Feature identification and method for fast searching based on the focus path of periodTechnical field
The present invention relates to a kind of method of network path search, relate in particular to the method for utilizing the large data of historical track in road network, to carry out focus Path Recognition and search.
Background technology
In network path search, optimal path typically refers in from origin to destination all paths, the shortest one of cum rights path.According to the difference of weights implication in highway section in the road network, that optimal path inquiry can develop is the shortest for path, the enforcement time is minimum, paying price is optimum, and the calculating in the path such as energy resource consumption is minimum.In comparatively complicated application, optimal path can also be the optimum after multiple weighing value (as considering simultaneously enforcement time and paying price) considers.
Yet in many application scenarioss, these can't satisfy user's trip requirements based on the path query technology of weights optimum.For example, people tend to consider factors at a strange city whilst on tour, as road closed whether, road conditions complexity, pavement quality quality, traffic safety whether, and how etc. landscape on the way.These conditions are not only numerous and diverse, and temporal evolution is indefinite, are difficult to as concrete pathfinding standard.At this moment, select from origin to destination, the most normal path of being used by the user, namely the focus path is that more traditional method for searching is better selected.Except the application in recommend in the path, the focus path also is that city planning, space-time data excavate, and the gordian technique of the important application such as all kinds of location-based services.For example, we can be by checking within the different periods, the focus path is whether identical between identical source point and the destination, and analyze people and whether change in the trip custom of different times (such as working day and weekend), and the auxiliary generation of surveying unusual and major event.
In recent years, along with the fast development of position acquisition technology (such as Global Positioning System:GPS), people begin to collect and process the historical movement trace information of the objects such as increasing relevant vehicle, people, animal.For example, from 2007 to 2012, collected vehicle GPS position record and has reached about 1,000 hundred million Beijing.The appearance of magnanimity track data, for the identification in focus path and inquiry provide may.
In brief, the focus path refers in all paths from the source point to the destination, the path that the most often is used.This concept is easily understood, and its principal character but is difficult to extract.Patent documentation 1(number of patent application 201110357525.7) general routes and the focus path implication that propose are similar.Specifically, general routes refers in all paths from the source point to the destination, through the path of historical track number greater than certain preset value.The subject matter of the method is, the optimal path that obtains does not thus possess the characteristic of suffix subpath optimum.This characteristic refers to, supposes path P=v1→ v2→ ... → vnFrom source point v1To destination vnThe focus path, vi(1≤i≤n) is the node in the road network, so the suffix subpath v of Pi→ ... → vnAlso should be viTo vnThe focus path.Otherwise in the reality navigation, the every crossroad of user (is vi), just needing the again focus path of the remaining route of inquiry, this obviously is discontented with the demand that use on full border.Secondly, track data possesses the space-time multi-dimensional nature, and existing large data processing technique can't be supported effective storage and the quick-searching of the large data of track.The method does not provide the solution of effective storage and the large data of inquiry track.At last, be subjected to the impact of the dynamic factors such as the magnitude of traffic flow, weather condition, road construction, anomalous event, the focus path possesses stronger ageing.But the method does not allow the user in when inquiry, selects the interested period, and the calculating in focus path is based on that all historical tracks finish.Because arbitrariness and the unpredictability of period, a lot of complicated operations (such as the track data inquiry) must be finished online, and this has proposed huge challenge for the fast query in path.
The scientific research personnel of University of Queensland has proposed the method in another definition focus path.They have designed a novel heat degree function, for assessment of the temperature from given source point to every paths the destination, and select the highest path of temperature as the focus path.The temperature value of one paths equals on this path the product that all highway sections arrive the probable value of destinations.Therefore, the highway section number is more, and the temperature value in path is lower.The road (such as the route by way of the urban district) that this obviously is unfavorable for those by way of more intersection and frequency of utilization is very high.Also have, the road that the method is found out may comprise the highway section that seldom is used, and such focus path does not have practical significance.In addition, the method does not allow the interested period of user selection yet, does not propose the solution of online query (such as the track data online query).
In sum, effective identification in focus path and fast search are problem demanding prompt solutions.。
Summary of the invention
In order to solve the deficiencies in the prior art, the invention provides the novel feature recognition strategy in a kind of focus path, a kind of focus path high-efficiency search method based on the period.Its purpose has 2 points: 1) focus Path Recognition mechanism reasonable in design, the footpath experience of seeking that accurately reflection is popular as far as possible; 2) the efficient track data storage and retrieval method of design realizes the fast search based on the focus path of period.
To achieve these goals, the invention provides the core identification feature in a cover focus path.Suppose P=v1→ v2→ ... → vnFrom v1To vnThe focus path, vi(1≤i≤n) is the node in the road network, and P should possess following core feature so:
Feature one: the suffix path is optimum, and namely any suffix subpath of P also should be a focus path;
Feature two: link length is irrelevant, and namely the temperature of P is only relevant with its number of times of once being used, and can't help its length decision;
Feature three: do not contain bottleneck road, namely P should not comprise and can be avoided the low temperature highway section of using.
In the feature one, the suffix subpath of P refers to, for any node v among the Pi, from viTo vnSubpath.This subpath should be from viTo vnThe focus path.
In the feature two, both the shown the way physical length in footpath of path, the footpath that also shows the way comprises the quantity on highway section (limit).In addition, the temperature in path is the function that the reflection path is used number of times, and it is more frequent that the path is used, and its temperature is higher.
In the feature three, bottleneck road refers to from v1To vnCan be avoided the low temperature highway section of using.In addition, the temperature in highway section is to reflect in order to arrive the destination, and this highway section is used the function of number of times.It is more frequent that the highway section is used, and its temperature is higher.The temperature in highway section must be based on given destination vnOnly in order to reach vnAnd select the track in this highway section, just the temperature in this highway section there is contribution.
The present invention also provides a kind of characteristic recognition method of the focus path based on the period.Comprise following step:
Step 1, the sign of track and filtration, every track all represents once significant travelling.Take taxi as example, a track has comprised the motion recording that the passenger gets off from getting on the bus to.Article one, typical track can be designated Y=((v1, t1) ..., (vn, tn)), wherein, (v1..., vn) be the paths in the road network, ti(1≤i≤n) is that Y arrives node viTime.The interested period T of given user=[ts, te], then every track will not be filtered in the part that T generated in the period.Particularly, suppose Y '=((vk, tk) ..., (vh, th)) be the result's (sub-trajectory of Y) after track Y is filtered by T, so:
· ts≤ tk,th≤ te;
If k〉1, t thenK-1<ts
If h<n, then tH+1Te
Step 2, the measuring of highway section temperature, particularly, the temperature of highway section e refers to arrive destination v by way of enThe track number.Every track is all filtered by T herein.Note the not necessarily terminal point of track of destination, as long as track had passed through e before arriving the destination.
Step 3, the vector of path temperature indicates, and namely adopts vector to indicate the temperature in path from origin to destination.Particularly, the temperature F of path P (P)=(f1, f2..., fk) be exactly that P(is comprised k highway section) and in sort the from low to high sequence of rear generation of the temperature in all highway sections.F whereini(1≤i≤k) is exactly the temperature that temperature comes the highway section of i name reciprocal.
Step 4, the rank of path temperature, this rank is based on a kind of novel temperature relational calculus.Given two paths P and P ' and their temperature F (P)=(f1, f2..., fm) and F (P ')=(f1', f2' ..., fn'), if following any two conditions satisfy one, we think that the temperature of P is not less than P '.If the value of F (P) and F (P ') is different, the temperature that we say P is greater than P ':
Condition 1:F (P) is the prefix of F (P ');
Condition 2: exist q belong to set 1 ..., min (m, n) } so that: 1) for theset 1 ..., the arbitrary element i among the q-1} all has fi=fi', 2) fqFq'.
Use this relational calculus, can the temperature in path be sorted entirely, come first namely be the focus path.It all is the highest that attention may have the temperature of mulitpath, at this moment selects wherein any one to get final product.
The present invention also provides a kind of track data Indexing Mechanism CFMI(Containment-Based Footmark Index), be used for retrieval and in specified time period T, arrive certain node vdAll historical tracks, and intercept them and arrive vdBefore, and the part in T.Utilize this index can calculate the temperature in highway section, but the function of this index possesses versatility, be not limited to the focus path query.The feature of this Indexing Mechanism is can filter all not arrive v in TdTrack.Owing to whenever reading a track, will produce the expense that disk reads at random, in order to reduce the I/O operation, the basic thought of this Indexing Mechanism is only to read leading track from disk, and by the reference position of other tracks of record in leading track, reduce the track route of other (satisfying querying condition) tracks.Suppose that track Y is by way of node vi, use Y(*, vi)Indicate track Y and arrive vi(comprise v beforei) sub-trajectory, with Path (Y(*, vi)) sign Y(*, vi)The path of process.For other any one by way of viTrack Y ', if or Path (Y(*, vi)) and Path (Y '(*, vi)) identical, or Path is (Y(*, vi)) be not Path (Y '(*, vi)) suffix, we claim that Y is node viLeading track.By analysis and the research to the large data of real trace, the track quantity that we are found to destination (the especially focus in the city) is far longer than the leading track quantity on this ground.If track Y ' ' passes through vi, and Path (Y ' '(*, vi)) be Path (Y(*, vi)) suffix (in other words, Y ' ' arrives viRoute covered by the route that Y arrives vi), we claim that Y is that Y ' ' is about node v soiLeading track, we can reduce Y ' ' by only reading Y.The foundation of doing like this is because period T(such as several days, several week, some months) often be far longer than the time of a track (such as dozens of minutes, several hours.We think that a track is once significant trip, for example the track of taxi from upper visitor to lower visitor).Therefore for most of track, as long as they arrive the time of destination in T, its zero-time is also contained in the T naturally.We only do independent reading to the track on its time leap of only a few T border.
In index CFMI, we are each the node v in the road networkiCreate a B+ tree BTViBTViIndex track arrive viTime, and deposited the track number of this track.Each BTViLeaf node comprise five territories:
<tid, tstart, tarrive, did, sloc>
Wherein tid is unique sign of track; tStartIt is the zero-time of track tid; tArriveThat track arrives viTime; Did is tid number of the affiliated leading track of track tid; Sloc is the reference position of track tid in track did.Secondly, we are each BTViSafeguarded a table vi-Dom has recorded vertex v in the tableiEvery leading track arrive viThe number of vertices of process before.In addition, we have safeguarded a form Table, are used for each node mapping to its corresponding B+ tree.
The present invention also provides a kind of method for quickly querying of the focus path based on the period.Given road network G=(V, E), departure place vs, destination vd, period T interested, the method comprises two steps: 1) generate based on (vd, temperature figure G T)f=(Vf, Ef).GfThe cum rights subgraph of G, VfComprised in time T, in order to arrive vd, historical track the vertex set of process.EfThe set on the limit (highway section) that temperature is non-vanishing.2) search the focus path, namely at GfMiddle inquiry is from vsTo vdThe focus path.If vsNot at GfIn, perhaps GfBe sky, then return null value, illustrate from vsTo vdThere is not the focus path to exist; Otherwise return lookup result.
Described generation temperature figure GfThe specific implementation step as follows:
Step 1, FG represents based on (v with adjacency matrixs, vd, temperature figure G T)f, all elements is initialized as 0 among the FG;
Step 2 is searched index CFMI and is returned two set: track record set TR and leading track set of records ends DOM.Wherein, set TR has deposited all through (vd, (namely this track has not passed through v for sky T) to filter rear sub-trajectoryd, and arrive vdBefore for some time in T) trace information, comprise (tid, tStart, did, sloc), notice that tid is unique sign of track; Set DOM has deposited the information of the leading track of all tracks among the set TR, comprises (did, len), and wherein did is unique sign of leading track, and len is that leading track arrives vdThe time the nodal point number of process (comprise vd);
Step 3, one of initialization comprise the set DA of array for empty, and for every among DOM record (did, len), creating a length is the array DA.did of len, and its all elements of initialization is 0.Then data DA.did is incorporated among the set DA;
Step 4 is for every among the TR record (tid, tStart, did, sloc), check tStartWhether in period T, if do not exist, then according to track not the mode in T revise temperature figure matrix F G; If, the value of sloc the element of array DA.did is added 1;
Step 5 is revised temperature figure matrix F G according to the mode of track in T;
Step 6 is returned temperature figure matrix F G, FG[i wherein, j] in the expression road network from viTo vjHave the highway section to link to each other, temperature is FG[i, j].Temperature figure GfThen comprised all temperatures and be not 0 highway section, and their nodes of being connected.If the temperature in all highway sections that link to each other with node v among the attention road network G is 0, then v can not appear at temperature figure GfIn.
In thestep 2 that generates temperature figure, the concrete steps of searching index CFMI are as follows:
1) original state, set TR and set DOM are sky;
2) in form Table, find B+ tree BTVdThe deposit position of root node;
3) from BTVdRoot node sets out, and finds in leaf node, greater than period T=[ts, te] middle tsMinimum tArriveThe element at place (tid, tStart, tArrive, did, sloc), with element (tid, tStart, did, sloc) and insert set TR, and at table viFind value corresponding to track did (to arrive v among the-DomdThe nodal point number of process) len if (did, len) do not exist in set DOM, then inserts;
4) along BTVdPointer in the tree between the leaf node is from element (tid, tStart, tArrive, did, sloc) set out, press tStartThe order that increases, take out one by one to the right next element (tid ', t 'Start, t 'Arrive, did ', sloc '), if t 'ArriveIn T, then repeating step 3) in operation.
In the step 4 that generates temperature figure, if the departure time t of track tidStartNot in period T, the concrete steps of revising temperature figure matrix F G are:
1) reads track tid from disk, take out first element (vid of track tid1, t1);
2) if t1Not in T, then continue to get its following element, until take out the element (vid of first time of arrival in Ti, ti);
3) take out element (vidi, ti) next first prime element (vidI+1, tI+1) (notice that this element is certain existence, because index CFMI only can return relevant (vd, T) sub-trajectory is not empty track), and with matrix element FG[vidi] [vidI+1] value add 1;
4) repeat 3), until get destination vdTill the element at place.Like this, among the track tid from (vidi, ti) to (vd, tVd) the temperature in each highway section added 1 at FG.
In thestep 5 that generates temperature figure, if the departure time t of track tidStartIn period T, the concrete steps of revising temperature figure matrix F G are:
1) value with sloc the element of array DA.did adds 1;
2) for each element (did, len) among the set DOM, be done as follows:
A) from disk, take out leading track did, and take out first node vid of track did process1
B) two variable k=1 of initialization, w=0;
C) if vid1Not vd, then take out the next node vid of the process of track tid2
D) if DA.did[k] be not 0 or w be not 0, then the value of w is increased DA.did[k], and with FG[vid1] [vid2] value increase w;
E) value with k adds 1;
F) repeat c), until take out destination node vdTill.
Described search the focus path operations be input as starting point vsWith based on (vd, temperature figure G T)f, concrete steps are as follows:
Step 1 is if temperature figure is GfBe sky, illustrating does not have track to arrive v in period Td, return from vsTo vdThe focus path be empty;
Step 2 is with temperature figure GfCall in internal memory.If departure place vsNot at GfIn, illustrating does not have track once from vsTo vd, return the focus path for empty; Otherwise, continue to carry out following steps.
Step 3 is with F* (vs, i) be illustrated under the prerequisite on maximum permission i bars limit, from vsTo vdThe focus path.For GfIn each node u, represent the temperature of the F* (u, i) that up to the present finds with u. £, represent the immediate successor node of node u among the F* (u, i) with u.suc.Under the original state, if u is not equal to vd, u. £=#(explanation focus path is set does not exist), u.suc=null; Otherwise u. £ is set is empty (illustrating that u does not comprise any highway section to the focus path of u).Unless this means u is exactly vd, otherwise from u to vdThe focus path that comprises 0 limit is non-existent.
Step 4 is to GfIn every limit (u, v), with w (u, v) temperature of expression (u, v), and be done as follows: if (w (u, v) ‖ v. £)〉u. £ illustrates the temperature of F* (u, i), not from u through limit (u, v), pass through again F* (v, the temperature in path i) is high, therefore need to revise F* (u, i), order
u.£ = w(u, v) ‖ v.£;
u.suc = v;
Step 5, repeating step 4 be altogether | Vf|-1 time, | Vf| be temperature figure GfThe sum on middle summit;
Step 6 is from vsSet out, along the suc pointer to vdThe path, namely be vsTo vdThe focus path.
In the step 4 of searching the focus path, the temperature in two kinds of paths is arranged: a kind of is the temperature in dead circuit footpath, and a kind of is the temperature # that does not have the path.In all path temperatures, temperature be the highest, the temperature of # is minimum.
In the step 4 of searching the focus path, operation " ‖ " is defined as follows:
1) if two non-decreasing sequences that input all is comprised of positive integer, " ‖ " is merged into a non-decreasing sequence with these two sequences.For example: (20) ‖ (5,20)=(5,20,20);
2) if one of them is input as empty sequence, another input will as a result of be returned so.If two inputs all are empty sequences, then as a result of return.For example: ‖ (5,20)=(5,20);
3) if one of them is input as #, then return #.For example: #+(5,20)=#.
Compared with prior art, the present invention has following advantage:
1) the present invention proposes a kind of new method for searching path: based on the focus route searching of period.The present invention allows the user when searching the focus path, selects the interested period.This meets the characteristic of in time dynamic change of focus path very much.Can not only provide accurately result for digital map navigation; Also can be by the variation in the different period focus paths of analysis and comparison, for the complicated applications such as city planning, space-time data excavation provide the core technology support;
2) the present invention has designed a kind of focus path identification method based on the period.The focus path that utilizes the method to find, satisfy the suffix subpath optimum, irrelevant with path, do not contain the good characteristic such as bottleneck road, meet people to the intuitivism apprehension in focus path, can better reflect in the past people's the footpath experience of seeking;
3) the present invention has designed a kind of simple, efficient track data Indexing Mechanism, can not only filter the track data that all and result have nothing to do, can also be by only reading the mode of leading track, reduction is dominated track and is included in other interior a large amount of tracks, can effectively reduce the random reading times of disk, have good extensibility, its space hold is also very low.Secondly, this index also possesses good versatility, can accelerate " in set period, arriving the track of any appointed place " inquiry, cut apart and obtain, be not limited to the search in focus path;
4) the present invention has designed a kind of simple, efficient focus path search algorithm.Fast focus path online query can be provided.Utilize the historical taxi data in more than 1,000 ten thousand Shanghai City, move the method at the separate unit server, (destination that namely arrives is focus, and a lot of track processes are arranged under worst case; Time is whole historical time), the time of searching in focus path is no more than 1 minute.Therefore should the very suitable focus path query based on the large data of historical track of invention.
Description of drawings
The present invention is further described below in conjunction with drawings and Examples.
Fig. 1 is the focus route characteristic identification process figure of first embodiment of the present invention.
Fig. 2 is the trace filtering method schematic diagram of first embodiment of the present invention.
Fig. 3 is the path temperature Relationship Comparison process flow diagram of first embodiment of the present invention.
Fig. 4 is the leading track structural representation of second embodiment of the present invention.
Fig. 5 is the index CFMI building-block of logic of second embodiment of the present invention.
Fig. 6 is the temperature figure visioning procedure figure of the 3rd embodiment of the present invention.
Fig. 7 is that the 3rd embodiment of the present invention searches process flow diagram in CFMI
Fig. 8 is the track departure time processing flow chart in T not among the 3rd embodiment of the present invention
Fig. 9 is the processing flow chart of track departure time in T among the 3rd embodiment of the present invention
Figure 10 is the search routine figure of focus path on temperature figure of the 4th embodiment of the present invention.
Embodiment
Below in conjunction with accompanying drawing, describe the embodiment of focus path identification method of the present invention and fast search mechanism in detail.Listed accompanying drawing for explanation, is not limitation of the present invention only.
Embodiment one
The embodiment of the invention provides a kind of characteristic recognition method in focus path, as shown in Figure 1.Input parameter comprises: road network G, historical track set, departure place vs, destination vd, and interested period T.Specifically comprise the steps:
A1. for every historical track, only keep it and arrive destination vd(comprise v befored), and the part in T.
A2. calculate the temperature in every highway section for arriving v through this highway sectiond(filter after) historical track number;
A3. for every from vsTo vdThe path, calculate its temperature and be the non-decreasing arrangement of its institute through the temperature in highway section;
A4. with all from vsTo vdThe path entirely sort according to their temperature, what temperature was the highest is exactly in the period T, from vsTo vdThe focus path.
Historical track is according to (vd, the method for T) filtering as shown in Figure 2.Article one, typical track can be designated Y=((v1, t1) ..., (vn, tn)), wherein, (v1..., vn) be the paths in the road network, ti(1≤i≤n) is that Y arrives node viTime.The interested period T=[t of given users, te], then every track will not be filtered in the part that T generated in the period.Particularly, suppose Y '=((vk, tk) ..., (vh, th)) be the result's (sub-trajectory of Y) after track Y is filtered by T, so:
· ts≤ tk,th≤ te;
If k〉1, t thenK-1<ts
If h<n, then tH+1Te
Further, we only preserve and arrive v among the Y 'd(comprise vd) before part.If Y ' is without vd, Y ' is empty after then filtering.Note, because we suppose that every track all is once significant travelling, so we have reason to think that every track can not repeat through same place (node), so we do not consider to arrive the track part behind the destination.Concrete, 6 track Y1 are arranged to Y6 among Fig. 2.Result after they filter is respectively:
Y1 the path of process be (v1→ v2→ v7→ vd→ v5), because v1Not in T, v5At vdAfterwards, the result after therefore filtering is (v2→ v7→ vd);
Y2 the path of process be (v1→ v2→ v7→ vd), and whole Y2 is in T, so Y2 remains unchanged after filtration.The situation of Y3 and Y4 is the same with Y2, and whole track also remains unchanged after filtering;
Y5 the path of process be (v1→ v2→ v6→ vd), but v1Not in T, the result after therefore filtering is (v2→ v6→ vd);
Y6 the path of process be (v7→ v6→ v5), although whole Y6 is in T, because Y6 is without vdSo the result after filtering is empty.
The comparative approach of path temperature is considered the temperature ofpath P 1 and P2 as shown in Figure 3:
F(P1) = (f11, f12, …, f1n)
F(P2) = (f21, f22, …, f1m)
Comparison procedure based on temperature relational calculus provided by the invention is specific as follows:
B1. count initialized device i equals 1;
If b2. i≤min (m, n) turns step b3, otherwise turn step b5;
If f b3.1i=f2i, i is added 1, and turns step b2, otherwise turn step b4;
If f b4.1i<f2i, then export F (P1)<F (P2), the temperature that reaches P1 is lower than P2, otherwise turns step b5;
B5. export F (P1) 〉=F (P2), namely the temperature of P1 is not less than P2.
Embodiment two
The embodiment of the invention provides ultimate principle and the logical organization of index CFMI.The ultimate principle of CFMI is to recover a large amount of tracks by reading a small amount of leading track, as shown in Figure 4.Suppose that track Y is by way of node vi, use Y(*, vi)Indicate track Y and arrive vi(comprise v beforei) sub-trajectory, with Path (Y(*, vi)) sign Y(*, vi)The path of process.For other any one by way of viTrack Y ', if or Path (Y(*, vi)) and Path (Y '(*, vi)) identical, or Path is (Y(*, vi)) be not Path (Y '(*, vi)) suffix, we claim that Y is node viLeading track.In Fig. 4, viBe the black node in the road net.One has six tracks (Y1 to Y6) arrives this node.Note track Y2 and Y3 the path of process be comprised among the track Y1, track Y4 and Y5 the path of process be comprised among the track Y6, and Y1 and Y6 before arriving the black node the path of process, do not comprised through the path by any other track, so Y1 and Y6 are the leading tracks of black node.
Fig. 5 has described the logical organization of CFMI.In index CFMI, we are each the node v in the road networkiCreate a B+ tree BTViBTViIndex track arrive viTime, and deposited the track number of this track.Each BTViLeaf node comprise five territories:
<tid, tstart, tarrive, did, sloc>
Wherein tid is unique sign of track; tStartIt is the zero-time of track tid; tArriveThat track arrives viTime; Did is tid number of the affiliated leading track of track tid; Sloc is the reference position of track tid in track did.Secondly, we are each BTViSafeguarded a table vi-Dom has recorded vertex v in the tableiEvery leading track arrive viThe number of vertices of process before.In addition, we have safeguarded a form Table, are used for each node mapping to its corresponding B+ tree.
The upper left corner of Fig. 5 is a road network example.We have indicated eight node (v1To v8).Historical track by this road network has 4, and is specific as follows:
Y1 arrives v2Front part is: ((v6, tY1-v6), (v7, tY1-v7), (v3, tY1-v3), (v4, tY1-v4), (v2, tY1-v2));
Y2 arrives v1Front part is: ((v3, tY2-v3), (v4, tY2-v4), (v2, tY2-v2), (v5, tY2-v5), (v1, tY2-v1));
Y3 arrives v1Front part is: ((v5, tY3-v5), (v1, tY3-v1));
Y4 arrives v1Front part is: ((v8, tY4-v8), (v1, tY4-v1));
Wherein, tYi-vjExpression track Yi arrives node vjTime, and:
tY1-v2< tY2-v2< tY4-v1 < tY2-v1 < tY3-v1
With BTV1Be example, its leaf node partial index Y2, Y3 and Y4 arrive node v1Time, and according to time of arrival they having been carried out the non-decreasing arrangement, because tY4-v1<tY2-v1<tY3-v1, so node (Y4, tY4-v8, tY4-v1, Y4,1) and come Far Left, secondly be node (Y2, tY2-v3, tY2-v1, Y2,1), rightmost is node (Y3, tY3-v5, tY3-v1, Y2,1).With node (Y4, tY4-v8, tY4-v1, Y4,1) and be example, track tid=Y4, tStart=tY4-v8The zero-time that Y4 is described is through v8Time, tArrive=tY4-v1Indicated the time of Y4 arrival v1, the leading track that did=Y4 explanation comprises Y4 is exactly Y4 oneself, and sloc=1 explanation Y4 reference position in the leading track under it is 1, and namely the leading track under the Y4 namely is Y4 oneself.Notice that the leading track under the Y3 is Y2, because it arrives v1Before do through the path be included in the Y2.In addition, table v1-Dom has comprised two records, illustrates to arrive v1Leading track have two, i.e. Y2 and Y4.Take Y2 as example, it before arriving v1 the nodal point number of process be 5, i.e. v3, v4, v2, v5And v1
Embodiment three
The embodiment of the invention provides creation method and the flow process of temperature figure, as shown in Figure 6.Input road network G (V, E), destination vdAnd interested period T, temperature figure GfThe concrete steps that create are as follows:
C1. represent based on (v with adjacency matrix FGs, vd, temperature figure G T)f, all elements is initialized as 0 among the FG;
C2. search index CFMI and return two set: track record set TR and leading track set of records ends DOM.Wherein, set TR has deposited all through (vd, T) (namely this track has not passed through v in T for sky after the filtrationd) trace information, comprise (tid, tStart, did, sloc), notice that tid is unique sign of track; Set DOM has deposited the information of the leading track of all tracks among the set TR, comprises (did, len), and wherein did is unique sign of leading track, and len is that leading track arrives vdThe time the nodal point number of process (comprise vd);
C3. create a set DA who comprises array, each element among the DA is an array DA.did, the record (did, len) among the corresponding DOM.The length of DA.did is len, and under the original state, all elements of DA.did is 0;
C4. judge that whether set TR is empty, if so, then turns step c8, otherwise turns step c5;
C5. take out element (tid, the t of TRStart, did, sloc), and judge tStartWhether in period T.If, turn step c6, otherwise turn step c7;
C6. with array element DA.did[sloc] value add 1, turn step c4;
C7. according to tStartThe mode in period T is not revised adjacency matrix FG, turns step c4;
C8. according to tStartMode in period T is revised adjacency matrix FG;
C9. export adjacency matrix FG, FG[i wherein, j] in the expression road network from viTo vjHave the highway section to link to each other, temperature is FG[i, j].
Temperature figure GfComprised all temperatures and be not 0 highway section, and their nodes of being connected.If the temperature in all highway sections that link to each other with node v among the attention road network G is 0, then v can not appear at temperature figure GfIn.
Fig. 7 has provided the flow process of searching at index CFMI among the step c2, given input vdAnd T=[ts, te], concrete steps are as follows:
D1. initialization set TR and set DOM are sky;
D2. in form Table, find B+ tree BTVdThe deposit position of root node;
D3. from BTVdRoot node sets out, and finds in leaf node, greater than tsMinimum tArriveThe element at place (tid, tStart, tArrive, did, sloc);
D4. incite somebody to action wherein (tid, tStart, did, sloc) and insert set TR, and at table viSearch track did and corresponding value (arrival v thereof among-the DomdThe nodal point number of process) len if (did, len) do not exist in set DOM, then inserts;
D5. along BTVdPointer in the tree between the leaf node takes out (tid, tStart, tArrive, did, sloc) next node;
If d6. this node exists and tStartIn T, turn steps d 4, otherwise turn steps d 7;
D7. output set TR and the set DOM.
Fig. 9 has provided track departure time t among the step c7StartIn the time of not in T, revise the flow process of adjacency matrix FG.Input element (tid, tStart, did, sloc), period T and FG, concrete steps are as follows:
E1. read track tid from disk, take out first element (vid of track tid1, t1);
If t e2.1Not in T, then continue to read next element (vidi, ti), until tiTill in T;
If vid e3.i=vd, then turn step e6, otherwise turn step e4;
E4. take out element (vidi, ti) next first prime element (vidI+1, tI+1);
E5. and with matrix element FG[vidi] [vidI+1] value add 1, and turn step e3;
E6. export adjacency matrix FG.
Fig. 8 has provided track departure time t among the step c8StartIn the time of in T, revise the flow process of adjacency matrix FG.Input set DOM and FG, concrete steps are as follows:
F1. initializing variable k=1, w=0;
F2. take out the next element (did, len) of set DOM;
If f3. this element (did, len) does not exist, then turn step f11; Otherwise turn step f4;
F4. from disk, take out leading track corresponding to did, and take out first node vid of track did process1
If vid f5.1Vd, then turn step f2; Otherwise turn step f6;
F6. take out the next node vid of the process of track tid2
If DA.did[k f7.] be not 0 or w be not 0, then turn step f8, otherwise turn step f10;
F8. the value with w increases DA.did[k];
F9. and with FG[vid1] [vid2] value increase w;
F10. the value with k adds 1, and with vid2Value be assigned to vid1, and turn step f5;
F11. export adjacency matrix FG.
Embodiment four
The embodiment of the invention provides the search routine of focus path on temperature figure, as shown in figure 10.Be input as starting point vsWith based on (vd, temperature figure G T)f=(Vf, Ef), concrete steps are as follows:
If G g1.fBe sky, illustrating does not have track to arrive v in period Td, EO; Otherwise turnstep g 2;
G2. with temperature figure GfCall in internal memory, if departure place vsNot at GfIn, illustrating does not have track once from vsTo vd, the focus path is empty, EO, otherwise turn step g 3;
G3. use F* (vs, i) be illustrated under the prerequisite on maximum permission i bars limit, from vsTo vdThe focus path.For GfIn each node u, represent the temperature of the F* (u, i) that up to the present finds with u. £, represent the immediate successor node of node u among the F* (u, i) with u.suc.Under the original state, if u is not equal to vd, u. £=#(explanation focus path is set does not exist), u.suc=null; Otherwise u. £ is set is empty (illustrating that u does not comprise any highway section to the focus path of u).Unless this means u is exactly vd, otherwise from u to vdThe focus path that comprises 0 limit is non-existent;
G4. count initialized device i is 0;
G5. the value with i adds 1.If the value of i is greater than greater than GfTotal nodal point number | Vf|, EO then; Otherwise turn step g 6;
G6. count initialized device j is 0;
G7. the value with j adds 1, if the value of j is greater than GfTotal limit number | Ef|, then turnstep g 5; Otherwise turn step g 8;
G8. take out GfJ bar limit (u, v), with w (u, v) expression (u, v) temperature;
G9. (if w (u, v) ‖ v. £)〉u. £, F* (u is described, i) temperature, not from u through limit (u, v), pass through again F* (v, the temperature in path i) is high, therefore needs to revise F* (u, i), make u. £=w (u, v) ‖ v. £, then u.suc=v turns step g 7; Otherwise directly turn step g 7.
From vsSet out, along the suc pointer to vdThe path, namely be vsTo vdThe focus path.
In the step g 3 of searching the focus path, the temperature in two kinds of paths is arranged: a kind of is the temperature in dead circuit footpath, and a kind of is the temperature # that does not have the path.In all path temperatures, temperature be the highest, the temperature of # is minimum.
In the step g 9 of searching the focus path, operation " ‖ " is defined as follows:
1) if two non-decreasing sequences that input all is comprised of positive integer, " ‖ " is merged into a non-decreasing sequence with these two sequences;
2) if one of them is input as empty sequence, another input will as a result of be returned so.If two inputs all are empty sequences, then as a result of return;
If one of them is input as #, then return #.