A method for identifying intercity travel modes based on sparse spatiotemporal big data of origin and destination locations.

By mining the spatiotemporal context information of origin and destination points and building machine learning models in intercity travel, the problem of travel mode identification under sparse trajectory data is solved, achieving high-precision intercity travel mode classification, which is applicable to multiple data sources.

CN121502102BActive Publication Date: 2026-04-03TONGJI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-01-14
Publication Date
2026-04-03

Smart Images

  • Figure CN121502102B_ABST
    Figure CN121502102B_ABST
Patent Text Reader

Abstract

This invention relates to the field of traffic big data analysis technology, and specifically to a method for identifying intercity travel modes based on sparse spatiotemporal big data of origin and destination spatial locations. The method includes the following steps: Step S1, constructing an intercity travel dataset and extracting sparse trajectories; Step S2, discriminative feature engineering for sparse trajectories: constructing a feature system based on the spatiotemporal context of origin and destination, including: origin and destination spatial location features, origin and destination time features, travel cost features, and the number of trajectory points and dwell time features; Step S3, based on the intercity travel dataset obtained in Step S1, implementing small-sample training set labeling based on spatial matching rules; Step S4, constructing and training a machine learning traffic mode classification model; Step S5, predicting the traffic mode for intercity trips labeled "traffic mode undetermined" in Step S3. This invention effectively overcomes the limitations on recognition accuracy caused by trajectory data sparsity and inaccurate intermediate point time information, possesses universality, and can achieve refined classification and recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of traffic big data analysis technology, specifically to a method for identifying intercity travel modes based on sparse spatiotemporal big data of origin and destination spatial locations. Background Technology

[0002] With the rapid development of regional economies and the continuous advancement of urban integration, intercity transportation connections within metropolitan areas are becoming increasingly close. Accurate identification of intercity travel modes is of great value for the scientific planning of intercity integrated transportation systems and the optimization of transportation resource allocation. Currently, urban travel mode identification technologies based on spatiotemporal big data such as mobile phone signaling and GPS positioning are relatively mature. However, intercity travel is characterized by long distances, large spatial spans, uneven signal coverage along the route (especially weak signals in urban boundaries and remote areas), and significant differences between the transportation network structure (such as high-speed rail, suburban rail, and long-distance buses) and the urban road network. Therefore, travel mode identification models suitable for urban travel are difficult to directly apply to intercity travel scenarios. In intercity travel, due to uneven signal coverage and privacy protection strategies, data sampling intervals are large, and trajectory points are extremely sparse (typically ≤3 trajectory points per trip).

[0003] Through the retrieval and analysis of existing literature and patents, current methods for identifying travel modes based on spatiotemporal big data mainly rely on the following three technical approaches:

[0004] Category 1: Rule-based matching method using high-sampling-frequency dense trajectory data: This method relies on data sources such as high-frequency mobile phone signaling or dense GPS trajectories. Its core technology lies in utilizing the complete travel path information recorded by continuous and dense trajectory points to make inferences through the following two rules: First, spatial matching and topological analysis are performed between the trajectory point sequence and the transportation network (such as road and railway alignments), and the mode of travel is determined based on the path overlap. Second, fine motion features such as instantaneous speed, average speed, and acceleration are calculated based on the dense trajectory points, and these are matched with typical speed ranges for different modes of transportation (e.g., walking <5 km / h, car 60-120 km / h, high-speed rail >250 km / h) to complete the identification.

[0005] Category 2: Supervised Learning Methods Based on Volunteer-Annotated Data: To address the anonymity issue of most spatiotemporal big data, this approach recruits volunteers to collect sample data with real travel mode labels in specific case areas. The technical process is as follows: First, volunteers record their modes of transportation used in travel experiments through questionnaires, travel logs, etc.; then, the volunteers' personal information is linked to their personal information and trajectory information from the data provider to construct a training dataset containing complete trajectory information and real travel mode labels; finally, motion features (such as instantaneous velocity and acceleration) are extracted from these dense trajectories to train a machine learning classification model for classifying the remaining anonymized data.

[0006] Category 3: Direct Determination Method Based on Location Information from Dedicated Communication Infrastructure: This method utilizes dedicated communication infrastructure in specific transportation scenarios, such as dedicated base stations in subway tunnels or dedicated wireless network nodes along high-speed rail lines. The key technology lies in pre-constructing a rule base containing the geographical location information of these dedicated base stations. When a user's trajectory points appear within the signal range of a specific type of dedicated base station, it can be directly determined that the user has adopted the corresponding mode of transportation (e.g., entering the base station range of a subway tunnel indicates taking the subway). Under ideal conditions, this method can provide accurate passenger entry and exit time sequence information.

[0007] While the aforementioned technical solutions are effective under specific conditions, the increasing stringency of data privacy policies and the diverse sampling strategies employed by devices have made the sparsity and anonymization of trajectory data an irreversible trend. This exposes significant limitations of existing technologies that rely on specific data conditions when dealing with sparse intercity trajectory points.

[0008] First, the technical foundation of rule-based matching and supervised learning methods based on dense trajectories (corresponding to categories 1 and 2 above) lies in the continuity of data and high sampling rates. However, in intercity travel, due to uneven signal coverage and privacy protection strategies, the data sampling interval is large, and trajectory points are extremely sparse (typically ≤3 trajectory points per trip). Sparse trajectories, on the one hand, cannot provide enough spatial points to support effective spatial matching and topological analysis with the transportation network, causing geofencing-based rule-based methods to fail; on the other hand, it makes it impossible to calculate fine motion features such as instantaneous velocity and acceleration. The calculated "segment velocity" can only reflect the average movement speed over a long period of time and cannot characterize key motion behavior patterns, resulting in a sharp decrease in accuracy or even complete unusability for both velocity-based rule matching and motion-feature-based supervised learning models.

[0009] Secondly, supervised learning methods based on volunteer data (corresponding to category 2 above) face serious practical bottlenecks in their application. In intercity travel scenarios, organizing volunteers to complete long-distance, high-cost travel experiments and obtaining their complete personal privacy information for data association requires enormous human and material resources and has poor scalability. More importantly, under increasingly stringent privacy protection regulations, obtaining and associating volunteers' sensitive personal information has become increasingly difficult or even impossible. This makes it difficult to achieve the core step of building high-quality labeled datasets, severely restricting the large-scale application of this technical approach.

[0010] Furthermore, the limitations of the determination method based on dedicated base stations (corresponding to the third category above) are as follows: First, such dedicated base station information usually belongs to the core assets of communication operators and is extremely difficult for external researchers to obtain; Second, under the condition of sparse trajectory points, the user's trajectory point sequence may just miss these discretely distributed dedicated infrastructure nodes, resulting in the lack of key judgment basis, thus causing the method to fail.

[0011] Furthermore, a key issue generally overlooked by existing technologies is that they all fail to fully explore and utilize the strong correlation between the spatiotemporal attributes of origin-destination (OD) points and travel modes. It is generally accepted in transportation behavior research that travel purpose (reflected by the spatial location attributes of OD points, such as from residential areas to transportation hubs, from airports to central business districts, etc., as well as temporal attributes) is the decisive factor in choosing a mode of transportation. Existing methods overemphasize the trajectory pattern of the travel process while neglecting the highly reliable and inevitable contextual information of origin and destination points, even with sparse data. This leads to insufficient prior knowledge in the models, especially in intercity travel scenarios where intermediate point information is severely lacking, greatly limiting their recognition capabilities.

[0012] In summary, existing technologies face inherent technical bottlenecks and application obstacles when confronted with the dual challenges of data sparsity and privacy protection. Therefore, there is an urgent need in this field for a novel travel mode identification method suitable for complex intercity traffic scenarios. This method should be specifically designed for sparse trajectory conditions, effectively circumvent privacy and data acquisition challenges, and deeply utilize origin-destination (OD) spatiotemporal context information. Summary of the Invention

[0013] To address the problems existing in current technologies, this invention provides a method for identifying intercity travel modes from spatiotemporal big data of sparse trajectory points. The core of this method lies in its approach to the sparse nature of intercity travel trajectory points. Instead of relying on spatial matching of dense trajectory midpoints or instantaneous velocity features, it deeply mines and utilizes the spatiotemporal context information of origin and destination (OD) points as core features. This is combined with a rule-based small-sample annotation process and a machine learning classification model to achieve accurate identification of intercity travel modes across the entire dataset of sparse trajectories.

[0014] Spatiotemporal big data refers to large-scale datasets that record the time and space information of an individual's movement and stay in space, including but not limited to mobile phone signaling data, location-based service (LBS) data, GPS data, etc.

[0015] The sparse trajectory point characteristic refers to the fact that the total number of trajectory points effectively recorded by an individual during a single trip is less than or equal to 3. Given the characteristics of spatiotemporal big data, the starting point (point O) and ending point (point D) of a single trip can always be recorded. Therefore, a sparse trajectory refers to the trajectory data that can be recorded in addition to points O and D, including one intermediate stop point.

[0016] Technical solution

[0017] A method for identifying intercity travel modes based on sparse spatiotemporal big data of origin and destination locations includes the following steps:

[0018] Step S1: Construction of intercity travel dataset and sparse trajectory extraction;

[0019] Effective intercity travel segments are selected and constructed from raw spatiotemporal big data to provide a suitable data foundation for subsequent innovative processing.

[0020] Step S2, Discriminative Feature Engineering for Sparse Trajectories: Based on the spatiotemporal context of origin and destination (OD), construct a feature system, including: spatial location features of origin and destination, temporal features of origin and destination, travel cost features, and number and dwell time features of trajectory points.

[0021] This step is the primary innovation in addressing the challenges of sparse trajectories and achieving high-precision recognition. To solve the problem of feature scarcity caused by the lack of intermediate point information in sparse trajectories, this invention proposes to shift the focus of data mining to the origin and destination points of the journey and construct four types of feature variables.

[0022] Step S3: Based on the intercity travel dataset obtained in step S1, implement small sample training set annotation based on spatial matching rules;

[0023] First, obtain vector data of high-speed rail, urban rail transit, and highway routes and stations, and construct a traffic network buffer zone for them; then, perform spatial overlay analysis on the intercity travel trajectory points (O point, D point, and intermediate point) obtained from S1 with the buffer zones of the above-mentioned transportation stations and routes, and label the corresponding transportation mode (such as "high-speed rail") or "to be determined".

[0024] Step S4: Construct and train a machine learning traffic mode classification model;

[0025] The feature variables defined in step S2 are used as input features of the machine learning model. The intercity travel data automatically generated in step S3 based on spatial matching rules and labeled as "high-speed rail", "rail transit" and "highway" are used as training sample library to train the machine learning classification model.

[0026] The purpose of this step is to use the specific data generated in the previous steps to train a predictive model that can classify transportation modes based on macroscopic features such as origin and destination (OD), which is suitable for travel mode classification of sparse trajectory data.

[0027] Step S5: Predict the mode of transportation for intercity travel labeled "mode of transportation undetermined" in step S3;

[0028] For all intercity travel data marked as "transportation mode undetermined" in step S3, extract the feature variables defined in step S2, and input them into the optimal model trained in step S4 for prediction to obtain the most likely transportation mode for each trip.

[0029] Ultimately, this will enable the complete identification of all intercity travel modes.

[0030] Step S1 is as follows:

[0031] (1) Data Preprocessing and Trajectory Point Filtering: The spatiotemporal big data is preprocessed, and user trajectory data is sorted by user ID and dwell time, with valid trajectory points for each user identified. The criteria for determining trajectory points are: for a single dwell point at the same location, the dwell time... It should exceed the preset threshold. For multiple consecutive stops at the same geographical location, they are merged into a single stop, and their total stay duration is sum( It should exceed the preset threshold. Obtain the daily trajectory point sequence for all users.

[0032] (2) Intercity travel user screening: Users whose trajectory points appear in two different prefecture-level cities within a single day are screened out to determine that the user has intercity travel behavior on that day.

[0033] (3) Determination of origin and destination (points O and D): For users with intercity travel behavior:

[0034] ① The duration of its last stop in the city of departure. Exceeding the threshold The location is determined as the origin (Origin, point O) of this intercity trip. The departure time from point O is recorded as the departure time.

[0035] ② Determine the length of their first stay in the destination city. Exceeding the threshold The location is determined as the destination (point D) of this intercity trip. The arrival time at point D is recorded as the arrival time.

[0036] (4) Sparse trajectory segment extraction: Taking points O and D as the core, all trajectory points between them in the time series are extracted to form a complete intercity travel trajectory. In the extracted intercity travel trajectories, the total number of trajectory points (including points O, D, and intermediate points) is usually less than or equal to 3, which meets the definition of sparse trajectory points. All intercity travel trajectories of all users constitute the intercity travel dataset.

[0037] In this embodiment, the threshold Set to 10 minutes, threshold Set to 30 minutes.

[0038] Step S2 is as follows:

[0039] The feature system is as follows:

[0040] (1) Spatial location features of origin and destination points: Extract the latitude and longitude coordinates of points O and D. Form four feature variables: longitude of point O, latitude of point O, longitude of point D, and latitude of point D. This step uses the absolute spatial location of the OD points as direct input features, enabling the model to learn the strong correlation between the specific spatial locations served by different modes of transportation (such as city centers, important business districts, important public activity centers, densely populated residential areas, etc.) and travel modes. This is a breakthrough from the traditional approach that ignores the spatial semantic features of OD points.

[0041] (2) Origin and Destination Time Features: Extract the departure time of point O and the arrival time of point D. This forms two feature variables: departure time and arrival time. Specifically, this includes the start time of the stay at the origin (o_stime), the end time of the stay at the origin (o_etime), the start time of the stay at the destination (d_stime), and the end time of the stay at the destination (d_etime). This step provides the model with the temporal context of travel, enabling it to capture the differences in operating times (e.g., high-speed rail has fixed schedules, and road traffic has peak hours) and time costs among different modes of transportation, thus compensating for the time dimension information lost due to the inability to calculate instantaneous speed.

[0042] (3) Travel cost characteristics: Calculate the Euclidean distance between points O and D as the travel distance. Calculate the difference between departure time and arrival time as the travel duration. Divide the travel distance by the travel duration to calculate the average speed. Travel distance, duration, and average speed are the most direct and effective macroscopic motion characteristics that distinguish different modes of transportation. These macroscopic motion characteristics can still be reliably calculated under sparse conditions, effectively replacing the unavailable instantaneous speed characteristics.

[0043] (4) Number of trajectory points and dwell characteristics: Count the number of intermediate trajectory points other than points O and D in a single trip, and calculate the average dwell time at all intermediate points. This forms two characteristic variables: the number of dwell points along the way and the average dwell time along the way. Under the condition of extremely sparse trajectory points, the presence or absence of intermediate points and dwell behavior can be used as auxiliary judgment criteria (for example, long-distance driving may involve short stops at service areas, and the dwell time at high-speed rail stations is much longer than that of rail transit, etc.).

[0044] Step S3 is as follows:

[0045] To overcome the following two challenges: ① the high cost and privacy issues associated with relying on volunteer annotation, and ② the difficulty of rule matching based on dense trajectory points, this invention designs a novel, manual-free automatic annotation mechanism suitable for sparse trajectory data:

[0046] (1) Construction of traffic network buffer: Obtain vector data of high-speed rail, rail transit (such as subway), and highway (such as expressway and national highway) routes and stations, and create buffers for them.

[0047] For a railway line, the buffer zone is the actual width of the train track and the surrounding adjacent area; for a station, the buffer zone is the typical area where passengers enter and exit the station, wait, and transfer.

[0048] (2) Spatial matching: Spatial overlay analysis is performed on the trajectory points (O point, D point and intermediate point) of each intercity trip obtained from S1 and the buffer zones of the above-mentioned transportation stations and routes.

[0049] (3) Transportation mode labeling: Each intercity trip in the intercity travel dataset obtained by S1 is labeled. If a trip has trajectory points that fall within the buffer of a single type of transportation network and no trajectory points that fall within the buffer of other types of transportation networks, it is labeled with high confidence as the corresponding transportation mode (such as "high-speed rail"); otherwise, it is labeled as "pending".

[0050] For example, if a trajectory has three points, and only one point falls within the buffer zone of a high-speed rail line, while the other two points do not fall within the buffer zones of any other line, then this trajectory will be marked as "High-speed rail". Conversely, if another point on this trajectory falls within the buffer zone of a highway line, then this trajectory will be marked as "Pending".

[0051] It should be noted that although most trips cannot be determined by this rule under sparse data, its core value lies in its ability to automatically and cost-effectively "filter" a small portion (about 15%) of samples with extremely high label quality from the full dataset, providing a training set that is difficult to obtain with traditional methods for subsequent supervised learning.

[0052] Step S4 is as follows:

[0053] (1) Dataset partitioning: The intercity travel data automatically labeled with “high-speed rail”, “rail transit” and “highway” generated in step S3 based on spatial matching rules is used as the training sample library. This sample library is divided into the model training set and the test set according to a preset ratio (e.g., 8:2).

[0054] (2) Model training: All four types of feature variables (including but not limited to the spatial location of origin and destination, time of origin and destination, travel cost, number of trajectory points and stay characteristics, etc.) defined in step S2 of each trip in the training set are used as input features (X) of the machine learning model; and their corresponding transportation mode labels are used as the learning target (y) of the model.

[0055] (3) Model tuning and validation: The configured training set (X, y) is input into the selected machine learning classification algorithm (such as LightGBM, XGBoost, etc.) for training. To further improve model performance, techniques such as grid search and random search are used to optimize the model's hyperparameters, and k-fold cross-validation is used to evaluate the performance of different parameter combinations.

[0056] (4) Model validation: Use the reserved test set to evaluate the classification performance of the trained final model and ensure that its key indicators such as accuracy, precision, and recall meet the application requirements.

[0057] The model trained in this step uses a newly constructed feature system based on sparse trajectories and centered on the spatiotemporal context of origin and destination (OD). Its training data comes from high-confidence small samples automatically labeled according to rules, which makes the model specifically suitable for sparse trajectory scenarios and able to make classification decisions based on the spatiotemporal information features of origin and destination.

[0058] Beneficial effects

[0059] Compared with the prior art, the technical solution of this invention has the following innovations and advantages:

[0060] (1) Transportation Mode Recognition Feature Engineering Based on Origin-Destination (OD) Spatial Context Semantics. This invention breaks through the fundamental limitation of existing technologies that must rely on dense trajectory information during the journey, and instead mines the spatial location information inherent in the origin and destination points themselves and their derived macroscopic features (such as Euclidean distance between ODs, travel time, and average speed) as the core discrimination criteria for machine learning models. This invention is the first to discover and utilize the strong correlation between the spatial location of OD points and the choice of transportation mode, thereby effectively overcoming the constraints on recognition accuracy caused by the sparsity of trajectory data and the inaccuracy of intermediate point time information due to privacy protection policies. Ablation experiments show that OD spatial location features improve the model's performance on sparse datasets by 19.2%.

[0061] (2) Machine learning method based on origin-destination (OD) spatial context semantics. The feature extraction and machine learning model architecture design of this invention are fundamentally independent of the number of trajectory points and sampling frequency, and its performance is not significantly degraded by data sparsity (such as data containing only origin and destination points). Feature engineering based on origin-destination spatial context semantics can effectively train machine learning models. The core advantage of this method lies in its universality. It can seamlessly adapt to various spatiotemporal big data from different sampling strategies and sources (such as mobile signaling, LBS, GPS) without modifying the core algorithm, providing a unified and robust technical solution for solving the common industry problem of data sparsity.

[0062] (3) High-precision identification of multi-level rail transit modes based on origin-destination (OD) spatial context semantics. The method of this invention can effectively distinguish between different levels of rail transit modes (such as high-speed rail and urban (suburban) rail) with similar speed characteristics but different service functions, achieving a refined technical effect. By learning the unique OD point spatial distribution patterns of different rail transit services through machine learning models, it is possible to achieve refined classification and identification based on the spatial semantic function of origin and destination points in scenarios where instantaneous speed cannot be relied upon for differentiation. Attached Figure Description

[0063] Figure 1 This is the overall flowchart of the algorithm of this invention;

[0064] Figure 2 This is the extraction process of the intercity travel dataset in an embodiment of the present invention;

[0065] Figure 3 This is a schematic diagram of a geohash grid according to an embodiment of the present invention;

[0066] Figure 4 This invention provides a rule-based discriminant method for identifying intercity travel modes in an embodiment of the present invention.

[0067] Figure 5 This is a schematic diagram of the LightGBM model construction according to an embodiment of the present invention;

[0068] Figure 6 This is a performance comparison of different machine learning algorithms in embodiments of the present invention. Detailed Implementation

[0069] The technical solution provided in this application will be further described below with reference to specific embodiments and accompanying drawings. The advantages and features of this application will become clearer from the following description.

[0070] Intercity travel, as referred to in this invention, means cross-city travel where the origin and destination are not in the same prefecture-level city, including travel that crosses prefecture-level city administrative boundaries and provincial administrative boundaries. Sparse trajectory points refer to travel segments (including origin and destination points) with fewer than or equal to 3 trajectory points.

[0071] This invention aims to solve the technical challenge of identifying intercity travel modes under conditions of sparse trajectory points (≤3). The core inventive concept is to abandon the traditional paradigm that relies on travel process data (dense trajectories, instantaneous speed) and instead construct a new technology system that integrates geographically based automatic annotation and machine learning classification with highly reliable origin-destination (OD) information as the core.

[0072] Example

[0073] A method for identifying intercity travel modes based on sparse spatiotemporal big data of origin and destination locations, the overall process of which is as follows: Figure 1 As shown, it includes the following steps:

[0074] S1 Data Preprocessing and Intercity Travel Extraction

[0075] This step accurately identifies individual intercity trips from the raw sparse data. The raw sparse data used in this embodiment comes from mobile signaling data provided by China Unicom in March 2024, covering the entire areas of Suzhou and Shanghai.

[0076] The following is an explanation of the parameter method:

[0077] (1) Input data description:

[0078] The input data processed in this invention is a user dwell time table as shown in Table 1, generated from raw spatiotemporal big data using a mature dwell point identification algorithm (such as a clustering method based on time and distance thresholds), which forms the basis for subsequent analysis. Due to privacy protection policies, the data has been subjected to gridded blurring processing. In this embodiment, the spatial granularity of the spatiotemporal big data is a geohash7 grid with a size of approximately 150m. 150m. The data includes user ID (uid), grid number (grid_id), start time (stime), and end time (etime). Its basic structure is shown in Table 1. Data types include String (string type) and DateTime (UTC timestamp accurate to milliseconds, formatted as "year-month-day-hour-minute-second").

[0079] Table 1 User Stay Table

[0080]

[0081] To comply with current privacy policies, readily available spatiotemporal big data is often presented in a grid format rather than using specific latitude and longitude coordinates in traditional data. This fine-grained grid data obscures the user's specific activity points but indicates the area where the user has been, representing a crucial measure in addressing current privacy policies. Geohash is a spatial encoding technique that compresses two-dimensional latitude and longitude coordinates into one-dimensional strings. This grid recursively divides the plane into smaller blocks using interval bisection, and then calculates the corresponding Base32 encoding through binary encoding.

[0082] In addition, the spatiotemporal big data provider will also provide the geographic region corresponding to the grid, i.e., the grid metadata table, including the grid center longitude (centroid_lon) and latitude (centroid_lat), the district / county (qx_name) and city (city_name) where the grid is located. Its basic structure is shown in Table 2.

[0083] Table 2 Grid Metadata Table

[0084]

[0085] (2) Time threshold for filtering trajectory points:

[0086] In the data preprocessing stage, this invention determines the dwell time of trajectory points. It should exceed the preset threshold. No specific regulations are specified; they can be tailored to the data characteristics and the research area. For the spatiotemporal big data in this example, The threshold is set at 10 minutes, which is the duration of stay at a single stop. Or the total duration of stay at multiple consecutive stops at the same location A point must be at least 10 minutes old to be considered a valid trajectory point.

[0087] (3) Determine the time threshold for the OD point:

[0088] In this invention, a threshold is used to determine whether the OD point remains for more than a certain period of time. No specific regulations are set; they can be tailored to the data characteristics and the research area. For the spatiotemporal big data in this example, the threshold is set at 30 minutes, meaning both OD points must meet the threshold. >30 minutes.

[0089] (4) Sparse trajectory features of intercity travel dataset

[0090] The S1 process yields an intercity travel dataset, where each record represents a user's stop information during an intercity trip, including the spatiotemporal information of point O and point D for that trip (Table 3). Statistical analysis shows that the average number of trajectory points (including O and D) per trip in the example dataset is approximately 3.24, which conforms to the definition of sparse trajectory points.

[0091] Table 3 Intercity Travel Data

[0092]

[0093] This step ensures that even with extremely sparse trajectory points (total number ≤ 3), the spatiotemporal information of point O and point D for each trip is always complete and available, providing a reliable data prerequisite for subsequent innovative feature engineering based on OD points.

[0094] S2. Extract feature variables from the entire intercity travel data.

[0095] The core task of S2 is to extract feature vectors for machine learning classification for each trip record from the intercity travel dataset constructed in S1. Given the severe lack of inter-trajectory information during the trip due to data sparsity (total number of trajectory points ≤ 3), the feature engineering in this invention abandons the traditional approach of relying on dense trajectories and shifts the focus of information mining to the complete and stable origin-destination (OD) points in each trip, supplemented by necessary macro-statistics, thereby constructing a discriminative feature system suitable for sparse conditions.

[0096] Based on an intercity travel trajectory point (O, … (D) Calculate the intercity travel characteristics, where points O and D represent the origin and destination of the intercity trip. … Let S1 represent the n intermediate stops for an intercity trip. For each intercity trip record obtained from S1, calculate the following 13 feature variables across 4 categories:

[0097] (1) Spatial location characteristics of the origin and destination points (4):

[0098] This feature dimension includes four feature variables: the longitude of the starting grid center (o_lon), the latitude of the starting grid center (o_lat), the longitude of the ending grid center (d_lon), and the latitude of the ending grid center (d_lat). These directly represent the absolute spatial location of the origin and destination points of intercity travel. By allowing the model to learn the spatial coordinates of the origin and destination points, it can capture the specific spatial location patterns served by different modes of transportation (for example, high-speed rail travel usually occurs at high-speed rail stations between cities, while some rail transit connects urban areas and suburbs), that is, understand the intrinsic connection between the spatial semantics of "where to come from and where to go" and the mode of travel.

[0099] By connecting the intercity travel dataset described in Table 3 to the grid metadata table shown in Table 2 using O and D point grid encoding, the spatial location features of the four origin and destination points can be obtained.

[0100] (2) Time characteristics of the start and end points (4):

[0101] This feature dimension includes four variable values: the start time of the stay at the origin (o_stime), the end time of the stay at the origin (o_etime), the start time of the stay at the destination (d_stime), and the end time of the stay at the destination (d_etime). These directly represent the temporal characteristics of the origin and destination points of intercity travel. This feature provides the model with crucial travel time context, enabling it to identify differences in operating times (such as fixed schedules for high-speed rail and flexible departures for highways) and time costs among different modes of transportation, effectively compensating for the time dimension information lost due to the inability to calculate instantaneous speed.

[0102] The four origin-destination time feature variables mentioned above can be directly obtained from the intercity travel dataset described in Table 3.

[0103] (3) Travel cost characteristics (3):

[0104] This feature dimension includes three variable values: travel distance (t_distance), travel time (t_time), and travel speed (t_speed). These three variables together constitute the cost characteristics of travel. They can be reliably calculated even under sparse trajectory conditions and serve as effective macro-indicators for distinguishing between modes of transportation such as high-speed rail, urban rail transit, and automobiles.

[0105] The travel distance (t_distance) is calculated using the latitude and longitude of the center of the origin and destination grids (points O and D), and can be obtained by connecting Table 2 to Table 3 based on the origin and destination grid codes. The distance calculation uses the Haversine formula, as follows:

[0106]

[0107] In the formula: o_lat , o_lon — The latitude and longitude of point O;

[0108] d_lat , d_lon —Latitude and longitude of point D;

[0109] —Latitude difference between points O and D;

[0110] —Difference in longitude between points O and D;

[0111] —Earth radius, which is taken as 6371 km in this invention.

[0112] —Archetangent function

[0113] The trip duration (t_time) is calculated by subtracting the start time from the end time from the destination time, as shown in Table 3. The calculation formula is as follows:

[0114]

[0115] Travel speed (t_speed) is obtained by dividing the travel distance by the travel time. The calculation formula is as follows:

[0116]

[0117] (4) Number of trajectory points and dwell characteristics (2):

[0118] This feature dimension includes the average dwell time during the journey ( ), number of stops along the way ( There are two characteristic variables. The average dwell time is the average dwell time at all intermediate points between the origin and destination (OD) points, and the number of dwell points refers to the total number of intermediate points between the OD points. In the context of sparse data, this feature can serve as an auxiliary basis for judgment. For example, high-speed rail travel may stop at stations along the way, rail transit travel may also stop at stations along the way, and road travel may stop at service areas; however, the stopping behavior patterns of these different modes of transportation differ.

[0119] The formula for calculating the number of stops along the way is as follows:

[0120]

[0121] In the formula: —The i-th stop

[0122] ——Counting function

[0123] The formula for calculating the average dwell time during the journey is as follows:

[0124]

[0125] In the formula: —Duration of stay at the i-th intermediate stop

[0126] —Start time of the i-th intermediate stop

[0127] —The end time of the stay at the i-th intermediate stop

[0128] S3 Automatic Labeling of Training Samples Based on Spatial Matching Rules

[0129] To overcome the high cost and privacy challenges of traditional volunteer-based annotation, as well as the bottleneck of difficulty in obtaining dense trajectory data, this invention designs an automated annotation mechanism suitable for sparse trajectory data. The aim is to automatically select a portion of high-confidence labeled samples from the full dataset, providing a reliable training foundation for subsequent supervised learning.

[0130] (1) Construct a grid library for traffic network buffer zones:

[0131] This invention acquires vector data for high-speed rail, urban rail transit (in this example, subways spanning Suzhou and Shanghai, as well as suburban railways), and highways (in this example, expressways and national highways) including routes and stations. Since routes and stations are line and point elements and lack spatial extent, a buffer zone approach is used for location matching. For routes, the buffer zone simulates the actual width of the train track and its surrounding area; for stations, the buffer zone simulates typical areas where passengers enter and exit, wait, and transfer. In practice, buffer zones are created using geographic information software such as ArcGIS PRO, centered on the routes and stations. The distance threshold for the buffer zones is not specifically defined in this invention and can be determined based on data characteristics and the study area. In this embodiment, to match the data granularity of the Geohash7 grid (approximately 150m × 150m), the buffer zone radius is uniformly set to 150 meters. This buffer zone is spatially connected to the Geohash7 grid to obtain a set of grids located within the buffer zones of each transportation network.

[0132] (2) Automatic annotation rules:

[0133] For each trip in the intercity travel dataset, examine all its trajectory points (O, … The grid where D) is located. If the intercity travel trajectory point only appears in the neighboring grid of the corresponding mode of transportation, it is identified as the corresponding mode of transportation, and the corresponding mode of transportation is labeled for this intercity trip. The specific process is as follows: Figure 4 As shown in the figure. In this embodiment, intercity travel modes only include three categories: high-speed rail travel, rail transit travel, and road travel. High-speed rail travel includes trains starting with "G", "D", or "C" with speeds greater than 160 km / h. Rail transit includes subways, suburban railways, and other trains with speeds less than 160 km / h. Road travel includes all types of ground road transportation such as cars and buses.

[0134] ①If the trajectory point falls only within a certain distance buffer zone of the high-speed rail line and station, then this intercity trip is labeled as "high-speed rail";

[0135] ②If the trajectory point falls only within a certain distance buffer zone of the rail transit line and station, then this intercity trip is labeled as "rail transit";

[0136] ③ If the trajectory points fall only within a certain distance buffer zone of the highway route and stations, then this intercity trip is labeled as "highway".

[0137] ④ If the trajectory point falls within the buffer zone of the above-mentioned multiple routes and stations, or is not within any buffer zone, then this intercity trip will be labeled as "travel mode pending".

[0138] (3) Size of the labeled dataset:

[0139] After performing the above steps, only about 15% of the intercity travel datasets in this embodiment were effectively labeled with modes of transportation. On the one hand, this confirms that under sparse trajectory conditions, spatial matching alone cannot achieve full data identification; on the other hand, this step can label a portion of sparse trajectories with modes of transportation through spatial matching, forming a small-scale, high-quality training set that requires no manual intervention, is low-cost, and avoids privacy risks. This step provides technical support for solving the common problem of "how to apply supervised learning to sparse trajectories lacking labeled data," laying a data foundation for the training of subsequent machine learning models.

[0140] S4. Machine Learning Model Training and Optimization

[0141] The purpose of S4 is to train a predictive model that can accurately classify intercity travel modes based on sparse trajectory features, especially the spatiotemporal context information of origin and destination (OD).

[0142] This invention is the first to use the aforementioned automatically labeled data as samples and a sparse feature system with OD features as the core as input to train a classifier specifically suitable for this type of data, thereby solving the problem of traditional models failing on sparse data.

[0143] (1) Data preparation and partitioning:

[0144] From the labeled dataset automatically generated by spatial rules in S3, samples labeled as high-speed rail, rail transit, and highway are selected. The data frames of these samples are divided into feature matrix X and label vector y. The feature matrix X contains all 13 feature variables of 4 classes extracted for these samples in S2, which in particular include the spatial location features of the origin and destination (o_lon, o_lat, d_lon, d_lat) and the temporal features of the origin and destination (o_stime, o_etime, d_stime, d_etime).

[0145] The dataset is randomly divided into a training set (X_train, y_train) and a test set (X_test, y_test) according to a certain ratio, and stratified sampling is used to ensure that the proportion of each class is consistent. The split ratio can be determined according to specific circumstances, and is generally 8:2 or 7:3.

[0146] (2) Model training and optimization:

[0147] Classification is one of the important application scenarios of machine learning. This invention uses a machine learning classification model to learn 13 features in 4 categories from the training set to train an intercity transportation mode classification model.

[0148] This invention does not specify a particular machine learning classification method. Different machine learning algorithms, such as XGBoost, LightGBM, and Random Forest, can be used for different case data. A comparison of different machine learning models can be performed first to determine the optimal model algorithm. However, for all different case data, the 13 feature variables across 4 categories proposed in this invention should be used uniformly for model training and prediction.

[0149] This embodiment employs the LightGBM algorithm. Model training and optimization based on LightGBM involves two key steps: hyperparameter optimization and iterative model training.

[0150] Hyperparameter optimization:

[0151] Hyperparameters are parameters set before model training begins and control the training process itself. To achieve optimal performance, this invention employs a grid search method to systematically optimize four key hyperparameters of LightGBM:

[0152] learning_rate: controls the contribution of each decision tree to the final model, with a value range of [0.01, 0.05, 0.1].

[0153] num_leaves (maximum number of leaves in a single tree): directly controls the complexity of the model, with a value range of [31, 63, 127].

[0154] max_depth (maximum depth of the tree): used to prevent overfitting, with a value range of [-1, 5, 10] (-1 means no limit).

[0155] subsample (training sample sampling rate): The proportion of data used in each iteration to enhance robustness, with a value range of [0.8, 1.0].

[0156] During optimization, 5-fold cross-validation was used to evaluate the performance of each hyperparameter combination on the training set, with accuracy as the evaluation metric. Finally, the hyperparameter combination that performed best in cross-validation was selected for subsequent model training.

[0157] Model training iterations:

[0158] After determining the optimal combination of hyperparameters, the LightGBM model training iteration process is performed using all training set data, and the steps are as follows ( Figure 5 ):

[0159] Input training data: Use the high-speed rail travel dataset, rail transit travel dataset, and highway travel dataset obtained in S3 as the input training set;

[0160] Model initialization: Initialize the model .

[0161] Iteratively build the decision tree: for each iteration round m (m=1, 2, ..., M) Perform the following operations:

[0162] ① Calculate the negative gradient: For the current model Calculate the negative gradient of all training samples with respect to the loss function. In this embodiment, the squared error loss function is used:

[0163]

[0164] in, For the true value, For predicted values, For sample size

[0165] ② Construct a decision tree Using the negative gradient of the current iteration as the target, a new decision tree is fitted. During the tree construction process, LightGBM automatically applies its core acceleration techniques: histogram algorithm (discrete continuous features into buckets, significantly reducing the computational cost of finding the optimal split point), gradient-based one-sided sampling (GOSS) (retaining samples with large gradients and randomly sampling samples with small gradients, focusing on training samples that the current model struggles to judge), and mutually exclusive feature bundling (EFB) (bundling mutually exclusive features into one feature, thereby reducing feature dimensionality).

[0166] ③ Update the model: Add the newly constructed tree to the model, and the update formula is as follows: ,in, The learning rate is obtained from the hyperparameter optimization process.

[0167] Terminating training: Repeatedly build the decision tree iteratively until the preset maximum number of iterations is reached, or until the model's performance on the validation set no longer improves for several consecutive iterations (early stopping), then training terminates. The final output is the trained model. .

[0168] (3) Model performance:

[0169] To determine the most suitable classification algorithm for this invention, this embodiment conducted a controlled variable comparison experiment under the same training set (i.e., the high-speed rail, rail transit, and highway travel datasets generated by S3) and the same input features (i.e., the 13 features across 4 classes defined by S2). Five representative ensemble learning algorithms were selected: AdaBoost, Random Forest (RF), Gradient Boosting Decision Tree (GBDT), XGBoost, and LightGBM. To ensure the fairness and sufficiency of the comparison, a grid search method was used to optimize the key hyperparameters of each algorithm to find its best performance in the current task. Under their respective optimal hyperparameter settings, their classification accuracy was compared on the same test set. The comparison results clearly show that the LightGBM algorithm achieved the highest classification accuracy in this task. Figure 6 Therefore, LightGBM is preferred as the core classifier in this embodiment.

[0170] It should be noted that the technical solution protected by this invention is not limited to LightGBM. In general implementation, those skilled in the art can also follow this comparison process and select other machine learning algorithms with comparable performance as alternatives based on the specific data characteristics.

[0171] In this embodiment, the optimized model achieved an accuracy of 87.2% on the test set, an improvement of 2.4 percentage points compared to the unoptimized model, demonstrating the effectiveness of the method. Furthermore, in the trained model, the "origin and destination spatial location features" (o_lon, o_lat, d_lon, d_lat) and "origin and destination temporal features" (o_stime, o_etime, d_stime, d_etime) ranked among the top six in importance, validating the effectiveness and superiority of using origin and destination spatiotemporal context information for predicting intercity travel modes based on sparse trajectories.

[0172] Furthermore, to verify the core contribution of the feature system proposed in this invention, especially the spatial location features of origin and destination, an ablation experiment was conducted in this embodiment (Table 4). Under the same model structure and training conditions, after removing the "spatial location features of origin and destination" (o_lon, o_lat, d_lon, d_lat) from the input features, the accuracy of the model on the test set significantly decreased from 87.2% to 68%. After removing the "temporal features of origin and destination" (o_stime, o_etime, d_stime, d_etime) from the input features, the accuracy of the model on the test set significantly decreased from 87.2% to 84%. Simultaneously, after removing both the "spatial location features of origin and destination" (o_lon, o_lat, d_lon, d_lat) and the "temporal features of origin and destination" (o_stime, o_etime, d_stime, d_etime) from the input features, the accuracy of the model on the test set significantly decreased from 87.2% to 67%.

[0173] Table 4 Ablation Experiment Results

[0174]

[0175] The ablation experiments described above further validated the effectiveness and superiority of using origin-destination spatiotemporal context information for intercity travel mode prediction based on sparse trajectories. The origin-destination spatiotemporal context information effectively reflects the differences in origin and start time among different travel modes, thus contributing key feature information to intercity travel mode prediction under sparse trajectory conditions.

[0176] S5 Intercity Travel Mode Identification (Pending)

[0177] For the travel data marked "pending" in S3, extract all the features described in S2 and input them into the optimal model trained in S4 for prediction. The predicted labels output by the model are the most likely modes of transportation for these trips. Finally, by merging all labeled and predicted modes of transportation, a complete identification of intercity travel modes across the entire sparse trajectory dataset is achieved.

[0178] In this embodiment, the final prediction results are basically consistent with the results of the official "Sixth Comprehensive Transportation Survey of Shanghai", which verifies the reliability of the intercity traffic identification algorithm (Table 5).

[0179] Table 5 Comparison of Model Recognition Results and Official Travel Survey Results

[0180]

[0181] The above description is merely a description of preferred embodiments of this application and is not intended to limit the scope of this application in any way. Any changes or modifications made by those skilled in the art based on the above-disclosed technical content should be considered as equivalent and valid embodiments and fall within the scope of protection of the technical solution of this application.

Claims

1. A method for identifying intercity travel modes based on sparse spatiotemporal big data of origin and destination spatial locations, characterized in that, Includes the following steps: Step S1: Construction of intercity travel dataset and sparse trajectory extraction; Effective intercity travel segments were selected and constructed from raw spatiotemporal big data. Step S2, Discriminative Feature Engineering for Sparse Trajectories: Based on the spatiotemporal context of origin and destination, construct feature variables, including: spatial location features of origin and destination, temporal features of origin and destination, travel cost features, and number and dwell time features of trajectory points; Step S3: Based on the intercity travel dataset obtained in step S1, implement small sample training set annotation based on spatial matching rules; First, obtain vector data of high-speed rail, urban rail transit, and highway routes and stations, and construct a traffic network buffer for them; then, perform spatial overlay analysis on the intercity travel trajectory points obtained from S1, including O point, D point and intermediate points, and label the corresponding transportation mode or "to be determined". Step S4: Construct and train a machine learning traffic mode classification model; The feature variables defined in step S2 are used as input features of the machine learning model. The intercity travel data automatically generated in step S3 based on spatial matching rules and labeled as "high-speed rail", "rail transit" and "highway" are used as training sample library to train the machine learning classification model. Step S5: Predict the mode of transportation for intercity travel labeled "mode of transportation undetermined" in Step S3; Extract the feature variables defined in step S2 from all intercity travel data marked as "transportation mode undetermined" in step S3, and input them into the optimal model trained in step S4 for prediction to obtain the most likely transportation mode for each trip. Ultimately, this will enable the complete identification of all intercity travel modes. Step S3 is as follows: (1) Construction of traffic network buffer zones: Obtain vector data of high-speed rail, rail transit and highway lines and stations, and create buffer zones for them; for lines, the buffer zone is the actual width of the train track and the surrounding adjacent area; for stations, the buffer zone is the typical area where passengers enter and exit the station, wait and transfer. (2) Spatial matching: Spatial overlay analysis is performed on the trajectory points of each intercity trip obtained from S1 and the buffer zones of the above-mentioned transportation stations and routes; (3) Transportation mode labeling: Each intercity trip in the intercity travel dataset obtained by S1 is labeled; when a trip has a trajectory point that falls within the buffer of a single type of transportation network and no trajectory point falls within the buffer of other types of transportation networks, it is labeled with high confidence as the corresponding transportation mode; otherwise, it is labeled as "pending".

2. The method for identifying intercity travel modes based on sparse spatiotemporal big data of origin and destination spatial locations according to claim 1, characterized in that, Step S1 is as follows: (1) Data preprocessing and trajectory point filtering: preprocess the spatiotemporal big data, sort the user trajectory data according to the user ID and the dwell time, and identify the valid trajectory points of each user; The criteria for determining trajectory points are: for a single stop point at the same location, the duration of its stay. It should exceed the preset threshold. For multiple consecutive stops at the same geographical location, they are merged into a single stop, and their total stay duration is sum( It should exceed the preset threshold. Obtain the daily trajectory point sequence for all users; (2) Intercity travel user screening: Users whose trajectory points appear in two different prefecture-level cities within a single day are screened out to determine that the user has intercity travel behavior on that day; (3) Origin and Destination Determination: For users with intercity travel behavior: ① The duration of its last stop in the city of departure. Exceeding the threshold The location is determined as point O, the starting point of this intercity trip, and the departure time from point O is recorded as the departure time. ② Determine the length of their first stay in the destination city. Exceeding the threshold The location is determined as point D, the destination of this intercity trip, and the arrival time at point D is recorded as the arrival time. (4) Sparse trajectory segment extraction: Taking O and D as the core, extract all trajectory points between the two in the time series to form a complete intercity travel trajectory; all intercity travel trajectories of all users constitute the intercity travel dataset.

3. The method for identifying intercity travel modes based on sparse spatiotemporal big data of origin and destination locations according to claim 2, characterized in that, threshold Set to 10 minutes, threshold Set to 30 minutes.

4. The method for identifying intercity travel modes based on sparse spatiotemporal big data of origin and destination locations according to claim 1, characterized in that, In step S2, the feature variables are as follows: (1) Spatial location characteristics of origin and destination: Extract the latitude and longitude coordinates of point O and point D to form four feature variables: longitude of point O, latitude of point O, longitude of point D, and latitude of point D; (2) Origin and destination time characteristics: Extract the departure time of point O and the arrival time of point D; form two feature variables: departure time and arrival time; specifically including the start time of the stay at the origin, the end time of the stay at the origin, the start time of the stay at the destination, and the end time of the stay at the destination. (3) Travel cost characteristics: Calculate the Euclidean distance between point O and point D as the travel distance; Calculate the difference between departure time and arrival time as the travel duration; Calculate the average speed by dividing the travel distance by the travel time. (4) Number of trajectory points and dwell characteristics: Count the number of intermediate trajectory points other than O and D in a trip, and calculate the average dwell time of all intermediate points; Two characteristic variables are formed: the number of stops along the way and the average duration of stops along the way; under the condition of extremely sparse trajectory points, the presence or absence of intermediate points and the stopping behavior are used as auxiliary judgment criteria.

5. The method for identifying intercity travel modes based on sparse spatiotemporal big data of origin and destination locations according to claim 1, characterized in that, Transportation modes are automatically labeled according to the following rules: For each trip in the intercity travel dataset, examine all its trajectory points (O, … If the intercity travel trajectory point in the grid containing (D) only appears in the neighboring grids of the corresponding mode of transportation, it is identified as the corresponding mode of transportation, and the corresponding mode of transportation label is assigned to this intercity trip; for intercity travel data including high-speed rail travel, rail transit travel, and highway travel, the processing is as follows: ①If the trajectory point falls only within the buffer zone of the high-speed rail line and station, then this intercity trip is labeled as "high-speed rail"; ②If the trajectory point falls only within the buffer zone of the rail transit line and station, then this intercity trip is labeled as "rail transit"; ③ If the trajectory points fall only within the buffer zone of the highway route and stations, then this intercity trip is labeled as "highway". ④ If the trajectory point falls within the buffer zone of multiple routes and stations, or is not within any buffer zone, then this intercity trip will be labeled "mode of travel pending".

6. The method for identifying intercity travel modes based on sparse spatiotemporal big data of origin and destination locations according to claim 1, characterized in that, Step S4 is as follows: (1) Data set partitioning: The intercity travel data automatically labeled with "high-speed rail", "rail transit" and "highway" generated in step S3 based on spatial matching rules is used as the training sample library; this sample library is divided into model training set and test set according to a preset ratio; (2) Model training: Take all four types of feature variables defined by step S2 for each trip in the training set as input features X of the machine learning model; take the corresponding transportation mode label as the learning target y of the model; (3) Model tuning and validation: Input the above-configured training set (X, y) into the selected machine learning classification algorithm for training; use grid search and random search techniques to optimize the hyperparameters of the model, and use k-fold cross-validation to evaluate the performance of different parameter combinations; (4) Model validation: Use the reserved test set to evaluate the classification performance of the trained final model and ensure that its key indicators of accuracy, precision and recall meet the application requirements.

Citation Information

Patent Citations

  • Traffic travel origin and destination identification method based on space-time clustering analysis algorithm

    CN106600960A

  • A bus route optimization design method and system based on residents' travel big data

    CN119783930A