Path fitting method and system based on trajectory data and storage medium

By combining Hidden Markov Models and Gradient Boosting Models in path fitting, this method solves the problems of existing path fitting algorithms' inability to dynamically capture vehicle driving status and insufficient real-time performance, achieving efficient and accurate path fitting, and is suitable for path fitting on networked toll roads.

CN121685233APending Publication Date: 2026-03-17HIGHWAY MONITORING & RESPONSE CENT MINIST OF TRANSPORT OF THE P R C +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511665475.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-13
Publication Date
2026-03-17

AI Technical Summary

Technical Problem

Existing path fitting algorithms struggle to dynamically capture vehicle driving status and fail to meet real-time requirements while maintaining fitting accuracy, resulting in inaccurate online billing.

Method used

By combining Hidden Markov Models and Gradient Boosting Models, a novel path fitting model is constructed. The Viterbi algorithm is used to optimize the path fitting, the geohashing algorithm is used to determine candidate road segments, and the gradient boosting algorithm is used to enhance the nonlinear modeling capability at the feature level.

Benefits of technology

It achieves reduced time complexity while maintaining fitting accuracy, can dynamically capture vehicle driving status, meets real-time optimization requirements, and is suitable for path fitting on networked toll roads.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121685233A_ABST
    Figure CN121685233A_ABST
Patent Text Reader

Abstract

The invention provides a path fitting method and system based on trajectory data and a storage medium. The method comprises the following steps: acquiring road network data and trajectory data; based on the road network data and the trajectory data, candidate road sections corresponding to the trajectory points are determined; for each track point, inputting the determined position information of the corresponding candidate road section and the related information of the track point in the track data into a pre-trained path fitting model, and outputting to obtain an observation probability corresponding to the track point and a transition probability between the candidate road section corresponding to the track point and the candidate road section corresponding to the adjacent track point; wherein the pre-trained path fitting model comprises a hidden Markov model and a gradient boosting model, and the output of the hidden Markov model is used as the input of the gradient boosting model; and a matched candidate road section sequence is obtained through fitting based on the observation probability and the transition probability by using a Viterbi algorithm. According to the method, the driving state of the vehicle can be dynamically captured, and real-time optimization is realized while the fitting precision is met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent transportation technology, and in particular to a path fitting method and system based on trajectory data. Background Technology

[0002] Currently, the main toll collection method for toll roads is still media-based tolling, i.e., toll collection via ETC cards or CPC cards. If gantry location data is lost within the route selection range during a vehicle's journey, multiple routes exist within the road network, making it impossible to accurately reconstruct the vehicle's original trajectory. Currently, methods such as minimum toll amount or shortest path are commonly used to address the information gap issue, but this may result in the actual toll amount being lower than the amount due, causing economic losses for road owners. Therefore, to solve the problem of inaccurate media-based tolling, the networked toll collection industry is shifting towards full online operation. Whether addressing the inaccuracy of media-based tolling or the future transformation of toll routes, the accuracy of online tolling is undoubtedly the most critical element. And the decisive factor determining the accuracy of online tolling is the accuracy of path fitting.

[0003] With the widespread application of mobile device positioning, it has become possible to perform high-precision path fitting based on trajectory data reported by mobile positioning devices (such as GPS (Global Positioning System) data from users' mobile phones). This is because the trajectory data reported by users' mobile phones has a higher density than that of fixed-location toll collection facilities, better reflecting the actual trajectory of vehicles. It can complement toll collection facilities, solving the problem of path ambiguity caused by lost data from toll collection facilities, accurately reconstructing the true trajectory of vehicles, and improving the accuracy of toll road billing.

[0004] Therefore, the toll collection system's path fitting can combine user's mobile phone GPS data to reconstruct the user's actual travel route. The specific principle is as follows: By inputting the original route information of the vehicle's passage through toll collection facilities, including trajectory points and travel times, the system returns the complete path information of the vehicle after fitting, including the coordinates and names of the road segments passed in sequence. By combining this with user mobile phone data, ambiguous path selection can be performed, effectively identifying data anomalies such as gantry connectivity issues and toll plaza data problems. This provides technical support for the subsequent nationwide rollout of online tolling and facilitates the digital transformation of highway toll collection services.

[0005] Although existing path fitting algorithms incorporate GPS data, issues such as defects, multiple points, and deviations frequently occur due to the multipath effect and signal obstruction affecting mobile phone GPS data. Trajectory reconstruction based on GPS data is a core problem in intelligent transportation and location services. Researchers have designed HMM (Hidden Markov Model) map matching algorithms and classic algorithms such as Dijkstra's algorithm. However, existing vehicle path fitting algorithms still have the following significant drawbacks: ① Insufficient adaptation due to low sampling rates: The gantry spacing on networked toll highways is 500–2000 meters, and traditional HMMs, relying on geometric distance features, struggle to capture dynamic driving states; ② Real-time performance versus accuracy contradiction: Classic reconstruction algorithms such as Dijkstra's algorithm have high time complexity (O((V+E)logV)), failing to meet the real-time tolling requirements of millions of vehicles on highways.

[0006] Therefore, there is an urgent need for a new path fitting method that can not only dynamically capture the driving status of vehicles, but also optimize in real time while meeting the fitting accuracy requirements. Summary of the Invention

[0007] Therefore, embodiments of the present invention provide a path fitting method and system based on trajectory data, which can solve the problem that existing HMM algorithms have difficulty capturing dynamic driving states, and reduce time complexity while ensuring restoration accuracy.

[0008] One aspect of the present invention provides a path fitting method based on trajectory data, the method comprising the following steps: Acquire road network data and trajectory data of the user to be matched; wherein, the trajectory data includes the location, speed and direction information of all trajectory points detected by the user from the start to the end based on the global positioning system, and the road network data includes the road geometry and topology information between the start and end of the user; Based on road network data and trajectory data, candidate road segments corresponding to each trajectory point are determined; For each trajectory point, the location information of the corresponding candidate road segment and the relevant information of the trajectory point in the trajectory data are input into the pre-trained path fitting model. The output is the observation probability corresponding to the trajectory point and the transition probability between the candidate road segment corresponding to the trajectory point and the candidate road segment corresponding to the adjacent trajectory point. The pre-trained path fitting model includes a hidden Markov model and a gradient boosting model, and the output of the hidden Markov model is used as the input of the gradient boosting model. Using the Viterbi algorithm, a matching candidate road segment sequence is obtained by fitting the observation probability and transition probability.

[0009] In some embodiments of the present invention, the observation probability corresponding to a trajectory point is determined based on the degree of offset between the trajectory point and the corresponding candidate road segment and the directional similarity between the trajectory point and the corresponding candidate road segment; The transition probability between the candidate road segment corresponding to the trajectory point and the candidate road segment corresponding to the adjacent trajectory point is determined based on the distance similarity between the distance between the trajectory point and the adjacent trajectory point and the shortest path distance between the candidate road segments, the similarity between the distance between the trajectory point and the adjacent trajectory point and the corresponding candidate road segments, and the speed information of each trajectory point.

[0010] In some embodiments of the present invention, the degree of offset between the trajectory point and the corresponding candidate road segment is represented by the distance between the trajectory point and the candidate point projected onto the corresponding candidate road segment; The shortest path distance between candidate road segments is the shortest path distance between the candidate point projected onto the corresponding candidate road segment and the candidate point projected onto the corresponding candidate road segment of the adjacent trajectory point; The similarity between the trajectory point and the distances between the adjacent trajectory points and the corresponding candidate road segments is represented by the distance similarity between the first distance formed by the candidate point projected onto the corresponding candidate road segment and the trajectory point, and the second distance formed by the candidate point projected onto the corresponding candidate road segment and the adjacent trajectory point.

[0011] In some embodiments of the present invention, the path fitting model is obtained in the following manner: The training sample set is used as the input to the initial path fitting model, and the model parameters are iteratively updated based on the loss function and the output of the initial path fitting model to obtain the pre-trained path fitting model; where the loss function includes a state confidence term and a prediction error term.

[0012] In some embodiments of the present invention, the state confidence term is determined by the ratio of the log-likelihood probability obtained from the observation probability and transition probability output by the initial path fitting model to the temperature parameter. The gradient boosting model is based on the XGBoost algorithm, and the prediction error term is determined based on the objective function of the XGBoost algorithm.

[0013] In some embodiments of the present invention, candidate road segments corresponding to each trajectory point are determined based on road network data and trajectory data, including: Using a geohashing algorithm, based on the location information of each trajectory point in the trajectory data and road network data, road segments whose distance from each trajectory point is less than a set radius are selected as candidate road segments corresponding to each trajectory point.

[0014] In some embodiments of the present invention, obtaining the trajectory data of the user to be matched includes: The original trajectory data of the user to be matched is obtained by sampling based on the set sampling frequency. The original trajectory data is preprocessed to remove trajectory points with abnormal speed, direction and position information.

[0015] Another aspect of the present invention provides a path fitting system based on trajectory data, including a processor, a memory, and a computer program / instructions stored in the memory. The processor is used to execute the computer program / instructions, and when the computer program / instructions are executed, the system implements the steps of the method described in any of the above embodiments.

[0016] Another aspect of the present invention provides a computer-readable storage medium having a computer program / instructions stored thereon, which, when executed by a processor, implement the steps of the method described in any of the above embodiments.

[0017] Another aspect of the present invention provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of the method described in any of the above embodiments.

[0018] This invention proposes a path fitting method and system based on trajectory data. It combines Hidden Markov Models (HMMs) and Gradient Boosting Models (GPRBs) to construct a novel path fitting model, particularly suitable for intelligent transportation scenarios such as networked toll roads where simultaneous handling of temporal dependencies and high-dimensional features is required. The HMM provides temporal patterns at the state level, while the GPRB enhances nonlinear modeling capabilities at the feature level. The proposed method and system can not only dynamically capture vehicle driving states but also optimize in real time while maintaining fitting accuracy.

[0019] Additional advantages, objects, and features of the invention will be set forth in part in the description which follows, and will also become apparent in part to those skilled in the art upon studying the description, or may be learned by practice of the invention. The objects and other advantages of the invention can be realized and obtained by means of the structures specifically pointed out in the description and drawings.

[0020] Those skilled in the art will understand that the objectives and advantages achievable with the present invention are not limited to those specifically described above, and that the above and other objectives achievable with the present invention will become clearer from the following detailed description. Attached Figure Description

[0021] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, are not intended to limit the scope of the invention. In the drawings: Figure 1 This is a schematic diagram illustrating the derivation of the prior probability of the hidden state in one embodiment of the present invention.

[0022] Figure 2 This is a schematic diagram of the path fitting process combined with the gradient boosting algorithm in one embodiment of the present invention.

[0023] Figure 3 This is a flowchart illustrating a path fitting method based on trajectory data in one embodiment of the present invention.

[0024] Figure 4 This is a schematic diagram of calculating the optimal binding road for adjacent trajectory points in one embodiment of the present invention.

[0025] Figure 5 This is a schematic diagram of the architecture of a path fitting system in one embodiment of the present invention.

[0026] Figure 6 This is a functional design diagram of the path fitting system for path fitting in one embodiment of the present invention.

[0027] Figure 7 This is a schematic diagram of the display interface of the path fitting system for the square and gantry in one embodiment of the present invention.

[0028] Figure 8 This is a schematic diagram of the path fitting display interface of the system in one embodiment of the present invention.

[0029] Figure 9 This is a schematic diagram of the statistical analysis interface of the system in one embodiment of the present invention.

[0030] Figure 10 This is a schematic diagram of the path fitting failure case statistics interface of the system in one embodiment of the present invention. Detailed Implementation

[0031] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the embodiments and accompanying drawings. Here, the illustrative embodiments and descriptions of this invention are used to explain the invention, but are not intended to limit the invention.

[0032] It should also be noted that, in order to avoid obscuring the invention with unnecessary details, only the structures and / or processing steps closely related to the solution according to the invention are shown in the accompanying drawings, while other details that are not closely related to the invention are omitted.

[0033] It should be emphasized that the term "including / comprises" as used herein refers to the presence of a feature, element, step, or component, but does not exclude the presence or addition of one or more other features, elements, steps, or components.

[0034] In the following description, embodiments of the invention will be illustrated with reference to the accompanying drawings. In the drawings, the same reference numerals represent the same or similar parts, or the same or similar steps.

[0035] To address potential information gaps or system malfunctions in toll collection, online billing is increasingly being adopted in highway toll collection. The accuracy of path fitting directly impacts the accuracy of online billing. While traditional Hidden Markov Model (HMM) map matching algorithms can improve matching accuracy through state transition modeling, their probability calculations rely on single geometric features (such as distance), making them ill-suited for dynamic environments. Classic algorithms like Dijkstra's algorithm struggle to simultaneously meet the requirements of real-time performance and accuracy.

[0036] Based on this, this application introduces gradient boosting into the existing Hidden Markov Model (HMM), forming a novel path fitting algorithm. Specifically, this application utilizes the nonlinear modeling capability of the gradient boosting algorithm at the feature level to solve the problem that the HMM algorithm struggles to capture dynamic driving states while extracting temporal patterns at the state level. Moreover, compared to classic restoration algorithms such as Dijkstra's algorithm, the new path fitting algorithm proposed in this application maintains a time complexity comparable to traditional HMM algorithms, meeting the requirements of real-time performance and accuracy.

[0037] The algorithm principles for HMM applied to path fitting are as follows: Assumption The set of all possible hidden states. Given the set of all observed states, then , ,in, It is the total number of all possible hidden states. It is the number of all possible observed states.

[0038] For a length of sequence, This represents the hidden state sequence corresponding to the given sequence. This represents the observed sequence corresponding to the given sequence. , , where any one of the hidden states Any observation state .therefore, and The probability of them appearing together is: ; in, Indicates hidden state To hide The state transition probability, Indicates the observation state In hidden state The probability of generating the following (i.e.) (corresponding observation probability) ), Represents the initial state transition probability (time). In state (probability) This represents a Hidden Markov Model, defined by an initial state probability vector. The state transition probability matrix A and the observation probability matrix B determine the state transition probability matrix, which can be represented by a triplet as follows: ,in, .

[0039] Based on the marginal probability distribution function, the observation sequence can be derived. In the model The conditional probability of the following occurrence (i.e., the formula for solving the probability of the observed sequence) can be expressed as: ; According to the homogeneous Markov chain hypothesis, from time... At the time State transition probability (i.e., at time) In Under the conditions, at time Transferred to The probability of ( ) can be expressed as: ; According to the assumption of observation independence, if at time... Hidden state The corresponding observation state is Then at time Generate observation state The probability can be: ,satisfy: .

[0040] If time The hidden state is The observed state sequence is ,definition Hidden state Let the prior probabilities represent the local states of the dynamic programming model, then we have: ; Assuming that the time has been found The preceding probability of the hidden state at time t can be used to deduce the time t. The preceding probabilities of each hidden state. For example... Figure 1 As shown, it can be based on time Multiplying the prior probabilities of each hidden state by the corresponding state transition probabilities yields the result at time step [time]. Hidden state The prior probability, i.e. It is at any moment Observed And at all times Hidden state ,time Hidden state The probability of.

[0041] If you want to Figure 1 The sum of the probabilities corresponding to all the line segments shown is, i.e. It is at any moment Observed And at all times Hidden state is The probability at that time. Due to the observed state. Only depend on Hide state at all times ,so It is at any moment Observed And at all times Hidden state The probability of [the outcome]. This probability is the probability at time [the moment]. Corresponding hidden state The prior probability. That is, ; Therefore, when the input is The observation sequence is When this happens, the output of the HMM can be: ; in, , State transition probability matrix With the initial state probability vector The hidden Markov chain is determined, an unobservable state sequence is generated, and the observation probability matrix is ​​obtained. The method for generating observations from states was determined, and the method for generating observation sequences was determined by combining the state sequence with the state sequence.

[0042] like Figure 2As shown, this paper introduces gradient boosting algorithms (such as XGBoost and LightGBM) on the basis of existing HMMs. By integrating multiple features to optimize the observation model of HMM, the HMM algorithm can be applied to complex scenarios such as path fitting of network toll roads. Specifically, while Hidden Markov Models (HMMs) excel at capturing implicit state transition patterns in time series, they also have several drawbacks. This application addresses these shortcomings by incorporating gradient boosting algorithms: ① HMMs are weak at modeling complex nonlinearities of multidimensional features, while gradient boosting algorithms can automatically learn the interactions between features through the splitting mechanism of gradient boosting trees; ② The state transition probabilities of HMMs are typically static, making it difficult to reflect dynamically changing data distributions in real time; gradient boosting algorithms can dynamically adjust feature weights through regularization and adaptive parameter adjustment, enhancing model robustness; ③ HMMs have high requirements for data integrity, while gradient boosting algorithms can automatically handle missing values ​​and assign optimal solutions to missing data through splitting rules; ④ HMMs are prone to overfitting due to excessively large state spaces, while gradient boosting algorithms can effectively suppress model complexity through pruning and subsampling mechanisms; ⑤ HMMs focus on global state transitions in the sequence, while gradient boosting algorithms can capture the differences in the importance of local features, achieving spatiotemporal feature fusion optimization.

[0043] In essence, the combination of Hidden Markov Models (HMM) and gradient boosting algorithms achieves complementarity between sequence modeling and feature engineering: HMM provides temporal patterns at the state level, while XGBoost enhances nonlinear modeling capabilities at the feature level. The algorithm formed by combining HMM and gradient boosting is particularly suitable for intelligent transportation scenarios such as path fitting for interconnected toll roads, which requires simultaneously handling temporal dependencies and high-dimensional features.

[0044] This application uses the XGBoost algorithm as an example to illustrate the basic principle of gradient boosting algorithms, as detailed below: XGBoost's objective function consists of a loss function (prediction error) and a regularization term (model complexity), used to balance prediction error and model complexity: ; in, For loss function, For the true value, For the front The predicted value of the trees, For the first The output of each tree, For the first The regularization term for each tree.

[0045] To optimize efficiently, XGBoost approximates the loss function using a second-order Taylor approximation: ; in, The first derivative of the loss function. The second derivative of the loss function. This is a constant term. , .

[0046] Regularization is defined to suppress overfitting, but the first... The complexity of a tree is determined by both the number of leaf nodes and their weights. ; in, The number of leaf nodes. For the first The weight of each leaf node. and These are hyperparameters used to control the splitting penalty and weight smoothing. Increase the inhibition of cell division, Suppress large weights).

[0047] When parsing the leaf node values, the samples are grouped according to the leaf nodes. Then the objective function simplifies to: ; Based on the simplified objective function described above, the sum of the weighted trees can be calculated, and the softmax transformation of the leaf node scores can be output.

[0048] Figure 3 This application proposes a path fitting method using a path fitting model combining Hidden Markov Models (HMM) and gradient boosting algorithms. For example... Figure 3 As shown, the method includes steps S110 to S140.

[0049] Step S110: Obtain road network data and trajectory data of the user to be matched.

[0050] The trajectory data includes, based on the Global Positioning System (GPS), identification information (such as trajectory point ID), timestamps (time of location of the trajectory point), location information (expressed in latitude and longitude), speed information (which can be instantaneous speed, average speed between adjacent trajectory points, and may also include angular velocity and acceleration), and direction information (describing the direction of movement of the user to be matched, expressed as azimuth angle between adjacent trajectory points). The road network data includes the geometric and topological information of the roads from the user's origin to the destination; that is, the road network data includes the geometric and topological structure of all passable road networks from the origin to the destination, which can be obtained from electronic maps or official highway management systems. The user's origin and destination can be determined based on the path to be matched, for example, based on highway entrances and exits traversed by the user.

[0051] The adjacent trajectory points mentioned in this application refer to two trajectory points with adjacent timestamps in the trajectory point sequence collected by GPS, that is, the adjacent trajectory points are the trajectory point collected at time t and the trajectory point collected at time t+1 (or the trajectory point collected at time t-1 and time t).

[0052] In some embodiments of the present invention, due to the influence of multipath effects and signal blockage, defects, multiple points, and deviations frequently occur in mobile phone GPS data. To address the issue of high noise sensitivity, obtaining the trajectory data of the user to be matched may include: sampling based on a set sampling frequency (sampling from the GPS system) to obtain the original trajectory data of the user to be matched; and performing data preprocessing on the original trajectory data to remove trajectory points with abnormal speed, direction, and position information. For example, trajectory points with abnormal speed information may be those with speeds exceeding the normal driving speed of a vehicle; trajectory points with abnormal direction information may be those with a direction angle range exceeding 0–360°; and trajectory points with abnormal position information may be those with a large positional deviation compared to other trajectory points.

[0053] Step S120: Based on road network data and trajectory data (mainly the location information of trajectory points in the trajectory data), determine the candidate road segments corresponding to each trajectory point. The candidate road segments are road segments that the vehicle may pass through during its journey, and the number of candidate road segments corresponding to each trajectory point can be one or more.

[0054] More specifically, for each trajectory point, this step can utilize a geohashing algorithm (i.e., the GeoHash algorithm) to select road segments whose distance from the trajectory point is less than a set radius as candidate road segments based on the location information of the trajectory point in the trajectory data and road network data. For example, for each trajectory point, all road segments within a set radius can be selected as candidate road segments, with that point as the center.

[0055] As an example, road segments between any two road intersections can be determined based on road network data, forming a set of road segments, and then candidate road segments corresponding to trajectory points can be selected from the set of road segments.

[0056] In this application, the vertical projection point of the trajectory point onto its corresponding candidate road segment is called the candidate point (the perpendicular line from the trajectory point to the candidate road segment is the foot of the perpendicular). If there is no projection point, the point on the candidate road segment closest to the trajectory point is used as the candidate point. Moreover, the distance between the candidate road segment and the trajectory point can be expressed as the Euclidean distance between the candidate point formed by the vertical projection of the trajectory point onto the candidate road segment and the trajectory point.

[0057] Step S130: For each trajectory point, input the location information of the corresponding candidate road segment (determined based on road network data) and the relevant information of the trajectory point in the trajectory data (mainly the speed and direction information of the trajectory point) into the pre-trained path fitting model, and output the observation probability corresponding to the trajectory point and the transition probability between the candidate road segment corresponding to the trajectory point and the candidate road segment corresponding to the adjacent trajectory point.

[0058] In some embodiments of the present invention, the application uses a sequence of trajectory points as an observation sequence. The final sequence of matching candidate road segments is the hidden sequence. According to the observation sequence Generate hidden sequences The probability of the observed sequence is the probability of the observed sequence. The probability of moving from one hidden state to another is called the transition probability.

[0059] The observation probability corresponding to a trajectory point is determined based on the degree of offset between the trajectory point and the corresponding candidate road segment, as well as the directional similarity between the trajectory point and the corresponding candidate road segment. The degree of offset between the trajectory point and the corresponding candidate road segment is represented by the distance between the trajectory point and the candidate point projected onto the corresponding candidate road segment. For example, the observation probability can be a weighted sum of the degree of offset and the directional similarity.

[0060] For each trajectory point, the transition probability between the candidate road segment corresponding to that trajectory point and the candidate road segments corresponding to its neighboring trajectory points is based on the distance between trajectory point a and its neighboring trajectory point b. The shortest path distance between the candidate road segment (i.e., the candidate road segment corresponding to trajectory point a and the candidate road segment corresponding to the adjacent trajectory point b) The distance similarity between the trajectory points, the distance similarity between the trajectory point and its corresponding candidate road segment (D) and the distance similarity between adjacent trajectory points and their corresponding candidate road segments (D'), and the speed information of each trajectory point (the contribution of trajectory point speed information to the transition probability can be represented by the ratio between the trajectory point's speed and the road speed limit) are all considered. Among these, the shortest path distance between candidate road segments is also considered. The shortest path distance between the candidate point projected onto the corresponding candidate road segment and the candidate point projected onto the corresponding candidate road segment of the adjacent trajectory point is used. The similarity between the distances between the trajectory point and the adjacent trajectory point and the corresponding candidate road segment is represented by the distance similarity between the first distance (i.e., D) formed by the candidate point projected onto the corresponding candidate road segment and the trajectory point and the second distance (i.e., D') formed by the candidate point projected onto the corresponding candidate road segment of the adjacent trajectory point and the adjacent trajectory point.

[0061] As an example, in this application, distance similarity can be represented by a ratio of distances, therefore the transition probability can be based on... , The ratio between the speed of the trajectory point and the road speed limit Confirmed. Furthermore, the transition probability can be... , and The accurate weighted summation value.

[0062] Furthermore, the pre-trained path fitting model includes a Hidden Markov Model (HMM) and a Gradient Boosting Model (GPB), with the output of the HMM serving as the input to the GPB. The path fitting model can be obtained by using the training sample set as input to the initial path fitting model and iteratively updating the model parameters based on the loss function and the output of the initial path fitting model, thereby obtaining the pre-trained path fitting model when a set training stopping condition is met (e.g., the number of iterations reaches a certain value or the loss function result is less than a set error). That is, this application uses a supervised training method to train the initial path fitting model.

[0063] In some embodiments of the present invention, the loss function may include a state confidence term and a prediction error term. The state confidence term is determined by the ratio of the log-likelihood probability obtained from the observation probability and transition probability output by the initial path fitting model to the temperature parameter; the gradient boosting model may be a model based on the XGBoost algorithm, and the prediction error term is determined based on the objective function of the XGBoost algorithm.

[0064] For example, the joint objective loss function of the model can be expressed by the following formula: ; The loss function of the model is also expressed using the following probability formula: ; in, Let represent the log-likelihood probability of the Hidden Markov Model (HMM). This represents the predicted probability of XGBoost. For temperature parameters, It is a constant (for example, it can be 1e-8). and These are the weights for the HMM and XGBoost algorithms, respectively. , As an example, to overcome the impact of parameter changes on path fitting accuracy, the method further includes updating the trained path fitting model according to a set update cycle to achieve periodic model updates.

[0065] Step S140: Using the Viterbi algorithm, a sequence of candidate road segments is fitted based on the observation probability and transition probability to obtain a matching sequence. For example, based on the observation probability and transition probability of each trajectory point output by the Viterbi algorithm and the model, the set of trajectory points with the largest cumulative sum of comprehensive probabilities can be calculated (the comprehensive probability of the first trajectory point is the observation probability, and the comprehensive probabilities of other trajectory points excluding the first trajectory point are the product of the observation probability and the transition probability), thus obtaining the optimal map matching result. The larger the comprehensive probability, the greater the probability that the trajectory point is bound to the candidate road segment. The comprehensive probability can also be the sum of the observation probability and the transition probability. This application does not specifically limit the specific calculation method of the comprehensive probability; it can be determined based on the observation probability and the transition probability.

[0066] Figure 4 This diagram illustrates the calculation of the optimal binding road between two adjacent trajectory points at time t and time t+1. This represents information about the trajectory points at time t. This represents information about the trajectory points at time t+1. This represents the trajectory point corresponding to time t. For each candidate road segment, the observation probability (observationRate) represents the observation probability between a trajectory point and its corresponding candidate road segment, which can be simply understood as the observation probability of the trajectory point. The transition probability (stateTranRate) represents the transition probability between two adjacent trajectory points at time t and time t+1 (since this probability is related to these two trajectory points and the candidate road segments corresponding to the trajectory points, it can also be understood as the transition probability between candidate road segments). The output probability (outputRate) is used to represent the total score bound to the current candidate road segment up to the current trajectory point. Figure 4 In and If the overall probability is 0, the road will no longer be considered. In an extreme case, if the overall probability of all candidate road segments is 0, it means that the user may be violating traffic regulations or that the road network is incomplete. In this case, the binding should be interrupted and the path fitting should be started again. The fitting results should be output in segments.

[0067] This application can also define the preceding best-binding road segment, such as Figure 4 For each candidate road segment corresponding to a GPS point at time t+1, the transition probability and overall probability need to be calculated separately for all candidate road segments of the previous GPS point (excluding candidate road segments with an overall probability of 0). The road segment with the highest overall probability is recorded as the best preceding bound road segment for the GPS point at time t+1. For example... The best preceding binding segment is ,and The best preceding binding segment is ,but There is no preceding best-binding segment.

[0068] Different GPS points may have different optimal road chains, such as Figure 4 As shown, for a GPS point at time t, the candidate road segment with the highest overall probability is... For the GPS point at time t+1, the candidate road segment with the highest overall probability is... By recursively backtracking the previous best-bound road segment from the last GPS point candidate road segment to the first point, we obtain the final bound road and bound position corresponding to any GPS point in a series of GPS points, thus obtaining the entire best-bound road chain.

[0069] By comparing the HMM map matching algorithm with the path fitting model proposed in this application, the significant effect of the proposed model is verified. The comparison results are shown in Table 1.

[0070] Table 1 Comparison of key performance parameters of the HMM model after optimization using the XGBoost algorithm. The path fitting method proposed in this application has the following advantages: ① Dynamic parameter optimization: This application combines existing HMM and gradient boosting algorithms to construct a path fitting model that fuses spatiotemporal features, thereby achieving dynamic modeling. This overcomes the shortcomings of traditional HMMs, such as static state transition probabilities and single observation features, and leverages HMM to enhance the gradient boosting algorithm's lack of temporal modeling capabilities. ② Compared to methods like hierarchical path reconstruction, which are difficult to dynamically update, the model proposed in this application can achieve second-level matching of millions of trajectory points. ③ Dual-modal feature fusion: By combining vehicle dynamics features (acceleration, angular velocity) with road topology features, multi-source heterogeneous feature fusion is achieved. ④ The model proposed in this application is adaptable to embedded device edge computing scenarios and is compatible with multiple systems. It enables lightweight deployment of embedded devices, for example, by adopting a hybrid architecture of centralized cloud computing and distributed edge computing.

[0071] Corresponding to the above method, the present invention also provides a path fitting system based on trajectory data. The system includes a computer device, which includes a processor and a memory. The memory stores computer programs / instructions, and the processor is used to execute the computer programs / instructions stored in the memory. When the computer programs / instructions are executed by the processor, the system implements the steps of the method described above.

[0072] Furthermore, this application also designs a path fitting system for networked toll roads based on a model algorithm that integrates Hidden Markov Models (HMM) and gradient boosting. This system can be applied to pre-toll estimation, post-toll auditing, online toll path reconstruction, and the construction of a comprehensive customer service system. For example... Figure 5 The diagram shows the overall system architecture. The system comprises four layers: sensing and acquiring various data through underlying hardware infrastructure such as gantries and toll lanes; building infrastructure services through the IaaS layer; constructing rich, diverse, comprehensive, and personalized middleware services through the PaaS layer; and building multiple application platforms through the SaaS layer, providing display and operation windows for various types of users. The path fitting model proposed in this application is set at the IaaS layer.

[0073] The functional design diagram of the path fitting system is as follows: Figure 6 As shown, the system features data display, data query, case analysis, data statistics, and data updates. After determining the path fitting through the query service, new logs can be generated and stored for subsequent case analysis. Furthermore, the system can compile and process updated data in the road network and store it in the database for later statistical queries.

[0074] like Figure 7 As shown, the path fitting system designed in this application can be linked with the high-speed gantry management system, supporting the display of all squares and gantry within the view range, and supporting the query of squares and gantry based on user ID. Figure 8The path fitting display interface can show all the gantries along the path and the map matching results, and mark which gantries were newly added during the fitting process. Figure 9 This is the statistical analysis interface. Statistical indicators include: number of requests, overall success rate, effective success rate, percentage of errors caused by noise in the plaza, percentage of errors caused by abnormal reversals, percentage of errors caused by plaza not being provided, percentage of errors caused by plaza unavailability, percentage of errors caused by low-quality plaza not being used, percentage of errors caused by plaza not being used, percentage of errors caused by using open plazas, percentage of errors caused by connectivity errors, and percentage of errors caused by request time errors. Figure 10 The interface shown is for statistics on path fitting failure cases. It supports daily statistics of high-frequency failure cases and provides no more than 3 example cases.

[0075] This invention also provides a computer-readable storage medium storing a computer program / instructions thereon, which, when executed by a processor, implements the steps of the aforementioned edge computing server deployment method. The computer-readable storage medium can be a tangible storage medium, such as random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, floppy disks, hard disks, removable storage disks, CD-ROMs, or any other form of storage medium known in the art.

[0076] This invention also provides a computer program product storing a computer program / instructions thereon, which, when executed by a processor, implements the steps of the aforementioned edge computing server deployment method. The computer program product can be a tangible product, such as random access memory (RAM), memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, floppy disks, hard disks, removable storage disks, CD-ROMs, or any other form of product known in the art.

[0077] Those skilled in the art will understand that the exemplary components, systems, and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software, or a combination of both. Whether 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 implementation should not be considered beyond the scope of this invention. When implemented in hardware, it can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this invention are programs or code segments used to perform the desired tasks. The programs or code segments can be stored in a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried in a carrier wave.

[0078] It should be clarified that the present invention is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of the present invention.

[0079] In this invention, features described and / or illustrated for one embodiment may be used in the same or similar manner in one or more other embodiments, and / or combined with or in place of features of other embodiments.

[0080] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, various modifications and variations of the embodiments of the present invention are possible. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A trajectory data based path fitting method, characterized in that, The method comprises the following steps: Obtaining road network data and trajectory data of a user to be matched; wherein the trajectory data comprises position information, speed information and direction information of all trajectory points of the user to be matched detected based on a global positioning system from a starting point to an ending point, and the road network data comprises road geometric topology information between the starting point and the ending point of the user to be matched; Based on the road network data and the trajectory data, determining a corresponding candidate road segment for each trajectory point; For each trajectory point, inputting the position information of the determined corresponding candidate road segment and the related information of the trajectory point in the trajectory data into a pre-trained path fitting model, and outputting an observation probability corresponding to the trajectory point and a transition probability between the candidate road segment corresponding to the trajectory point and the candidate road segment corresponding to an adjacent trajectory point; wherein the pre-trained path fitting model comprises a hidden Markov model and a gradient boosting model, and the output of the hidden Markov model is taken as the input of the gradient boosting model; Using a Viterbi algorithm, fitting a matched candidate road segment sequence based on the observation probability and the transition probability.

2. The method of claim 1, wherein, The observation probability corresponding to a trajectory point is determined based on the offset degree between the trajectory point and the corresponding candidate road segment and the direction similarity between the trajectory point and the corresponding candidate road segment; The transition probability between the candidate road segment corresponding to the trajectory point and the candidate road segment corresponding to an adjacent trajectory point is determined based on the distance similarity between the distance between the trajectory point and the adjacent trajectory point and the shortest path distance between the candidate road segments, the similarity of the distances between the trajectory point and the adjacent trajectory point and the corresponding candidate road segments, and the speed information of each trajectory point.

3. The method of claim 2, wherein, The offset degree between the trajectory point and the corresponding candidate road segment is represented by the distance between the trajectory point and the candidate point on the corresponding candidate road segment to which the trajectory point is projected; The shortest path distance between the candidate road segments is the shortest path distance between the candidate point on the corresponding candidate road segment to which the trajectory point is projected and the candidate point on the corresponding candidate road segment to which the adjacent trajectory point is projected; The similarity of the distances between the trajectory point and the adjacent trajectory point and the corresponding candidate road segments is represented by the distance similarity between a first distance formed by the candidate point on the corresponding candidate road segment to which the trajectory point is projected and the trajectory point and a second distance formed by the candidate point on the corresponding candidate road segment to which the adjacent trajectory point is projected and the adjacent trajectory point.

4. The method of claim 1, wherein, The path fitting model is obtained by the following method: Taking a training sample set as the input of an initial path fitting model, and iteratively updating the model parameters based on a loss function and the output result of the initial path fitting model, thereby obtaining a pre-trained path fitting model; wherein the loss function comprises a state confidence term and a prediction error term.

5. The method of claim 4, wherein, The state confidence term is determined by the ratio of the log-likelihood probability obtained based on the observation probability and the transition probability output by the initial path fitting model and a temperature parameter; The gradient boosting model is a model based on an XGBoost algorithm, and the prediction error term is determined based on an objective function of the XGBoost algorithm.

6. The method of claim 1, wherein, The determination of the corresponding candidate road segment for each trajectory point based on the road network data and the trajectory data comprises: Using a geographic hash algorithm, based on the position information of each trajectory point in the trajectory data and the road network data, the road segments with a distance less than a set radius from each trajectory point are taken as the candidate road segments corresponding to each trajectory point.

7. The method of claim 1, wherein, Obtain trajectory data of a user to be matched, including: Sampling based on a set sampling frequency to obtain original trajectory data of the user to be matched, and performing data preprocessing on the original trajectory data to eliminate trajectory points with abnormal speed information, direction information, and position information.

8. A trajectory data based path fitting system comprising a processor, a memory and a computer program / instructions stored on the memory, wherein, The processor is configured to execute the computer programs / instructions, and when the computer programs / instructions are executed, the system implements the steps of the method according to any one of claims 1 to 7.

9. A computer readable storage medium having stored thereon computer programs / instructions, characterized in that, The computer programs / instructions are executed by the processor to implement the steps of the method according to any one of claims 1 to 7.

10. A computer program product comprising computer programs / instructions, characterized in that, The computer programs / instructions are executed by the processor to implement the steps of the method according to any one of claims 1 to 7.