Public transport passenger travel portrait restoration method, device, equipment and medium
By integrating bus IC card and automatic passenger flow counting data, and performing data preprocessing, time calibration, and spatiotemporal trajectory matching, a high-precision passenger travel profile is generated, which solves the problem of incomplete passenger travel information in existing technologies and achieves accurate single-trip origin and destination points and long-term behavior tracking.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-18
- Publication Date
- 2026-03-24
AI Technical Summary
Existing technologies cannot simultaneously provide accurate information on the origin and destination of a passenger's single trip and long-term traceable passenger identification, resulting in insufficient accuracy in public transportation data analysis.
By integrating public transport IC card data and automatic passenger flow counting data, data preprocessing, time calibration, spatiotemporal trajectory matching, and frequent traveler identification are performed to generate a high-precision passenger travel profile.
It enables high-precision reconstruction of single-trip origin and destination information and long-term passenger behavior tracking, providing a high-quality data foundation and reliable analytical basis for traffic management.
Smart Images

Figure CN121722948A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of intelligent transportation systems and public transportation data analysis, in particular to a public transportation passenger travel portrait restoration method, device, equipment and medium. BACKGROUND
[0002] In the field of public transportation operation management and planning, accurately obtaining the complete travel trajectory of passengers, especially the travel chain containing accurate origin (Origin) and destination (Destination) information, is crucial for deep applications such as passenger flow analysis, line network optimization, and frequent passenger identification. Currently, the industry mainly relies on two types of electronic data sources: one is ticketing data based on passenger card swiping behavior (such as public transportation IC card data), and the other is automatic passenger flow counting data based on vehicle-mounted sensors.
[0003] However, both of the above two types of data sources have inherent technical limitations. Ticketing data can usually uniquely identify passengers through card numbers and has the ability to track the same passenger for a long time, but due to the widespread use of single-ticketing system (only swiping the card when getting on the vehicle), it severely lacks information about the passenger's alighting station, and cannot directly form a complete travel OD chain. Automatic passenger flow counting data (such as boarding and alighting counting based on video analysis) can relatively accurately record the time and location of each boarding and alighting event, forming single-trip OD information, but to protect passenger privacy, the data is usually anonymized, and the data between different trips cannot be linked, thus losing the ability to track the travel patterns of specific individuals for a long time. In existing technologies, attempts are often made to compensate for the shortcomings of single data through data fusion or estimation methods (for example, using complete OD data from other systems for estimation), but such methods have bottlenecks in accuracy, making it difficult to meet the dual requirements of high-precision single-OD restoration and long-term individual behavior tracking.
[0004] Therefore, how to effectively fuse multiple heterogeneous data with complementary properties to overcome their respective shortcomings and generate high-quality passenger travel records with accurate single-OD and long-term traceability has become a key technical challenge to improve the level of fine analysis of public transportation. SUMMARY
[0005] The technical problem to be solved by the present application is to overcome the technical defects of existing single data sources that cannot provide accurate single-trip origin and destination information of passengers and long-term traceable passenger identification, and to realize high-precision public transportation passenger travel chain restoration and long-term travel behavior tracking.
[0006] To solve the above technical problems, the technical scheme adopted by the present application is as follows: a public transportation passenger travel portrait restoration method, comprising the following steps: Acquire a first type of data and a second type of data; wherein, the first type of data includes passenger identification and boarding station information, but lacks or partially lacks alighting station information; the second type of data includes complete passenger boarding and alighting station information, but lacks persistent passenger identification for long-term tracking. Data preprocessing and standardization are performed on the first type of data and the second type of data to obtain standardized first type of record set and second type of record set; Based on the same operating vehicle, the timestamps in the second type of record set are time-calibrated to eliminate systematic clock drift between the acquisition devices of the second type of data and the acquisition devices of the first type of data; Based on the optimal allocation algorithm, the standardized first type of record set and the time-calibrated second type of record set are matched in time and space within the same vehicle trip to form a fused record; wherein, each fused record is associated with a unique passenger identifier and its complete origin and destination information.
[0007] Furthermore, the time calibration of timestamps in the second type of record set based on the same operating vehicle includes: From the first and second record sets of the same vehicle, identify at least one candidate record pair describing the same passenger's journey as an anchor pair; For each anchor point pair, calculate its time difference, and based on preset consistency check rules and reasonable range constraints, select valid time offset samples. Based on all the selected valid time offset samples, the statistically significant central trend value is calculated as the systematic time drift of the vehicle. The systematic time drift is applied to the timestamps of all second-type records corresponding to the vehicle.
[0008] Furthermore, identifying at least one candidate record pair describing the same passenger's journey as an anchor point pair from the first and second type of record sets of the same vehicle includes: Prioritize finding the first type of records and the second type of records where the boarding station information and the alighting station information are completely consistent as strong anchor points; If the number of strong anchor points is insufficient, then the first type of records and the second type of records with completely identical boarding station information are selected as weak anchor points.
[0009] Furthermore, based on all the selected valid time offset samples, the statistically significant central trend value is calculated, specifically by calculating the median of all valid time offset samples.
[0010] Furthermore, the step of matching the standardized first-class record set with the time-calibrated second-class record set within the same vehicle shift based on the optimal allocation algorithm includes: For m records of type I and n records of type II within a single vehicle trip, construct an m×n cost matrix C, where elements... This represents the matching cost between the i-th record of type I and the j-th record of type II; Define the matching cost The cost is a weighted sum of time difference cost and spatial difference cost, wherein the time difference cost is calculated based on the difference between boarding time and the difference between alighting time of the two records, and the spatial difference cost is calculated based on the distance between boarding station and alighting station of the two records. The cost matrix C is constrained and optimized by setting the matching cost corresponding to the individual difference cost that exceeds a preset threshold as a value that prohibits matching. Based on the optimized cost matrix, a bipartite graph optimal matching algorithm is used to find the one-to-one record allocation scheme with the minimum total matching cost.
[0011] Furthermore, the time difference cost is calculated based on the boarding time difference and alighting time difference between the first type of record and the second type of record, and when the alighting time information is missing, the corresponding time difference is not included in the time difference cost; the spatial difference cost is calculated based on the boarding station spatial distance and alighting station spatial distance between the first type of record and the second type of record, and when the station spatial coordinate information is missing, it reverts to judging the spatial difference based on the consistency of station names.
[0012] Furthermore, the method for reconstructing public transportation passenger travel profiles also includes a step of frequent traveler identification based on the fused records, specifically including: Records that conform to a preset travel time pattern are selected from the fused records; For each selected passenger, spatial clustering is performed on their boarding and alighting locations to determine their stable origin and destination areas. The most frequent origin-destination pairs for each passenger are statistically analyzed, and frequent flyer groups are identified based on this frequency.
[0013] The present invention also provides a device for reconstructing the travel profile of public transportation passengers, comprising: The data acquisition module is used to acquire a first type of data and a second type of data. The first type of data includes passenger identification and boarding station information, but lacks or partially lacks alighting station information. The second type of data includes complete passenger boarding and alighting station information, but lacks persistent passenger identification for long-term tracking. The preprocessing and standardization module is used to preprocess and standardize the first type of data and the second type of data to obtain a standardized first type of record set and a second type of record set. The time calibration module is used to perform time calibration on the timestamps in the second type of record set based on the same operating vehicle, so as to eliminate the systematic clock drift between the acquisition device of the second type of data and the acquisition device of the first type of data. The spatiotemporal trajectory matching module is used to perform spatiotemporal trajectory matching between the standardized first type of record set and the time-calibrated second type of record set within the same vehicle trip based on the optimal allocation algorithm, so as to form a fused record; wherein, each fused record is associated with a unique passenger identifier and its complete origin and destination information.
[0014] The present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor executes the computer program to implement the steps of the public transportation passenger travel profile reconstruction method as described above.
[0015] The present invention also provides a computer-readable storage medium having a computer program stored thereon, characterized in that, when the computer program is executed by a processor, it implements the steps of the public transportation passenger travel profile reconstruction method described above.
[0016] The beneficial effects of this invention are as follows: by creatively fusing complementary data of the first and second types, it resolves the core contradiction that a single data source cannot simultaneously achieve accurate single-time origin-destination (OD) reconstruction and long-term passenger tracking. Specifically, data preprocessing and standardization ensure the consistency of the fusion basis; vehicle-by-vehicle time calibration based on the same operating vehicle effectively eliminates matching errors caused by system clock drift between heterogeneous devices; and spatiotemporal trajectory matching based on the optimal allocation algorithm minimizes global matching costs, achieving accurate, one-to-one association of the two types of data within the same vehicle shift. The final fused record retains both the persistent passenger identifier of the first type of data and the complete origin-destination information of the second type of data, thus forming, for the first time at the data level, a passenger travel chain that combines high accuracy and long-term traceability, providing a reliable, high-quality data foundation for subsequent in-depth analysis and precise traffic management. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the structures shown in these drawings without creative effort.
[0018] Figure 1 This is a flowchart of the public transportation passenger travel profile reconstruction method according to an embodiment of the present invention; Figure 2 This is a flowchart illustrating the time calibration process according to an embodiment of the present invention; Figure 3 This is a flowchart illustrating the anchor point identification process according to an embodiment of the present invention. Figure 4 This is a flowchart of spatiotemporal trajectory matching according to an embodiment of the present invention; Figure 5 This is a flowchart illustrating the frequent flyer identification process according to an embodiment of the present invention. Figure 6 This is a diagram showing the straight-line distance distribution between boarding and alighting stations according to an embodiment of the present invention. Figure 7 This is a block diagram of a public transportation passenger travel profile reconstruction device according to an embodiment of the present invention; Figure 8 This is a schematic block diagram of a computer device according to an embodiment of the present invention. Detailed Implementation
[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0020] It should be noted that the descriptions involving "first," "second," etc., in this invention are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first" or "second" may explicitly or implicitly include at least one of that feature. Furthermore, the technical solutions of the various embodiments can be combined with each other, but only on the basis of being achievable by those skilled in the art. When the combination of technical solutions is contradictory or impossible to implement, such a combination of technical solutions should be considered non-existent and not within the scope of protection claimed by this invention.
[0021] like Figure 1 As shown, an embodiment of the present invention is: a method for reconstructing a travel profile of a public transportation passenger, comprising the following steps: S1. Obtain the first type of data and the second type of data; wherein, the first type of data includes passenger identification and boarding station information, but lacks or partially lacks alighting station information; the second type of data includes complete passenger boarding and alighting station information, but lacks persistent passenger identification for long-term tracking.
[0022] In this embodiment, the first type of data typically refers to bus IC card swipe data, which includes the card number (passenger identifier), boarding station name or code, and boarding timestamp, but lacks alighting station information. The second type of data typically refers to data from an automatic passenger flow counting system (such as an onboard camera counter), which includes the timestamp of each passenger boarding and alighting event and the corresponding station location (such as GPS coordinates or station name). However, due to anonymization processing, records from different trips cannot be correlated using the passenger identifier.
[0023] S2. Perform data preprocessing and standardization on the first type of data and the second type of data to obtain a standardized first type of record set and a standardized second type of record set.
[0024] This step forms the basis for subsequent exact matching and specifically includes: Unique identifier cleaning: Key identifier fields in the original data, such as card numbers and license plate numbers, are uniformly converted into string types for processing. This operation aims to fundamentally eliminate the risk of mistreating encoded IDs (such as 001234) as numerical values (1234), ensuring the semantic integrity and uniqueness of data identifiers, and providing an accurate basis for subsequent passenger and vehicle-based association matching.
[0025] Timestamp cleaning and formatting: Timestamp information from different systems with varying formats is uniformly converted into a standard, machine-readable format (such as Unix timestamps or ISO 8601 format). Records with non-standard formats or invalid content (such as future times or very early historical times) are considered unqualified data and are discarded, thereby ensuring that each record has a valid time reference that can be used for accurate spatiotemporal calculations.
[0026] Spatial coordinate cleaning: This step checks and validates the latitude and longitude coordinate fields in the records. First, it determines if the coordinates are valid numbers, then compares them with preset operational geofences (such as city administrative boundaries or public transport network areas). Only coordinate data within reasonable areas is retained; records with empty coordinates, incorrect formats, or those clearly outside the operational area (e.g., falling into lakes or outside the country) are discarded. This operation provides reliable and effective data assurance for the subsequent geographic distance-based similarity calculation module.
[0027] S3. Based on the same operating vehicle, time calibration is performed on the timestamps in the second type of record set to eliminate systematic clock drift between the acquisition device of the second type of data and the acquisition device of the first type of data.
[0028] In a specific embodiment, such as Figure 2 As shown, in step S3, the time calibration of the timestamps in the second type of record set based on the same operating vehicle includes: S31. Identify at least one candidate record pair describing the same passenger's journey as an anchor pair from the first type of record set and the second type of record set of the same vehicle.
[0029] In a specific embodiment, such as Figure 3 As shown, in step S31, identifying at least one candidate record pair describing the same passenger's journey as an anchor pair from the first and second type record sets of the same vehicle includes: S311. Prioritize finding the first type of records and the second type of records where the boarding station information and alighting station information are completely consistent as strong anchor points.
[0030] This step involves finding record pairs where the boarding and alighting stations match perfectly at the station name (or code) level. This dual constraint makes the possibility of a match being purely coincidental extremely low, thus providing a time benchmark with the highest confidence.
[0031] S312. If the number of strong anchor points is insufficient, then find the first type of record and the second type of record that are completely identical only in terms of boarding station information as weak anchor points.
[0032] In real-world data, strong anchor points may be scarce due to data errors or subtle differences in station naming. This step expands the candidate sample pool by relaxing the constraints (requiring only that the boarding stations are consistent), ensuring that a sufficient number of anchor points can be obtained for time offset estimation in most cases, thus enhancing the robustness of the method.
[0033] S32. Calculate the time difference for each anchor point pair, and select valid time offset samples based on preset consistency check rules and reasonable range constraints.
[0034] This step aims to eliminate false anchors, specifically including: For strong anchor points, calculate the time difference between their boarding stations respectively. ) and time difference between the alighting station ( In theory, the systematic clock drift between the same pair of devices should be a constant, therefore and The time difference should be very close. The algorithm checks if the absolute difference between the two time differences is within a small threshold (such as 5 seconds). If it exceeds this threshold, it is considered a false match and discarded. This solves the problem of false matches caused by the same station name but different actual itineraries.
[0035] Set a reasonable absolute range for the time difference (e.g., plus or minus 60 minutes). Any calculated time offset that exceeds this range will be considered an outlier (possibly due to serious issues such as incorrect date recording) and discarded to prevent it from contaminating the overall estimate.
[0036] S33. Based on all the selected valid time offset samples, calculate their statistically significant central trend value as the systematic time drift of the vehicle.
[0037] After the above screening, a series of relatively reliable time difference samples were obtained. To obtain an estimate that represents the true and stable offset, and to mitigate the influence of potential extreme outliers in the data, this step uses the median as the central trend value, denoted as . Compared to the arithmetic mean, the median is less sensitive to outliers, thus providing a more robust estimate of drift.
[0038] S34. Apply the systematic time drift amount to the timestamps of all second-type records corresponding to the vehicle.
[0039] The result to be calculated The value is uniformly added to the original timestamp field of all passenger flow counter data (second type of data) of the vehicle (including boarding time and alighting time), thereby achieving synchronization with the first type of card swipe data in the time dimension and eliminating key error sources for subsequent spatiotemporal matching.
[0040] In a specific embodiment, the step of calculating the statistically significant central trend value based on all selected valid time offset samples specifically involves calculating the median of all valid time offset samples.
[0041] S4. Based on the optimal allocation algorithm, the standardized first type of record set and the time-calibrated second type of record set are matched in the same vehicle shift to form a fused record; wherein, each fused record is associated with a unique passenger identifier and its complete origin and destination information.
[0042] In a specific embodiment, such as Figure 4 As shown, in step S4, the step of matching the standardized first-class record set with the time-calibrated second-class record set within the same vehicle shift based on the optimal allocation algorithm includes: S41. For m records of type I and n records of type II within a vehicle shift, construct an m×n cost matrix C, where elements... Let represent the matching cost between the i-th record of type I and the j-th record of type II. This step formalizes the matching problem as a bipartite graph matching problem, where the set For the first type of record, set For the second type of records, the goal is to find the optimal one-to-one match between U and V. .
[0043] S42. Define the matching cost. The cost is a weighted sum of time difference cost and spatial difference cost, whereby the time difference cost is calculated based on the difference between boarding and alighting times of the two records, and the spatial difference cost is calculated based on the distance between boarding and alighting stations of the two records.
[0044] In a specific embodiment, the time difference cost is calculated based on the boarding time difference and alighting time difference between the first type of record and the second type of record, and when the alighting time information is missing, the corresponding time difference is not included in the time difference cost; the spatial difference cost is calculated based on the boarding station spatial distance and alighting station spatial distance between the first type of record and the second type of record, and when the station spatial coordinate information is missing, it reverts to judging the spatial difference based on the consistency of station names.
[0045] Specifically, matching costs Defined as: in: and It is a hyperparameter that controls the relative importance of temporal and spatial consistency.
[0046] It is a time difference; It is spatial difference.
[0047] Time variability ( This section measures the absolute time difference between two recorded events: boarding and alighting. Its design is capable of handling situations where camera data for alighting is missing. The specific calculation is as follows: and These represent the passenger flow counter data recorded after time calibration. Boarding time and records The alighting time. If the alighting time is recorded by the card reader or passenger counter data... or If it is empty, then the second item It is considered zero. This ensures that the algorithm can still perform effective matching based on boarding time even when only one-way ticket data is available.
[0048] Spatial differences ( This section measures the geographic distance between two recorded site locations. The algorithm uses the semi-versus formula to calculate the spherical distance between GPS coordinates.
[0049] Similarly, to handle missing data, if the station coordinates for a record are unavailable (for example, some historical card-swipe data only has the station name but no coordinates), the algorithm will fall back to comparing the station name text. If the station names are exactly the same, the spatial distance between the corresponding events is considered zero. This hierarchical processing strategy enhances the algorithm's compatibility with heterogeneous data sources.
[0050] S43. Perform constraint optimization on the cost matrix C, and set the matching cost corresponding to the single difference cost exceeding the preset threshold as a value that prohibits matching.
[0051] To ensure logical consistency in matching and reduce unnecessary computational complexity, this step implements hard constraints. For example, if the difference in boarding time or the distance between boarding locations of two records exceeds a predefined reasonable threshold (e.g., boarding interval > 300 seconds or distance > 500 meters), they are considered highly unlikely to describe the same trip. In this case, the corresponding cost will be... Set it to a maximum value (such as infinity ∞) to effectively prevent the pairing in subsequent solutions.
[0052] S44. Based on the optimized cost matrix, the bipartite graph optimal matching algorithm is used to find the one-to-one record allocation scheme with the minimum total matching cost.
[0053] In this embodiment, the classic Hungarian algorithm is used to solve the linear sum allocation problem described above. This algorithm can efficiently find the solution that minimizes the global total matching cost. The optimal one-to-one matching set M is minimized. This ensures that within each vehicle shift, a globally optimal association is achieved between card swipe records and passenger flow count records, maximizing overall matching accuracy.
[0054] In a specific embodiment, such as Figure 5 As shown, the method for reconstructing public transportation passenger travel profiles also includes a step of frequent traveler identification based on the fused records, specifically including: S51. Filter out records that conform to the preset travel time pattern from the fused records; for example, morning peak (e.g., 7:00-9:00) and evening peak (e.g., 17:00-19:00) time windows can be set to initially filter out travel records with obvious commuting characteristics and focus on the analysis target.
[0055] S52. For each selected passenger, spatial clustering is performed on their boarding and alighting locations to determine their stable origin-destination (OD) areas. This step uses the DBSCAN spatial clustering algorithm. Since the selected stations for a single trip may fluctuate slightly (e.g., adjacent bus stops), clustering the latitude and longitude of all a passenger's historical boarding stations allows geographically adjacent stations to be grouped into a stable boarding area. Similarly, clustering all alighting stations yields the alighting area. This eliminates the random station selection error of a single trip and extracts the passenger's stable OD pattern.
[0056] S53. Analyze the most frequent origin-destination area pairs for each passenger and identify frequent flyers based on this frequency. For each passenger, count the number of times the OD pair (from a specific boarding area to a specific alighting area) occurs in all their trips. Identify the most frequent OD pair as their primary commuting mode. Finally, rank all passengers in descending order of their primary commuting mode's travel frequency, and identify the top-ranked passengers with highly stable travel patterns as frequent flyers. Figure 6 As shown, further in-depth analysis can be conducted on the identified frequent traveler groups, such as drawing a map of their travel distance distribution, discovering the typical characteristic that about 80% of their trips are concentrated within 5 kilometers, or analyzing the spatial clustering of their travel origin and destination in the city through heat maps, providing precise insights for urban transportation planning.
[0057] like Figure 7 As shown, this embodiment of the invention also provides a public transportation passenger travel profile reconstruction device, comprising: The data acquisition module 10 is used to acquire a first type of data and a second type of data. The first type of data includes passenger identification and boarding station information, but lacks or partially lacks alighting station information. The second type of data includes complete passenger boarding and alighting station information, but lacks persistent passenger identification for long-term tracking. The preprocessing and standardization module 20 is used to preprocess and standardize the first type of data and the second type of data to obtain a standardized first type of record set and a second type of record set. The time calibration module 30 is used to perform time calibration on the timestamps in the second type of record set based on the same operating vehicle, so as to eliminate the systematic clock drift between the acquisition device of the second type of data and the acquisition device of the first type of data. The spatiotemporal trajectory matching module 40 is used to perform spatiotemporal trajectory matching between the standardized first type of record set and the time-calibrated second type of record set within the same vehicle shift based on the optimal allocation algorithm, so as to form a fused record; wherein, each fused record is associated with a unique passenger identifier and its complete origin and destination information.
[0058] In a specific embodiment, the time calibration module 30 is specifically used for: From the first and second record sets of the same vehicle, identify at least one candidate record pair describing the same passenger's journey as an anchor pair; For each anchor point pair, calculate its time difference, and based on preset consistency check rules and reasonable range constraints, select valid time offset samples. Based on all the selected valid time offset samples, the statistically significant central trend value is calculated as the systematic time drift of the vehicle. The systematic time drift is applied to the timestamps of all second-type records corresponding to the vehicle.
[0059] In a specific embodiment, identifying at least one candidate record pair describing the same passenger's journey as an anchor point pair from the first type of record set and the second type of record set of the same vehicle includes: Prioritize finding the first type of records and the second type of records where the boarding station information and the alighting station information are completely consistent as strong anchor points; If the number of strong anchor points is insufficient, then the first type of records and the second type of records with completely identical boarding station information are selected as weak anchor points.
[0060] In a specific embodiment, the step of calculating the statistically significant central trend value based on all selected valid time offset samples specifically involves calculating the median of all valid time offset samples.
[0061] In a specific embodiment, the spatiotemporal trajectory matching module 40 is specifically used for: For m records of type I and n records of type II within a single vehicle trip, construct an m×n cost matrix C, where elements... This represents the matching cost between the i-th record of type I and the j-th record of type II; Define the matching cost The cost is a weighted sum of time difference cost and spatial difference cost, whereby the time difference cost is calculated based on the difference between boarding and alighting times of the two records, and the spatial difference cost is calculated based on the distance between boarding and alighting stations of the two records.
[0062] In a specific embodiment, the time difference cost is calculated based on the boarding time difference and alighting time difference between the first type of record and the second type of record, and when the alighting time information is missing, the corresponding time difference is not included in the time difference cost; the spatial difference cost is calculated based on the boarding station spatial distance and alighting station spatial distance between the first type of record and the second type of record, and when the station spatial coordinate information is missing, it reverts to judging the spatial difference based on the consistency of station names.
[0063] The cost matrix C is constrained and optimized by setting the matching cost corresponding to the individual difference cost that exceeds a preset threshold as a value that prohibits matching. Based on the optimized cost matrix, a bipartite graph optimal matching algorithm is used to find the one-to-one record allocation scheme with the minimum total matching cost.
[0064] In a specific embodiment, the public transportation passenger travel profile reconstruction device further includes a frequent traveler identification module, specifically used for: Records that conform to a preset travel time pattern are selected from the fused records; For each selected passenger, spatial clustering is performed on their boarding and alighting locations to determine their stable origin and destination areas. The most frequent origin-destination pairs for each passenger are statistically analyzed, and frequent flyer groups are identified based on this frequency.
[0065] It should be noted that those skilled in the art can clearly understand that the specific implementation process of the above-mentioned public transportation passenger travel profile reconstruction device and each unit can be referred to the corresponding description in the foregoing method embodiments. For the sake of convenience and brevity, it will not be repeated here.
[0066] The aforementioned public transportation passenger travel profile reconstruction device can be implemented as a computer program, which can, for example... Figure 8 It runs on the computer device shown.
[0067] Please see Figure 8 , Figure 8 This is a schematic block diagram of a computer device provided in an embodiment of this application. The computer device 500 can be a terminal or a server. The terminal can be an electronic device with communication functions, such as a smartphone, tablet, laptop, desktop computer, personal digital assistant, or wearable device. The server can be a standalone server or a server cluster composed of multiple servers.
[0068] See Figure 8The computer device 500 includes a processor 502, a memory, and a network interface 505 connected via a system bus 501. The memory may include a non-volatile storage medium 503 and internal memory 504.
[0069] The non-volatile storage medium 503 may store an operating system 5031 and a computer program 5032. The computer program 5032 includes program instructions that, when executed, cause the processor 502 to perform a method for reconstructing a public transportation passenger travel profile.
[0070] The processor 502 provides computing and control capabilities to support the operation of the entire computer device 500.
[0071] The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute a method for restoring a public transportation passenger travel profile.
[0072] This network interface 505 is used for network communication with other devices. Those skilled in the art will understand that... Figure 8 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device 500 to which the present application is applied. The specific computer device 500 may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0073] The processor 502 is used to run a computer program 5032 stored in a memory to implement the public transportation passenger travel profile reconstruction method as described above.
[0074] It should be understood that in the embodiments of this application, the processor 502 may be a central processing unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.
[0075] It will be understood by those skilled in the art that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program includes program instructions and can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiments of the above methods.
[0076] Therefore, the present invention also provides a storage medium. This storage medium can be a computer-readable storage medium. The storage medium stores a computer program, wherein the computer program includes program instructions. When executed by a processor, the program instructions cause the processor to perform the public transportation passenger travel profile reconstruction method as described above.
[0077] The storage medium can be any computer-readable storage medium capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory (ROM), magnetic disk, or optical disk.
[0078] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0079] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For example, the division of each unit is merely a logical functional division, and there may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.
[0080] The steps in the method of this invention can be adjusted, merged, or reduced in order according to actual needs. The units in the device of this invention can be merged, divided, or reduced according to actual needs. Furthermore, the functional units in the various embodiments of this invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0081] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a terminal, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.
[0082] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for reconstructing a travel profile of public transportation passengers, characterized in that, Includes the following steps: Acquire a first type of data and a second type of data; wherein, the first type of data includes passenger identification and boarding station information, but lacks or partially lacks alighting station information; the second type of data includes complete passenger boarding and alighting station information, but lacks persistent passenger identification for long-term tracking. Data preprocessing and standardization are performed on the first type of data and the second type of data to obtain standardized first type of record set and second type of record set; Based on the same operating vehicle, the timestamps in the second type of record set are time-calibrated to eliminate systematic clock drift between the acquisition devices of the second type of data and the acquisition devices of the first type of data; Based on the optimal allocation algorithm, the standardized first type of record set and the time-calibrated second type of record set are matched in time and space within the same vehicle trip to form a fused record; wherein, each fused record is associated with a unique passenger identifier and its complete origin and destination information.
2. The method for reconstructing public transportation passenger travel profiles according to claim 1, characterized in that, The time calibration of timestamps in the second type of record set based on the same operating vehicle includes: From the first and second record sets of the same vehicle, identify at least one candidate record pair describing the same passenger's journey as an anchor pair; For each anchor point pair, calculate its time difference, and based on preset consistency check rules and reasonable range constraints, select valid time offset samples. Based on all the selected valid time offset samples, the statistically significant central trend value is calculated as the systematic time drift of the vehicle. The systematic time drift is applied to the timestamps of all second-type records corresponding to the vehicle.
3. The method for reconstructing public transportation passenger travel profiles according to claim 2, characterized in that, The step of identifying at least one candidate record pair describing the same passenger's journey as an anchor pair from the first and second type of record sets of the same vehicle includes: Prioritize finding the first type of records and the second type of records where the boarding station information and the alighting station information are completely consistent as strong anchor points; If the number of strong anchor points is insufficient, then the first type of records and the second type of records with completely identical boarding station information are selected as weak anchor points.
4. The method for reconstructing public transportation passenger travel profiles according to claim 2, characterized in that, The central tendency value is calculated based on all the selected valid time offset samples, specifically by calculating the median of all valid time offset samples.
5. The method for reconstructing public transportation passenger travel profiles according to claim 1, characterized in that, The step of matching the standardized first-class record set with the time-calibrated second-class record set within the same vehicle shift, based on the optimal allocation algorithm, includes: For m records of type I and n records of type II within a single vehicle trip, construct an m×n cost matrix C, where elements... This represents the matching cost between the i-th record of type I and the j-th record of type II; Define the matching cost The cost is a weighted sum of time difference cost and spatial difference cost, wherein the time difference cost is calculated based on the difference between boarding time and the difference between alighting time of the two records, and the spatial difference cost is calculated based on the distance between boarding station and alighting station of the two records. The cost matrix C is constrained and optimized by setting the matching cost corresponding to the individual difference cost that exceeds a preset threshold as a value that prohibits matching. Based on the optimized cost matrix, a bipartite graph optimal matching algorithm is used to find the one-to-one record allocation scheme with the minimum total matching cost.
6. The method for reconstructing public transportation passenger travel profiles according to claim 5, characterized in that, The time difference cost is calculated based on the boarding time difference and alighting time difference between the first type of record and the second type of record. When the alighting time information is missing, the corresponding time difference is not included in the time difference cost. The spatial difference cost is calculated based on the boarding station spatial distance and alighting station spatial distance between the first type of record and the second type of record. When the station spatial coordinate information is missing, the spatial difference is judged based on the consistency of station names.
7. The method for reconstructing public transportation passenger travel profiles according to claim 1, characterized in that, It also includes a step of frequent flyer identification based on the fused records, specifically including: Records that conform to a preset travel time pattern are selected from the fused records; For each selected passenger, spatial clustering is performed on their boarding and alighting locations to determine their stable origin and destination areas. The most frequent origin-destination pairs for each passenger are statistically analyzed, and frequent flyer groups are identified based on this frequency.
8. A device for reconstructing a travel profile of a public transportation passenger, characterized in that, include: The data acquisition module is used to acquire a first type of data and a second type of data. The first type of data includes passenger identification and boarding station information, but lacks or partially lacks alighting station information. The second type of data includes complete passenger boarding and alighting station information, but lacks persistent passenger identification for long-term tracking. The preprocessing and standardization module is used to preprocess and standardize the first type of data and the second type of data to obtain a standardized first type of record set and a second type of record set. The time calibration module is used to perform time calibration on the timestamps in the second type of record set based on the same operating vehicle, so as to eliminate the systematic clock drift between the acquisition device of the second type of data and the acquisition device of the first type of data. The spatiotemporal trajectory matching module is used to perform spatiotemporal trajectory matching between the standardized first type of record set and the time-calibrated second type of record set within the same vehicle trip based on the optimal allocation algorithm, so as to form a fused record; wherein, each fused record is associated with a unique passenger identifier and its complete origin and destination information.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the public transportation passenger travel profile reconstruction method as described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the public transportation passenger travel profile reconstruction method as described in any one of claims 1 to 7.