Method and device for constructing crowd flow prediction model, terminal and storage medium

CN117556880BActive Publication Date: 2026-10-27HEBEI UNIV OF ENG
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311512985.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-14
Publication Date
2026-10-27
Estimated Expiration
2043-11-14

AI Technical Summary

Technical Problem

[0004]本申请提供了一种人群流量预测方法、装置、终端及存储介质,以解决现有技术中站点之间复杂的时空相关性以及站点人群流量数据波动大造成预测结果误差大的问题

Benefits of technology

[0021]本申请提供一种人群流量预测模型的构建方法、装置、终端及存储介质,通过残差网络和时空图卷积网络构建人群流量预测模型,根据对获取人群流量数据的目标区域划分多个网格,把公共交通网格和目标区域以及人群流量数据相结合,提高了预测模型的预测精度;根据人群流量预测模型中的残差网络模块将目标区域内的人群流量数据按时间划分为三个时间层次的矩阵,并根据人群流量预测模型中的时空图卷积网络模型对公共交通网格进行聚类,将聚类后的网格和人群流量数据经过图卷积网络,得到时空关联矩阵,再将三个时间层次的矩阵和时空关联矩阵进行融合,实现了时间与空间的结合,提高了预测模型的预测精准度;由于公共交通网格对应的人群流量数据的变化较大,通过时空图卷积网络模块结合公共交通网格和对应的人群流量数据得到时空关联矩阵,解决了由于人群流量数据波动大造成的预测结果误差大的问题;在融合模块加入外部环境数据,可以更好地处理更细粒度的时间与空间关系,提升了流量预测模型的预测结果的准确度;最后通过对预测模型的预测流量矩阵与真实流量矩阵计算误差,可以对预测模型进行优化训练,有利于提升城市人群流量预测模型的精准度。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117556880B_ABST
    Figure CN117556880B_ABST
Patent Text Reader

Abstract

The application provides a construction method and device of a crowd flow prediction model, a terminal and a storage medium. The construction method comprises the following steps: constructing a crowd flow prediction model; acquiring crowd flow data of a target area in a historical time period and external environment data in a prediction time period; dividing the crowd flow data into proximity data, periodic data and trend data according to a preset time, and training a residual network module; clustering a public transport grid by using a hierarchical clustering method to obtain a clustered grid and corresponding crowd flow data as input, and a clustered spatio-temporal correlation matrix as output, and training a spatio-temporal graph convolution network module; inputting the above matrices and the external environment data into a fusion module for fusion to obtain a target fusion matrix; and obtaining the trained crowd flow prediction model according to the target fusion matrix. The application can improve the accuracy of the crowd flow data prediction result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of urban intelligent computing technology, and in particular to a method, device, terminal and storage medium for predicting crowd flow. Background Technology

[0002] With the acceleration of urbanization and the surge in urban residents, people's demand for travel, shopping, and tourism is also constantly increasing. Thanks to improved public transportation infrastructure, people can quickly reach their destinations. However, the increase in the number and frequency of trips has led to road congestion and overcrowding at public transportation stations, potentially posing safety hazards. Many studies have focused on exploring the digital footprint of these residents' movements, hoping to improve their quality of life through artificial intelligence. Among these studies, predicting passenger travel demand has attracted considerable attention because the prediction results aid in decision-making for many intelligent transportation applications, such as public transportation management, shared bicycle redistribution, and road traffic management. It is well known that by analyzing passenger travel demand, it is possible to further develop station flow management for citywide subway, bus, and bicycle-sharing systems, reducing urban traffic congestion. Therefore, station-oriented crowd flow prediction has gradually become a research hotspot in the field of intelligent transportation.

[0003] In deep learning-based urban crowd flow prediction, convolutional networks (CNNs) and recurrent neural networks (RNNs) are typically the most widely used network units in deep learning models. CNNs excel at learning spatial correlations, while RNNs are better at learning temporal or sequential correlations. However, unless the network is sufficiently deep, CNNs have a limited learning scope and cannot capture long-range spatial correlations. Furthermore, RNNs struggle to learn long-term correlations due to the vanishing and exploding gradient problems. Most models simply use a given spatial adjacency matrix for graph network modeling. Moreover, current crowd flow prediction research is significantly inadequate in capturing the dependencies between local and global correlations in space and time. And because the flowing crowds form complex spatiotemporal correlations between stations, although there are obvious regularities at the target area level, the congestion flow at individual stations fluctuates greatly. Summary of the Invention

[0004] This application provides a crowd flow prediction method, device, terminal, and storage medium to solve the problems of complex spatiotemporal correlations between sites and large fluctuations in crowd flow data at sites, which lead to large prediction errors in the prior art.

[0005] Firstly, this application provides a method for constructing a crowd flow prediction model, the method comprising:

[0006] A crowd flow prediction model is constructed, which includes a residual network module, a spatiotemporal graph convolutional network module, a fusion module, and a feedback module.

[0007] The system acquires population flow data for a target area over a historical period and external environment data for a predicted period. The target area is divided into multiple grids, including public transportation grids and non-public transportation grids. The population flow data includes location data for each public transportation grid and corresponding population flow data for each public transportation grid.

[0008] The population flow data within the historical time period is divided into proximity data, periodic data, and trend data according to a preset time. The proximity data, periodic data, and trend data are respectively used as inputs, and the proximity matrix corresponding to the proximity data, the periodic matrix corresponding to the periodic data, and the trend matrix corresponding to the trend data are used as outputs to train the residual network module.

[0009] Hierarchical clustering method is used to cluster the public transportation grid in the target area to obtain the clustered grid and the corresponding crowd flow data. The public transportation grid and the corresponding crowd flow data are used as input and the spatiotemporal correlation matrix corresponding to the clustered grid is used as output to train the spatiotemporal graph convolutional network module.

[0010] The proximity matrix, the periodic matrix, the trend matrix, the spatiotemporal correlation matrix, and the external environment data are fused together by the input fusion module to obtain the target fusion matrix;

[0011] The target fusion matrix is ​​input into the feedback module to calculate the predicted traffic matrix within the prediction time period, and the error between the predicted traffic matrix and the actual traffic matrix within the prediction time period is calculated. Based on the error, the parameters in the fusion module are adjusted, and the crowd traffic prediction model is iterated until the error meets the preset conditions, thus obtaining the trained crowd traffic prediction model.

[0012] Secondly, this application provides an apparatus for constructing a crowd flow prediction model, the apparatus comprising:

[0013] A construction unit is used to build a crowd flow prediction model, which includes a residual network module, a spatiotemporal graph convolutional network module, a fusion module, and a feedback module.

[0014] The acquisition unit is used to acquire population flow data of the target area during a historical time period and external environment data during a predicted time period. The target area is divided into multiple grids, including public transportation grids and non-public transportation grids. The population flow data includes the location data of each public transportation grid and the population flow data corresponding to each public transportation grid.

[0015] The spatiotemporal residual training unit is used to divide the population flow data within the historical time period into proximity data, periodic data, and trend data according to a preset time. The proximity data, periodic data, and trend data are taken as inputs, and the proximity matrix corresponding to the proximity data, the periodic matrix corresponding to the periodic data, and the trend matrix corresponding to the trend data are taken as outputs to train the residual network module.

[0016] The spatiotemporal graph convolutional training unit is used to cluster the public transportation grid in the target area using a hierarchical clustering method to obtain the clustered grid and the corresponding crowd flow data. The public transportation grid and the corresponding crowd flow data are used as inputs and the spatiotemporal correlation matrix corresponding to the clustered grid is used as output to train the spatiotemporal graph convolutional network module.

[0017] The fusion unit is used to fuse the proximity matrix, the periodic matrix, the trend matrix, the spatiotemporal correlation matrix, and the external environment data into the fusion module to obtain the target fusion matrix;

[0018] The determining unit is used to input the target fusion matrix into the feedback module, calculate the predicted traffic matrix within the prediction time period, calculate the error between the predicted traffic matrix and the actual traffic matrix within the prediction time period, adjust the parameters in the fusion module based on the error, and iterate the crowd traffic prediction model until the error meets the preset conditions to obtain the trained crowd traffic prediction model.

[0019] Thirdly, this application provides a terminal including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method as described in the first aspect or any possible implementation of the first aspect above.

[0020] Fourthly, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method as described in the first aspect or any possible implementation thereof.

[0021] This application provides a method, apparatus, terminal, and storage medium for constructing a crowd flow prediction model. The model is built using a residual network and a spatiotemporal graph convolutional network. It divides the target area for acquiring crowd flow data into multiple grids, combining the public transportation grids with the target area and crowd flow data to improve the prediction accuracy. The residual network module in the crowd flow prediction model divides the crowd flow data within the target area into three time-level matrices. The spatiotemporal graph convolutional network model in the crowd flow prediction model clusters the public transportation grids. The clustered grids and crowd flow data are then processed through a graph convolutional network to obtain a spatiotemporal correlation matrix. Finally, the three time-level matrices are combined with... By fusing spatiotemporal correlation matrices, the combination of time and space is achieved, improving the prediction accuracy of the forecasting model. Since the population flow data corresponding to the public transportation grid varies significantly, a spatiotemporal correlation matrix is ​​obtained by combining the public transportation grid and the corresponding population flow data through a spatiotemporal graph convolutional network module. This solves the problem of large prediction errors caused by large fluctuations in population flow data. Incorporating external environmental data into the fusion module allows for better handling of finer-grained temporal and spatial relationships, improving the accuracy of the traffic prediction model. Finally, by calculating the error between the predicted traffic matrix and the actual traffic matrix of the forecasting model, the model can be optimized and trained, further improving the accuracy of the urban population flow prediction model. Attached Figure Description

[0022] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 This is a flowchart illustrating the implementation of the crowd flow prediction model construction method provided in the embodiments of this application;

[0024] Figure 2 This is a region grid division diagram provided in an embodiment of this application;

[0025] Figure 3 This is a population flow distribution map within a regional grid provided in an embodiment of this application;

[0026] Figure 4 This is a schematic diagram of the structure of the ResUnit residual network module provided in the embodiments of this application;

[0027] Figure 5 This is a schematic diagram of the structure of the device for constructing the crowd flow prediction model provided in the embodiments of this application;

[0028] Figure 6 This is a schematic diagram of the terminal provided in the embodiments of this application. Detailed Implementation

[0029] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.

[0030] To make the objectives, technical solutions, and advantages of this application clearer, the following description will be provided in conjunction with the accompanying drawings and specific embodiments.

[0031] Figure 1 The implementation flowchart of the crowd flow prediction model construction method provided in the embodiments of this application is described in detail below:

[0032] In step 101, a crowd flow prediction model is constructed, which includes a residual network module, a spatiotemporal graph convolutional network module, a fusion module, and a feedback module.

[0033] Because the flow of people forms complex spatiotemporal correlations between regional grids, although there are obvious regularities at the regional level, the congestion flow of a single grid fluctuates greatly. Therefore, this application embodiment constructs a crowd flow prediction model, which includes a residual network model, a spatiotemporal graph convolutional network module, a fusion module, and a feedback module.

[0034] For details on the grid division within the region, please refer to [link / reference]. Figure 2 This is a grid system based on geospatial information, dividing a region into areas composed of N×M grids. People move within the grid, thus creating spatiotemporal relationships between the grids. For details, please refer to [link to relevant documentation]. Figure 3 The intensity of color within a grid represents the amount of pedestrian traffic between grids.

[0035] The residual network module is constructed based on the residual network of the convolutional neural network, and the spatiotemporal graph convolutional network module is constructed based on the graph convolutional neural network.

[0036] In step 102, the population flow data of the target area during the historical time period and the external environment data for the predicted time period are obtained. The target area is divided into multiple grids, including public transportation grids and non-public transportation grids. The population flow data includes the location data of each public transportation grid and the population flow data corresponding to each public transportation grid.

[0037] Among them, see Figure 2Let be any target area. The grid in the diagram represents multiple grids divided within that target area. These grids include public transportation grids and non-public transportation grids, for example, Figure 2 The black area in the diagram represents the public transportation grid within the target area, while the rest are non-public transportation grids.

[0038] This application embodiment obtains the population flow data of the public transportation grid and non-public transportation grid of the target area in historical time periods and the corresponding external environment data of the target area in the predicted time period.

[0039] This application combines pedestrian flow data from irregular public transportation grids with pedestrian flow data from regular target areas, thereby improving the prediction accuracy of the prediction model.

[0040] In step 103, the population flow data within the historical time period is divided into proximity data, periodic data, and trend data according to a preset time. The proximity data, periodic data, and trend data are used as inputs, and the proximity matrix corresponding to the proximity data, the periodic matrix corresponding to the periodic data, and the trend matrix corresponding to the trend data are used as outputs to train the residual network module.

[0041] In this map raster data, each region's data is influenced by its neighboring regions, resulting in complex spatial correlations between different regions. The purpose of convolutional operations is to extract complex features from simple features. However, as the number of layers in a convolutional neural network increases, the accuracy of the crowd flow prediction model decreases. Therefore, in this embodiment, a residual network module is added to improve the model's prediction accuracy. See [link to relevant documentation]. Figure 4 , Figure 4 This is a schematic diagram of the ResUnit module of the residual network.

[0042] The residual network is divided into three units because the temporal characteristics of the crowd flow data are divided into three layers according to the length of a preset time interval: proximity, periodicity, and trend. Models are built for these three time layers to extract features and achieve better crowd flow prediction results.

[0043] Formally, the residual network with identity mapping is defined by the following calculation formula:

[0044] X (l+1) =X (l) +F(X (l) )

[0045] Among them, X (l+1) X is the output of the residual network. (l) is the input to the residual network, and F is the residual function.

[0046] In this embodiment of the application, the population flow data of the target area obtained in step 102 within a historical time period is divided into proximity data, periodic data and trend data according to a preset time. The preset time can be set as follows: the population flow data obtained every half hour is regarded as proximity data, the population flow data obtained every hour is regarded as periodic data, and the population flow data obtained every 24 hours is regarded as trend data. The specific setting of the preset time is not limited in this application.

[0047] Before inputting the segmented proximity data, periodic data, and trend data into the residual network for training, the data is divided into training, validation, and test sets according to a preset ratio. Since the acquired crowd flow data are all continuous time series data, it is not necessary to shuffle the data in each layer when dividing the dataset.

[0048] Since different features typically have different units and meanings, which can affect data mining and analysis, this application standardizes the acquired crowd flow data (i.e., data normalization) to reduce the impact of different attributes between features and address the issue of differences between features. The calculation formula for normalization is as follows:

[0049]

[0050] Where, x ′ Let x be the normalized input crowd flow data, min(x) be the minimum value of the input crowd flow data, and max(x) be the maximum value of the input crowd flow data.

[0051] In this embodiment of the application, before training, it is also necessary to label the initial time series of crowd flow data. The sliding window algorithm is adopted, and the crowd flow data of unit time interval (t+l) is used as the data label of unit time interval y, and the corresponding label set is created.

[0052] After normalization and window sliding operations, the processed proximity data, periodic data, and trend data are used as inputs to the residual network module. The proximity matrix corresponding to the proximity data, the periodic matrix corresponding to the periodic data, and the trend matrix corresponding to the trend data are used as outputs to train the residual network module, resulting in a trained residual network module. This embodiment of the application uses a convolutional neural network-based residual network that can capture the spatial dependence between any two regions, ensuring that the network structure is not affected by gradient vanishing or exploding. The population flow data of the target area over a historical time period is categorized into three types based on temporal characteristics: proximity, periodicity, and trend. The residual network module uses three residual networks to extract these three characteristics to ensure the results of short-term, periodic, and long-term predictions.

[0053] In step 104, the public transportation grid within the target area is clustered using a hierarchical clustering method to obtain the clustered grid and the corresponding crowd flow data. The public transportation grid and the corresponding crowd flow data are used as inputs, and the spatiotemporal correlation matrix corresponding to the clustered grid is used as output to train the spatiotemporal graph convolutional network module.

[0054] Hierarchical clustering methods refer to attempts to divide a dataset at different levels to form a tree-like clustering structure.

[0055] Because urban public transportation stations are irregularly distributed, there may be one or several stations within the same grid area, and very rarely, no stations at all. Statistics on the inflow and outflow of people at each station over different time periods can determine the travel patterns of people around that station. However, observing crowd flow from only a single station cannot summarize patterns and contains significant errors. Merging the flow from several stations can approximate the crowd flow within a regular area. Therefore, this application first employs a hierarchical clustering method to aggregate the public transportation grid within the target area, allowing the graph convolutional network to capture spatial correlations and reducing computational scale. Here, the public transportation station has the same meaning as the public transportation grid in this application.

[0056] This application embodiment, based on the grid division of the target area, performs hierarchical clustering of public transportation stations, merging public transportation stations with the smallest distance and highest similarity. The specific calculation steps of the agglomerative hierarchical clustering method are as follows:

[0057] Step 1: Locate all existing public transportation stops in the region as feature points and network nodes, and calculate the distance between each pair of network nodes.

[0058] Step 2: Merge the network nodes that are closest to each other into a new node. All network nodes must be within the same rule area when merging.

[0059] Step 3: Recalculate the distances between the merged network nodes and all nodes within the region, and calculate the shortest distance between stations within all regions. Based on the selected clustering method, calculate the estimated value of the nodes for population traffic statistics in each region.

[0060] Step 4: Repeat steps 2 and 3 until all network nodes meet the set termination conditions, then the hierarchical clustering calculation is complete.

[0061] The resulting clustered grids are adjacent within the region, and the corresponding crowd flow patterns are also similar. Applying graph convolutional neural networks then makes it easier to capture the spatial similarity between nodes.

[0062] In step 1, the network nodes in the same region are calculated, the topological relationship of the network nodes is established, and a complete network node data structure is constructed.

[0063] In step 2, all network nodes must be merged within the same rule area because merging nodes across regions will affect the spatiotemporal relationships captured by the graph convolution module, increasing computational complexity.

[0064] After using hierarchical clustering to cluster the public transportation grid within the target area and obtaining the clustered grid and corresponding crowd flow data, a spatiotemporal graph convolutional network module is constructed using graph convolutional neural networks to capture the corresponding spatiotemporal correlation matrix.

[0065] This application embodiment utilizes a graph convolutional neural network, taking public transportation grids and corresponding crowd flow data as input, and the spatiotemporal correlation matrix corresponding to the clustered grids as output, to train the graph convolutional neural network and obtain a spatiotemporal graph convolutional network module.

[0066] Graph Convolution Neural Networks (GCNNs) methods are divided into two categories: spectral domain-based methods and spatial domain-based methods. Spectral domain-based methods define graph convolution by introducing filters from the perspective of graph signal processing, where the graph convolution operation is interpreted as removing noise from the graph signal. Spatial domain-based methods represent graph convolution as aggregating feature information from neighbors.

[0067] Spatiotemporal convolutional blocks utilize graph convolution to extract spatial features with significant weights and capture temporal correlation matrices. Urban population flow clustering patterns are the result of clustering and convolution operations on historical urban population flow data. The model assumes that the results of graph convolution operations reflect common patterns and regularities in urban population flow.

[0068] This application embodiment uses graph convolutional neural networks to capture the spatiotemporal correlation matrix of public transportation grids, solving the problem that residual networks cannot capture the correlation between public transportation grids and regions due to the large changes in population flow on public transportation grids. In conjunction with residual networks to model the correlation between regions and external features, the interference of urban stations on the population flow statistics between regular regions is eliminated, enabling accurate population flow prediction.

[0069] In step 105, the proximity matrix, periodic matrix, trend matrix, spatiotemporal correlation matrix, and external environment data are input into the fusion module and fused to obtain the target fusion matrix.

[0070] The proximity matrix, periodic matrix, and trend matrix obtained in step 103, the spatiotemporal correlation matrix obtained in step 104, and the external environment data obtained in step 102 are input into the fusion module for fusion to obtain the target fusion matrix.

[0071] In one possible implementation, the fusion module includes a parameter matrix-based fusion module and a splicing method-based fusion module; step 105 may specifically include:

[0072] The proximity matrix, periodic matrix, and trend matrix are input into the parameter matrix-based fusion module for weighted fusion to obtain the weighted fusion matrix;

[0073] The weighted fusion matrix and the spatiotemporal correlation matrix are concatenated and fused to obtain the concatenated fusion matrix. The concatenated fusion matrix and the external environment data are then input into the fusion module based on the concatenation method for fusion to obtain the target fusion matrix.

[0074] Since different regions may have different weights for proximity, periodicity, and trend attributes, a comparative experiment between parameter matrix-based fusion and ordinary matrix splicing revealed that the parameter matrix-based fusion scheme improves the performance of the ordinary matrix splicing scheme by nearly 10% under the root mean square error evaluation criterion. Therefore, this application selects the parameter matrix-based fusion method to obtain the target fusion matrix.

[0075] In this embodiment, the fusion module includes a parameter matrix-based fusion module and a splicing method-based fusion module. The parameter matrix-based fusion module fuses the proximity matrix, periodic matrix, and trend matrix obtained in step 103 to obtain a weighted fusion matrix. The spliced ​​fusion matrix is ​​obtained by fusing the spatiotemporal correlation matrix in step 104 with the weighted fusion matrix obtained by the parameter matrix-based fusion module. The spliced ​​fusion matrix is ​​then fused with the acquired external environment data to obtain the target fusion matrix.

[0076] In one possible implementation, the crowd flow prediction model also includes convolutional neural networks and fully connected networks;

[0077] Prior to step 105, the method may further include:

[0078] The external environment data of the prediction time period in the target area is input into the convolutional neural network, and the embedded layer feature matrix corresponding to the external environment data is output. The embedded layer feature matrix is ​​the external feature matrix of the external environment data with their respective weight coefficients.

[0079] The embedding layer feature matrix is ​​input into the fully connected network, and the output is a mapping feature matrix with the same dimension as the concatenated fusion matrix; external environmental data includes weather, meteorology, holidays, temperature, air quality index, and time;

[0080] Accordingly, the stitched fusion matrix and external environment data are input into a fusion module based on the stitching method for fusion to obtain the target fusion matrix, including:

[0081] The concatenated fusion matrix and the external feature matrix are input into the fusion module based on the concatenation method for fusion to obtain the target fusion matrix.

[0082] In this embodiment of the application, the crowd flow prediction model further includes a convolutional neural network and a fully connected network. The fully connected network is used to ensure that the matrix dimensions of the matrices being fused are consistent, so that different matrices can be fused.

[0083] The role of the external feature branch is to learn fine-grained representations of the external environment in different regions at different time periods. The external feature branch can learn the unified influence weights of all external features of time and region, rather than simply splicing together external environment features.

[0084] To improve the prediction accuracy of the prediction model, additional external features are added in this embodiment. This application extracts six types of external environmental data: weather, meteorology, holidays, temperature, air quality index (AQI), and time (including days and hours). The time interval y is used as the correlation field. The weather, meteorology, holidays, temperature, AQI, and time features of each subsequence are fused using matrix concatenation. Then, the data is input into a convolutional neural network, and different weight coefficients are assigned to different features. The output is the embedding layer feature matrix corresponding to the external environmental data. The embedding layer feature matrix is ​​an external feature matrix of the external environmental data with their respective weight coefficients. The embedding layer feature matrix is ​​input into a fully connected network, and the input is a mapping feature matrix with the same matrix dimension as the concatenated fusion matrix.

[0085] This application embodiment incorporates external environmental data for fusion, resulting in higher prediction accuracy.

[0086] The proximity matrix, periodic matrix, and trend matrix obtained in step 103 are fed into a parameter matrix-based fusion module and then passed through a fully connected network. The output proximity matrix, periodic matrix, and trend matrix have the same matrix dimension, and are then fused to obtain a weighted fusion matrix.

[0087] In one possible implementation, the proximity matrix, periodicity matrix, and trend matrix are input into a parameter matrix-based fusion module for weighted fusion to obtain a weighted fusion matrix, which may include:

[0088] The proximity matrix, periodicity matrix, and trend matrix are input into the Hadamard product to calculate the weighted fusion matrix. The Hadamard product is:

[0089]

[0090] Among them, R Res This is the weighted fusion matrix. It is a proximity matrix. It is a periodic matrix. For trend matrix, W m W represents the parameters corresponding to the proximity matrix. q W is the parameter corresponding to the periodic matrix. z Here are the parameters corresponding to the trend matrix, and Θ is the Hadamard product.

[0091] This application's embodiments employ a parameter matrix-based fusion method to integrate the proximity matrix. Periodic matrix and trend matrix The input is a parameter matrix-based fusion module. First, a fully connected network is used to make the matrix dimensions of the proximity matrix, periodic matrix, and trend matrix consistent. Then, the three matrices are weighted and fused using the Hadamard product to obtain the weighted fusion matrix Y. Res Among them, the parameters corresponding to the proximity matrix, periodicity matrix, and trend matrix are W, respectively. m W q W z .

[0092] The embodiments of this application reflect the impact of three time-dimensional components on the prediction target.

[0093] The spatiotemporal correlation matrix obtained in step 104 and the weighted fusion matrix obtained by the fusion module based on the parameter matrix are then fed into a fully connected network after being fed into the fusion module based on the splicing method. The output spatiotemporal correlation matrix and the weighted fusion matrix have the same matrix dimension. Then, they are spliced ​​and fused to obtain the spliced ​​fusion matrix. The spliced ​​fusion matrix is ​​then fused with the external environment data to obtain the target fusion matrix.

[0094] In one possible implementation, the weighted fusion matrix and the spatiotemporal correlation matrix are concatenated and fused to obtain a concatenated fusion matrix. This concatenated fusion matrix and external environment data are then input into a fusion module based on the concatenation method for fusion to obtain the target fusion matrix, which may include:

[0095] The weighted fusion matrix and the spatiotemporal correlation matrix are input into the splicing calculation formula to calculate the spliced ​​fusion matrix, and the spliced ​​fusion matrix and the external environment data are input into the fusion calculation formula to calculate the target fusion matrix;

[0096] The formula for splicing calculation is:

[0097]

[0098] Among them, Y n Y is the fused matrix after splicing. Res Y is the weighted fusion matrix. Se It is a spatiotemporal correlation matrix. For splicing calculation symbols;

[0099] The fusion calculation formula is as follows:

[0100] Y m =W f Y n +Y Ext

[0101] Among them, Y m For the target fusion matrix, W f Y represents the parameters corresponding to the concatenated fusion matrix. Ext This refers to external environment data.

[0102] This application's embodiments employ a parameter matrix-based fusion method, which weights the fusion matrix Y... Res And the spatiotemporal correlation matrix Y Se The input is a fusion module based on a concatenation method. First, a fully connected network is used to make the spatiotemporal correlation matrix and the weighted fusion matrix have the same matrix dimensions. Then, the spatiotemporal correlation matrix and the weighted fusion matrix are fused and concatenated using a concatenation calculation formula to obtain the concatenated fusion matrix Y. nThe spatiotemporal correlation matrix and the weighted fusion matrix are fused and spliced ​​to obtain the spliced ​​fusion matrix, which can improve the prediction accuracy of the model.

[0103] Then take the external environment data Y Ext Input the fusion module based on the concatenation method, and the concatenated fusion matrix Y. n A parameter matrix-based fusion method is used to obtain the target fusion matrix Y. m Among them, the parameter corresponding to the fusion module based on the splicing method is W. f .

[0104] In step 106, the target fusion matrix is ​​input into the feedback module to calculate the predicted traffic matrix within the prediction time period, and the error between the predicted traffic matrix and the actual traffic matrix within the prediction time period is calculated. Based on the error, the parameters in the fusion module are adjusted, and the crowd traffic prediction model is iterated until the error meets the preset conditions, thus obtaining the trained crowd traffic prediction model.

[0105] Target fusion matrix Y m The input feedback module calculates the predicted flow matrix for the predicted time period. The calculation formula is as follows:

[0106]

[0107] Here, tanh is the activation function, which keeps the output range (-1, 1).

[0108] Based on the predicted flow matrix and the actual traffic matrix Y within the predicted time period t Calculate the error between the two, and adjust the parameter W in the fusion module according to the error. m W q W z W f The crowd flow prediction model is repeatedly trained until the error meets the preset conditions, thus obtaining the trained crowd flow prediction model.

[0109] In one possible implementation, the error includes the root mean square error. Based on the parameters within the error adjustment and fusion module, the crowd flow prediction model is iterated until the error meets a preset condition, resulting in a trained crowd flow prediction model, which may include:

[0110] Determine whether the root mean square error is less than the preset error;

[0111] If the root mean square error is less than the preset error, the crowd flow prediction model is considered to have completed training.

[0112] If the root mean square error is greater than the preset error, the parameters in the fusion module are adjusted, and the process of inputting the proximity matrix, periodic matrix, trend matrix, spatiotemporal correlation matrix, and external environment data into the fusion module for fusion to obtain the target fusion matrix continues until the root mean square error is less than the preset error, at which point it is determined that the crowd flow prediction model has completed training.

[0113] The error includes the root mean square error, then the predicted flow matrix and the actual traffic matrix Y within the predicted time period t The formula for calculating the root mean square error is as follows:

[0114]

[0115] Where L(θ) is the predicted flow matrix and the actual traffic matrix Y within the predicted time period t The root mean square error is L(θ), where θ is the set of all training parameters. The model training process is the process of minimizing L(θ).

[0116] In this embodiment, a preset error ε is set, and it is determined whether the root mean square error L(θ) is less than the preset error ε. If it is less, the crowd flow prediction model is considered to have completed training; if it is greater, the parameters in the fusion module, i.e., W, are adjusted. m W q W z W f Then return to step 105 to continue execution until the root mean square error L(θ) is less than the preset error ε, then it is determined that the crowd flow prediction model training is complete.

[0117] For example, using the crowd flow prediction model trained in this application embodiment, the operation is as follows:

[0118] Step 1: Obtain the population flow data X of target area A during the historical time period and the external environment data Y for the predicted time period T. Ext Among them, the crowd flow data X includes the location data of each public transportation grid and the crowd flow data corresponding to each public transportation grid;

[0119] Step 2: Input the crowd flow data X into the residual network module of the prediction model, and output the proximity matrix corresponding to the crowd flow data X. Periodic matrix and trend matrix

[0120] Step 3: Input the acquired public transportation grids and corresponding crowd flow data within the historical time period into the spatiotemporal graph convolutional network module of the prediction model, and output the corresponding spatiotemporal correlation matrix Y. Se Then the proximity matrix Periodic matrix and trend matrix The input is a parameter matrix-based fusion module that performs fusion, and the output is a weighted fusion matrix Y. Res Then the weighted fusion matrix Y Res And the spatiotemporal correlation matrix Y Se Perform splicing and fusion, and output the spliced ​​fusion matrix Y. n Then the spliced ​​fusion matrix Y n and external environment data Y Ext Perform fusion and output the target fusion matrix Y. m This is output as the prediction result.

[0121] This application provides a method for constructing a crowd flow prediction model. The model is built using a residual network and a spatiotemporal graph convolutional network. It divides the target area for obtaining crowd flow data into multiple grids, combining the public transportation grids with the target area and crowd flow data to improve the prediction accuracy. The residual network module in the crowd flow prediction model divides the crowd flow data within the target area into three time-level matrices. The spatiotemporal graph convolutional network model in the crowd flow prediction model clusters the public transportation grids. The clustered grids and crowd flow data are then processed through a graph convolutional network to obtain a spatiotemporal correlation matrix. Finally, the three time-level matrices and the spatiotemporal correlation matrix are combined... By fusing the data into temporal and spatial data, the prediction accuracy of the model is improved. Since the population flow data corresponding to the public transportation grid varies significantly, a spatiotemporal correlation matrix is ​​obtained by combining the public transportation grid and the corresponding population flow data through a spatiotemporal graph convolutional network module. This solves the problem of large prediction errors caused by large fluctuations in population flow data. Adding external environmental data to the fusion module allows for better handling of finer-grained temporal and spatial relationships, improving the accuracy of the traffic prediction model. Finally, by calculating the error between the predicted traffic matrix and the actual traffic matrix, the prediction model can be optimized and trained, further improving the accuracy of the urban population flow prediction model.

[0122] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0123] The following are device embodiments of this application. For details not described in detail, please refer to the corresponding method embodiments described above.

[0124] Figure 5A schematic diagram of the structure of the crowd flow prediction model construction device provided in the embodiments of this application is shown. For ease of explanation, only the parts related to the embodiments of this application are shown, and are described in detail below:

[0125] like Figure 5 As shown, the device 5 for constructing the crowd flow prediction model includes:

[0126] Building unit 51 is used to build a crowd flow prediction model. The prediction model includes a residual network module, a spatiotemporal graph convolutional network module, a fusion module, and a feedback module.

[0127] The acquisition unit 52 is used to acquire the population flow data of the target area in the historical time period and the external environment data in the predicted time period. The target area is divided into multiple grids, including public transportation grids and non-public transportation grids. The population flow data includes the location data of each public transportation grid and the population flow data corresponding to each public transportation grid.

[0128] The spatiotemporal residual training unit 53 is used to divide the population flow data within a historical time period into proximity data, periodic data, and trend data according to a preset time. The proximity data, periodic data, and trend data are taken as inputs, and the proximity matrix corresponding to the proximity data, the periodic matrix corresponding to the periodic data, and the trend matrix corresponding to the trend data are taken as outputs to train the residual network module.

[0129] The spatiotemporal graph convolutional training unit 54 is used to cluster the public transportation grid in the target area using hierarchical clustering method, obtain the clustered grid and the corresponding crowd flow data, and use the public transportation grid and the corresponding crowd flow data as input and the spatiotemporal correlation matrix corresponding to the clustered grid as output to train the spatiotemporal graph convolutional network module.

[0130] The fusion unit 55 is used to input proximity matrix, periodic matrix, trend matrix, spatiotemporal correlation matrix and external environment data into the fusion module for fusion to obtain the target fusion matrix;

[0131] The determination unit 56 is used to input the target fusion matrix into the feedback module, calculate the predicted traffic matrix within the prediction time period, and calculate the error between the predicted traffic matrix and the actual traffic matrix within the prediction time period. Based on the error, the parameters in the fusion module are adjusted, and the crowd traffic prediction model is iterated until the error meets the preset conditions, thus obtaining the trained crowd traffic prediction model.

[0132] This application provides a device for constructing a crowd flow prediction model. The model is built using a residual network and a spatiotemporal graph convolutional network. It divides the target area for acquiring crowd flow data into multiple grids, combining the public transportation grids with the target area and crowd flow data to improve the prediction accuracy. The residual network module in the crowd flow prediction model divides the crowd flow data within the target area into three time-level matrices. The spatiotemporal graph convolutional network model in the crowd flow prediction model clusters the public transportation grids. The clustered grids and crowd flow data are then processed through a graph convolutional network to obtain a spatiotemporal correlation matrix. Finally, the three time-level matrices and the spatiotemporal correlation matrix are combined... By fusing the data into temporal and spatial data, the prediction accuracy of the model is improved. Since the population flow data corresponding to the public transportation grid varies significantly, a spatiotemporal correlation matrix is ​​obtained by combining the public transportation grid and the corresponding population flow data through a spatiotemporal graph convolutional network module. This solves the problem of large prediction errors caused by large fluctuations in population flow data. Adding external environmental data to the fusion module allows for better handling of finer-grained temporal and spatial relationships, improving the accuracy of the traffic prediction model. Finally, by calculating the error between the predicted traffic matrix and the actual traffic matrix, the prediction model can be optimized and trained, further improving the accuracy of the urban population flow prediction model.

[0133] In one possible implementation, the fusion module may include a parameter matrix-based fusion module and a splicing method-based fusion module; the fusion unit may specifically be used for:

[0134] The proximity matrix, periodic matrix, and trend matrix are input into the parameter matrix-based fusion module for weighted fusion to obtain the weighted fusion matrix;

[0135] The weighted fusion matrix and the spatiotemporal correlation matrix are concatenated and fused to obtain the concatenated fusion matrix. The concatenated fusion matrix and the external environment data are then input into the fusion module based on the concatenation method for fusion to obtain the target fusion matrix.

[0136] In one possible implementation, the fusion unit can also be used for:

[0137] The proximity matrix, periodicity matrix, and trend matrix are input into the Hadamard product to calculate the weighted fusion matrix. The Hadamard product is:

[0138]

[0139] Among them, Y Res This is the weighted fusion matrix. It is a proximity matrix. It is a periodic matrix. For trend matrix, W m W represents the parameters corresponding to the proximity matrix. q W is the parameter corresponding to the periodic matrix. z Here are the parameters corresponding to the trend matrix, and Θ is the Hadamard product.

[0140] In one possible implementation, the fusion unit can also be used for:

[0141] The weighted fusion matrix and the spatiotemporal correlation matrix are input into the splicing calculation formula to calculate the spliced ​​fusion matrix, and the spliced ​​fusion matrix and the external environment data are input into the fusion calculation formula to calculate the target fusion matrix;

[0142] The formula for splicing calculation is:

[0143]

[0144] Among them, Y n Y is the fused matrix after splicing. Res Y is the weighted fusion matrix. Se The spatiotemporal correlation matrix is ​​represented by ⊕, which is the symbol for concatenation calculation.

[0145] The fusion calculation formula is as follows:

[0146] Y m =W f Y n +Y Ext

[0147] Among them, Y m For the target fusion matrix, W f Y represents the parameters corresponding to the concatenated fusion matrix. Ext This refers to external environment data.

[0148] In one possible implementation, the crowd flow prediction model may also include convolutional neural networks and fully connected networks;

[0149] Prior to the fusion unit, this device can also be used for:

[0150] The external environment data of the prediction time period in the target area is input into the convolutional neural network, and the embedded layer feature matrix corresponding to the external environment data is output. The embedded layer feature matrix is ​​the external feature matrix of the external environment data with their respective weight coefficients.

[0151] The embedding layer feature matrix is ​​input into the fully connected network, and the output is a mapping feature matrix with the same dimension as the concatenated fusion matrix; external environmental data includes weather, meteorology, holidays, temperature, air quality index, and time;

[0152] Accordingly, the fusion unit can be used for:

[0153] The concatenated fusion matrix and the external feature matrix are input into the fusion module based on the concatenation method for fusion to obtain the target fusion matrix.

[0154] In one possible implementation, the error may include the root mean square error, and the determining unit may also be used for:

[0155] Determine whether the root mean square error is less than the preset error;

[0156] If the root mean square error is less than the preset error, the crowd flow prediction model is considered to have completed training.

[0157] If the root mean square error is greater than the preset error, the parameters in the fusion module are adjusted, and the process of inputting the proximity matrix, periodic matrix, trend matrix, spatiotemporal correlation matrix, and external environment data into the fusion module for fusion to obtain the target fusion matrix continues until the root mean square error is less than the preset error, at which point it is determined that the crowd flow prediction model has completed training.

[0158] Figure 6 This is a schematic diagram of the terminal provided in an embodiment of this application. For example... Figure 6 As shown, the terminal 6 in this embodiment includes: a processor 60, a memory 61, and a computer program 62 stored in the memory 61 and executable on the processor 60. When the processor 60 executes the computer program 62, it implements the steps in the above-described embodiments of the methods for constructing various crowd flow prediction models, for example... Figure 1 Steps 101 to 106 are shown. Alternatively, when the processor 60 executes the computer program 62, it implements the functions of each unit in the above-described device embodiments, for example... Figure 5 The functions of units 51 to 56 are shown.

[0159] For example, the computer program 62 can be divided into one or more units, which are stored in the memory 61 and executed by the processor 60 to complete this application. The one or more units can be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program 62 in the terminal 6. For example, the computer program 62 can be divided into... Figure 5 Units 51 to 56 are shown.

[0160] The terminal 6 can be a computing device such as a desktop computer, laptop, handheld computer, or cloud server. The terminal 6 may include, but is not limited to, a processor 60 and a memory 61. Those skilled in the art will understand that... Figure 6This is merely an example of terminal 6 and does not constitute a limitation on terminal 6. It may include more or fewer components than shown, or combine certain components, or different components. For example, the terminal may also include input / output devices, network access devices, buses, etc.

[0161] The processor 60 may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.

[0162] The memory 61 can be an internal storage unit of the terminal 6, such as a hard disk or memory of the terminal 6. The memory 61 can also be an external storage device of the terminal 6, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the terminal 6. Furthermore, the memory 61 can include both internal storage units and external storage devices of the terminal 6. The memory 61 is used to store the computer program and other programs and data required by the terminal. The memory 61 can also be used to temporarily store data that has been output or will be output.

[0163] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0164] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0165] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0166] In the embodiments provided in this application, it should be understood that the disclosed devices / terminals and methods can be implemented in other ways. For example, the device / terminal embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling or direct coupling or communication connection may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0167] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0168] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0169] If the integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the above-described embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the above-described embodiments of the methods for constructing various crowd flow prediction models. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately added to or subtracted from the content as required by the legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium may not include electrical carrier signals and telecommunication signals.

[0170] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A method for constructing a crowd flow prediction model, characterized in that, The construction method includes: A crowd flow prediction model is constructed, which includes a residual network module, a spatiotemporal graph convolutional network module, a fusion module, and a feedback module. The system acquires population flow data for a target area over a historical period and external environment data for a predicted period. The target area is divided into multiple grids, including public transportation grids and non-public transportation grids. The population flow data includes location data for each public transportation grid and corresponding population flow data for each public transportation grid. The population flow data within the historical time period is divided into proximity data, periodic data, and trend data according to a preset time. The proximity data, periodic data, and trend data are respectively used as inputs, and the proximity matrix corresponding to the proximity data, the periodic matrix corresponding to the periodic data, and the trend matrix corresponding to the trend data are used as outputs to train the residual network module. Hierarchical clustering method is used to cluster the public transportation grid in the target area to obtain the clustered grid and the corresponding crowd flow data. The public transportation grid and the corresponding crowd flow data are used as input and the spatiotemporal correlation matrix corresponding to the clustered grid is used as output to train the spatiotemporal graph convolutional network module. The proximity matrix, the periodic matrix, the trend matrix, the spatiotemporal correlation matrix, and the external environment data are fused together by the input fusion module to obtain the target fusion matrix; The target fusion matrix is ​​input into the feedback module to calculate the predicted traffic matrix within the prediction time period, and the error between the predicted traffic matrix and the actual traffic matrix within the prediction time period is calculated. Based on the error, the parameters in the fusion module are adjusted, and the crowd traffic prediction model is iterated until the error meets the preset conditions, thus obtaining the trained crowd traffic prediction model.

2. The method for constructing a crowd flow prediction model according to claim 1, characterized in that, The fusion module includes a parameter matrix-based fusion module and a splicing method-based fusion module; the step of fusing the proximity matrix, the periodic matrix, the trend matrix, the spatiotemporal correlation matrix, and the external environment data into the fusion module to obtain the target fusion matrix includes: The proximity matrix, the periodic matrix, and the trend matrix are input into the parameter matrix-based fusion module for weighted fusion to obtain a weighted fusion matrix; The weighted fusion matrix and the spatiotemporal correlation matrix are concatenated and fused to obtain a concatenated fusion matrix. The concatenated fusion matrix and the external environment data are then input into the fusion module based on the concatenation method for fusion to obtain the target fusion matrix.

3. The method for constructing a crowd flow prediction model according to claim 2, characterized in that, The step of inputting the proximity matrix, the periodicity matrix, and the trend matrix into the parameter matrix-based fusion module for weighted fusion to obtain a weighted fusion matrix includes: The proximity matrix, the periodicity matrix, and the trend matrix are input into the Hadamard product to calculate the weighted fusion matrix. The Hadamard product is: Among them, Y Res The weighted fusion matrix is... Let be the proximity matrix. For the periodic matrix, For the trend matrix, W m W is the parameter corresponding to the proximity matrix. q W is the parameter corresponding to the periodic matrix. z Let θ be the parameter corresponding to the trend matrix, and Θ be the Hadamard product.

4. The method for constructing a crowd flow prediction model according to claim 2, characterized in that, The process of concatenating and fusing the weighted fusion matrix and the spatiotemporal correlation matrix to obtain a concatenated fusion matrix, and then inputting the concatenated fusion matrix and the external environment data into the fusion module based on the concatenation method for fusion to obtain the target fusion matrix, includes: The weighted fusion matrix and the spatiotemporal correlation matrix are input into the splicing calculation formula to calculate the spliced ​​fusion matrix, and the spliced ​​fusion matrix and the external environment data are input into the fusion calculation formula to calculate the target fusion matrix; The splicing calculation formula is as follows: Among them, Y n Y is the spliced ​​fusion matrix. Res Let Y be the weighted fusion matrix. Se The spatiotemporal correlation matrix is... For splicing calculation symbols; The fusion calculation formula is as follows: AND m =W f AND n +And Ext Among them, Y m Let W be the target fusion matrix. f Y is the parameter corresponding to the spliced ​​fusion matrix. Ext This refers to the external environment data.

5. The method for constructing a crowd flow prediction model according to claim 2, characterized in that, The crowd flow prediction model also includes convolutional neural networks and fully connected networks; Before fusing the proximity matrix, the periodic matrix, the trend matrix, the spatiotemporal correlation matrix, and the external environment data into the fusion module to obtain the fused matrix, the method further includes: The external environment data of the target area for the predicted time period is input into the convolutional neural network, and the embedded layer feature matrix corresponding to the external environment data is output. The embedded layer feature matrix is ​​the external feature matrix of the external environment data with its own weight coefficients. The embedded layer feature matrix is ​​input into a fully connected network, and the output is a mapping feature matrix with the same dimension as the concatenated fusion matrix; the external environment data includes weather, meteorology, holidays, temperature, air quality index, and time; Accordingly, the step of inputting the spliced ​​fusion matrix and the external environment data into the fusion module based on the splicing method for fusion to obtain the target fusion matrix includes: The spliced ​​fusion matrix and the external feature matrix are input into the splicing method-based fusion module for fusion to obtain the target fusion matrix.

6. The method for constructing a crowd flow prediction model according to claim 1, characterized in that, The error includes the root mean square error. The step of adjusting the parameters within the fusion module based on the error and iterating the crowd flow prediction model until the error meets a preset condition, thereby obtaining a trained crowd flow prediction model, includes: Determine whether the root mean square error is less than a preset error; If the root mean square error is less than the preset error, then the crowd flow prediction model is determined to have completed training. If the root mean square error is greater than the preset error, the parameters in the fusion module are adjusted, and the process of fusing the proximity matrix, the periodic matrix, the trend matrix, the spatiotemporal correlation matrix, and the external environment data into the fusion module to obtain the target fusion matrix continues until the root mean square error is less than the preset error, at which point it is determined that the crowd flow prediction model has completed training.

7. A device for constructing a crowd flow prediction model, characterized in that, The construction apparatus includes: A construction unit is used to build a crowd flow prediction model, which includes a residual network module, a spatiotemporal graph convolutional network module, a fusion module, and a feedback module. The acquisition unit is used to acquire population flow data of the target area during a historical time period and external environment data during a predicted time period. The target area is divided into multiple grids, including public transportation grids and non-public transportation grids. The population flow data includes the location data of each public transportation grid and the population flow data corresponding to each public transportation grid. The spatiotemporal residual training unit is used to divide the population flow data within the historical time period into proximity data, periodic data, and trend data according to a preset time. The proximity data, periodic data, and trend data are taken as inputs, and the proximity matrix corresponding to the proximity data, the periodic matrix corresponding to the periodic data, and the trend matrix corresponding to the trend data are taken as outputs to train the residual network module. The spatiotemporal graph convolutional training unit is used to cluster the public transportation grid in the target area using a hierarchical clustering method to obtain the clustered grid and the corresponding crowd flow data. The public transportation grid and the corresponding crowd flow data are used as inputs and the spatiotemporal correlation matrix corresponding to the clustered grid is used as output to train the spatiotemporal graph convolutional network module. The fusion unit is used to fuse the proximity matrix, the periodic matrix, the trend matrix, the spatiotemporal correlation matrix, and the external environment data into the fusion module to obtain the target fusion matrix; The determining unit is used to input the target fusion matrix into the feedback module, calculate the predicted traffic matrix within the prediction time period, calculate the error between the predicted traffic matrix and the actual traffic matrix within the prediction time period, adjust the parameters in the fusion module based on the error, and iterate the crowd traffic prediction model until the error meets the preset conditions to obtain the trained crowd traffic prediction model.

8. The apparatus for constructing a crowd flow prediction model according to claim 7, characterized in that, The fusion module includes a parameter matrix-based fusion module and a splicing method-based fusion module; the fusion unit is used for: The proximity matrix, the periodic matrix, and the trend matrix are input into the parameter matrix-based fusion module for weighted fusion to obtain a weighted fusion matrix; The weighted fusion matrix and the spatiotemporal correlation matrix are concatenated and fused to obtain a concatenated fusion matrix. The concatenated fusion matrix and the external environment data are then input into the fusion module based on the concatenation method for fusion to obtain the target fusion matrix.

9. A terminal, 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 computer program, it implements the steps of the method for constructing the crowd flow prediction model as described in any one of claims 1 to 6.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method for constructing the crowd flow prediction model as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Crowd portrait prediction method, device and equipment and storage medium

    CN111429185A

  • Traffic speed prediction method and device based on space-time attention graph convolutional network

    CN113705880A