A flow prediction method, apparatus and storage medium
The traffic prediction model trained by the bidirectional encoding algorithm and the residual connection decoding algorithm solves the problem that deep learning time series models cannot simultaneously capture long-term periodicity and short-term dependency, and achieves fast and accurate network traffic prediction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-10
- Publication Date
- 2026-03-10
AI Technical Summary
Existing deep learning time series models struggle to simultaneously capture both long-term periodicity and short-term dependencies in time series data, failing to fully utilize historical data information and impacting the accuracy of prediction results.
A traffic prediction model is trained using a bidirectional encoding algorithm and a residual connection decoding algorithm. By fusing information from left to right and from right to left, a multi-layer network model is constructed to capture temporal nonlinear relationships and utilize the long-term periodic patterns and short-term dependencies of time series.
It enables fast and accurate prediction of network traffic, and can simultaneously consider long-term periodic patterns and short-term dependencies, thus improving the accuracy of prediction.
Smart Images

Figure CN114282648B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communication technology, and in particular to a traffic prediction method, apparatus, and storage medium. Background Technology
[0002] Network traffic prediction is crucial for reducing manual workload and improving network quality. In the short term, it can provide early warnings during peak traffic periods and issue alerts during periods of abnormal traffic. In the long term, it enables network expansion and construction.
[0003] Existing deep learning time series models struggle to simultaneously capture both long-term periodicity and short-term dependencies in time series data, failing to fully utilize historical data and impacting the accuracy of final predictions. While improving model performance by capturing short-term dependencies can be achieved, it neglects the learning of non-linear temporal relationships.
[0004] Therefore, how to quickly and accurately predict network traffic is a technical problem that urgently needs to be solved. Summary of the Invention
[0005] This application provides a traffic prediction method, apparatus, and storage medium, which solves the technical problem that existing technologies cannot quickly and accurately predict network traffic.
[0006] To achieve the above objectives, this application adopts the following technical solution:
[0007] Firstly, a traffic prediction method is provided, including:
[0008] Obtain the first traffic information within the first time period;
[0009] Determine the first feature data of the first flow information; the first feature data includes first time-series feature data divided by time-series features;
[0010] The first feature data is input into a pre-trained traffic prediction model to obtain traffic prediction information for the target time period. The traffic prediction model is trained based on the second time-series feature data of the second traffic information of the second time period, a bidirectional encoding algorithm, and a residual connection decoding algorithm. The target time period is located after the first time period and the second time period.
[0011] Optionally, traffic prediction methods also include:
[0012] Obtain the second traffic information;
[0013] The second feature data of the second flow information is determined; the second feature data includes second time-series feature data divided by time-series features.
[0014] A traffic prediction model is trained based on the second time-series feature data, a bidirectional encoding algorithm, and a residual connection decoding algorithm.
[0015] Optionally, based on the second time-series feature data, a bidirectional encoding algorithm, and a residual connection decoding algorithm, a traffic prediction model is trained, including:
[0016] According to the bidirectional coding algorithm, the second time-series feature data is bidirectionally encoded to obtain the first encoded data encoded from left to right and the second encoded data encoded from right to left;
[0017] The first and second encoded data are concatenated to obtain the fused sequence feature data;
[0018] Based on the residual connection decoding algorithm, a multi-layer network model is constructed, and the residual network is used to connect the network models in the multi-layer network model.
[0019] The outputs of each layer of the network model are weighted and fused to obtain the prediction results of the fused sequence feature data;
[0020] Based on the prediction results of the second time-series feature data, the model parameters in each layer of the network model are adjusted until convergence is achieved to obtain the traffic prediction model.
[0021] Optionally, the first feature data for determining the first traffic information includes:
[0022] Perform logarithmic processing on the first flow information to obtain the logarithmically processed first data;
[0023] Regularization is performed on the first logarithmically processed data to obtain the first feature data.
[0024] Optionally, the second feature data for determining the second traffic information includes:
[0025] Logarithmic processing is performed on the second flow information to obtain the logarithmically processed second data;
[0026] Regularization is performed on the logarithmically transformed second data to obtain the second feature data.
[0027] Optionally, after inputting the first feature data into a pre-trained traffic prediction model to obtain traffic prediction information for the target time period, the method further includes:
[0028] The accuracy of traffic prediction information is determined based on a preset evaluation algorithm.
[0029] In a second aspect, a traffic prediction device is provided, the traffic prediction device comprising: an acquisition unit and a processing unit;
[0030] The acquisition unit is used to acquire the first traffic information within the first time period.
[0031] The processing unit is used to determine the first feature data of the first traffic information; the first feature data includes first time-series feature data divided by time-series features;
[0032] The processing unit is also used to input the first feature data into a pre-trained traffic prediction model to obtain traffic prediction information for the target time period; the traffic prediction model is trained based on the second time-series feature data of the second traffic information of the second time period, a bidirectional encoding algorithm, and a residual connection decoding algorithm; the target time period is located after the first time period and the second time period.
[0033] Optionally, the acquisition unit is also used to acquire second traffic information;
[0034] The processing unit is further configured to determine second feature data of the second flow information; the second feature data includes second time-series feature data divided by time-series features;
[0035] The processing unit is also used to train a traffic prediction model based on the second time-series feature data, a bidirectional encoding algorithm, and a residual connection decoding algorithm.
[0036] Optional, processing unit, specifically used for:
[0037] According to the bidirectional coding algorithm, the second time-series feature data is bidirectionally encoded to obtain the first encoded data encoded from left to right and the second encoded data encoded from right to left;
[0038] The first and second encoded data are concatenated to obtain the fused sequence feature data;
[0039] Based on the residual connection decoding algorithm, a multi-layer network model is constructed, and the residual network is used to connect the network models in the multi-layer network model.
[0040] The outputs of each layer of the network model are weighted and fused to obtain the prediction results of the fused sequence feature data;
[0041] Based on the prediction results of the second time-series feature data, the model parameters in each layer of the network model are adjusted until convergence is achieved to obtain the traffic prediction model.
[0042] Optional, processing unit, specifically used for:
[0043] Perform logarithmic processing on the first flow information to obtain the logarithmically processed first data;
[0044] Regularization is performed on the first logarithmically processed data to obtain the first feature data.
[0045] Optional, processing unit, specifically used for:
[0046] Logarithmic processing is performed on the second flow information to obtain the logarithmically processed second data;
[0047] Regularization is performed on the logarithmically transformed second data to obtain the second feature data.
[0048] Optionally, the processing unit is also used to determine the accuracy of the traffic prediction information based on a preset evaluation algorithm.
[0049] Thirdly, a flow prediction apparatus is provided, including a memory and a processor. The memory stores computer-executable instructions, and the processor is connected to the memory via a bus. When the flow prediction apparatus is running, the processor executes the computer-executable instructions stored in the memory to cause the flow prediction apparatus to perform the flow prediction method described in the first aspect.
[0050] The traffic prediction device can be a network device or a component of a network device, such as a chip system within the network device. The chip system supports the network device in implementing the functions involved in the first aspect and any possible implementation thereof, such as receiving, determining, and routing the data and / or information involved in the aforementioned traffic prediction method. The chip system includes a chip, but may also include other discrete devices or circuit structures.
[0051] Fourthly, a computer-readable storage medium is provided, comprising computer-executable instructions that, when executed on a computer, cause the computer to perform the traffic prediction method described in the first aspect.
[0052] Fifthly, a computer program product is provided that, when run on a computer, causes the computer to perform the traffic prediction method as described in the first aspect and any possible design thereof.
[0053] It should be noted that the aforementioned computer instructions may be stored, in whole or in part, on the first computer storage medium. The first computer storage medium may be packaged together with the processor of the flow prediction device, or it may be packaged separately from the processor of the flow prediction device; this application does not impose any limitations on this.
[0054] The descriptions of the second, third, fourth, and fifth aspects of this invention can be referred to the detailed description of the first aspect; and the beneficial effects of the second, third, fourth, and fifth aspects can be referred to the analysis of the beneficial effects of the first aspect, which will not be repeated here.
[0055] In this application, the name of the aforementioned flow prediction device does not limit the device or functional module itself. In actual implementation, these devices or functional modules may appear under other names. As long as the function of each device or functional module is similar to that of this invention, it falls within the scope of the claims of this invention and its equivalents.
[0056] These or other aspects of the invention will become more apparent from the following description.
[0057] The technical solution provided in this application brings at least the following beneficial effects:
[0058] In this application, the traffic prediction device can acquire first traffic information within a first time period and determine the first feature data of the first traffic information. Subsequently, the first feature data is input into a pre-trained traffic prediction model to obtain traffic prediction information for a target time period. Since the first feature data includes first temporal feature data divided by time-series features, this application can simultaneously consider long-term periodic patterns and short-term dependencies that may exist in the time series. Secondly, since the traffic prediction model is trained based on the second temporal feature data of the second traffic information in the second time period, a bidirectional encoding algorithm, and a residual connection decoding algorithm, this application comprehensively utilizes the information from left to right and from right to left in the time series, inputs the hidden states of all encoded time steps into the decoder, and constructs a strong regressor from a weak regressor by weighting the outputs of different layers. This enables the capture of more accurate temporal nonlinear relationships, thereby enabling fast and accurate prediction of network traffic. Attached Figure Description
[0059] Figure 1 This is a schematic diagram of the hardware structure of a traffic prediction device provided in an embodiment of this application;
[0060] Figure 2 A schematic diagram of the hardware structure of another flow prediction device provided in the embodiments of this application;
[0061] Figure 3 A flowchart illustrating a training traffic prediction model provided in an embodiment of this application;
[0062] Figure 4 A flowchart illustrating a traffic prediction method provided in an embodiment of this application;
[0063] Figure 5 A flowchart illustrating another traffic prediction method provided in an embodiment of this application;
[0064] Figure 6 This is a schematic diagram of the structure of a flow prediction device provided in an embodiment of this application. Detailed Implementation
[0065] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0066] It should be noted that in the embodiments of this application, the words "exemplary" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of the words "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0067] To facilitate a clear description of the technical solutions of the embodiments of this application, the terms "first" and "second" are used in the embodiments of this application to distinguish the same or similar items with essentially the same function and effect. Those skilled in the art can understand that the terms "first" and "second" are not intended to limit the quantity or execution order.
[0068] Existing deep learning time series models struggle to simultaneously capture both long-term periodicity and short-term dependencies in time series data, failing to fully utilize historical data and impacting the accuracy of final predictions. While improving model performance by capturing short-term dependencies can be achieved, it neglects the learning of non-linear temporal relationships.
[0069] Therefore, how to quickly and accurately predict network traffic is a technical problem that urgently needs to be solved.
[0070] To address the aforementioned issues, this application provides a traffic prediction method. The traffic prediction device acquires first traffic information within a first time period and determines first feature data of the first traffic information. Subsequently, the first feature data is input into a pre-trained traffic prediction model to obtain traffic prediction information for a target time period. Since the first feature data includes first temporal feature data divided by time-series features, this application can simultaneously consider long-term periodic patterns and short-term dependencies that may exist in the time series. Furthermore, since the traffic prediction model is trained based on the second temporal feature data of the second traffic information in the second time period, a bidirectional encoding algorithm, and a residual connection decoding algorithm, this application comprehensively utilizes information from left to right and right to left in the time series, inputs the hidden states of all encoded time steps into the decoder, and constructs a strong regressor from a weak regressor by weighting the outputs of different layers. This enables the capture of more accurate temporal nonlinear relationships, thereby allowing for rapid and accurate prediction of network traffic.
[0071] The aforementioned traffic prediction device can be a device used to predict the performance of the equipment and lines corresponding to the target port, a chip in the device, or a system-on-a-chip in the device.
[0072] Optionally, the device can be a physical machine, such as a desktop computer, mobile phone, tablet computer, laptop computer, ultra-mobile personal computer (UMPC), netbook, personal digital assistant (PDA), and other terminal devices.
[0073] Optionally, the traffic prediction device described above can also achieve the same functions using a virtual machine (VM) deployed on a physical machine.
[0074] For ease of understanding, the structure of the flow prediction device in the embodiments of this application is described below.
[0075] Figure 1 A schematic diagram of a hardware structure of a traffic prediction device provided in an embodiment of this application is shown. Figure 1 As shown, the flow prediction device includes a processor 11, a memory 12, a communication interface 13, and a bus 14. The processor 11, the memory 12, and the communication interface 13 can be connected via the bus 14.
[0076] Processor 11 is the control center of the flow prediction device. It can be a single processor or a collective term for multiple processing elements. For example, processor 11 can be a general-purpose central processing unit (CPU) or other general-purpose processors. Among them, the general-purpose processor can be a microprocessor or any conventional processor.
[0077] As one embodiment, processor 11 may include one or more CPUs, for example Figure 1 CPU 0 and CPU 1 are shown in the diagram.
[0078] The memory 12 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), disk storage medium or other magnetic storage device, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but is not limited thereto.
[0079] In one possible implementation, the memory 12 can exist independently of the processor 11. The memory 12 can be connected to the processor 11 via a bus 14 and is used to store instructions or program code. When the processor 11 calls and executes the instructions or program code stored in the memory 12, it can implement the traffic prediction method provided in this embodiment of the invention.
[0080] In another possible implementation, the memory 12 can also be integrated with the processor 11.
[0081] Communication interface 13 is used to connect with other devices via a communication network. The communication network can be Ethernet, a wireless access network, a wireless local area network (WLAN), etc. Communication interface 13 may include a receiving unit for receiving data and a transmitting unit for sending data.
[0082] Bus 14 can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 1 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0083] It should be pointed out that, Figure 1 The structure shown does not constitute a limitation on this flow prediction device. Except... Figure 1 In addition to the components shown, the flow prediction device may include more or fewer components than illustrated, or combine certain components, or have different component arrangements.
[0084] Figure 2 Another hardware structure of the flow prediction device in the embodiments of this application is shown. For example... Figure 2 As shown, the communication device may include a processor 21 and a communication interface 22. The processor 21 is coupled to the communication interface 22.
[0085] The functions of processor 21 can be referred to in the description of processor 11 above. In addition, processor 21 also has storage functions, which can be referred to in the description of memory 12 above.
[0086] The communication interface 22 is used to provide data to the processor 21. The communication interface 22 can be an internal interface of the communication device, or it can be an external interface of the flow prediction device (equivalent to communication interface 13).
[0087] It should be pointed out that, Figure 1 (or Figure 2 The structure shown in the diagram does not constitute a limitation on the flow prediction device, except... Figure 1 (or Figure 2 In addition to the components shown in the diagram, the flow prediction device may include more or fewer components than illustrated, or combine certain components, or have different component arrangements.
[0088] The traffic prediction method provided in the embodiments of this application will be described in detail below with reference to the accompanying drawings.
[0089] The traffic prediction method provided in this application includes: a traffic prediction device training a traffic prediction model based on the second time-series feature data of the second traffic information of the second time period, a bidirectional encoding algorithm and a residual connection decoding algorithm (hereinafter referred to as "traffic prediction model training process") and a process by which the traffic prediction device determines the traffic prediction information of the target time period (hereinafter referred to as "traffic prediction process").
[0090] The following section describes the "Training Process for Traffic Prediction Model".
[0091] like Figure 3 As shown, the "Traffic Prediction Model Training Process" includes: S301-S303.
[0092] S301, The flow prediction device acquires the second flow information.
[0093] Specifically, when training a traffic prediction model, the traffic prediction device needs to acquire a large amount of historical data as sample data for training the model. In this case, the traffic prediction device can acquire second traffic information for the second time period.
[0094] Optionally, the second traffic information can be historical port traffic information of any one or more network traffic ports in the second time period, including uplink data and downlink data.
[0095] S302, The flow prediction device determines the second characteristic data of the second flow information.
[0096] The second feature data includes second time-series feature data divided by time-series features.
[0097] Specifically, after obtaining the second traffic information, it can be combined according to different time-series dimensions.
[0098] For short-term time series forecasting (short-term does not refer to a short period of time, but rather a period during which the external environment has not changed significantly), multi-dimensional time features can be constructed by combining data from the same time of day for each historical day.
[0099] For example, traffic information from the same time point within the past 7 days can be combined to construct multi-temporal fusion data features, which can then be used as input features for the model. Traffic data from all time periods of the following day can then be used as output features for the model.
[0100] Optionally, the method for determining the characteristic data of traffic information by the traffic prediction device specifically includes:
[0101] The flow prediction device performs logarithmic processing on the second flow information to obtain the logarithmically processed second data.
[0102] Specifically, since the flow information is a large value, on the order of 1e6, the flow prediction device performs logarithmic processing on the flow information in order to smooth the data and reduce the order of magnitude.
[0103] The flow prediction device performs logarithmic processing on the flow information to obtain logarithmically processed data that satisfies the following formula:
[0104]
[0105] in, The data is logarithmically processed, x represents the second flow information, and C is a constant.
[0106] The flow prediction device performs regularization on the logarithmically processed second data to obtain second feature data.
[0107] Specifically, in order to regularize the data and accelerate the convergence speed of machine learning algorithms, the traffic prediction device performs regularization processing on the logarithmically processed data to obtain feature data of traffic information.
[0108] The flow prediction device performs regularization on the logarithmically processed data to obtain characteristic data of the flow information that satisfy the following formula:
[0109]
[0110] in, Let σ be the characteristic data of the traffic information, σ be the standard deviation of the second traffic information at different times in each time period, and u be the average value of the second traffic information at different times in each time period.
[0111] S303. The traffic prediction device trains a traffic prediction model based on the second time-series feature data, a bidirectional coding algorithm, and a residual connection decoding algorithm.
[0112] Specifically, the traffic prediction model adopts a sequence-to-sequence network structure, consisting of a multi-temporal fusion component (encoder) and a deep fusion temporal decoding component (decoder). The traffic prediction device can input the second temporal feature data into the encoder to obtain a sequence that fuses short-term dependence and long-term periodic pattern characteristics, and then input this sequence into the decoder to output traffic data at any time.
[0113] Optionally, the method by which the traffic prediction device trains the traffic prediction model based on the second time-series feature data, a bidirectional coding algorithm, and a residual connection decoding algorithm specifically includes:
[0114] The traffic prediction device performs bidirectional encoding on the second time-series feature data according to the bidirectional encoding algorithm to obtain first encoded data encoded from left to right and second encoded data encoded from right to left.
[0115] Specifically, the flow prediction device can use a quasi-recurrent network (QRNN) to encode the second time-series feature data bidirectionally to obtain two sets of features from left to right and from right to left.
[0116] Optionally, the flow prediction device can also use other types of recurrent neural networks, including but not limited to recurrent neural networks (RNN), long short-term memory networks (LSTM), gated recurrent units (GRU), and other models.
[0117] The VTQRNN model in this application adopts the Seq2Seq framework and constructs a multi-temporal fusion component as the encoder. The multi-temporal fusion component is based on a QRNN-designed bidirectional sequence mechanism: it encodes the time series in both left-to-right and right-to-left directions.
[0118] It should be noted that the VTQRNN model adopts the Seq2Seq framework, where the encoder inputs the hidden layer vectors of all time steps into the decoder.
[0119] The first encoded data obtained by encoding the second time-series feature data from left to right using QRNN satisfies the following formula:
[0120]
[0121]
[0122]
[0123]
[0124]
[0125] t∈[0,T)∩N;
[0126] in, Used to represent the encoding result at the t-th position of the sequentially encoded time series from left to right; the superscript l indicates the encoding result from left to right; T represents the total time step; N represents the set of integers, t∈[0,T)∩N indicates that t is a positive integer in the interval [0,T); The value is used to represent the computation result of the hidden layer; w represents the weights that need to be learned in the deep learning algorithm; p represents the sliding window size in QRNN and corresponds to p weight matrices, with the i-th weight matrix denoted as . The right subscript indicates that the weight matrix is used to calculate z; x is the second time series feature data. Since the QRNN algorithm has a sliding window of size p, it is necessary to perform a radial operation on the vector at the ti-th position of the time series. Used to represent the result of the forget gate operation. Used to represent the result of the output gate operation; tanh is used to represent the hyperbolic tangent function; σ is used to represent the sigmoid function; This is used to represent the QRNN that will be passed to the (t+1)th position for computation; c t-1 It is the result obtained by QRNN calculation at position t-1; ⊙ represents matrix multiplication at the same position.
[0127] Accordingly, the second encoded data obtained by encoding the second time-series feature data from right to left using QRNN satisfies the following formula:
[0128]
[0129]
[0130]
[0131]
[0132]
[0133] t∈[0,T)∩N;
[0134] in, Used to represent the encoding result at the t-th position of a sequentially encoded time series from right to left; the superscript r indicates the encoding result from right to left.
[0135] The flow prediction device splices the first coded data and the second coded data to obtain fused sequence feature data.
[0136] Specifically, the flow prediction device concatenates the two sets of features to obtain long-short time fusion sequence feature data, that is, it combines the encoding results along two directions to obtain the final encoding result of the multi-temporal fusion component. t∈[0,T)∩N.
[0137] It should be noted that the two-time-series feature data in QRNN Where R represents the real number field, and n represents the number of n days whose moments were concatenated together during preprocessing. This represents the i-th weight in a QRNN with p weight matrices. Let the dimension of tensor X be T×n.
[0138] The traffic prediction device constructs a multi-layer network model based on the residual connection decoding algorithm, and connects the various layers of the multi-layer network model with a residual network.
[0139] Specifically, the traffic prediction device can use QRNN to decode the long-short time fusion sequence features, and on this basis, construct a multi-layer network model, and use a residual network to connect the various layers of the multi-layer network model.
[0140] Optionally, the decoder consists of multiple layers of QRNN, and there are various choices of activation functions between layers, including but not limited to the activation function (Leaky Rectified Linear Unit, LeakyReLU), the linear rectified function (Rectified Linear Unit, ReLU), the curve activation function (Tanh), the sigmoid function, the regression loss function (log(cosh)), and the maximum output function (MaxOut).
[0141] The VTQRNN model in this application adopts the Seq2Seq framework to construct a deep fusion time series decoding component as the decoder. The deep fusion time series decoding component consists of multiple layers of QRNN, with layers connected through residual networks. LeakyReLU is used as the activation function to enable the multi-layer structure with residual connections to better learn the nonlinear relationships of time series.
[0142] The traffic prediction device constructs a multi-layer network model based on the residual connection decoding algorithm, and connects the various layers of the multi-layer network model using a residual network to satisfy the following formula:
[0143]
[0144]
[0145]
[0146]
[0147]
[0148]
[0149] in, Used to represent the decoding result of the k-th layer of a multi-layer network model; the superscript k represents the k-th layer of the multi-layer network model, and H is used to represent a sequence concatenated after calculating h at each position from left to right in the QRNN; or a sequence concatenated after calculating h at each position from right to left.
[0150] The traffic prediction device performs weighted fusion of the outputs from each layer of the network model to obtain the prediction results of the fused sequence feature data.
[0151] Optionally, there are several options for the fusion weighting method, including but not limited to adaptive linear weighting and softmax weighting.
[0152] The VTQRNN model employs a Seq2Seq framework, merging multiple decoders into a single strong decoder during decoding. Since the VTQRNN decoder consists of multiple layers of QRNNs, the outputs of each layer of the deep fusion temporal decoding component are weighted and fused when outputting prediction results.
[0153] The prediction result of the second time-series feature data satisfies the following formula:
[0154]
[0155] in,
[0156]
[0157] Where, [ω0,…,ω n-1 ] represents the weights between different layers, ω i Let α represent the weight of the i-th layer. i And e are constants.
[0158] The traffic prediction device adjusts the model parameters in each layer of the network model based on the prediction results of the second time-series feature data until convergence, so as to obtain the traffic prediction model.
[0159] Specifically, after obtaining the prediction results of the second time-series feature data, the traffic prediction device can verify the accuracy of the prediction results based on the actual results of the second time-series feature data. If the prediction results of the second time-series feature data are inaccurate, the model parameters in each layer of the network model can be adjusted until convergence is achieved to obtain the traffic prediction model.
[0160] Optionally, when the traffic prediction device adjusts the model parameters in each layer of the network model based on the prediction results of the second time-series feature data, it can use MAE as the loss function and ADAM as the parameter optimizer.
[0161] The "traffic prediction process" will be described next.
[0162] After training the traffic prediction model using the above method, traffic prediction information for the target time period can be determined based on the model. For example... Figure 4 As shown, it includes: S401-S403.
[0163] S401, The flow prediction device acquires the first flow information within the first time period.
[0164] The flow prediction device obtains the first flow information within the first time period. For details on the flow prediction device obtaining the second flow information, please refer to S301. This will not be repeated here.
[0165] S402, The flow prediction device determines the first characteristic data of the first flow information.
[0166] The first feature data includes first time-series feature data divided by time-series features.
[0167] Optionally, the method by which the flow prediction device determines the first feature data of the first flow information specifically includes:
[0168] Perform logarithmic processing on the first flow information to obtain the logarithmically processed first data;
[0169] Regularization is performed on the first logarithmically processed data to obtain the first feature data.
[0170] For details on the method by which the flow prediction device determines the first characteristic data of the first flow information, please refer to S302 for the specific description of the second characteristic data of the flow prediction device for determining the second flow information, which will not be repeated here.
[0171] S403. The traffic prediction device inputs the first feature data into the pre-trained traffic prediction model to obtain traffic prediction information for the target time period.
[0172] The traffic prediction model is trained using second time-series feature data of the second traffic information in the second time period, a bidirectional encoding algorithm, and a residual connection decoding algorithm. The target time period is located after the first and second time periods.
[0173] Optionally, the second time period may include the first time period or may be located before the first time period; this application does not limit this.
[0174] Optionally, since the traffic prediction device inputs the first feature data of the first traffic information into a pre-trained traffic prediction model, the output of the traffic prediction model is the prediction result corresponding to the first feature data. In this case, the traffic prediction device can perform inverse regularization and exponentialization on the prediction result to obtain traffic prediction information for the target time period.
[0175] In one feasible way, combining Figure 4 ,like Figure 5 As shown. Following S403, this traffic prediction method also includes:
[0176] S501. The flow prediction device determines the accuracy of the flow prediction information according to a preset evaluation algorithm.
[0177] Optionally, the preset evaluation algorithms include the mean absolute percentage (MAPE) algorithm or the Pearson correlation coefficient (CORR) algorithm.
[0178] The foregoing mainly describes the solutions provided by the embodiments of this application from a methodological perspective. To achieve the above functions, it includes corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should readily recognize that, in conjunction with the units and algorithm steps of the various examples described in the embodiments disclosed herein, the embodiments of this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this invention.
[0179] This application embodiment can divide the traffic prediction device into functional modules according to the above method example. For example, each function can be divided into its own functional module, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware or as a software functional module. Optionally, the module division in this application embodiment is illustrative and only represents one logical functional division; other division methods may be used in actual implementation.
[0180] like Figure 6 The diagram shown is a structural schematic of a flow prediction device 600 provided in an embodiment of this application. The flow prediction device 600 includes: an acquisition unit 601 and a processing unit 602;
[0181] Acquisition unit 601 is used to acquire the first traffic information within the first time period;
[0182] Processing unit 602 is used to determine first feature data of first traffic information; the first feature data includes first time-series feature data divided by time-series features;
[0183] The processing unit 602 is further configured to input the first feature data into a pre-trained traffic prediction model to obtain traffic prediction information for the target time period; the traffic prediction model is trained based on the second time-series feature data of the second traffic information of the second time period, a bidirectional encoding algorithm, and a residual connection decoding algorithm; the target time period is located after the first time period and the second time period.
[0184] Optionally, the acquisition unit 601 is also used to acquire second traffic information;
[0185] The processing unit 602 is further configured to determine second feature data of the second flow information; the second feature data includes second time-series feature data divided by time-series features;
[0186] The processing unit 602 is also used to train a traffic prediction model based on the second time-series feature data, the bidirectional encoding algorithm, and the residual connection decoding algorithm.
[0187] Optionally, the processing unit 602 is specifically used for:
[0188] According to the bidirectional coding algorithm, the second time-series feature data is bidirectionally encoded to obtain the first encoded data encoded from left to right and the second encoded data encoded from right to left;
[0189] The first and second encoded data are concatenated to obtain the fused sequence feature data;
[0190] Based on the residual connection decoding algorithm, a multi-layer network model is constructed, and the residual network is used to connect the network models in the multi-layer network model.
[0191] The outputs of each layer of the network model are weighted and fused to obtain the prediction results of the fused sequence feature data;
[0192] Based on the prediction results of the second time-series feature data, the model parameters in each layer of the network model are adjusted until convergence is achieved to obtain the traffic prediction model.
[0193] Optionally, the processing unit 602 is specifically used for:
[0194] Perform logarithmic processing on the first flow information to obtain the logarithmically processed first data;
[0195] Regularization is performed on the first logarithmically processed data to obtain the first feature data.
[0196] Optionally, the processing unit 602 is specifically used for:
[0197] Logarithmic processing is performed on the second flow information to obtain the logarithmically processed second data;
[0198] Regularization is performed on the logarithmically transformed second data to obtain the second feature data.
[0199] Optionally, the processing unit 602 is also used to determine the accuracy of the traffic prediction information according to a preset evaluation algorithm.
[0200] This application also provides a computer-readable storage medium including computer-executable instructions. When the computer executes the instructions and runs them, the computer performs the various steps of the traffic prediction device in the traffic prediction method provided in the above embodiments.
[0201] This application also provides a computer program product that can be directly loaded into a memory and contains software code. After being loaded and executed by a computer, the computer program product can realize the various steps performed by the traffic prediction device in the traffic prediction method provided in the above embodiments.
[0202] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented using software programs, implementation can be, in whole or in part, in the form of a computer program product. This computer program product includes one or more computer instructions. When these computer instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device containing one or more servers, data centers, etc., that can be integrated with the medium. The available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state disks, SSDs).
[0203] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0204] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and other division methods may exist in actual implementation. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the shown or discussed mutual couplings, direct couplings, or communication connections may be through some interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms. Units described as separate components may or may not be physically separate; components shown as units may be one physical unit or multiple physical units, i.e., they may be located in one place or distributed in multiple different places. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0205] Furthermore, the functional units in the various embodiments of this invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiments of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.
[0206] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A traffic prediction method characterized by, The method comprises the following steps: acquiring first traffic information in a first time period; determining first feature data of the first traffic information; the first feature data comprises first time sequence feature data divided by time sequence features; inputting the first feature data into a pre-trained traffic prediction model to obtain traffic prediction information of a target time period; the traffic prediction model is trained according to second time sequence feature data of second traffic information in a second time period, a bidirectional encoding algorithm and a residual connection decoding algorithm; the target time period is located after the first time period and the second time period; the traffic prediction model is trained in the following way: acquiring the second traffic information; determining second feature data of the second traffic information; the second feature data comprises the second time sequence feature data divided by time sequence features; using a recurrent neural network to bidirectionally encode the second time sequence feature data according to the bidirectional encoding algorithm to obtain first encoding data encoded from left to right and second encoding data encoded from right to left; splicing the first encoding data and the second encoding data to obtain fused sequence feature data; constructing a multi-layer network model according to the residual connection decoding algorithm and connecting each layer network model in the multi-layer network model by a residual network; performing weighted fusion on the results output by the layer network models to obtain a prediction result of the fused sequence feature data; adjusting model parameters in the layer network models according to the prediction result of the second time sequence feature data until convergence to obtain the traffic prediction model; the first encoding data is obtained by the following formula: t [0, T) ∩ N; wherein, a coding result of a t-th position of an encoding time sequence for representing the order from left to right; a superscript l represents a coding result from left to right; T represents a total time step; N represents an integer set, t∈[0,T)∩N indicates that t is a positive integer in the interval [0,T); a calculation result of a hidden layer; w is a weight that needs to be learned in a deep learning algorithm; p represents the size of the sliding window in the recurrent neural network, and corresponds to p weight matrices, the i-th weight matrix is denoted as The right subscript is used to represent that the weight matrix is used to calculate z; x is the second time series feature data, since there is a sliding window with a size of p in the recurrent neural network algorithm, it is necessary to perform a radiation operation on the vector at the t-i position of the time series is used to represent the operation result of the forget gate; is used to represent the operation result of the output gate; tanh is used to represent the hyperbolic tangent function; σ is used to represent the sigmoid function; is used to represent the recurrent neural network calculation result passed to the t+1 position; c t-1 is the result calculated by the recurrent neural network at the t-1 position; and is the matrix multiplication of the same position.
2. The traffic prediction method according to claim 1, characterized in that, the determination of the first feature data of the first traffic information comprises: performing logarithmic processing on the first traffic information to obtain first data after logarithmic processing; performing regularization processing on the first data after logarithmic processing to obtain the first feature data.
3. The traffic prediction method according to claim 1, characterized in that, the determination of the second feature data of the second traffic information comprises: performing logarithmic processing on the second traffic information to obtain second data after logarithmic processing; performing regularization processing on the second data after logarithmic processing to obtain the second feature data.
4. The traffic prediction method of claim 1, wherein, after inputting the first feature data into the pre-trained traffic prediction model to obtain the traffic prediction information of the target time period, the method further comprises the following steps: determining the accuracy of the traffic prediction information according to a preset evaluation algorithm.
5. A flow prediction device, characterized by, The method comprises the following steps: an acquisition unit and a processing unit; the acquisition unit is configured to acquire first traffic information in a first time period; the processing unit is configured to determine first feature data of the first traffic information; the first feature data comprises first time sequence feature data divided by time sequence features; The processing unit is further configured to input the first feature data into a pre-trained traffic prediction model to obtain traffic prediction information of a target time period; the traffic prediction model is trained according to second time sequence feature data of second traffic information of a second time period, a bidirectional encoding algorithm and a residual connection decoding algorithm; and the target time period is located after the first time period and the second time period. The acquisition unit is further configured to acquire the second traffic information. The processing unit is further configured to determine second feature data of the second traffic information; the second feature data includes the second time sequence feature data divided by time sequence features. The processing unit is further configured to: According to the bidirectional encoding algorithm, the second time sequence feature data is bidirectionally encoded by using a recurrent neural network to obtain first encoding data encoded from left to right and second encoding data encoded from right to left. The first encoding data and the second encoding data are spliced to obtain fused sequence feature data. According to the residual connection decoding algorithm, a multi-layer network model is constructed, and each layer network model in the multi-layer network model is connected by a residual network. The results output by the each layer network model are weighted and fused to obtain a prediction result of the fused sequence feature data. According to the prediction result of the second time sequence feature data, model parameters in the each layer network model are adjusted until convergence to obtain the traffic prediction model. The first encoding data is obtained by the following formula: t∈[0,T)∩N. wherein, represents the encoding result of the t-th position of the sequentially encoded time series from left to right; the superscript l represents the encoding result from left to right; T represents the total time step; N represents a set of integers, t∈[0,T)∩N indicates that t is a positive integer in the interval [0,T); represents the calculation result of the hidden layer; w is the weight that needs to be learned in the deep learning algorithm; p represents the size of the sliding window in the recurrent neural network, and corresponds to p weight matrices, the i-th weight matrix is denoted as The right subscript is used to represent that the weight matrix is used to calculate z; x is the second time series feature data, since there is a sliding window with a size of p in the recurrent neural network algorithm, it is necessary to perform a radiation operation on the vector at the t-i position of the time series The operation result of the forget gate is denoted as The operation result of the output gate is denoted as tanh represents the hyperbolic tangent function; σ represents the sigmoid function; The operation result of the output gate is denoted as tanh represents the hyperbolic tangent function; σ represents the sigmoid function; t-1 is the result obtained by calculating the recurrent neural network at the t-1 position; and is the matrix multiplication of the same position.
6. The flow prediction device of claim 5, wherein, The processing unit is specifically configured to: Perform logarithmic processing on the first traffic information to obtain first data after logarithmic processing; Perform regularization processing on the first data after logarithmic processing to obtain the first feature data.
7. The flow prediction device of claim 5, wherein, The processing unit is specifically configured to: Perform logarithmic processing on the second traffic information to obtain second data after logarithmic processing; Perform regularization processing on the second data after logarithmic processing to obtain the second feature data.
8. The flow prediction device of claim 5, wherein, The processing unit is further configured to determine the accuracy of the traffic prediction information according to a preset evaluation algorithm.
9. A flow prediction device, characterized by, The memory is configured to store computer execution instructions, and the processor is connected with the memory through a bus; When the traffic prediction device is running, the processor executes the computer execution instructions stored in the memory, so that the traffic prediction device executes the traffic prediction method according to any one of claims 1-4.
10. A computer-readable storage medium, characterized in that, The computer readable storage medium includes computer execution instructions, when the computer execution instructions are running on the computer, so that the computer executes the traffic prediction method according to any one of claims 1-4.
Citation Information
Patent Citations
Bidirectional sequence generation
US20220309230A1