Line net matching method and device based on improved hidden markov model and medium

By using an improved Hidden Markov Model and a deep learning framework, the accuracy and robustness issues in matching bus routes with road networks were resolved, achieving efficient matching of bus routes with road networks and improving matching performance.

CN116337040BActive Publication Date: 2026-04-10GUANGZHOU URBAN PLANNING & DESIGN SURVEY RES INST
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGZHOU URBAN PLANNING & DESIGN SURVEY RES INST
Filing Date
2023-03-20
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing map matching algorithms suffer from poor matching performance, low accuracy, low efficiency, poor robustness and interpretability in matching public transport networks and corrected road networks, and are prone to errors, especially in complex road networks and sparse data.

Method used

An improved Hidden Markov Model is adopted, combined with a deep learning framework. By acquiring bus network and road network data for preprocessing, the emission probability and transition probability of candidate points are calculated. The Viterbi algorithm is used to trace the shortest path to achieve accurate matching between the bus network and the road network.

Benefits of technology

It improves the matching accuracy between the bus network and the road network, enhances the robustness and relevance of the model, improves the matching performance, and avoids the limitations of traditional methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116337040B_ABST
    Figure CN116337040B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on improved hidden Markov model line network matching method, device and medium, by obtaining bus line network data and road network data, and the bus line network data and road network data are preprocessed, obtain the point set to be matched of bus line network and the section set of road network, the point set to be matched of bus line network and the section set of road network are input into the fitting hidden Markov model of pre-set, the emission probability and transition probability of all candidate points corresponding to all points to be matched of the bus line network are calculated, the shortest path between all candidate points of any adjacent point to be matched of the bus line network is calculated using Viterbi algorithm tracing source, obtain the matching result of bus line network and road network.Therefore, the application embodiment can improve the matching accuracy of bus line network and road network.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of intelligent transportation, and in particular to a line-network matching method and device based on an improved hidden Markov model and a medium. BACKGROUND

[0002] Due to the problems of the Internet map used in the production process, such as the road network update not being timely and the information being inaccurate, it is necessary to correct the space and information. As an important part of the transportation system, the bus line network does not match the corrected map. In order to realize the fusion of the bus line network and the road network, support the optimization of the bus line and the station, and improve the service level of the bus system, it is necessary to match the bus line network with the corrected road network.

[0003] The existing map matching algorithm is mostly used for the road generated by GPS data, which can be roughly divided into six categories: (1) geometric matching algorithm, which uses line-to-line, point-to-point and point-to-line matching, is easy to calculate and has high efficiency, but only considers the road topology, trajectory characteristics and other factors, and the matching of nodes in the road network is prone to errors and has low stability; (2) topological relationship algorithm, which is generally divided into two categories: simple topological relationship matching, which uses the topological relationship characteristics between roads and trajectories and GPS data information to limit the candidate road sections, thereby improving the matching accuracy; weighted topological relationship matching, which considers the correlation and the distance between GPS points and roads for weight calculation, thereby ranking the candidate road sections and selecting the road section with the highest weight, but the matching effect is poor and the precision is low; (3) probability algorithm, which adds a confidence interval, calculates scores for multiple road sections in the confidence interval and ranks them, and selects the road section with the highest score, adds a confidence interval at the intersection, and improves the matching efficiency at the turning point, but the running speed decreases with the increase of the calculation complexity; (4) fuzzy logic algorithm, which uses membership functions to describe candidate roads through fuzzification, reasoning and defuzzification, and selects roads by calculating errors, but it lacks theoretical basis, has poor interpretability, low calculation efficiency and poor practicability; (5) Bayesian algorithm, which considers the errors of road generation and designs network topology to calculate the probability values of each road section for matching, but it needs to preset the initial matching, and has insufficient adaptability to complex road networks and sparse data, and is prone to a series of errors caused by a single data point error; (6) Kalman filter algorithm, which analyzes whether the error of the model meets the Gaussian distribution based on noise assumption, and then matches the map, but it has poor matching effect in the early stage, and does not comprehensively consider the properties of the road network, which easily causes the matching route to detour at the error is large or the intersection node. Therefore, the existing map matching algorithm usually has the following limitations: 1. poor matching effect and low precision; 2. low matching efficiency, poor robustness and poor interpretability. SUMMARY

[0004] The application provides a line network matching method and device based on an improved hidden Markov model and a medium to solve the limitations of the existing map matching method, realize accurate matching of bus lines and corrected road networks, and do not need to preset functions, thereby enhancing the robustness and pertinence of the hidden Markov model and improving the matching performance of the model.

[0005] To achieve the above-mentioned purpose, in a first aspect, the embodiments of the application provide a line network matching method based on an improved hidden Markov model, comprising:

[0006] Obtaining bus line network data and road network data, and preprocessing the bus line network data and the road network data to obtain a set of to-be-matched points of the bus line network and a set of road segments of the road network;

[0007] Inputting the set of to-be-matched points of the bus line network and the set of road segments of the road network into a preset fitted hidden Markov model to calculate the emission probability and the transition probability of all candidate points corresponding to all to-be-matched points of the bus line network;

[0008] Taking the emission probability and the transition probability as input, using a Viterbi algorithm to trace back to calculate the shortest path between all candidate points of any adjacent to-be-matched points of the bus line network to obtain a matching result of the bus line network and the road network.

[0009] As an improvement of the above-mentioned scheme, the inputting of the set of to-be-matched points of the bus line network and the set of road segments of the road network into the preset fitted hidden Markov model to calculate the emission probability and the transition probability of all candidate points corresponding to all to-be-matched points of the bus line network specifically comprises:

[0010] Inputting the set of to-be-matched points of the bus line network and the set of road segments of the road network into the preset fitted hidden Markov model;

[0011] Calculating the shortest distance of a target to-be-matched point in the set of to-be-matched points and m road segments in a preset range of the target to-be-matched point in the set of road segments, setting the points on the m road segments used to calculate the shortest distance as candidate points to obtain a candidate point set of the target to-be-matched point;

[0012] Calculating the shortest path and distance between the candidate point set corresponding to the target to-be-matched point and the candidate point set corresponding to a to-be-matched point adjacent to the target to-be-matched point to obtain a distance error set between the target to-be-matched point and the adjacent to-be-matched point;

[0013] The probability distribution functions of the shortest distances and the distance error sets of all the to-be-matched points in the to-be-matched point set are fitted by using a deep learning framework to construct and train the probability distribution functions of the emission probability and the transition probability of the hidden Markov chain, so as to obtain the emission probability and the transition probability of all the candidate points corresponding to all the to-be-matched points of the bus line network.

[0014] As an improvement of the above scheme, the probability distribution functions of the shortest distances and the distance error sets of all the to-be-matched points in the to-be-matched point set are fitted by using a deep learning framework to construct and train the probability distribution functions of the emission probability and the transition probability of the hidden Markov chain, so as to obtain the emission probability and the transition probability of all the candidate points corresponding to all the to-be-matched points of the bus line network, specifically comprising:

[0015] The maximum and minimum values of the shortest distance set and the distance error set are calculated, and the shortest distance set and the distance error set are divided into several intervals;

[0016] The probability distribution of the shortest distance set in each interval and the probability distribution of the distance error set in each interval are calculated, and the first probability distribution set of the shortest distance set and the second probability distribution set of the distance error set are formed by merging, and the center values of each interval of the shortest distance set form a first center value set, and the center values of each interval of the distance error set form a second center value set;

[0017] A neural network with an input size of 1, a hidden layer neuron of 3, an activation function of Sigmoid function, an output size of 1, an optimizer of Adam, and a loss function of mean square error is built by using a deep learning framework;

[0018] The neural network is trained by using the first probability distribution set and the first center value set to fit the probability distribution function of the shortest distance set, and the neural network is trained by using the second probability distribution set and the second center value set to fit the probability distribution function of the distance error set, so as to obtain the emission probability and the transition probability of all the candidate points corresponding to all the to-be-matched points of the bus line network.

[0019] As an improvement of the above scheme, the emission probability and the transition probability are taken as inputs, and the Viterbi algorithm is used to trace back to calculate the shortest path between all the candidate points of any adjacent to-be-matched points of the bus line network, so as to obtain the matching result of the bus line network and the road network, specifically comprising:

[0020] The emission probability and the transition probability are taken as inputs, and the Viterbi probability of the jth candidate point of the tth to-be-matched point is calculated according to the order of the to-be-matched point set.

[0021] when t-1 is 0, and the Viterbi probability is equal to its corresponding emission probability, selecting a preset candidate point with the maximum Viterbi probability of the last layer of the fitted hidden Markov model, backtracking layer by layer to find the candidate point selected at the t-1 layer, and so on until the corresponding candidate point of the first layer of the fitted hidden Markov model is found;

[0022] forming a first collection of the selected candidate points, traversing adjacent two candidate points in the first collection from the first candidate point, and obtaining the shortest path of the adjacent two candidate points to form a path set, and obtaining a matching result of the bus line network and the road network.

[0023] In a second aspect, an embodiment of the present application provides a bus line network and road network matching device based on an improved hidden Markov model, comprising:

[0024] a data acquisition module, configured to acquire bus line network data and road network data, and preprocess the bus line network data and the road network data to obtain a to-be-matched point set of the bus line network and a road section set of the road network;

[0025] a probability acquisition module, configured to input the to-be-matched point set of the bus line network and the road section set of the road network into a preset fitted hidden Markov model, and calculate emission probabilities and transition probabilities of all candidate points corresponding to all to-be-matched points of the bus line network;

[0026] a matching result module, configured to take the emission probabilities and the transition probabilities as inputs, and calculate shortest paths between all candidate points of any adjacent to-be-matched points of the bus line network by using a Viterbi algorithm, to obtain a matching result of the bus line network and the road network.

[0027] As an improvement of the above scheme, the probability acquisition module is specifically configured to:

[0028] input the to-be-matched point set of the bus line network and the road section set of the road network into the preset fitted hidden Markov model;

[0029] calculate shortest distances of m road sections within a preset range of a target to-be-matched point in the to-be-matched point set and the target to-be-matched point, set points on the m road sections used for calculating the shortest distances as candidate points, and obtain a candidate point set of the target to-be-matched point;

[0030] calculate shortest paths and distances between the candidate point set corresponding to the target to-be-matched point and a candidate point set corresponding to a to-be-matched point adjacent to the target to-be-matched point, to obtain a distance error set between the target to-be-matched point and the adjacent to-be-matched point;

[0031] The probability distribution functions of the shortest distances and the distance error sets of all the to-be-matched points in the to-be-matched point set are fitted by using a deep learning framework to construct and train the probability distribution functions of the emission probability and the transition probability of the hidden Markov chain, so as to obtain the emission probability and the transition probability of all the candidate points corresponding to all the to-be-matched points of the bus line network.

[0032] As an improvement of the above scheme, the probability distribution functions of the shortest distances and the distance error sets of all the to-be-matched points in the to-be-matched point set are fitted by using a deep learning framework to construct and train the probability distribution functions of the emission probability and the transition probability of the hidden Markov chain, so as to obtain the emission probability and the transition probability of all the candidate points corresponding to all the to-be-matched points of the bus line network, specifically comprising:

[0033] The maximum and minimum values of the shortest distance set and the distance error set are calculated, and the shortest distance set and the distance error set are divided into several intervals;

[0034] The probability distribution of the shortest distance set in each interval and the probability distribution of the distance error set in each interval are calculated, and the first probability distribution set of the shortest distance set and the second probability distribution set of the distance error set are formed by merging, and the center values of each interval of the shortest distance set form a first center value set, and the center values of each interval of the distance error set form a second center value set;

[0035] A neural network with an input size of 1, a fully connected layer with 3 hidden layer neurons, a Sigmoid function as the activation function, an output size of 1, an Adam optimizer, and a mean square error loss function is built by using a deep learning framework;

[0036] The neural network is trained by using the first probability distribution set and the first center value set to fit the probability distribution function of the shortest distance set, and the neural network is trained by using the second probability distribution set and the second center value set to fit the probability distribution function of the distance error set, so as to obtain the emission probability and the transition probability of all the candidate points corresponding to all the to-be-matched points of the bus line network.

[0037] As an improvement of the above scheme, the matching result module is specifically used for:

[0038] The emission probability and the transition probability are taken as inputs, and the Viterbi probability of the jth candidate point of the tth to-be-matched point is calculated according to the order of the to-be-matched point set.

[0039] When t-1 is 0 and the Viterbi probability is equal to the corresponding emission probability, a preset candidate point with the maximum Viterbi probability of the last layer of the fitted hidden Markov model is selected, and a candidate point selected at the t-1 layer is found by backtracking layer by layer, and the process is repeated until a candidate point corresponding to the first layer of the preset fitted hidden Markov model is found;

[0040] The selected candidate points form a first collection, and adjacent two candidate points in the first collection are traversed from the first candidate point, and a shortest path of the adjacent two candidate points is obtained to form a path collection, and a matching result of the bus line network and the road network is obtained.

[0041] In a third aspect, an embodiment of the present application provides a bus line network and road network matching device based on the improved hidden Markov model, which comprises a processor, a memory and a computer program stored in the memory and configured to be executed by the processor, and the processor implements the bus line network and road network matching method based on the improved hidden Markov model when executing the computer program.

[0042] In addition, an embodiment of the present application further provides a computer readable storage medium, which comprises a stored computer program, wherein the computer readable storage medium controls a device where the computer readable storage medium is located to execute the bus line network and road network matching method based on the improved hidden Markov model when the computer program runs.

[0043] Compared with the prior art, the bus line network and road network matching method, device and medium based on the improved hidden Markov model disclosed by the embodiment of the present application can obtain bus line network data and road network data, and pre-process the bus line network data and the road network data to obtain a to-be-matched point set of the bus line network and a road section set of the road network, input the to-be-matched point set of the bus line network and the road section set of the road network into a preset fitted hidden Markov model, calculate emission probabilities and transition probabilities of all candidate points corresponding to all to-be-matched points of the bus line network, use a Viterbi algorithm to trace the shortest paths between all candidate points of any adjacent to-be-matched points of the bus line network, and obtain a matching result of the bus line network and the road network. Therefore, the embodiment of the present application can improve the matching accuracy of the bus line network and the road network, and the embodiment of the present application is based on a deep learning framework to perform nonlinear fitting on probability distributions of two errors, does not need to preset a function, and compared with a traditional normal distribution or exponential distribution, the robustness and pertinence of the preset fitted hidden Markov model are enhanced, and the matching performance of the preset fitted hidden Markov model is improved. BRIEF DESCRIPTION OF DRAWINGS

[0044] Figure 1 is a flowchart of a bus line network and road network matching method based on an improved hidden Markov model provided by the embodiment of the present application;

[0045] Figure 2 is a structural schematic diagram of a line network matching device based on a modified hidden Markov model according to an embodiment of the present application. DETAILED DESCRIPTION

[0046] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.

[0047] It should be noted that the terms “comprise” and “specific” and any variations of them in the present application are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device comprising a series of steps or units does not have to be limited to the clearly listed steps or units, but can include other steps or units that are not clearly listed or inherent to the process, method, product or device.

[0048] Please refer to Figure 1 , Figure 1 is a flowchart of a line network matching method based on a modified hidden Markov model according to an embodiment of the present application. The line network matching method based on the modified hidden Markov model comprises steps S11 to S13.

[0049] S11: Obtain bus line network data and road network data, and pre-process the bus line network data and the road network data to obtain a set of to-be-matched points of the bus line network and a set of road segments of the road network;

[0050] Specifically, the required bus line network data and road network data include a complete vector file of the bus line network in the research area boundary (attributes include: uplink / downlink, line name, departure frequency, etc.), and a vector file of the road network after spatial and information correction. The data of the bus line network is flexibly compatible, and the bus line network data can be detailed linear data or only have bus route station information, and the compatibility of sparse data is good.

[0051] First, the bus line network data is divided into uplink and downlink data sets, denoted as L up and L down , wherein each data set contains line elements of each bus route, denoted as and Then, the line elements are divided into point sets according to the turning points, which are used for the following matching, taking L as an example, the corresponding point set is denoted as , wherein each point element contains longitude and latitude information in the WGS84 coordinate system, denoted as for the next matching calculation.

[0052] A LinkID is given to each road segment of the road network set for recording the path and subsequent tracing work.

[0053] S12: input the set of to-be-matched points of the bus line network and the set of road segments of the road network into a preset fitting hidden Markov model, and calculate the emission probability and transition probability of all candidate points corresponding to all to-be-matched points of the bus line network;

[0054] S13: take the emission probability and transition probability as input, and use the Viterbi algorithm to trace and calculate the shortest path between all candidate points of any adjacent to-be-matched points of the bus line network, and obtain the matching result of the bus line network and the road network.

[0055] As a preferred embodiment, the step S12 specifically comprises:

[0056] S121: input the set of to-be-matched points of the bus line network and the set of road segments of the road network into a preset fitting hidden Markov model;

[0057] S122: calculate the shortest distance of a target to-be-matched point of the set of to-be-matched points and n road segments within a preset range of the target to-be-matched point in the set of road segments, set the points on the n road segments corresponding to the calculation of the shortest distance as candidate points, and obtain the candidate point set of the target to-be-matched point;

[0058] Specifically, for the tth to-be-matched point of the set of to-be-matched points, the shortest distances to the surrounding road segments are calculated (if the foot of the perpendicular line is on the road segment, the distance of the perpendicular line segment is selected; if the foot of the perpendicular line is outside the road segment, the distance between the to-be-matched point and the closer road segment endpoint is selected), and n shortest shortest distances are selected and recorded as , and the corresponding points on the road segments used for calculating the shortest path are set as candidate points and recorded as t,1 , t,2 , t,n .

[0059] S123: calculate the shortest path and distance between the candidate point set corresponding to the target to-be-matched point and the candidate point set corresponding to the adjacent to-be-matched point of the target to-be-matched point, so as to obtain the distance error set between the target to-be-matched point and the adjacent to-be-matched point.

[0060] Specifically, m road segments within the specified range of the to-be-matched point are searched, and the shortest path algorithm is used to calculate the candidate point set {c t,1 , t,2 , t,n of the tth to-be-matched point.The shortest path and distance between the candidate point set {c t+1,1 , t+1,2 …,c t+1,n} and the (t+1)th to-be-matched point are determined, the shortest path is denoted as Link(c t,i , t+1,j ), the shortest distance is denoted as d(c t,i , t+1,j ), the distance is merged into a set denoted as D(c t , t+1 ), the Euclidean straight-line distance between the tth to-be-matched point and the (t+1)th to-be-matched point is denoted as d(t,t+1), each element in D(c t , t+1 ) is subtracted from d(t,t+1) and the absolute value is taken to form a new distance error set denoted as

[0061] In step S124, a probability distribution function of the emission probability and the transition probability of the fitted hidden Markov chain is constructed and trained by using a deep learning framework to fit the probability distribution functions of the shortest distances and the distance error sets of all to-be-matched points in the to-be-matched point set, so as to obtain the emission probability and the transition probability of all candidate points corresponding to all to-be-matched points of the bus line network.

[0062] As a preferred embodiment, the step S124 specifically comprises the following steps:

[0063] All shortest distances are recorded as a shortest distance set, the maximum value and the minimum value of the shortest distance set and the distance error set are counted, and the shortest distance set and the distance error set are divided into several intervals;

[0064] The probability distribution of the shortest distance set in each interval and the probability distribution of the distance error set in each interval are calculated, and the first probability distribution set of the shortest distance set and the second probability distribution set of the distance error set are formed by merging, and the center values of each interval of the shortest distance set form a first center value set and the center values of each interval of the distance error set form a second center value set;

[0065] A neural network with an input size of 1, a fully connected layer with 3 hidden layer neurons, a Sigmoid function as an activation function, an output size of 1, an Adam optimizer, and a mean square error loss function is built by using a deep learning framework;

[0066] The neural network is trained using the first probability distribution set and the first center value set to fit the probability distribution function of the shortest distance set, and the neural network is trained using the second probability distribution set and the second center value set to fit the probability distribution function of the distance error set, so as to obtain the emission probability and the transition probability of all candidate points corresponding to all to-be-matched points of the bus network.

[0067] Specifically, the functions of the reflection probability and the transition probability of the hidden Markov chain are fitted by using a deep learning framework. The emission probability function is the probability distribution density function of the shortest distance of the i-th candidate point of the t-th to-be-matched point, denoted as P c (t,i), which is used to reflect the influence of the distance factor between the to-be-matched point and the candidate point. The transition probability function is the probability distribution density function of the distance error between the i-th candidate point of the t-th to-be-matched point and the i-th candidate point of the t+1-th to-be-matched point, denoted as P d (c t,i ,c t+1,j ), which is used to reflect the influence of the path distance factor between the candidate points. First, the shortest distances between all to-be-matched points and their candidate points are calculated to form a set Loss C , and the maximum value max(Loss C ) and the minimum value min(Loss C ) in the set Loss C are obtained by statistics. The interval is step C , which is (max(Loss C )-min(Loss C )) / n. The probability distribution of Loss C in each interval is calculated, for example, the interval (0,step C ) corresponds to the probability , where is the number of Loss C in the interval, and n(Loss C ) is the total number. The probabilities in each interval are combined to form a set Y C :{P(0,step C ),P(step C ,2·step C )…,P(n·step C ,(n+1)·step C )}, and the center values of each interval are taken to form a set X c :{0.5·step C ,1.5·step C …,(n+0.5)·step C}, a neural network Net with an input size of 1, a fully connected layer with 3 hidden layer neurons (the number of neurons should be kept small to prevent overfitting), a Sigmoid function as the activation function, an output size of 1, an Adam optimizer, and a mean square error loss function is built using a deep learning framework c c c The probability distribution function of the Loss C

[0068] Similarly, the true path of all candidate points is calculated, and the corresponding error set is calculated, and all sets are aggregated to form the Loss D d The probability distribution of the path distance error is fitted by constructing and training the Net d

[0069] It should be noted that the tth matching point is taken as the tth layer of the preset fitted hidden Markov model, each layer has n candidate points (according to the road network and the position of the matching point, the number of candidate points in each layer <=n), the straight line distance between the candidate point and the matching point is input into the Net c , P c (t, i) calculated by the probability curve fitted by the deep learning network is taken as the emission probability of the candidate point; the distance error between the ith candidate point of the tth layer and the jth candidate point of the t+1th layer is input into the Net d , P d (c t,i , c t+1,j ) calculated by the probability curve fitted by the deep learning network is taken as the transition probability, and finally a hidden Markov model with a size of t x nix n+1 is formed.

[0070] As a preferred embodiment, the step S124 specifically comprises:

[0071] The emission probability and the transition probability are taken as inputs, and the Viterbi probability of the jth candidate point of the tth matching point is calculated according to the order of the set of matching points;

[0072] When t-1 is 0 and the Viterbi probability is equal to its corresponding emission probability, the candidate point with the maximum Viterbi probability of the last layer of the preset fitted hidden Markov model is selected, and the candidate point selected in the t-1th layer is found by backtracking layer by layer, and so on until the candidate point corresponding to the first layer of the preset fitted hidden Markov model is found;

[0073] ​​​The selected candidate points form a first collection, and the shortest paths of adjacent two candidate points in the first collection are traversed from the first candidate point to obtain a path set, and a matching result of the bus line network and the road network is obtained.

[0074] Specifically, the Viterbi probability of the jth candidate point of the tth to-be-matched point is calculated according to the order of the to-be-matched points, and is denoted as P v (t,j), and the calculation formula is P v (t,j) = P c (t,j) * max(P v (t-1,i) * P d (c t-1,i ,c t,j )), i is (1, 2, …, n), when t-1 is 0, P v (t,j) = P c (t,j), the candidate point with the maximum P v (t,j) of the last layer of the preset fitting hidden Markov model is selected, and the point selected at the t-1 layer of the preset fitting hidden Markov model is backtracked layer by layer, and the point corresponding to the first layer of the preset fitting hidden Markov model is found in the same way until the first layer of the preset fitting hidden Markov model is found. The selected points form a set denoted as R: {c 1,i ,c 2,j …, c n,k}, and the adjacent two candidate points in R are traversed from the first element, and the recorded Link(c t,i ,c t+1,j ) forms a path set, which is the final matching result.

[0075] Figure 2 is a structure schematic diagram of a line network matching device based on a modified hidden Markov model provided by an embodiment of the application. The line network matching device based on the modified hidden Markov model comprises:

[0076] The data acquisition module 21 is configured to acquire bus line network data and road network data, and pre-process the bus line network data and the road network data to obtain a to-be-matched point set of the bus line network and a road section set of the road network.

[0077] The probability acquisition module 22 is configured to input the to-be-matched point set of the bus line network and the road section set of the road network into a preset fitting hidden Markov model, and calculate the emission probability and the transition probability of all candidate points corresponding to all to-be-matched points of the bus line network.

[0078] The matching result module 23 is configured to take the emission probability and the transition probability as inputs, trace the shortest paths between all candidate points of any adjacent to-be-matched points of the bus line network by using a Viterbi algorithm, and obtain a matching result of the bus line network and the road network.

[0079] As a preferred embodiment, the acquisition probability module 22 specifically comprises:

[0080] An input unit is configured to input a to-be-matched point set of the bus line network and a road segment set of the road network into a preset fitting hidden Markov model.

[0081] A first calculation unit is configured to calculate shortest distances of m road segments within a preset range of a target to-be-matched point in the to-be-matched point set and the target to-be-matched point, take points corresponding to the m road segments used for calculating the shortest distances as candidate points, and obtain a candidate point set of the target to-be-matched point.

[0082] A second calculation unit is configured to calculate shortest paths and distances between the candidate point set corresponding to the target to-be-matched point and a candidate point set corresponding to a to-be-matched point adjacent to the target to-be-matched point, and obtain a distance error set between the target to-be-matched point and the adjacent to-be-matched point.

[0083] A fitting unit is configured to fit probability distribution functions of shortest distances and distance error sets of all to-be-matched points in the to-be-matched point set by using a deep learning framework to construct and train probability distribution functions of emission probability and transition probability of a fitting hidden Markov chain, so as to obtain emission probability and transition probability of all candidate points corresponding to all to-be-matched points of the bus line network.

[0084] As a preferred embodiment, the fitting unit is specifically configured to:

[0085] All shortest distances are recorded as a shortest distance set, maximum and minimum values of the shortest distance set and the distance error set are counted, and the shortest distance set and the distance error set are divided into several intervals;

[0086] Probability distributions of the shortest distance set in each interval and probability distributions of the distance error set in each interval are calculated, and a first probability distribution set of the shortest distance set and a second probability distribution set of the distance error set are formed by merging, and a first center value set is formed by taking center values of each interval of the shortest distance set, and a second center value set is formed by taking center values of each interval of the distance error set.

[0087] A neural network is built by using a deep learning framework, wherein the input size is 1, the number of neurons in the hidden layer is 3, the activation function is a Sigmoid function, the output size is 1, the optimizer is Adam, and the loss function is mean square error;

[0088] The neural network is trained by using the first probability distribution set and the first center value set to fit the probability distribution function of the shortest distance set, and the neural network is trained by using the second probability distribution set and the second center value set to fit the probability distribution function of the distance error set, so that the emission probability and the transition probability of all candidate points corresponding to all to-be-matched points of the bus line network are obtained.

[0089] As a preferred embodiment, the matching result module 23 is specifically configured to:

[0090] The emission probability and the transition probability are taken as inputs, and the Viterbi probability of the jth candidate point of the tth to-be-matched point is calculated according to the order of the to-be-matched point set;

[0091] When t-1 is 0 and the Viterbi probability is equal to the emission probability corresponding thereto, a candidate point with the maximum Viterbi probability of the last layer of a preset fitting hidden Markov model is selected, and the candidate point selected at the t-1 layer is found out by backtracking layer by layer, and the process is continued until the candidate point corresponding to the first layer of the preset fitting hidden Markov model is found out;

[0092] The selected candidate points form a first set, and the first candidate point in the first set is traversed to obtain the shortest path of the adjacent two candidate points, and a path set is formed, so that the matching result of the bus line network and the road network is obtained.

[0093] The line network matching device based on the improved hidden Markov model provided in the embodiment can implement all processes of the line network matching method based on the improved hidden Markov model, the functions of each module in the device and the technical effects achieved by the functions are the same as the functions of the line network matching method based on the improved hidden Markov model and the technical effects achieved by the functions, and thus will not be described here.

[0094] The line network matching device based on the improved hidden Markov model provided in the embodiment includes a processor, a memory and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps in the line network matching method based on the improved hidden Markov model are implemented. Alternatively, when the processor executes the computer program, the functions of each module in the line network matching device based on the improved hidden Markov model are implemented.

[0095] For example, the computer program can be divided into one or more modules, which are stored in the memory and executed by the processor to complete the present application. The one or more modules can be a series of computer program instruction segments capable of completing a specific function, which are used to describe the execution process of the computer program in the device.

[0096] The processor can be a central processing unit, and can also be other general-purpose processors, digital signal processors, application-specific integrated circuits, field programmable gate arrays or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc. The processor is the control center of the device, which connects various parts of the device through various interfaces and lines.

[0097] The memory can be used to store the computer program and / or modules, and the processor realizes various functions of the device by running or executing the computer program and / or modules stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required by a function (such as a sound playing function, an image playing function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card, at least one disk storage device, a flash memory device, or other volatile solid-state memory devices.

[0098] It should be noted that the above-described device embodiments are only illustrative, wherein the units described as separate components can or can not be physically separated, and the components displayed as units can or can not be physical units, i.e. they can be located in one place or distributed on multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the present embodiment. In addition, the connection relationship between the modules in the device embodiment provided by the present application indicates that there is a communication connection between them, which can be realized as one or more communication buses or signal lines. Those skilled in the art can understand and implement it without creative labor.

[0099] The embodiment of the present application also provides a computer readable storage medium, which comprises a stored computer program, wherein when the computer program runs, the device where the computer readable storage medium is located executes the improved hidden Markov model line network matching method according to the above embodiment.

[0100] In summary, the present invention discloses a method, apparatus, and medium for matching bus network data and road network data based on an improved Hidden Markov Model (HMM). This involves acquiring bus network data and road network data, preprocessing the bus network data and road network data to obtain a set of points to be matched in the bus network and a set of road segments in the road network. These sets are then input into a preset fitted HMM to calculate the emission probability and transition probability of all candidate points corresponding to all points to be matched in the bus network. The Viterbi algorithm is used to trace the shortest path between all candidate points of any adjacent points to be matched in the bus network, thus obtaining the matching result between the bus network and the road network. Therefore, the present invention can improve the matching accuracy between the bus network and the road network. Furthermore, the present invention uses a deep learning framework to perform nonlinear fitting of the probability distributions of the two errors, eliminating the need for a preset function. Compared with traditional normal or exponential distributions, this enhances the robustness and specificity of the preset fitted HMM, improving its matching performance.

[0101] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A line net matching method based on a modified hidden Markov model, characterized in that, The method comprises the following steps: obtaining bus line network data and road network data, and preprocessing the bus line network data and the road network data to obtain a set of to-be-matched points of the bus line network and a set of road segments of the road network; inputting the set of to-be-matched points of the bus line network and the set of road segments of the road network into a preset fitted hidden Markov model to calculate the emission probability and the transition probability of all candidate points corresponding to all to-be-matched points of the bus line network; using the Viterbi algorithm to trace back to calculate the shortest path between all candidate points of any adjacent to-be-matched points of the bus line network as input, and obtaining the matching result of the bus line network and the road network; wherein the step of inputting the set of to-be-matched points of the bus line network and the set of road segments of the road network into a preset fitted hidden Markov model to calculate the emission probability and the transition probability of all candidate points corresponding to all to-be-matched points of the bus line network comprises the following steps: inputting the set of to-be-matched points of the bus line network and the set of road segments of the road network into a preset fitted hidden Markov model; calculating the shortest distance of a target to-be-matched point in the set of to-be-matched points and m road segments within a preset range of the target to-be-matched point in the set of road segments, setting the points on the m road segments corresponding to the calculation of the shortest distance as candidate points to obtain a set of candidate points of the target to-be-matched point; calculating the shortest path and distance between the set of candidate points corresponding to the target to-be-matched point and the set of candidate points corresponding to the to-be-matched point adjacent to the target to-be-matched point to obtain a distance error set between the target to-be-matched point and the adjacent to-be-matched point; using a deep learning framework to construct and train a probability distribution function of the emission probability and the transition probability of the fitted hidden Markov model to fit the probability distribution functions of the shortest distances and the distance error sets of all to-be-matched points in the set of to-be-matched points to obtain the emission probability and the transition probability of all candidate points corresponding to all to-be-matched points of the bus line network.

2. The line net matching method based on the improved hidden Markov model according to claim 1, wherein, The step of using a deep learning framework to construct and train a probability distribution function of the emission probability and the transition probability of the fitted hidden Markov model to fit the probability distribution functions of the shortest distances and the distance error sets of all to-be-matched points in the set of to-be-matched points to obtain the emission probability and the transition probability of all candidate points corresponding to all to-be-matched points of the bus line network comprises the following steps: record all the shortest distances as a set of shortest distances, and count the maximum and minimum values of the set of shortest distances and the distance error set, and divide the set of shortest distances and the distance error set into several intervals; calculate the probability distribution of the set of shortest distances in each interval and the probability distribution of the distance error set in each interval, and combine to form a first probability distribution set of the set of shortest distances and a second probability distribution set of the distance error set, and take the center values of each interval of the set of shortest distances to form a first center value set and the center values of each interval of the distance error set to form a second center value set; A neural network is built by using a deep learning framework, with an input size of 1, a fully connected layer with 3 hidden layer neurons, a Sigmoid function as the activation function, an output size of 1, an Adam optimizer, and a mean square error loss function; The first probability distribution set and the first center value set are used to train the neural network to fit the probability distribution function of the shortest distance set; the second probability distribution set and the second center value set are used to train the neural network to fit the probability distribution function of the distance error set; thereby obtaining the emission probability and transition probability of all candidate points corresponding to all to-be-matched points of the bus line network.

3. The line net matching method based on the improved hidden Markov model according to claim 1, wherein, The emission probability and transition probability are taken as inputs, and the Viterbi algorithm is used to trace back to calculate the shortest path between all candidate points of any adjacent to-be-matched points of the bus line network, to obtain the matching result of the bus line network and the road network, specifically including: The emission probability and the transition probability are taken as inputs, and the Viterbi probability of the mth candidate point of the nth to-be-matched point is calculated according to the sequence of the to-be-matched point set. The Viterbi probability of the mth candidate point of the nth to-be-matched point is calculated according to the sequence of the to-be-matched point set.​ When is 0, and the Viterbi probability is equal to its corresponding emission probability, the last layer of the preset fitted hidden Markov model is selected, and the candidate point with the maximum Viterbi probability is backtracked layer by layer to find its corresponding candidate point of the first layer of the preset fitted hidden Markov model; The selected candidate points form a first collection, and the shortest path of the adjacent two candidate points in the first collection is obtained to form a path set, to obtain the matching result of the bus line network and the road network.

4. An improved hidden Markov model line net matching device based on, characterized in that, It includes: The data acquisition module is used to acquire bus line network data and road network data, and to preprocess the bus line network data and road network data to obtain a to-be-matched point set of the bus line network and a road segment set of the road network; The probability acquisition module is used to input the to-be-matched point set of the bus line network and the road segment set of the road network into a preset fitted hidden Markov model, and calculate the emission probability and transition probability of all candidate points corresponding to all to-be-matched points of the bus line network; The matching result module is used to take the emission probability and transition probability as inputs, and use the Viterbi algorithm to trace back to calculate the shortest path between all candidate points of any adjacent to-be-matched points of the bus line network, to obtain the matching result of the bus line network and the road network; The probability acquisition module is used to: Input the to-be-matched point set of the bus line network and the road segment set of the road network into a preset fitted hidden Markov model; Calculate the shortest distance of a target to-be-matched point in the to-be-matched point set and m road segments within a preset range of the target to-be-matched point in the road segment set, and set the points on the m road segments corresponding to the calculation of the shortest distance as candidate points to obtain a candidate point set of the target to-be-matched point; Calculate the shortest path and distance between the candidate point set corresponding to the target to-be-matched point and the candidate point set corresponding to the to-be-matched point adjacent to the target to-be-matched point, to obtain a distance error set between the target to-be-matched point and the adjacent to-be-matched point. The probability distribution function of the emission probability and transition probability of the fitted hidden Markov model is constructed and trained to fit the probability distribution functions of the shortest distance and distance error set of all to-be-matched points in the to-be-matched point set, to obtain the emission probability and transition probability of all candidate points corresponding to all to-be-matched points of the bus line network.

5. The modified hidden Markov model based line network matching apparatus of claim 4, wherein, The probability distribution functions of the shortest distances and the distance error sets of all the to-be-matched points in the to-be-matched point set are fitted by using a deep learning framework to construct and train the probability distribution functions of the emission probability and the transition probability of the fitted hidden Markov model, so as to obtain the emission probability and the transition probability of all the candidate points corresponding to all the to-be-matched points of the bus line network, and the method specifically comprises the following steps. All the shortest distances are recorded as a shortest distance set, the maximum and minimum values of the shortest distance set and the distance error set are counted, and the shortest distance set and the distance error set are divided into several intervals; The probability distribution of the shortest distance set in each interval and the probability distribution of the distance error set in each interval are calculated, and the first probability distribution set of the shortest distance set and the second probability distribution set of the distance error set are formed by merging, and the center values of each interval of the shortest distance set form a first center value set, and the center values of each interval of the distance error set form a second center value set; A neural network with an input size of 1, a fully connected layer with 3 hidden layer neurons, a Sigmoid function as an activation function, an output size of 1, an Adam optimizer, and a mean square error loss function is built by using a deep learning framework; The neural network is trained by using the first probability distribution set and the first center value set to fit the probability distribution function of the shortest distance set, and the neural network is trained by using the second probability distribution set and the second center value set to fit the probability distribution function of the distance error set, so as to obtain the emission probability and the transition probability of all the candidate points corresponding to all the to-be-matched points of the bus line network.

6. The modified hidden Markov model based line network matching apparatus of claim 5, wherein, The matching result module is specifically configured to: The emission probability and the transition probability are taken as inputs, and a Viterbi probability of a first candidate point of a first to-be-matched point is calculated according to an order of the to-be-matched point set. The emission probability and the transition probability are taken as inputs, and a Viterbi probability of a first candidate point of a first to-be-matched point is calculated according to an order of the to-be-matched point set.​ When is 0, and the Viterbi probability is equal to its corresponding emission probability, the last layer Viterbi probability maximum candidate point of the preset fitted hidden Markov model is selected, and the corresponding candidate point of the first layer of the preset fitted hidden Markov model is found by backtracking layer by layer , and so on until the corresponding candidate point of the first layer of the preset fitted hidden Markov model is found. The selected candidate points form a first collection, the adjacent two candidate points in the first collection are traversed from the first candidate point, the shortest paths of the adjacent two candidate points are obtained to form a path set, and the matching result of the bus line network and the road network is obtained.

7. An improved hidden Markov model line net matching device based on, characterized in that, The computer readable storage medium comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, and the processor implements the bus line network matching method based on the improved hidden Markov model according to any one of claims 1-3 when executing the computer program.

8. A computer-readable storage medium, characterized in that, The computer readable storage medium comprises a stored computer program, wherein the computer readable storage medium controls the device where the computer readable storage medium is located to execute the bus line network matching method based on the improved hidden Markov model according to any one of claims 1-3 when the computer program is running.

Citation Information

Patent Citations

  • Dynamic map matching method based on high-order hidden Markov model

    CN112632202A