CN108882172B - Indoor moving trajectory data prediction method based on HMM model - Google Patents
Indoor moving trajectory data prediction method based on HMM model Download PDFInfo
- Publication number
- CN108882172B CN108882172B CN201810647384.4A CN201810647384A CN108882172B CN 108882172 B CN108882172 B CN 108882172B CN 201810647384 A CN201810647384 A CN 201810647384A CN 108882172 B CN108882172 B CN 108882172B
- Authority
- CN
- China
- Prior art keywords
- grid
- points
- track
- sequence
- historical
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/02—Services making use of location information
- H04W4/029—Location-based management or tracking services
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/30—Services specially adapted for particular environments, situations or purposes
- H04W4/33—Services specially adapted for particular environments, situations or purposes for indoor environments, e.g. buildings
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Image Analysis (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention belongs to the field of indoor moving track management and prediction, and particularly provides an HMM model-based indoor moving track data prediction method, which is used for realizing HMM-based track data prediction in an indoor space. Firstly, based on a historical track sequence, taking the minimum Euclidean distance between continuous non-repeated points of the historical track sequence as the side length of a grid unit, and carrying out hierarchical meshing on an indoor space model to generate a grid space; based on the grid space, projecting the historical track data to generate a grid sequence, preprocessing the grid sequence, and generating a historical grid track database; then, clustering is carried out on the basis of a DBSCAN algorithm to generate a clustering information base, and an HMM model is constructed according to a clustering information table; and finally, predicting by using a Viterbi algorithm based on the trained HMM model. The invention provides an indoor track data position prediction method, which effectively improves the accuracy of predicted track data and further optimizes the performance of an indoor track data management system.
Description
Technical Field
The invention belongs to the field of indoor moving track management and prediction, particularly relates to indoor track prediction under big data, and particularly relates to a prediction method of indoor moving track data based on an HMM (hidden Markov model).
Background
With the rapid development of wireless interconnection technology, location-based services are widely applied; location-based services are classified into outdoor location services and indoor location services, and a positioning technology is one of core technologies of location services. In large indoor environments, such as shopping malls, hospitals, airports, etc., users are increasingly demanding location services. With the increasingly sophisticated indoor positioning technologies of Bluetooth and WIFI and the popularization of intelligent terminals, massive moving object trajectory data are collected; the problems to be solved at present are faced to how to reasonably analyze, efficiently store and accurately predict massive indoor moving trajectory data.
Due to the rapid development of the intelligent mobile terminal, the middle-high-end intelligent mobile phone is generally provided with the MEMS inertial measurement unit, and a new idea is provided for indoor trajectory prediction. The indoor track position prediction method based on the HMM model is characterized in that a space is divided into disjoint areas, and track points are represented by the areas, so that track data are simplified, and the speed of prediction calculation is improved; however, the classical HMM model has the problems of discontinuous hidden states, state staying, and the like, and the floor attributes exist in the indoor space, so that the same position coordinates exist between different floors, which results in failure of prediction. At present, a method for solving the problem that the transition probability of a discontinuous hidden state is 0 is to use historical data for multiple times in a gradient manner in the HMM establishment process, extract trace points at intervals of a period, and perform state transition matrix calculation together with continuous trace points to obtain two discontinuous state transition probabilities; however, this algorithm requires multiple accesses to the historical data, and when the storage amount of the historical data is accumulated, the calculation amount becomes large, and model overfitting occurs. The state staying problem is that in the first N track points, a plurality of continuous points belong to the same hidden state, and the rotation probability of a state transition probability matrix is 0, so that the prediction fails; the solution adopted by most of the current researches is to obtain an empirical value through experiments, so that the autorotation probability of a model is not 0; since the method needs manual setting, the predicted progress difference on different trajectory data is large. In view of the above problems, the present invention provides a method for predicting indoor moving trajectory data based on an HMM model.
Disclosure of Invention
The present invention is directed to provide a method for predicting indoor moving trajectory data based on an HMM model, which is used to realize prediction based on HMM trajectory data in an indoor space. The invention provides indoor track data position prediction and a system, which are used for improving the accuracy of predicted track data and further optimizing the performance of an indoor track data management system.
In order to achieve the purpose, the invention adopts the technical scheme that:
a spatial movement track position prediction method based on an HMM model is characterized by comprising the following steps:
step 1: based on the historical track sequence, taking the minimum Euclidean distance between continuous non-repeated points of the historical track sequence as the side length of a grid unit, and carrying out hierarchical meshing on the indoor space model to generate a grid space;
step 2: based on the grid space generated in the step 1, projecting historical track data to generate a grid sequence, preprocessing the grid sequence, and generating a historical grid track database;
and step 3: clustering is carried out on the basis of a DBSCAN algorithm according to the historical grid track database generated in the step 2 to generate a clustering information base;
and 4, step 4: constructing an HMM model:
step 4.1: selecting a cluster { C generated by clustering the hidden state of the HMM model according to the clustering information table1,C2,...CmAnd m is the number of cluster classes generated by clustering, and the observation sequence is all grid points in the grid space: { g1,g2,..gnN is the length of the observation sequence; setting an initial state probability matrix lambda:
wherein k is the number of clusters closest to the indoor entrance, the initial states of the k clusters closest to the indoor entrance are set to be uniformly distributed, the probability of the initial state is 1/k, and the probability of the rest states is 0;
step 4.2: calculating an initial state transition probability A and a confusion matrix B according to three characteristics of the fusion corner, the dwell time and the Euclidean distance, and constructing an HMM initial model:
step 4.2.1: according to a hidden state Ci,CiIs in a hidden state { C1,C2,...CmAny sub-element; by hidden state CicId query the clustering information table to obtain CiObtaining coordinates of core points in clusters and calculating Euclidean distances between the core points in the current cluster and other core points in clusters according to the average value of track points in the clusters, angle attributes { aS2, aS3, aS4, aS5, aS6, aS7 and aSlen } and grid Id numbers of the core points in the clusters;
step 4.2.2: the initial state probability matrix a and the confusion matrix B are calculated by a weighting method,
wherein, the initial state probability matrix A:
aijis in a hidden state CiAnd CjProbability of state transition of aijIs prepared from'ijNormalized to yield:
and, instead,wherein the content of the first and second substances,is in a hidden state CiAnd CjThe characteristic value of the normalized angle between the two angles,is CiThe value of the characteristic of the residence time of,is CiAnd CjThe reciprocal of the euclidean distance between; omegaa、ωst、ωdisAre respectively as The preset weight of (1);
confusion matrix B:
bijto observe the sequence gjAnd hidden state CiProbability of state transition of bijIs prepared from b'ijNormalized to yield:
and, instead,wherein, gjFor any one of the grid points, the grid is,is in a hidden state CiAnd gjThe characteristic value of the normalized angle between the two angles,is CiAnd gjThe reciprocal of the euclidean distance between; w is aa、wdisAre respectively asA corresponding weight;
step 4.3: based on the HMM initial model constructed in the step 4.2, performing model training on an input observation sequence by adopting a forward and backward algorithm and a Baum-Welch algorithm;
in the training process, when the state transition probability matrix A is in the autorotation probability aijAnd if j is zero, updating the i-th row element to be zero by adopting a linear smoothing method
Wherein the content of the first and second substances,stoptime(Ci) Represents a cluster CiMaximum value of dwell time stoptime of all grid points within, aijIs the value of the ith row, jth column, max (a) in the state transition matrix Aij) Representing the probability maximum value of the ith row in the state probability transition matrix A, wherein Logistic is a data normalization logarithm Logistic mode;
when the element 0 in the ith row of the confusion matrix B isThe number is more thanIn the meantime, the ith row of the confusion matrix B is updated to be the ith row by adopting a linear smoothing method
Wherein the content of the first and second substances,bis a preset value, ziThe number of 0 elements in the ith row in the confusion matrix B;
and 5: and (4) predicting by using a Viterbi algorithm based on the trained HMM model in the step 4.
Further, the grid sequence preprocessing in the step 2 is as follows:
step 2.1: setting a retention time st for any generated grid sequence, and removing continuous repeated grid track points;
step 2.2: and performing corner calculation among the points of the grid track sequence on the grid sequence without the redundant points to generate the grid track sequence as follows:
gridSequence={g1,g2,...,gi,...,gt},gi={id,st,angle} (5)
wherein id is the projected grid number, st is the retention time, angle is the corner between adjacent grid track points, and t represents the length of the grid track sequence;
step 2.3: detecting the generated grid track sequence, judging whether grid sequence points are lost or not and judging whether noise points exist in the grid track sequence, and performing track completion and denoising on the grid sequence;
step 2.4: standardizing angles in the grid track sequence, equally dividing an angle interval [0,2 pi ] into 8 disjoint subintervals which are sequentially numbered aS aS 1-aS 8, and representing corners of any grid sequence point by adopting the number of the corresponding subinterval;
step 2.5: traversing all the historical grid track sequences to generate a historical grid track database, wherein the entries of the historical grid track database comprise: id. x, y, floor, num, stoptime and angles, wherein id represents a grid number, x represents longitude, y represents dimensionality, floor represents a layer number after a space model is layered, num represents the number of grid track sequences passing through a current grid point, and stoptime represents dwell time: the average of the dwell time st at the current grid point for all grid trajectory sequences passing through the grid point, angle, represents the set of corners: the angles ═ aS1: n1, aS2: n2, aS8: n8, n1, n2, and n8 respectively represent the number of corners aS1, aS2, aS8 of all the grid trajectory sequences at the current grid point passing through the current grid point.
Further, the DBSCAN clustering algorithm in step 3 specifically includes the following steps:
step 3.1: traversing the grid points of the historical grid track database, and judging whether the current grid points meet the clustering condition, wherein the clustering condition is that any one of the following conditions is met:
the first condition is as follows: the dwell time stoptime of the current grid point is larger than the clustering time threshold etat;
step 3.2: traversing a historical grid track database, calculating the Euclidean distance from the current grid point, screening out the field grid which is determined as the current grid point by the grid point with the distance from the current grid point less than the preset value, and judging whether the number of the neighborhood grid points is greater than the adjacent threshold valueadjIf yes, the point is regarded as a core point of the cluster, the point is placed into a core point set, and a cluster label cId is set;
step 3.3: expanding the neighborhood grids of the core points calculated in the step 3.2, namely traversing grid points in the domain grids, retrieving grid points meeting clustering conditions, and marking the grid points meeting clustering conditions with cluster numbers cId which are the same as the core points; until all grid points of the historical grid track library are visited, a clustering information table is generated.
The specific process of the step 5 is as follows: traversing all next possible observation points of the current grid position, substituting the observation points into the HMM model, and returning a most possible hidden state sequence group; and based on the returned hidden state sequence group, calculating a current moving end deflection angle by combining a moving end MEMS inertial navigation unit, carrying out angle standardization on the deflection angle, acquiring the most possible hidden state in the angle interval, and returning the nearest grid point which is in the cluster and is shown by the most possible hidden state and is away from the current grid position.
The invention has the beneficial effects that:
(1) according to the invention, hot spot areas with long retention time, dense track points and multiple corner times are screened out by clustering important points of historical track data; reducing the number of hidden states in the HMM by using a density-based clustering algorithm, and performing segmentation processing on the track data to extract a characteristic value of local position data; considering the independence of the time latitude of the moving object, the segmentation sequences can be considered to be independent, so that an HMM model is established by taking the segments as units, the historical track data is prevented from being called, the calculation amount is reduced, the calculation time is shortened, and the overfitting of the HMM model is avoided;
(2) because the development of indoor positioning is not mature enough, most prediction algorithms based on HMM models are used in outdoor space; however, the indoor space is different from the outdoor space, and the same position coordinates exist between different floors of the indoor space; currently, most of research adopts a method of calculating and comparing the altitude by using a barometer in a mobile-end MEMS (micro-electromechanical system) to obtain floor information; according to the invention, the floor information of the moving object is calculated through the MEMS barometer, and different floor hidden states are returned according to the floors, so that the problem of the same coordinate of different floors in the indoor space is solved;
(3) by using the invention, when the user is in unstable signals and dead signal angles, real-time position services such as indoor navigation, hotspot search and the like can be provided based on the mobile terminal, the dependence on network signal transmission is reduced, and the user experience is improved.
Drawings
Fig. 1 is a flowchart illustrating a method for predicting indoor moving trajectory data based on HMM models according to the present invention.
FIG. 2 is a flow chart of an embodiment of the present invention.
FIG. 3 is a diagram of trajectory prediction errors in an embodiment of the present invention.
FIG. 4 is a graph comparing accuracy of algorithms under different error thresholds according to an embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples.
The embodiment provides a method for predicting a spatial movement trajectory position based on an HMM model, and the flow of the method is shown in fig. 1; the method comprises the following specific steps:
step 1: based on the historical track data, calculating the side length of an indoor space grid unit, and meshing the indoor space;
step 1.1: the method for calculating the side length of the grid unit comprises the following steps: taking the minimum distance between continuous non-repeated points of the historical track sequence as the side length of a grid unit, and gridding the indoor space model; therefore, the integrity of the track sequence can be improved when the track sequence is subjected to gridding projection, and the phenomena that track data are lost and the generated grid sequence is redundant due to improper selection of the side length of an indoor space grid unit are avoided;
the invention relates to the format of the original track data as
S={s1,s2...si...sn},si=(xi,yi,t),i=1,2,...,n (1)
Wherein s isiIs a track point, x, of an original track sequence at a certain momenti,yiT corresponds to latitude, longitude and time stamp respectively; n represents the total number of track points;
partial repeated continuous track points exist in the original track sequence, so the calculation method of the indoor space grid unit is as follows: calculating the Euclidean distance between continuous non-repeated track points of historical track data, and taking the minimum value as the unit side length of a divided grid unit:
the method adopts the Euclidean distance as the formula (2) to calculate the distance;
wherein s isi,sjFor points, x, continuously non-repeating in any track of the same tracki,yiIs a track point siLongitude and latitude, xj,yjIs a track point sjThe longitude and latitude of (c);
step 1.2, gridding the global indoor space model according to the side length of the grid unit calculated in step 1.1; because the floor attributes are related in the indoor space, different floors have track points with the same longitude and latitude, the method of the invention is to grid the indoor space model in a layering way, and each grid unit has unique id;
step 2: based on the grid space generated in the step 1, projecting historical track data to generate a grid sequence, preprocessing the grid sequence and generating a historical grid sequence library; therefore, the complexity of historical track data can be reduced, and the calculation efficiency of track prediction and track compression is improved;
when the track is subjected to gridding projection, a plurality of track points may be projected into the same unit grid, so that a generated grid sequence contains continuous repeated points, and therefore, the generated grid data is preprocessed in the invention; the pretreatment method adopted in the invention comprises the following steps:
step 2.1: setting a stay time attribute for any generated grid sequence, and removing continuous repeated grid track points;
the specific process is that a grid sequence is set:
<..gj,gi1,gi2,...,gik,....>, (3)
wherein, gi1To gikBetween them are grid track points with same grid number and different time, gj,gi1The method is characterized in that the method is a grid track point with different grid numbers, and the retention time is set as follows:
wherein the content of the first and second substances,tfor presetting a time threshold value, when the time interval between the track points of the continuous grids is larger thantThe grid point is considered to have a stay state;
step 2.2: and performing corner calculation among the points of the grid track sequence on the grid sequence without the redundant points to generate the grid track sequence as follows:
gridSequence={g1,g2,...,gi,...,gt},gi={id,st,angle} (5)
wherein id is the projected grid number, st is the retention time, angle is the corner between adjacent grid track points, and t represents the length of the grid track sequence; the calculation method of the corner is to calculate the included angle by an arc tangent formula after acquiring the longitude and latitude of the adjacent grid track points;
step 2.3: detecting the generated grid track sequence, judging whether grid sequence points are lost or not and judging whether noise points exist in the grid track sequence, and performing track completion and denoising on the grid sequence;
the method for judging the loss of the grid sequence points comprises the following steps: calculating the length between adjacent grid sequence points, and if the length exceeds a set threshold value, determining that data loss exists; adopting Dijkstra shortest path algorithm, inserting grid sequence points into the two grid sequences, and completing the grid track sequences;
the method for judging the grid sequence points to belong to the noise points comprises the following steps: giving a certain grid sequence point, wherein the distance between two adjacent grid sequence points is greater than a distance threshold, and the time interval between the two adjacent grid sequence points is smaller than a threshold, and then considering the point as a noise point;
step 2.4: standardizing angles in the grid track sequence, equally dividing an angle interval [0,2 pi ] into 8 disjoint subintervals which are sequentially numbered aS aS 1-aS 8, and representing corners of any grid sequence point by adopting the number of the corresponding subinterval;
step 2.5: traversing all the historical grid track sequences to generate a historical grid database, wherein the table entries of the historical grid database comprise: id. x, y, floor, num, stoptime and angles, wherein id represents a grid number, x represents longitude, y represents dimensionality, floor represents a layer number after a space model is layered, num represents the number of grid track sequences passing through a current grid point, and stoptime represents dwell time: the average of the dwell time st at the current grid point for all grid trajectory sequences passing through the grid point, angle, represents the set of corners: the angles ═ aS1: n1, aS2: n2, aS8: n8, n1, n2, aS8, n8 respectively represent the number of corners aS1, aS2, aS8 of all grid trajectory sequences passing through the current grid point at the current grid point;
the historical grid database generated in this embodiment is as shown in table 1:
TABLE 1
id | x | y | floor | angles | stoptime | num |
Id1 | X1 | Y1 | 1 | {aS1:n1,aS2:n2,...,aS8:n8}1 | Time1 | 10 |
Id2 | X2 | Y2 | 0 | {aS1:n1,aS2:n2,...,aS8:n8}2 | Time2 | 5 |
… | … | … | … | … | … | … |
And step 3: clustering is carried out on the basis of a DBSCAN algorithm according to the historical grid track database generated in the step 2 to generate a clustering information base;
basic flow based on DBSCAN clustering algorithm:
step 3.1: traversing the grid points of the historical grid track database, and judging whether the current grid points meet the clustering condition, wherein the clustering condition is that any one of the following conditions is met:
the first condition is as follows: the dwell time stoptime of the current grid point is larger than the clustering time threshold etat;
step 3.2: traversing a historical grid track database, calculating the Euclidean distance from the current grid point, screening out grid points with the distance from the current grid point being less than (preset value), and judging whether the number of neighborhood grid points is greater than an adjacent threshold valueadjIf it is greater than the thresholdThe value is that the point is regarded as the core point of the cluster, the point is put into the core point set, and the cluster label cId is set up;
step 3.3: expanding the neighborhood grids of the core points calculated in the step 3.2, namely traversing grid points in the domain, retrieving grid points meeting clustering conditions, and marking the grid points meeting clustering conditions with cluster numbers cId which are the same as the core points; until all grid points of the historical grid track library are accessed; generating a clustering information table;
the clustering information table generated based on the example based on the DBSCAN algorithm is shown in the table 2
TABLE 2
id | cId | stoptime | aS2 | aS3 | aS4 | aS5 | aS6 | aS7 | aSlen |
… | … | … | … | … | .. | .. | … | … | … |
4014 | 1 | 80 | 0 | 0 | 0 | 0 | 16 | 58 | 74 |
2942 | 1 | 13 | 39 | 5 | 0 | 0 | 0 | 149 | 193 |
2943 | 1 | 9 | 2 | 17 | 0 | 34 | 0 | 92 | 145 |
2947 | 2 | 27 | 0 | 0 | 0 | 0 | 0 | 60 | 60 |
3043 | 2 | 20 | 22 | 0 | 0 | 0 | 0 | 78 | 100 |
… | … | … | … | … | .. | .. | … | … | … |
Wherein id is the grid number, cId is the cluster number, [ aS2, aS7]Is an angle interval6 sub-intervals of (a);
and 4, step 4: constructing an HMM model;
the steps for constructing the HMM model are shown in fig. 2, and the specific steps are as follows:
step 4.1: selecting a cluster { C generated by clustering the hidden state of the HMM model according to the clustering information table1,C2,...CmAnd m is the number of cluster classes generated by clustering, and the observation sequence is all grid points in the grid space: { g1,g2,..gnN is the length of the observation sequence; setting an initial state probability matrix lambda:
wherein k is the number of clusters closest to the indoor entrance, the initial states of the k clusters closest to the indoor entrance are set to be uniformly distributed, the probability of the initial state is 1/k, and the probability of the rest states is 0;
step 4.2: the method comprises the following steps of calculating an initial state transition probability A by fusing three characteristics of corners, stay time and Euclidean distance, and specifically comprising the following steps:
step 4.2.1: according to a hidden state Ci,CiIs in a hidden state { C1,C2,...CmAny sub-element; by hidden state CicId query the clustering information table to obtain CiObtaining coordinates of core points in clusters and calculating Euclidean distances between the core points in the current cluster and other core points in clusters according to the average value of track points in the clusters and the angle attributes { aS2, aS3, aS4, aS5, aS6, aS7 and aSlen } and grid Id numbers of the core points in the clusters;
step 4.2.2: and (3) calculating an initial state probability matrix A and a confusion matrix B by using a weighting method, wherein the matrix A is as shown in the formula (7):
indicating state transitions between hidden statesProbability of shift, aijIs in a hidden state CiAnd CjProbability of state transition of (C)iAnd CjIs in a hidden state { C1,C2,...CmAny two subelements in (1); a isijIs prepared from'ijNormalized to yield:
a'ijthe calculation method of (2) is as follows:
wherein i is the row number of the state transition matrix A, and j is the column number of the state transition matrix A;is in a hidden state CiAnd CjNormalizing the angle characteristic value, wherein the calculation method comprises the following steps:
by step 4.2.1, C is obtainediAnd CjCoordinates of core points, calculating CiAnd CjAngle theta between core pointsijWill thetaijMapping to [ aS1, aS8]Obtaining the angle subinterval to which the cluster C belongsiInner thetaijTotal value of corner times of the angle subinterval and cluster CiDividing the total value of the times of all inner corners;
is CiThe characteristic value of the residence time is calculated by a cluster CiAverage of dwell times at all grid points within;
ωa、ωst、ωdisare respectively asThe preset weight can be changed to set the importance degrees of the three characteristic values and adjust the parameters of the HMM model;
confusion matrix B is as in equation (9):
a transition probability matrix representing hidden states and grid sequences, m is the number of the hidden states, n is the length of an observation sequence, bijIs an observation sequence gjAnd hidden state CiProbability of state transition of bijIs formed by bi'jNormalized to yield:
bi'jthe calculation method of (2) is as follows:
wherein, gjIs any grid point, CiIs in a hidden state { C1,C2,...CmAny sub-element of (1); when observing the grid track point gjNot belonging to cluster Ci,Hidden state CiAnd gjNormalizing the angle characteristic value by calculating cluster CiCore point of (1) and (g)jAngle mu therebetweenijIs measured byijMapping to [ aS1, aS8]These 8 disjoint angular sub-intervals, cluster CiInner muijTotal value of corner times of the angle subinterval and cluster CiDividing the total value of the times of the inner corner;
is CiAnd gjThe reciprocal of the euclidean distance between; w is aa、wdisAre respectively asA corresponding weight;
step 4.3: based on the HMM initial model calculated in the step 4.2, namely the state transition matrix A and the confusion matrix B, performing model training on the input observation sequence by adopting a forward and backward algorithm and a Baum-Welch algorithm;
1) during training, a plurality of continuous grid sequence tracks may be projected into the same cluster to generate continuous cluster sequences; if a state transition matrix defined by a classical HMM is adopted, the rotation probability of a hidden state is zero, so that the prediction fails; this patent therefore proposes the following improvements:
with hidden state { C1,C2,...CmIn which C isiIs in a hidden state { C1,C2,...CmAny sub-element of (1); from step 3, the cluster object C is knowni={{gi1},{gi2},...,{giqQ is a cluster CiThe number of grid points involved; traversal cluster CiFinding out the maximum value as the cluster CiRetention time of (C)i);
Further normalizing the residence time of the current cluster, as in equation (12):
therein, max (a)ij) Representing the probability maximum value of the ith row in the state probability transition matrix A; logistic is a data normalization logarithm Logistic mode; to (1) foraThe constraint condition is less than the maximum probability of the current row of the state transition matrix;
during the training of the model, the spin probability (a) occurs when in the state transition probability matrix AijWhen i is equal to j), updating the i-th row element to be zero by adopting a linear smoothing methodAs in equation (13):
wherein, aijFor the ith row and jth column in the state transition matrix A, i.e. hidden state CiAnd CjA state transition probability therebetween;
2) when training the HMM model, after multiple iteration updates due to insufficient training data, when the number of 0 elements in the ith row of the confusion matrix B is larger than that of the 0 elements in the ith row of the confusion matrix BIn the invention, the i-th row is updated to be the confusion matrix B by adopting a linear smoothing method through the formula (14)Thereby avoiding prediction failure;
wherein the content of the first and second substances,bis a preset value, ziThe number of 0 elements in the ith row in the confusion matrix B;
the basic idea of the Viterbi algorithm is to find a most likely hidden state sequence based on a sequence of observable states; traversing the next possible observation point and substituting the observation point into the trained HMM model; returning the most likely hidden state sequence group; based on the returned hidden state sequence group, calculating a current deflection angle of the mobile terminal by combining the MEMS inertial navigation unit of the mobile terminal, and carrying out angle standardization of the deflection angle in the step 2.4; and acquiring the most possible hidden state in the angle interval, and returning the most possible hidden state to represent the nearest grid point to the current grid position in the cluster.
According to the invention, simulation experiments are carried out by adopting the UJINDOOR data set, and the experimental conclusion is as follows:
as shown in fig. 3 and 4, the threshold set in the dotted line portion of fig. 3 is 1.5m, which is an error range acceptable for indoor positioning accuracy; the error value of the predicted track position and the real track position is mostly in the interval of [0.25,0.5], so that the indoor positioning prediction precision is achieved, and the prediction accuracy is high.
FIG. 4 shows the accuracy of the present invention compared to the HMM model combined with Kalman filtering (HMM-KF), a common probability method; when the error value of the improved HMM algorithm is below 1.5m, the improved HMM algorithm is 20% higher than the HMM-KF and is 60% higher than the common probability method; meanwhile, in the portion where the error value is lower than 1m, the accuracy of the improved HMM algorithm is also higher than those of the other two algorithms.
While the invention has been described with reference to specific embodiments, any feature disclosed in this specification may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise; all of the disclosed features, or all of the method or process steps, may be combined in any combination, except mutually exclusive features and/or steps.
Claims (4)
1. A spatial movement track position prediction method based on an HMM model is characterized by comprising the following steps:
step 1: based on the historical track sequence, taking the minimum Euclidean distance between continuous non-repeated points of the historical track sequence as the side length of a grid unit, and carrying out hierarchical meshing on the indoor space model to generate a grid space;
step 2: based on the grid space generated in the step 1, projecting historical track data to generate a grid sequence, preprocessing the grid sequence, and generating a historical grid track database;
and step 3: clustering is carried out on the basis of a DBSCAN algorithm according to the historical grid track database generated in the step 2 to generate a clustering information base;
and 4, step 4: constructing an HMM model:
step 4.1: according to the clustering information tableSelecting hidden states of HMM model as clusters { C ] generated by clustering1,C2,...CmAnd m is the number of cluster classes generated by clustering, and the observation sequence is all grid points in the grid space: { g1,g2,..gnN is the length of the observation sequence; setting an initial state probability matrix lambda:
wherein k is the number of clusters closest to the indoor entrance, the initial states of the k clusters closest to the indoor entrance are set to be uniformly distributed, the probability of the initial state is 1/k, and the probability of the rest states is 0;
step 4.2: calculating an initial state transition probability A and a confusion matrix B according to three characteristics of the fused corner, the stay time and the Euclidean distance, and constructing an HMM initial model; the specific process is as follows:
step 4.2.1: according to a hidden state Ci,CiIs in a hidden state { C1,C2,...CmAny sub-element; by hidden state CicId query the clustering information table to obtain CiObtaining coordinates of core points in clusters and calculating Euclidean distances between the core points in the current cluster and other core points in clusters according to the average value of track points in the clusters, angle attributes { aS2, aS3, aS4, aS5, aS6, aS7 and aSlen } and grid Id numbers of the core points in the clusters;
step 4.2.2: the initial state probability matrix a and the confusion matrix B are calculated by a weighting method,
wherein, the initial state probability matrix A:
aijis in a hidden state CiAnd CjProbability of state transition of aijIs prepared from'ijNormalized to yield:
and, instead,wherein the content of the first and second substances,is in a hidden state CiAnd CjThe characteristic value of the normalized angle between the two angles,is CiThe value of the characteristic of the residence time of,is CiAnd CjThe reciprocal of the euclidean distance between; omegaa、ωst、ωdisAre respectively as The preset weight of (1);
confusion matrix B:
bijto observe the sequence gjAnd hidden state CiProbability of state transition of bijIs prepared from b'ijNormalized to yield:
and, instead,wherein, gjFor any one of the grid points, the grid is,is in a hidden state CiAnd gjThe characteristic value of the normalized angle between the two angles,is CiAnd gjThe reciprocal of the euclidean distance between; w is aa、wdisAre respectively asA corresponding weight;
step 4.3: based on the HMM initial model constructed in the step 4.2, performing model training on an input observation sequence by adopting a forward and backward algorithm and a Baum-Welch algorithm;
in the training process, when the state transition probability matrix A is in the autorotation probability aijAnd if j is zero, updating the i-th row element to be zero by adopting a linear smoothing method
Wherein the content of the first and second substances,stoptime(Ci) Represents a cluster CiMaximum value of dwell time stoptime of all grid points within, aijIs the value of the ith row, jth column, max (a) in the state transition matrix Aij) Representing the probability maximum value of the ith row in the state probability transition matrix A, wherein Logistic is a data normalization logarithm Logistic mode;
when the number of 0 elements in the ith row of the confusion matrix B is larger than that of the 0 elements in the ith row of the confusion matrix BWhen it is, thenUpdating the ith row of the confusion matrix B into the ith row by adopting a linear smoothing method
Wherein the content of the first and second substances,bis a preset value, ziThe number of 0 elements in the ith row in the confusion matrix B;
and 5: and (4) predicting by using a Viterbi algorithm based on the trained HMM model in the step 4.
2. The method for predicting the position of a spatial movement trajectory based on an HMM model according to claim 1, wherein the grid sequence preprocessing in step 2 is:
step 2.1: setting a retention time st for any generated grid sequence, and removing continuous repeated grid track points;
step 2.2: and performing corner calculation among the points of the grid track sequence on the grid sequence without the redundant points to generate the grid track sequence as follows:
gridSequence={g1,g2,...,gi,...,gt},gi={id,st,angle} (5)
wherein id is the projected grid number, st is the retention time, angle is the corner between adjacent grid track points, and t represents the length of the grid track sequence;
step 2.3: detecting the generated grid track sequence, judging whether grid sequence points are lost or not and judging whether noise points exist in the grid track sequence, and performing track completion and denoising on the grid sequence;
step 2.4: standardizing angles in the grid track sequence, equally dividing an angle interval [0,2 pi ] into 8 disjoint subintervals which are sequentially numbered aS aS 1-aS 8, and representing corners of any grid sequence point by adopting the number of the corresponding subinterval;
step 2.5: traversing all the historical grid track sequences to generate a historical grid track database, wherein the entries of the historical grid track database comprise: id. x, y, floor, num, stoptime and angles, wherein id represents a grid number, x represents longitude, y represents dimensionality, floor represents a layer number after a space model is layered, num represents the number of grid track sequences passing through a current grid point, and stoptime represents dwell time: the average of the dwell time st at the current grid point for all grid trajectory sequences passing through the grid point, angle, represents the set of corners: the angles ═ aS1: n1, aS2: n2, aS8: n8, n1, n2, and n8 respectively represent the number of corners aS1, aS2, aS8 of all the grid trajectory sequences at the current grid point passing through the current grid point.
3. The method for predicting the position of the HMM model-based spatial movement trajectory according to claim 2, wherein the DBSCAN clustering algorithm in step 3 comprises the following specific steps:
step 3.1: traversing the grid points of the historical grid track database, and judging whether the current grid points meet the clustering condition, wherein the clustering condition is that any one of the following conditions is met:
the first condition is as follows: the dwell time stoptime of the current grid point is larger than the clustering time threshold etat;
step 3.2: traversing a historical grid track database, calculating the Euclidean distance from the current grid point, screening out the field grid which is determined as the current grid point by the grid point with the distance from the current grid point less than the preset value, and judging whether the number of the neighborhood grid points is greater than the adjacent threshold valueadjIf yes, the point is regarded as a core point of the cluster, the point is placed into a core point set, and a cluster label cId is set;
step 3.3: expanding the neighborhood grids of the core points calculated in the step 3.2, namely traversing grid points in the domain grids, retrieving grid points meeting clustering conditions, and marking the grid points meeting clustering conditions with cluster numbers cId which are the same as the core points; until all grid points of the historical grid track library are visited, a clustering information table is generated.
4. The method for predicting the position of a spatial movement trajectory based on an HMM model according to claim 2, wherein the specific process in step 5 is as follows: traversing all next possible observation points of the current grid position, substituting the observation points into the HMM model, and returning a most possible hidden state sequence group; and based on the returned hidden state sequence group, calculating a current moving end deflection angle by combining a moving end MEMS inertial navigation unit, carrying out angle standardization on the deflection angle, acquiring the most possible hidden state in the angle interval, and returning the nearest grid point which is in the cluster and is shown by the most possible hidden state and is away from the current grid position.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810647384.4A CN108882172B (en) | 2018-06-22 | 2018-06-22 | Indoor moving trajectory data prediction method based on HMM model |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810647384.4A CN108882172B (en) | 2018-06-22 | 2018-06-22 | Indoor moving trajectory data prediction method based on HMM model |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108882172A CN108882172A (en) | 2018-11-23 |
CN108882172B true CN108882172B (en) | 2020-10-23 |
Family
ID=64340337
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810647384.4A Active CN108882172B (en) | 2018-06-22 | 2018-06-22 | Indoor moving trajectory data prediction method based on HMM model |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108882172B (en) |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109783771B (en) * | 2019-01-22 | 2021-01-29 | 清华大学 | Processing method and device for converting track sequence into image matrix and storage medium |
CN110595487A (en) * | 2019-07-24 | 2019-12-20 | 平安科技(深圳)有限公司 | Driving track generation method and device, computer equipment and storage medium |
CN112543419B (en) * | 2019-09-20 | 2022-08-12 | ***通信集团吉林有限公司 | User trajectory prediction method and device based on density clustering |
CN110909037B (en) * | 2019-10-09 | 2024-02-13 | 中国人民解放军战略支援部队信息工程大学 | Frequent track mode mining method and device |
CN110909106B (en) * | 2019-11-26 | 2022-08-12 | 杭州三汇数字信息技术有限公司 | Trajectory prediction method and system |
CN111291280B (en) * | 2020-03-10 | 2023-04-11 | 中国科学院计算技术研究所 | Method, medium, and apparatus for fast predicting trajectory of large-scale moving object |
CN115952253B (en) * | 2023-03-15 | 2023-05-26 | 中国空气动力研究与发展中心计算空气动力研究所 | Air drop track prediction method and device for complex terrain space database |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103218628A (en) * | 2013-03-22 | 2013-07-24 | 中国科学技术大学 | Abnormal behavior description method based on characteristics of block mass and track |
CN105210115A (en) * | 2013-06-10 | 2015-12-30 | 英特尔公司 | Performing hand gesture recognition using 2D image data |
CN108108808A (en) * | 2018-01-08 | 2018-06-01 | 北京邮电大学 | A kind of position predicting method and device based on depth belief network |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7250907B2 (en) * | 2003-06-30 | 2007-07-31 | Microsoft Corporation | System and methods for determining the location dynamics of a portable computing device |
-
2018
- 2018-06-22 CN CN201810647384.4A patent/CN108882172B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103218628A (en) * | 2013-03-22 | 2013-07-24 | 中国科学技术大学 | Abnormal behavior description method based on characteristics of block mass and track |
CN105210115A (en) * | 2013-06-10 | 2015-12-30 | 英特尔公司 | Performing hand gesture recognition using 2D image data |
CN108108808A (en) * | 2018-01-08 | 2018-06-01 | 北京邮电大学 | A kind of position predicting method and device based on depth belief network |
Also Published As
Publication number | Publication date |
---|---|
CN108882172A (en) | 2018-11-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108882172B (en) | Indoor moving trajectory data prediction method based on HMM model | |
Song et al. | A novel convolutional neural network based indoor localization framework with WiFi fingerprinting | |
US9904932B2 (en) | Analyzing semantic places and related data from a plurality of location data reports | |
CN104507050B (en) | Probabilistic type finger print matching method in a kind of WiFi indoor positionings | |
CN107679558A (en) | A kind of user trajectory method for measuring similarity based on metric learning | |
CN109948066B (en) | Interest point recommendation method based on heterogeneous information network | |
CN110533048A (en) | The realization method and system of combination semantic hierarchies link model based on panoramic field scene perception | |
CN112135248B (en) | WIFI fingerprint positioning method based on K-means optimal estimation | |
CN106326923A (en) | Sign-in position data clustering method in consideration of position repetition and density peak point | |
Wang et al. | Deep neural network‐based Wi‐Fi/pedestrian dead reckoning indoor positioning system using adaptive robust factor graph model | |
CN115265555A (en) | Hidden Markov based multi-noise perception map matching correction method and system | |
CN109121081B (en) | Indoor positioning method based on position candidate set and EM algorithm | |
CN113132931B (en) | Depth migration indoor positioning method based on parameter prediction | |
Mallik et al. | Rank based iterative clustering (RBIC) for indoor localization | |
CN115691140B (en) | Analysis and prediction method for space-time distribution of automobile charging demand | |
CN108133234B (en) | Sparse subset selection algorithm-based community detection method, device and equipment | |
CN114664104B (en) | Road network matching method and device | |
CN110633890A (en) | Land utilization efficiency judgment method and system | |
CN115062708A (en) | Abnormal node detection method based on track deviation point embedding and depth clustering | |
CN114186112B (en) | Robot navigation method based on Bayesian optimization multiple information gain exploration strategy | |
CN115752459A (en) | Trajectory rectification method based on indoor position network model | |
CN115510317A (en) | Cloud-edge collaborative interest point recommendation method and device | |
Nie et al. | Joint access point fuzzy rough set reduction and multisource information fusion for indoor Wi-Fi positioning | |
Zhang et al. | DeepLoc: deep neural network-based telco localization | |
Zhu et al. | A data-driven sequential localization framework for big telco data |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |