Station traffic prediction method and device, equipment, storage medium and program product
By acquiring and utilizing the dynamic and aggregating features of the site, combined with a multi-layer perception network, the problem of low accuracy in OD traffic prediction in the prior art is solved, and more accurate inter-site traffic prediction is achieved.
Patent Information
- Application Number
- CN202411080867.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-07
- Publication Date
- 2024-12-03
AI Technical Summary
The existing OD traffic prediction methods have low accuracy and cannot effectively capture the traffic characteristics and associations between sites.
By obtaining the dynamic and aggregation characteristics of the site, the dynamic features reflect the current and historical traffic states, the aggregation characteristics reflect the association relationship between the sites and the shared traffic state, and traffic prediction is performed in combination with a multi-layer perception network.
It improves the accuracy of traffic forecasts between sites, fully considers the direct and indirect relationships between sites, and enhances the reliability of predictions.
Smart Images

Figure CN119067467A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of traffic engineering technology, and in particular, relates to a method, device, equipment, storage medium and program product for predicting site traffic. Background Art
[0002] The OD (Origin-Destination) traffic forecasting task is to predict the OD data of the subsequent period under the given historical OD data (and corresponding environmental information). By predicting and analyzing the OD data of different regions, we can explore the regional pattern of population flow and regional travel characteristics, thereby providing decision support for transportation planning, urban construction, population management and a series of other tasks.
[0003] In the prior art, the OD traffic prediction method is as follows: the OD traffic prediction task is to first process the OD traffic within the observation time into an OD matrix with equal time intervals, and each item (i, j) of the matrix represents the traffic from station i to station j within the time period; then, a sparse spatiotemporal residual neural network model based on OD is constructed, and a convolutional neural network is used to extract features from the constructed multi-step OD matrix in both time and space dimensions, and finally, the extracted features are output through a nonlinear prediction model to obtain the OD prediction result. However, the accuracy of this prediction method is low. Summary of the invention
[0004] The embodiments of the present application provide a site traffic prediction method, apparatus, device, storage medium, and program product, which can solve the problem of low accuracy of existing traffic prediction tasks.
[0005] In a first aspect, an embodiment of the present application provides a method for predicting site traffic, the method comprising:
[0006] Obtain a first dynamic feature and a first aggregate feature of a first site, and a second dynamic feature and a second aggregate feature of a second site, wherein the first dynamic feature is used to characterize an actual flow state of the first site before and at a current moment, the first aggregate feature is used to characterize an association relationship and a shared flow state between the first site and other sites in the subway station, the second dynamic feature is used to characterize an actual flow state of the second site before and at a current moment, the second aggregate feature is used to characterize an association relationship and a shared flow state between the second site and other sites in the subway station, and the first site and the second site both belong to the subway station;
[0007] A first flow between the first site and the second site is predicted according to the first dynamic feature, the first aggregate feature, the second dynamic feature, and the second aggregate feature.
[0008] In some embodiments, obtaining a first dynamic feature of the first site includes:
[0009] Acquire user travel data associated with the first site;
[0010] The first dynamic feature is converted into the first dynamic feature according to the user travel data.
[0011] In some embodiments, after converting the user travel data into the first dynamic feature, the method further includes:
[0012] When first travel data is obtained, the first dynamic feature and the third dynamic feature are concatenated to obtain a message vector corresponding to the first travel data, wherein the first travel data is data of a single trip of a user between a first station and a third station, and the third dynamic feature is used to characterize an actual traffic state of the third station at and before the current time.
[0013] Acquire a second time at which the first travel data occurs, and a third time at which the second travel data occurs, wherein the second travel data is data of a single trip of the user between the first station and the third station last time the first travel data occurs;
[0014] The first dynamic feature is updated according to the second time, the third time and the message vector.
[0015] In some embodiments, obtaining a first aggregate feature of the first site includes:
[0016] Performing hierarchical clustering on all the stations in the subway station to obtain multiple layers of virtual stations and virtual features of each virtual station, wherein each layer includes at least one virtual station, and in the multiple layers of virtual stations, the virtual stations of the upper layer are the clustering centers of the virtual stations of the lower layer, and the virtual stations of the lowest layer are the clustering centers of the real stations;
[0017] Obtaining a first association weight between any two adjacent virtual sites in the multi-layer virtual site, and a second association weight between the virtual site at the bottom layer in the multi-layer virtual site and the first site;
[0018] The first aggregate feature is determined according to the virtual feature of each of the virtual sites, the first association weight, and the second association weight.
[0019] In some embodiments, determining the first aggregate feature according to the virtual features of each of the virtual sites, the first association weight, and the second association weight includes:
[0020] For a virtual site in a first level of the multi-layer virtual site, determine the virtual characteristics of the virtual site as the aggregate characteristics of the virtual site, the first level being the topmost level of the multi-layer virtual site;
[0021] For the virtual sites in the second level of the multi-layer virtual sites, determining the aggregation characteristics of the virtual sites in the second level according to the first association relationship between the second level and the virtual sites in the level above the second level, and the aggregation characteristics of the virtual sites in the level above the second level;
[0022] The first aggregate feature is determined according to a second association weight between the first site and a virtual site in a bottommost layer of the multi-layer virtual sites, and aggregate features of the virtual sites in the bottommost layer.
[0023] In some embodiments, after performing hierarchical clustering on all the stations in the subway station to obtain multiple layers of virtual stations and virtual features of each of the virtual stations, the method further includes:
[0024] When a dynamic feature of a real station in the subway station changes, acquiring the changed third dynamic feature;
[0025] The virtual characteristics of each virtual site are updated layer by layer according to the third dynamic characteristic, the first association weight, and the second association weight.
[0026] In some embodiments, predicting the first traffic between the first site and the second site according to the first dynamic feature, the first aggregate feature, the second dynamic feature, and the second aggregate feature includes:
[0027] Concatenate the first dynamic feature and the first aggregate feature to obtain a first concatenated feature;
[0028] Concatenate the second dynamic feature and the second aggregate feature to obtain a second concatenated feature;
[0029] The first splicing feature and the second splicing feature are input into a pre-trained prediction model to obtain the first flow.
[0030] In a second aspect, an embodiment of the present application provides a device for predicting site traffic, the device comprising:
[0031] an acquisition module, configured to acquire a first dynamic feature and a first aggregate feature of a first site, and a second dynamic feature and a second aggregate feature of a second site, wherein the first dynamic feature is used to characterize an actual flow state of the first site at and before the current moment, the first aggregate feature is used to characterize an association relationship and a shared flow state between the first site and other sites in the subway station, the second dynamic feature is used to characterize an actual flow state of the second site at and before the current moment, the second aggregate feature is used to characterize an association relationship and a shared flow state between the second site and other sites in the subway station, and the first site and the second site both belong to the subway station;
[0032] A prediction module is used to predict the first traffic between the first site and the second site based on the first dynamic feature, the first aggregate feature, the second dynamic feature and the second aggregate feature.
[0033] In a third aspect, an embodiment of the present application provides a site traffic prediction device, the device comprising: a processor and a memory storing computer program instructions;
[0034] When the processor executes the computer program instructions, the above site traffic prediction method is implemented.
[0035] In a fourth aspect, an embodiment of the present application provides a computer storage medium having computer program instructions stored thereon, and when the computer program instructions are executed by a processor, the above-mentioned site traffic prediction method is implemented.
[0036] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes computer program instructions, and when the computer program instructions are executed by a processor, the above-mentioned site traffic prediction method is implemented.
[0037] In this application, since the dynamic features can reflect the actual traffic status of the site at the current time and before, and capture the immediate and historical travel behavior, and the aggregate features can reflect the association and shared traffic status of the first site, the second site and other sites. Therefore, based on the dynamic features and aggregate features of the two sites whose traffic needs to be predicted, the traffic between any sites can be predicted at any time, and the direct and indirect associations between the sites can be fully considered, thereby improving the accuracy of the prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0039] Figure 1 It is a flowchart of a method for predicting site traffic provided by an embodiment of the present application;
[0040] Figure 2 It is a structural schematic diagram of a site traffic prediction device provided in an embodiment of the present application;
[0041] Figure 3 It is a schematic diagram of the hardware structure of a site traffic prediction device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0042] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.
[0043] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0044] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The embodiments will be described in detail below in conjunction with the accompanying drawings.
[0045] Specifically, in order to solve the problems of the prior art, the embodiments of the present application provide a method, device, equipment, storage medium and program product for predicting site traffic. The following first introduces the method for predicting site traffic provided by the embodiments of the present application.
[0046] Figure 1 A flow chart of a method for predicting site traffic provided by an embodiment of the present application is shown. The method comprises the following steps:
[0047] S110, obtaining a first dynamic feature and a first aggregate feature of a first site, and a second dynamic feature and a second aggregate feature of a second site, wherein the first dynamic feature is used to characterize an actual flow state of the first site before and at the current moment, and the first aggregate feature is used to characterize an association relationship and a shared flow state between the first site and other sites in the subway station, and the second dynamic feature is used to characterize an actual flow state of the second site before and at the current moment, and the second aggregate feature is used to characterize an association relationship and a shared flow state between the second site and other sites in the subway station, and the first site and the second site both belong to the subway station.
[0048] In this embodiment, the subway station includes multiple stations, including the first station and the second station. A dynamic feature can be initialized for each station in the subway station at the current moment. The dynamic feature is constructed based on the OD (Origin-Destination) data before the current moment, and this dynamic feature will change with the addition of OD data. OD data is the data of OD behavior, and OD behavior refers to a trip from one station (Origin) to another station (Destination).
[0049] For example, the OD behavior can be modeled and V = {v1, v2, ..., v n} is the set of n stations in the subway station, is an OD travel behavior, indicating that a passenger m Time from Departure from the site If the stations are regarded as nodes and OD travel behaviors as edges, then all OD travel behaviors constitute a graph structure G that evolves continuously over time. t =(V, E). represents all travel behaviors before time t. The OD prediction task is to t , the OD flow between any stations within the future time t-t+τ can be predicted based on the OD data E of all travel behaviors before time t.
[0050] Taking the first site as an example, as an optional embodiment, obtaining the first dynamic feature of the first site includes:
[0051] Acquire user travel data associated with the first site;
[0052] The first dynamic feature is converted into the first dynamic feature according to the user travel data.
[0053] In this embodiment, the user travel data associated with the first station is the OD data with the first station as the end point or the starting point. The user travel data associated with the first station can be screened out from all travel behaviors before the current moment, and then the user travel data is vectorized to obtain the first dynamic feature.
[0054] Among them, the first site can be set as v i , v i Initial two dynamic vectors and Regulation It is the first dynamic feature of the node at the current moment.
[0055] In this way, the user's travel data can be represented as the first dynamic feature in a vectorized manner, which facilitates efficient extraction and processing of features in subsequent processing and analysis.
[0056] In addition, as an optional embodiment, after converting the user travel data into the first dynamic feature, the method further includes:
[0057] When first travel data is obtained, the first dynamic feature and the third dynamic feature are concatenated to obtain a message vector corresponding to the first travel data, wherein the first travel data is data of a single trip of a user between a first station and a third station, and the third dynamic feature is used to characterize an actual traffic state of the third station at and before the current time.
[0058] Acquire a second time at which the first travel data occurs, and a third time at which the second travel data occurs, wherein the second travel data is data of a single trip last associated with the first station and the first travel data;
[0059] The first dynamic feature is updated according to the second time, the third time and the message vector.
[0060] In this embodiment, the first dynamic feature converted from the user travel data can be used as the initialized dynamic feature. After obtaining the initialized first dynamic feature, the first dynamic feature can be updated based on the first travel data every time a new first travel data associated with the first site is obtained.
[0061] Specifically, after receiving a new first travel data, the first dynamic feature of the first site involved in the first travel data and the third dynamic feature of the third site are obtained, and then the second moment when the first travel data occurs and the third moment when the second travel data occurs can be obtained. The first dynamic feature is updated according to the second moment, the third moment and the message vector spliced by the first dynamic feature and the third dynamic feature.
[0062] For example, at t k The first trip data (v i , v j , t k ) then the third dynamic feature r of the third site j can be j - and the static characteristic F of the third site j j Splice and get the message vector corresponding to the third site
[0063] Then, the time difference t1 between the third moment and the second moment can be calculated as the time difference corresponding to the first site, and the time difference t2 corresponding to the third site can be obtained by the same calculation method. t1 and t2 can be sent to the exponential decay function exp(λt) to obtain the time decay coefficients exp(λt1), exp(λt2), and the time decay coefficients are multiplied by the first travel data to obtain the message vectors after time-weighted transformation of each of the two sites.
[0064] Specifically, we perform time-weighted aggregation on multiple OD interaction behaviors at the same time to obtain the update message of the travel node and The specific process is as follows
[0065]
[0066] Here λ is a hyperparameter set artificially, (v i ,v j ,t k ) represents an OD travel behavior, and is the message vector after the site weighted transformation, which is used to update the site representation later, and t represents the current time.
[0067] Then, the message vector and the initial first dynamic feature can be input into a preset multi-layer perception network, that is, the updated first dynamic feature and the updated third dynamic feature can be obtained.
[0068] Specifically, it can be expressed as the following formula
[0069]
[0070] in and is the message vector after site weighted transformation, λ is a hyperparameter set artificially, represents the first dynamic feature of the first site before updating, and represents the first dynamic feature of the first site after update, W1 is the parameter of the multilayer perceptron, and σ(·) is the sigmoid activation function.
[0071] In this way, the dynamic characteristics of the station can be updated by calculating the time difference and time decay coefficient, performing weighted summation on the new travel data. This method can dynamically reflect the characteristic changes of the station at different time points and ensure the accuracy of traffic prediction.
[0072] In addition, the aggregation features corresponding to the sites reflect the comprehensive features of multiple real sites, which include the shared features and overall spatiotemporal characteristics between multiple sites, and take into account the spatial correlation. Specifically, it is necessary to first perform hierarchical clustering of the sites based on the dynamic features of each real site to obtain multiple virtual sites, and then obtain the aggregation features of the real sites based on the aggregation features of the multi-layer virtual sites.
[0073] Taking the first site as an example, as an optional embodiment, obtaining the first aggregated feature of the first site includes:
[0074] Performing hierarchical clustering on all the stations in the subway station to obtain multiple layers of virtual stations and virtual features of each virtual station, wherein each layer includes at least one virtual station, and in the multiple layers of virtual stations, the virtual stations of the upper layer are the clustering centers of the virtual stations of the lower layer, and the virtual stations of the lowest layer are the clustering centers of the real stations;
[0075] Obtaining a first association weight between any two adjacent virtual sites in the multi-layer virtual site, and a second association weight between the virtual site at the bottom layer in the multi-layer virtual site and the first site;
[0076] The first aggregate feature is determined according to the virtual feature of each of the virtual sites, the first association weight, and the second association weight.
[0077] In this embodiment, based on the dynamic characteristics of real stations in the subway station, the stations can be hierarchically clustered to obtain multi-layer virtual stations.
[0078] A pyramid-shaped multi-level virtual station representation can be set from bottom to top, with the number of stations decreasing layer by layer. The virtual stations of the upper level represent the cluster centers of the virtual stations of the lower level, and the virtual stations of the lowest level represent the cluster centers of the real stations in the subway station. The virtual features of the virtual stations are used to extract the dynamic features of the real stations.
[0079] For example, two types of virtual sites can be set up: site cluster sites and regional sites. Site cluster sites can be understood as complex sites composed of a combination of real sites, and regional sites can be understood as complex sites composed of a combination of site cluster sites. and regional sites Initialize a vectorized representation respectively And stipulate It is a vector representation of two types of sites. Optionally, by setting different hierarchical structures K, a site structure with more levels is set, including:
[0080] Then select the spatial level K and the number of sites num in each level k , construct ∑num k virtual sites, and for each virtual site Initialize a vectorized representation That is, the virtual characteristics corresponding to the site, and stipulates It represents its virtual representation at time t. The virtual site of the kth layer can be understood as a complex site composed of the sites of the k-1th layer, where the n sites in (1) are regarded as the bottom-level sites.
[0081] After activating multiple levels of virtual sites and obtaining the virtual characteristics of each virtual site, we can further determine the first association weights between the virtual sites in adjacent levels in the multi-layer virtual site, as well as the second association weights between the virtual sites in the bottom level of the multi-layer virtual site and the real sites, where the real sites include the first site. Finally, we can determine the first aggregation feature based on the virtual characteristics of each virtual site, the first association weight and the second association weight.
[0082] In this way, by hierarchically clustering all the real stations in the subway station, generating multiple layers of virtual stations and their features, and calculating the association weights between each level, the spatial association relationship between real stations can be effectively captured, providing a more comprehensive and rich feature representation.
[0083] As an optional embodiment, determining the first aggregate feature according to the virtual features of each virtual site, the first association weight, and the second association weight includes:
[0084] For a virtual site in a first level of the multi-layer virtual site, determine the virtual characteristics of the virtual site as the aggregate characteristics of the virtual site, the first level being the topmost level of the multi-layer virtual site;
[0085] For the virtual sites in the second level of the multi-layer virtual sites, determining the aggregation characteristics of the virtual sites in the second level according to the first association relationship between the second level and the virtual sites in the level above the second level, and the aggregation characteristics of the virtual sites in the level above the second level;
[0086] The first aggregate feature is determined according to a second association weight between the first site and a virtual site in a bottommost layer of the multi-layer virtual sites, and aggregate features of the virtual sites in the bottommost layer.
[0087] In this embodiment, when the virtual characteristics of each virtual site itself, as well as the first association weight and the second association weight are known, the virtual characteristics of the virtual site at the top level in the virtual site can be directly determined as its corresponding aggregate characteristics, and then starting from the second level virtual site, from top to bottom, each virtual site performs weighted summation of the aggregate representations of the virtual sites at the upper level by the second association weight to obtain its own aggregate representation. After obtaining the aggregate representation of the virtual site at the bottom level, the first site performs weighted summation of the aggregate representations of the virtual sites at the bottom level according to the second association weight between the first site and the virtual site at the bottom level to obtain the aggregate representation of the first site.
[0088] Specifically, we first generate the real site v through the following mechanism i Site cluster characterization
[0089]
[0090] in represents the association matrix weight between the generated sites and site clusters, represents the association strength between the hth node cluster node and the jth generated site, Represents the aggregate representation of the resulting site clusters.
[0091] Similarly, we generate the regional representation of the site according to the above top-down message passing method.
[0092]
[0093] in represents the association weight matrix between the generated site clusters and regional sites, Represents the aggregate representation of the generated regional sites.
[0094] This process calculates the aggregate representation of the site step by step from the top layer to the bottom layer by weighted summation, and finally obtains an aggregate representation that accurately reflects the comprehensive characteristics of virtual nodes at different levels. This method can effectively integrate information at different levels and improve the accuracy of OD traffic prediction.
[0095] As an optional embodiment, after performing hierarchical clustering on all the stations in the subway station to obtain multiple layers of virtual stations and virtual features of each of the virtual stations, the method further includes:
[0096] When a dynamic feature of a real station in the subway station changes, acquiring the changed third dynamic feature;
[0097] The virtual characteristics of each virtual site are updated layer by layer according to the third dynamic characteristic, the first association weight, and the second association weight.
[0098] In this embodiment, whenever the first travel data associated with the first site is detected, the first dynamic feature corresponding to the first site is updated based on the first travel data. After the dynamic feature of the real site is updated, the virtual features of the multiple layers of virtual sites also need to be updated accordingly.
[0099] First, the attention mechanism can be used to obtain the first association weights between all two adjacent virtual site representations. Taking any two adjacent virtual sites as an example, if there are n virtual sites in the upper layer and m virtual sites in the lower layer, the first association weights corresponding to the two virtual sites can be an n*m matrix, and the i-th row and j-th column of the matrix represent the strength of the lower virtual site j belonging to the upper virtual site i. For the virtual site representation of the lowest layer, the attention mechanism is used to obtain the first association weights between the real site with updated dynamic features and each virtual site in the lowest layer.
[0100] Assuming that there are n virtual sites at the bottom layer and m real sites with updated dynamic representations, the association weight is an n*m matrix, where the i-th row and j-th column represent the strength value of the real site j belonging to the virtual site i.
[0101] Specifically, we first use the multi-head attention mechanism to obtain the association weight matrix between sites and site clusters in The i-th row and j-th column in the i Belong to site The strength is calculated as follows:
[0102]
[0103] Here is the learnable parameter matrix, H is the number of attention heads, is a matrix consisting of the representations of all sites before the current time, For all site cluster sites, N C The number of sites in the site cluster.
[0104] From bottom to top, each virtual site performs weighted summation of the message vectors of the sites at the lower level by associating weights to obtain the message vectors of each virtual site. The lowest virtual site aggregates the message vectors of the real sites, which are obtained by the previous step S1.3.
[0105] Specifically, we use the following information dissemination mechanism to obtain site update messages:
[0106]
[0107] in is a trainable parameter, || is a concatenation operation, exp() is an exponential function, A c is the association weight matrix between sites and site clusters, and the subscripts represent the matrix index. A message vector representing a site in a site cluster.
[0108] Similarly, we update regional site news based on site cluster news.
[0109]
[0110]
[0111] in is a trainable parameter matrix, || is a concatenation operation, exp() is an exponential function, A g is the association weight matrix between site clusters and regional sites, and the subscripts represent the index.
[0112] To update the representation of all virtual sites, first calculate the time difference t3 between the current time and the last update time of the virtual site to be updated, then send it to the exponential decay function exp(λt) to get the time decay coefficient exp(λt3), multiply this coefficient by the obtained message vector to get the message vector after time weighted transformation. Then send the time weighted message vector and the virtual site representation to the multilayer perceptron network to get the updated virtual site representation.
[0113] In this way, whenever the dynamic characteristics of the real site change, the virtual characteristics of the virtual site will be updated in real time.
[0114] S120: Predict a first flow between the first site and the second site according to the first dynamic feature, the first aggregate feature, the second dynamic feature, and the second aggregate feature.
[0115] In this embodiment, after obtaining the first dynamic feature and the first aggregation feature of the first site, and the second dynamic feature and the second aggregation feature of the second site, the first traffic between the first site and the second site in a future period of time can be predicted based on the first dynamic feature, the first aggregation feature, the second dynamic feature and the second aggregation feature.
[0116] Since dynamic features can reflect the actual traffic status of the site at the current moment and before, and capture instant and historical travel behaviors, and aggregate features can reflect the association and shared traffic status of the first site, the second site, and other sites, based on the dynamic features and aggregate features of the two sites whose traffic needs to be predicted, the traffic between any sites can be predicted at any time, and the direct and indirect associations between sites can be fully considered, thereby improving the accuracy of the prediction.
[0117] As an optional embodiment, predicting the first traffic between the first site and the second site according to the first dynamic feature, the first aggregate feature, the second dynamic feature, and the second aggregate feature includes:
[0118] Concatenate the first dynamic feature and the first aggregate feature to obtain a first concatenated feature;
[0119] Concatenate the second dynamic feature and the second aggregate feature to obtain a second concatenated feature;
[0120] The first splicing feature and the second splicing feature are input into a pre-trained prediction model to obtain the first flow.
[0121] In this embodiment, taking u as the first station and v as the second station as an example, the aggregated features and dynamic features of the u and v stations can be spliced to obtain the first spliced features and second spliced features for prediction. Then, the first spliced features and second spliced features for prediction of the u and v stations are sent to the multi-layer perceptron network to obtain the first flow between the two stations in the future. It should be noted that the duration of the predicted first flow of the subway in the future needs to be pre-defined by the model user. If it is necessary to support predictions of different durations, the duration can also be used as input and sent to the multi-layer perceptron to achieve predictions of different durations.
[0122] Based on the site traffic prediction method provided in the above embodiment, the present application also provides a specific implementation of the site traffic prediction device. Please refer to the following embodiment.
[0123] See first Figure 2 The site traffic prediction device 200 provided in the embodiment of the present application includes the following modules:
[0124] An acquisition module 201 is used to acquire a first dynamic feature and a first aggregate feature of a first site, and a second dynamic feature and a second aggregate feature of a second site, wherein the first dynamic feature is used to characterize an actual flow state of the first site before and at a current moment, the first aggregate feature is used to characterize an association relationship and a shared flow state between the first site and other sites in the subway station, the second dynamic feature is used to characterize an actual flow state of the second site before and at a current moment, the second aggregate feature is used to characterize an association relationship and a shared flow state between the second site and other sites in the subway station, and the first site and the second site both belong to the subway station;
[0125] The prediction module 202 is used to predict the first traffic between the first site and the second site according to the first dynamic feature, the first aggregate feature, the second dynamic feature and the second aggregate feature.
[0126] The device can obtain the first dynamic feature and the first aggregate feature of the first site, and the second dynamic feature and the second aggregate feature of the second site, wherein the first dynamic feature is used to characterize the actual flow state of the first site before and at the current moment, the first aggregate feature is used to characterize the association relationship and shared flow state between the first site and other sites in the subway station, the second dynamic feature is used to characterize the actual flow state of the second site before and at the current moment, the second aggregate feature is used to characterize the association relationship and shared flow state between the second site and other sites in the subway station, and the first site and the second site both belong to the subway station; predict the first flow between the first site and the second site according to the first dynamic feature, the first aggregate feature, the second dynamic feature and the second aggregate feature. Since the dynamic feature can reflect the actual flow state of the site before and at the current moment, and capture the instant and historical travel behavior, and the aggregate feature can reflect the association relationship and shared flow state between the first site, the second site and other sites. Therefore, based on the dynamic features and aggregate features of the two sites whose flow needs to be predicted, the flow between any sites can be predicted at any time, and the direct and indirect association relationship between the sites can be fully considered, thereby improving the accuracy of the prediction.
[0127] As an implementation of the present application, the acquisition module 201 may also be used to:
[0128] Acquire user travel data associated with the first site;
[0129] The first dynamic feature is converted into the first dynamic feature according to the user travel data.
[0130] As an implementation of the present application, the above-mentioned site traffic prediction device 200 can also be used for:
[0131] When first travel data is obtained, the first dynamic feature and the third dynamic feature are concatenated to obtain a message vector corresponding to the first travel data, wherein the first travel data is data of a single trip of a user between a first station and a third station, and the third dynamic feature is used to characterize an actual traffic state of the third station at and before the current time.
[0132] Acquire a second time at which the first travel data occurs, and a third time at which the second travel data occurs, wherein the second travel data is data of a single trip of the user between the first station and the third station last time the first travel data occurs;
[0133] The first dynamic feature is updated according to the second time, the third time and the message vector.
[0134] As an implementation of the present application, the acquisition module 201 may also be used to:
[0135] Performing hierarchical clustering on all the stations in the subway station to obtain multiple layers of virtual stations and virtual features of each virtual station, wherein each layer includes at least one virtual station, and in the multiple layers of virtual stations, the virtual stations of the upper layer are the clustering centers of the virtual stations of the lower layer, and the virtual stations of the lowest layer are the clustering centers of the real stations;
[0136] Obtaining a first association weight between any two adjacent virtual sites in the multi-layer virtual site, and a second association weight between the virtual site at the bottom layer in the multi-layer virtual site and the first site;
[0137] The first aggregate feature is determined according to the virtual feature of each of the virtual sites, the first association weight, and the second association weight.
[0138] As an implementation of the present application, the acquisition module 201 may also be used to:
[0139] For a virtual site in a first level of the multi-layer virtual site, determine the virtual characteristics of the virtual site as the aggregate characteristics of the virtual site, the first level being the topmost level of the multi-layer virtual site;
[0140] For the virtual sites in the second level of the multi-layer virtual sites, determining the aggregation characteristics of the virtual sites in the second level according to the first association relationship between the second level and the virtual sites in the level above the second level, and the aggregation characteristics of the virtual sites in the level above the second level;
[0141] The first aggregate feature is determined according to a second association weight between the first site and a virtual site in a bottommost layer of the multi-layer virtual sites, and aggregate features of the virtual sites in the bottommost layer.
[0142] As an implementation of the present application, the above-mentioned site traffic prediction device 200 can also be used for:
[0143] When a dynamic feature of a real station in the subway station changes, acquiring the changed third dynamic feature;
[0144] The virtual characteristics of each virtual site are updated layer by layer according to the third dynamic characteristic, the first association weight, and the second association weight.
[0145] As an implementation of the present application, the prediction module 202 may also be used for:
[0146] Concatenate the first dynamic feature and the first aggregate feature to obtain a first concatenated feature;
[0147] Concatenate the second dynamic feature and the second aggregate feature to obtain a second concatenated feature;
[0148] The first splicing feature and the second splicing feature are input into a pre-trained prediction model to obtain the first flow.
[0149] The site traffic prediction device provided in the embodiment of the present invention can implement each step in the above method embodiment, and will not be described again here to avoid repetition.
[0150] Figure 3 A schematic diagram of the hardware structure of a site traffic prediction device provided in an embodiment of the present application is shown.
[0151] The device for predicting site traffic may include a processor 1001 and a memory 1002 storing computer program instructions.
[0152] Specifically, the processor 1001 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0153] The memory 1002 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 1002 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 1002 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 1002 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 1002 is a non-volatile solid-state memory.
[0154] The memory may include read-only memory (ROM), random access memory (RAM), magnetic disk storage media devices, optical storage media devices, flash memory devices, electrical, optical or other physical / tangible memory storage devices. Thus, typically, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to an aspect of the present disclosure.
[0155] The processor 1001 reads and executes computer program instructions stored in the memory 1002 to implement any one of the site traffic prediction methods in the above embodiments.
[0156] In one example, the site traffic prediction device may further include a communication interface 1003 and a bus 1010. Figure 3 As shown, the processor 1001, the memory 1002, and the communication interface 1003 are connected via a bus 1010 and communicate with each other.
[0157] The communication interface 1003 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0158] Bus 1010 includes hardware, software or both, and the components of the prediction device of site traffic are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front-side bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 1010 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the present application considers any suitable bus or interconnection.
[0159] The site traffic prediction device may be based on the above embodiment, thereby realizing the site traffic prediction method and apparatus combined with the above embodiment.
[0160] In addition, in combination with the site traffic prediction method in the above-mentioned embodiment, the embodiment of the present application may provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by the processor, any one of the site traffic prediction methods in the above-mentioned embodiments is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here. Among them, the above-mentioned computer-readable storage medium may include a non-transitory computer-readable storage medium, such as a read-only memory (Read-Only Memory, referred to as ROM), a random access memory (Random Access Memory, referred to as RAM), a disk or an optical disk, etc., which is not limited here.
[0161] In addition, an embodiment of the present application further provides a computer program product, including computer program instructions, which can implement the steps and corresponding contents of the aforementioned method embodiment when the computer program instructions are executed by a processor.
[0162] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.
[0163] The functional blocks shown in the above block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0164] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.
[0165] Aspects of the present disclosure are described above with reference to the flowchart and / or block diagram of the method, device and computer program product according to the embodiment of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.
[0166] The above are only specific implementation methods of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.
Claims
1. A method for predicting site traffic, characterized in that: The method comprises: Obtain a first dynamic feature and a first aggregate feature of a first site, and a second dynamic feature and a second aggregate feature of a second site, wherein the first dynamic feature is used to characterize an actual flow state of the first site before and at a current moment, the first aggregate feature is used to characterize an association relationship and a shared flow state between the first site and other sites in the subway station, the second dynamic feature is used to characterize an actual flow state of the second site before and at a current moment, the second aggregate feature is used to characterize an association relationship and a shared flow state between the second site and other sites in the subway station, and the first site and the second site both belong to the subway station; A first flow between the first site and the second site is predicted according to the first dynamic feature, the first aggregate feature, the second dynamic feature, and the second aggregate feature.
2. The method for predicting site traffic according to claim 1, characterized in that: The obtaining of the first dynamic feature of the first site includes: Acquire user travel data associated with the first site; The first dynamic feature is converted into the first dynamic feature according to the user travel data.
3. The method for predicting site traffic according to claim 2, characterized in that: After converting the user travel data into the first dynamic feature, the method further includes: When first travel data is obtained, the first dynamic feature and the third dynamic feature are concatenated to obtain a message vector corresponding to the first travel data, wherein the first travel data is data of a single trip of a user between a first station and a third station, and the third dynamic feature is used to characterize an actual traffic state of the third station at and before the current time. Acquire a second time at which the first travel data occurs, and a third time at which the second travel data occurs, wherein the second travel data is data of a single trip of the user between the first station and the third station last time the first travel data occurs; The first dynamic feature is updated according to the second time, the third time and the message vector.
4. The method for predicting site traffic according to claim 1, characterized in that: The obtaining of the first aggregated feature of the first site includes: Performing hierarchical clustering on all the stations in the subway station to obtain multiple layers of virtual stations and virtual features of each virtual station, wherein each layer includes at least one virtual station, and in the multiple layers of virtual stations, the virtual stations of the upper layer are the clustering centers of the virtual stations of the lower layer, and the virtual stations of the lowest layer are the clustering centers of the real stations; Obtaining a first association weight between any two adjacent virtual sites in the multi-layer virtual site, and a second association weight between the virtual site at the bottom layer in the multi-layer virtual site and the first site; The first aggregate feature is determined according to the virtual feature of each of the virtual sites, the first association weight, and the second association weight.
5. The method for predicting site traffic according to claim 4, characterized in that: The determining the first aggregate feature according to the virtual features of each of the virtual sites, the first association weight, and the second association weight includes: For a virtual site in a first level of the multi-layer virtual site, determine the virtual characteristics of the virtual site as the aggregate characteristics of the virtual site, the first level being the topmost level of the multi-layer virtual site; For the virtual sites in the second level of the multi-layer virtual sites, determining the aggregation characteristics of the virtual sites in the second level according to the first association relationship between the second level and the virtual sites in the level above the second level, and the aggregation characteristics of the virtual sites in the level above the second level; The first aggregate feature is determined according to a second association weight between the first site and a virtual site in a bottommost layer of the multi-layer virtual sites, and aggregate features of the virtual sites in the bottommost layer.
6. The method for predicting site traffic according to claim 4, characterized in that: After performing hierarchical clustering on all the stations in the subway station to obtain multiple layers of virtual stations and virtual features of each of the virtual stations, the method further includes: When a dynamic feature of a real station in the subway station changes, acquiring the changed third dynamic feature; The virtual characteristics of each virtual site are updated layer by layer according to the third dynamic characteristic, the first association weight, and the second association weight.
7. The method for predicting site traffic according to claim 1, characterized in that: The predicting the first traffic between the first site and the second site according to the first dynamic feature, the first aggregate feature, the second dynamic feature, and the second aggregate feature includes: Concatenate the first dynamic feature and the first aggregate feature to obtain a first concatenated feature; Concatenate the second dynamic feature and the second aggregate feature to obtain a second concatenated feature; The first splicing feature and the second splicing feature are input into a pre-trained prediction model to obtain the first flow.
8. A site traffic prediction device, characterized in that: The device comprises: an acquisition module, configured to acquire a first dynamic feature and a first aggregate feature of a first site, and a second dynamic feature and a second aggregate feature of a second site, wherein the first dynamic feature is used to characterize an actual flow state of the first site at and before the current moment, the first aggregate feature is used to characterize an association relationship and a shared flow state between the first site and other sites in the subway station, the second dynamic feature is used to characterize an actual flow state of the second site at and before the current moment, the second aggregate feature is used to characterize an association relationship and a shared flow state between the second site and other sites in the subway station, and the first site and the second site both belong to the subway station; A prediction module is used to predict the first traffic between the first site and the second site based on the first dynamic feature, the first aggregate feature, the second dynamic feature and the second aggregate feature.
9. A site traffic prediction device, characterized in that: The site traffic prediction device includes: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the method for predicting site traffic according to any one of claims 1 to 8 is implemented.
10. A computer storage medium, characterized in that: The computer storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the method for predicting site traffic according to any one of claims 1 to 8 is implemented.
11. A computer program product, characterized in that The computer program product comprises computer program instructions, and when the computer program instructions are executed by a processor, the method for predicting site traffic according to any one of claims 1 to 8 is implemented.
