A dynamic network traffic control method and system based on pre-training
By constructing discrete dependency graphs and spatio-temporal graphs, and using pre-trained models to extract feature representations, the accuracy problem of dynamic network traffic prediction is solved and long-term accurate prediction effects are achieved in highly dynamic network environments.
Patent Information
- Application Number
- CN202311652833.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-01
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2043-12-01
AI Technical Summary
It is difficult to achieve long-term accurate prediction of dynamic network traffic with existing technology, especially in highly dynamic network environments. Traditional time series prediction methods ignore spatiotemporal correlation. Spatiotemporal graph neural networks rely on long-term historical data, and the generation of adversarial models is difficult in complex environments. The spatiotemporal data is unstable.
A dynamic network traffic control method based on pre-training is used to obtain historical time series data, divide it into multiple time series segments, construct discrete dependency graphs and spatio-temporal graphs, use the pre-training model to extract potential feature representations, and update the feature representations of central nodes. to make future traffic predictions.
It achieves long-term accurate prediction of dynamic network traffic, improves prediction accuracy and stability, and is suitable for highly dynamic network environments.
Smart Images

Figure CN117675615B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information technology, and in particular to a pre-training-based dynamic network traffic control method and system thereof. Background Art
[0002] With the rapid development of cloud computing, Internet of Vehicles, and Web3.0 blockchain distributed networks, the types and number of new services have increased dramatically. Problems such as reduced quality of service (QoS) and reduced network stability caused by insufficient monitoring of network indicators often occur. How to reasonably schedule network traffic to avoid network congestion, thereby improving network resource utilization and ensuring user experience quality has become an increasingly important issue in the network field. One of the main challenges of traffic prediction is the long-term unpredictability of network traffic. In addition, the high spatial dynamics brought by blockchain networks, Internet of Vehicles, and satellite networks increase the difficulty of accurate network prediction and timely suppression of congestion. High dynamics is an important factor that limits the performance improvement of some network systems, and accurate prediction of network dynamic changes can provide effective support for relevant decisions on network infrastructure. Software Defined Network (SDN) separates the control layer and the data layer. The control layer can uniformly allocate network resources from a global perspective. Network managers can formulate various strategies at the control layer to ensure stable and efficient operation of the network. SDN network controllers are also gradually developing towards clustering, with more powerful computing power to support large-model working modes. The underlying data transmission plane of SDN is also expanding to wider network boundaries, such as delay-sensitive networks, blockchain Internet web3.0 networks, etc. As the most promising technology for optimizing network resource management in the future, it is increasingly being used in scenarios with high network performance, such as Data Center Network (DCN).
[0003] On the other hand, artificial intelligence technology is changing with each passing day. Using deep learning to achieve network traffic prediction is a new research direction, which can effectively improve the performance and reliability of the network. At present, there are three main types of network traffic prediction technologies using deep learning technology: the first is to directly treat traffic data as time series data, ignoring the spatiotemporal correlation of traffic data, and directly using the time series prediction method for prediction. Its prediction accuracy in a dynamic network environment will inevitably be affected; the second method considers the spatiotemporal characteristics of traffic data. In recent years, spatiotemporal graph neural network (STGNN) has become a popular method for multivariate time series (MTS) prediction. By jointly modeling the spatiotemporal pattern of MTS through graph neural network and sequence model, the prediction accuracy is significantly improved. However, the representation of time series and the spatial dependency between them need to be analyzed based on long-term historical data, which is unrealistic for cold start problems such as new links in the network; the third method further considers the scarcity of spatiotemporal data and uses the generative adversarial model (GAN) for data generation and prediction. Compared with other generative models, the competitive method of GAN no longer requires a hypothetical data distribution, but directly samples using a distribution, so that it can truly achieve theoretical approximation to real data. However, for complex data such as spatiotemporal data, this method based on simple GAN that does not require pre-modeling is too free and uncontrollable, and the model training is unstable and prone to failure.
[0004] Therefore, it is necessary to improve the prior art. Summary of the invention
[0005] The main technical problem solved by the present invention is to provide a dynamic network traffic control method and system based on pre-training, aiming to achieve long-term accurate prediction of dynamic network traffic.
[0006] According to the first aspect, an embodiment provides a method for dynamic network traffic control based on pre-training. The method includes:
[0007] Acquire historical time series data from the network, and segment the historical time series data to obtain multiple time series segments;
[0008] Input the time series segment into the trained prediction model,
[0009] The prediction model is used to:
[0010] obtaining a latent feature representation of the time series segment;
[0011] constructing a discrete dependency graph based on the time series segments and the latent feature representation;
[0012] constructing a spatiotemporal graph based on the discrete dependency graph and the latest time series segment among the time series segments;
[0013] Based on the potential feature representation of the latest time series segment and the spatiotemporal graph, a future time series segment is predicted to obtain a corresponding prediction result; wherein the future time series segment is located in the next time period of the latest time series segment in the time series segments.
[0014] In one embodiment, the constructing a discrete dependency graph based on the time series segments and the latent feature representation includes:
[0015] The step of feature-based node representation: taking each of the time series segments as a node of the discrete dependency graph, and representing the potential features corresponding to the time series segments as feature vectors corresponding to the node;
[0016] Creating an initial adjacency matrix; wherein the dimension of the adjacency matrix is the number of nodes multiplied by the number of nodes, the adjacency matrix is used to represent the connection relationship between each of the nodes, and the number of nodes represents the total number of nodes in the discrete dependency graph;
[0017] The step of automatically constructing a connection relationship: for each of the nodes, calculate the K nodes that are the nearest neighbors of the node, and use the K nodes that are the nearest neighbors of the node as the neighbor nodes of the node in the discrete dependency graph; determine the connection weights between the nodes according to the similarities between the nodes in the discrete dependency graph; for each of the nodes, connect the node to the K nodes that are the nearest neighbors of the node according to the corresponding connection weights;
[0018] The above-mentioned step of automatically building connection relationships is repeated until each of the nodes is connected, so as to obtain the discrete dependency graph.
[0019] In one embodiment, the step of constructing a spatiotemporal graph based on the discrete dependency graph and the latest time series segment in the time series segments includes:
[0020] Taking the latest time series segment among the time series segments as the central node of the discrete dependency graph;
[0021] Calculating the correlation between the central node and the non-latest time series segment; wherein the correlation is characterized by a corresponding similarity metric; wherein the non-latest time series segment is a time series segment other than the latest time series segment in the time series segment;
[0022] Selecting a preset number of the time series segments having the highest correlation with the central node from the non-latest time series segments as neighbor nodes of the central node;
[0023] The central node and neighboring nodes of the central node are connected to each other to form the space-time graph; wherein the space-time graph represents the space-time dependency relationship between the central node and the preset number of time series segments.
[0024] In one embodiment, the prediction model is also used to: update the potential feature representation of the central node of the space-time graph based on information collected from the neighboring nodes of the space-time graph; predict the future time series segments based on the potential feature representation of the latest time series segments and the updated space-time graph to obtain corresponding prediction results.
[0025] In one embodiment, the updating of the potential feature representation of the central node of the space-time graph according to the information collected from the neighboring nodes of the space-time graph includes:
[0026] Collecting feature vectors corresponding to the neighbor nodes from the neighbor nodes in the space-time graph;
[0027] Aggregating the feature vectors collected from different neighboring nodes to generate a new potential feature representation of the central node;
[0028] Inputting the new latent feature representation into a nonlinear activation function to obtain the new latent feature representation after nonlinear transformation;
[0029] The new latent feature representation after the nonlinear transformation is used to replace the original latent feature representation of the central node.
[0030] In one embodiment, the above-mentioned dynamic network traffic control method further includes: controlling the network according to the corresponding prediction result;
[0031] In one embodiment, the above-mentioned dynamic network traffic control method further includes:
[0032] Monitoring the total time used by the prediction model to perform the prediction and obtain the corresponding prediction result; wherein, if the total time is greater than the time corresponding to the range of future time steps that can be predicted by the prediction model, immediately stopping the prediction work of the prediction model;
[0033] In one embodiment, the above-mentioned dynamic network traffic regulation method also includes: if the accuracy of the corresponding prediction result is lower than a preset accuracy threshold, the prediction work of the prediction model is immediately stopped.
[0034] According to the second aspect, an embodiment provides a pre-training-based dynamic network traffic control system. The system includes:
[0035] A prediction module is configured to obtain historical time series data from a network and segment the historical time series data to obtain a plurality of time series segments;
[0036] Inputting the time series segment into the trained prediction model to predict the future time series segment through the trained prediction model to obtain corresponding prediction results;
[0037] Wherein, the future time series segment is located in the next time period of the latest time series segment among the time series segments;
[0038] Wherein, the prediction model includes an encoder, a graph structure learning submodule and a second decoder;
[0039] The encoder is extracted from a pre-trained model that has been pre-trained.
[0040] The encoder is used to obtain a latent feature representation of the time series segment;
[0041] The graph structure learning submodule is used to construct a discrete dependency graph based on the time series segments and the latent feature representation;
[0042] The second decoder includes a spatiotemporal graph neural network submodule and a regression prediction layer submodule;
[0043] The spatiotemporal graph neural network submodule is used to construct a spatiotemporal graph based on the discrete dependency graph and the latest time series segment in the time series segment, and to update the potential feature representation of the central node of the spatiotemporal graph according to the information collected from the neighbor nodes of the spatiotemporal graph;
[0044] The regression prediction layer submodule is used to predict future time series segments based on the potential feature representation of the latest time series segment and the pre-updated spatiotemporal graph or the updated spatiotemporal graph.
[0045] According to a third aspect, an embodiment provides a computer-readable storage medium, wherein the computer-readable storage medium includes a program, wherein the program can be executed by a processor to implement the dynamic network traffic control method as described in any embodiment of the present invention.
[0046] The beneficial effects of this application are:
[0047] The dynamic network traffic control method and system of the present application obtains historical time series data from the network, and obtains multiple time series segments based on the historical time series data; inputs the time series segments into a trained prediction model, and the prediction model is used to obtain the potential feature representation of the time series segments; constructs a discrete dependency graph based on the time series segments and the potential feature representation; constructs a spatiotemporal graph based on the discrete dependency graph and the latest time series segments in the time series segments; predicts future time series segments based on the potential feature representation of the latest time series segments and the spatiotemporal graph to obtain corresponding prediction results; wherein the future time series segments are located in the next time period of the latest time series segments in the time series segments. The dynamic network traffic control method and system provided by the present application can achieve long-term accurate prediction of dynamic network traffic. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 A schematic diagram of a flow chart of a dynamic network traffic control method based on pre-training according to an embodiment;
[0049] Figure 2 A schematic diagram of a module of a pre-training model of an embodiment;
[0050] Figure 3 A schematic diagram of a process for constructing a discrete dependency graph according to an embodiment;
[0051] Figure 4 A schematic diagram of a process of constructing a space-time graph according to an embodiment;
[0052] Figure 5 A schematic diagram of a process of updating a potential feature representation of a central node according to an embodiment;
[0053] Figure 6 A schematic diagram of a module of a prediction model of an embodiment;
[0054] Figure 7 A schematic diagram of a flow chart of a dynamic network traffic control method according to another embodiment;
[0055] Figure 8 A module diagram of a dynamic network traffic control system according to an embodiment. DETAILED DESCRIPTION
[0056] The present invention is further described in detail below by specific embodiments in conjunction with the accompanying drawings. Wherein similar elements in different embodiments adopt associated similar element numbers. In the following embodiments, many detailed descriptions are for making the present application better understood. However, those skilled in the art can easily recognize that some features can be omitted in different situations, or can be replaced by other elements, materials, methods. In some cases, some operations related to the present application are not shown or described in the specification, this is to avoid the core part of the present application being overwhelmed by too much description, and for those skilled in the art, it is not necessary to describe these related operations in detail, and they can fully understand the related operations according to the description in the specification and the general technical knowledge in the art.
[0057] In addition, the features, operations or characteristics described in the specification can be combined in any appropriate manner to form various implementations. At the same time, the steps or actions in the method description can also be interchanged or adjusted in a manner that is obvious to those skilled in the art. Therefore, the various sequences in the specification and the drawings are only for the purpose of clearly describing a certain embodiment and are not meant to be a required sequence, unless otherwise specified that a certain sequence must be followed.
[0058] The serial numbers of the components in this document, such as "first", "second", etc., are only used to distinguish the objects described and do not have any order or technical meaning. The "connection" and "coupling" mentioned in this application, unless otherwise specified, include direct and indirect connections (couplings).
[0059] The pre-training plus fine-tuning training paradigm in the field of natural language processing has been widely used and studied in recent years. This method can effectively improve the generalization ability and performance of the model by performing generative pre-training on a large-scale corpus and then fine-tuning on a specific task. In recent years, this pre-training plus fine-tuning training paradigm has also been gradually applied to the field of time series prediction. The data in time series prediction can be regarded as a sequence in time, similar to the sequence of words in a text. Therefore, the pre-training plus fine-tuning training paradigm in the field of natural language processing can be applied to time series prediction. For specific time series prediction tasks, fine-tuning is performed on the basis of the pre-trained model to improve the performance and generalization ability of the model. Many language pre-training models use a masked self-supervised training mechanism, which not only greatly reduces the labor cost of training, but also solves the scarcity of data to a certain extent.
[0060] The present application proposes a dynamic network traffic control method and system based on pre-training. The dynamic network traffic control method and system combines a spatiotemporal graph neural network and a self-supervised time series generation model (i.e., the pre-training model described below), and achieves accurate prediction of future multi-step traffic information of dynamic network traffic through long-term time series representation learning and fine-tuning training of the spatiotemporal graph neural network. Among them, the present application pre-trains a long period of network traffic time series data fragments in a self-supervised manner to achieve accurate multi-step time series generation, and modifies it on the basis of the pre-training model to achieve the downstream task of dynamic network traffic prediction with a lower training cost.
[0061] The technical solution of the present application will be described in detail below in conjunction with embodiments.
[0062] Please refer to Figure 1 , a dynamic network traffic control method based on pre-training, comprising:
[0063] Step S100: Acquire historical time series data from the network, and segment the historical time series data to obtain multiple time series segments;
[0064] Step S200: Input the time series segment into a trained prediction model, which is used to:
[0065] obtaining a latent feature representation of the time series segment;
[0066] constructing a discrete dependency graph based on the time series segments and the latent feature representation;
[0067] constructing a spatiotemporal graph based on the discrete dependency graph and the latest time series segment among the time series segments;
[0068] Based on the potential feature representation of the latest time series segment and the spatiotemporal graph, a future time series segment is predicted to obtain a corresponding prediction result; wherein the future time series segment is located in the next time period of the latest time series segment in the time series segments.
[0069] One purpose of constructing a spatiotemporal graph is to convert the spatiotemporal dependencies in historical time series data into a graph structure.
[0070] It should be noted that the above historical time series data are everywhere, from transportation, energy to economy. For example, in the intelligent transportation system, sensors deployed on the road network constantly record traffic conditions. For example, the total number of vehicles passing each sensor, the speed of the vehicles, etc. These massive data contain multiple time series, each of which comes from a traffic sensor. Similar examples also appear in the power system and financial system, such as the power consumption of multiple regions, the changes of multiple stock curves, etc. In addition, the specific process of "obtaining historical time series data from the network" belongs to the common knowledge in this field, so it will not be repeated here.
[0071] This application uses a framework called STEP (Spatial-Temporal graph neural networks are Enhanced by a Pre-training model), in which the spatial-temporal graph neural network is enhanced by a scalable time series pre-training model (i.e., the pre-training model in step S200). In some embodiments, please refer to Figure 2 , the pre-training model uses TSGPT (TSGPT is a generative pre-training model based on the encoder-decoder architecture and the self-attention mechanism, which uses a masked self-encoding mechanism to achieve self-supervised training without manual annotation), which aims to effectively learn temporal patterns from very long-term historical time series data and generate fragment-level representations (i.e., the above-mentioned potential feature representations). This fragment-level contains rich contextual information, which is conducive to solving the challenge that "the spatiotemporal graph neural network (STGNN) submodule has no perception of contextual information outside the window". In addition, the learned representations of these fragments can combine the information of the entire long-term historical time series data to calculate the correlation between time series fragments, thereby solving the challenge of "short-term information is unreliable for modeling discrete dependency graphs", that is, the challenge of lacking discrete dependency graphs. Among them, the discrete dependency graph is represented by the similarity (or correlation) between time series fragments. Among them, the present application uses an efficient, unsupervised pre-training model, which is trained by a masked automatic encoding strategy. The pre-trained model that has completed the training can effectively capture the information of very long-term historical data (such as weeks or months of data) and generate segment-level representations that correctly reflect the complex patterns in time series segments. The graph structure learning submodule based on the unsupervised pre-trained model representation used in this application learns discrete dependency graphs and uses kNN calculated based on the unsupervised pre-trained model representation as regularization to guide the joint training of the graph structure and spatiotemporal graph neural network (STGNN) submodules.
[0072] The training process of the prediction model in step S200 generally includes:
[0073] Step S1, segmenting and masking the historical time series data;
[0074] Step S2: construct a Transformer-based encoder;
[0075] Step S3: construct a first decoder based on Transformer;
[0076] Step S4, performing target reconstruction;
[0077] Step S5, selecting the encoder obtained in step S4;
[0078] Step S6, construct graph structure learning;
[0079] Step S7, constructing an enhanced downstream spatiotemporal graph neural network;
[0080] Step S8: training the prediction model to obtain the trained prediction model.
[0081] In some embodiments, for the above step S1, the training samples of the time series segments are obtained from an original ultra-long time series (i.e., the above historical time series data) using a sliding window. For example, the flow data of each node in the network at Th time points in the past period of time (such as the past two weeks) can be collected in real time by the SDN controller. Those skilled in the art can define and determine the above time point Th according to actual needs to determine the time point for collecting historical data.
[0082] In some embodiments, at each time point Th, the SDN sub-controller may collect data packet data related to each node in the network. The data includes total length, packet loss rate, controller memory load, and timestamp. The data is recorded to form a data point. The collected data points are organized into a sequence matrix S i (i.e. the above historical time series data). i Each row of represents a time point Th, and each column thereof may correspond to the total length of the above-mentioned data packet, packet loss rate, controller memory load and timestamp, respectively. The above-mentioned SDN sub-controller (i.e., SDN controller) is an application in software-defined networking (SDN) that is responsible for traffic control to ensure intelligent networks. The SDN controller is based on protocols such as OpenFlow, which allows servers to tell switches where to send data packets.
[0083] In some embodiments, those skilled in the art may determine the window length L and prediction time step Tf for data slicing according to actual needs, wherein the selection of Tf and L may be scheduled and controlled by the SDN sub-controller.
[0084] In some embodiments, the input historical time series data S i Divide into multiple time series segments of length L The above time series fragment The future time series segment with a time step length Tf and a sliding window length L is used to predict. The latest time series segment (i.e., the latest time series segment mentioned above) is retained as a validation set. Those skilled in the art can define the latest time series segment by themselves. For example, the time series segment located one hour before the current time point in the above time series segment is the latest time series segment.
[0085] In some embodiments, those skilled in the art can set the masking rate according to actual needs. For example, the masking rate can be set to 75%, that is, in each time series segment, about 75% of the data will be masked. Only a portion of the above data will be used to generate the output of the first decoder of the pre-trained model.
[0086] In some embodiments, in each of the above time series segments, a portion of data points can be randomly selected and masked according to the above mask rate. These data points will not be input into the prediction model (such as the second decoder and graph structure learning submodule of the prediction model), but will be used as the target of the self-supervision task.
[0087] In some embodiments, a self-supervised task can be created, where the goal of the pre-trained model is to generate data for the mask portion based on known segments.
[0088] In some embodiments, the above-mentioned time series fragments can be generated with a sliding window of size H+L. Among them, the data within the first H length is used to represent historical data, and the data within the last L length is used to represent future data, which respectively correspond to the input of the model in machine learning and the true value to be predicted (that is, the model inputs the first H part of the data and tries to predict the last L part of the data). Every time the time window slides, a time series fragment is generated. For example, the historical length of the historical time series data in the database is H=P*L, where L is the length to be predicted. That is, the time series fragments of the first P*L length are used as training samples, and the latest time series of L length are used as corresponding labels. The value of P here can be set by the user. For another example, the i-th time series in the above-mentioned historical time series data can be set as S i . Input sequence S i Divide into L non-overlapping segments of length P. The jth time series segment can be expressed as S j iL is the commonly used length of time series segments input to the spatiotemporal graph neural network (STGNN) submodule. Parts of non-overlapping segments are randomly masked (occluded) with a high mask rate r of 75% and then restored, creating a challenging self-supervised task.
[0089] In some embodiments, the encoder of the pre-trained model in the present application includes an input embedding layer and a multi-head sparse self-attention submodule (which includes a series of Transformer models with positional encoding). The encoder only operates on unmasked segments. For details, please refer to Figure 2 , the input embedding layer submodule is a linear projection that transforms the unmasked segments (i.e., unmasked segments) into the latent space: Where W and b are learnable parameters, d is the dimension of the latent space, is the input vector (i.e. each unmasked fragment), is the corresponding latent space representation. After that, the position encoding layer is used to add order information. For example, the position encoding layer can traverse the position encoding vector of each position i. A position encoding vector Upos is generated for each position i. The position encoding vector is usually generated using sine and cosine functions to capture the position information. The specific formula for generating the position encoding vector is: Among them, k represents the dimension of position encoding, d represents the dimension of latent space, and i represents the position index. Then, the above latent space can be represented as and the position encoding vector U pos Add the elements together to get a new vector. This new vector is used to represent the feature vector with position information added, that is, After that, the feature vector X with position information added with_position The input is sent to the multi-head sparse self-attention submodule composed of the Transformer model. The multi-head sparse self-attention submodule can include a 4-layer self-attention Transformer model. Finally, the input sequence is encoded by the multi-head sparse self-attention submodule, and the encoding is trained to obtain the jth unmasked segment (such as the time series segment Sj i )’s latent feature representation (i.e., temporal representation) Among them, the above-mentioned Transformer model is a neural network model based on the self-attention mechanism, which is used to process sequence data.
[0090] In some embodiments, the first decoder of the pre-trained model also includes a series of Transformer models (such as Figure 2The first decoder reconstructs the above latent feature representation back to a lower semantic level, i.e., digital level information. The first decoder operates on the complete set of fragments, including masked fragments. There is no need to add position vectors here, because all fragments have already added position information in the encoder. The first decoder is only used to perform sequence reconstruction tasks (i.e., the above target reconstruction) during the pre-training phase.
[0091] In some embodiments, the first decoder may use only a single-layer Transformer model. Finally, a multi-layer perceptron (such as the regression prediction layer in the pre-trained model) is applied for prediction, and the number of output dimensions is equal to the length of each time series segment. Specifically, the latent feature representation of a given segment j is The first decoder generates the corresponding reconstructed sequence
[0092] In some embodiments, the original sequence (i.e., the above-mentioned time series segment Sj) is calculated. i ) and reconstruct the sequence The mean absolute error (Mean-Absolute-Error) between: The above mean absolute error is used as the loss function of the target reconstruction step. Wherein, the above n represents the total number of data points, such as the number of data points used to calculate MAE; It represents the actual observed or true target value (actual value), that is, the actual flow data point in the data; Represents the prediction value generated by the first decoder, that is, the prediction value of the first decoder for the corresponding data point.
[0093] The encoder of the prediction module is the encoder in the pre-trained model that has been trained. The encoder of the pre-trained model can assist in learning the graph structure required by the spatiotemporal graph neural network (STGNN) submodule of the prediction model. The representation of the encoder of the pre-trained model can also be added to the spatiotemporal graph neural network (STGNN) submodule as super-long history information.
[0094] It should be noted that the graph structure learning submodule of this application is based on time series fragments (such as Sj above) i ) represents the latent feature H j i Constructing and time series segment Sj iThe specific process of the corresponding discrete dependency graph can refer to the following relevant content in paragraphs
[0063] to
[0072] of the Chinese patent document "Multivariate Time Series Prediction Method and System Based on Pre-training Enhancement" with publication number CN115688871: "The goal of the graph structure learning submodule is to learn a discrete sparse graph. Specifically, the above STEP framework expects to learn a Bernoulli distribution parameter Θij, from which a discrete dependency graph can be sampled. First, regularization is introduced based on the representation of TSFormer to provide supervision information for graph optimization. Specifically, first It is represented as the features of time series segment i, where || represents the concatenation operation. Then a kNN graph A is calculated between all nodes. a Here we can control the sparsity of the learning graph by setting different k. Benefiting from the ability of TSFormer, A a To reflect the dependencies between nodes, it helps guide the training of graph structure. Then, calculate Θ ij As follows: ij =FC(relu(FC(Z i ||Z j ))); Z i =relu(FC(H i ))+G i ; where Θ ij It is a non-normalized probability. The first dimension represents the probability of affirmation (i.e., there is a connection between time series), and the second dimension represents the probability of negation. i is the global feature of time series segment i, which is obtained by the convolutional network Get, where S train i The entire training set time series, L train is the length of the training dataset. S train i It is static for all samples during training, which helps make the training process more robust and accurate. i It is dynamic for different training samples to reflect the dynamics of the dependency graph. Therefore, the present invention uses Θ and kNN graph A a The cross entropy between is used as graph structure regularization:
[0095]
[0096] where Θ' ij =softmax(Θ ij ) is the normalized probability. The last problem of discrete graph structure learning is to ij The sampling operation to the adjacent matrix A is not differentiable. Therefore, the Gumbel-Softmax reparameterization technique is applied in STEP: A ij=softmax((Θ ij +g) / τ); where g is independent and identically distributed data drawn from the Gumbel(0,1) distribution. τ is the temperature parameter of softmax. When τ→0, Gumbel-Softmax converges to a discrete state.
[0097] In some embodiments, the traffic data at the latest time point may be selected from the traffic data of each network node collected in real time by the aforementioned SDN controller over a period of time (such as the past two weeks), for example, data one hour before the current time point.
[0098] It should be noted that discrete dependency graphs are used to capture the spatial dependencies between nodes in a time series segment. For example, the connection relationship between nodes: the edges in the discrete dependency graph indicate whether there is a connection or dependency between different nodes (if there is an edge between two nodes, there may be some association or interaction between them); for another example, the strength of the dependency: the weight of the edge can indicate the strength or weight of the dependency between nodes (which helps to quantify the degree of mutual influence between nodes); for another example, the network structure: the topological structure of the graph can provide information about how the nodes are organized and connected (which helps to understand the overall structure of the system); for another example, local and global dependencies: by analyzing the discrete dependency graph, you can understand which nodes are more susceptible to the influence of other nodes and which nodes play a key role in the entire network; for another example, time correlation: if the time factor in the time series segment is also taken into account, the discrete dependency graph can also help understand how the nodes change over time and whether there are time-related dependencies.
[0099] It should be noted that a discrete dependency graph is a graph structure used to represent the dependency relationship between nodes. In this graph, each node represents the representation of a time series segment, and the edges in the graph represent the dependency or association between different time series segments. The purpose of constructing a discrete dependency graph is to help understand the relationship between nodes in a time series segment for further analysis, prediction or control. Among them, all "nodes" refer to all time series segments in the time series data. Each time series segment corresponds to a node, where the representation of the node is usually a feature representation of the time series segment. These node sets constitute the node set of the discrete dependency graph.
[0100] Please refer to Figure 3 , the above is based on the time series segment Sj i and the latent feature representation H j i Construct discrete dependency graphs, including:
[0101] Step S21 of feature-based node representation: transform each time series segment Sj iAs a node in the discrete dependency graph, it will be associated with the time series segment Sj i The corresponding latent feature representation H j i as the feature vector corresponding to the node;
[0102] Step S22: creating an initial adjacency matrix Aa; wherein the dimension of the adjacency matrix Aa is the number of nodes multiplied by the number of nodes, the adjacency matrix Aa is used to represent the connection relationship between the nodes, and the number of nodes represents the total number of nodes in the discrete dependency graph;
[0103] Step S23 of automatically constructing a connection relationship: for each node, calculate the K nodes that are the nearest neighbors of the node, and use the K nodes that are the nearest neighbors of the node as the neighbor nodes of the node in the discrete dependency graph; determine the connection weights between the nodes according to the similarities between the nodes in the discrete dependency graph; for each node, connect the node to the K nodes that are the nearest neighbors of the node according to the corresponding connection weights;
[0104] Step S24: Repeat the above step S23 of automatically building a connection relationship until each node is connected to obtain a discrete dependency graph.
[0105] The adjacency matrix Aa is used to represent the connection relationship between nodes. Each element Aa[i][j] of the adjacency matrix indicates whether there is a connection or dependency relationship between node i and node j. The adjacency matrix is usually a binary matrix, in which the value of Aa[i][j] can be 0 or 1, indicating no connection or existence of connection, respectively.
[0106] In some embodiments, in the above-mentioned step S23 of automatically constructing the connection relationship, the measurement value (i.e., the corresponding connection weight) can be filled into the corresponding position of the adjacency matrix Aa, and then the dependency relationship between each node is reflected through the adjacency matrix Aa. For example, for node i and node j, if node j belongs to one of the k nearest neighbor nodes of node i, then the corresponding element Aa[i][j] in the above-mentioned adjacency matrix is 1; otherwise, the corresponding element Aa[i][j] in the above-mentioned adjacency matrix is 0. Among them, the specific process of calculating the K nodes nearest to the node calculated above (such as obtained by using the above-mentioned KNN algorithm) belongs to the prior art in this field, so it will not be repeated here. KNN (k-NearestNeighbor, i.e., k nearest neighbor algorithm) is an existing commonly used supervised learning method.
[0107] In some embodiments, in the above-mentioned step S23 of automatically constructing a connection relationship, the "similarity" in the above-mentioned "based on the similarity between each node in the discrete dependency graph" can be characterized by cosine similarity. Therefore, the above-mentioned corresponding connection weight can be determined by the cosine similarity between the node and one of the K nodes. The above-mentioned connection weight can be determined by a binarization method. For example, if the above-mentioned cosine similarity is higher than a preset threshold, the corresponding connection weight is set to 1; otherwise, the corresponding connection weight is set to 0. Among them, those skilled in the art can determine the specific value of the above-mentioned preset threshold according to actual needs, and the above-mentioned preset threshold is not limited here.
[0108] It can be seen that in the above-mentioned feature-based node representation step S21, each time series segment Sj i are all regarded as a node in the discrete dependency graph and have a corresponding feature vector, so that each node can be used to represent the potential feature representation of the corresponding time series segment, so as to better capture the information of the time series segment; the above-mentioned step S23 of automatically constructing the connection relationship constructs a discrete dependency graph by calculating the cosine similarity between each node and selecting the K nearest nodes of a node, so as to automatically construct the connection relationship between each node without manual definition, thereby improving the representation quality of the data; Capture of spatial dependency relationship: Since the connection relationship between each node is determined by the cosine similarity between each node, the spatial dependency relationship between the nodes can be better captured, which helps to improve the analysis and Understanding; Adjustable connection weights: In some embodiments, a binarization method is used to determine the above-mentioned connection weights, so that technical personnel in this field can adjust the weights of the above-mentioned corresponding connections according to actual needs, so as to better meet different data analysis needs; Efficiency and automation: By automatically constructing the connection relationship between each node (i.e., the above-mentioned step S23 of automatically constructing the connection relationship), the efficiency of the analysis process is improved, and the need for manual intervention is reduced, thereby making the processing of time series data more automated; In summary, the above-mentioned steps of constructing a discrete dependency graph have technical advantages such as better feature representation, capturing spatial dependency relationships, automatic construction of connection relationships, and adjustable weights, which help to improve the analysis and characterization quality of spatiotemporal data.
[0109] In some embodiments, all time series segments Sj corresponding to the historical time series segments may be i Potential characterization of The graph structure learning submodule is input to train the graph structure learning submodule.
[0110] In some embodiments, the connection mode between nodes can be determined based on the relationship between time series segments, and the connection can be determined by calculating cosine similarity.
[0111] It should be noted that the above “relationship between time series segments” refers to the temporal relationship between different time series segments. For example, the relationship between two time series segments may be that the data trends are similar in a certain time period. The above “connection method between nodes” refers to the method of determining which nodes should be connected when building a node dependency graph. Measuring the similarity between nodes based on cosine similarity refers to calculating the representation of the time series segments corresponding to each pair of nodes. Among them, cosine similarity is a commonly used similarity measure, which measures the cosine value of the angle between two vectors. For example, if the corresponding cosine similarity is higher than a preset threshold, then it can be considered that there is a connection between the nodes, otherwise there is no connection. For another example, suppose there are multiple sensor nodes in a network, and each node records temperature data for different time periods. In order to construct a discrete dependency graph, the cosine similarity between the temperature data (i.e., time series fragments) of each pair of nodes can be calculated. If the cosine similarity is higher than the preset threshold, the two nodes can be connected, indicating that they have similarities in temperature changes.
[0112] In some embodiments, K nearest neighbors (KNN) are calculated for all nodes in a discrete dependency graph: for each node, the K nodes closest to it are calculated as a time interval distance metric.
[0113] It should be noted that the above-mentioned "time interval distance metric" involves how to calculate the distance between nodes to determine the connection between them. Here, it refers to the distance measurement method used to calculate the connection between nodes. Specifically, it includes the time interval or time difference between nodes. For example, you can consider using the timestamp between two nodes to calculate the time difference between them, which can be used as a distance metric. The K nearest neighbor (KNN) method is a method that uses the time interval distance metric to determine the connection between nodes. It finds the closest K nodes to each node, and these closest nodes are considered to be connected to the target node.
[0114] In some embodiments, a spatiotemporal graph neural network submodule may be used to extract the latest time series segments. Characterization It can effectively encode and represent time series fragments, thereby better understanding and processing the spatiotemporal information in time series data. Used to characterize the latest time series segment The above characterization These features can be included, that is, these features can be represented in a more abstract way. The spatiotemporal graph neural network model, namely graph convolution (GCN), can perform graph structure learning to process spatiotemporal graph data.
[0115] In some embodiments, only the traffic data of the last time series segment of each node (i.e., the latest time series segment mentioned above) can be input into the fine-tuning learning architecture of the spatiotemporal graph neural network (STGNN) submodule and trained to obtain the corresponding spatial dependency relationship.
[0116] It should be noted that the use of the traffic data of the latest time series fragments to the fine-tuned learning architecture of the space-time graph neural network (STGNN) submodule and training can quickly respond to data changes while reducing overhead and not requiring the processing of large amounts of historical data. Here, instead of directly using the existing untrained space-time graph neural network (STGNN) submodule, a fine-tuned and improved version model based on the STGNN model (i.e., the fine-tuned learning architecture mentioned above) is used.
[0117] It should be noted that the above-mentioned "space-time graph neural network submodule" is used to analyze and process the space-time relationship in the time series fragment. In particular, it uses the latest time series fragment as the central node to build a space-time graph, and then uses neural network technology to analyze and model this space-time graph. In this application, it uses the latest time series fragment as the central node to build a space-time graph in order to better understand and process the space-time information in the time series fragment.
[0118] It should be noted that the main purpose of constructing a spatiotemporal graph is to convert the spatiotemporal relationship in the time series fragment into a graph structure so as to better understand, represent and analyze the data. This can provide more powerful tools and methods for various spatiotemporal related tasks. Among them, when constructing a spatiotemporal graph, the connection relationship between nodes and the information between neighbor nodes can be used to learn more advanced feature representations. This helps to improve the feature representation of the data to improve the performance of subsequent tasks. In addition, based on the constructed spatiotemporal graph, various tasks can also be performed, such as prediction of time series fragments, anomaly detection, analysis, data clustering, etc. The spatiotemporal graph can provide richer information to support the above tasks.
[0119] Please refer to Figure 4 , based on discrete dependency graphs and time series segments Sj i The latest time series fragments in the construction of space-time graphs, including:
[0120] Step S30: Transform the time series segment Sj into i The latest time series snippet in Acts as the central node of a discrete dependency graph;
[0121] Step S31: Calculate the correlation between the central node and the non-latest time series segment; wherein the correlation is characterized by a corresponding similarity metric; the non-latest time series segment is the time series segment Sj i Except for the latest time series segment Other time series segments;
[0122] Step S32: selecting a preset number of the time series segments with the highest correlation with the central node from the non-latest time series segments as neighbor nodes of the central node;
[0123] Step S33: The central node and the neighboring nodes of the central node are connected to each other to form a space-time graph; wherein the space-time graph represents the space-time dependency relationship between the central node and a preset number of time series segments.
[0124] In some embodiments, the central node and the time series segment Sj are used in the above step S31. i Remove the latest time series segment The above correlation is characterized by the cosine similarity between the time series segments other than . The calculation of cosine similarity belongs to the prior art in this field, so the specific calculation of cosine similarity will not be repeated.
[0125] In some embodiments, the latest time series segment S P i As the central node of the space-time graph, the latest time series segment S is represented by the initial discrete dependency graph. P i Find its neighbor nodes in the discrete dependency graph, which together with the central node form a spatiotemporal graph.
[0126] It can be seen that the above-mentioned dynamic central node selection (i.e., step S30) is a technical means that allows the latest time series segment to be selected from the time series data as the central node of the discrete dependency graph. This means that the discrete dependency graph of the present application is dynamic, that is, it can select different central nodes according to different times to adapt to different data changes and needs; the above-mentioned automatic construction of neighbor nodes (i.e., steps S31 to S32) is a technical means that automatically constructs neighbor nodes by calculating the correlation and setting thresholds. This helps to identify time series segments related to the central node without the need to manually define neighbor nodes. The above-mentioned technical means of capturing spatiotemporal dependencies (i.e., step S33) constructs a spatiotemporal graph by connecting the central node and its neighbor nodes, and the constructed spatiotemporal graph helps to represent the spatiotemporal dependencies between the central node and its related time series segments (for example, it helps to capture the latest time series segment S P iThis helps to better understand and analyze the correlations in time series data.
[0127] In some embodiments, the representation of the latest time sequence segment may be used as an input feature corresponding to the central node, wherein the representation of the latest time sequence segment may include a feature vector of the segment.
[0128] It can be seen that the above-mentioned technical means of "using the representation of the latest time series segment as the input feature corresponding to the central node" indicates that the spatiotemporal graph of the present application can provide personalized feature representation to better reflect the characteristics and information of the time series segment.
[0129] In some embodiments, the connection relationship and weight of the constructed spatiotemporal graph can be integrated with the feature vector of the central node to form input data. Afterwards, the input data is input into the above-mentioned regression prediction layer submodule.
[0130] It can be seen that the above-mentioned technical means of "integrating to form input data" can integrate the connection relationship and weight of the spatiotemporal graph with the feature vector of the central node to form input data. This provides a comprehensive data representation, including spatiotemporal dependencies and feature information, which is helpful for subsequent analysis and modeling. In summary, the above steps provide technical effects such as dynamic central node selection, automatic construction of neighbor nodes, capture of spatiotemporal dependencies, personalized feature representation, and integration to form input data. These technical effects help improve the representation and analysis quality of time series data, making it more suitable for modeling and analysis of spatiotemporal data.
[0131] In some embodiments, the prediction model is also used to: update the potential feature representation of the central node of the space-time graph based on the information collected from the neighboring nodes of the space-time graph; predict the future time series segments based on the potential feature representation of the latest time series segment and the updated space-time graph to obtain the corresponding prediction results. Please refer to Figure 5 , the above-mentioned updating of the potential feature representation of the central node of the spatiotemporal graph according to the information collected from the neighboring nodes of the spatiotemporal graph includes:
[0132] Step S40: collecting feature vectors corresponding to neighbor nodes from neighbor nodes in the space-time graph;
[0133] Step S41: Aggregate the feature vectors collected from different neighboring nodes to generate a new potential feature representation of the central node;
[0134] Step S42: inputting the new latent feature representation into a nonlinear activation function to obtain a new latent feature representation after nonlinear transformation;
[0135] Step S43: Using the new latent feature representation after nonlinear transformation to replace the original latent feature representation of the central node.
[0136] In some embodiments, before the potential feature representation of the central node of the spatiotemporal graph is updated, the potential feature representation of the central node can be initialized. For example, the potential feature representation of the central node can be initialized to the original feature vector or other representation of the central node. Those skilled in the art can determine the above other representations according to actual needs. Afterwards, by considering the relationship between the central node and its neighboring nodes, relevant information is collected from the neighboring nodes to update the potential feature representation of the central node.
[0137] In some embodiments, the aggregation method in the above step S41 includes: weighted average, summation or average value.
[0138] It can be seen that the above specific method of initializing the potential feature representation of the central node means that different methods can be used to initialize the potential feature representation of the central node, for example, including using the original feature vector or other types of representations.
[0139] It can be seen that through the above-mentioned information propagation step (i.e., step S40), information can be effectively collected from each neighbor node, for example, by weighted averaging the potential feature representations of neighbor nodes, where the weights are usually calculated based on the connection strength or other similarity metrics. This helps to better propagate information and features; the above-mentioned feature aggregation step (i.e., step S41) describes the information aggregation process, including element-level weighted average, summary function or other task-specific aggregation methods, which helps to generate a new potential feature representation of the central node, containing information of neighbor nodes; the above-mentioned nonlinear transformation step (i.e., step S42) introduces nonlinear transformation, by passing the new potential feature representation to a nonlinear activation function to better capture the complex patterns and dependencies in the data. This helps to improve the expressive power of the representation; the above-mentioned feature update step (i.e., step S43) assigns the new potential feature representation after nonlinear transformation to the central node to replace the original potential feature representation of the central node, which means that the feature representation of the central node will include information about itself and neighbor nodes, thereby improving the information richness of the feature; in summary, through the above-mentioned steps S40 to S43, effective information aggregation can be achieved. This includes collecting information from neighboring nodes, weighted averaging the feature representations of neighboring nodes, and applying nonlinear transformations. In general, according to the above steps, technical effects such as effective feature representation initialization, information aggregation and propagation, nonlinear transformation, and feature updating can be achieved, which helps to improve the representation and analysis capabilities of spatiotemporal data, thereby better capturing the associations and patterns in the data.
[0140] It should be noted that the above-mentioned "updating the latent feature representation of the central node of the space-time graph based on the information collected from the neighboring nodes of the space-time graph" helps to capture the spatial dependencies of the latest time series fragments. For example, suppose there is a city's traffic network, each node represents an intersection, and each node has a feature representation (such as the above-mentioned latent feature representation), where the feature representation includes information such as traffic flow, vehicle speed, and congestion at the intersection. If you want to analyze how traffic flow propagates in the city to predict future traffic conditions. In this scenario, the above-mentioned "spatial dependency" may refer to the situation where traffic flow at different intersections affects each other. For example, the traffic flow at an intersection may be affected by the traffic flow at adjacent intersections. If an intersection is congested, the intersections near it may be affected by traffic congestion. Among them, suppose there is a central node V i , which has an initial feature representation X i , and a set of neighbor nodes N i , they also have their own characteristic representation X j , where j belongs to N i In some embodiments, a neural network layer may be used to update the feature representation of the central node as follows: i '=f(X i , X j , for j belongs to Ni), where f is a function or a neural network layer that transforms the central node V i and its neighbor node feature representation X j Combined together, generate the updated feature representation X i '. This updated feature representation X i 'Will better capture the central node V i spatial dependencies.
[0141] It should be noted that the purpose of end-to-end training of the above-mentioned spatiotemporal graph neural network submodule is to optimize the parameters of the model by jointly training the entire spatiotemporal graph neural network submodule to make it better suited to the task. This task includes spatiotemporal relationship modeling and prediction. End-to-end training helps the model learn more meaningful representations from the data to improve task performance. Among them, the latest time series fragment Characterization It refers to the representation of the latest time series fragment of each node i. It can include the characteristics of the node and other information related to the latest time series fragment. It is the representation of the latest state of the node. Characterization The corresponding dependency representation H gw It refers to the representation of node dependency information. Dependency information refers to the relationship between a node and its neighboring nodes or other related nodes, which involve temporal and spatial dependencies. That is, Hgw Information used to represent these dependencies.
[0142] It should be noted that the latest fragment representation Hp of each node and its corresponding dependency representation H gw The purpose of fusion is to combine the latest state of the node (Hp) with the information of its dependencies (H gw ) to obtain a more comprehensive and informative node representation. This helps the model better understand the time series fragments of the node, including its spatiotemporal relationships with other nodes, thereby improving the performance of the model in the task.
[0143] In some embodiments, a semantic projector SP can be introduced to convert the latest segment representation Hp into the semantic space of the dependency graph representation Hgw, and Hp is projected through training learning to form a merged matrix H final :H final =SP(Hp)+Hgw. Finally, please refer to Figure 6 , prediction is performed through the regression prediction layer submodule: Given the future real value Y∈R TxNxd , using mean absolute error as regression loss.
[0144] It should be noted that the main function of the above “introducing a semantic projector SP” is to transform the latest segment representation Hp from its original representation space to the dependency graph representation H gw The semantic space of the above "converting the latest fragment representation Hp to the semantic space of the dependency graph representation Hgw" is roughly as follows: First, a projection transformation matrix needs to be defined, which will be used to map Hp from its original representation space to the semantic space; wherein, this matrix can be a learnable parameter of the model, learned through the training process; 2) Learning the projection transformation matrix: During the training process, the model will learn how to adjust the weights of the projection transformation matrix to maximize the retention of useful information of Hp and map it to the semantic space; this is usually done by minimizing the loss function, and the design of the loss function can be determined according to the task requirements; 3) Applying the projection transformation: Once the projection transformation matrix is learned, the latest fragment representation Hp can be transformed through this matrix; this transformation can be done using matrix multiplication: H final =SP(Hp)+H gw ; Among them, SP stands for semantic projector, H final is the transformed latest fragment representation, and Hp is the original latest fragment representation.
[0145] It should be noted that the above merged matrix H finalThe specific process belongs to the prior art in this field. For example, you can refer to the following content in paragraph
[0077] of the Chinese patent document "Multivariate Time Series Prediction Method and System Based on Pre-training Enhancement" with publication number CN115688871: "The conventional spatiotemporal graph neural network (STGNN) submodule takes the last segment (such as the latest time series segment mentioned above) and the discrete dependency graph as input, while the enhanced spatiotemporal graph neural network (STGNN) submodule also considers the representation of the input segment. Since the Transformer model has a strong ability in extracting long-term dependencies, the above representation Contains rich contextual information. The STEP framework can be extended to almost any STGNN. Here, an existing method is used as the backend model, namely Graph WaveNet. Graph WaveNet effectively captures spatiotemporal dependencies by combining graph convolution with dilated random convolution. It is based on the potential hidden representation H of its output gw ∈R Nxd The prediction is made through a regression prediction layer (e.g. a multi-layer perceptron). The Transformer model representation H of the last segment P of all nodes i i P It can be combined and expressed as: H P ∈R Nxd , the representations of Graph WaveNet and TSFormer are fused in the following way:
[0146] H final =SP(H P )+Hgw
[0147] Where SP(·) is the i P Convert to H gw The semantic projector of the semantic space (for example, implemented by a multi-layer perceptron). Finally, the prediction is made through the regression prediction layer: Given the future real value Y∈R TxNxd Use mean absolute error as regression loss:
[0148] Where N is the number of nodes, T is the number of prediction steps, and C is the dimensionality of the output."
[0149] The spatiotemporal graph neural network (STGNN) submodule and the graph structure learning submodule are trained in an end-to-end manner. The total loss function L of the spatiotemporal graph neural network (STGNN) submodule and the graph structure learning submodule can be expressed as:
[0150] L=L regression +λL graph ,
[0151] Among them, λL graph is a gradually decaying graph regularization term. The graph regularization term λ is set to gradually decay during the training process to surpass the kNN graph. Among them, the above graph regularization term L graph Used to constrain the learning of the model to better capture the correlation between data points. λ is a hyperparameter that adjusts the weight of the graph regularization term. The graph regularization term may be gradually decayed, which means that during the training process, the value of λ will gradually decrease, allowing the model to be more constrained by graph regularization at the beginning, and then gradually reduce the constraints as training progresses, so that the model gradually focuses more on the regression task. The introduction of the graph regularization term is used to capture the correlation between data.
[0152] It should be noted that the above-mentioned "capturing the correlation between data" means that the model attempts to understand and learn the association or correlation between different data points. For example, time correlation in time series data: For time series data, there may be time correlation between data points at different time points. The model can try to capture this time correlation to better predict future data points; for another example, node correlation in graph data: In graph data, there may be node correlation between data points at different nodes. For example, there may be relationships between users in a social network, or in a traffic network, the traffic between different intersections may affect each other. The model can also try to capture this node correlation to better understand network data.
[0153] It should be noted that the above-mentioned "introduction of graph regularization term" usually refers to adding a regularization term (usually a regularization term based on the graph structure) to constrain the learning of the model when training a machine learning model, so as to better capture the correlation between data points. Specifically, a graph structure between the data can be defined, in which nodes represent data points and edges represent the association between data. This can be a pre-defined graph structure or it can be automatically constructed from the data. After that, a regularization term related to the graph structure needs to be defined, usually called a graph regularization term. This regularization term is usually based on similarity, connectivity or other correlation measures between nodes. A common example is the Laplace regularization term. After that, the graph regularization term is added to the loss function of the model, and then the model will not only try to fit the data during training, but will also be constrained by the regularization term to better capture the correlation between data points.
[0154] In some embodiments, stochastic gradient descent (SGD) can be used to train the spatiotemporal graph neural network (STGNN) submodule and the graph structure learning submodule to minimize the above-mentioned total loss function L. For example, the gradient is propagated from the total loss function back to the model parameters to update the parameters. Multiple iterations are performed on the training data, and the model parameters are continuously adjusted so that the prediction results gradually approach the actual traffic value. Among them, the specific process of training the spatiotemporal graph neural network (STGNN) submodule and the graph structure learning submodule belongs to the prior art in this field, so it will not be repeated here.
[0155] In some embodiments, the time series segment corresponding to the retained validation set can be input into the regression prediction layer to predict the traffic data of the next time series segment Tf time steps of each node. This belongs to the aforementioned stage of "adopting the traffic data of the latest time series segment to the fine-tuning learning architecture of the spatiotemporal graph neural network (STGNN) submodule and training" (i.e., the regression prediction and continuous fine-tuning stage). The regression prediction and continuous fine-tuning stage here can also include: initializing the parameters of the pre-trained model, and using the parameters of the pre-trained model to initialize the regression model; preparing a training data set with labels, collecting a training data set with real traffic value labels, and ensuring that each sample has a corresponding real value of the traffic segment at the future time Tf; using the SDN sub-controller for scheduling and regulation, monitoring whether the total time used by the prediction model to predict and obtain the corresponding prediction result is less than the time corresponding to the range of future time steps that the prediction model can predict (such as the prediction range of the Tf step sliding window); if the above total time is greater than the time corresponding to the range of future time steps that the prediction model can predict, then immediately stop the prediction work of the prediction model; or, if the accuracy of the corresponding prediction result is lower than the preset accuracy threshold, then immediately stop the prediction work of the prediction model and retrain the prediction model. Among them, the above "prediction range of the Tf step sliding window" refers to a window in the time series segment, which contains the range of future time steps predicted by the model. The size of this window is determined by the parameter Tf, which represents the number of future time steps to be predicted. For example, if Tf = 24, then the "forecast range of the Tf-step sliding window" means that the model is predicting data for the next 24 time steps. This window will start from the current time step and cover the data points of the next 24 time steps. The model will try to predict the data values in the time range from the current time step to 24 time steps later.
[0156] It should be noted that the above-mentioned "parameters of the pre-trained model" include the weights, biases and other learnable parameters of the model, which are learned in the pre-training stage and are used to capture the general characteristics of the input data. The above-mentioned "regression model" refers to a model used for regression tasks (such as the regression prediction layer submodule of the prediction model), which usually includes one or more neural network layers. The goal of the regression model in this application is to predict the traffic data of the next time series segment of each node based on the input data. The function of the regression model is to perform regression tasks, that is, to predict the traffic data of future time steps based on the input data. By using the parameters of the pre-trained model to initialize the regression model, the general features learned by the pre-trained model in previous tasks can be used to improve the performance of the regression model. This method of transfer learning can usually accelerate and improve the learning process of the model on specific tasks.
[0157] In some embodiments, when coordination of network resource allocation and traffic forecasting is required, the SDN sub-controller starts the forecasting process (i.e., step S200 above). This step involves resource allocation and network traffic forecasting. During this process, the SDN sub-controller needs to consider the current network topology, resource availability, and existing traffic data to predict future traffic demand.
[0158] In some embodiments, the dynamic network traffic control method of the present application further includes:
[0159] Step S300: regulating the network according to the corresponding prediction results.
[0160] The above step S300 means that the SDN sub-controller will dynamically adjust the network resource allocation to meet the predicted traffic demand to ensure network performance and efficiency.
[0161] It should be noted that the specific process of regulating the network according to the corresponding prediction results (such as using the SDN sub-controller) belongs to the existing technology in this field, so it will not be repeated here.
[0162] It can be seen that the SDN sub-controller starts the prediction process when it needs to coordinate network resource allocation and traffic prediction, which means that network resources can be adjusted in real time according to actual needs to improve network performance and efficiency.
[0163] For some examples, please refer to Figure 7 The dynamic network traffic control method of the present application also includes:
[0164] Step S400: monitor the total time used by the prediction model to perform predictions and obtain corresponding prediction results; if the total time is greater than the time corresponding to the range of future time steps that the prediction model can predict, the prediction work of the prediction model is stopped immediately.
[0165] In some embodiments, the dynamic network traffic control method of the present application further includes:
[0166] If the accuracy of the corresponding prediction result is lower than the preset accuracy threshold, the prediction work of the prediction model will be stopped immediately.
[0167] In some embodiments, the dynamic network traffic regulation method of the present application further includes: if the accuracy of the corresponding prediction result is lower than a preset accuracy threshold, the prediction work of the prediction model is immediately stopped.
[0168] In some embodiments, if the total time is greater than the time corresponding to the range of future time steps that can be predicted by the prediction model, the prediction work of the prediction model is stopped immediately to avoid exceeding the acceptable time range.
[0169] In some embodiments, if the accuracy of the corresponding prediction result is lower than a preset accuracy threshold, the prediction work of the prediction model is immediately stopped and the prediction model is retrained.
[0170] In some embodiments, the SDN sub-controller may monitor the total time used by the prediction model to perform prediction and obtain the corresponding prediction result. The total time includes the time from the start of the prediction to the completion of the prediction. The above total time is monitored to ensure that it is less than Tf, where Tf represents the prediction range of the sliding window.
[0171] It can be seen that when the SDN sub-controller performs resource allocation and network traffic prediction (such as step S200 above), it combines the current network topology, resource availability and existing traffic data, which helps to predict future traffic demand, thereby better allocating resources and improving network efficiency.
[0172] As can be seen, the SDN sub-controller monitors the total times to ensure that they are completed within an acceptable time range. This helps ensure that the network regulation process does not cause unnecessary delays or performance degradation. If the total time exceeds the predicted range (Tf), the SDN sub-controller can automatically end the prediction process to avoid unnecessary resource waste and time delays.
[0173] It can be seen that if the accuracy of the corresponding prediction result is lower than the preset accuracy threshold, the SDN sub-controller can terminate the current prediction process (i.e., perform quality control operations) and re-predict the model. This helps to improve the accuracy and quality of the prediction. In general, the above steps include real-time network regulation, resource optimization and traffic prediction, timeliness monitoring, automatic process termination, and quality control, which helps to improve the performance, efficiency, and reliability of the SDN network and ensure the effective use of network resources.
[0174] It should be noted that the pre-trained dynamic network traffic control method and system provided in this application can be applied and implemented based on the intelligent ecological network IEN. In other words, the pre-trained dynamic network traffic control method and system provided in this application can also be adopted or applied to the system architecture of the intelligent ecological network (Intelligent Eco Networking, referred to as IEN).
[0175] The above is some description of the dynamic network traffic control method based on pre-training. In some embodiments of the present application, a dynamic network traffic control system based on pre-training is also disclosed. Please refer to Figure 8 The system comprises:
[0176] The prediction module 100 is configured to obtain historical time series segments from the network, segment the historical time series segments to obtain multiple time series segments; input the time series segments into the trained prediction model to predict the future time series segments through the trained prediction model to obtain corresponding prediction results;
[0177] Among them, the prediction model includes an encoder, a graph structure learning submodule and a second decoder;
[0178] The encoder is extracted from a pre-trained model that has already been pre-trained.
[0179] The encoder is used to obtain the latent feature representation of the time series segments;
[0180] The graph structure learning submodule is used to construct discrete dependency graphs based on time series segments and latent feature representations;
[0181] The second decoder includes a spatiotemporal graph neural network submodule and a regression prediction layer submodule;
[0182] Among them, the spatiotemporal graph neural network submodule is used to construct a spatiotemporal graph based on the discrete dependency graph and the latest time series fragments in the time series fragments.
[0183] and, updating the latent feature representation of the central node of the spatiotemporal graph according to information collected from neighboring nodes of the spatiotemporal graph;
[0184] The regression prediction layer submodule is used to predict future time series segments based on the latent feature representation of the latest time series segment and the space-time graph before updating or the space-time graph after updating.
[0185] It should be noted that the specific process and technical effects of the above-mentioned dynamic network traffic control system are basically similar to the specific process and technical effects of the dynamic network traffic control method in the previous article, that is, the specific process and technical effects of the above-mentioned dynamic network traffic control system can refer to the specific process and technical effects of the dynamic network traffic control method in the previous article, and no repeated discussion will be made here.
[0186] The above is some description about the dynamic network traffic control system based on pre-training. In some embodiments of the present application, a computer-readable storage medium is also disclosed, including a program, which can be executed by a processor to implement a method as in any embodiment of the present application.
[0187] This document is described with reference to various exemplary embodiments. However, those skilled in the art will recognize that changes and modifications may be made to the exemplary embodiments without departing from the scope of this document. For example, various operating steps and components for performing the operating steps may be implemented in different ways (e.g., one or more steps may be deleted, modified, or incorporated into other steps) depending on the specific application or considering any number of cost functions associated with the operation of the system.
[0188] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. In addition, as understood by those skilled in the art, the principles of this article can be reflected in a computer program product on a computer-readable storage medium, which is pre-installed with a computer-readable program code. Any tangible, non-temporary computer-readable storage medium can be used, including magnetic storage devices (hard disks, floppy disks, etc.), optical storage devices (CD to ROM, DVD, Blu Ray disks, etc.), flash memory and / or the like. These computer program instructions can be loaded onto a general-purpose computer, a special-purpose computer or other programmable data processing device to form a machine, so that these instructions executed on a computer or other programmable data processing device can generate a device that implements a specified function. These computer program instructions can also be stored in a computer-readable memory, which can instruct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory can form a manufactured product, including an implementation device that implements a specified function. Computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operating steps are performed on a computer or other programmable device to generate a computer-implemented process, so that the instructions executed on a computer or other programmable device can provide steps for implementing a specified function.
[0189] Although the principles of this invention have been shown in various embodiments, many modifications of structures, arrangements, proportions, elements, materials and components particularly suitable for specific environments and operational requirements can be used without departing from the principles and scope of this invention. The above modifications and other changes or amendments will be included in the scope of this invention.
[0190] The foregoing specific description has been described with reference to various embodiments. However, those skilled in the art will recognize that various modifications and changes can be made without departing from the scope of the present disclosure. Therefore, the consideration of the present disclosure will be illustrative rather than restrictive, and all these modifications will be included in its scope. Similarly, the advantages, other advantages and solutions to the problems of various embodiments have been described above. However, the benefits, advantages, solutions to the problems and any elements that can produce these, or make them more clear, should not be interpreted as critical, necessary or necessary. The term "include" and any other variants used in this article are all non-exclusive inclusions, so that the process, method, article or device including the list of elements not only includes these elements, but also includes other elements that are not explicitly listed or do not belong to the process, method, system, article or device. In addition, the term "coupled" and any other variants used in this article refer to physical connections, electrical connections, magnetic connections, optical connections, communication connections, functional connections and / or any other connections.
[0191] Those skilled in the art will appreciate that many changes may be made to the details of the above-described embodiments without departing from the basic principles of the invention. Therefore, the scope of the present invention should be determined solely by the claims.
Claims
1. A dynamic network traffic control method based on pre-training, characterized in that: include: Acquire historical time series data from the network, and segment the historical time series data to obtain multiple time series segments; The time series segments are input into a trained prediction model, which is used to: obtaining a latent feature representation of the time series segment; constructing a discrete dependency graph based on the time series segments and the latent feature representation; constructing a spatiotemporal graph based on the discrete dependency graph and the latest time series segment among the time series segments; Based on the potential feature representation of the latest time series segment and the spatiotemporal graph, a future time series segment is predicted to obtain a corresponding prediction result; wherein the future time series segment is located in the next time period of the latest time series segment in the time series segments; Wherein, constructing a discrete dependency graph based on the time series segments and the potential feature representation includes: The step of feature-based node representation: taking each of the time series segments as a node of the discrete dependency graph, and representing the potential features corresponding to the time series segments as feature vectors corresponding to the node; Creating an initial adjacency matrix; wherein the dimension of the adjacency matrix is the number of nodes multiplied by the number of nodes, the adjacency matrix is used to represent the connection relationship between each of the nodes, and the number of nodes represents the total number of nodes in the discrete dependency graph; The step of automatically constructing a connection relationship: for each of the nodes, calculate the K nodes that are the nearest neighbors of the node, and use the K nodes that are the nearest neighbors of the node as the neighbor nodes of the node in the discrete dependency graph; determine the connection weights between the nodes according to the similarities between the nodes in the discrete dependency graph; for each of the nodes, connect the node to the K nodes that are the nearest neighbors of the node according to the corresponding connection weights; Repeat the above-mentioned step of automatically building a connection relationship until each of the nodes is connected, so as to obtain the discrete dependency graph; The step of constructing a spatiotemporal graph based on the discrete dependency graph and the latest time series segment in the time series segments includes: Taking the latest time series segment among the time series segments as the central node of the discrete dependency graph; Calculating the correlation between the central node and the non-latest time series segment; wherein the correlation is characterized by a corresponding similarity metric; wherein the non-latest time series segment is a time series segment other than the latest time series segment in the time series segment; Selecting a preset number of the time series segments having the highest correlation with the central node from the non-latest time series segments as neighbor nodes of the central node; The central node and neighboring nodes of the central node are connected to each other to form the space-time graph; wherein the space-time graph represents the space-time dependency relationship between the central node and the preset number of time series segments.
2. The dynamic network traffic control method according to claim 1, characterized in that: The prediction model is also used to: updating a potential feature representation of a central node of the spatiotemporal graph according to information collected from neighboring nodes of the spatiotemporal graph; The future time series segments are predicted based on the potential feature representation of the latest time series segment and the updated space-time graph to obtain corresponding prediction results.
3. The dynamic network traffic control method according to claim 2, characterized in that: The updating of the potential feature representation of the central node of the space-time graph according to the information collected from the neighboring nodes of the space-time graph comprises: Collecting feature vectors corresponding to the neighbor nodes from the neighbor nodes in the space-time graph; Aggregating the feature vectors collected from different neighboring nodes to generate a new potential feature representation of the central node; Inputting the new latent feature representation into a nonlinear activation function to obtain the new latent feature representation after nonlinear transformation; The new latent feature representation after the nonlinear transformation is used to replace the original latent feature representation of the central node.
4. The dynamic network traffic control method according to claim 3, characterized in that: Also includes: The network is regulated according to the corresponding prediction results.
5. The dynamic network traffic control method according to claim 1 or 4, characterized in that: Also includes: Monitoring the total time used by the prediction model to perform the prediction and obtain the corresponding prediction result; If the total time is greater than the time corresponding to the range of future time steps that can be predicted by the prediction model, the prediction work of the prediction model is stopped immediately.
6. The dynamic network traffic control method according to claim 1 or 4, characterized in that: Also includes: If the accuracy of the corresponding prediction result is lower than the preset accuracy threshold, the prediction work of the prediction model is stopped immediately.
7. A dynamic network traffic control system based on pre-training, characterized in that: include: The prediction module is configured to obtain historical time series data from the network, segment the historical time series data to obtain a plurality of time series segments; input the time series segments into the trained prediction model, and predict the future time series segments through the trained prediction model to obtain corresponding prediction results; Wherein, the future time series segment is located in the next time period of the latest time series segment among the time series segments; Wherein, the prediction model includes an encoder, a graph structure learning submodule and a second decoder; The encoder is extracted from a pre-trained model that has been pre-trained. The encoder is used to obtain a latent feature representation of the time series segment; The graph structure learning submodule is used to construct a discrete dependency graph based on the time series segments and the latent feature representation; The second decoder includes a spatiotemporal graph neural network submodule and a regression prediction layer submodule; The spatiotemporal graph neural network submodule is used to construct a spatiotemporal graph based on the discrete dependency graph and the latest time series segment in the time series segment, and to update the potential feature representation of the central node of the spatiotemporal graph according to the information collected from the neighbor nodes of the spatiotemporal graph; The regression prediction layer submodule is used to predict future time series segments based on the potential feature representation of the latest time series segment and the space-time graph before updating or the space-time graph after updating; Wherein, constructing a discrete dependency graph based on the time series segments and the potential feature representation includes: The step of feature-based node representation: taking each of the time series segments as a node of the discrete dependency graph, and representing the potential features corresponding to the time series segments as feature vectors corresponding to the node; Creating an initial adjacency matrix; wherein the dimension of the adjacency matrix is the number of nodes multiplied by the number of nodes, the adjacency matrix is used to represent the connection relationship between each of the nodes, and the number of nodes represents the total number of nodes in the discrete dependency graph; The step of automatically constructing a connection relationship: for each of the nodes, calculate the K nodes that are the nearest neighbors of the node, and use the K nodes that are the nearest neighbors of the node as the neighbor nodes of the node in the discrete dependency graph; determine the connection weights between the nodes according to the similarities between the nodes in the discrete dependency graph; for each of the nodes, connect the node to the K nodes that are the nearest neighbors of the node according to the corresponding connection weights; Repeat the above-mentioned step of automatically building a connection relationship until each of the nodes is connected, so as to obtain the discrete dependency graph; The step of constructing a spatiotemporal graph based on the discrete dependency graph and the latest time series segment in the time series segments includes: Taking the latest time series segment among the time series segments as the central node of the discrete dependency graph; Calculating the correlation between the central node and the non-latest time series segment; wherein the correlation is characterized by a corresponding similarity metric; wherein the non-latest time series segment is a time series segment other than the latest time series segment in the time series segment; Selecting a preset number of the time series segments having the highest correlation with the central node from the non-latest time series segments as neighbor nodes of the central node; The central node and neighboring nodes of the central node are connected to each other to form the space-time graph; wherein the space-time graph represents the space-time dependency relationship between the central node and the preset number of time series segments.
8. A computer-readable storage medium, characterized in that: The method comprises a program which can be executed by a processor to implement the dynamic network traffic regulation method as claimed in any one of claims 1 to 6.
Citation Information
Patent Citations
Multivariate time sequence prediction method and system based on pre-training enhancement
CN115688871A
Network prediction and regulation method and network regulation system
CN116743635A
Sea surface temperature prediction method and network based on space-time multiple characteristic diagram convolution
CN116822382A
SDN network flow prediction method and system based on spatio-temporal information
CN117061360A
A method and apparatus for determining how many input values of a time series of data are required for forecasting a future value of the time series
EP0883067A1
