Multi-section train passenger flow prediction method and device based on temporal convolutional attention
By using the method of timing convolution attention in multi-section passenger flow prediction, combining linear and nonlinear units to extract different characteristics of multi-section passenger flow data, the problem of difficulty in extracting timing modes and spatial information in the prior art is solved, and the prediction accuracy is improved.
Patent Information
- Application Number
- CN202210032572.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-12
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2042-01-12
AI Technical Summary
The prior art is difficult to extract short-term and long-term timing patterns in multi-section train passenger flow prediction, and spatial information is difficult to utilize, resulting in poor prediction results.
The multi-section train passenger flow prediction method based on timing convolution attention is adopted. Through the combination of linear units and nonlinear units, linear characteristics, short-term timing characteristics, spatial relationship characteristics and long-term timing characteristics in the multi-section train passenger flow data are extracted.
It improves the accuracy of passenger flow prediction, can better capture local information, short-term and long-term timing characteristics in passenger flow in multiple sections, and enhances the in-depth exploration of different characteristics of railway passenger flow.
Smart Images

Figure CN114462685B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of railway passenger flow prediction, and in particular to a method and device for predicting multi-section train passenger flow based on temporal convolutional attention. Background Art
[0002] With the continuous upgrading of railway operation and management models in recent years, the high-speed railway network has moved from "four vertical and four horizontal" to "eight vertical and eight horizontal", and railway passenger transport has also achieved brilliant achievements along with the rapid development of the domestic economy. Thanks to the speed and convenience of railway passenger transport, high-speed rail has gradually become one of the first choices for passengers. However, in the face of growing travel demand, how to reasonably allocate resources, adjust operation strategies according to market dynamics, and increase operating revenue has become a challenge facing the railway department. In order to solve these problems, it is necessary to have a deeper understanding of passenger flow trends and make accurate predictions of railway passenger flow. Therefore, the analysis and prediction of railway passenger flow is the cornerstone of scientific management in railway-related fields and a necessary measure to grasp the dynamic trend of passenger flow. On the other hand, with the rapid development of the domestic economy, the high-speed railway network based on urban agglomerations has basically taken shape, and there are more and more studies on passenger flow distribution based on the railway network. From the perspective of passenger flow prediction, how to design a deep learning model to better utilize passenger flow data from multiple sections in the railway network has become an urgent problem to be solved.
[0003] Traditional passenger flow prediction methods include methods based on time series models, methods based on regression analysis, and methods based on machine learning. The method based on time series models uses historical passenger flow data to establish a time series model based on the past and present change characteristics of the predicted object, and then uses the model to perform extrapolation to predict the future. The method based on regression analysis is to establish a regression equation between passenger flow and the main influencing factors. Based on the prediction of the main factors, the regression equation is used to predict passenger flow. The method based on machine learning first extracts features that meet the characteristics of railway passenger flow through feature engineering, and then uses traditional machine learning regression methods for prediction. Although these methods have achieved certain results, they need to rely on manually designed rules or features, so that the performance of the model depends on the quality of the manually designed rules or features. In recent years, with the development of deep learning, methods based on neural networks have been applied to passenger flow prediction tasks and have achieved many research results. This method does not rely on manually designed features, and the relevant features are completely automatically learned by neural networks.
[0004] Although deep learning methods represented by convolutional neural networks and recurrent neural networks have made certain breakthroughs in passenger flow prediction tasks, there are still quite a few problems. For example, although convolutional neural networks can capture short-term temporal features and local spatial information in passenger flow, they ignore the role of global information. Although recurrent neural networks can effectively learn long-term temporal relationships in passenger flow, they cannot handle long sequence dependency problems. In addition, due to the nonlinearity of neural networks, neural network models often have the defect that the scale of the output is insensitive to the scale of the input. Usually, when processing input data of multiple scales, the range of the output data may be within a relatively small interval. If the input data continues to change non-periodically, the prediction accuracy of the neural network model will be reduced. Summary of the invention
[0005] The present invention provides a multi-section train passenger flow prediction method and device based on temporal convolutional attention, which are used to solve the defects of the prior art in the multi-section train passenger flow prediction task, such as the difficulty in extracting short-term and long-term temporal patterns, and the difficulty in utilizing spatial information, which lead to poor prediction effect. The method takes into account the long-term and short-term characteristics of passenger flow data and improves the prediction accuracy.
[0006] The present invention provides a multi-section train passenger flow prediction method based on temporal convolutional attention, comprising:
[0007] Obtain passenger flow data of multiple sections of trains;
[0008] Inputting the multi-section train passenger flow data into a multi-section passenger flow prediction model to obtain the multi-section train passenger flow prediction data output by the multi-section passenger flow prediction model;
[0009] Among them, the multi-section passenger flow prediction model is obtained by training with multi-section train passenger flow sample data, the multi-section passenger flow prediction model includes linear units and non-linear units, and the multi-section train passenger flow prediction data is obtained by adding the output results of the multi-section train passenger flow data after passing through the linear units and non-linear units respectively.
[0010] According to a multi-section train passenger flow prediction method based on temporal convolutional attention provided by the present invention, the linear unit is used to extract linear features in the multi-section train passenger flow data, and the non-linear unit is used to extract short-term temporal features of the multi-section train passenger flow data, spatial relationship features between passenger flows in different sections, and long-term temporal features.
[0011] According to a multi-section train passenger flow prediction method based on temporal convolutional attention provided by the present invention, the linear unit is used to extract linear features in the multi-section train passenger flow data, including:
[0012] The linear unit is used to extract the linear features in the multi-section train passenger flow data through an autoregressive model and output a linear component prediction result.
[0013] According to a multi-section train passenger flow prediction method based on temporal convolutional attention provided by the present invention, the nonlinear unit is used to extract the short-term temporal characteristics of the multi-section train passenger flow data, the spatial relationship characteristics between passenger flows in different sections, and the long-term temporal characteristics, including:
[0014] The nonlinear unit is used to extract the short-term time series characteristics of the multi-section train passenger flow data and the spatial relationship characteristics between passenger flows in different sections through a convolutional neural network to obtain a convolution result;
[0015] The nonlinear unit is also used to extract the long-term temporal features of the convolution result through a temporal convolutional attention network and output a nonlinear component prediction result.
[0016] According to a multi-section train passenger flow prediction method based on temporal convolutional attention provided by the present invention, the temporal convolutional attention network includes four dilated convolutional layers and four self-attention layers, and a self-attention layer is arranged after each dilated convolutional layer.
[0017] The present invention also provides a multi-section train passenger flow prediction device based on temporal convolution attention, comprising:
[0018] The acquisition module is used to obtain passenger flow data of multiple sections of trains;
[0019] A prediction module, used for inputting the multi-section train passenger flow data into a multi-section passenger flow prediction model to obtain the multi-section train passenger flow prediction data output by the multi-section passenger flow prediction model;
[0020] Among them, the multi-section passenger flow prediction model is obtained by training with multi-section train passenger flow sample data, the multi-section passenger flow prediction model includes linear units and non-linear units, and the multi-section train passenger flow prediction data is obtained by adding the output results of the multi-section train passenger flow data after passing through the linear units and non-linear units respectively.
[0021] According to a multi-section train passenger flow prediction device based on temporal convolutional attention provided by the present invention, in the prediction module, the linear unit is used to extract linear features in the multi-section train passenger flow data, and the non-linear unit is used to extract short-term temporal features of the multi-section train passenger flow data, spatial relationship features between passenger flows in different sections, and long-term temporal features.
[0022] The present invention also 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 multi-section train passenger flow prediction method based on temporal convolutional attention as described in any one of the above-mentioned methods are implemented.
[0023] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the above-described multi-section train passenger flow prediction methods based on temporal convolutional attention.
[0024] The present invention also provides a computer program product, comprising a computer program, which, when executed by a processor, implements the steps of any of the above-mentioned methods for predicting multi-section train passenger flow based on temporal convolutional attention.
[0025] The multi-section train passenger flow prediction method and device based on time series convolution attention provided by the present invention realizes accurate prediction of passenger flow by establishing a multi-section passenger flow prediction model. The model is divided into linear units and nonlinear units, which can take into account different features in passenger flow data. It can simultaneously capture local information, short-term time series and long-term time series features in multi-section passenger flow, deeply mine different features of railway passenger flow, deeply and completely represent the time and space characteristics of passenger flow from multiple aspects, and improve the effect of passenger flow prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0027] Figure 1 It is a flow chart of a multi-section train passenger flow prediction method based on temporal convolutional attention provided by an embodiment of the present invention;
[0028] Figure 2 It is a schematic diagram of the structure of a multi-section passenger flow prediction model provided by an embodiment of the present invention;
[0029] Figure 3 is a schematic diagram of the structure of a temporal convolutional attention network provided by an embodiment of the present invention;
[0030] Figure 4 is a schematic diagram of the self-attention layer calculation process provided by an embodiment of the present invention;
[0031] Figure 5It is a structural schematic diagram of a multi-section train passenger flow prediction device based on temporal convolutional attention provided by an embodiment of the present invention;
[0032] Figure 6 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0033] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0034] Combine the following Figure 1-Figure 4 The multi-section train passenger flow prediction method based on temporal convolutional attention of the present invention is described, and the method comprises the following steps:
[0035] Step 101, obtaining multi-section train passenger flow data;
[0036] Step 102: inputting the multi-section train passenger flow data into a multi-section passenger flow prediction (HANet) model to obtain the multi-section train passenger flow prediction data output by the multi-section passenger flow prediction model;
[0037] Among them, the multi-section passenger flow prediction model is obtained by training with multi-section train passenger flow sample data, the multi-section passenger flow prediction model includes linear units and non-linear units, and the multi-section train passenger flow prediction data is obtained by adding the output results of the multi-section train passenger flow data after passing through the linear units and non-linear units respectively.
[0038] It should be noted that the multi-section train passenger flow data is historical data in a time period close to the time period to be predicted, and the multi-section train passenger flow sample data includes data in multiple time periods.
[0039] The multi-section train passenger flow prediction method based on temporal convolutional attention provided by the present invention realizes accurate prediction of passenger flow by establishing a multi-section passenger flow prediction model, such as Figure 2 As shown in the figure, the model is divided into linear units and nonlinear units, which can take into account the different characteristics of passenger flow data, deeply explore the different characteristics of railway passenger flow, deeply and completely represent the time and space characteristics of passenger flow from multiple aspects, and improve the effect of passenger flow prediction.
[0040] In at least one embodiment of the present invention, the linear unit is used to extract linear features from the multi-section train passenger flow data, and the nonlinear unit is used to extract short-term time series features, spatial relationship features between passenger flows in different sections, and long-term time series features from the multi-section train passenger flow data. The different features of railway passenger flow are deeply mined, and the temporal and spatial features of passenger flow are deeply and completely represented from multiple aspects, thereby improving the effect of passenger flow prediction.
[0041] In at least one embodiment of the present invention, the linear unit is used to extract linear features in the multi-segment train passenger flow data, including:
[0042] The linear unit is used to extract the linear features in the multi-section train passenger flow data through an autoregressive model (AR model) and output a linear component prediction result.
[0043] It should be noted that, in order to solve the nonlinear problem of the neural network, the embodiment of the present invention introduces an AR model as the linear part that focuses on the local scale problem (ie, the spatial relationship problem) when constructing the model.
[0044] In at least one embodiment of the present invention, the nonlinear unit is used to extract the short-term time series characteristics of the multi-section train passenger flow data, the spatial relationship characteristics between passenger flows in different sections, and the long-term time series characteristics, including:
[0045] The nonlinear unit is used to extract the short-term time series characteristics of the multi-section train passenger flow data and the spatial relationship characteristics between passenger flows in different sections through a convolutional neural network to obtain a convolution result;
[0046] It should be noted that there are two repetitive time series patterns in passenger flow data, short-term and long-term. In addition, there is spatial dependence between passenger flows in different sections. These two types of features can be better captured through convolution. The convolutional neural network (CNN) consists of multiple convolution kernels with a width of w and a length of D, where the width represents the number of days of passenger flow data selected during convolution and the length represents the number of sections.
[0047] The nonlinear unit is also used to extract the long-term temporal features of the convolution result through a temporal convolutional attention network (TCAN) and output a nonlinear component prediction result. The TCAN is as follows: Figure 3 shown.
[0048] It should be noted that TCAN can search through long time series of input to find out which features are more relevant to the recognition target and which features are not relevant.
[0049] In at least one embodiment of the present invention, the temporal convolutional attention network includes four dilated convolutional layers and four self-attention layers, and a self-attention layer is set after each dilated convolutional layer. TCAN adds a self-attention layer after each dilated convolutional layer, which can better handle the long sequence dependency problem in passenger flow data.
[0050] It should be noted that TCAN searches through the long time series of input to find out which features are more relevant to the recognition target and which features are irrelevant. After multiple experiments, the present invention uses four layers of dilated convolution superimposed with four layers of self-attention, where the process of self-attention layer calculation is as follows Figure 4 shown.
[0051] The embodiment of the present invention also discloses a multi-section train passenger flow prediction method based on time series convolution attention. After the model is trained, the historical train passenger flow data Y under multiple sections is input. T The specific steps for making predictions are:
[0052] Step a: Collect train passenger flow data Y for multiple sections within a certain period of time T ={Y1, Y1, ..., Y D}∈R D*T ,in, D represents the number of sections, and T is the number of days spanned in the train passenger flow data;
[0053] Step b: inputting the train passenger flow data of multiple sections within the certain period into the multi-section passenger flow prediction model, and obtaining the multi-section train passenger flow prediction data Y output by the multi-section passenger flow prediction model within a certain day. t ;
[0054] In at least one embodiment of the present invention, step b in the processing of the model includes the following sub-steps:
[0055] Step b1: The linear unit uses the AR model to extract the linear law in the train passenger flow data, and the linear component prediction result h is obtained as shown in Formula 1. L :
[0056]
[0057] in, represents the AR weight coefficient, b ar ∈R represents the bias term, Y k represents the multi-section train passenger flow on the kth day, q ar The number of days spanned in the input data for the AR model;
[0058] Step b2: The nonlinear unit uses the convolutional neural network CNN to extract the train passenger flow data Y under multiple sections TThe short-term temporal characteristics in the time dimension and the spatial relationship characteristics between passenger flows in different sections;
[0059] As shown in Formula 2, the i-th convolution kernel in CNN processes the train passenger flow data Y under multiple sections. T Perform convolution and get the output vector h i :
[0060] h i =RELU(W i *Y T +b i ) (Formula 2)
[0061] Among them, * represents the convolution operation, W i represents the weight coefficient of the convolution kernel, b i represents the bias term;
[0062] During the convolution process, the input matrix Y T Zero padding is performed so that each output vector h i The length is T, and the output matrix size of the last convolutional layer is d c *T,d c Indicates the number of convolution kernels;
[0063] Step b3: Use the temporal convolutional attention network TCAN to extract the long-term temporal regularity in the passenger flow data;
[0064] It should be noted that step b3 specifically includes:
[0065] The output of CNN is passed to TCAN as input, and the output C of the dilated convolution is converted into keys, queries, and values through three linear transformations, represented by K, Q, and V respectively, and then the attention weight W is generated by the Softmax function, as shown in Equation 3:
[0066] W=f softmax (Q T K) (Formula 3)
[0067] Calculate the weighted attention layer result W T V, add the results of the last layer of dilated convolution and self-attention layer, and get the final output of TCAN as shown in Equation 4:
[0068] h A =W T V+C (Formula 4)
[0069] Among them, W T is the transposed matrix of W.
[0070] Step b4: Concatenate the linear and nonlinear unit output results to obtain the final prediction result.
[0071] It should be noted that step b4 specifically includes:
[0072] The state of TCAN at the last moment is taken as the output of the nonlinear part, and then this result is sent to the fully connected layer. The output of the fully connected layer is added to the result of the linear part to get the final prediction result:
[0073] Y t =h L +h D
[0074] Among them, h L is the linear part output, h D is the output of TCAN A Output after the fully connected layer.
[0075] The following is a description of the multi-section train passenger flow prediction device based on temporal convolutional attention provided by the present invention. The multi-section train passenger flow prediction device based on temporal convolutional attention described below and the multi-section train passenger flow prediction method based on temporal convolutional attention described above can be referred to each other. Figure 5 As shown, the embodiment of the present invention also discloses a multi-section train passenger flow prediction device based on temporal convolutional attention, comprising:
[0076] The acquisition module 501 is used to obtain the passenger flow data of multiple sections of trains;
[0077] Prediction module 502, used for inputting the multi-section train passenger flow data into the multi-section passenger flow prediction model to obtain the multi-section train passenger flow prediction data output by the multi-section passenger flow prediction model;
[0078] Among them, the multi-section passenger flow prediction model is obtained by training with multi-section train passenger flow sample data, the multi-section passenger flow prediction model includes linear units and non-linear units, and the multi-section train passenger flow prediction data is obtained by adding the output results of the multi-section train passenger flow data after passing through the linear units and non-linear units respectively.
[0079] The multi-section train passenger flow prediction device based on temporal convolutional attention provided by the present invention realizes accurate prediction of passenger flow by establishing a multi-section passenger flow prediction model. The model is divided into linear units and nonlinear units, which can take into account different characteristics in passenger flow data, deeply mine the different characteristics of railway passenger flow, deeply and completely represent the time and space characteristics of passenger flow from multiple aspects, and improve the effect of passenger flow prediction.
[0080] In at least one embodiment of the present invention, the linear unit in the prediction module 502 is used to extract linear features in the multi-section train passenger flow data, and the non-linear unit is used to extract short-term time series features, spatial relationship features between passenger flows in different sections, and long-term time series features of the multi-section train passenger flow data.
[0081] In at least one embodiment of the present invention, the linear unit is used to extract linear features in the multi-segment train passenger flow data, including:
[0082] The linear unit is used to extract the linear features in the multi-section train passenger flow data through an autoregressive model and output a linear component prediction result.
[0083] In at least one embodiment of the present invention, the nonlinear unit is used to extract the short-term time series characteristics of the multi-section train passenger flow data, the spatial relationship characteristics between passenger flows in different sections, and the long-term time series characteristics, including:
[0084] The nonlinear unit is used to extract the short-term time series characteristics of the multi-section train passenger flow data and the spatial relationship characteristics between passenger flows in different sections through a convolutional neural network to obtain a convolution result;
[0085] The nonlinear unit is also used to extract the long-term temporal features of the convolution result through a temporal convolutional attention network and output a nonlinear component prediction result.
[0086] In at least one embodiment of the present invention, the temporal convolutional attention network includes four dilated convolutional layers and four self-attention layers, and a self-attention layer is arranged after each dilated convolutional layer.
[0087] In order to verify the effectiveness of the method of the present invention, this embodiment selected multiple train passenger flows in 14 sections on the Beijing-Shanghai line train data set for experiments, and conducted comparative experiments with 7 multivariate time series prediction models. The basic structure of the comparative model is as follows:
[0088] (1) LSTM: LSTM is a classic time recurrent neural network that is good at capturing temporal patterns in input sequences.
[0089] (2) TCN: It uses a multi-layer dilated convolution structure instead of RNN to handle sequence modeling tasks. It introduces dilated convolution and uses residual connections to avoid model overfitting.
[0090] (3) LSTNet-Skip: The prediction model is divided into two parts: linear and nonlinear. A new skip RNN is proposed in the nonlinear part to capture long-term temporal patterns.
[0091] (4) LSTNet-Attn: The structure is the same as LSTNet-Skip, except that the nonlinear part uses the attention mechanism instead of Skip-RNN.
[0092] (5) TPA-LSTM: A new attention mechanism is proposed based on LSTNet-Attn to screen relevant time series and use their frequency domain information for multivariate prediction.
[0093] (6)DSANet: utilizes two parallel convolutional components, called global temporal convolution and local temporal convolution, to capture the complex mixture information of global and local temporal patterns.
[0094] (7) MTGNN: A general graph neural network framework for multivariate time series prediction, which calculates an adjacency matrix through a graph learning module to better learn the unidirectional relationship between variables. In addition, MTGNN proposes a new hybrid skip propagation layer and an extended inception layer to capture the spatial and temporal dependencies in time series.
[0095] The comparative experiment in this embodiment uses two evaluation indicators: Root Relative Squared Error (RSE) and Empirical Correlation Coefficient (CORR). The calculation formula is as follows:
[0096]
[0097]
[0098] Among them, Y are the true value and the predicted value, respectively, and n is the number of variables in the training sample. RSE takes the total squared error and normalizes it by dividing it by the total squared error of the predicted variable. By taking the square root of the relative squared error, the error can be reduced to the same size as the predicted amount. The lower the value of RSE, the better, and the higher the value of CORR, the better.
[0099] The experimental results are shown in Table 1:
[0100] Table 1 Comparison experimental results of various models
[0101]
[0102] The experimental results show that the HANet model constructed by the method of the embodiment of the present invention has achieved better results in all indicators. Compared with LSTM, TCN in the table is significantly better than the latter in both evaluation indicators, which indirectly shows that it is reasonable for HANet to use TCN instead of RNN. Compared with TCN alone, HANet's prediction performance will be significantly reduced because TCN does not have an AR component to learn the linear laws in passenger flow.
[0103] Figure 6 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 6 As shown, the electronic device may include: a processor 610, a communication interface 620, a memory 630 and a communication bus 640, wherein the processor 610, the communication interface 620 and the memory 630 communicate with each other through the communication bus 640. The processor 610 may call the logic instructions in the memory 630 to execute a multi-section train passenger flow prediction method based on temporal convolution attention, the method comprising:
[0104] Obtain passenger flow data of multiple sections of trains;
[0105] Inputting the multi-section train passenger flow data into a multi-section passenger flow prediction model to obtain the multi-section train passenger flow prediction data output by the multi-section passenger flow prediction model;
[0106] Among them, the multi-section passenger flow prediction model is obtained by training with multi-section train passenger flow data, the multi-section passenger flow prediction model includes linear units and non-linear units, and the multi-section train passenger flow prediction data is obtained by adding the output results of the multi-section train passenger flow data after passing through the linear units and non-linear units respectively.
[0107] In addition, the logic instructions in the above-mentioned memory 630 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0108] On the other hand, the present invention further provides a computer program product, the computer program product comprising a computer program, the computer program can be stored on a non-transitory computer-readable storage medium, and when the computer program is executed by a processor, the computer can execute the multi-section train passenger flow prediction method based on temporal convolutional attention provided by the above methods, the method comprising:
[0109] Obtain passenger flow data of multiple sections of trains;
[0110] Inputting the multi-section train passenger flow data into a multi-section passenger flow prediction model to obtain the multi-section train passenger flow prediction data output by the multi-section passenger flow prediction model;
[0111] Among them, the multi-section passenger flow prediction model is obtained by training with multi-section train passenger flow data, the multi-section passenger flow prediction model includes linear units and non-linear units, and the multi-section train passenger flow prediction data is obtained by adding the output results of the multi-section train passenger flow data after passing through the linear units and non-linear units respectively.
[0112] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to execute the multi-section train passenger flow prediction method based on temporal convolutional attention provided by the above methods, the method comprising:
[0113] Obtain passenger flow data of multiple sections of trains;
[0114] Inputting the multi-section train passenger flow data into a multi-section passenger flow prediction model to obtain the multi-section train passenger flow prediction data output by the multi-section passenger flow prediction model;
[0115] Among them, the multi-section passenger flow prediction model is obtained by training with multi-section train passenger flow data, the multi-section passenger flow prediction model includes linear units and non-linear units, and the multi-section train passenger flow prediction data is obtained by adding the output results of the multi-section train passenger flow data after passing through the linear units and non-linear units respectively.
[0116] The device embodiments described above are merely illustrative, wherein the units described 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 they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0117] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0118] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A multi-section train passenger flow prediction method based on temporal convolutional attention, characterized in that: include: Obtain passenger flow data of multiple sections of trains; Inputting the multi-section train passenger flow data into a multi-section passenger flow prediction model to obtain the multi-section train passenger flow prediction data output by the multi-section passenger flow prediction model; The multi-section passenger flow prediction model is a HANet model; The multi-section passenger flow prediction model is obtained by training with multi-section train passenger flow sample data, the multi-section passenger flow prediction model includes a linear unit and a non-linear unit, and the multi-section train passenger flow prediction data is obtained by adding the output results of the multi-section train passenger flow data after passing through the linear unit and the non-linear unit respectively; The linear unit is used to extract linear features from the multi-section train passenger flow data, and the nonlinear unit is used to extract short-term time series features, spatial relationship features between passenger flows in different sections, and long-term time series features from the multi-section train passenger flow data; The linear unit is used to extract linear features from the multi-section train passenger flow data, including: The linear unit is used to extract the linear features in the multi-section train passenger flow data through an autoregressive model and output a linear component prediction result; The nonlinear unit is used to extract the short-term time series characteristics of the multi-section train passenger flow data, the spatial relationship characteristics between passenger flows in different sections, and the long-term time series characteristics, including: The nonlinear unit is used to extract the short-term time series characteristics of the multi-section train passenger flow data and the spatial relationship characteristics between passenger flows in different sections through a convolutional neural network to obtain a convolution result; The nonlinear unit is also used to extract the long-term temporal features of the convolution result through a temporal convolution attention network, and output a nonlinear component prediction result; The temporal convolutional attention network includes four dilated convolutional layers and four self-attention layers, and a self-attention layer is set after each dilated convolutional layer.
2. A multi-section train passenger flow prediction device based on temporal convolutional attention for executing the multi-section train passenger flow prediction method based on temporal convolutional attention as claimed in claim 1, characterized in that: include: The acquisition module is used to obtain passenger flow data of multiple sections of trains; A prediction module, used for inputting the multi-section train passenger flow data into a multi-section passenger flow prediction model to obtain the multi-section train passenger flow prediction data output by the multi-section passenger flow prediction model; Among them, the multi-section passenger flow prediction model is obtained by training with multi-section train passenger flow sample data, the multi-section passenger flow prediction model includes linear units and non-linear units, and the multi-section train passenger flow prediction data is obtained by adding the output results of the multi-section train passenger flow data after passing through the linear units and non-linear units respectively.
3. 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 multi-section train passenger flow prediction method based on temporal convolutional attention as described in claim 1 are implemented.
4. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the multi-section train passenger flow prediction method based on temporal convolutional attention as claimed in claim 1 are implemented.
5. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the multi-section train passenger flow prediction method based on temporal convolutional attention as claimed in claim 1 are implemented.