Method, device and readable storage medium for automatically matching bus line

By matching the reverse GPS trajectory sequence with the reverse target sequence, and combining historical trajectory cache and station entry/exit status anchor points, the bus's operating route and direction can be automatically identified. This solves the problems of human factors and misjudgment of direction in complex scenarios in existing technologies, and achieves the accuracy of bus dispatch data.

CN122454778APending Publication Date: 2026-07-24SOYEA TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610702280.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-21
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

The existing buses are susceptible to human factors when binding their routes and directions, which can lead to incorrect station announcements and distorted dispatch data. In particular, GPS trajectory matching algorithms are prone to misjudging the direction of travel in complex operating scenarios.

Method used

By acquiring pre-stored bus route and station sequence information, collecting GPS positioning points in real time and generating valid trajectory sequences, monitoring vehicle status to trigger an automatic matching process, matching the reverse GPS trajectory sequence with the reverse target sequence, and combining historical trajectory cache and station entry and exit status anchor points to calculate the matching score and automatically identify the route and direction.

Benefits of technology

It achieves accurate identification of bus routes and directions without human intervention, overcomes directional misjudgments in scenarios such as turning back at the terminal or departing midway, and ensures the accuracy of bus dispatch data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122454778A_ABST
    Figure CN122454778A_ABST
Patent Text Reader

Abstract

The application relates to a bus automatic matching line method, equipment and a readable storage medium, the method comprises the following steps: acquiring pre-stored line station sequence information; collecting and processing vehicle GPS positioning points to generate effective GPS track sequences; starting matching when a trigger condition is met, and extracting single complete operation data to generate a historical normal track cache; arranging the effective GPS track sequences in a reverse order according to time to obtain reverse-order GPS track sequences; fusing the historical normal track cache into the station sequence and arranging the station sequence in a reverse physical order to obtain a reverse-order target sequence; and matching and calculating the reverse-order GPS track sequences and the reverse-order target sequence, and determining an actual running line and direction according to the matching score rate of each candidate line direction. The application effectively overcomes the direction misjudgment in the scenarios of terminal station turn-back and midway departure, and realizes high-precision line matching without manual intervention.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of public transportation system technology, and in particular to a method, device and readable storage medium for automatic bus route matching. Background Technology

[0002] In existing technologies, with the development of intelligent public transportation systems, vehicles need to be accurately bound to their operating routes and directions to support automatic stop announcements and intelligent dispatching. Current mainstream systems largely rely on drivers manually selecting routes and directions, which is easily affected by subjective factors such as driver fatigue, shift changes, or unfamiliarity with temporary route adjustments, leading to incorrect route selection and consequently, incorrect stop announcements and distorted dispatching data.

[0003] Furthermore, existing GPS trajectory matching algorithms based on orthogonal time series are prone to misjudging the direction of travel when faced with complex operational scenarios where buses depart midway or, in particular, turn around at the terminal station, their trajectories highly overlap. Summary of the Invention

[0004] To address the aforementioned issues, this application provides a method, device, and readable storage medium for automatic bus route matching with accurate identification of bus routes and driving directions without human intervention.

[0005] To achieve the above objectives, in a first aspect, embodiments of this application provide a method for automatically matching bus routes, comprising the following steps: S1: Obtain the pre-stored bus route stop sequence information, which includes the up-line stop sequence, down-line stop sequence, and latitude and longitude coordinates of each stop for each route; S2: Real-time acquisition and processing of vehicle GPS location points to generate a valid GPS trajectory sequence arranged in chronological order; S3: Monitor the vehicle's station reporting status and operating status. When the preset trigger conditions are met, start the automatic route matching process. When it is determined that the vehicle has completed a single full route operation, extract the GPS data of that operation to generate a historical normal trajectory cache. S4: Rearrange the valid GPS trajectory sequence according to the timestamps from most recent to oldest to obtain the reverse GPS trajectory sequence; S5: Determine whether there is a historical normal trajectory cache corresponding to each candidate route. If there is, merge the historical normal trajectory cache into the station sequence information to generate a route point sequence. If there is no, use the station sequence information as the route point sequence. Arrange the route point sequence according to the reverse physical order of the stations to obtain the reverse target sequence. S6: Perform matching calculations between the reverse GPS trajectory sequence and the reverse target sequence, calculate the matching score rate of each candidate route and its up and down directions, and determine the route direction with the highest matching score rate as the actual running route and direction of the current vehicle.

[0006] Preferably, step S2, which involves processing GPS positioning points to generate a valid GPS trajectory sequence, includes: Remove invalid positioning points where the horizontal accuracy factor is greater than the preset accuracy threshold or the number of satellites is less than the preset number threshold; Calculate the distance between two consecutive positioning points. If the distance is less than a preset distance threshold, the corresponding positioning point is treated as a stationary point and removed. The positioning points are downsampled and extracted according to a preset time interval, and only positioning points within a preset time window or a preset driving distance range are retained to generate the effective GPS trajectory sequence.

[0007] Preferably, in step S3, the preset triggering condition is: Acquire the station reporting status signal from the vehicle-mounted station reporting module and monitor the current changes in the vehicle's GPS coordinates; If the change in GPS coordinates meets the preset displacement condition, the vehicle is determined to be in continuous operation. If the station announcement signal is not obtained for more than a preset time during the continuous operation, the automatic route matching process is triggered.

[0008] Preferably, step S3, determining whether the vehicle has completed a single full route operation and extracting and generating a historical normal trajectory cache, includes: During vehicle operation, trajectory points are saved using a preset data structure. The data structure includes latitude and longitude, collection time, and entry / exit status labels. The entry / exit status labels include route name, direction, station name, station number, and entry / exit status. When a vehicle arrives at its destination and all stations on the route corresponding to the trip have generated corresponding entry and exit status records, the trip is determined to be a single complete route operation, and the historical normal trajectory cache is extracted according to the preset cache filtering rules.

[0009] Preferably, the step of extracting the historical normal trajectory cache according to the preset cache filtering rules includes: Extract the trajectory points with the station number of the first station and the status of exiting the station from the saved trajectory points, and use them as the current reference cache points; Trajectory points are traversed in chronological order. Trajectory points whose timestamps differ from the current baseline cache point by a time difference greater than or equal to a preset time interval are added to the final cache queue and updated as new baseline cache points. When a trajectory point with the status of "entering the station" is encountered during traversal, it is directly added to the final cache queue, and the remaining intermediate trajectory points between the trajectory point with the status of "entering the station" and the previous reference cache point are removed. Subsequently, the departure status trajectory point of the current station is added to the final cache queue, and the departure status trajectory point is used as the new reference cache point to continue traversing backward until the arrival status trajectory point of the terminal station is obtained, thus obtaining the historical normal trajectory cache composed of status anchor points and equal time interval points.

[0010] Preferably, in step S5, the step of fusing the historical normal trajectory cache into the station sequence information to generate the route location sequence includes: Based on the entry and exit status labels corresponding to each trajectory point in the historical normal trajectory cache, the trajectory points are added sequentially between the exit node of the current line's corresponding station and the entry node of the next station, generating the line point sequence containing physical station coordinates and historical cache point coordinates.

[0011] Preferably, step S6, the step of matching the reversed GPS trajectory sequence with the reversed target sequence, includes: The target points in the reversed target sequence are extracted sequentially and then compared and traversed in the reversed GPS trajectory sequence. Calculate the spatial distance between the extracted target point and the traversed reverse GPS trajectory points. When the spatial distance is less than a preset matching threshold, determine that the current point is successfully matched, record the reverse target sequence index and the reverse GPS trajectory sequence index of the currently successfully matched point, and terminate the traversal and comparison of the current target point. When traversing and comparing the next target point, the comparison calculation continues from the index of the previously recorded reverse GPS trajectory sequence as the starting position until the reverse target sequence has been traversed.

[0012] Preferably, in step S6, the rules for calculating the matching score rate and determining the actual running route and direction include: for routes without historical normal trajectory cache, the matching score rate is the ratio of the number of successfully matched physical stations to the total number of physical stations in the route direction; for routes with historical normal trajectory cache, the matching score rate is the ratio of the number of successfully matched points to the total number of points in the route direction that include historical cache points; when determining candidate route directions, if the current reverse GPS trajectory sequence matches both the starting trajectory and the ending trajectory of a certain route, the route direction containing the starting point is determined as the priority candidate direction, and the route direction matching the ending point is excluded.

[0013] Secondly, embodiments of this application provide a device for automatically matching bus routes, comprising: The memory is used to store computer programs and pre-acquired bus route and station sequence information; A processor is configured to execute a computer program stored in the memory to implement the method for automatically matching bus routes as described in any embodiment of the first aspect.

[0014] Thirdly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the method for automatically matching bus routes as described in any embodiment of the first aspect.

[0015] The method, equipment, and readable storage medium for automatic bus route matching designed in this application overcome the problem of misjudgment of direction in scenarios such as buses turning back at the terminal station or departing midway by arranging real-time GPS trajectory sequences in reverse chronological order and matching them with a reverse target sequence that incorporates historical trajectory cache. Simultaneously, by extracting historical trajectories based on station entry and exit status anchor points to expand the station sequence, and combining percentage normalization scoring and starting point priority rules, calculation errors for routes of different lengths are eliminated, achieving automatic identification of routes and driving directions without manual intervention and ensuring the accuracy of bus dispatching data. Attached Figure Description

[0016] Figure 1 This is a flowchart of a method for automatically matching bus routes provided in an embodiment of this application. Detailed Implementation

[0017] The preferred embodiments of this application are described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit this application.

[0018] Firstly, the method for automatically matching bus routes described in this embodiment can run on an onboard intelligent dispatch terminal or a cloud server. It solves the problem of misjudging the direction of travel of buses in overlapping road sections by comparing the trajectory back along the reverse time axis with the reverse sequence of physical stops. For example... Figure 1 As shown, the method mainly includes the following steps: Step S1: Obtain pre-stored bus route stop sequence information. The onboard equipment's storage module contains pre-installed structured route data issued by the bus company. The stop sequence information specifically includes the unique identifier of each route and the upstream stop sequence Line=[P0,P1,P2,...,P...]. n Downlink station sequence Line=[P0,P1,P2,...,P] n And the precise latitude and longitude coordinates P of each station. i =[lat i ,lng i ].

[0019] Step S2: Real-time acquisition and processing of vehicle GPS location points. After the vehicle starts, the onboard positioning module receives satellite positioning data at a fixed frequency. After cleaning and noise reduction by the underlying algorithm, a valid GPS trajectory sequence arranged in chronological order is generated, providing a high-quality data source for subsequent matching.

[0020] Step S3: Monitor the vehicle's station reporting and operational status. The system listens to the underlying bus data in real time. When preset trigger conditions are met, the system determines that the current vehicle may be deviating from its course or is in an unknown route state, and then initiates the automatic route matching process. At the same time, the system has self-learning capabilities. When it determines that the vehicle has completed a single full route operation, it extracts the GPS data of that operation to generate a historical normal trajectory cache to enrich the basic route model.

[0021] Step S4: Rearrange the valid GPS trajectory sequence according to the timestamp from most recent to oldest. The system reads the most recently acquired positioning point as the first position in the sequence, and then arranges the historical positioning points sequentially backward to obtain a reverse-order GPS trajectory sequence. The working principle of this step is to assign the most recent physical state the highest matching priority.

[0022] Step S5: Determine whether there is a historical normal trajectory cache corresponding to each candidate route. If it exists, the system merges the historical normal trajectory cache into the station sequence information to generate a high-density route point sequence. If it does not exist, the system directly uses the basic station sequence information as the route point sequence. Subsequently, the system arranges the route point sequence according to the reverse physical order of the stations to obtain the reversed target sequence.

[0023] Step S6: Match the reversed GPS trajectory sequence with the reversed target sequence. The system compares the spatial distance between the two sets of reversed sequences and calculates the matching score rate for each candidate route and its up and down directions. The system ultimately determines the route and direction with the highest matching score rate as the actual operating route and direction of the current vehicle, and outputs control commands to automatically switch the route display on the onboard station announcer and the dispatch screen.

[0024] In some embodiments, the GPS positioning point processing in step S2 specifically involves the following steps: During vehicle operation, the original GPS data often drifts due to obstruction by tall buildings or weather conditions. The system first removes invalid positioning points whose horizontal accuracy factor is greater than a preset accuracy threshold or whose number of satellites is less than four.

[0025] Subsequently, the system calculates the spatial distance between two consecutive positioning points. If the distance is less than a preset distance threshold, such as ten meters, the system determines that the vehicle is in a state of waiting at a red light or stopping at a station, and removes the corresponding positioning point as a stationary point to reduce redundant calculations.

[0026] Finally, the system downsamples and extracts the positioning points at preset time intervals, such as ten seconds, and retains only positioning points within a preset time window, such as ten minutes, or within a preset driving distance range, such as three kilometers, ultimately generating the effective GPS trajectory sequence. The effective GPS trajectory sequence is represented as T=[t0,t1,t2,...,t...]. n ], where each trajectory point t includes latitude l lat, longitude lng, and timestamp timestamp.

[0027] In some embodiments, the specific process of determining whether the preset triggering condition is met in step S3 includes: The system acquires the station announcement status signal from the onboard station announcement module and monitors the change in the vehicle's GPS coordinates in real time. If the change in GPS coordinates meets a preset displacement condition, the system determines that the vehicle is in continuous operation. If, in this continuous operation state, the system timer records that the station announcement status signal has not been acquired for more than a preset time, such as ten minutes, it indicates that the vehicle's current actual driving trajectory deviates significantly from the currently bound route station, and the system then triggers the automatic route matching process.

[0028] In some embodiments, the specific steps for generating the preconditions and data structure for the historical normal trajectory cache are as follows: During the daily operation of the vehicle, the system frequently saves trajectory points using a preset data structure. This data structure includes not only latitude and longitude and collection time, but also a special addition of station entry / exit status labels. These labels specifically include the route name, direction, station name, station number, and entry / exit status.

[0029] When the vehicle arrives at the terminal station, the system iterates through all records for this trip. Only when all stations on the route corresponding to this trip have generated corresponding entry and exit status records does the system determine that this trip is a single complete route operation, and then extracts the historical normal trajectory cache according to preset cache filtering rules. The sequence of the historical normal trajectory cache is represented as T. cache =[t1,t2,t3,...,t n ], where each trajectory point t includes latitude lat and longitude lng.

[0030] In some embodiments, the specific steps for extracting the historical normal trajectory cache according to the preset cache filtering rules are as follows: the system first extracts the trajectory points with the station number as the first station and the status as exiting the station from the saved trajectory points, and uses them as the current reference cache points.

[0031] The system iterates through subsequent trajectory points in chronological order, adds trajectory points whose timestamps differ from the current baseline cache point by a preset time interval (e.g., one minute) to the final cache queue, and updates them as new baseline cache points.

[0032] During this traversal, when the system encounters a trajectory point in the "entering station" state, the system forcibly interrupts the time interval check, directly adds it to the final cache queue, and removes the remaining intermediate trajectory points between the "entering station" trajectory point and the previous reference cache point to avoid generating a large number of invalid stacking points during the deceleration phase of entering the station.

[0033] Subsequently, the system adds the departure status trajectory point of the current station to the final cache queue, and uses this departure status trajectory point as the new baseline cache point to continue traversing backwards until the arrival status trajectory point of the destination station. Finally, the system obtains the historical normal trajectory cache composed of status anchor points and equal-time interval points.

[0034] In some embodiments, the specific steps for integrating historical normal trajectory cache into the station sequence information are as follows: the system performs precise slicing and insertion based on the entry / exit status labels corresponding to each trajectory point in the historical normal trajectory cache. Specifically, the insertion method involves inserting the latitude and longitude of each cached station into the point preceding the exit status station corresponding to the current route's operating direction. The resulting route point sequence after integration is represented as P. new =[p1,t cache1 ,t cache2 ,...,p2,t cachen1 ,t cachen2 ...,p3, tcachem1 ,t cachem2 ,...,P n ].

[0035] The specific sequence arrangement is as follows: starting point, starting point exit, buffer point one, buffer point two until the first station entry, first station, first station exit, first station buffer one, first station buffer two until the second station entry, second station, second station exit, second station buffer one, second station buffer two until the destination entry, destination. Through this physical anchor point alignment method, the system generates a high-dimensional point sequence containing physical station coordinates and historical buffer point coordinates, significantly improving the trajectory resolution of long-distance stationless road segments.

[0036] In some embodiments, the underlying algorithm logic and distance calculation formula for reverse matching calculation are as follows: the system sequentially extracts target points from the reverse target sequence and performs traversal comparisons in the reverse GPS trajectory sequence. The system uses the great circle distance calculation formula to calculate the spatial distance between the extracted target points and the traversed reverse GPS trajectory points.

[0037] Preferably, the spatial distance is calculated using the Haversine formula. Given the latitude and longitude of two points, the latitude of the first point is... 1. The longitude is λ1, and the latitude of the second point is... 2. The longitude is λ2, where the angle unit is radians, and the Earth's radius is set to R, usually taken as 6371 km. The calculation process for the great circle distance d between two points is as follows: Δ = 2- 1 Δλ=λ2-λ1 + c = 2·arctan2( , ) d=R·c When the calculated great circle distance d is less than a preset matching threshold, such as fifty meters, the system determines that the current point has been successfully matched. The system then records the reversed target sequence index and the reversed GPS trajectory sequence index of the currently successfully matched point, and terminates the traversal and comparison of the current target point.

[0038] When performing traversal and comparison for the next target location, the system continues the comparison calculation starting from the index of the previously recorded reverse GPS trajectory sequence, until the reverse target sequence has been traversed. This unidirectional stepping logic effectively reduces the computational power consumption of traversal and shields against trajectory drift interference.

[0039] In some embodiments, the calculation rule and exclusion mechanism for the final matching score rate are as follows: For routes without historical normal trajectory cache, the system sets the matching score rate as the ratio of the number of successfully matched physical stations to the total number of physical stations in that route direction. For routes with historical normal trajectory cache, the system sets the matching score rate as the ratio of the number of successfully matched points to the total number of points in that route direction that include historical cached points. This percentage normalization design eliminates the scoring unfairness caused by different point bases for routes of varying lengths.

[0040] When determining candidate route directions, for terminal station turnaround scenarios, if the current reverse GPS trajectory sequence matches both the starting trajectory and the ending trajectory of a certain route, the system, based on the basic logic of public transportation operation, determines the route direction containing the starting point as the priority candidate direction and forcibly excludes the route direction matching the ending point, thereby completely eliminating the risk of incorrect direction.

[0041] Secondly, embodiments of this application provide a device for automatically matching bus routes.

[0042] Specifically, the device can be configured as an on-board intelligent dispatch terminal host, which includes a memory and a processor. The memory is used to store computer programs and pre-acquired bus route and stop sequence information, and the memory can be flash memory or high-speed random access memory. The processor is electrically connected to the memory, and the processor is used to call and execute the computer program stored in the memory to implement all the steps of the automatic bus route matching method described in the first aspect.

[0043] Thirdly, embodiments of this application provide a computer-readable storage medium.

[0044] The computer-readable storage medium contains a computer program. This computer-readable storage medium can be a non-volatile storage medium such as a read-only optical disc, a Universal Serial Bus flash drive, or a portable hard drive. When the computer program is read and executed by the processor of the vehicle-mounted terminal or cloud server, the method for automatically matching bus routes described in the first aspect can be fully implemented.

[0045] The method, device, and readable storage medium for automatic bus route matching provided in this application overcome the problem of misjudgment of direction in scenarios such as buses turning back at the terminal station or departing midway by arranging real-time GPS trajectory sequences in reverse chronological order and matching them with a reverse target sequence that incorporates historical trajectory cache. Simultaneously, by extracting historical trajectories based on station entry and exit status anchor points to expand the station sequence, and combining percentage normalization scoring and starting point priority rules, calculation errors for routes of different lengths are eliminated, achieving automatic identification of routes and driving directions without manual intervention and ensuring the accuracy of bus dispatching data.

[0046] In the description of this application, it should be noted that the terms "vertical", "up", "down", "horizontal", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this application.

[0047] In the description of this application, it should also be noted that, unless otherwise expressly specified and limited, the terms "set," "install," "connect," and "link" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.

[0048] Finally, it should be noted that the above descriptions are merely preferred embodiments of this application and are not intended to limit this application. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A method for automatically matching bus routes, characterized in that, Includes the following steps: S1: Obtain the pre-stored bus route stop sequence information, which includes the up-line stop sequence, down-line stop sequence, and latitude and longitude coordinates of each stop for each route; S2: Real-time acquisition and processing of vehicle GPS location points to generate a valid GPS trajectory sequence arranged in chronological order; S3: Monitor the vehicle's station reporting status and operating status. When the preset trigger conditions are met, start the automatic route matching process. When it is determined that the vehicle has completed a single full route operation, extract the GPS data of that operation to generate a historical normal trajectory cache. S4: Rearrange the valid GPS trajectory sequence according to the timestamps from most recent to oldest to obtain the reverse GPS trajectory sequence; S5: Determine whether there is a historical normal trajectory cache corresponding to each candidate route. If there is, merge the historical normal trajectory cache into the station sequence information to generate a route point sequence. If it does not exist, the station sequence information is used as the line location sequence; the line location sequence is arranged in reverse physical order of the stations to obtain the reverse target sequence; S6: Perform matching calculations between the reverse GPS trajectory sequence and the reverse target sequence, calculate the matching score rate of each candidate route and its up and down directions, and determine the route direction with the highest matching score rate as the actual running route and direction of the current vehicle.

2. The method for automatically matching bus routes according to claim 1, characterized in that, Step S2, which involves processing GPS positioning points to generate a valid GPS trajectory sequence, includes: Remove invalid positioning points where the horizontal accuracy factor is greater than the preset accuracy threshold or the number of satellites is less than the preset number threshold; Calculate the distance between two consecutive positioning points. If the distance is less than a preset distance threshold, the corresponding positioning point is treated as a stationary point and removed. The positioning points are downsampled and extracted according to a preset time interval, and only positioning points within a preset time window or a preset driving distance range are retained to generate the effective GPS trajectory sequence.

3. The method for automatically matching bus routes according to claim 1, characterized in that, In step S3, the preset triggering condition is: Acquire the station reporting status signal from the vehicle-mounted station reporting module and monitor the current changes in the vehicle's GPS coordinates; If the change in GPS coordinates meets the preset displacement condition, the vehicle is determined to be in continuous operation. If the station announcement signal is not obtained for more than a preset time during the continuous operation, the automatic route matching process is triggered.

4. The method for automatically matching bus routes according to claim 1, characterized in that, Step S3, which involves determining whether a vehicle has completed a single full route operation and extracting and generating a historical normal trajectory cache, includes: During vehicle operation, trajectory points are saved using a preset data structure. The data structure includes latitude and longitude, collection time, and entry / exit status labels. The entry / exit status labels include route name, direction, station name, station number, and entry / exit status. When a vehicle arrives at its destination and all stations on the route corresponding to the trip have generated corresponding entry and exit status records, the trip is determined to be a single complete route operation, and the historical normal trajectory cache is extracted according to the preset cache filtering rules.

5. The method for automatically matching bus routes according to claim 4, characterized in that, The step of extracting the historical normal trajectory cache according to the preset cache filtering rules includes: Extract the trajectory points with the station number of the first station and the status of exiting the station from the saved trajectory points, and use them as the current reference cache points; Trajectory points are traversed in chronological order. Trajectory points whose timestamps differ from the current baseline cache point by a time difference greater than or equal to a preset time interval are added to the final cache queue and updated as new baseline cache points. When a trajectory point with the status of "entering the station" is encountered during traversal, it is directly added to the final cache queue, and the remaining intermediate trajectory points between the trajectory point with the status of "entering the station" and the previous reference cache point are removed. Subsequently, the departure status trajectory point of the current station is added to the final cache queue, and the departure status trajectory point is used as the new reference cache point to continue traversing backward until the arrival status trajectory point of the terminal station is obtained, thus obtaining the historical normal trajectory cache composed of status anchor points and equal time interval points.

6. The method for automatically matching bus routes according to claim 1, characterized in that, Step S5, the step of fusing the historical normal trajectory cache into the station sequence information to generate the route location sequence includes: Based on the entry and exit status labels corresponding to each trajectory point in the historical normal trajectory cache, the trajectory points are added sequentially between the exit node of the current line's corresponding station and the entry node of the next station, generating the line point sequence containing physical station coordinates and historical cache point coordinates.

7. The method for automatically matching bus routes according to claim 1, characterized in that, Step S6, the step of matching the reversed GPS trajectory sequence with the reversed target sequence, includes: The target points in the reversed target sequence are extracted sequentially and then compared and traversed in the reversed GPS trajectory sequence. Calculate the spatial distance between the extracted target point and the traversed reverse GPS trajectory points. When the spatial distance is less than a preset matching threshold, determine that the current point is successfully matched, record the reverse target sequence index and the reverse GPS trajectory sequence index of the currently successfully matched point, and terminate the traversal and comparison of the current target point. When traversing and comparing the next target point, the comparison calculation continues from the index of the previously recorded reverse GPS trajectory sequence as the starting position until the reverse target sequence has been traversed.

8. The method for automatically matching bus routes according to claim 1 or 7, characterized in that, In step S6, the rules for calculating the matching score rate and determining the actual running route and direction include: for routes without historical normal trajectory cache, the matching score rate is the ratio of the number of successfully matched physical stations to the total number of physical stations in the route direction; for routes with historical normal trajectory cache, the matching score rate is the ratio of the number of successfully matched points to the total number of points in the route direction that include historical cache points; when determining candidate route directions, if the current reverse GPS trajectory sequence matches both the starting trajectory and the ending trajectory of a certain route, the route direction containing the starting point is determined as the priority candidate direction, and the route direction matching the ending point is excluded.

9. A device for automatically matching bus routes, characterized in that, include: The memory is used to store computer programs and pre-acquired bus route and station sequence information; A processor for executing a computer program stored in the memory to implement the method for automatically matching bus routes as described in any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method for automatically matching bus routes as described in any one of claims 1 to 8.