Shared bicycle connection rail transit combined travel mode recognition method
By acquiring and processing shared bicycle order data and subway station data, identifying shared bicycles’ travel modes to connect to subways, the problem of lack of data evidence and inaccurate identification in the buffer radius selection in the prior art is solved, and higher identification accuracy is achieved.
Patent Information
- Application Number
- CN202411782945.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-05-09
AI Technical Summary
When identifying the mode of traveling with shared bicycles to subway, the prior art lacks clear data evidence to prove the rationality of the buffer radius, and the identification method is not accurate enough, and non-connected travel may be mistaken for traveling with subway.
By obtaining urban shared bicycle order data and subway line site data, calculate the single riding distance and time of shared bicycles, match the starting and end points of shared bicycles and the nearest subway station, define the optimal connection buffer radius, and eliminate non-connection cycling in the connection buffer, and use the KDTree algorithm to conduct efficient nearest neighbor search.
It significantly improves the accuracy of the identification of real shared bicycle shuttle behaviors and ensures the accurate identification of the travel mode of shared bicycle shuttle shuttle subways.
Smart Images

Figure CN119961638A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of shared bicycle docking combined travel mode recognition, and in particular relates to a shared bicycle docking rail transit combined travel mode recognition method. Background Art
[0002] Identifying the combined travel behavior of shared bicycles and subways is the first step in exploring shared bicycles and subways, and is the basis for subsequent research and analysis. There are two main types of shared bicycles and subways: ① Users use shared bicycles to ride from the departure point to the subway station (the first kilometer), which is defined as entry transfer; ② Users ride shared bicycles from the subway station to the destination (the last kilometer), which is defined as exit transfer.
[0003] At present, there is no clear trip information to record shared bicycles connecting to subway trips, and combined trip records are difficult to obtain, so it is necessary to identify connecting trips. Existing research mainly uses the buffer method to identify connecting trips. The buffer is constructed with the geometric center of the subway station or the entrances and exits of the station as the center of the circle, and the number of valid shared bicycle trips in the buffer is calculated. The shared bicycle trips whose starting or ending point falls within the buffer are regarded as connecting trips.
[0004] However, most studies mainly rely on experience when selecting the buffer radius, and do not provide clear data evidence to prove its rationality. Secondly, existing studies only consider trips that start or end within a specific buffer zone of a subway station, and regard shared bicycle trips in this area as connecting to the subway. However, the land use around subway stations is relatively complex, and users use shared bicycles for a variety of purposes. Therefore, this identification method is not accurate and may regard some non-connecting trips as connecting to the subway. Summary of the invention
[0005] In order to overcome the above-mentioned deficiencies in the prior art, the present invention provides a method for identifying a combined travel mode of shared bicycles connecting to rail transit, which eliminates non-connecting rides and improves the accuracy of identifying real shared bicycle connecting behaviors.
[0006] In order to achieve the above-mentioned object of the invention, the technical solution adopted by the present invention is:
[0007] The present invention provides a method for identifying a combined travel mode of a shared bicycle connecting to rail transit, comprising the following steps:
[0008] S1. Obtain the city's shared bicycle order data and subway line station data, and calculate the shared bicycle single riding distance and duration;
[0009] S2, matching the nearest subway station according to the starting and ending points of the shared bicycle and calculating the distance between them;
[0010] S3. Define the optimal connection buffer radius;
[0011] S4. Eliminate non-connection riding in the connection buffer zone;
[0012] S5. Identify the rides whose starting point or end point is within the optimal connection buffer as combined travel orders.
[0013] The beneficial effects of the present invention are as follows: the shared bicycle connecting to rail transit combined riding mode identification method provided by the present invention uses shared bicycle riding data and rail transit line station data as core data, performs spatial position matching on the two sets of data to identify shared bicycle connecting to subway riding behavior, calculates shared bicycle riding distance, adopts KDTree algorithm, and implements efficient nearest neighbor search by constructing KD tree, matches the nearest subway station for each shared single GPS point and calculates the distance between the two points. Establish the best subway station connecting buffer zone, filter out riding data with the starting point or end point within the connecting buffer zone, and eliminate non-connecting travel within the connecting zone by constraint conditions, so as to improve the accuracy of identifying the shared bicycle connecting to subway travel mode.
[0014] Furthermore, the S1 obtains the city's shared bicycle order data and subway line station data, and calculates the shared bicycle's single riding distance and duration, which specifically includes the following steps:
[0015] S11. Clean the original data, including coordinate conversion, removal of null values and duplicate data, removal of switch locks and abnormal latitude and longitude data, and extraction of data on shared bicycle travel time within subway operation hours;
[0016] S12. Calculate the riding time and distance, and remove abnormal data on riding time and distance. If the riding time or distance of a shared bicycle is very short, it may be because the user scanned a faulty bicycle or the GPS positioning is unstable; if the riding time or distance of a shared bicycle is very long, it may be because the user uses the shared bicycle for sightseeing, cycling exercise, etc., which is contrary to the shared bicycle connecting to the subway. Therefore, it is necessary to remove trips with a travel time of less than 60s and more than 1h, as well as trips with a distance of less than 100m and more than 5000m. In order to calculate the actual distance between the starting and ending points of each ride, the Haversine formula is used, and the distance is determined by longitude and latitude, as shown in Formula I and Formula II:
[0017]
[0018] Where: d is the great circle distance between two points; r is the radius of the earth; and is the latitude between the two points; λ1 and λ2 are the longitude between the two points. Assuming that the earth is a regular sphere and its radius r = 6378km, then the spherical distance between any two points, as shown in Formula III, is:
[0019]
[0020] Where D 1,2 is the distance between two points 1 and 2.
[0021] The beneficial effects of adopting the above further solution are: preprocessing the data, calculating the riding time and distance, and eliminating abnormal riding data.
[0022] Furthermore, the step S2 of matching the nearest subway station according to the starting and ending points of the shared bicycle and calculating the distance therebetween specifically includes the following steps:
[0023] S21, matching the processed latitude and longitude data of the shared bicycle riding start point and end point with the subway station data;
[0024] S22. Use Python environment to build KDTree algorithm, establish spatial index of shared bicycle riding data and subway station data, search and number the subway stations closest to the riding starting point and end point, and calculate the distance between the subway station closest to the riding starting point and the riding starting point (s_dist) and the distance between the subway station closest to the riding end point and the riding end point (e_dist).
[0025] The beneficial effect of adopting the above further scheme is: matching the nearest subway station for each shared bicycle GPS point, and using the KDTree algorithm to establish a K-dimensional tree spatial index for the K-dimensional spatial points that need to be matched. During neighbor matching, the input point can be quickly retrieved in the tree to find the nearest neighbor point, reducing the computational complexity of the spatial neighbor matching task.
[0026] Furthermore, S3 defines the optimal docking buffer radius, and establishes a multi-ring circular docking buffer with each subway station as the center based on the processed shared bicycle order data and subway station line data, and determines the optimal buffer radius by observing the growth rate of shared bicycle entry orders in the multi-ring circular buffer. Assuming that the number of shared bicycle travel orders first increases rapidly with the increase of the buffer radius, and then as the buffer radius increases, the growth rate gradually decreases and tends to be stable, the optimal buffer radius of the subway station is determined by observing the change trend. Specifically, it includes the following steps:
[0027] S31. Based on the shared bicycle order data and subway station data, taking each subway station as the center, construct a multi-ring circular connection buffer zone of a certain distance for each subway station;
[0028] S32, calculating the spatial positions of the shared bicycle travel starting point, travel end point and multi-ring buffer zone of each subway station, intersecting and merging them to determine the overlapping area or intersection between them, and extracting the shared bicycle travel data in the multi-ring buffer zone;
[0029] S33, using the "distance" field in the extracted travel data attribute table, counting the increase in shared bicycle orders within different radius buffers, including the increase in inbound orders (i.e., shared bicycle trips with their destination near the subway station) and the increase in outbound orders (i.e., shared bicycle trips with their starting point near the subway station);
[0030] S34. Visualize the changes in the number of shared bicycle inbound and outbound orders and the changes in order growth rate under different radius buffers, observe the changing trends and determine the optimal buffer radius.
[0031] The beneficial effect of adopting the above further scheme is: determining the optimal buffer radius of the subway station by observing the changing trend of the shared bicycle order volume under different buffer radiuses is more accurate than the traditional method of selecting the buffer radius based on experience.
[0032] Furthermore, the step S4 removes non-connection riding within the connection buffer distance, specifically including the following steps:
[0033] S41. Determine whether the starting point and the end point of the shared bicycle are at the same distance from the nearest subway station. If the starting point and the end point are the same subway station, the ride is a subway ride. If they are different stations, based on the traveler's psychology of choosing the nearest station, the difference between the riding distance d1 and the distance d2 from the starting point (or end point) to the nearest subway station needs to be calculated. When the difference is small, it can be considered that the trip is a subway ride. When the difference between the two is large, further screening is required;
[0034] S42, determine whether the subway lines are the same. When d1 and d2 differ greatly, if the starting and ending points of the shared bicycles are at two stations on the same subway line, this is in conflict with the psychological tendency of travelers to choose the nearest subway station. It is a substitute for subway travel, not a connecting trip, so such order data needs to be eliminated; if the starting and ending points are at subway stations on different lines, it may be a connecting subway trip, which requires further judgment;
[0035] S43. Analyze riding characteristics and riding rules based on user riding data, and set a threshold for the distance of shared bicycle connection. When the starting and ending points of a trip are located at two subway stations on different lines, some travelers will choose to connect to the subway by shared bicycle to avoid transfers. To determine this type of connection trip, eliminate the riding data with a riding distance less than the set threshold to obtain the connection riding data.
[0036] The beneficial effect of adopting the above further scheme is: rules for eliminating non-connecting trips are proposed based on the spatial location of the starting and ending points of shared bicycles, subway lines, riding distances, etc., effectively improving the accuracy of connecting trip identification.
[0037] Furthermore, based on the above elimination of non-connecting travel orders within the connection buffer zone, rides with a starting point or end point within the optimal connection buffer zone are identified as a shared bicycle and subway connection combination trip. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 This is a flowchart of the steps of the method for identifying the travel mode of a shared bicycle connecting to rail transit in the present invention;
[0039] Figure 2 A flow chart of the KDTree algorithm constructed in the example of the present invention;
[0040] Figure 3 A flow chart for defining an optimal connection buffer zone radius in an example of the present invention;
[0041] Figure 4 It is a matching diagram of subway multi-ring buffer and shared bicycle orders in the example of the present invention;
[0042] Figure 5 A graph showing the number of shared bicycle orders and growth rates at different buffer zone radii in an example of the present invention;
[0043] Figure 6 This is a diagram of a method for eliminating non-connected rows in an example of the present invention. DETAILED DESCRIPTION
[0044] Based on the shared bicycle order data and subway line station data for five consecutive working days from May 10 to May 14, 2021 in Shenzhen, the present invention proposes a method for identifying the combined travel mode of shared bicycles connecting to rail transit. The technical solution of the present invention is illustrated below in conjunction with the accompanying drawings and implementation examples.
[0045] like Figure 1 As shown, the process of the embodiment specifically includes the following steps:
[0046] S1. Obtain the order data of shared bicycles in Shenzhen and the data of subway lines and stations, and calculate the distance and duration of a single ride of a shared bicycle;
[0047] The data processing specifically includes the following steps:
[0048] S11. Clean the original shared bicycle order data, including coordinate conversion: In order to match the shared bicycle data with the geographic information data of the research area of Nanjing, use Python statements to convert the shared bicycle order data coordinate system into the WGS-84 coordinate system; remove null values and duplicate data: USER_ID is a unique value in a shared bicycle travel record, and USER_ID can be used to determine whether there are duplicate data records in the bicycle data; remove switch locks and abnormal longitude and latitude data: Due to deviations in the GPS device during transmission, there may be abnormal situations such as longitude and latitude coordinates of 0, the same longitude and latitude coordinates of the starting point and the end point, and the same order start time and end time. Such abnormal travel records should be removed; eliminate trips that start or end outside the Shenzhen Metro operating hours (6:00 to 23:00).
[0049] S12. Calculate the riding time and distance, and remove abnormal data on riding time and distance. If the riding time or distance of a shared bicycle is very short, it may be because the user scanned a faulty bicycle or the GPS positioning is unstable; if the riding time or distance of a shared bicycle is very long, it may be because the user uses the shared bicycle for sightseeing, cycling exercise, etc., which is contrary to the shared bicycle connecting to the subway. Therefore, it is necessary to remove trips with a travel time of less than 60s and more than 1h, and trips with a distance of less than 100m and more than 5000m. In order to calculate the actual distance between the starting and ending points of each ride, the Haversine formula is used, and the distance is determined by longitude and latitude, as shown in Formula I and Formula II:
[0050]
[0051] Where: d is the great circle distance between two points; r is the radius of the earth; and is the latitude between the two points; λ1 and λ2 are the longitude between the two points. Assuming that the earth is a regular sphere and its radius r = 6378km, then the spherical distance between any two points is as shown in Formula III:
[0052]
[0053] Where D 1,2 is the distance between points 1 and 2. The format of the processed shared bicycle order data is shown in the following table:
[0054]
[0055] In the figure, USER_ID is the user ID; START_TIME and END_TIME are the start and end time of the order; WGS_START_LNG and WGS_START_LAT are the longitude and latitude of the starting point of the ride; WGS_END_LNG and WGS_END_LAT are the longitude and latitude of the end point of the ride; distance is the ride distance (m); duration is the ride duration (min).
[0056] S2. Match the nearest subway station according to the starting and ending points of the shared bicycles and calculate the distance between them.
[0057] As process Figure 2 As shown in the figure, a KDTree algorithm is constructed to match the nearest subway station for each shared bicycle GPS point, and a K-dimensional tree spatial index is established for the K-dimensional spatial points that need to be matched. During the nearest neighbor matching, the input point can be quickly retrieved in the tree to find the nearest neighbor point, reducing the computational complexity of the spatial nearest neighbor matching task.
[0058] S21. Match the processed latitude and longitude data of the starting and ending points of shared bicycle rides with the subway station data; in the example, the data of 239 urban subway stations in Shenzhen in 2021, including 11 subway lines in 9 administrative regions, were selected, and their coordinate system was ensured to be the WGS-84 coordinate system.
[0059] S22. Use Python environment to build KDTree algorithm, establish spatial index of shared bicycle riding data and subway station data, search and number the subway stations closest to the riding starting point and the end point, and calculate the distance between the subway station closest to the riding starting point and the riding starting point (s_dist) and the distance between the subway station closest to the riding end point and the riding end point (e_dist). The output results are shown in the following table:
[0060]
[0061] S3. Define the optimal connection buffer radius.
[0062] Based on the 3,480,553 orders of shared bicycles in Shenzhen for five consecutive days and the line data of Shenzhen subway stations, a multi-ring circular buffer zone was established with each subway station as the center. The optimal buffer zone radius was determined by observing the order volume and growth rate of shared bicycles entering and leaving the station in the multi-ring circular buffer zone. The flow chart is as follows: Figure 3 As shown, the specific steps include:
[0063] S31, such as Figure 4As shown in the figure, using geographic information system software, the Shenzhen shared bicycle order data and subway line station data processed in the above steps are put into the same layer for spatial position matching. With each subway station as the center and 50m as the interval, a multi-ring circular buffer zone of 50m-500m is constructed for each subway station;
[0064] S32, respectively intersecting and merging the shared bicycle travel starting point and travel end point with the multi-ring buffer of each subway station, calculating the geometric intersection, and extracting the shared bicycle travel data in the multi-ring buffer;
[0065] S33, using the "distance" field in the extracted travel data attribute table, counting the increase in shared bicycle orders within different radius buffers, including the increase in inbound orders (i.e., shared bicycle trips with their destination near the subway station) and the increase in outbound orders (i.e., shared bicycle trips with their starting point near the subway station);
[0066] S34. Visualize the changes in the number of shared bicycle inbound orders and outbound orders under different radius buffers, observe the changing trend of the growth rate of shared bicycle orders under different radius buffers to determine the optimal buffer radius.
[0067] Taking the outbound traffic as an example, the specific changes in the increase in outbound traffic orders of shared bicycles in each buffer zone are as follows: Figure 4 As shown in the figure, by observing the growth rate of shared bicycle orders under different buffer radius, it can be seen that there is an obvious inflection point in the growth rate of shared bicycle orders around 200 meters, indicating that within the 200-meter buffer zone, the growth rate of shared bicycle orders is faster, and after the 200-meter buffer zone, the growth rate of shared bicycle orders is slow. This shows that shared bicycle trips are obviously concentrated within 200 meters of subway stations, and 200 meters is finally determined as the optimal connection buffer radius.
[0068] Step S4 removes non-connection riding within the connection buffer distance. The flow chart is as follows: Figure 5 As shown, the specific steps include:
[0069] S41. Determine whether the starting point and the end point of the shared bicycle are at the same distance from the nearest subway station. If the starting point and the end point are the same subway station, the ride is a subway ride. If they are different stations, based on the traveler's psychology of choosing the nearest station, it is necessary to calculate the difference between the riding distance d1 and the distance d2 from the nearest subway station to the starting point (or end point). When the difference is small, that is, the difference is less than 200 meters, it can be considered that the trip is a subway ride. When the difference between the two is large, that is, greater than 200 meters, further screening is required;
[0070] S42, determine whether the subway lines are the same. When d1 and d2 differ greatly, if the starting and ending points of the shared bicycles are at two stations on the same subway line, this is in conflict with the psychological tendency of travelers to choose the nearest subway station. It is a substitute for subway travel, not a connecting trip, so such order data needs to be eliminated; if the starting and ending points are at subway stations on different lines, it may be a connecting subway trip, which requires further judgment;
[0071] S43. By analyzing the riding characteristics and riding rules based on the riding data of shared bicycle users, it can be concluded that 90% of the riding distance for connecting to the subway is completed within 2 kilometers, so the threshold for the shared bicycle connecting riding distance is set to 2 kilometers. When the starting and ending points of a trip are located at two subway stations on different lines, some travelers will choose to connect to the subway by shared bicycle to avoid transfers. In order to determine this type of connecting trip, the riding data with a riding distance greater than 2 kilometers is eliminated to obtain the connecting riding data.
[0072] The beneficial effects of the present invention are as follows: the method for identifying the combined travel mode of shared bicycles connected to rail transit provided by the present invention uses a nearest neighbor matching algorithm to match the subway station closest to the start / end point of a shared bicycle ride, and calculates the distance between the subway station closest to the start / end point of the ride and the start / end point of the ride. The optimal docking buffer zone for subway stations is constructed based on subway station data and a large amount of shared bicycle order data, and orders whose distances between the start and end point of the ride and the nearest subway station are within the radius of the optimal buffer zone are screened out. Finally, non-connecting ride orders in the buffer zone are eliminated under the constraints of the spatial location of the start and end point, subway lines, and riding distances, and the screened ride records are identified as combined travel, which significantly improves the recognition accuracy of the combined travel mode of shared bicycles connected to rail transit.
[0073] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the embodiments here. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the claims of the present invention.
Claims
1. A method for identifying a combined travel mode of a shared bicycle connecting to rail transit, characterized in that: The steps include: S1. Obtain the city's shared bicycle order data and subway line station data, and calculate the shared bicycle single riding distance and duration; S2, matching the nearest subway station according to the starting and ending points of the shared bicycle and calculating the distance between them; S3. Define the optimal connection buffer radius; S4. Eliminate non-connection riding in the connection buffer zone; S5. Identify the rides whose starting point or end point is within the optimal connection buffer as combined travel orders.
2. The method for identifying a combined travel mode of a shared bicycle connected to rail transit according to claim 1, characterized in that: The S1 obtains the city's shared bicycle order data and subway line station data, and calculates the shared bicycle single riding distance and duration, including the following steps: S11. Clean the original data, including coordinate conversion, removal of null values and duplicate data, removal of switch locks and abnormal latitude and longitude data, and extraction of data on shared bicycle travel time within subway operation hours; S12, calculating the riding time and the riding distance, and eliminating abnormal riding time and riding distance data.
3. The method for identifying a combined travel mode of a shared bicycle connected to rail transit according to claim 1, characterized in that: The step S2 includes the following steps when matching the nearest subway station according to the starting and ending points of the shared bicycles and calculating the distance between them: S21, matching the processed latitude and longitude data of the shared bicycle riding start point and end point with the subway station data; S22. Use Python environment to build KDTree algorithm, establish spatial index of shared bicycle riding data and subway station data, search and number the subway stations closest to the riding starting point and end point, and calculate the distance between the subway station closest to the riding starting point and the riding starting point (s_dist) and the distance between the subway station closest to the riding end point and the riding end point (e_dist).
4. The method for identifying a combined travel mode of a shared bicycle connected to rail transit according to claim 1, characterized in that: S3 defines the optimal docking buffer radius, establishes a multi-ring circular docking buffer with each subway station as the center, and determines the optimal buffer radius by observing the number of shared bicycle entry orders and the order growth rate in the multi-ring circular buffer. Assuming that the number of shared bicycle travel orders first increases rapidly with the increase of the buffer radius, and then as the buffer radius increases, the growth rate gradually decreases and tends to be stable, the optimal buffer radius of the subway station is determined by observing the trend of the order growth rate. Specifically, it includes the following steps: S31. Based on the shared bicycle order data and subway station data, taking each subway station as the center, construct a multi-ring circular connection buffer zone of a certain distance for each subway station; S32, calculating the spatial positions of the shared bicycle travel starting point, travel end point and multi-ring buffer zone of each subway station, intersecting and merging them to determine the overlapping area or intersection between them, and extracting the shared bicycle travel data in the multi-ring buffer zone; S33, using the "distance" field in the extracted travel data attribute table, counting the number of shared bicycle orders within different radius buffers, including the number of inbound orders (i.e., shared bicycle trips with the end point near the subway station) and the number of outbound orders (i.e., shared bicycle trips with the start point near the subway station); S34. Visualize the changes in the number of shared bicycle inbound and outbound orders and the changes in order growth rate under different radius buffers, observe the changing trends and determine the optimal buffer radius.
5. The method for identifying a combined travel mode of a shared bicycle connected to rail transit according to claim 1, characterized in that: When the step S4 removes non-connection riding in the connection buffer zone, it includes the following steps: S41. Determine whether the starting point and the end point of the shared bicycle are at the same distance from the nearest subway station. If the starting point and the end point are the same subway station, the ride is a subway ride. If they are different stations, based on the traveler's psychology of choosing the nearest station, the difference between the riding distance d1 and the distance d2 from the starting point (or end point) to the nearest subway station needs to be calculated. When the difference is small, it can be considered that the trip is a subway ride. When the difference between the two is large, further screening is required; S42, determine whether the subway lines are the same. When d1 and d2 differ greatly, if the starting and ending points of the shared bicycles are at two stations on the same subway line, this is in conflict with the psychological tendency of travelers to choose the nearest subway station. It is a substitute for subway travel, not a connecting trip, so such order data needs to be eliminated; if the starting and ending points are at subway stations on different lines, it may be a connecting subway trip, which requires further judgment; S43. Analyze riding characteristics and riding rules based on user riding data, and set a threshold for the distance of shared bicycle connection. When the starting and ending points of a trip are located at two subway stations on different lines, some travelers will choose to connect to the subway by shared bicycle to avoid transfers. To determine this type of connection trip, eliminate the riding data with a riding distance greater than the set threshold to obtain the connection riding data.
6. The method for identifying a combined travel mode of a shared bicycle connected to rail transit according to claim 1, characterized in that: The KDTree algorithm is constructed to match the nearest subway station to the start and end point of a shared bicycle ride and calculate the distance. The optimal connection buffer radius of the subway station is determined by establishing a multi-ring buffer zone, and the rides whose start and end points are within the optimal connection buffer radius are screened out. The non-connection trips in the connection area are eliminated by using constraints such as the distance between the start and end point of the shared bicycle and the nearest subway station, the subway line, and the ride distance. By screening the constraint conditions, shared bicycle connection subway rides can be successfully identified, among which the rides whose start point is in the connection area are outbound connections, and the rides whose end point is in the connection area are inbound connections.