A flow prediction method, network training method, device and electronic equipment
Through deep learning network learning the time-tightness and periodic characteristics of historical traffic data, and adjusting the traffic prediction data in combination with dynamic adjustment parameters, solving the problem of failure to effectively consider the impact of periodic data in the existing technology and improving traffic prediction accuracy and network accuracy.
Patent Information
- Application Number
- CN202011284570.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-17
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2040-11-17
AI Technical Summary
Existing traffic prediction technologies fail to effectively consider the impact of periodic data on traffic prediction, resulting in bias in prediction results.
By obtaining a data set containing historical traffic data and historical traffic data of the same period, using deep learning network learning time density characteristics and periodic characteristics, combining dynamic adjustment parameters to adjust the prediction data to generate more accurate traffic prediction results.
The accuracy of traffic prediction is improved, and the impact of periodic data and data before and after periodic time points on prediction is taken into account, which reduces the deviation between the prediction results and the actual data, and improves the accuracy of the network.
Smart Images

Figure CN114584476B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of traffic prediction, and in particular to a traffic prediction method, a network training method, a device and an electronic device. Background Art
[0002] In recent years, the amount of Internet traffic used by users has increased year by year, especially this year, the gradual application of 5G networks around the world has put forward higher requirements for operators. To improve service efficiency, operators must deal with the problem of network resource allocation. When some nodes are under-allocated, it will cause user oversaturation, increase node service load, and reduce user experience; on the contrary, when node resources are allocated too much, it will cause resource waste and may even cause problems such as excessive service pressure on surrounding nodes. In recent years, some common deep learning methods have also been applied to traffic prediction applications.
[0003] The current traffic prediction technology does not take into account the impact of periodic data on the prediction, or the periodic data taken into account is not strictly periodic data for traffic prediction. The traffic may have certain dynamic fluctuations at the same periodic time point, resulting in certain deviations in the prediction results. Summary of the invention
[0004] In order to solve the existing technical problems, the embodiments of the present invention provide a traffic prediction method, a network training method, a device and an electronic device.
[0005] To achieve the above object, the technical solution of the embodiment of the present invention is implemented as follows:
[0006] In a first aspect, an embodiment of the present invention provides a network training method for traffic prediction, the method comprising:
[0007] Obtain a data set including a plurality of first data, and obtain first prediction data at a prediction time point based on the data set and a first network; the plurality of first data are historical traffic data before the prediction time point;
[0008] Obtaining a plurality of second data, and obtaining adjustment data based on the plurality of second data and the second network, wherein the plurality of second data are historical traffic data of the same period as the predicted time point; the plurality of second data include historical traffic data of time points of the same period as the predicted time point, and also include historical traffic data of time points before and / or after time points of the same period as the predicted time point;
[0009] Adjust the first prediction data according to the adjustment data and the dynamic adjustment parameter to obtain second prediction data, and generate prediction sequence data based on the obtained plurality of second prediction data;
[0010] The predicted sequence data is processed by a fully connected network and a loss is determined with the target sequence data, and the first network, the second network and the fully connected network are trained according to the loss.
[0011] In the above solution, the method further includes: adding the second prediction data to the data set, and deleting one first data in the data set to obtain an updated data set;
[0012] The first prediction data at the prediction time point is retrieved based on the updated data set and the first network.
[0013] In the above scheme, the multiple second data include the first historical flow data of the time point in the same period as the predicted time point, the second historical flow data of the time point before the time point in the same period as the predicted time point, and the third historical flow data of the time point after the time point in the same period as the predicted time point;
[0014] The obtaining the adjustment data based on the plurality of second data and the second network comprises:
[0015] Based on the second network, respectively obtain first adjustment data, second adjustment data, and third adjustment data corresponding to the first historical traffic data, the second historical traffic data, and the third historical traffic data;
[0016] The first adjustment data, the second adjustment data and the third adjustment data are weighted, and the adjustment data is obtained according to the weighted processing result.
[0017] In the above solution, the weighted processing of the first adjustment data, the second adjustment data and the third adjustment data includes:
[0018] Using the dynamic adjustment parameter α as the weight of the first adjustment data, (1-α) / 2 as the weights of the second adjustment data and the third adjustment data, weighted sum processing is performed on the first adjustment data, the second adjustment data and the third adjustment data to obtain a weighted processing result.
[0019] In the above solution, adjusting the first prediction data according to the adjustment data and the dynamic adjustment parameter to obtain the second prediction data includes:
[0020] A correction value is obtained by multiplying the dynamic correction factor β and the adjustment data, and the correction value and the first prediction data are added to obtain the second prediction data.
[0021] In the above scheme, the step of processing the predicted sequence data through a fully connected network and determining the loss with the target sequence data includes:
[0022] Obtaining third data in the predicted sequence data after being processed by the fully connected network, and obtaining fourth data in the target sequence data; the third data is the i-th data in the predicted sequence data, and the fourth data is the i-th data in the target sequence data; the value of i is greater than 0 and less than or equal to the number of data contained in the predicted sequence data or the target sequence data;
[0023] A mean absolute percentage error between the third data and the fourth data is determined, and a cosine distance between the third data and the fourth data is determined, and a loss is determined based on the mean absolute percentage error and the cosine distance.
[0024] In a second aspect, an embodiment of the present invention further provides a flow prediction method, the method comprising:
[0025] Obtaining first-category data and second-category data, wherein the first-category data includes a plurality of historical traffic data before a prediction time point, and the second-category data includes a plurality of historical traffic data in the same period as the prediction time point, wherein the plurality of second data includes historical traffic data at time points in the same period as the prediction time point, and also includes historical traffic data at time points before and / or after time points in the same period as the prediction time point;
[0026] Obtain initial prediction data based on the first type of data and the trained first network, and obtain adjustment data based on the second type of data and the trained second network;
[0027] Adjust the initial prediction data according to the adjustment data and the dynamic adjustment parameter to obtain prediction data;
[0028] Based on the obtained multiple prediction data, prediction sequence data is generated, and the prediction sequence data is processed by a fully connected network to obtain a traffic prediction result at the prediction time point.
[0029] In the above solution, the first network, the second network and the fully connected network are obtained by training based on the method described in the first aspect of the embodiment of the present invention.
[0030] In a third aspect, an embodiment of the present invention further provides a network training device for traffic prediction, the device comprising: a first processing unit, a second processing unit, an adjustment unit and a training unit; wherein,
[0031] The first processing unit is used to obtain a data set including a plurality of first data, and obtain first prediction data at a prediction time point based on the data set and the first network; the plurality of first data are historical traffic data before the prediction time point;
[0032] The second processing unit is used to obtain a plurality of second data, and obtain adjustment data based on the plurality of second data and the second network, wherein the plurality of second data are historical traffic data of the same period as the predicted time point; the plurality of second data include historical traffic data of time points of the same period as the predicted time point, and also include historical traffic data of time points before and / or after time points of the same period as the predicted time point;
[0033] The adjustment unit is used to adjust the first prediction data according to the adjustment data and the dynamic adjustment parameter to obtain second prediction data, and generate prediction sequence data based on the obtained multiple second prediction data;
[0034] The training unit is used to determine the loss between the predicted sequence data and the target sequence data after the predicted sequence data is processed by the fully connected network, and train the first network, the second network and the fully connected network according to the loss.
[0035] In the above scheme, the first processing unit is also used to add the second prediction data to the data set, and delete one first data in the data set to obtain an updated data set; based on the updated data set and the first network, the first prediction data at the prediction time point is obtained again.
[0036] In the above scheme, the multiple second data include first historical flow data at a time point in the same period as the predicted time point, second historical flow data at a time point before the time point in the same period as the predicted time point, and third historical flow data at a time point after the time point in the same period as the predicted time point;
[0037] The second processing unit is used to obtain first adjustment data, second adjustment data and third adjustment data corresponding to the first historical traffic data, the second historical traffic data and the third historical traffic data respectively based on the second network; perform weighted processing on the first adjustment data, the second adjustment data and the third adjustment data, and obtain the adjustment data according to the weighted processing result.
[0038] In the above scheme, the second processing unit is used to use the dynamic adjustment parameter α as the weight of the first adjustment data, (1-α) / 2 as the weight of the second adjustment data and the third adjustment data, and perform weighted sum processing on the first adjustment data, the second adjustment data and the third adjustment data to obtain a weighted processing result.
[0039] In the above solution, the adjustment unit is used to obtain a correction value by multiplying the dynamic correction factor β by the adjustment data, and to add the correction value to the first prediction data to obtain the second prediction data.
[0040] In the above scheme, the training unit is used to obtain the third data in the predicted sequence data after processing by the fully connected network, and obtain the fourth data in the target sequence data; the third data is the i-th data in the predicted sequence data, and the fourth data is the i-th data in the target sequence data; the value of i is greater than 0 and less than or equal to the number of data contained in the predicted sequence data or the target sequence data; determine the mean absolute percentage error between the third data and the fourth data, and determine the cosine distance between the third data and the fourth data, and determine the loss based on the mean absolute percentage error and the cosine distance.
[0041] In a fourth aspect, an embodiment of the present invention further provides a flow prediction device, the device comprising: a data acquisition unit and a third processing unit; wherein,
[0042] The data acquisition unit is used to obtain first-category data and second-category data, wherein the first-category data includes a plurality of historical flow data before a prediction time point, and the second-category data includes a plurality of historical flow data in the same period as the prediction time point, wherein the plurality of second data includes historical flow data at time points in the same period as the prediction time point, and also includes historical flow data at time points before and / or after time points in the same period as the prediction time point;
[0043] The third processing unit is used to obtain initial prediction data based on the first category of data and the trained first network; obtain adjustment data based on the second category of data and the trained second network; adjust the initial prediction data according to the adjustment data and dynamic adjustment parameters to obtain prediction data; generate prediction sequence data based on the obtained multiple prediction data, and obtain the traffic prediction result at the prediction time point after processing the prediction sequence data through a fully connected network.
[0044] In the above scheme, the first network, the second network and the fully connected network are obtained by training based on the network training device for traffic prediction described in the third aspect of the embodiment of the present invention.
[0045] In a fifth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in the first aspect or the second aspect of the embodiment of the present invention.
[0046] In a sixth aspect, an embodiment of the present invention further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the method described in the first or second aspect of the embodiment of the present invention are implemented.
[0047] The traffic prediction method, network training method, device and electronic device provided by the embodiments of the present invention, the network training method includes: obtaining a data set including multiple first data, and obtaining first prediction data of a prediction time point based on the data set and the first network; the multiple first data are historical traffic data before the prediction time point; obtaining multiple second data, and obtaining adjustment data based on the multiple second data and the second network, the multiple second data are historical traffic data of the same period as the prediction time point; the multiple second data include historical traffic data of time points in the same period as the prediction time point, and also include historical traffic data of time points before and / or after time points in the same period as the prediction time point; adjusting the first prediction data according to the adjustment data and dynamic adjustment parameters to obtain second prediction data, and generating prediction sequence data based on the obtained multiple second prediction data; after the prediction sequence data is processed by a fully connected network, the loss is determined with the target sequence data, and the first network, the second network and the fully connected network are trained according to the loss. By adopting the technical solution of the embodiment of the present invention, on the one hand, the dynamic time compactness characteristics of the historical traffic data are learned through the first network, and the periodic characteristics of the periodic data are learned through the second network. Adjustment data is determined based on the historical traffic data of the time points in the same period as the prediction time points and the time points before and after, so as to adjust the first prediction data based on the adjustment data, that is, the influence of the periodic data is taken into account in the process of predicting the traffic. On the other hand, in the process of predicting the traffic, the influence of the periodic data and the data before and / or after the periodic time points on the prediction is taken into account, and the first prediction data is adjusted by using dynamic adjustment parameters in combination with the adjustment data, so as to improve the accuracy of the traffic prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 A schematic diagram of a flow chart of a network training method for traffic prediction according to an embodiment of the present invention;
[0049] Figure 2 A schematic block diagram of the processing flow of a network training method for traffic prediction according to an embodiment of the present invention;
[0050] Figure 3 A flow chart of a flow prediction method according to an embodiment of the present invention;
[0051] Figure 4 A schematic diagram of the composition structure of a network training device for traffic prediction according to an embodiment of the present invention;
[0052] Figure 5 A schematic diagram of the structure of a flow prediction device according to an embodiment of the present invention;
[0053] Figure 6The figure is a schematic diagram of the hardware structure of the electronic device according to the embodiment of the present invention. DETAILED DESCRIPTION
[0054] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0055] The terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.
[0056] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present disclosure. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0057] The embodiment of the present invention provides a network training method for traffic prediction. The embodiment of the present invention can be applied to various electronic devices, including but not limited to fixed devices and / or mobile devices, for example, the fixed devices include but are not limited to: personal computers (PCs), or servers, etc., and the servers can be cloud servers or ordinary servers.
[0058] Figure 1 FIG. 1 is a flow chart of a network training method for flow prediction according to an embodiment of the present invention; Figure 1 As shown, the method includes:
[0059] Step 101: obtaining a data set including a plurality of first data, and obtaining first prediction data at a prediction time point based on the data set and a first network; the plurality of first data are historical traffic data before the prediction time point;
[0060] Step 102: obtaining a plurality of second data, and obtaining adjustment data based on the plurality of second data and the second network, wherein the plurality of second data are historical traffic data of the same period as the prediction time point; the plurality of second data include historical traffic data of time points of the same period as the prediction time point, and also include historical traffic data of time points before and / or after time points of the same period as the prediction time point;
[0061] Step 103: adjusting the first prediction data according to the adjustment data to obtain second prediction data, and generating prediction sequence data based on the obtained plurality of second prediction data;
[0062] Step 104: After the prediction sequence data is processed by the fully connected network, a loss is determined with the target sequence data, and the first network, the second network and the fully connected network are trained according to the loss.
[0063] In this embodiment, the first network is a deep learning network, specifically a recurrent neural network. Exemplarily, the first network may use a long short-term memory (LSTM) network. In this embodiment, the first network analyzes and processes a plurality of historical traffic data, learns the time density characteristics, and thus predicts and obtains the first prediction data at the prediction time point.
[0064] The multiple first data included in the data set are specifically multiple data before the prediction time point. Exemplarily, the multiple first data may be multiple historical traffic data that meet certain time parameters. For example, multiple historical traffic data may be randomly obtained from the historical traffic data within a preset time period before the prediction time point. Optionally, each first data represents the historical traffic information corresponding to a certain moment or time period in history, that is, the first data may carry a time parameter.
[0065] In this embodiment, the second network is used to learn the periodic characteristics. Exemplarily, the second network can be implemented by a multi-layer perceptron (MLP) network. In this embodiment, the second network analyzes and processes the historical traffic data of the same period as the prediction time point to learn the periodic characteristics.
[0066] Each second data represents the historical traffic corresponding to a certain moment (time point) in history. Among the multiple second data, at least the historical traffic data of the same period time point as the preset time point may also include the historical traffic data of the previous time point and / or the next time point of the same period time point as the preset time point. Exemplarily, the second data may be represented in the form of a sequence.
[0067] Considering that the disturbances generated by periodic dynamic changes are generally at the position where the adjacent time of the time point in the same period of the predicted time point is shorter, therefore, in this embodiment, the above-mentioned multiple second data include the historical flow data of the time point in the same period of the predicted time point, and also include the historical flow data of the time point before and / or after the time point in the same period of the predicted time point. In some optional embodiments, the multiple second data include the first historical flow data of the time point in the same period of the predicted time point, the second historical flow data of the time point before the time point in the same period of the predicted time point, and the third historical flow data of the time point after the time point in the same period of the predicted time point; that is, the time point in the same period of the predicted time point can be selected as the first time point, the time point before and after the first time point can be respectively selected as the second time point and the third time point, and the first historical flow data corresponding to the first time point, the second historical flow data corresponding to the second time point, and the third historical flow data corresponding to the third time point can be respectively selected as the above-mentioned second data. Of course, in this embodiment, the above-mentioned second data is not limited to the above-mentioned examples, and can also be the time point separated from the first time point by a preset time as the above-mentioned second time point and the third time point, and the length of the preset time can be set according to the actual situation.
[0068] In this embodiment, the adjustment data obtained based on the plurality of second data and the second network is used to adjust the first prediction data, thereby adjusting the accuracy of a single prediction data (ie, the first prediction data).
[0069] In some optional embodiments of the present invention, the multiple second data include first historical traffic data of a time point in the same period as the predicted time point, second historical traffic data of a time point before the time point in the same period as the predicted time point, and third historical traffic data of a time point after the time point in the same period as the predicted time point; obtaining adjustment data based on the multiple second data and the second network includes: obtaining first adjustment data, second adjustment data and third adjustment data corresponding to the first historical traffic data, the second historical traffic data and the third historical traffic data respectively based on the second network; performing weighted processing on the first adjustment data, the second adjustment data and the third adjustment data, and obtaining the adjustment data according to the weighted processing result.
[0070] Among them, in some optional embodiments, the weighted processing of the first adjustment data, the second adjustment data and the third adjustment data includes: using the dynamic adjustment parameter α as the weight of the first adjustment data, (1-α) / 2 as the weight of the second adjustment data and the third adjustment data, performing weighted sum processing on the first adjustment data, the second adjustment data and the third adjustment data, and obtaining a weighted processing result.
[0071] This embodiment is described by taking as an example a plurality of second data including first historical traffic data at a time point in the same period as the prediction time point, second historical traffic data at a time point before the time point in the same period as the prediction time point, and third historical traffic data at a time point after the time point in the same period as the prediction time point. The first historical traffic data, the second historical traffic data, and the third traffic data are processed respectively through the second network to obtain first adjustment data (denoted as Q1) corresponding to the first historical traffic data, second adjustment data (denoted as Q2) corresponding to the second historical traffic data, and third adjustment parameter (denoted as Q2) corresponding to the third historical traffic data. The parameter α is used as the weight of the first adjustment data, and (1-α) / 2 is used as the weights of the second adjustment data and the third adjustment data. Then, the adjustment data Q satisfies:
[0072]
[0073] The value range of α is greater than 0 and less than 1. Of course, the value range of α in this embodiment is not limited to the above example.
[0074] In some optional embodiments of the present invention, adjusting the first prediction data according to the adjustment data to obtain second prediction data includes: obtaining a correction value by multiplying a dynamic correction factor by the adjustment data, and adding the correction value to the first prediction data to obtain the second prediction data.
[0075] In this embodiment, the first prediction data is set as S1, the adjustment data is still recorded as Q, and the correction factor is recorded as β, then the second prediction data S2 satisfies:
[0076] S2=S1+β×Q (2)
[0077] Exemplarily, the value range of β is greater than -0.5 and less than 0.5. Of course, the value range of β in this embodiment is not limited to the above example.
[0078] In this embodiment, in some optional embodiments, multiple second prediction data may be obtained based on the obtained multiple data sets according to the processing of the above steps 101 to 102.
[0079] In some other optional embodiments, the method further includes: adding the second prediction data to the data set, and deleting one first data in the data set to obtain an updated data set; and re-obtaining the first prediction data at the prediction time point based on the updated data set and the first network.
[0080] In this embodiment, the data set may be a data sequence arranged in a certain order. After obtaining the first second prediction data, the second prediction data is added to the data set (i.e., data sequence), and the first data in the data set (i.e., data sequence) is deleted, thereby obtaining a new data set. Then, according to the processing of the above steps 101 to 102, the second second prediction data is obtained. Then, the second second prediction data is repeatedly added to the data set (i.e., data sequence), and the first data in the data set (i.e., data sequence) is deleted, thereby obtaining a new data set. Then, according to the processing of the above steps 101 to 102, the third second prediction data is obtained, and so on, until the prediction sequence data is obtained, and the prediction sequence data includes a set number of the above second prediction data.
[0081] In some optional embodiments of the present invention, the process of processing the predicted sequence data through a fully connected network and determining the loss with the target sequence data includes: obtaining third data in the predicted sequence data and obtaining fourth data in the target sequence data; the third data is the i-th data in the predicted sequence data and the fourth data is the i-th data in the target sequence data; the value of i is greater than 0 and less than or equal to the number of data contained in the predicted sequence data or the target sequence data; determining the mean absolute percentage error between the third data and the fourth data, and determining the cosine distance between the third data and the fourth data, and determining the loss based on the mean absolute percentage error and the cosine distance.
[0082] In this embodiment, the above loss can adopt a mapping cosine distance (MC, MAPE-Cosine Distance) mixed loss function, that is, the above loss includes two parts: one part is the mean absolute percentage error between the predicted data and the actual data (ie, target data), and the other part is the cosine distance between the predicted data and the actual data (ie, target data).
[0083] Exemplarily, the loss L satisfies:
[0084]
[0085] Among them, k is a hyperparameter for adjusting the cosine distance ratio. The value of k is less than -1, y i is the i-th value of the target sequence data, p i is the i-th value of the predicted sequence data; N represents the number of data in the target sequence data and the predicted sequence data.
[0086] In this embodiment, after the predicted sequence data obtained in the above step 103 is processed by the fully connected network, the loss L is determined according to the processing result of the fully connected network and the target sequence data according to the above formula (3), and the parameters in the above-mentioned first network, second network and fully connected network are adjusted according to the loss L, that is, the first network, second network and fully connected network are trained, so that the loss L obtained based on the predicted sequence data and the target sequence data meets the convergence condition.
[0087] The technical solution of the embodiment of the present invention is adopted. On the one hand, the dynamic time compactness characteristics of historical traffic data are learned through the first network, and the periodic characteristics of periodic data are learned through the second network. The adjustment data is determined based on the historical traffic data of the time point in the same period as the prediction time point and the time points before and after, so as to adjust the first prediction data based on the adjustment data, that is, the influence of periodic data is taken into account in the process of traffic prediction; on the other hand, in the process of traffic prediction, the influence of periodic data and data before and / or after the periodic time point on the prediction is taken into account, and the first prediction data is adjusted by using dynamic adjustment parameters (including dynamic adjustment parameters α and dynamic correction factors β) combined with adjustment data, so as to improve the accuracy of single prediction data (such as second prediction data). On the third hand, the loss function of the present application includes two parts: mean absolute percentage error and cosine distance, which can reduce the deviation between the prediction data and the actual data, thereby improving the accuracy of the network and the accuracy of traffic prediction.
[0088] The network training method according to the embodiment of the present invention is described below with reference to a specific example.
[0089] Figure 2 FIG. 1 is a schematic block diagram of a processing flow of a network training method for flow prediction according to an embodiment of the present invention; Figure 2 As shown, in this embodiment, the input data includes: three periodic sequences {P0} with a dimension of n×p n×p , {P -1} n×p ,{P1} n×p and a preceding time series {W} of length w w×1 , {W} w×1 includes w data. Among them, the above {W} w×1 is the data set in the above embodiment, the above {P0} n×p , {P -1} n×p ,{P1} n×p The output data is: the predicted sequence {W} of length p p×1 .
[0090] Step 1: Set the sequence {W i} w×1 As input, the neural network outputs the predicted data S 1i ; Among them, the value range of i is but equal to 1 and less than or equal to w.
[0091] Step 2: The corresponding time points of n periods before the predicted time point and the sequence of adjacent time points {P0} n×i , {P -1} n×i ,{P1} n×i After passing through the second network and weighted by the dynamic parameter α, the output adjustment data S 2i ;
[0092] Among them, assuming that {P0} n×i , {P -1} n×i ,{P1} n×i The output results of the second network are recorded as Q1, Q2 and Q3 respectively, then the adjusted data S 2i satisfy:
[0093]
[0094] The value range of α is greater than 0 and less than 1.
[0095] Step 3: The result S is obtained based on the neighboring dynamics of the data periodicity features learned in step 2 2i And the dynamic correction factor β adjusts the forecast data S 1i ; Get the predicted data S i ;
[0096] Here, S i =S 1i +β×S 2i
[0097] The value range of β is greater than -0.5 and less than 0.5. The prediction point S is adjusted by the dynamic correction factor β. 1i , improve the single value prediction accuracy and output the predicted value S i .
[0098] Step 4: Set the prediction data S i Assign value to w i Add {W i} w×1 , and delete {W i} w×1 The first data in generates {W i+1} w×1 The new input data is obtained and steps 1 to 4 are executed again using the new data.
[0099] Step 5: Implement the above p cycles to obtain a sequence {S} of length p p×1 ; where {S} p×1 Each value in is the predicted data S obtained in each cycle in the above step 3 i .
[0100] Step 6: p×1 After the fully connected (FC) network, the mixed loss function between the target sequence data is calculated, and the first network, the second network and the FC network are trained according to the calculation result of the mixed loss function so that the deviation between them and the target sequence data in value and time meets the preset convergence conditions.
[0101] The above process is the network training process. When traffic prediction is performed based on the first network, the second network, and the FC network shown in the figure, the sequence {S} can be obtained by following the above steps 1 to 5. p×1 , sequence {S} p×1 After FC network processing, the traffic prediction result is obtained {S} p×1 .
[0102] Based on the above embodiments, an embodiment of the present invention further provides a flow prediction method. Figure 3 FIG. 1 is a flow chart of a flow prediction method according to an embodiment of the present invention; Figure 3 As shown, the method includes:
[0103] Step 201: obtaining first-category data and second-category data, wherein the first-category data includes a plurality of historical traffic data before a prediction time point, and the second-category data includes a plurality of historical traffic data in the same period as the prediction time point, wherein the plurality of second data includes historical traffic data at time points in the same period as the prediction time point, and also includes historical traffic data at time points before and / or after time points in the same period as the prediction time point;
[0104] Step 202: obtaining initial prediction data based on the first type of data and the trained first network, and obtaining adjustment data based on the second type of data and the trained second network;
[0105] Step 203: adjusting the initial prediction data according to the adjustment data to obtain prediction data;
[0106] Step 204: Generate prediction sequence data based on the obtained multiple prediction data, and obtain the traffic prediction result at the prediction time point after processing the prediction sequence data through a fully connected network.
[0107] The detailed processing procedures in step 201 to step 204 in this embodiment can refer to the records of the relevant steps in the aforementioned network training method embodiment, which will not be repeated here.
[0108] In this embodiment, the first network, the second network and the fully connected network are obtained by training based on the network training method described in the foregoing embodiments of the present application.
[0109] The embodiment of the present invention also provides a network training device for traffic prediction. Figure 4 FIG. 1 is a schematic diagram of the composition structure of a network training device for flow prediction according to an embodiment of the present invention. Figure 4 As shown, the device includes: a first processing unit 31, a second processing unit 32, an adjustment unit 33 and a training unit 34; wherein,
[0110] The first processing unit 31 is used to obtain a data set including a plurality of first data, and obtain first prediction data at a prediction time point based on the data set and the first network; the plurality of first data are historical traffic data before the prediction time point;
[0111] The second processing unit 32 is used to obtain a plurality of second data, and obtain adjustment data based on the plurality of second data and the second network, wherein the plurality of second data are historical traffic data of the same period as the prediction time point; the plurality of second data include historical traffic data of time points of the same period as the prediction time point, and also include historical traffic data of time points before and / or after time points of the same period as the prediction time point;
[0112] The adjusting unit 33 is used to adjust the first prediction data according to the adjustment data and the dynamic adjustment parameter to obtain second prediction data, and generate prediction sequence data based on the obtained multiple second prediction data;
[0113] The training unit 34 is used to determine the loss between the predicted sequence data and the target sequence data after the data is processed by the fully connected network, and train the first network, the second network and the fully connected network according to the loss.
[0114] In some optional embodiments of the present invention, the first processing unit 31 is further used to add the second prediction data to the data set, and delete one first data in the data set to obtain an updated data set; and regain the first prediction data at the prediction time point based on the updated data set and the first network.
[0115] In some optional embodiments of the present invention, the plurality of second data include first historical flow data at a time point in the same period as the predicted time point, second historical flow data at a time point before the time point in the same period as the predicted time point, and third historical flow data at a time point after the time point in the same period as the predicted time point;
[0116] The second processing unit 32 is used to obtain the first adjustment data, the second adjustment data and the third adjustment data corresponding to the first historical traffic data, the second historical traffic data and the third historical traffic data respectively based on the second network; perform weighted processing on the first adjustment data, the second adjustment data and the third adjustment data, and obtain the adjustment data according to the weighted processing result.
[0117] In some optional embodiments of the present invention, the second processing unit 32 is used to use the dynamic adjustment parameter α as the weight of the first adjustment data, (1-α) / 2 as the weight of the second adjustment data and the third adjustment data, and perform weighted sum processing on the first adjustment data, the second adjustment data and the third adjustment data to obtain a weighted processing result.
[0118] In some optional embodiments of the present invention, the adjustment unit 33 is used to obtain a correction value by multiplying the dynamic correction factor β by the adjustment data, and to add the correction value to the first prediction data to obtain the second prediction data.
[0119] In some optional embodiments of the present invention, the training unit 34 is used to obtain the third data in the predicted sequence data after processing by the fully connected network, and obtain the fourth data in the target sequence data; the third data is the i-th data in the predicted sequence data, and the fourth data is the i-th data in the target sequence data; the value of i is greater than 0 and less than or equal to the number of data contained in the predicted sequence data or the target sequence data; determine the mean absolute percentage error between the third data and the fourth data, and determine the cosine distance between the third data and the fourth data, and determine the loss based on the mean absolute percentage error and the cosine distance.
[0120] In the embodiment of the present invention, the first processing unit 31, the second processing unit 32, the adjustment unit 33 and the training unit 34 in the device can be implemented by a central processing unit (CPU), a digital signal processor (DSP), a microcontroller unit (MCU) or a programmable gate array (FPGA) in practical applications.
[0121] It should be noted that: the network training device for traffic prediction provided in the above embodiment only uses the division of the above program modules as an example when performing network training. In actual applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the device is divided into different program modules to complete all or part of the processing described above. In addition, the network training device for traffic prediction provided in the above embodiment and the network training method embodiment for traffic prediction belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0122] The embodiment of the present invention also provides a flow prediction device. Figure 5 FIG. 1 is a schematic diagram of the structure of a flow prediction device according to an embodiment of the present invention; Figure 5 As shown, the device comprises: a data acquisition unit 41 and a third processing unit 42; wherein,
[0123] The data acquisition unit 41 is used to obtain first-category data and second-category data, wherein the first-category data includes a plurality of historical flow data before the prediction time point, and the second-category data includes a plurality of historical flow data in the same period as the prediction time point, wherein the plurality of second data includes the historical flow data at the time point in the same period as the prediction time point, and also includes the historical flow data at the time point before and / or after the time point in the same period as the prediction time point;
[0124] The third processing unit 42 is used to obtain initial prediction data based on the first category of data and the trained first network; obtain adjustment data based on the second category of data and the trained second network; adjust the initial prediction data according to the adjustment data and dynamic adjustment parameters to obtain prediction data; generate prediction sequence data based on the obtained multiple prediction data, and obtain the traffic prediction result at the prediction time point after processing the prediction sequence data through a fully connected network.
[0125] In the embodiment of the present invention, the data acquisition unit 41 and the third processing unit 42 in the device can be implemented by a CPU, a DSP, an MCU or an FPGA in practical applications.
[0126] It should be noted that: the flow prediction device provided in the above embodiment only uses the division of the above program modules as an example when performing flow prediction. In actual applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the device is divided into different program modules to complete all or part of the processing described above. In addition, the flow prediction device provided in the above embodiment and the flow prediction method embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0127] An embodiment of the present invention further provides an electronic device, which may include the network training device or traffic prediction device for traffic prediction in the aforementioned embodiment. Figure 6 FIG. 1 is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present invention. Figure 6 As shown, the electronic device includes a memory 52, a processor 51, and a computer program stored in the memory 52 and executable on the processor 51. When the processor 51 executes the program, the steps of the network training method for traffic prediction described in the aforementioned embodiment of the present invention are implemented; alternatively, when the processor 51 executes the program, the steps of the traffic prediction method described in the aforementioned embodiment of the present invention are implemented.
[0128] Optionally, the components in the electronic device are coupled together via a bus system 53. It is understood that the bus system 53 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 53 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, Figure 6 Various buses are labeled as bus system 53.
[0129] It can be understood that the memory 52 can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disk, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM, SyncLink Dynamic Random Access Memory), and direct RAM bus random access memory (DRRAM, Direct Rambus Random Access Memory).The memory 52 described in the embodiments of the present invention is intended to include, but is not limited to, these and any other suitable types of memory.
[0130] The method disclosed in the above embodiment of the present invention can be applied to the processor 51, or implemented by the processor 51. The processor 51 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit in the processor 51 or the instruction in the form of software. The above processor 51 can be a general processor, DSP, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor 51 can implement or execute the methods, steps and logic block diagrams disclosed in the embodiment of the present invention. The general processor can be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the embodiment of the present invention can be directly embodied as a hardware decoding processor to execute, or the hardware and software modules in the decoding processor can be combined to execute. The software module can be located in a storage medium, which is located in the memory 52. The processor 51 reads the information in the memory 52 and completes the steps of the above method in combination with its hardware.
[0131] In an exemplary embodiment, the electronic device may be implemented by one or more application specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), FPGAs, general purpose processors, controllers, MCUs, microprocessors, or other electronic components to execute the aforementioned method.
[0132] In an exemplary embodiment, the present invention also provides a computer-readable storage medium, such as a memory 52 including a computer program, and the computer program can be executed by a processor 51 of an electronic device to complete the steps of the aforementioned method. The computer-readable storage medium can be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface memory, optical disk, or CD-ROM; or it can be various devices including one or any combination of the above memories.
[0133] An embodiment of the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the network training method for traffic prediction described in the foregoing embodiment of the present invention, or, when executed by a processor, implements the steps of the traffic prediction method described in the foregoing embodiment of the present invention.
[0134] The methods disclosed in several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.
[0135] The features disclosed in several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.
[0136] The features disclosed in several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.
[0137] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0138] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the scheme of this embodiment.
[0139] In addition, all functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0140] A person of ordinary skill in the art can understand that: all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium, which, when executed, executes the steps of the above-mentioned method embodiment; and the aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, disks or optical disks.
[0141] Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.
[0142] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A network training method for traffic prediction, characterized in that: The method comprises: Obtain a data set including a plurality of first data, and obtain first prediction data at a prediction time point based on the data set and a first network; the plurality of first data are historical traffic data before the prediction time point; Obtaining a plurality of second data, and obtaining adjustment data based on the plurality of second data and the second network, wherein the plurality of second data are historical traffic data of the same period as the prediction time point; the plurality of second data include historical traffic data of time points of the same period as the prediction time point, and also include historical traffic data of time points before and / or after time points of the same period as the prediction time point; the adjustment data is used to adjust the accuracy of the first prediction data based on periodic data; Adjust the first prediction data according to the adjustment data and the dynamic adjustment parameter to obtain second prediction data, and generate prediction sequence data based on the obtained plurality of second prediction data; The predicted sequence data is processed by a fully connected network and a loss is determined with the target sequence data, and the first network, the second network and the fully connected network are trained according to the loss.
2. The method according to claim 1, characterized in that The method further comprises: adding the second prediction data to the data set, and deleting one first data in the data set to obtain an updated data set; The first prediction data at the prediction time point is retrieved based on the updated data set and the first network.
3. The method according to claim 1, characterized in that The plurality of second data include first historical flow data at a time point in the same cycle as the predicted time point, second historical flow data at a time point before the time point in the same cycle as the predicted time point, and third historical flow data at a time point after the time point in the same cycle as the predicted time point; The obtaining the adjustment data based on the plurality of second data and the second network comprises: Based on the second network, respectively obtain first adjustment data, second adjustment data, and third adjustment data corresponding to the first historical traffic data, the second historical traffic data, and the third historical traffic data; The first adjustment data, the second adjustment data and the third adjustment data are weighted, and the adjustment data is obtained according to the weighted processing result.
4. The method according to claim 3, characterized in that The weighted processing of the first adjustment data, the second adjustment data and the third adjustment data includes: Using the dynamic adjustment parameter α as the weight of the first adjustment data, (1-α) / 2 as the weights of the second adjustment data and the third adjustment data, weighted sum processing is performed on the first adjustment data, the second adjustment data and the third adjustment data to obtain a weighted processing result.
5. The method according to claim 1, characterized in that The step of adjusting the first prediction data according to the adjustment data and the dynamic adjustment parameter to obtain second prediction data includes: A correction value is obtained by multiplying the dynamic correction factor β and the adjustment data, and the correction value and the first prediction data are added to obtain the second prediction data.
6. The method according to claim 1, characterized in that The step of processing the predicted sequence data through a fully connected network and determining the loss with the target sequence data comprises: Obtaining third data in the predicted sequence data after being processed by the fully connected network, and obtaining fourth data in the target sequence data; the third data is the i-th data in the predicted sequence data, and the fourth data is the i-th data in the target sequence data; the value of i is greater than 0 and less than or equal to the number of data contained in the predicted sequence data or the target sequence data; A mean absolute percentage error between the third data and the fourth data is determined, and a cosine distance between the third data and the fourth data is determined, and a loss is determined based on the mean absolute percentage error and the cosine distance.
7. A flow prediction method, characterized in that: The method comprises: Obtaining first-category data and second-category data, wherein the first-category data includes a plurality of historical traffic data before a prediction time point, and the second-category data includes a plurality of historical traffic data in the same period as the prediction time point, wherein the plurality of second-category data includes historical traffic data at time points in the same period as the prediction time point, and also includes historical traffic data at time points before and / or after time points in the same period as the prediction time point; Obtaining initial prediction data based on the first type of data and the trained first network, and obtaining adjustment data based on the second type of data and the trained second network; the adjustment data is used to adjust the accuracy of the initial prediction data based on the periodic data; Adjust the initial prediction data according to the adjustment data and the dynamic adjustment parameter to obtain prediction data; Based on the obtained multiple prediction data, prediction sequence data is generated, and the prediction sequence data is processed by a fully connected network to obtain a traffic prediction result at the prediction time point.
8. The method according to claim 7, characterized in that The first network, the second network and the fully connected network are obtained by training based on the method according to any one of claims 1 to 6.
9. A network training device for traffic prediction, characterized in that: The device comprises: a first processing unit, a second processing unit, an adjustment unit and a training unit; wherein, The first processing unit is used to obtain a data set including a plurality of first data, and obtain first prediction data at a prediction time point based on the data set and the first network; the plurality of first data are historical traffic data before the prediction time point; The second processing unit is used to obtain a plurality of second data, and obtain adjustment data based on the plurality of second data and the second network, wherein the plurality of second data are historical traffic data of the same period as the prediction time point; the plurality of second data include historical traffic data of time points of the same period as the prediction time point, and also include historical traffic data of time points before and / or after time points of the same period as the prediction time point; the adjustment data is used to adjust the accuracy of the first prediction data based on periodic data; The adjustment unit is used to adjust the first prediction data according to the adjustment data and the dynamic adjustment parameter to obtain second prediction data, and generate prediction sequence data based on the obtained multiple second prediction data; The training unit is used to determine the loss between the predicted sequence data and the target sequence data after the predicted sequence data is processed by the fully connected network, and train the first network, the second network and the fully connected network according to the loss.
10. The device according to claim 9, characterized in that The first processing unit is further configured to add the second prediction data to the data set, and delete a first data in the data set to obtain an updated data set; and re-obtain the first prediction data at the prediction time point based on the updated data set and the first network.
11. The device according to claim 10, characterized in that The plurality of second data include first historical flow data at a time point in the same cycle as the predicted time point, second historical flow data at a time point before the time point in the same cycle as the predicted time point, and third historical flow data at a time point after the time point in the same cycle as the predicted time point; The second processing unit is used to obtain first adjustment data, second adjustment data and third adjustment data corresponding to the first historical traffic data, the second historical traffic data and the third historical traffic data respectively based on the second network; perform weighted processing on the first adjustment data, the second adjustment data and the third adjustment data, and obtain the adjustment data according to the weighted processing result.
12. The device according to claim 11, characterized in that The second processing unit is used to use the dynamic adjustment parameter α as the weight of the first adjustment data and (1-α) / 2 as the weights of the second adjustment data and the third adjustment data, perform weighted sum processing on the first adjustment data, the second adjustment data and the third adjustment data, and obtain a weighted processing result.
13. The device according to claim 9, characterized in that The adjustment unit is used to obtain a correction value by multiplying the dynamic correction factor β by the adjustment data, and to add the correction value to the first prediction data to obtain the second prediction data.
14. The device according to claim 9, characterized in that The training unit is used to obtain the third data in the predicted sequence data after being processed by the fully connected network, and obtain the fourth data in the target sequence data; the third data is the i-th data in the predicted sequence data, and the fourth data is the i-th data in the target sequence data; the value of i is greater than 0 and less than or equal to the number of data contained in the predicted sequence data or the target sequence data; A mean absolute percentage error between the third data and the fourth data is determined, and a cosine distance between the third data and the fourth data is determined, and a loss is determined based on the mean absolute percentage error and the cosine distance.
15. A flow prediction device, characterized in that: The device comprises: a data acquisition unit and a third processing unit; wherein, The data acquisition unit is used to obtain first-category data and second-category data, wherein the first-category data includes a plurality of historical flow data before a prediction time point, and the second-category data includes a plurality of historical flow data in the same period as the prediction time point, wherein the plurality of second-category data includes historical flow data at time points in the same period as the prediction time point, and also includes historical flow data at time points before and / or after time points in the same period as the prediction time point; The third processing unit is used to obtain initial prediction data based on the first category of data and the trained first network; obtain adjustment data based on the second category of data and the trained second network; adjust the initial prediction data according to the adjustment data and dynamic adjustment parameters to obtain prediction data; generate prediction sequence data based on the obtained multiple prediction data, and obtain the traffic prediction result at the prediction time point after processing the prediction sequence data through a fully connected network; the adjustment data is used to adjust the accuracy of the initial prediction data based on periodic data.
16. The device according to claim 15, characterized in that The first network, the second network and the fully connected network are obtained by training based on the network training device for traffic prediction according to any one of claims 9 to 14.
17. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method described in any one of claims 1 to 6 are implemented; or, when the program is executed by a processor, the steps of the method described in claim 7 or 8 are implemented.
18. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the method described in any one of claims 1 to 6 are implemented; or, when the processor executes the program, the steps of the method described in claim 7 or 8 are implemented.
Citation Information
Patent Citations
Network service scheduling method and device
CN107959640A