Situation traffic prediction and message processing method and device, equipment, medium and product
The spatiotemporal Transformer prediction model is used to process situational traffic data and network topology, which solves the problem of low network traffic prediction accuracy in the existing technology, achieves more accurate network equipment traffic prediction, and meets the information industry's needs for safe operation and maintenance and user experience. .
Patent Information
- Application Number
- CN202410328266.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-21
- Publication Date
- 2024-10-18
AI Technical Summary
The network traffic prediction method in the existing technology only predicts single data, resulting in low prediction accuracy, making it difficult to meet the needs of the modern information industry for early perception of network threats and safe operation and maintenance.
The pre-trained spatiotemporal Transformer prediction model is used to process the situational traffic data and network topology, and feature extraction and aggregation is performed through the spatiotemporal module, feedforward neural network, dynamic pooling network and fully connected layer to generate traffic prediction results. Indicates network device traffic during a specified time period in the future.
It improves the prediction accuracy of network equipment situation log traffic, can capture the situation data characteristics of network equipment from the time and space dimensions, fully learns the time regularity characteristics and spatial correlation, and improves the prediction accuracy.
Smart Images

Figure CN118802584A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to a situational traffic prediction, message processing method, device, equipment, medium and product. Background Art
[0002] With the rapid development of communication technology, network traffic generated by all walks of life is increasing day by day. Early perception of potential network threats is an important requirement for safe production in the modern information industry. Accurate prediction and storage of device alarm information and situation log traffic in the network system plays a key role in the safe operation and maintenance of information companies such as operators and Internet companies and ensuring user experience.
[0003] In the related art, network traffic data is usually input into a neural network model for processing to achieve network traffic prediction. However, the prediction data of this prediction method is relatively single, which affects the prediction accuracy of network traffic. Summary of the invention
[0004] The embodiments of the present disclosure at least provide a situational traffic prediction, message processing method, device, equipment, medium and product.
[0005] In a first aspect, an embodiment of the present disclosure provides a situational traffic prediction method, comprising:
[0006] Determine the situation flow data to be predicted of each network device to be predicted;
[0007] Determine the network topology structure of the network device to be predicted; wherein the network topology structure includes device distance information between each network device;
[0008] The situational traffic data and the network topology are processed for traffic prediction using a pre-trained spatiotemporal Transformer prediction model to obtain a traffic prediction result; wherein the traffic prediction result is used to indicate the predicted traffic of the network device within a specified future time period.
[0009] In an optional implementation, the pre-trained spatiotemporal Transformer prediction model includes: a spatiotemporal module and a prediction module; wherein the prediction module includes a feedforward neural network, a dynamic pooling network and a fully connected layer.
[0010] In an optional implementation, the flow prediction processing is performed on the situation flow data and the network topology structure by using a pre-trained spatiotemporal Transformer prediction model to obtain a flow prediction result, including:
[0011] Processing the situational traffic data and the network topology structure through the spatiotemporal module to obtain traffic spatiotemporal characteristic information;
[0012] Performing feature aggregation processing on the spatiotemporal feature information through the feedforward neural network to obtain aggregated spatiotemporal feature information;
[0013] Performing pooling processing on the aggregated spatiotemporal feature information through the dynamic pooling network to obtain pooled feature information;
[0014] The pooled feature information is processed by the fully connected layer to obtain the flow prediction result.
[0015] In an optional implementation manner, the method further includes:
[0016] Build training data based on the situational traffic sample data of network devices;
[0017] The spatiotemporal Transformer prediction model to be trained is trained based on the training data to obtain the pre-trained spatiotemporal Transformer prediction model.
[0018] In an optional implementation manner, the step of constructing training data based on the situational traffic sample data of the network device includes:
[0019] Collecting situation flow sample data of all network devices, performing data statistics on the situation flow sample data according to unit time periods, and obtaining situation flow sample data within each unit time period;
[0020] Determine training samples based on the network devices to which the situational traffic sample data in the unit time period belongs, and determine a sample label for each of the training samples;
[0021] A training sample is constructed based on the training sample and the sample label.
[0022] In an optional implementation manner, determining the training sample based on the network device to which the situation flow sample data in the unit time period belongs includes:
[0023] Determine historical situation flow sample data of the network device within a historical time period;
[0024] Calculating a device topology structure between each of the network devices and each of the network devices in all the network devices;
[0025] The training sample is determined based on the historical situation traffic sample data and the device topology structure.
[0026] In a second aspect, an embodiment of the present disclosure provides a message processing method, including:
[0027] Determine the situation flow data to be predicted of each network device to be predicted;
[0028] Determine the network topology structure of the network device to be predicted; wherein the network topology structure includes device distance information between each network device;
[0029] The traffic prediction processing is performed on the situational traffic data and the network topology structure through a pre-trained spatiotemporal Transformer prediction model to obtain a traffic prediction result; wherein the traffic prediction result is used to indicate the predicted traffic of the network device in a specified time period in the future;
[0030] Based on the traffic prediction result, storage resources in the network system to which the network device to be predicted belongs are expanded or reduced in capacity, and log data of the network device is stored in the expanded or reduced storage resources.
[0031] In an optional implementation manner, storing the log data of the network device in the storage resource after the expansion and contraction processing includes:
[0032] Determine an abnormal traffic prediction result from the traffic prediction results of each of the network devices, and determine the abnormal network device corresponding to the abnormal traffic prediction result;
[0033] The log data of the abnormal network device is stored in the storage resource after the expansion and contraction processing.
[0034] In an optional implementation manner, storing the log data of the abnormal network device in the storage resource after the expansion and contraction processing includes:
[0035] Building a database in the storage resources after the expansion and contraction processing;
[0036] The log data of the abnormal network device is stored in the relational data table according to a preset index structure.
[0037] In an optional implementation manner, the method further includes:
[0038] In response to a data query request sent by a log requester through a preset API interface, determining a search keyword in the data query request;
[0039] A search is performed in the relational data table based on the search keyword to obtain a log search result, and the log search result is fed back to the log demander.
[0040] In a third aspect, the present disclosure provides a situation flow prediction device, including:
[0041] A first determining unit, used to determine the situation flow data to be predicted of each network device to be predicted;
[0042] A second determining unit is used to determine the network topology structure of the network device to be predicted; wherein the network topology structure includes device distance information between each network device;
[0043] The traffic prediction unit is used to perform traffic prediction processing on the situational traffic data and the network topology structure through a pre-trained spatiotemporal Transformer prediction model to obtain a traffic prediction result; wherein the traffic prediction result is used to indicate the predicted traffic of the network device in a specified time period in the future.
[0044] In a fourth aspect, an embodiment of the present disclosure provides a message processing device, including:
[0045] A first determining unit, used to determine the situation flow data to be predicted of each network device to be predicted;
[0046] A second determining unit is used to determine the network topology structure of the network device to be predicted; wherein the network topology structure includes device distance information between each network device;
[0047] A traffic prediction unit, used to perform traffic prediction processing on the situation traffic data and the network topology structure through a pre-trained spatiotemporal Transformer prediction model to obtain a traffic prediction result; wherein the traffic prediction result is used to indicate the predicted traffic of the network device in a specified future time period;
[0048] The log processing unit is used to perform capacity expansion and contraction processing on the storage resources in the network system to which the network device to be predicted belongs based on the traffic prediction result, and store the log data of the network device in the storage resources after the capacity expansion and contraction processing.
[0049] In a fifth aspect, an embodiment of the present disclosure further provides an electronic device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the above-mentioned first aspect, or any possible implementation of the first aspect, are performed.
[0050] In a sixth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned first aspect, or any possible implementation of the first aspect are executed.
[0051] In a seventh aspect, an embodiment of the present disclosure further provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the above-mentioned first aspect, or the steps in any possible implementation of the first aspect.
[0052] The present disclosure provides a situational traffic prediction and message processing method, device, equipment, medium and product. In the embodiment of the present disclosure, first, the situational traffic data to be predicted of each network device to be predicted is determined; the network topology structure of the network device to be predicted is determined; wherein the network topology structure includes the device distance information between each network device; finally, the situational traffic data and the network topology structure are processed by traffic prediction through a pre-trained spatiotemporal Transformer prediction model to obtain a traffic prediction result; wherein the traffic prediction result is used to indicate the predicted traffic of the network device in a specified time period in the future.
[0053] In the above implementation, by processing the situation flow data and network topology information through the spatiotemporal Transformer prediction model, the characteristics of the situation data of the network equipment can be captured from the time and space dimensions, with good data input parallelism. In the prediction process, the temporal regularity characteristics of the situation flow data and the spatial correlation between network devices can be fully learned, which effectively improves the prediction accuracy of the situation log flow of the network equipment.
[0054] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following is a brief introduction to the drawings required for use in the embodiments. The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used together with the specification to illustrate the technical solutions of the present disclosure. It should be understood that the following drawings only illustrate certain embodiments of the present disclosure and should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can also be obtained based on these drawings without creative work.
[0056] Figure 1 A flow chart of a situation flow prediction method provided by an embodiment of the present disclosure is shown;
[0057] Figure 2 A schematic diagram of the structure of a spatiotemporal Transformer prediction model provided by an embodiment of the present disclosure is shown;
[0058] Figure 3A flow chart of a message processing method provided by an embodiment of the present disclosure is shown;
[0059] Figure 4 A schematic diagram of a situation flow prediction device provided by an embodiment of the present disclosure is shown;
[0060] Figure 5 A schematic diagram of a message processing device provided by an embodiment of the present disclosure is shown;
[0061] Figure 6 A schematic diagram of an electronic device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0062] In order to make the purpose, technical scheme and advantages of the embodiments of the present disclosure clearer, the technical scheme in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. The components of the embodiments of the present disclosure generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure provided in the drawings is not intended to limit the scope of the present disclosure for protection, but merely represents the selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present disclosure.
[0063] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0064] The term "and / or" herein only describes an association relationship, indicating that three relationships may exist. For example, A and / or B may represent three situations: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C may represent including any one or more elements selected from the set consisting of A, B, and C.
[0065] Research has found that with the rapid development of communication technology, network traffic generated by all walks of life is increasing day by day. Early awareness of potential network threats is an important requirement for safe production in the modern information industry. Accurate prediction and storage of device alarm information and situation log traffic in the network system plays a key role in the safe operation and maintenance of information companies such as operators and Internet companies and ensuring user experience.
[0066] In the related art, network traffic data is usually input into a neural network model for processing to achieve network traffic prediction. However, the prediction data of this prediction method is relatively single, which affects the prediction accuracy of network traffic.
[0067] Based on the above research, the present disclosure provides a situational traffic prediction and message processing method, device, equipment, medium and product. In the embodiment of the present disclosure, first, the situational traffic data to be predicted of each network device to be predicted is determined; the network topology structure of the network device to be predicted is determined; wherein the network topology structure includes the device distance information between each network device; finally, the situational traffic data and the network topology structure are processed by traffic prediction through a pre-trained spatiotemporal Transformer prediction model to obtain a traffic prediction result; wherein the traffic prediction result is used to indicate the predicted traffic of the network device in a specified time period in the future.
[0068] In the above implementation, by processing the situation flow data and network topology information through the spatiotemporal Transformer prediction model, the characteristics of the situation data of the network equipment can be captured from the time and space dimensions, with good data input parallelism. In the prediction process, the temporal regularity characteristics of the situation flow data and the spatial correlation between network devices can be fully learned, which effectively improves the prediction accuracy of the situation log flow of the network equipment.
[0069] To facilitate understanding of this embodiment, a situational traffic prediction method disclosed in the embodiment of the present disclosure is first introduced in detail. The execution subject of the situational traffic prediction method provided in the embodiment of the present disclosure is generally an electronic device with certain computing capabilities. In some possible implementations, the situational traffic prediction method can be implemented by a processor calling a computer-readable instruction stored in a memory.
[0070] See also Figure 1 FIG. 1 is a flow chart of a method for predicting traffic flow according to an embodiment of the present disclosure, wherein the method comprises steps S101 to S103, wherein:
[0071] S101: Determine the situational traffic data to be predicted of each network device to be predicted.
[0072] S102: Determine the network topology structure of the network device to be predicted; wherein the network topology structure includes device distance information between each network device.
[0073] Here, the location coordinate information of each network device in the network system to which the network device to be predicted belongs may be determined. For example, if the network system includes N network devices, the location coordinate information of the N network devices may be determined.
[0074] At this time, the Euclidean distance formula can be used to calculate the device distance information between N network devices. For example, the formula The Euclidean distance between any two network devices is calculated, where (x, y) represents the location coordinate information of the network device, and d represents the Euclidean distance (i.e., the device distance information). Subsequently, the network topology is determined based on the device distance information d between the N network devices. For example, a topological position matrix G can be established based on the device distance information to obtain the network topology.
[0075] Here, the topological position matrix G (i.e. Figure 2 The spatial matrix G) shown can be expressed by the following formula: Among them, d i,j Indicates the device distance information between the i-th network device and the j-th network device.
[0076] S103: Perform traffic prediction processing on the traffic feature data and the network topology structure through a pre-trained spatiotemporal Transformer prediction model to obtain a traffic prediction result; wherein the traffic prediction result is used to indicate the predicted traffic of the network device in a specified future time period.
[0077] Here, the situational traffic data X and the topological position matrix G to be predicted can be input into the trained spatiotemporal Transformer prediction model for prediction processing, so as to predict the predicted traffic of the network device at the next t moments (ie, the traffic prediction result).
[0078] In the above implementation, by processing the situation flow data and network topology information through the spatiotemporal Transformer prediction model, the characteristics of the situation data of the network equipment can be captured from the time and space dimensions, with good data input parallelism. In the prediction process, the temporal regularity characteristics of the situation flow data and the spatial correlation between network devices can be fully learned, which effectively improves the prediction accuracy of the situation log flow of the network equipment.
[0079] In an embodiment of the present disclosure, a pre-trained spatiotemporal Transformer prediction model (hereinafter referred to as ST-Transformer model) includes: a spatiotemporal module and a prediction module; wherein the prediction module includes a feedforward neural network, a dynamic pooling network and a fully connected layer.
[0080] Here, the spatiotemporal Transformer prediction model includes multiple attention mechanisms, each of which can be set up with a corresponding spatiotemporal module; wherein the spatiotemporal module includes a spatial network model and a temporal network model. Here, the model structure of the spatial network model is as follows Figure 2 As shown, the model structure of the temporal network model is as follows Figure 2 As shown. Figure 2 As shown, the prediction module includes a feedforward neural network, a dynamic pooling layer, a fully connected layer and an output layer connected in sequence.
[0081] In an optional implementation, the above steps use a pre-trained spatiotemporal Transformer prediction model to perform traffic prediction processing on the situational traffic data and the network topology structure to obtain a traffic prediction result, which specifically includes the following steps:
[0082] Step S11, processing the situational traffic data and the network topology structure through the spatiotemporal module to obtain traffic spatiotemporal characteristic information;
[0083] Step S12, performing feature aggregation processing on the spatiotemporal feature information through the feedforward neural network to obtain aggregated spatiotemporal feature information;
[0084] Step S13, performing pooling processing on the aggregated spatiotemporal feature information through the dynamic pooling network to obtain pooled feature information;
[0085] Step S14: Process the pooled feature information through the fully connected layer to obtain the traffic prediction result.
[0086] In the disclosed embodiment, first, a feedforward neural network (referred to as network A) can be used to extract features from the situational traffic data and network topology to obtain traffic feature information. Then, the feature information is input into the spatiotemporal module of the spatiotemporal Transformer prediction model for processing, thereby obtaining the spatiotemporal traffic feature information; thereafter, the spatiotemporal feature information is subjected to feature aggregation processing by the feedforward neural network in the prediction module to obtain aggregated spatiotemporal feature information; wherein, the feedforward neural network and the above-mentioned network A can be networks with the same or different structures, which are not specifically limited here, subject to what can be implemented.
[0087] Next, the aggregated spatiotemporal feature information can be pooled through the dynamic pooling network of the prediction module to obtain pooled feature information; finally, the pooled feature information can be processed through the fully connected layer to obtain the traffic prediction result.
[0088] From the above description, we can see that the spatiotemporal Transformer prediction model contains multiple attention mechanisms, each of which can be set up with a corresponding spatiotemporal module. Based on this, combined with Figure 2 , the processing of multiple spatiotemporal modules can be described as follows:
[0089] For the i-th spatiotemporal module, when obtaining the i-th spatiotemporal module feature information input After (among which The spatial network model layer of the ST-Transformer model first extracts the traffic feature information x of N network devices in the d-dimensional space from time step T-M+1 to time step T extracted by the i-1 layer spatiotemporal module. The spatial feature information of the equipment status flow data corresponding to the position adjacency matrix G is extracted and learned Then, Y i S and Feature information after feature aggregation Input into the temporal network model layer of the ST-Transformer model to extract and learn temporal feature information Finally, Y i T and Perform feature aggregation to obtain feature information input for module i+1 The final spatiotemporal characteristic information of traffic is obtained after superposition training and learning of multiple layers of spatiotemporal modules.
[0090] After that, the flow spatiotemporal feature information is passed into the feedforward neural network of the prediction module for feature enhancement to obtain aggregated spatiotemporal feature information. Subsequently, the dynamic pooling network layer is introduced to adaptively adjust the pooling operation on the enhanced feature information (aggregated spatiotemporal feature information) to obtain pooled feature information. Among them, P(x) is the pooled feature information, c i is the dynamic pooling layer weight, and k is the number of pooling operations.
[0091] After obtaining the pooled feature information, the pooled feature information can be processed through a fully connected layer to obtain a traffic prediction result of the network device to be predicted.
[0092] In the above implementation, by setting a dynamic pooling layer in the spatiotemporal ST-Transformer prediction model, the pooling operation can be adaptively adjusted according to the temporal and spatial characteristics of the log data, so that the pooling window and method can be dynamically adjusted under different data characteristics to extract more effective traffic data features, thereby improving the accuracy of the fully connected classification prediction.
[0093] In an optional embodiment, the method further comprises the following steps:
[0094] Step S21, constructing training data based on the situational traffic sample data of the network device;
[0095] Step S22, training the spatiotemporal Transformer prediction model to be trained based on the training data to obtain the pre-trained spatiotemporal Transformer prediction model.
[0096] In the embodiment of the present disclosure, before performing traffic prediction on the network device to be predicted using a pre-trained spatiotemporal Transformer prediction model, it is necessary to train the initial spatiotemporal Transformer prediction model.
[0097] In specific implementation, training data can be constructed based on the situational traffic sample data of the network device, and then the training data is sequentially input into the spatiotemporal Transformer prediction model to be trained for prediction training processing.
[0098] For example, Figure 2 As shown in the figure, first, the training data is processed by network A, and then the processing results are input into the spatiotemporal module for processing, so as to obtain the spatiotemporal feature information of the traffic of the training sample. After that, the spatiotemporal feature information of the traffic is input into the feedforward neural network of the prediction module for processing to obtain the aggregated spatiotemporal feature information, and the aggregated spatiotemporal feature information is input into the dynamic pooling network for processing. After obtaining the pooled feature information, it is input into the fully connected layer of the prediction module for feature mapping and prediction label value comparison, and the cross entropy error is calculated to obtain the loss value. Finally, according to the error, it is reversely transmitted to each layer such as the ST-Transformer spatiotemporal module and the prediction module to optimize the weights and bias parameters until the loss value converges and the prediction accuracy is stable, and the improved ST-Transformer network model after training is obtained.
[0099] In an optional implementation, the above steps construct training data based on the situational traffic sample data of the network device, specifically including the following steps:
[0100] First, collect the situation flow sample data of all network devices, perform data statistics on the situation flow sample data according to unit time periods, and obtain the situation flow sample data in each unit time period;
[0101] Secondly, based on the network devices to which the situational traffic sample data in the unit time period belongs, training samples are determined, and sample labels of each training sample are determined;
[0102] Finally, a training sample is constructed based on the training sample and the sample label.
[0103] In the disclosed embodiment, first, the situation awareness data information (i.e., situation flow sample data) of each network device collected and analyzed by the situation awareness device is obtained and received; then, the received situation flow sample data is counted according to the unit time period to obtain the situation flow sample data in each unit time period. For example, the situation flow sample data can be counted every hour.
[0104] Afterwards, the training samples can be determined according to the belonging devices of the situational traffic sample data corresponding to each hour period; and the sample label of each training sample can be determined; wherein the sample label is the true value of the traffic set in advance for the training sample. Finally, the training samples can be constructed based on the training samples and the sample labels. Among them, the number of training samples is multiple, and each training sample contains the historical situational traffic sample data of the corresponding network device, as well as the device topology structure between each network device.
[0105] In an optional implementation, the above steps determine the training samples based on the network device to which the situation flow sample data in the unit time period belongs, and specifically include the following steps:
[0106] Step S31, determining historical situation flow sample data of the network device within a historical time period;
[0107] Step S32, calculating the device topology structure between each of the network devices and each of the network devices in all the network devices;
[0108] Step S33: determining the training sample based on the historical situation traffic sample data and the device topology structure.
[0109] In the embodiment of the present disclosure, the time series of the network device to which the situation flow sample data belongs in the unit time period in the past M hours (historical time period) can be determined. (where T means that the traffic data contains T time steps), and determines the spatial position matrix of the network device to which it belongs Then, the matrix set [X, G] and the corresponding L flow value M+t after the required prediction time t (M>>t) are determined as labels, for example, is the label, and its corresponding training sample is At this time, the training samples and the spatial position matrix G are input into the ST-Transformer model for training until an ST-Transformer model that meets the accuracy requirements is obtained.
[0110] See also Figure 3 FIG. 1 is a flow chart of a method for predicting traffic flow according to an embodiment of the present disclosure, wherein the method comprises steps S301 to S304, wherein:
[0111] Step S301, determining the situation flow data to be predicted of each network device to be predicted.
[0112] Here, you can Figure 1 The situational traffic data is determined in the manner of the illustrated embodiment.
[0113] Step S302, determining the network topology structure of the network device to be predicted; wherein the network topology structure includes device distance information between each network device.
[0114] Here, you can Figure 1 The method of the illustrated embodiment determines the network topology structure of the network device to be predicted.
[0115] Step S303, using a pre-trained spatiotemporal Transformer prediction model, performs traffic prediction processing on the situational traffic data and the network topology structure to obtain a traffic prediction result; wherein the traffic prediction result is used to indicate the predicted traffic of the network device within a specified time period in the future.
[0116] Here, the situational traffic data X and the topological position matrix G to be predicted can be input into the trained spatiotemporal Transformer prediction model for prediction processing, so as to predict the predicted traffic of the network device at the next t moments (ie, the traffic prediction result).
[0117] In the embodiments of the present disclosure, the spatiotemporal Transformer prediction model can be obtained by training in the manner described in the above embodiments, and the model structure of the spatiotemporal Transformer prediction model can be as follows: Figure 2 The structure shown in the figure, the processing process of the spatiotemporal Transformer prediction model on the situational traffic data and network topology structure is as described above and will not be repeated here in detail.
[0118] Step S304: scaling the storage resources in the network system to which the network device to be predicted belongs based on the traffic prediction result, and storing the log data of the network device in the storage resources after scaling.
[0119] In the disclosed embodiment, after the traffic prediction result is obtained, the storage resources in the network system to which the network device to be predicted belongs can be expanded or reduced based on the traffic prediction result.
[0120] It can be seen from the above description that in the embodiment of the present disclosure, the situational traffic data X and the position adjacency matrix G to be predicted can be input into the trained spatiotemporal Transformer prediction model for prediction, thereby obtaining the predicted traffic of the network device at the next t moments.
[0121] like Figure 2As shown in the figure, the spatial network model in the trained spatiotemporal Transformer prediction model first extracts the spatial feature information of the situation flow data to be predicted from the input X and the position adjacency matrix G, and inputs it into the time network model to extract the time series feature information, and then inputs it into the prediction module to perform feature extraction, dynamic pooling and full connection prediction in turn, so as to obtain the flow prediction results of N network devices to be predicted.
[0122] After obtaining the traffic prediction results, the traffic prediction results can be input into the distributed message processing system. The distributed message processing system expands or contracts the corresponding storage resources in the network system according to the traffic prediction results of each network device to be predicted at the future time t.
[0123] In specific implementation, the storage resources such as hardware servers and cloud virtual machines in the network system can be reasonably expanded or reduced in size by increasing or decreasing the number of nodes and dynamically expanding or reducing the capacity based on the traffic prediction results.
[0124] Through the above processing method, effective scheduling of storage resources can be achieved. When the storage resources of the network system are effectively scheduled, the log data of each network device can be effectively stored in the corresponding storage resources.
[0125] In the above implementation, a distributed message processing system is used to reasonably store the log data of each device in the system by increasing or reducing the capacity of storage server nodes or storage servers according to the log traffic data of the next time period predicted by each network device. This can not only save system software and hardware resources when business data is at a flat peak, but also dynamically expand the capacity during business peaks to complete real-time storage of massive data, thereby realizing the integrated storage and processing of application situational awareness log data traffic prediction results.
[0126] In an optional implementation, the above step of storing the log data of the network device in the storage resource after the expansion and contraction process includes the following steps:
[0127] First, determining an abnormal traffic prediction result in the traffic prediction results of each of the network devices, and determining the abnormal network device corresponding to the abnormal traffic prediction result;
[0128] Secondly, the log data of the abnormal network device is stored in the storage resource after the expansion and contraction processing.
[0129] In the embodiment of the present disclosure, the traffic prediction result can be compared with the normal traffic value of each network device; wherein the normal traffic value can be preset by relevant technical personnel, or determined based on the actual traffic value of the network device in the same period of time in the past. If the traffic prediction result is greater than the normal traffic value, or the difference between the traffic prediction result and the normal traffic value is greater than a specified difference, the network device can be determined to be an abnormal network device.
[0130] Afterwards, the log data of abnormal network devices can be stored in the storage resources after the expansion and contraction process for users to query.
[0131] In an optional implementation, the above step of storing the log data of the abnormal network device in the storage resource after the expansion and contraction processing specifically includes the following steps:
[0132] First, a database is constructed in the storage resources after the expansion and contraction processing, and a relational data table is constructed in the database;
[0133] Secondly, the log data of the abnormal network device is stored in the relational data table according to a preset index structure.
[0134] In the disclosed embodiment, an automated data processing software program is written and a data engine is developed and built to support the construction of MYSQL, ES and other databases and relational data tables according to device indexes, and the import of the data structure and fields of the device status log into the corresponding database table according to the preset index structure and index mapping.
[0135] In an optional embodiment, the method further comprises the following steps:
[0136] In response to a data query request sent by a log requester through a preset API interface, determining a search keyword in the data query request;
[0137] A search is performed in the relational data table based on the search keyword to obtain a log search result, and the log search result is fed back to the log demander.
[0138] After obtaining the database table of the status log of each device, the data query function is provided to the demander through the design and development of API interfaces and other methods. The user can query and call the detailed visual log data information of the database and relationship table corresponding to the abnormal network device on demand, and can complete the customized statistics and processing of the device log data through database operations. Compared with the situation alarm log storage structure that is not processed and is stored immediately after it is sent, the technical solution disclosed in the present invention not only effectively completes the distinction between the devices described in the corresponding log, but also provides the function of real-time query of log information by index information such as time and name, and has high practical applicability.
[0139] The technical solution disclosed in the present invention builds a data engine to construct a corresponding database and store the stored status log data of each abnormal device in separate tables, which can be queried and obtained at any time, thereby achieving effective storage and processing of status data and clear calling of abnormal results.
[0140] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.
[0141] Based on the same inventive concept, the embodiment of the present disclosure also provides a situational traffic prediction device corresponding to the situational traffic prediction method. Since the principle of solving the problem by the device in the embodiment of the present disclosure is similar to the above-mentioned situational traffic prediction method in the embodiment of the present disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0142] Reference Figure 4 FIG. 1 is a schematic diagram of a situation flow prediction device provided by an embodiment of the present disclosure, wherein the device comprises: a first determination unit 10, a second determination unit 20, and a flow prediction unit 30; wherein:
[0143] A first determining unit, used to determine the situation flow data to be predicted of each network device to be predicted;
[0144] A second determining unit is used to determine the network topology structure of the network device to be predicted; wherein the network topology structure includes device distance information between each network device;
[0145] The traffic prediction unit is used to perform traffic prediction processing on the situational traffic data and the network topology structure through a pre-trained spatiotemporal Transformer prediction model to obtain a traffic prediction result; wherein the traffic prediction result is used to indicate the predicted traffic of the network device in a specified time period in the future.
[0146] In the above implementation, by processing the situation flow data and network topology information through the spatiotemporal Transformer prediction model, the characteristics of the situation data of the network equipment can be captured from the time and space dimensions, with good data input parallelism. In the prediction process, the temporal regularity characteristics of the situation flow data and the spatial correlation between network devices can be fully learned, which effectively improves the prediction accuracy of the situation log flow of the network equipment.
[0147] In a possible implementation, the pre-trained spatiotemporal Transformer prediction model includes: a spatiotemporal module and a prediction module; wherein the prediction module includes a feedforward neural network, a dynamic pooling network and a fully connected layer.
[0148] In a possible implementation manner, the traffic prediction unit is further configured to:
[0149] Processing the situational traffic data and the network topology structure through the spatiotemporal module to obtain traffic spatiotemporal characteristic information;
[0150] Performing feature aggregation processing on the spatiotemporal feature information through the feedforward neural network to obtain aggregated spatiotemporal feature information;
[0151] Performing pooling processing on the aggregated spatiotemporal feature information through the dynamic pooling network to obtain pooled feature information;
[0152] The pooled feature information is processed by the fully connected layer to obtain the flow prediction result.
[0153] In a possible implementation manner, the device is further used for:
[0154] Build training data based on the situational traffic sample data of network devices;
[0155] The spatiotemporal Transformer prediction model to be trained is trained based on the training data to obtain the pre-trained spatiotemporal Transformer prediction model.
[0156] In a possible implementation manner, the device is further used for:
[0157] Collecting situation flow sample data of all network devices, performing data statistics on the situation flow sample data according to unit time periods, and obtaining situation flow sample data within each unit time period;
[0158] Determine training samples based on the network devices to which the situational traffic sample data in the unit time period belongs, and determine a sample label for each of the training samples;
[0159] A training sample is constructed based on the training sample and the sample label.
[0160] In a possible implementation manner, the device is further used for:
[0161] Determine historical situation flow sample data of the network device within a historical time period;
[0162] Calculating a device topology structure between each of the network devices and each of the network devices in all the network devices;
[0163] The training sample is determined based on the historical situation traffic sample data and the device topology structure.
[0164] Reference Figure 5 , which is a schematic diagram of a situation flow prediction device provided by an embodiment of the present disclosure, the device comprises: a first determination unit 10, a second determination unit 20, a flow prediction unit 30 and a log processing unit 40; wherein,
[0165] The first determining unit 10 is used to determine the situation flow data to be predicted of each network device to be predicted;
[0166] A second determining unit 20 is used to determine the network topology structure of the network device to be predicted; wherein the network topology structure includes device distance information between each network device;
[0167] The traffic prediction unit 30 is used to perform traffic prediction processing on the situation traffic data and the network topology structure through a pre-trained spatiotemporal Transformer prediction model to obtain a traffic prediction result; wherein the traffic prediction result is used to indicate the predicted traffic of the network device in a specified future time period;
[0168] The log processing unit 40 is used to perform capacity expansion and contraction processing on the storage resources in the network system to which the network device to be predicted belongs based on the traffic prediction result, and store the log data of the network device in the storage resources after the capacity expansion and contraction processing.
[0169] In a possible implementation manner, the log processing unit 40 is further configured to:
[0170] Determine an abnormal traffic prediction result from the traffic prediction results of each of the network devices, and determine the abnormal network device corresponding to the abnormal traffic prediction result;
[0171] The log data of the abnormal network device is stored in the storage resource after the expansion and contraction processing.
[0172] In a possible implementation manner, the log processing unit 40 is further configured to:
[0173] Constructing a database in the storage resources after the expansion and contraction processing, and constructing a relational data table in the database;
[0174] The log data of the abnormal network device is stored in the relational data table according to a preset index structure.
[0175] In a possible implementation manner, the device is further used for:
[0176] In response to a data query request sent by a log requester through a preset API interface, determining a search keyword in the data query request;
[0177] A search is performed in the relational data table based on the search keyword to obtain a log search result, and the log search result is fed back to the log demander.
[0178] For descriptions of the processing flow of each module in the device and the interaction flow between each module, reference may be made to the relevant descriptions in the above method embodiment, which will not be described in detail here.
[0179] Corresponds to Figure 1 The situation flow prediction method in the present disclosure also provides an electronic device 700, such as Figure 6 FIG. 7 is a schematic diagram of the structure of an electronic device 700 provided in an embodiment of the present disclosure, including:
[0180] Processor 71, memory 72, and bus 73; memory 72 is used to store execution instructions, including internal memory 721 and external memory 722; the internal memory 721 is also called internal memory, which is used to temporarily store the operation data in the processor 71 and the data exchanged with the external memory 722 such as a hard disk. The processor 71 exchanges data with the external memory 722 through the internal memory 721. When the electronic device 700 is running, the processor 71 communicates with the memory 72 through the bus 73, so that the processor 71 executes the following instructions:
[0181] Determine the situation flow data to be predicted of each network device to be predicted;
[0182] Determine the network topology structure of the network device to be predicted; wherein the network topology structure includes device distance information between each network device;
[0183] The situational traffic data and the network topology are processed for traffic prediction using a pre-trained spatiotemporal Transformer prediction model to obtain a traffic prediction result; wherein the traffic prediction result is used to indicate the predicted traffic of the network device within a specified future time period.
[0184] Or execute the following command:
[0185] Determine the situation flow data to be predicted of each network device to be predicted;
[0186] Determine the network topology structure of the network device to be predicted; wherein the network topology structure includes device distance information between each network device;
[0187] The traffic prediction processing is performed on the situational traffic data and the network topology structure through a pre-trained spatiotemporal Transformer prediction model to obtain a traffic prediction result; wherein the traffic prediction result is used to indicate the predicted traffic of the network device in a specified time period in the future;
[0188] Based on the traffic prediction result, storage resources in the network system to which the network device to be predicted belongs are expanded or reduced in capacity, and log data of the network device is stored in the expanded or reduced storage resources.
[0189] The present disclosure also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the situational traffic prediction method described in the above method embodiment are executed. The storage medium can be a volatile or non-volatile computer-readable storage medium.
[0190] The present disclosure also provides a computer program product that carries a program code. The program code includes instructions that can be used to execute the steps of the situational traffic prediction method described in the above method embodiment. For details, please refer to the above method embodiment, which will not be repeated here.
[0191] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is implemented as a computer storage medium. In another optional embodiment, the computer program product is implemented as a software product, such as a software development kit (SDK).
[0192] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. In the several embodiments provided in the present disclosure, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the device or unit can be electrical, mechanical or other forms.
[0193] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0194] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0195] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0196] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed in the present disclosure, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. A situation flow prediction method, characterized in that: include: Determine the situation flow data to be predicted of each network device to be predicted; Determine the network topology structure of the network device to be predicted; wherein the network topology structure includes device distance information between each network device; The situational traffic data and the network topology are processed for traffic prediction using a pre-trained spatiotemporal Transformer prediction model to obtain a traffic prediction result; wherein the traffic prediction result is used to indicate the predicted traffic of the network device within a specified future time period.
2. The method according to claim 1, characterized in that: The pre-trained spatiotemporal Transformer prediction model includes: a spatiotemporal module and a prediction module; wherein the prediction module includes a feedforward neural network, a dynamic pooling network and a fully connected layer.
3. The method according to claim 2, characterized in that The pre-trained spatiotemporal Transformer prediction model is used to perform traffic prediction processing on the situational traffic data and the network topology structure to obtain a traffic prediction result, including: Processing the situational traffic data and the network topology structure through the spatiotemporal module to obtain traffic spatiotemporal characteristic information; Performing feature aggregation processing on the spatiotemporal feature information through the feedforward neural network to obtain aggregated spatiotemporal feature information; Performing pooling processing on the aggregated spatiotemporal feature information through the dynamic pooling network to obtain pooled feature information; The pooled feature information is processed by the fully connected layer to obtain the flow prediction result.
4. The method according to claim 1, characterized in that: The method further comprises: Build training data based on the situational traffic sample data of network devices; The spatiotemporal Transformer prediction model to be trained is trained based on the training data to obtain the pre-trained spatiotemporal Transformer prediction model.
5. The method according to claim 4, characterized in that The training data is constructed based on the situation flow sample data of the network device, including: Collecting situation flow sample data of all network devices, performing data statistics on the situation flow sample data according to unit time periods, and obtaining situation flow sample data within each unit time period; Determine training samples based on the network devices to which the situational traffic sample data in the unit time period belongs, and determine a sample label for each of the training samples; A training sample is constructed based on the training sample and the sample label.
6. The method according to claim 5, characterized in that The determining of the training samples based on the network device to which the situation flow sample data in the unit time period belongs includes: Determine historical situation flow sample data of the network device within a historical time period; Calculating a device topology structure between each of the network devices and each of the network devices in all the network devices; The training sample is determined based on the historical situation traffic sample data and the device topology structure.
7. A message processing method, characterized in that: include: Determine the situation flow data to be predicted of each network device to be predicted; Determine the network topology structure of the network device to be predicted; wherein the network topology structure includes device distance information between each network device; The traffic prediction processing is performed on the situational traffic data and the network topology structure through a pre-trained spatiotemporal Transformer prediction model to obtain a traffic prediction result; wherein the traffic prediction result is used to indicate the predicted traffic of the network device in a specified time period in the future; Based on the traffic prediction result, the storage resources in the network system to which the network device to be predicted belongs are expanded or reduced in capacity, and the log data of the network device is stored in the expanded or reduced storage resources.
8. The method according to claim 7, characterized in that The storing the log data of the network device in the storage resource after the expansion and contraction processing includes: Determine an abnormal traffic prediction result from the traffic prediction results of each of the network devices, and determine the abnormal network device corresponding to the abnormal traffic prediction result; The log data of the abnormal network device is stored in the storage resource after the expansion and contraction processing.
9. The method according to claim 8, characterized in that The storing the log data of the abnormal network device in the storage resource after the expansion and contraction processing includes: Constructing a database in the storage resources after the expansion and contraction processing, and constructing a relational data table in the database; The log data of the abnormal network device is stored in the relational data table according to a preset index structure.
10. The method according to claim 9, characterized in that The method further comprises: In response to a data query request sent by a log requester through a preset API interface, determining a search keyword in the data query request; A search is performed in the relational data table based on the search keyword to obtain a log search result, and the log search result is fed back to the log demander.
11. A situation flow prediction device, characterized in that: include: A first determining unit, used to determine the situation flow data to be predicted of each network device to be predicted; A second determining unit is used to determine the network topology structure of the network device to be predicted; wherein the network topology structure includes device distance information between each network device; The traffic prediction unit is used to perform traffic prediction processing on the situational traffic data and the network topology structure through a pre-trained spatiotemporal Transformer prediction model to obtain a traffic prediction result; wherein the traffic prediction result is used to indicate the predicted traffic of the network device in a specified time period in the future.
12. A message processing device, characterized in that: include: A first determining unit, used to determine the situation flow data to be predicted of each network device to be predicted; A second determining unit is used to determine the network topology structure of the network device to be predicted; wherein the network topology structure includes device distance information between each network device; A traffic prediction unit, used to perform traffic prediction processing on the situation traffic data and the network topology structure through a pre-trained spatiotemporal Transformer prediction model to obtain a traffic prediction result; wherein the traffic prediction result is used to indicate the predicted traffic of the network device in a specified future time period; The log processing unit is used to perform capacity expansion and contraction processing on the storage resources in the network system to which the network device to be predicted belongs based on the traffic prediction result, and store the log data of the network device in the storage resources after the capacity expansion and contraction processing.
13. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the situational traffic prediction method as described in any one of claims 1 to 6, or the steps of the message processing method as described in any one of claims 7 to 10 are performed.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, executes the steps of the situational traffic prediction method as described in any one of claims 1 to 6, or the steps of the message processing method as described in any one of claims 7 to 10.
15. A computer program product, characterized in that The computer program product is stored in a storage medium, and the program product is executed by at least one processor to implement the steps of the situational traffic prediction method as described in any one of claims 1 to 6, or the steps of the message processing method as described in any one of claims 7 to 10.
Citation Information
Patent Citations
Communication network traffic prediction method and system, storage medium and computer equipment
CN114422381A
Automatic node expansion and contraction method and system for distributed storage system
CN115599296A
Transform anomaly detection method based on spatio-temporal characteristics
CN115618196A
Detection method based on network flow situation awareness
CN116633601A
Service node capacity control method and device, equipment and storage medium
CN117376982A
