A method for predicting intercity population flow based on a dynamic time-series radiation model
By fusing multi-source data through a dynamic temporal radiation model and a self-cross-attention mechanism, the data fusion problem in intercity population flow prediction was solved, achieving high-precision prediction of short-term dynamic changes and sudden peak periods, and improving the prediction accuracy during holiday periods.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- WUHAN VOCATIONAL COLLEGE OF SOFTWARE & ENG (WUHAN OPEN UNIV)
- Filing Date
- 2026-03-26
- Publication Date
- 2026-06-30
AI Technical Summary
Existing technologies struggle to effectively integrate heterogeneous data from multiple sources, such as meteorological data, nighttime light pollution, and holiday effects, making it impossible to accurately predict short-term dynamic changes in intercity population flows and sudden peak periods of population movement.
A dynamic temporal radiation model is adopted to construct urban dynamic feature vectors of OD pairs and surrounding areas. Combining self-attention and cross-attention mechanisms, multi-source heterogeneous data are integrated to predict population flow.
It significantly improves the accuracy of population flow prediction during holidays, effectively captures the fluctuation characteristics of time series, and provides high-precision traffic scheduling and urban planning data support.
Smart Images

Figure CN122309977A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of deep learning technology, and in particular to a method for predicting intercity population flow based on a dynamic time-series radiation model. Background Technology
[0002] Intercity population flow is an important indicator reflecting regional economic ties and the development level of urban agglomerations. Accurate prediction of daily intercity population flow is of great significance for traffic scheduling, epidemic prevention and control, and urban planning.
[0003] Currently, some related technologies can predict intercity population flows using static models, time-series models, and methods that fuse multiple dynamic features. Static models, such as traditional gravity models and radiation models, are primarily used for annual-scale static flow prediction and rely on static variables such as population size and distance, failing to capture high-frequency fluctuations at the daily scale influenced by factors like holidays and weather. Time-series models, such as ARIMA models or basic LSTM models, can handle dynamic time-series data; however, these models often treat each population flow path as an isolated time series, ignoring the spatial interaction and competition mechanisms between origin-destination (OD) cities and their surrounding areas. Furthermore, existing methods struggle to effectively fuse multi-source heterogeneous data such as meteorological data, nighttime light (representing economic activity), and holiday effects. In particular, they lack targeted modeling mechanisms for "temporal heterogeneity" (such as differences in patterns between weekdays and holidays), leading to a significant drop in prediction accuracy during sudden population flow peaks (such as during holidays like Spring Festival and National Day).
[0004] Therefore, there is currently a lack of an intercity population flow prediction method that can take into account both spatial interaction mechanisms and short-term dynamic changes, and can also predict sudden traffic surges during holidays. Summary of the Invention
[0005] This application provides a method for predicting intercity population flow based on a dynamic time-series radiation model, in order to overcome the shortcomings of the aforementioned related technologies. The technical solution is as follows: Firstly, this application provides a method for predicting intercity population flow based on a dynamic time-series radiation model, including: For each city in the target area, take it as the starting point and another city as the ending point, and construct OD pairs for the population flow direction from the starting point to the ending point; For each OD pair, determine the distance between the starting point and each other city in the target area, identify cities whose distance is less than the distance between the starting point and the ending point as surrounding cities, and define the set of surrounding cities as the surrounding area; Extract the intercity population flow volume of the OD pair at each time step in the historical period to construct the intercity population flow feature vector. The urban dynamic features of the OD pair and its surrounding area at each time step in the historical period are extracted to construct the urban dynamic feature vector. The time-encoding vector constructed based on historical periods, the intercity population flow feature vector, and the urban dynamic feature vector are input into the trained population flow prediction model. The population flow prediction model is used to obtain the predicted population flow for each OD pair at the prediction time step.
[0006] In one alternative of the first aspect, the step of extracting the urban dynamic features of the OD pair and its surrounding area at each time step in the historical period to construct the urban dynamic feature vector includes: Extract the urban dynamic features of the origin and end points of OD pairs at each time step within the historical period; By splicing together the urban dynamic features of the starting point at each time step and the urban dynamic features of the ending point at each time step, an OD pair of urban dynamic feature vectors is constructed. Extract the urban dynamic features of each surrounding city within the surrounding area of the OD pair at each time step in the historical period; Aggregate the dynamic features of all surrounding cities with the same feature type within the same time step to obtain aggregated features. Construct aggregated feature vectors based on the aggregated features of each feature type within the same time step. Concatenate the aggregated feature vectors of each time step to construct the dynamic feature vector of surrounding cities. The urban dynamic feature vector includes the OD pair urban dynamic feature vector and the surrounding area urban dynamic feature vector.
[0007] In one alternative embodiment of the first aspect, the construction process of the time-coded vector includes: Based on the preset mapping relationship between the type of time step and the numerical code, each time step in the historical period is mapped to the corresponding numerical code. The time-coded vector is constructed by arranging the numerical codes obtained by mapping according to the time step order.
[0008] In one alternative embodiment of the first aspect, the population flow prediction model includes an input layer, a feature extraction layer, a self-attention layer, a cross-attention layer, a fully connected layer, a random deactivation layer, a global average pooling layer, and a prediction layer. The calculation process of the population flow prediction model includes the following steps: The input layer obtains three types of feature vectors and the time-encoded vector; wherein, the three types of feature vectors include the OD pair urban dynamic feature vector, the surrounding area urban dynamic feature vector, and the intercity population flow feature vector. The three types of feature vectors are respectively input into the feature extraction layer, and the long short-term memory network in the feature extraction layer processes each type of feature vector to extract the corresponding type of temporal features. Each type of temporal feature is input into the self-attention layer, and attention features of each type are obtained based on self-attention weighting. Attention features of each type are concatenated along the feature dimension to obtain an attention feature matrix. The attention feature matrix and the query matrix obtained by processing the time encoding vector are input into the cross-attention layer to obtain the cross-attention fusion feature; The concatenated temporal features obtained by concatenating temporal features based on each type are added element-wise to the cross-attention fusion features to obtain the fusion feature vector; The fused feature vector is input into the fully connected layer, and then processed sequentially through the fully connected layer, the random deactivation layer, and the global average pooling layer to obtain the target feature vector. The target feature vector is input into the prediction layer, and the process yields the predicted population flow value for each OD pair at the prediction time step.
[0009] In one alternative embodiment of the first aspect, the step of inputting the attention feature matrix and the query matrix obtained based on the time encoding vector into the cross-attention layer to obtain cross-attention fusion features includes: After embedding and projection processing based on the time-encoded vector, a query matrix is generated, and a key matrix and a value matrix are obtained by processing based on the attention feature matrix. The attention weight matrix is calculated based on the query matrix and the key matrix. The value matrix is then weighted and summed based on the attention weight matrix to obtain the cross-attention fusion feature.
[0010] In one alternative embodiment of the first aspect, the training process of the population flow prediction model includes the following steps: For each city in the sample area, take it as the starting point and another city as the ending point, and construct sample OD pairs of population flow directions from the starting point to the ending point; Obtain the intercity population flow of each sample OD pair within the sample area at each time step during the sample period, and obtain the urban dynamic characteristics of the sample OD pair and its surrounding area at each time step during the sample period. The sample set is constructed by taking the intercity population flow and urban dynamic characteristics of multiple consecutive time steps as sample inputs and taking the intercity population flow of the next adjacent time step as the corresponding sample label. Input the sample set into the population flow prediction model to be trained, and obtain the prediction results generated by the population flow prediction model based on the sample input; A loss function is constructed based on the prediction results and the corresponding sample labels. Backpropagation is then performed based on the value of the loss function to adjust the model parameters of the population flow prediction model. Output the model parameters of the converged population flow prediction model to obtain the trained population flow prediction model.
[0011] In one alternative to the first aspect, the loss function is expressed as follows: ; in, Represents the loss function. This is the mean square error term. Indicates sample label, Indicates the prediction result. Indicates a non-negative penalty term. This represents the penalty coefficient.
[0012] Secondly, this application also provides an intercity population flow prediction device based on a dynamic time-series radiation model, comprising: The data processing module is used to construct OD pairs of population flow directions from start to finish, taking each city in the target area as the start point and another city as the end point. For each OD pair, the data processing module is also used to determine the distance between the starting point and each other city in the target area, identify cities whose distance is less than the distance between the starting point and the ending point as surrounding cities, and determine the set of surrounding cities as the surrounding area; The data processing module is also used to extract the intercity population flow volume of the OD pair at each time step in the historical period, and construct the intercity population flow volume feature vector. The data processing module is also used to extract the urban dynamic features of the OD pair and the surrounding area of the OD pair at each time step in the historical period, and construct the urban dynamic feature vector. The population flow prediction module is used to input the time-encoded vector constructed based on historical periods, the intercity population flow feature vector, and the urban dynamic feature vector into the trained population flow prediction model. The population flow prediction module is also used to process the population flow prediction model to obtain the predicted population flow value for each OD pair at the prediction time step.
[0013] Thirdly, this application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method provided by the first aspect of this application or any implementation thereof.
[0014] Fourthly, this application also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method provided by the first aspect of this application or any implementation thereof.
[0015] This application's embodiments, by simultaneously considering population flow data, urban dynamic characteristics, and urban dynamic characteristics of surrounding areas for each OD pair, enable the model to dynamically adjust prediction results using real-time meteorological and nighttime light dynamic features. This effectively balances spatial interaction mechanisms with short-term dynamic changes, overcoming the shortcomings of traditional static models that rely on static variables such as population size and distance and cannot capture high-frequency fluctuations. It also avoids the limitations of time series models that ignore the spatial interaction and competition mechanisms between origin and destination cities and surrounding areas. Simultaneously, by introducing time encoding vectors through cross-attention, the impact of holiday periods on population flow data is fully considered. Combining the synergy of dynamic features and cross-attention mechanisms, the model can more effectively capture the fluctuation characteristics of time series between weekdays and holidays, significantly improving the prediction accuracy of the model during holidays such as Spring Festival and National Day.
[0016] Therefore, the embodiments of this application can not only integrate multi-source heterogeneous data, but also achieve high-precision prediction during sudden peak population flows, providing reliable data support for traffic scheduling and urban planning. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in this application or related technologies, the drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is one of the flowcharts illustrating an intercity population flow prediction method based on a dynamic time-series radiation model provided in this application embodiment; Figure 2 This is the second flowchart illustrating a method for predicting intercity population flow based on a dynamic time-series radiation model provided in this application embodiment; Figure 3 This is a schematic diagram of the structure of an intercity population flow prediction device based on a dynamic time-series radiation model provided in an embodiment of this application; Figure 4 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0020] The terms "comprising" and "having," and any variations thereof, in the specification, claims, and accompanying drawings of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or modules is not limited to the steps or modules listed, but may optionally include steps or modules not listed, or may optionally include other steps or modules inherent to such process, method, product, or apparatus.
[0021] It should be noted that the terms "first" and "second" used in this application are merely to distinguish similar objects and do not represent a specific ordering of the objects. It is understood that "first" and "second" can be interchanged in a specific order or sequence where permitted. It should be understood that the objects distinguished by "first" and "second" can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in an order other than those described or illustrated herein.
[0022] The present application will now be described in detail with reference to specific embodiments.
[0023] Next, combine Figure 1 This paper introduces a method for predicting intercity population flow based on a dynamic time-series radiation model, provided by embodiments of this application. For details, please refer to... Figure 1 , Figure 1 This illustration shows a flowchart of an intercity population flow prediction method based on a dynamic time-series radiation model, provided in an embodiment of this application. Figure 1 As shown, the method includes the following steps: S101, taking each city in the target area as the starting point and another city as the ending point, construct OD pairs of population flow directions from the starting point to the ending point; S102, For each OD pair, determine the distance between the starting point and each other city in the target area, identify cities whose distance is less than the distance between the starting point and the ending point as surrounding cities, and define the set of surrounding cities as the surrounding area; S103, extract the intercity population flow volume of the OD pair at each time step in the historical period, and construct the intercity population flow feature vector. S104. Extract the urban dynamic features of the OD pair and its surrounding area at each time step in the historical period to construct the urban dynamic feature vector. S105, input the time encoding vector constructed based on historical periods, the intercity population flow feature vector, and the urban dynamic feature vector into the trained population flow prediction model. S106, The population flow prediction model is used to obtain the predicted population flow value for each OD pair at the prediction time step.
[0024] Specifically, before implementing S101, any region can be selected as the target area for the study, such as a region covering all prefecture-level cities in East my country, South China, North China, and Central China.
[0025] In some embodiments, in S101, each city in the target area can be taken as the starting point and another different city as the ending point. Connecting the starting point to the ending point makes it easy to construct a vector from the starting point to the ending point, that is, to construct the OD pair of the population flow direction from the starting point to the ending point.
[0026] In some embodiments, in S102, the surrounding area of each OD pair can be determined for the population flow direction starting from city i and ending at city j. The OD pairs can be used to determine the distance between the starting point i and each other city k within the target area. , distance Less than the distance between the start and the end points The cities were defined as surrounding cities, and the set of surrounding cities was determined. The surrounding area can be represented by the following formula:
[0027] Understandably, the above formula is equivalent to defining the surrounding area as starting from the city. With the city as the center to the city distance The set of all cities within a circular area of radius coinciding with the target area (excluding the starting point). and the end point itself).
[0028] It should be noted that in S103, intercity population flow data between cities can be obtained through content published by location-based services (LBS) providers, map navigation platforms, or relevant official departments. This application embodiment does not limit this.
[0029] Based on publicly available intercity population flow data, the intercity population flow volume for each continuous time step within a historical period can be extracted. Arranging these time steps sequentially yields a time series vector, from which the intercity population flow feature vector can be constructed, expressed as the following formula: ; in, Let represent the feature vector of intercity population flow, t represent the prediction time step (the next time step immediately following the last time step in the historical period), N represent the total number of time steps in the historical period, and T represent the matrix transpose. This represents the intercity population movement of the corresponding OD pair at time step tN.
[0030] For example, we can choose a daily time step and select a historical time window size of N=7 days. Then, the predicted time step t is the 8th day. The intercity population flow feature vector contains 7 elements, expressed by the formula: ; At this time, the characteristic vector of intercity population flow This constitutes a size of The time series feature matrix.
[0031] In some embodiments, the urban dynamic feature vector in S104 specifically includes the OD pair urban dynamic feature vector and the surrounding area urban dynamic feature vector.
[0032] The process of constructing the dynamic feature vector of a city using OD includes: Extract the urban dynamic features of the starting point i and ending point j of the OD pair at each time step within the historical period; By splicing together the urban dynamic features of the starting point at each time step and the urban dynamic features of the ending point at each time step, an OD pair of urban dynamic feature vectors is constructed.
[0033] It should be noted that urban dynamic characteristics include meteorological characteristics and economic characteristics. Meteorological characteristics include, but are not limited to, wind speed characteristics, temperature characteristics, air pressure characteristics and precipitation characteristics. Economic characteristics can be measured by the intensity of urban nighttime light, i.e., nighttime light (NTL).
[0034] For example, six feature types can be set, including the 10-meter u-wind component, the 10-meter v-wind component, the 2-meter temperature, the surface air pressure, the total precipitation, and the nighttime illumination. Within a 7-day diurnal time window, the resulting OD-to-urban dynamic feature vector has the following dimensions: .
[0035] Furthermore, the construction process of the dynamic feature vectors of surrounding cities includes: Extract the urban dynamic features of each surrounding city within the historical period for each city in the surrounding area of the OD pair.
[0036] Specifically, for example, setting the time step as In the starting city With the destination city The set of surrounding cities in the corresponding OD pair's surrounding area. Include Given m surrounding cities, and m dynamic features of each city, then the set of surrounding cities is... The kth city in the middle at time step The The urban dynamic characteristics of each feature type can be represented as follows: .
[0037] Furthermore, aggregated features are obtained by aggregating the dynamic features of all surrounding cities with the same feature type within the same time step.
[0038] Specifically, aggregated features can be obtained using either mean aggregation or sum aggregation. The formula for mean aggregation can be expressed as: ; The formula for summation can be expressed as: ; in, This represents the aggregated features of all surrounding cities within time step t, representing the feature type m.
[0039] It should be noted that in practical applications, the system will choose between sum aggregation or mean aggregation based on the physical properties of the dynamic features.
[0040] In some embodiments, in order to uniformly eliminate the dimensional fluctuations caused by the differences in the number of surrounding cities between different OD pairs, the above-mentioned mean aggregation method is uniformly used to calculate dynamic features for all feature types.
[0041] Next, an aggregated feature vector can be constructed based on the aggregated features of each feature type within the same time step.
[0042] For example, if m=6 is set, after calculating each type of aggregated feature based on the above formula, an aggregated feature vector for a single time step can be generated, represented as: ; Finally, the aggregated feature vectors from each time step can be concatenated to construct the dynamic feature vectors of the surrounding urban areas.
[0043] For example, if m=6 is set, within a 7-day diurnal time window, the spliced dynamic feature vector of the surrounding urban area is a... The time series feature matrix.
[0044] It's important to note that if the origin and destination features corresponding to the dynamic feature vectors of OD pairs are lumped together with the surrounding features corresponding to the dynamic feature vectors of surrounding cities (e.g., directly merging them into a single input), the neural network will experience feature confusion, failing to distinguish which driving forces originate from the cities themselves within the OD pair and which come from the influence of surrounding cities in the surrounding areas. By constructing separate dynamic feature vectors for OD pairs and surrounding cities as independent inputs, subsequent self-attention and cross-attention layers can independently learn the different weights of "origin and destination self-pull force" and "surrounding radiation force" in different date scenarios, thereby improving the model's prediction accuracy for population flow.
[0045] In some embodiments, a time-encoded vector can be constructed based on historical periods before performing S105, including the following steps: Based on the preset mapping relationship between the type of time step and the numerical code, each time step in the historical period is mapped to the corresponding numerical code. The time-coded vector is constructed by arranging the numerical codes obtained by mapping according to the time step order.
[0046] For example, the type of time step can include holidays, ordinary dates other than holidays, etc. For instance, it can be determined whether the date corresponding to the time step is a National Day holiday, a Spring Festival holiday, etc., and then the numerical code can be obtained according to the mapping relationship. The following uses National Day and Mid-Autumn Festival as examples to determine the mapping relationship between time step t and numerical code using the following piecewise function, expressed as follows: ; in, The set of dates representing National Day. Let t represent the set of dates for the Mid-Autumn Festival, and let t fall within the set of dates for National Day. Within the range, time step t is mapped to the numerical code 0. If t falls within the set of dates for the Mid-Autumn Festival... Within the specified range, the mapping numerical code can be set to 9. If it is a regular date other than a holiday, the mapping numerical code can be set according to the date's sequence number within the week. Returns the week number from 1 to 7. For example, it maps Monday to the numeric code 1 and Sunday to the numeric code 7.
[0047] It should be noted that, in practice, the model provided in this application can encode all holidays, and the embodiments of this application do not limit this.
[0048] In some embodiments, the population flow prediction model in S105 includes an input layer, a feature extraction layer, a self-attention layer, a cross-attention layer, a fully connected layer, a random deactivation layer, a global average pooling layer, and a prediction layer. like Figure 2 As shown, Figure 2 The calculation process of the population flow prediction model is illustrated, specifically including the following steps: S1051, three types of feature vectors and the time encoding vector are obtained through the input layer; the three types of feature vectors include the OD pair urban dynamic feature vector, the surrounding area urban dynamic feature vector, and the intercity population flow feature vector.
[0049] S1052, the three types of feature vectors are input into the feature extraction layer respectively, and the Long Short-Term Memory (LSTM) network in the feature extraction layer processes each type of feature vector to extract the corresponding type of temporal features.
[0050] Among them, the temporal features obtained by OD from the urban dynamic feature vector through a long short-term memory network are represented as follows: The temporal features extracted from the dynamic feature vectors of surrounding cities via a long short-term memory network are represented as follows: The time-series features obtained by extracting the intercity population flow feature vector through a long short-term memory network are represented as follows: .
[0051] Based on the above embodiments, if m=6 is set, within a 7-day daily time window, the dynamic feature vector of the city is based on OD ( The obtained time series features The dimension is Based on the dynamic feature vectors of surrounding cities ( The obtained time series features The dimension is Based on the intercity population flow feature vector ( The obtained time series features The dimension is .
[0052] S1053, each type of temporal feature is input into the self-attention layer to capture the temporal step dependency within each feature. Attention features of each type are obtained based on self-attention weighting. Attention features of each type are concatenated along the feature dimension to obtain an attention feature matrix.
[0053] Based on the above embodiments, the dimension of the concatenated attention feature matrix is: .
[0054] S1054, the attention feature matrix and the query matrix obtained based on the time encoding vector are input into the cross-attention layer to obtain cross-attention fusion features, specifically including: A query matrix is generated after embedding and projection processing based on the time-encoded vector. The key matrix is obtained by processing the attention feature matrix. Sum matrix ; The attention weight matrix is calculated based on the query matrix and the key matrix, and the formula is as follows: ; in, This is the attention weight matrix. Let be the dimension of the key vector. This is used to scale the dot product result to prevent the softmax function from entering the gradient flattening region due to excessively large dot product values.
[0055] Furthermore, the value matrix is weighted and summed based on the attention weight matrix to obtain the cross-attention fusion feature, expressed by the formula: ; in, The cross-attention fusion feature, based on the above embodiments, has the following dimension: .
[0056] It should be noted that by introducing a query matrix generated by a time-encoded vector, the model can dynamically adjust the degree of attention it pays to features such as weather and surrounding competition based on cross-attention, depending on whether it is a holiday or not (for example, it may pay more attention to the features of surrounding tourist cities during holidays).
[0057] S1055, the spliced temporal features obtained by splicing temporal features based on each type are added element by element to the cross-attention fusion features to obtain the fusion feature vector.
[0058] Specifically, the time-series features obtained from S1052 can be concatenated along the feature dimension while keeping the time step dimension unchanged. The formula is as follows: ; in, The splicing timing features are represented by the dimensions described in the above embodiments. .
[0059] It should be noted that the concatenated temporal features fully preserve the spatial and historical flow information of each dimension before the attention mechanism intervenes. This matrix does not enter the cross-attention layer, but is directly used as a shortcut in subsequent steps to interact with the output of the cross-attention layer. Residual connections are used to effectively avoid the vanishing gradient problem in deep network training and ensure the complete transmission of original temporal features.
[0060] Specifically, the formula for residual join (element-by-element addition) is expressed as: ; in, This represents the fused feature vector.
[0061] S1056, The fused feature vector is input into the fully connected layer, and then processed sequentially through the fully connected layer, the random deactivation layer, and the global average pooling layer to obtain the target feature vector.
[0062] Specifically, the fully connected (Dense) layer is used to extract high-level abstract information, as expressed in the formula: ; in, This represents the learnable weight matrix of the fully connected layer. This represents the fused feature vector output at time step t. This represents the bias vector. This represents the output of the fully connected layer. This represents a non-linear activation function (e.g., ReLU); based on the above embodiments, the dimension of the learnable weight matrix is... The bias vector has a dimension of 128. After processing by the fully connected layer, the feature dimension of the output of the fully connected layer is compressed, and the overall dimension is reduced from 128. Mapped to .
[0063] Regularization is performed using a random deactivation layer (Dropout layer) to prevent overfitting, as expressed by the formula: ; in, This indicates an element-wise multiplication operation. Represents a mask vector that follows a Bernoulli distribution (dimension and dimension). same), This represents the output of the random deactivation layer at time step t. Based on the above embodiment, the dimension of the output remains the same after the random deactivation layer. .
[0064] Finally, a global average pooling layer is used to compress the time series data output from the random deactivation layer into a single feature vector of fixed length, thus obtaining the target feature vector, expressed by the formula: ; Among them, the global average pooling layer can compress the time dimension T, and the output results of the random deactivation layer are... It can transform a two-dimensional matrix that originally had a time series span ( Compressed along the time axis into a one-dimensional, fixed-length single feature vector. Based on the above embodiments, after the global average pooling layer, the target feature vector... The dimension is That is, a vector of length 128.
[0065] S1057, The target feature vector is input into the prediction layer and processed to obtain the population flow prediction value for each OD pair at the prediction time step.
[0066] Based on the above embodiments, the predicted population flow for the 8th day is obtained by predicting the population flow based on the 7-day historical population flow data of the historical period.
[0067] In some embodiments, the training process of the population flow prediction model includes the following steps: S201, each city in the sample area is used as the starting point and another city is used as the ending point to construct sample OD pairs of population flow directions from the starting point to the ending point.
[0068] Specifically, the process of constructing OD pairs is the same as that in the aforementioned embodiment S101, and will not be repeated here.
[0069] S202, obtain the intercity population flow of each sample OD pair within the sample area at each time step during the sample period, and obtain the urban dynamic characteristics of the sample OD pair and the surrounding area of the sample OD pair at each time step during the sample period.
[0070] Specifically, the process of determining the surrounding area is the same as that in the aforementioned embodiment S102, and will not be repeated here.
[0071] S203 uses the intercity population flow and urban dynamic characteristics of multiple consecutive time steps as sample inputs, and the intercity population flow of the next adjacent time step as the corresponding sample label to construct a sample set.
[0072] Specifically, intercity population flow and urban dynamics can be selected from multiple consecutive time steps within the sample period based on a preset time window to construct sample inputs and sample labels.
[0073] S204, input the sample set into the population flow prediction model to be trained, and obtain the prediction results generated by the population flow prediction model based on the sample input.
[0074] Understandably, before making predictions, the population flow prediction model can construct feature vectors based on steps S103 and S104. The calculation process of the population flow prediction model is the same as that of S1051-S1057. Please refer to the description of the aforementioned embodiments, which will not be repeated here.
[0075] S205, Based on the prediction results and the corresponding sample labels, a loss function is constructed, expressed as: ; in, Represents the loss function. This is the mean square error term. Indicates sample label, Indicates the prediction result. Indicates a non-negative penalty term. This represents the penalty coefficient.
[0076] Backpropagation is performed based on the value of the loss function to adjust the model parameters of the population flow prediction model.
[0077] It should be noted that population mobility (or migration index), as an absolute quantitative indicator, should be greater than or equal to 0 (i.e., negative population mobility is impossible). However, traditional neural network regression models (such as those directly using MSE as the loss function) produce mathematically unbounded predicted outputs when performing linear combinations and parameter mappings, easily leading to negative predictions that violate physical laws. By introducing a non-negative penalty term, when the model outputs a prediction in a certain iteration... When this happens, the penalty term is activated, generating a very large additional loss value. This produces a strong gradient signal during backpropagation, quickly 'pulling' the model parameters back to the parameter space where the output is non-negative. This mechanism greatly reduces the search time of optimizers (such as Adam) in the invalid parameter space, thereby accelerating the convergence speed of the model.
[0078] In some specific embodiments, the prediction performance of the population flow prediction model (Dynamic Temporal Radiation Model, DTRM) provided in this application is compared with that of other models, including the CityFeat-LSTM model (LSTM with City Dynamic Features), the HATt-LSTM model (LSTM with Historical / Holiday Attention Mechanism), and the ordinary LSTM model.
[0079] The standard LSTM model uses only time-series data of intercity population movement within a 7-day time window for single-step prediction, without incorporating the urban dynamic features used in this application. The HATt-LSTM model makes preliminary improvements to the standard LSTM model by introducing an attention mechanism for time features, thereby more effectively capturing the fluctuation characteristics of time series (especially between weekdays and holidays). The CityFeat-LSTM model improves upon the basic LSTM from a spatial feature perspective, incorporating dynamic feature sequences of the origin city, destination city, and surrounding cities based on the time-series flow data. The comparison results are shown in Table 1. Table 1. Comparison of the prediction performance of the model provided in this application with other models.
[0080] As shown in Table 1, the model provided in this application is significantly better than the comparison model. The root mean square error (RMSE) is 0.1670, which is about 22% lower than the basic LSTM (0.2154); the mean absolute error (MAE) is 0.0373, which is significantly lower than LSTM's 0.1030.
[0081] Therefore, by simultaneously considering the population flow data, urban dynamic characteristics, and urban dynamic characteristics of the surrounding areas for each OD pair, the embodiment of this application enables the model to dynamically adjust the prediction results using real-time urban dynamic characteristics (such as meteorological and nighttime light data). The embodiment of this application introduces a time encoding vector through cross-attention to consider the impact of holiday periods on population flow data. Through the synergy of dynamic features and cross-attention mechanisms, the embodiment of this application can more effectively capture the fluctuation characteristics of time series (especially between weekdays and holidays), significantly improving the prediction accuracy of the model during holidays such as Spring Festival and National Day.
[0082] The following are apparatus embodiments of this application, which can be used to execute the method embodiments of this application. For details not disclosed in the apparatus embodiments of this application, please refer to the method embodiments of this application.
[0083] Please see below. Figure 3 The image shows a schematic diagram of an intercity population flow prediction device based on a dynamic time-series radiation model, provided as an exemplary embodiment of this application. The device includes: The data processing module is used to construct OD pairs of population flow directions from start to finish, taking each city in the target area as the start point and another city as the end point. For each OD pair, the data processing module is also used to determine the distance between the starting point and each other city in the target area, identify cities whose distance is less than the distance between the starting point and the ending point as surrounding cities, and determine the set of surrounding cities as the surrounding area; The data processing module is also used to extract the intercity population flow volume of the OD pair at each time step in the historical period, and construct the intercity population flow volume feature vector. The data processing module is also used to extract the urban dynamic features of the OD pair and the surrounding area of the OD pair at each time step in the historical period, and construct the urban dynamic feature vector. The population flow prediction module is used to input the time-encoded vector constructed based on historical periods, the intercity population flow feature vector, and the urban dynamic feature vector into the trained population flow prediction model. The population flow prediction module is also used to process the population flow prediction model to obtain the predicted population flow value for each OD pair at the prediction time step.
[0084] It should be noted that the apparatus provided in the above embodiments, when executing the intercity population flow prediction method based on a dynamic time-series radiation model, is only illustrated by the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. Furthermore, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and their implementation process is detailed in the method embodiments, which will not be repeated here.
[0085] This application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of any of the methods described above.
[0086] Please see Figure 4 This is a structural block diagram of an electronic device provided in an embodiment of this application.
[0087] like Figure 4 As shown, the electronic device includes a processor and a memory.
[0088] In this embodiment, the processor is the control center of the computer system, and can be a processor of a physical machine or a processor of a virtual machine. The processor may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor can be implemented using at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), or PLA (Programmable Logic Array).
[0089] A processor can also include a main processor and a coprocessor. The main processor is used to process data in the wake-up state and is also called the CPU (Central Processing Unit). The coprocessor is a low-power processor used to process data in the standby state.
[0090] The memory may include one or more computer-readable storage media, which may be non-transitory. The memory may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments of this application, the non-transitory computer-readable storage media in the memory are used to store at least one instruction, which is executed by a processor to implement the methods in the embodiments of this application.
[0091] In some embodiments, the electronic device further includes a peripheral device interface and at least one peripheral device. The processor, memory, and peripheral device interface are connected via a bus or signal line. Each peripheral device is connected to the peripheral device interface via a bus, signal line, or circuit board. Specifically, the peripheral device includes: a display screen, a camera, and audio circuitry. The peripheral device interface can be used to connect at least one I / O (Input / Output) related peripheral device to the processor and memory.
[0092] In some embodiments of this application, the processor, memory, and peripheral device interfaces are integrated on the same chip or circuit board; in other embodiments of this application, any one or two of the processor, memory, and peripheral device interfaces can be implemented on separate chips or circuit boards. This application does not specifically limit the implementation in this regard.
[0093] The electronic device structural block diagrams shown in the embodiments of this application do not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or use different component arrangements.
[0094] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the methods in any of the foregoing embodiments. The computer-readable storage medium may include, but is not limited to, any type of disk, including floppy disks, optical disks, DVDs, CD-ROMs, microdrives, as well as magneto-optical disks, ROMs, RAMs, EPROMs, EEPROMs, DRAMs, VRAMs, flash memory devices, magnetic cards or optical cards, nanosystems (including molecular memory ICs), or any type of medium or device suitable for storing instructions and / or data.
[0095] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the parts that contribute to the related technology, can be embodied in the form of software products. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0096] Finally, it should be noted that the above 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.
Claims
1. A method for predicting intercity population flow based on a dynamic time-series radiation model, characterized in that, include: For each city in the target area, take it as the starting point and another city as the ending point, and construct OD pairs for the population flow direction from the starting point to the ending point; For each OD pair, determine the distance between the starting point and each other city in the target area, identify cities whose distance is less than the distance between the starting point and the ending point as surrounding cities, and define the set of surrounding cities as the surrounding area; Extract the intercity population flow volume of the OD pair at each time step in the historical period to construct the intercity population flow feature vector. The urban dynamic features of the OD pair and its surrounding area at each time step in the historical period are extracted to construct the urban dynamic feature vector. The time-encoding vector constructed based on historical periods, the intercity population flow feature vector, and the urban dynamic feature vector are input into the trained population flow prediction model. The population flow prediction model is used to obtain the predicted population flow for each OD pair at the prediction time step.
2. The intercity population flow prediction method based on a dynamic time-series radiation model according to claim 1, characterized in that, The process of extracting urban dynamic features of OD pairs and their surrounding areas at each time step within a historical period to construct an urban dynamic feature vector includes: Extract the urban dynamic features of the origin and end points of OD pairs at each time step within the historical period; By splicing together the urban dynamic features of the starting point at each time step and the urban dynamic features of the ending point at each time step, an OD pair of urban dynamic feature vectors is constructed. Extract the urban dynamic features of each surrounding city within the surrounding area of the OD pair at each time step in the historical period; Aggregate the dynamic features of all surrounding cities with the same feature type within the same time step to obtain aggregated features. Construct aggregated feature vectors based on the aggregated features of each feature type within the same time step. Concatenate the aggregated feature vectors of each time step to construct the dynamic feature vector of surrounding cities. The urban dynamic feature vector includes the OD pair urban dynamic feature vector and the surrounding area urban dynamic feature vector.
3. The method for predicting intercity population flow based on a dynamic time-series radiation model according to claim 1, characterized in that, The construction process of the time-coded vector includes: Based on the preset mapping relationship between the type of time step and the numerical code, each time step in the historical period is mapped to the corresponding numerical code. The time-coded vector is constructed by arranging the numerical codes obtained by mapping according to the time step order.
4. The intercity population flow prediction method based on a dynamic time-series radiation model according to claim 2, characterized in that, The population flow prediction model includes an input layer, a feature extraction layer, a self-attention layer, a cross-attention layer, a fully connected layer, a random deactivation layer, a global average pooling layer, and a prediction layer. The calculation process of the population flow prediction model includes the following steps: The input layer obtains three types of feature vectors and the time-encoded vector; wherein, the three types of feature vectors include the OD pair urban dynamic feature vector, the surrounding area urban dynamic feature vector, and the intercity population flow feature vector. The three types of feature vectors are respectively input into the feature extraction layer, and the long short-term memory network in the feature extraction layer processes each type of feature vector to extract the corresponding type of temporal features. Each type of temporal feature is input into the self-attention layer, and attention features of each type are obtained based on self-attention weighting. Attention features of each type are concatenated along the feature dimension to obtain an attention feature matrix. The attention feature matrix and the query matrix obtained by processing the time encoding vector are input into the cross-attention layer to obtain the cross-attention fusion feature; The concatenated temporal features obtained by concatenating temporal features based on each type are added element-wise to the cross-attention fusion features to obtain the fusion feature vector; The fused feature vector is input into the fully connected layer, and then processed sequentially through the fully connected layer, the random deactivation layer, and the global average pooling layer to obtain the target feature vector. The target feature vector is input into the prediction layer, and the process yields the predicted population flow value for each OD pair at the prediction time step.
5. The intercity population flow prediction method based on a dynamic time-series radiation model according to claim 4, characterized in that, The step of inputting the attention feature matrix and the query matrix obtained by processing the time encoding vector into the cross-attention layer to obtain cross-attention fusion features includes: After embedding and projection processing based on the time-encoded vector, a query matrix is generated, and a key matrix and a value matrix are obtained by processing based on the attention feature matrix. The attention weight matrix is calculated based on the query matrix and the key matrix. The value matrix is then weighted and summed based on the attention weight matrix to obtain the cross-attention fusion feature.
6. The method for predicting intercity population flow based on a dynamic time-series radiation model according to claim 1, characterized in that, The training process of the population flow prediction model includes the following steps: For each city in the sample area, take it as the starting point and another city as the ending point, and construct sample OD pairs of population flow directions from the starting point to the ending point; Obtain the intercity population flow of each sample OD pair within the sample area at each time step during the sample period, and obtain the urban dynamic characteristics of the sample OD pair and its surrounding area at each time step during the sample period. The sample set is constructed by taking the intercity population flow and urban dynamic characteristics of multiple consecutive time steps as sample inputs and taking the intercity population flow of the next adjacent time step as the corresponding sample label. Input the sample set into the population flow prediction model to be trained, and obtain the prediction results generated by the population flow prediction model based on the sample input; A loss function is constructed based on the prediction results and the corresponding sample labels. Backpropagation is then performed based on the value of the loss function to adjust the model parameters of the population flow prediction model. Output the model parameters of the converged population flow prediction model to obtain the trained population flow prediction model.
7. The intercity population flow prediction method based on a dynamic time-series radiation model according to claim 6, characterized in that, The formula for the loss function is expressed as follows: ; in, Represents the loss function. This is the mean square error term. Indicates sample label, Indicates the prediction result. Indicates a non-negative penalty term. This represents the penalty coefficient.
8. A device for predicting intercity population flow based on a dynamic time-series radiation model, characterized in that, include: The data processing module is used to construct OD pairs of population flow directions from start to finish, taking each city in the target area as the start point and another city as the end point. For each OD pair, the data processing module is also used to determine the distance between the starting point and each other city in the target area, identify cities whose distance is less than the distance between the starting point and the ending point as surrounding cities, and determine the set of surrounding cities as the surrounding area; The data processing module is also used to extract the intercity population flow volume of the OD pair at each time step in the historical period, and construct the intercity population flow volume feature vector. The data processing module is also used to extract the urban dynamic features of the OD pair and the surrounding area of the OD pair at each time step in the historical period, and construct the urban dynamic feature vector. The population flow prediction module is used to input the time-encoded vector constructed based on historical periods, the intercity population flow feature vector, and the urban dynamic feature vector into the trained population flow prediction model. The population flow prediction module is also used to process the population flow prediction model to obtain the predicted population flow value for each OD pair at the prediction time step.
9. 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, it implements the steps of the method as described in any one of claims 1 to 7.
10. 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, it implements the steps of the method as described in any one of claims 1 to 7.