Interface traffic prediction method and device, equipment, medium and program product
By using graph neural network model and space-time fusion matrix, combined with the actual traffic data of multiple interfaces, the problem of low prediction accuracy of multi-interface traffic in the prior art is solved, and higher prediction accuracy is achieved.
Patent Information
- Application Number
- CN202510020893.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-07
- Publication Date
- 2025-04-25
AI Technical Summary
The prior art has low accuracy when predicting traffic on multiple interfaces and fails to effectively capture the spatiotemporal correlation and interface call relationship between interfaces.
By obtaining the actual traffic data and the spatiotemporal fusion matrix of multiple interfaces, input the interface traffic prediction model and use the graph neural network model for training to improve the accuracy of traffic prediction. The space-time fusion matrix represents the space-time correlation between interfaces, including temporal correlation and spatial correlation.
The accuracy of the multi-interface traffic prediction results is improved, and the traffic changes of multiple interfaces can be more accurately predicted during the period to be predicted.
Smart Images

Figure CN119892660A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data communication technology, and in particular to an interface traffic prediction method, device, equipment, medium and program product. Background Art
[0002] Interface traffic prediction can be understood as the process of estimating and predicting the data traffic of a specified network interface, such as a network device interface, server interface, wireless air interface, etc., in the future. In a highly information-based data interaction system, the accuracy of interface traffic prediction is of practical significance for maintaining and improving the data interaction system.
[0003] Taking the banking system in the financial field as an example, the banking system is a complex system of financial data interaction and information processing. The stability and prediction accuracy of its interface traffic are related to the continuous operation of banking business, efficient allocation of resources and optimization of customer experience. As a key node for data exchange within and outside the banking system, the traffic characteristics of the interface not only reflect the current operating status of the banking system, but also an important reference for business trends and resource requirements in the future period.
[0004] In the related methods, when predicting the interface traffic, it is mostly used to predict the traffic of a single interface. When such methods are used to predict the traffic of multiple interfaces, the accuracy of the traffic prediction results is low. Summary of the invention
[0005] The embodiments of the present application provide an interface traffic prediction method, apparatus, device, medium and program product to achieve the purpose of improving the accuracy of traffic prediction results when performing traffic prediction on multiple interfaces.
[0006] In a first aspect, an embodiment of the present application provides an interface traffic prediction method, the method comprising: obtaining actual traffic data of multiple interfaces of the traffic to be predicted within a target time period before the time period to be predicted; inputting the actual traffic data and the space-time fusion matrix into an interface traffic prediction model to obtain the predicted traffic of the multiple interfaces within the time period to be predicted; wherein the space-time fusion matrix is a matrix used to characterize the space-time correlation of multiple interfaces, the space-time correlation includes time correlation and space correlation, the time correlation is used to characterize the degree of correlation between traffic changes over time between multiple interfaces, the space correlation is used to characterize the degree of correlation between interface calls between multiple interfaces, and the interface traffic prediction model is a model obtained by training a graph neural network model based on the actual traffic data of multiple interfaces before the target time period and the space-time fusion matrix.
[0007] In a possible implementation, the spatiotemporal fusion matrix is obtained in the following manner: a plurality of interfaces are respectively embedded and represented by a knowledge graph embedding model to obtain embedding vectors corresponding to each of the plurality of interfaces, where the knowledge graph embedding model is a pre-trained model for embedding and representing any one of the plurality of interfaces in the dimension of spatiotemporal correlation; based on the embedding vectors corresponding to each of the plurality of interfaces, the similarities between any two embedding vectors are respectively calculated to obtain a plurality of similarities corresponding to the plurality of interfaces; based on the plurality of similarities, a spatiotemporal fusion matrix is constructed.
[0008] In a possible implementation, the knowledge graph embedding model is trained in the following manner: based on training sample data of multiple interfaces, time correlation graphs and space correlation graphs of multiple interfaces are constructed, the time correlation graph is graph data used to characterize the time correlation of multiple interfaces, and the space correlation graph is graph data used to characterize the spatial correlation of multiple interfaces; based on the time correlation graph and the space correlation graph, multiple triplets are extracted, any triplet includes two interfaces and the correlation relationship between the two interfaces, and the correlation relationship includes a time correlation relationship, a spatial correlation relationship, or a spatiotemporal correlation relationship; the initial knowledge graph embedding model is trained based on multiple triplets to obtain a knowledge graph embedding model.
[0009] In one possible implementation, a spatiotemporal fusion matrix is constructed based on multiple similarities, including: determining the K most similar interfaces of each of the multiple interfaces based on the multiple similarities, the K most similar interfaces of any interface including the interfaces corresponding to the K largest similarities with the interface, K being a preset arbitrary positive integer; constructing the spatiotemporal fusion matrix based on the K most similar interfaces of each of the multiple interfaces and their corresponding similarities.
[0010] In a possible implementation, the method also includes: obtaining a time connection matrix, which is a matrix used to characterize the connection between each interface of a plurality of interfaces and itself; dividing the target time period into a plurality of time steps in turn, and sequentially splicing the space-time fusion matrix and the time connection matrix according to the order of the time steps to update the space-time fusion matrix; and inputting the updated space-time fusion matrix into an interface traffic prediction model to obtain predicted traffic of the plurality of interfaces in the time period to be predicted.
[0011] In a possible implementation, actual traffic data and a spatiotemporal fusion matrix are input into an interface traffic prediction model to obtain predicted traffic of multiple interfaces in a time period to be predicted, including: inputting actual traffic data and a spatiotemporal fusion matrix into an interface traffic prediction model to predict a first component and a second component of multiple interfaces in a time period to be predicted; wherein the first component is used to characterize the amount of change in the predicted traffic over time for multiple interfaces in the time period to be predicted; the second component is used to characterize the amount of fixed traffic over time for multiple interfaces in the time period to be predicted; based on the first component and the second component, the predicted traffic of multiple interfaces in the time period to be predicted is obtained.
[0012] In a second aspect, an embodiment of the present application provides an interface traffic prediction device, which includes: an acquisition module, used to obtain actual traffic data of multiple interfaces of the traffic to be predicted within a target time period before the time period to be predicted; a prediction module, used to input the actual traffic data and the space-time fusion matrix into an interface traffic prediction model to obtain the predicted traffic of multiple interfaces within the time period to be predicted; wherein the space-time fusion matrix is a matrix used to characterize the space-time correlation of multiple interfaces, and the space-time correlation includes time correlation and space correlation. The time correlation is used to characterize the degree of correlation between traffic changes over time between multiple interfaces, and the space correlation is used to characterize the degree of correlation between interface calls between multiple interfaces. The interface traffic prediction model is a model obtained by training the graph neural network model based on the actual traffic data of multiple interfaces before the target time period and the space-time fusion matrix.
[0013] In a possible implementation, the spatiotemporal fusion matrix is obtained in the following manner: a plurality of interfaces are respectively embedded and represented by a knowledge graph embedding model to obtain embedding vectors corresponding to each of the plurality of interfaces, where the knowledge graph embedding model is a pre-trained model for embedding and representing any one of the plurality of interfaces in the dimension of spatiotemporal correlation; based on the embedding vectors corresponding to each of the plurality of interfaces, the similarities between any two embedding vectors are respectively calculated to obtain a plurality of similarities corresponding to the plurality of interfaces; based on the plurality of similarities, a spatiotemporal fusion matrix is constructed.
[0014] In a possible implementation, the knowledge graph embedding model is trained in the following manner: based on training sample data of multiple interfaces, time correlation graphs and space correlation graphs of multiple interfaces are constructed, the time correlation graph is graph data used to characterize the time correlation of multiple interfaces, and the space correlation graph is graph data used to characterize the spatial correlation of multiple interfaces; based on the time correlation graph and the space correlation graph, multiple triplets are extracted, any triplet includes two interfaces and the correlation relationship between the two interfaces, and the correlation relationship includes a time correlation relationship, a spatial correlation relationship, or a spatiotemporal correlation relationship; the initial knowledge graph embedding model is trained based on multiple triplets to obtain a knowledge graph embedding model.
[0015] In one possible implementation, a spatiotemporal fusion matrix is constructed based on multiple similarities, including: determining the K most similar interfaces of each of the multiple interfaces based on the multiple similarities, the K most similar interfaces of any interface including the interfaces corresponding to the K largest similarities with the interface, K being a preset arbitrary positive integer; constructing the spatiotemporal fusion matrix based on the K most similar interfaces of each of the multiple interfaces and their corresponding similarities.
[0016] In a possible implementation, the acquisition module is also used to: obtain a time connection matrix, which is a matrix used to characterize the connection between each interface of a plurality of interfaces and itself; divide the target time period into a plurality of time steps in sequence, and sequentially splice the space-time fusion matrix and the time connection matrix according to the order of the time steps to update the space-time fusion matrix; input the updated space-time fusion matrix into the interface traffic prediction model to obtain the predicted traffic of the plurality of interfaces in the time period to be predicted.
[0017] In one possible implementation, the prediction module is specifically used to: input actual traffic data and the space-time fusion matrix into the interface traffic prediction model, and predict the first component and the second component of multiple interfaces in the time period to be predicted; wherein the first component is used to characterize the change in the traffic over time in the predicted traffic of multiple interfaces in the time period to be predicted; the second component is used to characterize the fixed amount of the traffic over time in the predicted traffic of multiple interfaces in the time period to be predicted; based on the first component and the second component, the predicted traffic of multiple interfaces in the time period to be predicted is obtained.
[0018] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a memory and a processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, so that the processor executes the first aspect above and / or various possible implementations of the first aspect.
[0019] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the first aspect above and / or various possible implementations of the first aspect.
[0020] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the above first aspect and / or various possible implementation methods of the first aspect.
[0021] The interface traffic prediction method, device, equipment, medium and program product provided by the embodiments of the present application, the method is to input the actual traffic data within the target time period and the space-time fusion matrix that characterizes the space-time correlation of the multiple interfaces into the pre-trained interface traffic prediction model to obtain the predicted traffic. On the one hand, the space-time fusion matrix can characterize the time correlation of the traffic changes of the multiple interfaces over time, and can also characterize the spatial correlation of the interface call relationship between the multiple interfaces. Therefore, based on the space-time fusion matrix, the interface traffic prediction model can provide the correlation information of the traffic changes between the multiple interfaces in the dual dimensions of time and space when predicting traffic, and then a more accurate prediction can be made for each interface based on the correlation information. On the other hand, the interface traffic prediction model is a model obtained after training the graph neural network model based on the actual traffic data of the multiple interfaces before the target time period and the space-time fusion matrix. Since both the spatiotemporal fusion matrix and actual traffic data can be represented as graph structured data, by training the graph neural network model, its data processing capability of processing the spatiotemporal fusion matrix and actual traffic data can be improved, so that the trained model has better prediction experience, which can be used to more accurately predict the traffic of multiple interfaces in the period to be predicted, and obtain the predicted traffic of multiple interfaces, thereby improving the accuracy of the multi-interface traffic prediction results.
[0022] After making high-accuracy traffic predictions for multiple interfaces, data transmission management can be performed on the system including the multiple interfaces to improve the overall data transmission efficiency of the system. For example, the flow rate limit of the interface with a larger predicted traffic among the multiple interfaces can be increased to increase the transmission speed of the interface, thereby improving the overall data transmission efficiency of the system. For another example, the calling relationship of some interfaces in the system can be adjusted according to the predicted traffic to balance the computing overhead of each interface during data transmission, thereby improving the overall data transmission efficiency of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0024] Figure 1 A schematic diagram of an application scenario provided in an embodiment of the present application;
[0025] Figure 2 Schematic diagram of the process of the interface traffic prediction method provided in the embodiment of the present application Figure 1 ;
[0026] Figure 3 A schematic diagram of the TransH embedding representation provided in an embodiment of the present application;
[0027] Figure 4A schematic diagram of updating the spatiotemporal fusion matrix provided in an embodiment of the present application;
[0028] Figure 5 Schematic diagram of the process of the interface traffic prediction method provided in the embodiment of the present application Figure 2 ;
[0029] Figure 6 A schematic diagram of the structure of an interface flow prediction device provided in an embodiment of the present application;
[0030] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0031] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0032] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0033] In the embodiments of the present application, words such as "first" and "second" are used to distinguish the same or similar items with substantially the same functions and effects. For example, the first electronic device and the second electronic device are only used to distinguish different electronic devices, and their order is not limited. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit them to be different.
[0034] In the embodiments of the present application, the words "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0035] In the embodiments of the present application, "at least one" means one or more, and "more" means two or more. "And / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.
[0036] In the technical solutions of the embodiments of the present application, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0037] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0038] Figure 1 A schematic diagram of an application scenario provided in an embodiment of the present application, such as Figure 1 As shown, the banking system includes multiple electronic devices arranged in multiple areas, such as multiple computers, routers, switches, and servers. These electronic devices can communicate over the network through interfaces such as Ethernet interfaces, optical fiber interfaces, serial interfaces, or logic interfaces to achieve the transmission and processing of financial data. In activities such as maintaining or evaluating the operating status of the banking system, it is necessary to predict the traffic of multiple interfaces in the banking system so as to carry out corresponding activities based on the predicted traffic of each interface.
[0039] In the related art, the methods of interface traffic prediction are mostly traffic prediction for a single interface. For example, a single interface is predicted based on statistical methods such as time series analysis or regression analysis. This type of method describes the law of interface traffic changes over time by constructing a mathematical model. For another example, a single interface is predicted based on machine learning methods such as support vector machines, random forests, or gradient boosting trees. This type of method learns the pattern of traffic changes from historical data through training models and predicts on new data. For another example, a single interface is predicted based on deep learning methods such as recurrent neural networks, long short-term memory networks, or convolutional neural networks and their variants. This type of method obtains prediction results through feature extraction and nonlinear modeling.
[0040] For example, when using statistical methods to predict a single interface, although a prediction model can be built based on historical data, it is limited by its linear assumption and is difficult to effectively capture nonlinear dynamic changes and emergencies in interface traffic. Therefore, when using this type of method to predict traffic for multiple interfaces, the prediction results obtained are less accurate.
[0041] When predicting a single interface using the random forest method, although random forest and lightweight gradient boosting decision tree can be combined for traffic prediction, it relies on relatively cumbersome manual feature engineering and has limited generalization capabilities. When faced with large-scale, high-dimensional interface traffic data in multi-interface scenarios, it is difficult to obtain more accurate prediction results.
[0042] When using convolutional kernels of different sizes to extract traffic data features in convolutional neural networks through deep learning methods, standard two-dimensional or three-dimensional grid data needs to be input. However, actual traffic data is often non-standard, irregular, or has an implicit complex topological structure, which makes it impossible for existing convolutional neural network models to fully utilize their feature extraction capabilities when processing multi-interface traffic data.
[0043] If the fully connected layer in the long short-term memory network is replaced with a convolutional layer to obtain a convolutional long short-term memory network to capture the traffic data characteristics of multiple interfaces, the long short-term memory network will be prone to gradient vanishing or gradient exploding when processing long sequences, which will make it unable to model the mutual influence relationship between multiple different interfaces, resulting in a decrease in the accuracy of its traffic prediction for multiple interfaces.
[0044] The inventors have found through research that the accuracy of the prediction results is limited due to many reasons when predicting interface traffic. For example, interface traffic has a large uncertainty, which will lead to a low accuracy of the prediction results. Specifically, interface traffic prediction is more dependent on historical traffic data, but historical traffic data is easily disturbed by various accidental factors such as network environment fluctuations and emergencies, resulting in increased difficulty in prediction and low accuracy. For another example, the network environment in which the interface traffic is located is more complex, and is affected by factors such as server configuration adjustments, changes in user behavior patterns, or network architecture upgrades. There may be more complex associations and interactions between the factors, which will increase the difficulty of capturing interface traffic characteristics and lead to a decrease in prediction accuracy. For another example, the change of interface traffic presents a high degree of dynamics, and its changes over time and changes with interface associations usually do not follow simple linear laws. Therefore, it is necessary to capture the changing characteristics of interface traffic in a nonlinear and dynamic manner. This factor will also limit the accuracy of the prediction, resulting in a low accuracy of the prediction results.
[0045] Since the above-mentioned related technologies mostly focus on the traffic prediction of a single interface, the interface call relationship between interfaces in multiple interfaces will be ignored. For example, there may be an interface call relationship between any two interfaces. When an interface is frequently called, the traffic of the interface that has an interface call relationship with the interface is likely to increase. Therefore, in the absence of a demand for traffic prediction for multiple interfaces, the related technologies will not pay too much attention to the interface call relationship between interfaces. When the existing related methods are used to predict the traffic of multiple interfaces separately, the problem of low accuracy of the traffic predicted for each interface will result.
[0046] In view of this, an embodiment of the present application provides an interface traffic prediction method, which focuses on the interface call relationship between multiple interfaces in the traffic prediction scenario of multiple interfaces. When the method predicts traffic for multiple interfaces, the actual traffic data in the target period before the period to be predicted and the spatiotemporal fusion matrix representing the spatiotemporal correlation of the multiple interfaces are input into a pre-trained interface traffic prediction model to predict the predicted traffic of multiple interfaces in the period to be predicted.
[0047] On the one hand, the time-space fusion matrix can characterize the correlation between the traffic changes over time among the multiple interfaces, and can also characterize the correlation between the interface calls among the multiple interfaces. Therefore, the time-space fusion matrix can provide the interface traffic correlation information of the multiple interfaces in the dual dimensions of time correlation and space correlation for the interface traffic prediction model, which helps to improve the prediction accuracy of the interface traffic prediction model.
[0048] On the other hand, the interface traffic prediction model is a model obtained after training the graph neural network model based on the actual traffic data of the multiple interfaces before the target time period, that is, the historical traffic data, and the spatiotemporal fusion matrix. Since each of the multiple interfaces can be represented as an entity, the calling relationship between interfaces or the association relationship between the traffic between interfaces that changes over time can be represented as edges between entities, therefore, the actual traffic data of the multiple interfaces in the target time period before the time period to be predicted can be represented as graph structure data, and the spatiotemporal fusion matrix can also be converted into graph structure data. The interface traffic prediction model obtained by training the graph neural network model has a good ability to process graph structure data, so the interface traffic prediction model can make more accurate predictions based on the actual traffic data and the spatiotemporal fusion matrix, and obtain prediction results with higher accuracy, thereby improving the accuracy of traffic prediction for multiple interfaces.
[0049] The technical solution of the present application is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0050] Figure 2 Schematic diagram of the process of the interface traffic prediction method provided in the embodiment of the present application Figure 1 The execution subject of the method may be an electronic device with corresponding data storage and computing capabilities, such as a computer, a server or a server cluster. Figure 2 As shown, the method includes:
[0051] S201, obtaining actual traffic data of multiple interfaces of traffic to be predicted in a target time period before the time period to be predicted.
[0052] Exemplarily, the interface may be a network device interface, a server interface, or a wireless air interface.
[0053] A network device interface can be understood as a connection point in network devices such as routers, switches, and firewalls for data exchange with other devices or networks. Network device interfaces include Ethernet interfaces, such as registered jack 45 (RJ-45) interfaces, fiber optic interfaces, such as small form-factor pluggable (SFP) or enhanced small form-factor pluggable plus (SFP+), and serial interfaces, such as recommended standard 232 (RS-232) interfaces. Network device interfaces can support multiple network protocols, such as transmission control protocol / internet protocol (TCP / IP) or Ethernet, to achieve data packet transmission, routing, and switching.
[0054] The server interface can be understood as the connection point for the server to communicate with other computer systems or devices. The server interface can be a physical interface, such as a universal serial bus (USB), a high definition multimedia interface (HDMI) or a network interface card, or a logical interface, such as an application programming interface (API) or a World Wide Web (Web) service interface. The server interface can support multiple protocols, such as the hyper text transfer protocol (HTTP), the file transfer protocol (FTP), the secure shell protocol (SSH), etc., for processing client requests, providing services and resource access.
[0055] The wireless air interface can be understood as the physical medium for devices to communicate through radio waves in a wireless communication system. It is the communication channel between wireless devices. The wireless air interface can be used for a variety of wireless technologies, such as wireless fidelity (WIREless-Fidelity, WIFI), cellular networks (such as 4G or 5G) and Bluetooth. The wireless air interface involves frequency selection, channel allocation, modulation and coding technologies to ensure reliable transmission of data in a wireless environment.
[0056] For example, a banking system includes multiple network devices and multiple servers for receiving and processing request data input from a large number of user terminals, and sending response data in response to each request data to the user terminal after processing, so that the user terminal can obtain transaction information related to banking business, etc. The banking system can also receive request data such as financial transactions, settlements and statistics transmitted within the bank, and feedback corresponding response data. All interfaces or some of the more important interfaces of each network device and each server in the banking system can be determined as interfaces among multiple interfaces. Traffic prediction of these interfaces can predict the amount of data received and / or output by these interfaces in a certain period of time in the future, and then monitor, maintain, evaluate or adjust the banking system.
[0057] Exemplarily, the time period to be predicted may be any time period in the future, and the target time period before the time period to be predicted may be a known time period associated with the time period to be predicted. For example, it may be a preset time period adjacent to the time period to be predicted. The actual flow data in the target time period may be measured flow data obtained by detecting multiple interfaces of the flow to be predicted through sensors or detection devices.
[0058] For example, in a banking system, 100 interfaces are determined as multiple interfaces for traffic to be predicted, and the output traffic of the 100 interfaces can be acquired in real time through software and / or hardware devices for traffic detection. Assuming that it is planned to predict the traffic of the 100 interfaces between 3 and 4 p.m. on the same day, the traffic of the 100 interfaces between 2 and 3 p.m. on the same day can be acquired as the actual traffic data in the target time period before the time period to be predicted, wherein the time period between 3 and 4 p.m. on the same day is the time period to be predicted, and the time period between 2 and 3 p.m. on the same day is the target time period before the time period to be predicted. It should be understood that the length of the time period to be predicted and the length of the target time period can be the same or different, and the time period to be predicted and the target time period can be adjacent to a shorter time interval or an adjacent longer time interval.
[0059] S202, input the actual traffic data and the spatiotemporal fusion matrix into the interface traffic prediction model to obtain the predicted traffic of multiple interfaces in the time period to be predicted. Among them, the spatiotemporal fusion matrix is a matrix used to characterize the spatiotemporal correlation of multiple interfaces, and the spatiotemporal correlation includes time correlation and space correlation. The time correlation is used to characterize the correlation degree of traffic changes between multiple interfaces over time, and the space correlation is used to characterize the correlation degree of interface calls between multiple interfaces. The interface traffic prediction model is a model obtained by training the graph neural network model based on the actual traffic data of multiple interfaces before the target time period and the spatiotemporal fusion matrix.
[0060] Exemplarily, the spatiotemporal fusion matrix can be understood as data information that represents the spatiotemporal correlation between multiple interfaces of the traffic to be predicted in the form of a matrix. For example, the rows and columns in the spatiotemporal fusion matrix can both be the multiple interfaces arranged in sequence, and the element value of a row or a column in the spatiotemporal fusion matrix can be used to indicate the spatiotemporal correlation between the interface of the row corresponding to the element value and the interface of the column corresponding to the element value.
[0061] Spatiotemporal correlation may include two aspects: time correlation and space correlation. Among them, time correlation can be understood as the traffic of any two interfaces among the multiple interfaces, and the degree of change of the two traffic over time shows a certain degree of correlation. Spatial correlation can be understood as the existence of an interface call relationship or the absence of an interface call relationship between any two interfaces among the multiple interfaces. Any element value in the spatiotemporal fusion matrix can be a comprehensive value obtained by fusing the time correlation and space correlation between the two interfaces corresponding to the element value, so as to comprehensively characterize the time correlation and space correlation between the two interfaces through the comprehensive value.
[0062] In a possible implementation, the spatiotemporal fusion matrix is obtained in the following manner: a plurality of interfaces are respectively embedded and represented by a knowledge graph embedding model to obtain embedding vectors corresponding to each of the plurality of interfaces, where the knowledge graph embedding model is a pre-trained model for embedding and representing any one of the plurality of interfaces in the dimension of spatiotemporal correlation; based on the embedding vectors corresponding to each of the plurality of interfaces, the similarity between any two embedding vectors is respectively calculated to obtain a plurality of similarities corresponding to the plurality of interfaces; based on the plurality of similarities, a spatiotemporal fusion matrix is constructed.
[0063] Exemplarily, the knowledge graph embedding model can be a model for embedding representation of multiple interfaces in the dimension of spatiotemporal correlation, and the knowledge graph embedding model can be obtained through model training based on the initial knowledge graph embedding model. Among them, the initial knowledge graph embedding model can be any model that can implement knowledge graph embedding technology, for example, the initial knowledge graph embedding model can be translation embedding (TransE), translation embedding on hyperplanes (TransH) or translation embedding on relation-specific spaces (TransR), etc. Knowledge graph embedding technology refers to a method for converting entities and relationships in a knowledge graph into a low-dimensional vector space representation. This technology aims to capture the structural and semantic information in the knowledge graph in a vectorized way, so that the machine learning model can process and utilize this information more effectively.
[0064] In a possible implementation, the knowledge graph embedding model can be trained in the following manner: based on the training sample data of multiple interfaces, construct time correlation graphs and space correlation graphs of multiple interfaces, the time correlation graph is graph data used to characterize the time correlation of multiple interfaces, and the space correlation graph is graph data used to characterize the spatial correlation of multiple interfaces; based on the time correlation graph and the space correlation graph, extract multiple triplets, any triplet includes two interfaces and the correlation relationship between the two interfaces, and the correlation relationship includes a time correlation relationship, a spatial correlation relationship, or a spatiotemporal correlation relationship; train the initial knowledge graph embedding model based on the multiple triplets to obtain the knowledge graph embedding model.
[0065] Exemplarily, the training sample data of multiple interfaces may be sample data used to train the multiple interfaces. The training sample data may include data that can characterize the temporal correlation between the multiple interfaces, such as historical actual traffic data, historical weather data, and historical event data; the training sample data may also include data that can characterize the spatial correlation between the multiple interfaces, such as interface call data between the multiple interfaces.
[0066] Through training sample data, time correlation graphs and spatial correlation graphs about multiple interfaces can be constructed, wherein the time correlation graph can be graph data used to characterize the time correlation of multiple interfaces, and the graph data can be understood as graph structure data, and the spatial correlation graph can be graph data used to characterize the spatial correlation of multiple interfaces.
[0067] Exemplarily, time correlation can also be understood as the correlation or trend consistency between the traffic data of each interface at different time points or time periods. In the scenario of multi-interface traffic prediction, the interfaces may not be directly connected, but some or all of the interfaces may show similar traffic change patterns due to shared services or functions, external factors such as weather and events, and user behavior patterns. Therefore, even if two interfaces do not seem to be directly related, there may be certain similarities in their traffic changes. However, the interface traffic prediction method of the prior art has failed to make full use of this information. Some existing methods completely ignore the time characteristics of historical traffic, and some other existing methods, although using some time information, usually only focus on the time similarity of the system as a whole, and ignore the finer-grained time correlation between any two interfaces. In order to fully explore the time correlation between multiple interfaces to improve the prediction accuracy of interface traffic, the method provided in the embodiment of the present application can combine time information at a finer granularity to explore the time correlation between different interfaces.
[0068] For example, the actual traffic data, weather data, and event data of the multiple interfaces collected during a certain week in history may be used to construct a training sample data in the training sample data set.
[0069] For example, a week is decomposed into a continuous sequence of time slots, each of which corresponds to a fixed time period in a week. Assuming that a week is divided into ω time slots, the length of each time slot can be expressed as 1 / ω. For any of the multiple interfaces, an N ω The dimensional traffic feature vector h can be used to vectorize the actual traffic data of the interface in the week. Among them, the jth element x of the traffic feature vector (j) It can be the average value of the historical traffic recorded by the interface in the jth time slot of the week.
[0070] Taking into account the influence of external factors such as weather and events, the embodiment of the present application also combines the weather feature vector and event feature vector corresponding to the corresponding time slot. First, N ω dimensional weather feature vector p, such as The jth element y (j) It can be the weather type corresponding to the jth time slot in the week. (j) It can be numerical data obtained through the mapping relationship between weather type and weather data value. The mapping relationship between weather type and weather data value can be a preset mapping relationship for numerical conversion of weather type, for example, if the weather type is sunny, it can be mapped to weather data value 0.1, if the weather type is light rain, it can be mapped to weather data value 0.2, if the weather type is heavy snow, it can be mapped to weather data value 0.8, etc.
[0071] Secondly, we can construct N ω dimensional event feature vector q, such as The jth element z (j) It can be the event ID corresponding to the jth time slot in the week. Similarly, the element z (j) It can be numerical data obtained by mapping the event identifier to the event data value. The event can be, for example, a holiday or a special event. The mapping relationship between the event identifier and the event data value can be similar to the mapping relationship between the weather type and the weather data value described above, and will not be repeated here.
[0072] For the traffic feature vector, weather feature vector and event feature vector, based on the importance of each feature vector in traffic prediction, random forest and other methods can be used to assign weights, so that the traffic feature vector, weather feature vector and event feature vector are fused by the assigned weights to obtain the time feature vector of the interface, which can be expressed as the following formula (1):
[0073] l=w1h + w2p + w3q (1)
[0074] Among them, l represents the time feature vector, w1, w2, and w3 are the weights assigned to the traffic feature vector h, the weather feature vector p, and the event feature vector q, respectively.
[0075] In the embodiment of the present application, the time similarity between two interfaces corresponding to any two time feature vectors can be measured by the distance between the two time feature vectors. For example, the time similarity between interface v and interface u can be determined by calculating the Euclidean distance, which can be expressed as the following formula (2):
[0076]
[0077] Among them, sim vu represents the time similarity between interface v and interface u, represents the i-th element in the time characteristic vector of interface v, Represents the i-th element in the time characteristic vector of interface u.
[0078] When constructing the time correlation graph, in order to reduce noise and maintain the sparsity of the time correlation graph, for any interface, k interfaces with the highest time similarity can be selected as the neighbors of any interface, so as to construct a time correlation graph C = (V, E time ), k can be any positive integer. Where V represents the interface set composed of the multiple interfaces, v∈V and u∈V, E time Indicates the time correlation between two interfaces.
[0079] For example, the time similarity between interface u and other interfaces is calculated respectively, and the interfaces corresponding to the largest k time similarities are determined as neighbors of interface u. If interface v is one of the k neighbors of interface u, then (u,v)∈E time , it can be understood that interface v and interface u satisfy the time correlation; if interface v is not one of the k neighbors of interface u, then It can be understood that interface v and interface u do not satisfy the time correlation.
[0080] When constructing the time-correlation graph C, each interface is a node in the graph. For any two interfaces that satisfy the time correlation, the two interfaces that satisfy the time correlation can be connected by an edge. The edge in the graph indicates that the two nodes have time correlation, and the time-correlation graph C can be obtained. The time-correlation graph C can be converted into the corresponding time-correlation matrix A TG , the time correlation matrix A TG It can be obtained by the following formula (3):
[0081]
[0082] Among them, A TG (i,j) is the element in the i-th row and j-th column of the time correlation matrix. The i-th row corresponds to interface v, and the j-th column corresponds to interface u. TopK(v) represents the set of k neighbors of interface v. If interface u belongs to the set of k neighbors of interface v, then the time correlation matrix A TG Middle A TG The element value of (i,j) is 1 if interface u does not belong to the set of k neighbors of interface v. Then the time correlation matrix A TG Middle A TG The element value of (i,j) is 0.
[0083] For example, in interface traffic prediction, spatial correlation can be understood as the correlation of traffic changes between different interfaces due to dependencies and mutual influences. The "space" here is not the geographical location space in the traditional sense, but refers to the relative position or relationship of the interface in the network architecture, business logic or data flow. The dependency between interfaces can be measured in a variety of ways, for example, it can be measured in the following ways.
[0084] For interface v and interface u, v∈V and u∈V, construct a spatial correlation graph R=(V,E road ), where V represents the interface set composed of the multiple interfaces, and E road Represents the spatial correlation between two interfaces. If there is an interface call relationship between interface v and interface u, for example, interface v will call interface u during data transmission, then (v,u)∈E road Indicates that there is spatial correlation between interface v and interface u.
[0085] When constructing the spatial correlation graph R, each interface is a node in the graph. For any two interfaces that have spatial correlation, the two interfaces that satisfy the spatial correlation can be connected by an edge. The edge in the graph indicates that there is spatial correlation between the two nodes, and the spatial correlation graph R can be obtained. The spatial correlation graph R can be converted into the corresponding spatial correlation matrix A SG , the spatial correlation matrix A SG It can be obtained by the following formula (4):
[0086]
[0087] Among them, A SG (i,j) represents the element in the i-th row and j-th column of the spatial correlation matrix. If the interface v i With interface v j If there is an interface call relationship between them, then A SG The element value of (i,j) is 1; if the interface v i With interface v j There is no interface call relationship between them, then A SG The element value of (i,j) is 0. The spatial correlation matrix A SG The element values on the diagonal of can be set to 1, indicating that there is an interface call relationship between any interface and itself. This setting can avoid ignoring the characteristics of the node itself in the spatial correlation graph.
[0088] When predicting interface traffic, considering both temporal correlation and spatial correlation is of great significance for improving prediction accuracy. Temporal and spatial correlation is a combination of both temporal correlation and spatial correlation. Temporal and spatial correlation can be understood as the interdependence between traffic changes at different interface locations and at different time points in interface traffic prediction. Temporal and spatial correlation covers the comprehensive impact of user behavior patterns, business peak hours, and external events (such as promotional activities or system maintenance events) on interface traffic.
[0089] In actual applications, the traffic changes of interfaces are not isolated. The traffic of each interface will propagate and affect each other due to the correlation between interfaces. For example, the interface of a high-load server may affect the traffic of other related interfaces through the interface call chain, and then trigger a chain reaction in the entire system composed of multiple interfaces. If the temporal and spatial correlation is ignored, the results of traffic prediction will often deviate from reality, which will increase the difficulty and uncertainty of interface management and resource scheduling. Therefore, effectively incorporating temporal correlation and spatial correlation into the interface traffic prediction model will help improve the accuracy and reliability of the prediction.
[0090] In order to fully combine the information in the time correlation graph and the space correlation graph, the embodiment of the present application provides a learning-based method to learn the embedding vector of each interface, thereby capturing the mutual influence of interface traffic between adjacent spaces and similar time points.
[0091] Exemplarily, graph data fusion can be performed based on the time correlation graph and the space correlation graph to obtain a spatiotemporal knowledge graph, and multiple triples can be extracted from the spatiotemporal knowledge graph, wherein any triple includes two interfaces and a correlation relationship between the two interfaces, and the correlation relationship includes a time correlation relationship, a spatial correlation relationship, or a time-space correlation relationship.
[0092] For example, based on the constructed time-related graph C and space-related graph R, a spatiotemporal knowledge graph can be constructed. in, represents entities in the spatiotemporal knowledge graph, represents the edge in the spatiotemporal knowledge graph, Represents the relationship type of an entity, that is, the correlation between two interfaces.
[0093] Specifically, The types of relationships represented include edges r that are in the spatial correlation graph but not in the temporal correlation graph n , i.e., spatial correlation relationship; virtual edge r in the temporal correlation graph but not in the spatial correlation graph t , that is, the time correlation relationship; the edge r in both the spatial correlation graph and the temporal correlation graph nt , that is, the space-time correlation relationship.
[0094] Therefore, each edge The corresponding relationship A triple can be constructed. For example, (u,r n ,v) means that the edge corresponding to (u,v) is in the spatial correlation graph but not in the temporal correlation graph.
[0095] In order to effectively reveal the spatiotemporal correlation between interfaces, the present embodiment can use TransH as the initial knowledge graph embedding model to learn the spatiotemporal knowledge graph. The entity embedding representation in is used to capture the interactions and correlations between multiple interfaces.
[0096] Figure 3 A schematic diagram of the TransH embedding representation provided in the embodiment of the present application, such as Figure 3 As shown, for the spatiotemporal knowledge graph For any triple (u, r, v) in the above formula, we can first embed the entities corresponding to interface u and interface v into h(u) = e u and h(v)=e v Projection onto hyperplane w r The constraint can be expressed as ||w r ||2=1, the projection embedding after projection can be expressed by the following formula (5) and formula (6):
[0097]
[0098] in, and Respectively represent e u and e v The projected embedding of r represents a hyperplane, represents the transposed matrix of the hyperplane. u and e v They respectively represent the embedding vectors obtained after entity embedding of interface u and interface v through h(·). h(·) can be understood as an embedding function for embedding vector representation of the interface, and the embedding function can be a function obtained by learning after training on the basis of the initial embedding function. Through the learned h(·), each of the multiple interfaces can be embedded and represented respectively. For example, in the initial stage of training, each interface can be numbered, and the number of each interface can be input into the initial embedding function for embedding representation, and the parameters of the initial embedding function can be adjusted through each training so that the initial embedding function can more and more accurately represent the embedding vector of each interface. After satisfying the embedding vector representation accuracy, h(·) can be obtained. The initial embedding function can be the embedding function in the initial TransH model.
[0099] like Figure 3 As shown, for a relationship r, on the hyperplane w r Define a translation vector d on r If (u, r, v) is a correct triple, then we expect and On the hyperplane, we can translate the vector d r The translation vector d is connected with a small error; the correct triplet can be understood as a positive example or a positive triplet. r It is also the training object in the process of training the initial knowledge graph embedding model. The translation vector d r It can be understood as the embedding vector of the correspondence between the two interfaces in the triple.
[0100] In a triple, if both the two interfaces and the edge between the two interfaces are correct, then the triple is a positive example, and multiple positive examples can form a set of positive examples. In a triple, if either the two interfaces or the edge between the two interfaces is incorrect, then the triple is a negative example or a negative example triple, and multiple negative examples can form a set of negative examples. For example, by modifying one or two interfaces in a positive example to other interfaces, or modifying the relationship type between two interfaces so that the two interfaces and the relationship in the modified triple do not correspond correctly, the process of obtaining a negative example from a positive example is achieved.
[0101] In the embodiment of the present application, the rationality of the triple can be calculated by the scoring function f(·) represented by the following formula (7):
[0102]
[0103] Among them, f r (e u ,e v ) means that in the triple (u, r, v), e u and e v The scoring function value. If the relationship between the triples is correct, the expected result of the scoring function is a lower value, otherwise it is a higher value. In order to achieve the expected result of the scoring function, the margin-based ranking loss (MarginRankingLoss) can be used as the loss function to train the initial knowledge graph embedding model. The margin-based ranking loss can be expressed as the following formula (8):
[0104]
[0105] in, represents the value of the loss function, Indicates that after the value in the square brackets is compared with 0, if the value is greater than 0, the value is taken; if the value is less than or equal to 0, the value is taken. (u, r, v) represents a positive example, (u′, r′, v′) represents a negative example, Δ represents the set of positive examples, Δ′ represents the set of negative examples, and γ represents the boundary between positive examples and negative examples. The boundary can be understood as a predefined distance difference threshold. It is required that for a positive example and a negative example derived from the positive example, the distance difference between the two is greater than γ, so that the model can effectively distinguish between positive examples and negative examples during model training.
[0106] Based on the above scoring function and loss function, combined with multiple triplets, the initial knowledge graph embedding model can be trained for multiple rounds. After training, the initial knowledge graph embedding model can learn an embedding function h(·) that can better preserve spatial correlation and temporal correlation. Thus, each interface can be embedded through the embedding function to obtain the corresponding embedding vector.
[0107] In this embodiment, based on the training sample data, the time correlation graph and the space correlation graph of the multiple interfaces are first constructed, which can respectively determine the time correlation, spatial correlation and spatiotemporal correlation between any two interfaces; based on the time correlation graph and the space correlation graph, multiple triples are extracted, and the initial knowledge graph embedding model can be trained through the multiple triples, and then a knowledge graph embedding model that can embed and represent multiple interfaces more accurately can be obtained.
[0108] Through training, the initial knowledge graph embedding model can iteratively learn how to embed multiple interfaces in the embedding vector space. After the training is completed, the obtained knowledge graph embedding model can embed each interface more accurately and output the embedding vector corresponding to each interface.
[0109] After outputting the embedding vectors corresponding to each interface, the similarity between any two embedding vectors can be calculated using a similarity calculation method to obtain multiple similarities corresponding to multiple interfaces. For example, the distance between any two embedding vectors can be calculated using a Euclidean distance function, a cosine distance function, or other distance functions, and the similarity can be obtained through the distance.
[0110] Exemplarily, in order to obtain the spatiotemporal correlation between different interfaces in different relationships, the distance between the embedding vectors of two interfaces can be determined by a distance function. Taking the distance between the embedding vector of interface u and the embedding vector of interface v as an example, it can be expressed by the following formula (9):
[0111] d(h(u),h(v)) = ||h(u) + e r - h(v)|| (9)
[0112] Where d(·) represents the distance function, h(u) and h(v) represent the embedding vector of interface u and the embedding vector of interface v respectively calculated by the learned embedding function h(·), and e r The embedding vector representing the relationship between interface u and interface v after learning, ||·|| represents L2 regularization. When the binary distance is close, the distance function d(·) will get a lower result, indicating that the distance between the two embedding vectors is close; otherwise, a higher result will be obtained.
[0113] Through this distance function, the distance between the embedding vectors represented by the knowledge graph embedding model can be more accurately calculated in the embedding vector space, so that the calculated distance can more accurately measure the gap between the embedding vectors.
[0114] Exemplarily, in order to obtain a higher similarity when the distance is closer, the embodiment of the present application provides an entity relationship similarity function s(·) to calculate the similarity of the embedding vectors between interface u and interface v in relationship r through the entity relationship similarity function s(·). The similarity function s(·) can be specifically expressed by the following formula (10):
[0115] s(h(u),h(v))=e -d(h(u),h(v)) (10)
[0116] Among them, s(h(u), h(v)) represents the similarity between the embedded vectors, and e represents the logarithmic operation. The similarity function s(·) can convert the distance value of the two embedded vectors into a preset numerical range (for example, 0 to 1), which is convenient for subsequent application or processing of the similarity. After the conversion, a larger distance value can be converted into a smaller similarity, and a smaller distance value can be converted into a larger similarity, so that the similarity can be effectively represented by the distance value.
[0117] The similarity between any two embedding vectors can be calculated by the similarity function s(·), and then multiple similarities can be obtained. After obtaining multiple similarities, a spatiotemporal fusion matrix can be constructed according to the multiple similarities.
[0118] In a possible implementation, when constructing a spatiotemporal fusion matrix based on multiple similarities, it can be specifically implemented in the following manner: based on multiple similarities, determine the K most similar interfaces of each of the multiple interfaces, the K most similar interfaces of any interface include the interfaces corresponding to the K largest similarities with the interface, K is a preset arbitrary positive integer; construct a spatiotemporal fusion matrix based on the K most similar interfaces of each of the multiple interfaces and their corresponding similarities.
[0119] Exemplarily, similar to the process of constructing the time correlation graph described above, for any interface among the multiple interfaces, the interfaces corresponding to the largest K similarities with the interface can be determined as the K most similar interfaces according to the similarity between the interface and other interfaces, and the similarity between the K most similar interfaces and the interface is determined as the element value of the interface in the spatiotemporal fusion matrix, which can be specifically expressed by the following formula (11):
[0120]
[0121] Among them, A ST (i,j) represents the element in the i-th row and j-th column of the spatiotemporal fusion matrix, and the i-th row corresponds to the interface v i , column j corresponds to interface v j ,TopK(v j ) indicates interface v j The K most similar interfaces of i Belongs to interface v j The K most similar interfaces of the time-space fusion matrix A ST Middle A ST The element value of (i,j) is the similarity s(h(v i ),h(v j )), if the interface v i Does not belong to interface v j The K most similar interfaces of the time-space fusion matrix A ST Middle A ST The element value of (i, j) is 0. Based on this, the noise can be reduced and the sparsity of the spatiotemporal fusion matrix can be maintained.
[0122] In this embodiment, by determining the K most similar interfaces through similarity, the element values of two interfaces with smaller similarity in the space-time fusion matrix can be excluded, and then a space-time fusion matrix that maintains moderate sparsity and less interference noise can be constructed, which can improve the representation of the space-time correlation between any two interfaces by the space-time fusion matrix.
[0123] For example, the spatiotemporal fusion matrix can also be converted into a spatiotemporal fusion graph of graph structure data. ST After normalization, we can get the spatiotemporal fusion map Specifically, the normalization process can be performed using the following formula (12):
[0124]
[0125] in, represents the spatiotemporal fusion graph constructed based on similarity, and D represents the spatiotemporal fusion matrix A ST The derived out-degree diagonal matrix, D = diag(AST ).
[0126] In this embodiment, the knowledge graph embedding model is a pre-trained model for embedding and representing any interface in the dimension of spatiotemporal correlation. Through pre-training, the knowledge graph embedding model can learn to embed and represent the multiple interfaces separately in the dimension of spatiotemporal correlation, so that the embedding vector corresponding to any interface can more accurately characterize the characteristics of the interface in the dual dimensions of time correlation and spatial correlation among the multiple interfaces and between the interfaces. Based on this, the spatiotemporal fusion matrix constructed by the similarity between the embedding vectors can more accurately represent the spatiotemporal correlation between any two interfaces in the multiple interfaces.
[0127] Exemplarily, the interface traffic prediction model is a model obtained by training the graph neural network model based on actual traffic data of multiple interfaces before the target time period and the spatiotemporal fusion matrix.
[0128] The period before the target time period can be understood as a time period that has passed, that is, a historical time period, and the actual traffic data before the target time period can be understood as the historical actual traffic data of the multiple interfaces.
[0129] The graph neural network model can be any model that can process graph data, for example, it can be a spatio-temporal fusion graph neural network (STFGNN), a spatio-temporal synchronous graph convolutional network (STSGCN), or a first-order graphical stationary model (FOGS).
[0130] Through the actual traffic data before the target period and the spatiotemporal fusion matrix that characterizes the spatiotemporal correlation of the multiple interfaces, the graph neural network model can make the trained graph neural network predict the future interface traffic based on the historical actual traffic data and the spatiotemporal correlation between multiple interfaces. In addition, both the actual traffic data and the spatiotemporal fusion matrix can be represented as graph structure data. Therefore, the interface traffic prediction model obtained after training can more accurately predict the predicted traffic of each of the multiple interfaces based on the actual traffic data and the information in the graph data expressed by the spatiotemporal fusion matrix.
[0131] An embodiment of the present application provides an interface traffic prediction method, which inputs the actual traffic data within the target time period and the spatiotemporal fusion matrix that characterizes the spatiotemporal correlation of the multiple interfaces into a pre-trained interface traffic prediction model to obtain predicted traffic. On the one hand, the spatiotemporal fusion matrix can characterize the temporal correlation of the traffic changes of the multiple interfaces over time, and can also characterize the spatial correlation of the interface call relationships between the multiple interfaces. Therefore, based on the spatiotemporal fusion matrix, the interface traffic prediction model can provide correlation information of the traffic changes between the multiple interfaces in the dual dimensions of time and space when predicting traffic, and then a more accurate prediction can be made for each interface based on the correlation information. On the other hand, the interface traffic prediction model is a model obtained after training the graph neural network model based on the actual traffic data of the multiple interfaces before the target time period and the spatiotemporal fusion matrix. Since both the spatiotemporal fusion matrix and actual traffic data can be represented as graph structured data, by training the graph neural network model, its data processing capability of processing the spatiotemporal fusion matrix and actual traffic data can be improved, so that the trained model has better prediction experience, which can be used to more accurately predict the traffic of multiple interfaces in the period to be predicted, and obtain the predicted traffic of multiple interfaces, thereby improving the accuracy of the multi-interface traffic prediction results.
[0132] For example, the spatial correlation graph can reflect the interface call relationship between interfaces, and the time correlation graph can reflect the connection between the traffic changes between interfaces in the time dimension, but the time correlation graph does not include the association between each node and itself at similar time points. Since the interface traffic is not completely independent at different time points, but there is a certain correlation and lag, this means that the interface traffic change of a certain interface in the previous time period may affect the interface status of the current time period. Therefore, the interface status of the current time period will also affect the interface status of the future time period, which reflects the time dependence.
[0133] Considering the associated information of the interface on the time axis can help correctly handle this time dependency and avoid information loss or misleading. Based on this, the time-space fusion matrix can be updated so that the time-space fusion matrix incorporates information about the impact of time dependency on interface traffic changes, thereby improving the accuracy of the time-space fusion matrix in representing the time-space correlation of multiple interfaces. To achieve this goal, the time-space fusion matrix can be updated by connecting the interface to itself at adjacent time steps.
[0134] In a possible implementation, the method also includes: obtaining a time connection matrix, which is a matrix used to characterize the connection between each interface of a plurality of interfaces and itself; dividing the target time period into a plurality of time steps in turn, and sequentially splicing the space-time fusion matrix and the time connection matrix according to the order of the time steps to update the space-time fusion matrix; inputting the updated space-time fusion matrix into the interface traffic prediction model to obtain the predicted traffic of the plurality of interfaces in the time period to be predicted.
[0135] Exemplarily, the time connection matrix can be a matrix that can connect each of the multiple interfaces to each interface itself. For example, the time connection matrix can be constructed and obtained through the unit matrix. Specifically, a matrix of the multiple interfaces with the same arrangement order of rows and columns is constructed, and the element values on the main diagonal of the matrix are set to 1, and the element values of other elements are set to 0, then a matrix representing the connection between each of the multiple interfaces and itself can be obtained, that is, the time connection matrix is obtained.
[0136] A time step can be understood as a unit time period when a time period is divided into equal parts. After the target time period is divided into equal parts per unit time, multiple time steps of the same length can be obtained. By dividing the target time period into time steps, the target time period can be subdivided into multiple unit time periods of the same length, and then the connection relationship between each interface and itself can be established on two adjacent time steps. When the spatiotemporal fusion matrix is updated based on the time connection matrix, the representation information of the interface's own state can be added to the updated spatiotemporal fusion matrix, so that the updated spatiotemporal fusion matrix can incorporate the interface's time dependency when representing the spatiotemporal correlation of the interface, thereby enhancing the comprehensiveness and representation power of the spatiotemporal correlation.
[0137] For example, the temporal connection matrix can be expressed as A TC , when constructing the time connection matrix, if the previous time step and the next time step are the same interface, then A TC The element value of the corresponding element can be set to 1, otherwise it can be set to 0.
[0138] When the spatiotemporal fusion matrix and the time connection matrix are sequentially spliced according to the order of each time step to update the spatiotemporal fusion matrix, the following method can be used: Figure 4 The method shown is implemented.
[0139] Figure 4 A schematic diagram of updating the spatiotemporal fusion matrix provided in an embodiment of the present application, Figure 4 Showing the updated space-time fusion matrix The specific composition of is composed of two |V|×|V| matrices, |V| represents the number of the multiple interfaces, and Kst represents the number of time steps. Figure 4Kst is 3, indicating that there are 3 time steps in total.
[0140] like Figure 4 As shown, assuming that the current time step t = 2, the time connection matrix A in the circle TC represents the connectivity between the same nodes from time step t = 2 to time step t = 3. For each interface lst, it can be numbered from 1 to |V|, then lst∈{1,2,…,|V|}. When updating the spatiotemporal fusion matrix from time step t = 2 to time step t = 3, i = (t+1)*|V|+lst = 3|V|+lst, j = t*|V|+lst = 2|V|+lst, then A STFG (i,j)=1, indicating the connection between the same interface and itself at adjacent time steps in the time connection matrix.
[0141] The space-time fusion matrix can be updated based on the time connection matrix, and the updated space-time fusion matrix can be input into the interface traffic prediction model together with the actual traffic data in the target period before the prediction period, so as to provide the interface traffic prediction model with the space-time correlation information of the multiple interfaces, and then complete the traffic prediction of the multiple interfaces in the prediction period.
[0142] In this embodiment, for any interface, the interface traffic has its own correlation and lag. By updating the space-time fusion matrix through the time connection matrix, the correlation information of each interface with itself during the passage of time can be added to the space-time fusion matrix, so that the updated space-time fusion matrix can more accurately reflect the traffic change rules of each of the multiple interfaces, and then the updated space-time fusion matrix is input into the interface traffic prediction model, which can improve the accuracy of the predicted traffic.
[0143] For example, the interface traffic has a large uncertainty and the network environment in which the interface traffic is located is highly complex. If the predicted traffic of each interface is directly predicted, the accuracy of the predicted traffic may decrease due to uncertainty and complexity. In order to better explain the complex time pattern, overcome the impact of uncertainty and complexity in the prediction process, and improve the prediction accuracy, the embodiment of the present application can use a time series decomposition method to decompose the prediction of the predicted traffic into components with higher predictability, each component represents a pattern that is easier to predict, and then by superimposing the components, a predicted traffic with higher accuracy can be obtained.
[0144] In a possible implementation, when the actual traffic data and the space-time fusion matrix are input into the interface traffic prediction model to obtain the predicted traffic of multiple interfaces in the time period to be predicted, it can be specifically implemented in the following way: the actual traffic data and the space-time fusion matrix are input into the interface traffic prediction model to predict the first component and the second component of multiple interfaces in the time period to be predicted; wherein the first component is used to characterize the change in the traffic of multiple interfaces over time in the predicted traffic period; the second component is used to characterize the fixed amount of the traffic of multiple interfaces over time in the predicted traffic period; based on the first component and the second component, the predicted traffic of multiple interfaces in the time period to be predicted is obtained.
[0145] Exemplarily, the first component and the second component may be two components that make up the predicted traffic. Among them, the first component may be used to characterize the change in the traffic over time in the predicted traffic of the multiple interfaces within the period to be predicted. The first component can also be understood as a trend component, which can reflect the long-term growth or decrease in the traffic over time in the predicted traffic. The second component may be used to characterize the fixed amount of traffic over time in the predicted traffic of the multiple interfaces within the period to be predicted. The second component can also be understood as a seasonal component, which can reflect the cyclical pattern that repeats after a fixed period. The predicted traffic can be decomposed into time series through the first component and the second component. By analyzing and modeling the first component and the second component, the inherent laws of the interface traffic data can be captured more accurately, and then the predicted traffic with higher accuracy can be predicted.
[0146] Exemplarily, when training the graph neural network model to obtain the interface traffic prediction model, the actual traffic data of each interface in the training sample data can be divided into training data and test data according to the time point. For example, a training sample data includes the actual traffic data of each interface for two hours. The middle time point between the first hour and the second hour can be used as the time point for dividing the training data and the test data, and the actual traffic data of the first hour is determined as the training data, and the actual traffic data of the second hour is determined as the test data. The training data can be understood as the input data for inputting the graph neural network model for prediction during the training stage, and the test data can be understood as the label data for verifying the true value of the predicted traffic output by the graph neural network model during the training stage.
[0147] For the actual traffic data in a training sample data, the training data X and the test data Y are divided. The duration corresponding to the training data X can be divided into T time steps. Each time step includes the actual traffic of each interface of the multiple interfaces at the time step. For example, the first time step can be represented as x1, and x1 can be a vector of |V| dimension, where |V| represents the number of the multiple interfaces. Then the training data X and the test data Y can be represented by the following formulas (13) and (14), respectively:
[0148]
[0149] Where T represents the number of time steps of the training data, and T′ represents the number of time steps of the test data. T and T′ can be the same or different. represents the real number field of |V|×T dimension, represents the real number field of dimension |V|×T′, x T represents the actual flow data at the Tth time step, y T′ represents the actual traffic data at the T′th time step. X can be understood as a matrix composed of T continuous graph signals, which serves as the input data for training; Y can be understood as x T The matrix composed of the next T′ graph signals is used as the true value corresponding to X.
[0150] In the training phase, a moving average kernel can be used to extract the trend component Z of the test data Y, and the difference between the test data Y and the trend component Z can be determined as the seasonal component S. The moving average kernel operation can be performed by the following formula (15), and the seasonal component S can be obtained by formula (16):
[0151] Z = AvgPool(Padding(Y )) (15)
[0152] S = Y - Z (16)
[0153] Among them, AvgPool represents the average pooling operation, and Padding represents the padding operation.
[0154] After obtaining the trend component Z and seasonal component S in the test data, the loss of the first component and the second component output by the graph neural network model can be calculated based on the trend component Z and the seasonal component S respectively, and then the parameters in the graph neural network model can be adjusted by back propagation and other methods to train and obtain the interface traffic prediction model.
[0155] For example, when training a graph neural network model, the mean absolute error (MAE) loss can be used as the loss function for training. MAE measures the prediction accuracy of the model by calculating the average of the absolute difference between the predicted value and the true value. MAE is simple and intuitive, easy to understand and explain, and has low sensitivity to outliers, so it can better accommodate the impact of outliers. The graph neural network model can be trained through the following steps 1 to 4 to obtain an interface traffic prediction model.
[0156] Step 1: Combine the training data X and the spatiotemporal fusion matrix A in the training sample STFG Input them into the graph neural network model g together, and output the predicted trend components respectively. and the seasonal component of the forecast It can be expressed as: and in, Represents the spatiotemporal fusion matrix A STFG The corresponding space-time fusion diagram.
[0157] Step 2: The mean absolute error loss, which can directly reflect the error, is used as the loss function. The loss is calculated by comparing the output predicted value with the true value through this loss function. The loss function of the trend component and the loss function of the seasonal component can be
[0158] middle, Represents the trend component of the forecast The loss function value of the trend component Z in the test data, Represents the seasonal component of the forecast The loss function value of the seasonal component S in the test data, i represents the i-th time step in T′ time steps, and j represents the j-th interface in |V| interfaces.
[0159] Step 3: The predicted trend component and the seasonal component of the forecast Add together to get the predicted flow And calculate the predicted flow The loss function value of the test data Y It can be expressed as:
[0160] Step 4: Combine the loss function value of the trend component, the loss function value of the seasonal component, and the loss function value of the predicted traffic as the objective function of the graph neural network model, and train the model with minimizing the objective function as the training goal, which can be expressed as the following expression: in, Represents the objective function during graph neural network model training.
[0161] Based on the above steps 1 to 4, one round of model training can be completed. After one or more rounds of training, when the back propagation adjusts the model parameters so that the objective function converges, the interface traffic prediction model can be obtained.
[0162] When applying the interface traffic prediction model to predict the traffic of the multiple interfaces, the actual traffic data within the target time period and the time-space fusion matrix can be input into the interface traffic prediction model to obtain the predicted traffic of the multiple interfaces within the time period to be predicted. The interface traffic prediction model can predict the first component and the second component of the multiple interfaces within the target time period respectively, and output the predicted traffic of the multiple interfaces within the time period to be predicted after superimposing the first component and the second component.
[0163] In this embodiment, in view of the complexity and non-stationarity in the traffic data, the predicted traffic is decomposed into two components with higher predictability by using time series decomposition. Subsequently, these components are predicted separately, and the prediction results are combined to obtain the final predicted traffic. Based on this, the difficulty and error of the prediction can be effectively reduced, and the stability and reliability of the prediction results can be improved.
[0164] For example, existing related methods mostly focus on single interface traffic prediction, ignoring the more complex dependencies between interfaces. In addition, most of the related methods aim to predict accurate traffic. However, interface traffic data is formed by the combined effects and intertwined influences of many different factors. These factors may include daily user behavior patterns, periodic activities (such as weekend effects or holiday peaks), emergencies (such as system failures or promotions), and external environmental factors (such as changes in network conditions). This multi-mode interweaving feature makes it extremely challenging to directly predict traffic because it is difficult to directly capture and model these complex and interrelated influences. At the same time, using a limited amount of training data usually leads to reduced accuracy in traffic prediction.
[0165] Therefore, the method provided in the embodiment of the present application aims to construct an interface traffic prediction model that can comprehensively consider the more complex dependencies between interfaces and the complex patterns of interface traffic. Specifically, the method of the present application can improve the accuracy of prediction through graph model construction, spatiotemporal feature analysis, and time series decomposition. Among them, graph model construction can be understood as constructing a graph model using the mutual call relationship between interfaces, intuitively representing the complex dependencies between interfaces, and providing richer relationship information for the prediction model. Spatiotemporal feature analysis can be understood as using knowledge graph embedding technology to fully combine time information and spatial information, and more comprehensively capture the evolution of traffic in time and the correlation pattern in space. Time series decomposition can be understood as using time series decomposition technology to decompose traffic data into more predictable components, and then predict these components.
[0166] Next, combine Figure 5 A specific implementation of the interface traffic prediction method provided in the embodiment of the present application is described. Figure 5 Schematic diagram of the process of the interface traffic prediction method provided in the embodiment of the present application Figure 2 ,like Figure 5 As shown, after the start, the actual traffic data, weather data, event data and call relationship data between interfaces of the multiple interfaces to be predicted are collected. The actual traffic data, weather data and event data are feature fused, and a time-related graph is constructed. The spatial correlation graph is constructed through the call relationship data between interfaces. The time-related graph and the space-related graph are fused through the knowledge graph embedding technology to construct a spatiotemporal fusion graph, which can correspond to the spatiotemporal fusion matrix. The training sample data is divided into training data and test data, the test data is time-series decomposed, and the graph neural network model is trained to obtain an interface traffic prediction model. In the application stage, for any time period to be predicted, the actual traffic data and the spatiotemporal fusion matrix in the target time period before the time period to be predicted are input into the interface traffic prediction model to obtain the output predicted traffic of the multiple interfaces.
[0167] The method provided in the embodiment of the present application combines actual traffic characteristics with weather characteristics and event characteristics, mines the time correlation between interfaces, builds a graph model through the mutual calling relationship between interfaces, and uses knowledge graph embedding technology to fully mine the complex spatiotemporal correlation relationship between interfaces, and uses a time series decomposition method to decompose more predictable components as prediction targets, thereby improving the accuracy of traffic prediction.
[0168] The embodiment of the present application utilizes the mutual calling relationship between interfaces to construct a graph model, which intuitively and accurately represents the complex dependencies between interfaces. Compared with the practice of the prediction model in related methods that ignores the dependencies between interfaces, the embodiment of the present application provides the prediction model with richer and more detailed relationship information, so that it can more accurately reflect the traffic changes in actual business scenarios and improve the accuracy of the prediction. In addition, by introducing knowledge graph embedding technology, the embodiment of the present application not only considers the evolution law of traffic data in the time dimension, but also deeply explores the correlation pattern in the spatial dimension. This comprehensive integration of spatiotemporal features enables the model to capture the complex dynamic changes in traffic data more carefully, further improving the precision and accuracy of the prediction.
[0169] Figure 6 A schematic diagram of the structure of the interface flow prediction device provided in the embodiment of the present application, such as Figure 6 As shown, an embodiment of the present application provides an interface traffic prediction device, the device comprising:
[0170] An acquisition module 601 is used to acquire actual flow data of multiple interfaces of to-be-predicted flow in a target period before the to-be-predicted period;
[0171] Prediction module 602, used to input actual traffic data and time-space fusion matrix into the interface traffic prediction model to obtain the predicted traffic of multiple interfaces in the period to be predicted;
[0172] Among them, the space-time fusion matrix is a matrix used to characterize the space-time correlation of multiple interfaces. The space-time correlation includes time correlation and space correlation. The time correlation is used to characterize the correlation degree of traffic changes between multiple interfaces over time. The space correlation is used to characterize the correlation degree of interface calls between multiple interfaces. The interface traffic prediction model is a model obtained by training the graph neural network model based on the actual traffic data of multiple interfaces before the target period and the space-time fusion matrix.
[0173] In a possible implementation, the spatiotemporal fusion matrix is obtained in the following manner: a plurality of interfaces are respectively embedded and represented by a knowledge graph embedding model to obtain embedding vectors corresponding to each of the plurality of interfaces, where the knowledge graph embedding model is a pre-trained model for embedding and representing any one of the plurality of interfaces in the dimension of spatiotemporal correlation; based on the embedding vectors corresponding to each of the plurality of interfaces, the similarities between any two embedding vectors are respectively calculated to obtain a plurality of similarities corresponding to the plurality of interfaces; based on the plurality of similarities, a spatiotemporal fusion matrix is constructed.
[0174] In a possible implementation, the knowledge graph embedding model is trained in the following manner: based on training sample data of multiple interfaces, time correlation graphs and space correlation graphs of multiple interfaces are constructed, the time correlation graph is graph data used to characterize the time correlation of multiple interfaces, and the space correlation graph is graph data used to characterize the spatial correlation of multiple interfaces; based on the time correlation graph and the space correlation graph, multiple triplets are extracted, any triplet includes two interfaces and the correlation relationship between the two interfaces, and the correlation relationship includes a time correlation relationship, a spatial correlation relationship, or a spatiotemporal correlation relationship; the initial knowledge graph embedding model is trained based on multiple triplets to obtain a knowledge graph embedding model.
[0175] In one possible implementation, a spatiotemporal fusion matrix is constructed based on multiple similarities, including: determining the K most similar interfaces of each of the multiple interfaces based on the multiple similarities, the K most similar interfaces of any interface including the interfaces corresponding to the K largest similarities with the interface, K being a preset arbitrary positive integer; constructing the spatiotemporal fusion matrix based on the K most similar interfaces of each of the multiple interfaces and their corresponding similarities.
[0176] In a possible implementation, the acquisition module 601 is also used to: obtain a time connection matrix, which is a matrix used to characterize the connection between each interface of a plurality of interfaces and itself; divide the target time period into a plurality of time steps in sequence, and sequentially splice the space-time fusion matrix and the time connection matrix according to the order of the time steps to update the space-time fusion matrix; input the updated space-time fusion matrix into the interface traffic prediction model to obtain the predicted traffic of the plurality of interfaces in the time period to be predicted.
[0177] In one possible implementation, the prediction module 602 is specifically used to: input actual traffic data and the space-time fusion matrix into the interface traffic prediction model, and predict the first component and the second component of multiple interfaces in the time period to be predicted; wherein the first component is used to characterize the change in the traffic over time in the predicted traffic of multiple interfaces in the time period to be predicted; the second component is used to characterize the fixed amount of the traffic over time in the predicted traffic of multiple interfaces in the time period to be predicted; based on the first component and the second component, the predicted traffic of multiple interfaces in the time period to be predicted is obtained.
[0178] The interface traffic prediction device provided in the embodiment of the present application can be used to execute the technical solution of the interface traffic prediction method in any of the above embodiments of the present application. Its implementation principle and technical effect are similar, and this embodiment will not be repeated here.
[0179] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown in FIG. Figure 7As shown, the electronic device of this embodiment may include: at least one processor 701; and a memory 702 communicatively connected to the at least one processor; wherein the memory 702 stores instructions executable by the at least one processor 701, and the instructions are executed by the at least one processor 701 so that the electronic device executes a method as in any of the above embodiments.
[0180] Optionally, the memory 702 may be independent or integrated with the processor 701 .
[0181] The implementation principle and technical effects of the electronic device provided in this embodiment can be found in the aforementioned embodiments and will not be described in detail here.
[0182] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions. When a processor executes the computer-executable instructions, the method described in any of the above embodiments is implemented.
[0183] An embodiment of the present application further provides a computer program product, including a computer program, which implements the method described in any of the above embodiments when executed by a processor.
[0184] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation, such as multiple modules can be combined or integrated into another system, or some features can be ignored or not executed.
[0185] The above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the method described in each embodiment of the present application.
[0186] It should be understood that the above-mentioned processor can be a processing unit (Central Processing Unit, CPU), or other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application-specific integrated circuits (Application Specific Integrated Circuit, ASIC), etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the application can be directly embodied as being executed by a hardware processor, or can be executed by a combination of hardware and software modules in the processor. The memory may include random access memory (Random Access Memory, RAM), and may also include non-volatile memory (Non-Volatile Memory, NVM), such as at least one disk storage, and can also be a USB flash drive, a mobile hard disk, a read-only memory, a disk or an optical disk, etc.
[0187] The above storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read only memory (EEPROM), erasable programmable read only memory (EPROM), programmable read only memory (PROM), read only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The storage medium can be any available medium that can be accessed by a general or special-purpose computer.
[0188] An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in a dedicated integrated circuit. Of course, the processor and the storage medium can also exist as discrete components in an electronic device or a main control device.
[0189] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0190] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0191] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0192] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
[0193] Those skilled in the art will readily come up with other implementations of the embodiments of the present application after considering the specification and practicing the application disclosed herein. The present application is intended to cover any modifications, uses or adaptations of the embodiments of the present application, which follow the general principles of the embodiments of the present application and include common knowledge or customary technical means in the art that are not disclosed in the embodiments of the present application.
[0194] It should be understood that the embodiments of the present application are not limited to the precise structures described above and shown in the drawings, and various modifications and changes can be made without departing from the scope thereof. The scope of the embodiments of the present application is limited only by the appended claims.
Claims
1. An interface traffic prediction method, characterized in that: The method comprises: Acquire actual traffic data of multiple interfaces of traffic to be predicted in a target time period before the time period to be predicted; Inputting the actual traffic data and the spatiotemporal fusion matrix into an interface traffic prediction model to obtain predicted traffic of the multiple interfaces within the time period to be predicted; Among them, the spatiotemporal fusion matrix is a matrix used to characterize the spatiotemporal correlation of the multiple interfaces, and the spatiotemporal correlation includes time correlation and space correlation. The time correlation is used to characterize the correlation degree of traffic changes between the multiple interfaces over time, and the spatial correlation is used to characterize the correlation degree of interface calls between the multiple interfaces. The interface traffic prediction model is a model obtained by training the graph neural network model based on the actual traffic data of the multiple interfaces before the target time period and the spatiotemporal fusion matrix.
2. The method according to claim 1, characterized in that The spatiotemporal fusion matrix is obtained in the following manner: The multiple interfaces are respectively embedded and represented by a knowledge graph embedding model to obtain embedding vectors corresponding to the multiple interfaces, wherein the knowledge graph embedding model is a pre-trained model for embedding and representing any interface of the multiple interfaces in the dimension of spatiotemporal correlation; According to the embedding vectors corresponding to the multiple interfaces, respectively calculate the similarity between any two embedding vectors to obtain multiple similarities corresponding to the multiple interfaces; The spatiotemporal fusion matrix is constructed according to the multiple similarities.
3. The method according to claim 2, characterized in that The knowledge graph embedding model is trained in the following way: Constructing a time correlation graph and a space correlation graph of the multiple interfaces according to the training sample data of the multiple interfaces, wherein the time correlation graph is graph data for characterizing the time correlation of the multiple interfaces, and the space correlation graph is graph data for characterizing the space correlation of the multiple interfaces; Extracting a plurality of triplets according to the time correlation graph and the space correlation graph, wherein any of the triplets includes two interfaces and a correlation relationship between the two interfaces, wherein the correlation relationship includes a time correlation relationship, a space correlation relationship, or a time-space correlation relationship; An initial knowledge graph embedding model is trained according to the multiple triples to obtain the knowledge graph embedding model.
4. The method according to claim 2, characterized in that: The step of constructing the spatiotemporal fusion matrix according to the multiple similarities includes: Determine, according to the multiple similarities, K most similar interfaces of each of the multiple interfaces, wherein the K most similar interfaces of any of the interfaces include interfaces corresponding to the largest K similarities among the similarities with the interface, where K is a preset arbitrary positive integer; The spatiotemporal fusion matrix is constructed according to the K most similar interfaces of each of the multiple interfaces and their corresponding similarities.
5. The method according to claim 4, characterized in that The method further comprises: Acquire a time connection matrix, where the time connection matrix is a matrix used to characterize the connection between each interface of the multiple interfaces and itself; Dividing the target time period into a plurality of time steps in sequence, and sequentially splicing the spatiotemporal fusion matrix and the time connection matrix according to the order of the time steps, so as to update the spatiotemporal fusion matrix; The updated time-space fusion matrix is input into the interface traffic prediction model to obtain the predicted traffic of the multiple interfaces in the time period to be predicted.
6. The method according to any one of claims 1 to 5, characterized in that: The step of inputting the actual traffic data and the spatiotemporal fusion matrix into the interface traffic prediction model to obtain the predicted traffic of the multiple interfaces in the time period to be predicted includes: Input the actual traffic data and the spatiotemporal fusion matrix into the interface traffic prediction model, and predict the first component and the second component of the multiple interfaces in the time period to be predicted; wherein the first component is used to characterize the change amount of the traffic in the predicted traffic of the multiple interfaces in the time period to be predicted over time; the second component is used to characterize the fixed amount of the traffic in the predicted traffic of the multiple interfaces in the time period to be predicted over time; The predicted traffic of the multiple interfaces within the time period to be predicted is obtained according to the first component and the second component.
7. An interface traffic prediction device, characterized in that: The device comprises: An acquisition module, used to acquire actual flow data of multiple interfaces of the to-be-predicted flow in a target period before the to-be-predicted period; A prediction module, used for inputting the actual flow data and the spatiotemporal fusion matrix into an interface flow prediction model to obtain the predicted flow of the multiple interfaces within the period to be predicted; Among them, the spatiotemporal fusion matrix is a matrix used to characterize the spatiotemporal correlation of the multiple interfaces, and the spatiotemporal correlation includes time correlation and space correlation. The time correlation is used to characterize the correlation degree of traffic changes between the multiple interfaces over time, and the spatial correlation is used to characterize the correlation degree of interface calls between the multiple interfaces. The interface traffic prediction model is a model obtained by training the graph neural network model based on the actual traffic data of the multiple interfaces before the target time period and the spatiotemporal fusion matrix.
8. An electronic device, characterized in that: include: Memory and processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 6 when executed by a processor.
10. A computer program product, characterized in that The method comprises a computer program, which implements the method according to any one of claims 1 to 6 when being executed by a processor.
Citation Information
Cited By
Base station flow prediction method based on spatio-temporal characteristic joint representation
CN121463080A
A base station traffic prediction method based on joint representation of space-time features
CN121463080B