A multi-source traffic data transfer mode estimation method and computer readable medium
By using Euclidean distance and smart card transaction data, the distance and time thresholds for transfer behavior are automatically extracted, which solves the shortcomings of existing models in data consideration and threshold selection, and achieves accurate estimation of transfer patterns, which is applicable to traffic data analysis in different cities.
Patent Information
- Application Number
- CN202310828000.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-06
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2043-07-06
AI Technical Summary
Existing transfer behavior recognition models are lacking in data consideration, threshold selection, and rule construction, resulting in results that do not match reality. Furthermore, the algorithmic thinking is not easily transferable and cannot be widely applied to traffic data in different cities.
By calculating the distance threshold between bus stops and subway stations using Euclidean distance and combining it with transaction data from smart card numbers, the distance and time thresholds for transfer behavior are automatically extracted, and a transfer pattern estimation method is constructed, including filtering Euclidean distance sequences, calculating quartile distance thresholds, and classifying transfer patterns.
It enables the precise extraction of transfer behavior from traffic big data, providing a data foundation for the healthy development and research of urban transportation, and is applicable to migration applications in different cities.
Smart Images

Figure CN116992370B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the field of geographic information science, and particularly relates to a multi-source traffic data transfer mode estimation method and a computer readable medium. BACKGROUND
[0002] With the rapid development of China, the population of first-line and second-line cities is growing, and the types of work are also increasingly diverse, giving birth to a large number of travel modes with rich types, strong differences between species, and strong similarities within species. One of the travel modes that is less studied but objectively exists in large quantities is the long-time and long-distance commuting travel mode. The people in this travel mode often need to transfer between various types of public transportation, and the commuting travel is very time-consuming and labor-intensive. Such people who need to transfer between transportation tools for long-time and long-distance commuting are often not in the minority. As for the extraction of transfer behavior, a small number of scholars at home and abroad have done research on the model of transfer behavior extraction. However, most of the models have more or less shortcomings in data consideration, threshold selection, rule construction, practical significance, and result performance. At the same time, most of the models ignore the most basic feature of big data, which is different from other data, that is, the mass of data itself has strong rules. Most of the previous domestic and foreign models use artificial preset conditions and thresholds to extract transfer behavior, so the results are not very realistic, the algorithm idea is not strong in transferability, and cannot be widely applied.
[0003] Therefore, there is an urgent need for a transfer behavior recognition algorithm that is applicable to all big data, can mine correct thresholds from the data itself, and can be used between different city data. SUMMARY
[0004] To solve the above technical problems, the present application provides a multi-source traffic data transfer mode estimation method and a computer readable medium.
[0005] The technical scheme of the method of the present application is a multi-source traffic data transfer mode estimation method, comprising the following steps:
[0006] Step 1: Obtain the longitude coordinates and latitude coordinates of a plurality of bus stations, calculate the Euclidean distance between any two bus stations according to the longitude coordinates and latitude coordinates of each bus station, select the smallest two Euclidean distances of each bus station from the Euclidean distances between each bus station and the remaining plurality of bus stations, and construct a bus station Euclidean distance sequence through the smallest two Euclidean distances of all bus stations. Sort the bus station Euclidean distance sequence in ascending order to obtain a bus station Euclidean distance ascending sequence, and calculate the distance of the 95th percentile of the bus station according to the four-point method to obtain the distance threshold of bus-to-bus transfer;
[0007] Step 2: Obtain the longitude coordinates and latitude coordinates of a plurality of subway stations and the longitude and latitude coordinates of each bus station. Calculate the Euclidean distance between any two subway stations and bus stations according to the longitude coordinates and latitude coordinates of each subway station and each bus station. Select the smallest two Euclidean distances to each subway station from the Euclidean distances between each subway station and all bus stations. Construct a subway station adjacent bus station Euclidean distance sequence from the smallest two Euclidean distances of all subway stations. Sort the subway station Euclidean distance sequence in ascending order to obtain a subway station Euclidean distance ascending sequence. Calculate the distance of the ninth and fifth quantiles of the subway station according to the four-point position method to serve as the distance threshold for subway and bus transfers.
[0008] Step 3: Obtain the longitude coordinates and latitude coordinates of a plurality of bus stations and the longitude and latitude coordinates of each subway station. Calculate the Euclidean distance between any two bus stations and subway stations according to the longitude coordinates and latitude coordinates of each bus station and each subway station. Select the smallest two Euclidean distances to each bus station from the Euclidean distances between each bus station and all subway stations. Select the Euclidean distances less than the distance threshold to construct a bus station adjacent subway station Euclidean distance sequence. Sort the bus station Euclidean distance sequence in ascending order to obtain a bus station Euclidean distance ascending sequence. Calculate the distance of the ninth and fifth quantiles of the bus station according to the four-point position method to serve as the distance threshold for bus and subway transfers.
[0009] Step 4: Obtain a plurality of transaction data of a plurality of IC card numbers on a certain day.
[0010] Step 5: Calculate the difference between the transaction time of the current transaction data and the transaction time of the next transaction data for each IC card number. Calculate the transfer point longitude and latitude distance of the current transaction data for each IC card number according to the longitude coordinates and latitude coordinates corresponding to the current station sequence number of the current transaction data and the longitude coordinates and latitude coordinates corresponding to the next station sequence number of the next transaction data. Construct the transfer type of each transaction data for each IC card number.
[0011] Step 6: Obtain the distance threshold corresponding to the transfer type of the current transaction data for each IC card number and the transfer point longitude and latitude distance of the current transaction data for each IC card number. According to the distance threshold, select the current transaction data and the next transaction data in the plurality of transaction data of each IC card number. Construct a transfer candidate transaction data set for each IC card number. Obtain the difference in transaction time of each transfer candidate transaction data in the transfer candidate transaction data set for each IC card number.
[0012] Step 7: Calculate the short transfer time threshold, the lower limit of the medium transfer time, the upper limit of the medium transfer time, and the long transfer time threshold in sequence by the difference of the transaction time of each transfer candidate transaction data in the transfer candidate transaction data set combined with the card number, and obtain the transfer mode of each transfer candidate transaction data in the transfer candidate transaction data set of each card number through threshold screening and classification.
[0013] As preferred, the transaction data of the plurality of card numbers in step 4 is defined as follows:
[0014]
[0015] Data k,p ={type k,p ,DEAL_TIME k,p ,UP k,p ,DOWN k,p}
[0016] k∈[1,K],p∈[1,N k ]
[0017] wherein, Data_All k represents a plurality of transaction data of the kth card number on a certain day, Data k,p represents the pth transaction data of the kth card number, N k represents the number of transaction data of the kth card number, and K represents the number of card numbers.
[0018] type k,p represents the station type of the pth transaction data of the kth card number, wherein if type k,p = 0, it represents that the station type is a bus station, and if type k,p = 1, it represents that the station type is a subway station, DEAL_TIME k,p represents the transaction time of the pth transaction data of the kth card number, UP k,p represents the boarding station number of the pth transaction data of the kth card number, and DOWN k,p represents the alighting station number of the pth transaction data of the kth card number.
[0019] If type k,p = 0, UP k,p and DOWN k,p are both the sequence numbers of bus stations.
[0020] If type k,p = 1, UP k,p and DOWN k,p are both the sequence numbers of subway stations.
[0021] As preferred, the step 5 calculates the difference between the transaction time of the current transaction data and the transaction time of the next transaction data of each card number, specifically as follows:
[0022] t k,p = DEAL_TIME k,p+1 - DEAL_TIME k,p
[0023] k e [1, K], p e [1, N k ]
[0024] wherein t k,p represents the difference between the transaction time of the pth transaction data and the p+1th transaction data of the kth card number, DEAL_TIME k,p and DEAL_TIME k,p+1 respectively represent the transaction time of the pth transaction data and the p+1th transaction data of the kth card number, N k represents the number of transaction data of the kth card number, and K represents the number of card numbers.
[0025] The step 5 calculates the distance between the longitude and latitude of the transfer point of the current transaction data of each card number, specifically as follows:
[0026] If type k,p = 0, then DOWN k,p is the serial number of the bus station, and the longitude coordinate and the latitude coordinate of the bus station are searched according to DOWN k,p to obtain the longitude coordinate and the latitude coordinate of the bus station where the kth card number gets off at the pth transaction data.
[0027] If type k,p = 1, then DOWN k,p is the serial number of the subway station, and the longitude coordinate and the latitude coordinate of the subway station are searched according to DOWN k,p to obtain the longitude coordinate and the latitude coordinate of the subway station where the kth card number gets off at the pth transaction data.
[0028] If type k,p+1 = 0, then UP k,p+1 is the serial number of the bus station, and the longitude coordinate and the latitude coordinate of the bus station are searched according to UP k,p+1 to obtain the longitude coordinate and the latitude coordinate of the bus station where the kth card number gets on at the p+1th transaction data.
[0029] If type k,p+1 = 1, then UP k,p+1is the serial number of the subway station, and the longitude coordinate and the latitude coordinate of the subway station are obtained according to UP k,p+1 is the serial number of the subway station, and the longitude coordinate and the latitude coordinate of the subway station are obtained according to UP
[0030] wherein, type k,p DOWN indicates the serial number of the station of the pth transaction data of the kth IC card number, UP k,p DOWN indicates the serial number of the station of the pth transaction data of the kth IC card number, UP k,p+1 DOWN indicates the serial number of the station of the pth transaction data of the kth IC card number, UP
[0031] DOWN indicates the serial number of the station of the pth transaction data of the kth IC card number, UP k,p ;
[0032] TRANSFER_TYPE is the transfer type of each transaction data of each IC card number in step 5, and is specifically as follows:
[0033] DOWN indicates the serial number of the station of the pth transaction data of the kth IC card number, UP k,p DOWN indicates the serial number of the station of the pth transaction data of the kth IC card number, UP k,p+1 DOWN indicates the serial number of the station of the pth transaction data of the kth IC card number, UP k,p ;
[0034] DOWN indicates the serial number of the station of the pth transaction data of the kth IC card number, UP k,p DOWN indicates the serial number of the station of the pth transaction data of the kth IC card number, UP k,p+1 DOWN indicates the serial number of the station of the pth transaction data of the kth IC card number, UP k,p ;
[0035] DOWN indicates the serial number of the station of the pth transaction data of the kth IC card number, UP k,p DOWN indicates the serial number of the station of the pth transaction data of the kth IC card number, UP k,p+1 DOWN indicates the serial number of the station of the pth transaction data of the kth IC card number, UP k,p ;
[0036] DOWN indicates the serial number of the station of the pth transaction data of the kth IC card number, UP k,p DOWN indicates the serial number of the station of the pth transaction data of the kth IC card number, UP k,p+1 DOWN indicates the serial number of the station of the pth transaction data of the kth IC card number, UP k,p ;
[0037] TRANSFER_TYPE indicates the transfer type between the pth transaction data and the p+1th transaction data of the kth IC card number; k,p TRANSFER_TYPE indicates the transfer type between the pth transaction data and the p+1th transaction data of the kth IC card number;
[0038] As preferred, the step 6 obtains the distance threshold corresponding to the transfer type of the current transaction data of each card number, which is specifically as follows:
[0039] If TRANSFER_TYPE k,p = 0, the distance threshold corresponding to the transfer type of the current transaction data of each card number is T b-b
[0040] If TRANSFER_TYPE k,p = 1, the distance threshold corresponding to the transfer type of the current transaction data of each card number is T s-b
[0041] If TRANSFER_TYPE k,p = 2, the distance threshold corresponding to the transfer type of the current transaction data of each card number is T b-s
[0042] If TRANSFER_TYPE k,p = 3, the distance threshold corresponding to the transfer type of the current transaction data of each card number is T s-s , the subway-subway transfer only occurs in the same station, and is known data, the distance threshold T s-s = 0 of the subway-subway transfer;
[0043] The step 6 judges the current transaction data and the next transaction data in the plurality of transaction data of each card number according to the distance threshold, which is specifically as follows:
[0044] When TRANSFER_TYPE k,p = 0, if S k,p ≤ T b-b , Data k,p , Data k,p+1 are stored in the transfer candidate transaction data set C k of the kth card number.
[0045] When TRANSFER_TYPE k,p = 1, if S k,p ≤ T s-b , Data k,p , Data k,p+1 are stored in the transfer candidate transaction data set C k of the kth card number.
[0046] When TRANSFER_TYPE k,p = 2, if S k,p ≤ T b-s , Data k,pData k,p+1 Store the transfer alternative transaction data set C for the kth IC card number. k ;
[0047] When TRANSFER_TYPE k,p =3, if S k,p ≤T s-s Then the Data k,p Data k,p+1 Store the transfer alternative transaction data set C for the kth IC card number. k ;
[0048] The set of alternative transfer transaction data for each IC card number mentioned in step 6 is specifically defined as follows:
[0049]
[0050]
[0051] k∈[1,K], j∈[1,M] k ], M k ≤N k
[0052] Among them, C k This represents the set of alternative transfer transaction data for the k-th IC card number. This represents the j-th transfer alternative transaction in the set of transfer alternative transaction data for the k-th IC card number, i.e., the i-th transfer alternative transaction for the k-th IC card number. j Transaction data, K represents the number of IC card numbers, N k M represents the number of transactions for the k-th IC card number. k This represents the number of alternative transfer transactions in the set of alternative transfer transaction data for the k-th IC card number. This indicates the station type in the j-th transfer candidate transaction data within the set of transfer candidate transaction data for the k-th IC card number. This represents the transaction time in the j-th transfer alternative transaction data within the set of transfer alternative transaction data for the k-th IC card number. This represents the boarding station number in the j-th transfer alternative transaction data within the set of transfer alternative transaction data for the k-th IC card number. This represents the disembarkation station number in the j-th transfer alternative transaction data within the set of transfer alternative transaction data for the k-th IC card number.
[0053] The difference in transaction time for each transfer alternative transaction in the transfer alternative transaction data set for each IC card number described in step 6 is: This represents the difference in transaction time among the j-th transfer alternative transaction data in the set of transfer alternative transaction data for the k-th IC card number;
[0054] Preferably, step 7 involves sequentially calculating the short transfer time threshold, the lower limit of the medium transfer time, the upper limit of the medium transfer time, and the long transfer time threshold, as detailed below:
[0055] Traverse C sequentially k middle To construct a transaction time difference sequence;
[0056] Where, k∈[1,K], j∈[1,M] k ], M k ≤N k C k This represents the set of alternative transfer transaction data for the k-th IC card number. This represents the difference in transaction time among the j-th alternative transfer transactions in the set of alternative transfer transaction data for the k-th IC card number, where K represents the number of IC card numbers, and N represents the number of IC card numbers. k M represents the number of transactions for the k-th IC card number. k This represents the number of alternative transfer transactions in the set of alternative transfer transaction data for the k-th IC card number.
[0057] Sort the transaction time difference sequence in ascending order to obtain the ascending order transaction time difference sequence;
[0058] Set a lower limit and an upper limit for the transaction time difference;
[0059] The time difference is divided into multiple time difference intervals at equal intervals between the lower limit and the upper limit of the time difference.
[0060] Each transaction time difference in the ascending order sequence is sequentially assigned to a corresponding transaction time difference interval;
[0061] The number of time differences in each time difference interval, sorted in ascending order, is defined as F. n n∈[1,L];
[0062] Among them, F n This represents the number of time differences in the nth time difference interval after ascending order, where L represents the number of time difference intervals.
[0063] Calculate the slope between adjacent transaction time difference intervals as follows:
[0064] FA n =(F n+1 -F n ) / Δ
[0065] n∈[1,L-1]
[0066] Wherein, FA n represents the slope between the n+1th trading time difference interval and the nth trading time difference interval, FA n+1 represents the number of the n+1th trading time difference interval, FA n represents the number of the nth trading time difference interval, and Δ represents the length of a single trading time difference interval.
[0067] The rate of change of the slope between adjacent trading time difference intervals is calculated as follows:
[0068] FB n =(FA n -FA n-1 ) / Δ
[0069] n∈[2,L-1]
[0070] Wherein, FB n represents the rate of change of the slope between the n+1th trading time difference interval and the nth trading time difference interval and the rate of change of the slope between the nth trading time difference interval and the n-1th trading time difference interval, FA n represents the slope between the n+1th trading time difference interval and the nth trading time difference interval, FA n-1 represents the slope between the nth trading time difference interval and the n-1th trading time difference interval, and Δ represents the length of a single trading time difference interval.
[0071] The FBn, n∈[2,L-1] is arranged in descending order from large to small to obtain the sorted rate of change of the slope between adjacent trading time difference intervals, which is defined as:
[0072]
[0073] Wherein, represents the rate of change of the slope between the lth sorted adjacent trading time difference interval, that is, the rate of change of the slope between the m l th adjacent trading time difference interval;
[0074] The median mid l of the m l th trading time difference interval is calculated in turn, l∈[2,L-1], and mid l is compared with According to the value of l, a new sequence C T is formed, and C T is composed of mid lThe descending sequence formed by the rate of change of the slope between adjacent transaction time difference intervals corresponding to the median;
[0075] From C T Start by iterating through and filtering the first mid1. l The mid that simultaneously satisfies the following two conditions l Reserved: mid l ≤α and mid retained this time l With the retained mid l The difference between them is not less than β; following this rule, a total of 4 medians are retained. r1, r2, r3, r4 ∈ [2, L-1], α represents the median threshold, and β represents the difference threshold;
[0076] right Sort in ascending order to obtain four sequential time thresholds T1, T2, T3, and T4. T1 represents the short transfer time threshold, T2 represents the lower limit of the medium transfer time, T3 represents the upper limit of the medium transfer time, and T4 represents the long transfer time threshold.
[0077] Step 7 describes obtaining the transfer pattern of each transfer candidate transaction in the transfer candidate transaction data set for each IC card number by classifying it through threshold judgment, as follows:
[0078] like but and The route involves short transfers.
[0079] like but and The transfer mode is between the two.
[0080] like but and The route involves a long transfer.
[0081] Where T1 represents the short transfer time threshold, T2 represents the lower limit of the medium transfer time, T3 represents the upper limit of the medium transfer time, and T4 represents the long transfer time threshold.
[0082] The present invention also provides a computer-readable medium storing a computer program executed by an electronic device, wherein when the computer program is run on the electronic device, it performs the steps of the multi-source traffic data transfer pattern estimation method.
[0083] The advantage of this invention is that it can automatically extract the distance and time thresholds of transfer behavior from traffic big data, and then accurately extract and classify transfer behavior through time and distance dual constraints, providing a data foundation for subsequent research on the healthy development of urban traffic and urban vitality.
[0084] Drawings
[0085] Figure 1 Method flow chart of the embodiment of the application. DETAILED DESCRIPTION
[0086] The technical solutions in the embodiments of the application will be described clearly and completely below with reference to the drawings in the embodiments of the application. Obviously, the described embodiments are only part of the embodiments of the application, rather than all the embodiments of the application. Based on the embodiments in the application, all other embodiments obtained by a person of ordinary skill in the art without creative work are within the protection scope of the application.
[0087] In the implementation, the method proposed in the technical solutions of the application can be automatically run by a person of ordinary skill in the art using computer software technology, and the system device of the method, for example, a computer readable storage medium storing the corresponding computer program of the technical solutions of the application and a computer device including the computer program, should also be within the protection scope of the application.
[0088] The method provided by the application can be used in different data migration, and needs certain manual interpretation. The flow of the application is specifically described by taking the data of Wednesday, April 1, 2015 in Beijing as an example.
[0089] The technical solutions of the embodiments of the application are described below. Figure 1 The technical solutions of the embodiments of the application are a multi-source traffic data transfer mode estimation method, and are specifically as follows.
[0090] As shown in Figure 1 The method flow chart of the application is shown in the figure.
[0091] Step 1: Obtain the longitude coordinates and latitude coordinates of a plurality of bus stations, calculate the Euclidean distance between any two bus stations according to the longitude coordinates and latitude coordinates of each bus station, select the smallest two Euclidean distances of each bus station from the Euclidean distances between each bus station and the remaining plurality of bus stations, construct a bus station Euclidean distance sequence through the smallest two Euclidean distances of all bus stations, sort the bus station Euclidean distance sequence in ascending order to obtain a bus station Euclidean distance ascending sequence, and calculate the distance of the 95th percentile of the bus station according to the four-point method to serve as the distance threshold of bus-to-bus transfer, T b-b = 0.007.
[0092] Step 2: Obtain the longitude coordinates and latitude coordinates of multiple subway stations and the longitude and latitude coordinates of each bus station. Calculate the Euclidean distance between any two subway stations and bus stations according to the longitude coordinates and latitude coordinates of each subway station and each bus station. In the Euclidean distance between each subway station and all bus stations, filter the smallest two Euclidean distances to each subway station. Construct the subway station adjacent bus station Euclidean distance sequence through the smallest two Euclidean distances of all subway stations. Sort the subway station Euclidean distance sequence in ascending order to obtain the subway station Euclidean distance ascending sequence. Calculate the distance of the 95th percentile of the subway station according to the quartile point method, and take it as the distance threshold of subway and bus transfer, T s-b = 0.01;
[0093] Step 3: Obtain the longitude coordinates and latitude coordinates of multiple bus stations and the longitude and latitude coordinates of each subway station. Calculate the Euclidean distance between any two bus stations and subway stations according to the longitude coordinates and latitude coordinates of each bus station and each subway station. In the Euclidean distance between each bus station and all subway stations, filter the smallest two Euclidean distances to each bus station, and filter the Euclidean distance less than the distance threshold to construct the bus station adjacent subway station Euclidean distance sequence. Sort the bus station Euclidean distance sequence in ascending order to obtain the bus station Euclidean distance ascending sequence. Calculate the distance of the 95th percentile of the bus station according to the quartile point method, and take it as the distance threshold of bus and subway transfer, T b-s = 0.025;
[0094] Step 4: Obtain multiple transaction data of multiple IC card numbers on a certain day.
[0095] The transaction data of the multiple IC card numbers in step 4 is defined as follows:
[0096]
[0097] Data k,p = {type k,p , DEAL_TIME k,p , UP k,p , DOWN k,p}
[0098] k∈[1,K],p∈[1,N k ]
[0099] wherein, Data_All k represents multiple transaction data of the kth IC card number on a certain day, Data k,p represents the pth transaction data of the kth IC card number, Nk the number of transaction data of the kth IC card number, K represents the number of IC card numbers;
[0100] type k,p the site type of the pth transaction data of the kth IC card number, if type k,p = 0, it represents that the site type is a bus station, if type k,p = 1, it represents that the site type is a subway station, DEAL_TIME k,p represent the transaction time of the pth transaction data of the kth IC card number, UP k,p represent the up station sequence number of the pth transaction data of the kth IC card number, DOWN k,p represent the down station sequence number of the pth transaction data of the kth IC card number;
[0101] if type k,p = 0, UP k,p and DOWN k,p are both the sequence numbers of bus stations;
[0102] if type k,p = 1, UP k,p and DOWN k,p are both the sequence numbers of subway stations;
[0103] Step 5: Calculate the difference between the transaction time of the current transaction data and the transaction time of the next transaction data of each IC card number, calculate the transfer point longitude and latitude distance of each IC card number according to the longitude coordinate and latitude coordinate corresponding to the down station sequence number of the current transaction data and the longitude coordinate and latitude coordinate corresponding to the up station sequence number of the next transaction data, and construct the transfer type of each transaction data of each IC card number;
[0104] Step 5 calculates the difference between the transaction time of the current transaction data and the transaction time of the next transaction data of each IC card number, which is as follows:
[0105] t k,p = DEAL_TIME k,p+1 - DEAL_TIME k,p
[0106] k ∈ [1, K], p ∈ [1, N k ]
[0107] wherein, t k,p represents the difference between the transaction time of the pth transaction data and the p+1th transaction data of the kth IC card number, DEAL_TIME k,p and DEAL_TIME k,p+1respectively represent the transaction time of the pth transaction data and the p+1th transaction data of the kth card, N k represents the number of transaction data of the kth card, K represents the number of cards;
[0108] Step 5 calculates the transfer point longitude and latitude distance of the current transaction data of each card, which is specifically as follows:
[0109] If type k,p = 0, DOWN k,p is the serial number of the bus station, and the longitude and latitude coordinates of the bus station are searched according to DOWN k,p to obtain the longitude and latitude coordinates of the alighting station of the pth transaction data of the kth card;
[0110] If type k,p = 1, DOWN k,p is the serial number of the subway station, and the longitude and latitude coordinates of the subway station are searched according to DOWN k,p to obtain the longitude and latitude coordinates of the alighting station of the pth transaction data of the kth card;
[0111] If type k,p+1 = 0, UP k,p+1 is the serial number of the bus station, and the longitude and latitude coordinates of the bus station are searched according to UP k,p+1 to obtain the longitude and latitude coordinates of the boarding station of the p+1th transaction data of the kth card;
[0112] If type k,p+1 = 1, UP k,p+1 is the serial number of the subway station, and the longitude and latitude coordinates of the subway station are searched according to UP k,p+1 to obtain the longitude and latitude coordinates of the boarding station of the p +1 th transaction data of the kth card;
[0113] Wherein, type k,p represents the station type of the pth transaction data of the kth card, DOWN k,p represents the alighting station serial number of the pth transaction data of the kth card, UP k,p+1 represents the boarding station serial number of the p+1th transaction data of the kth card, the pth transaction data is the current transaction data of each card, and the p+1th transaction data is the next transaction data of each card;
[0114] The longitude coordinate and latitude coordinate of the drop-off station of the pth transaction data of the kth card number are calculated by the Euclidean distance with the longitude coordinate and latitude coordinate of the pick-up station of the p+1th transaction data of the kth card number, to obtain the transfer point longitude and latitude distance of the pth transaction data of the kth card number, defined as: S k,p ;
[0115] The transfer type of each transaction data of each card number in step 5 is as follows:
[0116] If type k,p = 0 and type k,p +1 = 0, then TRANSFER_TYPE k,p = 0;
[0117] If type k,p = 1 and type k,p +1 = 0, then TRANSFER_TYPE k,p = 1;
[0118] If type k,p = 0 and type k,p +1 = 1, then TRANSFER_TYPE k,p = 2;
[0119] If type k,p = 1 and type k,p +1 = 1, then TRANSFER_TYPE k,p = 3;
[0120] Wherein, TRANSFER_TYPE k,p represents the transfer type between the pth transaction data and the p+1th transaction data of the kth card number;
[0121] Step 6: Obtain the distance threshold corresponding to the transfer type of the current transaction data of each card number, the transfer point longitude and latitude distance of the current transaction data of each card number, and filter the current transaction data and the next transaction data in the multiple transaction data of each card number according to the distance threshold, to construct a transfer candidate transaction data set of each card number, and obtain the difference value of the transaction time of each transfer candidate transaction data in the transfer candidate transaction data set of each card number;
[0122] Step 6: Obtain the distance threshold corresponding to the transfer type of the current transaction data of each card number, the transfer point longitude and latitude distance of the current transaction data of each card number, and filter the current transaction data and the next transaction data in the multiple transaction data of each card number according to the distance threshold, to construct a transfer candidate transaction data set of each card number, and obtain the difference value of the transaction time of each transfer candidate transaction data in the transfer candidate transaction data set of each card number;
[0123] If TRANSFER_TYPE k,p= 0, the distance threshold corresponding to the transfer type of the current transaction data of each one-card card number is: T b-b = 0.007
[0124] If TRANSFER_TYPE k,p = 1, the distance threshold corresponding to the transfer type of the current transaction data of each one-card card number is: T s-b = 0.01
[0125] If TRANSFER_TYPE k,p = 2, the distance threshold corresponding to the transfer type of the current transaction data of each one-card card number is: T b-s = 0.025
[0126] If TRANSFER_TYPE k,p = 3, the distance threshold corresponding to the transfer type of the current transaction data of each one-card card number is: T s-s , the subway-subway transfer only occurs within the same station, and is known data, the distance threshold T s-s = 0 for subway-subway transfer.
[0127] Step 6: According to the distance threshold, the current transaction data and the next transaction data are screened from the plurality of transaction data of each one-card card number, and the screening is as follows:
[0128] When TRANSFER_TYPE k,p = 0, if S k,p ≤ T b-b , Data k,p and Data k,p+1 are stored in the transfer candidate transaction data set C k of the kth one-card card number.
[0129] When TRANSFER_TYPE k,p = 1, if S k,p ≤ T s-b , Data k,p and Data k,p+1 are stored in the transfer candidate transaction data set C k of the kth one-card card number.
[0130] When TRANSFER_TYPE k,p = 2, if S k,p ≤ T b-s , Data k,p and Data k,p+1 are stored in the transfer candidate transaction data set C k of the kth one-card card number.
[0131] When TRANSFER_TYPE k,p =3, if S k,p ≤T s-s Then the Data k,p Data k,p+1 Store the transfer alternative transaction data set C for the kth IC card number. k ;
[0132] The set of alternative transfer transaction data for each IC card number mentioned in step 6 is specifically defined as follows:
[0133]
[0134]
[0135] k∈[1,K], j∈[1,M] k ], M k ≤N k
[0136] Among them, C k This represents the set of alternative transfer transaction data for the k-th IC card number. This represents the j-th transfer alternative transaction in the set of transfer alternative transaction data for the k-th IC card number, i.e., the i-th transfer alternative transaction for the k-th IC card number. j Transaction data, K represents the number of IC card numbers, N k M represents the number of transactions for the k-th IC card number. k This represents the number of alternative transfer transactions in the set of alternative transfer transaction data for the k-th IC card number. This indicates the station type in the j-th transfer candidate transaction data within the set of transfer candidate transaction data for the k-th IC card number. This represents the transaction time in the j-th transfer alternative transaction data within the set of transfer alternative transaction data for the k-th IC card number. This represents the boarding station number in the j-th transfer alternative transaction data within the set of transfer alternative transaction data for the k-th IC card number. This represents the disembarkation station number in the j-th transfer alternative transaction data within the set of transfer alternative transaction data for the k-th IC card number.
[0137] The difference in transaction time for each transfer alternative transaction in the transfer alternative transaction data set for each IC card number described in step 6 is: This represents the difference in transaction time among the j-th transfer alternative transaction data in the set of transfer alternative transaction data for the k-th IC card number;
[0138] Step 7: Combine the difference in transaction time of each transfer candidate transaction in the transfer candidate transaction data set of all IC card numbers to calculate the short transfer time threshold, medium transfer time lower limit, medium transfer time upper limit, and long transfer time threshold in sequence. The transfer mode of each transfer candidate transaction in the transfer candidate transaction data set of each IC card number is obtained by filtering and classifying through the threshold.
[0139] Step 7 involves sequentially calculating the short transfer time threshold, the lower limit of the medium transfer time, the upper limit of the medium transfer time, and the long transfer time threshold, as detailed below:
[0140] Traverse C sequentially k middle To construct a transaction time difference sequence;
[0141] Where, k∈[1,K], j∈[1,M] k ], M k ≤N k C k This represents the set of alternative transfer transaction data for the k-th IC card number. This represents the difference in transaction time among the j-th alternative transfer transactions in the set of alternative transfer transaction data for the k-th IC card number, where K represents the number of IC card numbers, and N represents the number of IC card numbers. k M represents the number of transactions for the k-th IC card number. k This represents the number of alternative transfer transactions in the set of alternative transfer transaction data for the k-th IC card number.
[0142] Sort the transaction time difference sequence in ascending order to obtain the ascending order transaction time difference sequence;
[0143] Set the lower limit of the transaction time difference to 0 and the upper limit of the transaction time difference to 1440;
[0144] The transaction time difference is divided into multiple transaction time difference intervals at equal intervals between the lower limit and the upper limit of the transaction time difference. In this example, it is divided into 300 intervals, i.e., L = 300.
[0145] Each transaction time difference in the ascending order sequence is sequentially assigned to a corresponding transaction time difference interval;
[0146] The number of time differences in each time difference interval, sorted in ascending order, is defined as F. n n∈[1,L];
[0147] Among them, F n This represents the number of time differences in the nth time difference interval after ascending order, and L represents the number of time difference intervals, where L = 300.
[0148] The slope between adjacent transaction time difference intervals is calculated as follows:
[0149] FA n = (F n+1 - F n ) / Δ
[0150] n ∈ [1, L-1]
[0151] Wherein, FA n represents the slope between the n+1th transaction time difference interval and the nth transaction time difference interval, F n+1 represents the number of the n+1th transaction time difference interval, F n represents the number of the nth transaction time difference interval, and Δ represents the length of a single transaction time difference interval.
[0152] The rate of change of the slope between adjacent transaction time difference intervals is calculated as follows:
[0153] FB n = (FA n - FA n-1 ) / Δ
[0154] n ∈ [2, L-1]
[0155] Wherein, FB n represents the rate of change of the slope between the n+1th transaction time difference interval and the nth transaction time difference interval and the slope between the nth transaction time difference interval and the n-1th transaction time difference interval, FA n represents the slope between the n+1th transaction time difference interval and the nth transaction time difference interval, FA n-1 represents the slope between the nth transaction time difference interval and the n-1th transaction time difference interval, and Δ represents the length of a single transaction time difference interval.
[0156] FB n , n ∈ [2, L-1] are arranged in descending order from large to small to obtain the sorted rate of change of the slope between adjacent transaction time difference intervals, which is defined as:
[0157]
[0158] Wherein, represents the rate of change of the slope between the lth sorted adjacent transaction time difference interval, that is, the m l th adjacent transaction time difference interval;
[0159] The median mid of the m l th transaction time difference interval is calculated in turnl , l∈[2,L-1], let mid l and Based on the one-to-one correspondence of the values of l, a new sequence C is formed. T C T It is mid l The descending sequence formed by the rate of change of the slope between adjacent transaction time difference intervals corresponding to the median;
[0160] From C T Start by iterating through and filtering the first mid1. l The mid that simultaneously satisfies the following two conditions l Reserved: mid l ≤α and mid retained this time l With the retained mid l The difference between them is not less than β; following this rule, a total of 4 medians are retained. r1, r2, r3, r4∈[2, L-1], α=120 represents the median threshold, β=5 represents the difference threshold;
[0161] right Sort in ascending order to obtain four sequential time thresholds: T1 = 2.4, T2 = 24, T3 = 57.6, and T4 = 72.
[0162] Step 7 describes obtaining the transfer pattern of each transfer candidate transaction in the transfer candidate transaction data set for each IC card number by classifying it through threshold judgment, as follows:
[0163] like but and The route involves short transfers.
[0164] like but and The transfer mode is between the two.
[0165] like but and The route involves a long transfer.
[0166] Where T1 = 2.4 represents the short transfer time threshold, T2 = 24 represents the lower limit of the medium transfer time, T3 = 57.6 represents the upper limit of the medium transfer time, and T4 = 72 represents the long transfer time threshold;
[0167] A specific embodiment of the present invention also provides a computer-readable medium.
[0168] The computer-readable medium is a server workstation;
[0169] The server workstation stores a computer program executed by the electronic device, which, when running on the electronic device, causes the electronic device to execute the steps of the multi-source traffic data transfer mode estimation method of the embodiments of the present application.
[0170] It should be understood that parts not described in detail in the specification are all part of the prior art.
[0171] It should be understood that the above description of the preferred embodiments is more detailed and is not considered as limiting the scope of patent protection of the present application. Those skilled in the art can make substitutions or modifications without departing from the scope of protection of the present application, which falls within the scope of protection of the present application. The scope of protection of the present application should be subject to the appended claims.
Claims
1. A method for estimating transfer patterns using multi-source traffic data, characterized in that: The distance thresholds for bus-to-bus transfers, subway-to-bus transfers, and bus-to-subway transfers are calculated using the four-point location method. Based on the distance threshold, the current transaction data and the next transaction data are filtered from multiple transaction data for each transit card number to construct a set of alternative transfer transaction data for each transit card number and the difference in the corresponding transaction time. The thresholds for short transfer time, medium transfer time (lower limit), medium transfer time (upper limit), and long transfer time are calculated sequentially. The transfer patterns of each transfer candidate transaction data in the transfer candidate transaction data set for each IC card number are obtained by filtering and classifying the thresholds. The method further includes: Step 1: Obtain the longitude and latitude coordinates of multiple bus stops. Calculate the Euclidean distance between any two bus stops using the Euclidean coordinates of each bus stop. Filter the Euclidean distances between each bus stop and the remaining multiple bus stops to find the two smallest Euclidean distances for each bus stop. Construct a sequence of Euclidean distances between all bus stops using the two smallest Euclidean distances. Sort the sequence of Euclidean distances in ascending order to obtain an ascending sequence of Euclidean distances between bus stops. Calculate the 95th percentile distance of each bus stop using the quartile method, which will be used as the distance threshold for bus-to-bus transfers. Step 2: Obtain the longitude and latitude coordinates of multiple subway stations and the longitude and latitude coordinates of each bus stop. Calculate the Euclidean distance between any two subway stations and bus stops using the Euclidean distance. Select the two smallest Euclidean distances between each subway station and all bus stops from the Euclidean distances between them. Construct a sequence of Euclidean distances between subway stations and their neighboring bus stops using the two smallest Euclidean distances between all subway stations. Sort the sequence of subway station Euclidean distances in ascending order to obtain an ascending sequence of subway station Euclidean distances. Calculate the 95th percentile distance of each subway station in the ascending sequence of subway station Euclidean distances using the quartile method, and use this as the distance threshold for subway-bus transfers. Step 3: Obtain the longitude and latitude coordinates of multiple bus stops and the longitude and latitude coordinates of each subway station. Calculate the Euclidean distance between any two bus stops and subway stations using the longitude and latitude coordinates of each bus stop and subway station. Select the two smallest Euclidean distances between each bus stop and all subway stations, and select those Euclidean distances less than a distance threshold to construct a sequence of Euclidean distances between bus stops and nearby subway stations. Sort the Euclidean distance sequence of bus stops in ascending order to obtain an ascending sequence of bus stop Euclidean distances. Calculate the 95th percentile distance of the bus stops using the quartile method, which serves as the distance threshold for bus-subway transfers. Step 4: Obtain multiple transaction records for multiple IC card numbers on a specific day; Step 5: Calculate the difference between the transaction time of the current transaction data and the transaction time of the next transaction data for each smart card number. Based on the longitude and latitude coordinates corresponding to the drop-off station number of the current transaction data and the longitude and latitude coordinates corresponding to the boarding station number of the next transaction data, calculate the latitude and longitude distance of the transfer point of the current transaction data for each smart card number, and construct the transfer type of each transaction data for each smart card number. Step 6: Obtain the distance threshold corresponding to the transfer type of the current transaction data for each smart card number, and the latitude and longitude distance of the transfer point for the current transaction data of each smart card number. Based on the distance threshold, filter the current transaction data and the next transaction data in the multiple transaction data of each smart card number, construct the transfer candidate transaction data set for each smart card number, and obtain the difference in transaction time of each transfer candidate transaction data in the transfer candidate transaction data set for each smart card number. Step 7: Combine the transaction time difference of each transfer candidate transaction in the transfer candidate transaction data set of all IC card numbers to calculate the short transfer time threshold, medium transfer time lower limit, medium transfer time upper limit, and long transfer time threshold in sequence. By filtering and classifying through the thresholds, the transfer mode of each transfer candidate transaction in the transfer candidate transaction data set of each IC card number is obtained.
2. The method for estimating transfer patterns using multi-source traffic data according to claim 1, characterized in that: The transaction data for the multiple smart card numbers mentioned in step 4 are defined as follows: k ∈[1, K ], ∈ in, Indicates the first day of a certain day k Multiple transaction records for a single smart card number Indicates the first k The first one of the all-in-one card numbers p Transaction data, Indicates the first k The number of transaction data for each IC card number K This indicates the number of campus card numbers; Indicates the first k The first one of the all-in-one card numbers p The site type of the transaction data, if =0 indicates that the station type is a bus station. =1 indicates that the station type is a subway station. Indicates the first k The first one of the all-in-one card numbers p The transaction time of each transaction data item Indicates the first k The first one of the all-in-one card numbers p The boarding station number of each transaction data item. Indicates the first k The first one of the all-in-one card numbers p The drop-off station number for each transaction; like =0 , All are the serial numbers of bus stops; like =1 , All of these are the serial numbers of subway stations.
3. The method for estimating transfer patterns using multi-source traffic data according to claim 2, characterized in that: Step 5 involves calculating the difference between the transaction time of the current transaction data and the transaction time of the next transaction data for each card number, as detailed below: k ∈[1, K ], ∈ in, Indicates the first k The first card number p Transaction data and the first p+1 The difference in transaction time between the transaction data. and They represent the first k The first card number p Transaction data and the first p+1 The transaction time of each transaction data item Indicates the first k The number of transaction data for each IC card number K This indicates the number of campus card numbers; Step 5 involves calculating the latitude and longitude distance of the transfer point for the current transaction data of each smart card number, as detailed below: like =0 The sequence number of the bus stop is determined by selecting the longitude and latitude coordinates of multiple bus stops. Search and match to get the first k The first one of the all-in-one card numbers p The longitude and latitude coordinates of the drop-off point for each transaction data item; like =1 The sequence number of the subway station is determined by selecting the longitude and latitude coordinates of multiple subway stations based on... Search and match to get the first k The first one of the all-in-one card numbers p The longitude and latitude coordinates of the drop-off point for each transaction data item; like =0 The sequence number of the bus stop is determined by selecting the longitude and latitude coordinates of multiple bus stops. Search and match to get the first k The first one of the all-in-one card numbers p+ The longitude and latitude coordinates of the station where the transaction started; like =1 The sequence number of the subway station is determined by selecting the longitude and latitude coordinates of multiple subway stations based on... To find the match, we get the first... k The first one of the all-in-one card numbers p+ The longitude and latitude coordinates of the station where the transaction started; in, Indicates the first k The first one of the all-in-one card numbers p The site type of each transaction data item Indicates the first k The first one of the all-in-one card numbers p The drop-off station number of each transaction data item. Indicates the first k The first one of the all-in-one card numbers p+ The boarding station number of the first transaction data entry. p The transaction data is the current transaction data for each IC card number, number 1. p+ One transaction record is the next transaction record for each smart card number; The first k The first one of the all-in-one card numbers p The longitude and latitude coordinates of the drop-off point of the transaction data are related to the first... k The first one of the all-in-one card numbers p+ The longitude and latitude coordinates of the starting point of one transaction are calculated using Euclidean distance to obtain the first... k The first one of the all-in-one card numbers p The latitude and longitude distance between transfer points for each transaction is defined as: ; The transfer type for each transaction data entry for each IC card number described in step 5 is as follows: like =0, =0, then ; like =1, =0, then ; like =0, =1, then ; like =1, =1, then ; in, Indicates the first k The first one of the all-in-one card numbers p Transaction data and the first p+1 Transfer types between transaction data.
4. The method for estimating transfer patterns using multi-source traffic data according to claim 3, characterized in that: Step 6, which involves obtaining the distance threshold corresponding to the transfer type of the current transaction data for each smart card number, is as follows: like Then, the distance threshold corresponding to the transfer type of the current transaction data for each smart card number is: like Then, the distance threshold corresponding to the transfer type of the current transaction data for each smart card number is: like Then, the distance threshold corresponding to the transfer type of the current transaction data for each smart card number is: like Then, the distance threshold corresponding to the transfer type of the current transaction data for each smart card number is: If subway-to-subway transfers only occur within the same station and the data is known, then what is the distance threshold for subway-to-subway transfers? ; Step 6 involves filtering the current transaction data and the next transaction data from multiple transaction records for each smart card number based on a distance threshold, as detailed below: when ,like Then , Deposit the first k A set of alternative transfer transaction data for each transit card number ; when ,like Then , Deposit the first k A set of alternative transfer transaction data for each transit card number ; when ,like Then , Deposit the first k A set of alternative transfer transaction data for each transit card number ; when ,like Then , Deposit the first k A set of alternative transfer transaction data for each transit card number .
5. The method for estimating transfer patterns using multi-source traffic data according to claim 4, characterized in that: The set of alternative transfer transaction data for each IC card number mentioned in step 6 is specifically defined as follows: k ∈[1, K ], ∈ , in, Indicates the first k A set of alternative transfer transaction data for each transit card number. Indicates the first k The first of the transfer alternative transaction data sets for each transit card number The transfer alternative transaction data, namely the first k The first one of the all-in-one card numbers Transaction data, K Indicates the number of campus card numbers. Indicates the first k The number of transaction data for each IC card number Indicates the first k The number of alternative transfer transactions in the set of alternative transfer transaction data for each IC card number. Indicates the first k The first of the transfer alternative transaction data sets for each transit card number The station types in the alternative transfer transaction data, Indicates the first k The first of the transfer alternative transaction data sets for each transit card number The transaction time in the alternative transfer transaction data. Indicates the first k The first of the transfer alternative transaction data sets for each transit card number The boarding station number in the alternative transfer transaction data. Indicates the first k The first of the transfer alternative transaction data sets for each transit card number The disembarkation station number in the alternative transfer transaction data; The difference in transaction time for each transfer alternative transaction in the transfer alternative transaction data set for each IC card number described in step 6 is: , Indicates the first k The first of the transfer alternative transaction data sets for each transit card number The difference in transaction time among the alternative transaction data for each transfer.
6. The method for estimating transfer patterns using multi-source traffic data according to claim 5, characterized in that: Step 7 involves sequentially calculating the short transfer time threshold, the lower limit of the medium transfer time, the upper limit of the medium transfer time, and the long transfer time threshold, as detailed below: Traverse sequentially middle To construct a transaction time difference sequence; in, k ∈[1, K ], ∈ , , Indicates the first k A set of alternative transfer transaction data for each transit card number. Indicates the first k The first of the transfer alternative transaction data sets for each transit card number The difference in transaction time among the alternative transfer transaction data. K Indicates the number of campus card numbers. Indicates the first k The number of transaction data for each IC card number Indicates the first k The number of alternative transfer transactions in the alternative transfer transaction data set for each IC card number; Sort the transaction time difference sequence in ascending order to obtain the ascending order transaction time difference sequence; Set a lower limit and an upper limit for the transaction time difference; The time difference is divided into multiple time difference intervals at equal intervals between the lower limit and the upper limit of the time difference. Each transaction time difference in the ascending order sequence is sequentially assigned to a corresponding transaction time difference interval; The number of time differences in each time difference interval, sorted in ascending order, is defined as F. n n∈[1,L]; Among them, F n This represents the number of time differences in the nth time difference interval after ascending order, where L represents the number of time difference intervals. Calculate the slope between adjacent transaction time difference intervals as follows: in, This represents the slope between the (n+1)th transaction time difference interval and the nth transaction time difference interval. F n+1 This represents the number of time difference intervals for the (n+1)th transaction. F n This represents the number of time difference intervals for the nth transaction. Indicates the length of the time difference interval for a single transaction; The rate of change of the slope between adjacent time difference intervals is calculated as follows: in, This represents the slope between the (n+1)th and nth trading time difference intervals, and the rate of change of the slope between the nth and (n-1)th trading time difference intervals. This represents the slope between the (n+1)th transaction time difference interval and the nth transaction time difference interval. This represents the slope between the time difference interval of the nth transaction and the time difference interval of the (n-1)th transaction. Indicates the length of the time difference interval for a single transaction; Will FB n , n ∈[ 2,L-1 Sort the transactions in descending order of time difference, and define the rate of change of the slope between adjacent time difference intervals as follows: in, Indicates the first The rate of change of the slope between adjacent time difference intervals after sorting, i.e., the th The rate of change of the slope between adjacent time difference intervals of transactions; Calculate the number in sequence Median of the intervals of time difference between transactions , ,Will and according to l The values are matched one-to-one to form a new sequence. , It is by The descending sequence formed by the rate of change of the slope between adjacent transaction time difference intervals corresponding to the median; from The first Start iterating and filtering If both of the following conditions are met reserve: And this time, the retained With the already retained The difference between them is not less than β; following this rule, a total of 4 medians are retained. , , β represents the median threshold, and β represents the difference threshold. right Sort in ascending order to obtain four sequential time thresholds. , This indicates the threshold for short transfer time. This indicates the lower limit of the transfer time. This indicates the upper limit of transfer time. This represents the threshold for long transfer times.
7. The method for estimating transfer patterns using multi-source traffic data according to claim 6, characterized in that: Step 7 describes obtaining the transfer pattern of each transfer candidate transaction in the transfer candidate transaction data set for each IC card number by classifying it through threshold judgment, as follows: like ,but and The route involves short transfers. like ,but and The transfer mode is between the two. like ,but and The route involves a long transfer. in, This indicates the threshold for short transfer time. This indicates the lower limit of the transfer time. This indicates the upper limit of transfer time. This represents the threshold for long transfer times.
8. A computer-readable medium, characterized in that, It stores a computer program executed by an electronic device, which, when run on the electronic device, causes the electronic device to perform the steps of the method as described in any one of claims 1-7.
Citation Information
Patent Citations
Bus IC card passenger transfer station judgment method combining intelligent dispatching data
CN103280100A
Method for determining transfer service level between bus and subway
CN115115233A