Summary of the invention
For addressing the above problem, the invention discloses the method and system of determining communication destination node position in a kind of automobile self-organized network, can not rely on the location-based service of any infrastructure, determine and make in the automobile self-organized network node when communication, in time destination node be carried out the position, communication overhead when the service that dips is safeguarded, the delay when reducing the node location inquiry.
The invention discloses the method for determining communication destination node position in a kind of automobile self-organized network, comprising:
Step 1, in described automobile self-organized network, select road, selecteed road is divided into one or more roadway segment, selects a node as the position candidate server from the node of each described roadway segment, all position candidate servers are formed the location server Candidate Set;
Step 2 is divided into a plurality of zones with described automobile-used self-organizing network, selects location server corresponding to each described zone for node from described location server Candidate Set, and described location server writes down the positional information of described node;
Step 3, node sends location update message to all or part of location server of described node, to upgrade the positional information of the described node on the described location server;
Step 4, source node is selected the location server of a destination node in the communication, sends position enquiring message to selecteed location server;
Step 5 after the location server of described destination node receives the described position enquiring message of sending, judges whether the positional information of record meets the demands, if, then reply the positional information of record, otherwise, described position enquiring forwards is given other location servers of described destination node.
Described step 1 further is:
Step 21 by the vehicle flowrate of each road in the described automobile self-organized network and the time of selection, is selected road from described automobile self-organized network;
Step 22 is divided into one or more roadway segment with selecteed road, and the node of each roadway segment is formed one bunch, and bunch head that selects described bunch from described bunch is as the position candidate server;
Step 23 is formed the location server Candidate Set with all described position candidate servers.
The location server of selecting corresponding to each described zone from described location server Candidate Set for node in the described step 2 further is:
Step 31 is used hash function described node is mapped in each described zone, makes the mapping position of described node in each described zone identical with respect to the side-play amount of described regional center;
Step 32, for each described zone, the nearest position candidate server of the mapping position of the described node of chosen distance in described zone is as the location server of described node corresponding to described zone from described location server Candidate Set.
Described step 3 further is:
Step 41 is selected this location server that upgrades from all location servers of described node;
Step 42 obtains the position of the described location server that this upgrades, and presses minimal spanning tree algorithm and generates the message forwarding tree, and the root node of described message forwarding tree is described node;
Step 43 is used described message forwarding tree and is sent described location update message to the described location server that this upgrades.
Described step 41 further is:
Step 51, Update Level is set, the renewal priority of the described Update Level correspondence that rank is big more is low more, the corresponding position recorder of each described Update Level, the initial value of all described position recorders all is the initial position of described node, and the renewal threshold value of each described Update Level correspondence is set and upgrades area size, the renewal threshold value of the Update Level correspondence that rank is big and upgrade area size respectively greater than the renewal threshold value of the little Update Level correspondence of rank with upgrade area size;
Step 52, calculate described node current location respectively with the distance between the node location that writes down in each described position recorder, compare the distance of each described Update Level correspondence and the renewal threshold value of each described Update Level correspondence respectively, more than or equal to the Update Level of selecting the rank maximum the Update Level of described renewal threshold value, the rank of selecteed Update Level is the maximum level of this renewal from described distance;
Step 53 is the center with described node current location, and the renewal area size of described selecteed Update Level is a size, determines to upgrade the zone, and the described location server that upgrades all described nodes in the zone is this location server that upgrades;
Also comprise after the described step 43:
Step 54 is updated to the position of the described node that writes down in the position recorder of rank smaller or equal to the Update Level correspondence of the maximum level of described this renewal the current location of described node.
Described automobile self-organized network is a rectangle,
Described step 51 is from 1 to n, wherein for described Update Level is set further
A and B are the length of side of described rectangle, and L is default renewal zone size parameter, and the renewal threshold value of Update Level i is 2
I-1* D, D is default renewal threshold parameter, the renewal area size of Update Level i is with 2
I-1* L is the square of the length of side.
Described step 4 further is that described source node sends position enquiring message to the nearest location server of the described source node of location server middle distance of described destination node.
Comprise the current position of described node, the current current direction of motion and the timestamp of speed, described node of described node in the location update message that described node sends;
Described step 3 also comprises:
Step 81 after the location server of described node receives described location update message, writes down position, movement velocity, the direction of motion and the update time of described node;
Described step 5 further comprises:
After step 82, the location server of described destination node receive the described position enquiring message of sending, judge the current time with the difference of update time of the described destination node of record whether less than default duration, if, then execution in step 83, otherwise, execution in step 84;
Step 83 is replied the positional information of the described destination node of record to described source node;
Step 84, according to position, movement velocity, the direction of motion and current time of the described destination node of record with the difference of update time, from other location servers of described destination node, select a location server, transmit described position enquiring message to selecteed location server.
The invention also discloses the system that determines communication destination node position in a kind of automobile self-organized network, comprise node, described system also comprises:
Location server Candidate Set determination module, be used for selecting road from described automobile self-organized network, selecteed road is divided into one or more roadway segment, select a node as the position candidate server from the node of each described roadway segment, all position candidate servers are formed the location server Candidate Set;
The location server module is used for described automobile-used self-organizing network is divided into a plurality of zones, for node is selected location server corresponding to each described zone from described location server Candidate Set;
Described node comprises:
Update module is used for sending location update message to all or part of location server of described node, to upgrade the positional information of the described node on the described location server;
The position logging modle is used for when described node is the location server of other nodes, the positional information of record corresponding node;
The position enquiring module is used for selecting the location server of a destination node when described node is the communication source node, sends position enquiring message to selecteed location server;
Module is replied in the position, be used for when described node is location server, the described position enquiring message that reception is sent, whether the positional information of judging record meets the demands, if, then reply the positional information of record, otherwise, described position enquiring forwards is given by other location servers of query node.
Described location server Candidate Set determination module is further used for selecting road by the vehicle flowrate of each road in the described automobile self-organized network and the time of selection from described automobile self-organized network; Selecteed road is divided into one or more roadway segment, the node of each roadway segment is formed one bunch, bunch head that selects described bunch from described bunch is as the position candidate server; All described position candidate servers are formed the location server Candidate Set.
Described location server module is further used for using hash function described node is mapped in each described zone after described automobile-used self-organizing network is divided into a plurality of zones, make the mapping position of described node in each described zone identical with respect to the side-play amount of described regional center; For each described zone, the nearest position candidate server of the mapping position of the described node of chosen distance in described zone is as the location server of described node corresponding to described zone from described location server Candidate Set.
Described update module further comprises:
Select module, be used for selecting this location server that upgrades from all location servers of described node;
Sending module, be used to obtain the position of the described location server that this upgrades, press minimal spanning tree algorithm and generate the message forwarding tree, the root node of described message forwarding tree is described node, uses described message forwarding tree and sends described location update message to the described location server that this upgrades.
Described selection module further comprises:
Rank is provided with module, be used to be provided with Update Level, the renewal priority of the described Update Level correspondence that rank is big more is low more, the corresponding position recorder of each described Update Level, the initial value of all described position recorders all is the initial position of described node, and the renewal threshold value of each described Update Level correspondence is set and upgrades area size, the renewal threshold value of the Update Level correspondence that rank is big and upgrade area size respectively greater than the renewal threshold value of the little Update Level correspondence of rank with upgrade area size;
Rank is selected module, be used for calculating respectively the distance between the node location that described node current location writes down with each described position recorder, compare the distance of each described Update Level correspondence and the renewal threshold value of each described Update Level correspondence respectively, more than or equal to the Update Level of selecting the rank maximum the Update Level of described renewal threshold value, the rank of selecteed Update Level is the maximum level of this renewal from described distance;
Upgrade regional determination module, being used for described node current location is the center, the renewal area size of described selecteed Update Level is a size, determines to upgrade the zone, and the described location server that upgrades all described nodes in the zone is this location server that upgrades;
The position recorder update module is used for after the operation of described sending module is finished, and the position of the described node that writes down in the position recorder of rank smaller or equal to the Update Level correspondence of the maximum level of described this renewal is updated to the current location of described node.
Described automobile self-organized network is a rectangle,
Described rank is provided with module and is further used for being provided with described Update Level for from 1 to n, wherein
A and B are the length of side of described rectangle, and L is default renewal zone size parameter, and the renewal threshold value of Update Level i is 2
I-1* D, D is default renewal threshold parameter, the renewal area size of Update Level i is with 2
I-1* L is the square of the length of side.
Described position enquiring module is further used for sending position enquiring message to the nearest location server of the described node of location server middle distance of described destination node.
Comprise the current position of described node, the current current direction of motion and the timestamp of speed, described node of described node in the location update message that described node sends;
Described position logging modle also is used for receiving the described location update message that sends to described node during for location server at described node, and record sends position, movement velocity, the direction of motion and the update time of the node of institute's rheme updating message;
After described position answer module is further used for receiving the described position enquiring message of sending, judge the current time with the record by the difference of the update time of query node whether less than default duration, if then reply the described of record by the positional information of query node to the node that sends described position enquiring message; Otherwise, described according to what write down by the position of query node, movement velocity, the direction of motion and current time difference with update time, selected a location server other location servers of query node from described, transmitted described position enquiring message to selecteed location server.
Beneficial effect of the present invention is, provide because location-based service is the communication by node self in automobile self-organized, do not rely on the communication and the storage facility of any outside, be not subjected to the restriction of external condition, can be widely used in various environment, have better adaptability; Because location-based service is provided by distributed location server, reduced probability invalid when location server is selected, improved the reliability of location-based service; Because when node sends position renewal message to location server, determine different renewal frequencies according to location server apart from the distance of node, and use the multicasting technology that E-Packets based on minimum spanning tree, reduced the positional information maintenance costs; Because each node has a plurality of location servers to be distributed in the network, and the server info near apart from node upgrades frequently, for for network application between the vehicle of local communication, most of position enquiring can be fed back fast by location server nearby, has reduced the delay of position enquiring.
Embodiment
Below in conjunction with accompanying drawing, the present invention is described in further detail.
As shown in Figure 1, the inventive method comprises:
Step S101, from automobile self-organized network, select road, selecteed road is divided into one or more roadway segment, selects a node as the position candidate server from the node of each roadway segment, all selecteed nodes are formed the location server Candidate Set.
Step S102 is divided into a plurality of zones with automobile-used self-organizing network, for each node in the described automobile self-organized network is selected from the location server Candidate Set corresponding to each regional location server.
Step S103, node sends location update message to all or part of location server of this node, to upgrade the positional information of this node on the location server.
Step S104, source node is selected the location server of a destination node in the communication, sends position enquiring message to selecteed location server.
Step S105, after the location server of destination node receives and sends to its position enquiring message, whether the positional information of judging record meets the demands, if, then reply the positional information of this destination node of record to source node, otherwise, the position enquiring forwards is given other location servers of this destination node.
The method of determining the location server Candidate Set as shown in Figure 2.
Step S201 according to automobile self-organized deployment scope, utilizes the vehicle electronics map to obtain the interior road information of network coverage area.
Step S202, inquiry roads data in the vehicle electronics map are extracted the description of each bar road about bus capacity, according to the size of vehicle flowrate that road holds, for road is divided rank.Road is divided into through street, trunk roads, secondary distributor road and branch road from high to low according to the size that it holds vehicle flowrate, and rank is high more, and the vehicle flowrate that is held is big more.
Step S203 selects to satisfy institute according to road grade and holds vehicle flowrate requirement road from all roads.Institute holds the vehicle flowrate requirement and dynamically adjusts in time, and making selecteed road in rush-hour is trunk roads and secondary distributor road, is the through street and make selecteed road night.
Step S204 according to the radio transmission distance, is divided into one or more roadway segment with every selecteed road, and the node in each roadway segment is formed one bunch, and selects a bunch of head for each bunch, and bunch head is as the position candidate server.
Wherein the radio transmission distance is the radio transmission distance of used communication protocol regulation in the automobile self-organized network, and for example, in the IEEE of WLAN (wireless local area network) 802.11 agreements, the radio transmission distance is about 250 meters.
Select the method for bunch head to comprise:
The bus conduct bunch head that selects movement locus to determine.
Select the slowest vehicle conduct bunch head of movement velocity in the roadway segment.
The vehicle conduct bunch head that chosen distance roadway segment center is nearest.
Step S205, bunch first location server Candidate Set of forming of all bunches.
Determine node location server method as shown in Figure 3.
Step S301 is divided into the area that automobile self-organized network covered in the zone of M * N rectangle.Parameter M and N are provided with according to the scale of automobile self-organized network.
Step S302 utilizes consistent hash function, and a node identification is mapped in each zone, makes the mapping position of this node in each zone all identical with respect to the side-play amount of this regional center.
M x N altogether of the mapping target location of determining uses (0,0) to (M-1, N-1) expression.
The concrete grammar that utilizes hash function to realize adopts following process, but is not limited to following process:
Zone length=network lid length/M;
Peak width=network lid width/N;
From i=0, when i≤M-1, be the each i in following processing back and increase progressively 1;
From j=0, when j≤N-1, be the each j in following processing back and increase progressively 1;
The (i, j) coordinate of individual mapping target location point is as follows:
Abscissa=network left margin abscissa+i x zone length+node identification is divided by the remainder of zone length;
Ordinate=network lower boundary ordinate+j x peak width+node identification is divided by the remainder of peak width;
Circular treatment j finishes;
Circular treatment i finishes.
Step S303 for each mapping position, selects and a nearest location server of this mapping position from the location server Candidate Set, and it is labeled as location server of this node.
Step S304, all location servers of node are formed the location server collection of this node.
All nodes in the automobile self-organized network are all determined the location server collection of oneself by said method.
The method of the positional information on the node updates location server as shown in Figure 4.
Step S401 is provided with Update Level, and the renewal priority of the Update Level correspondence that rank is big more is low more, and Update Level is to n, wherein from 1
A and B are the length of side of rectangle automobile self-organized network, and L is default renewal zone size parameter;
The corresponding position recorder of each described Update Level, Update Level 1 to n is correspondence position register R respectively
1, R
2..., R
n, the initial value of all position recorders all is the initial position of this node, the renewal threshold value of Update Level i is 2
I-1* D, D is default renewal threshold parameter, the renewal area size of Update Level i is with 2
I-1* L is the square of the length of side, and L is default renewal zone size parameter.
Step S402, node detect the position of oneself in real time, calculate the distance of current location with respect to position in each position recorder, and note is made d respectively
1, d
2..., d
i..., d
n
Step S403, judging distance d one by one
1, d
2..., d
i..., d
nWhether satisfy di 〉=2
I-1* D, if, then can trigger node and carry out the position renewal, execution in step S404, otherwise, wait for when upgrading execution in step S402 next time.
Step S404, the Update Level of selection rank maximum is designated as d from the Update Level that satisfies condition
j, the maximum level of this renewal is j.
Step S405 is according to d
jDetermining the more new range that this upgrades, is the center with the current location of this node, with 2
J-1* L is that the square area of the length of side is this new range more, upgrades this more location server of all these nodes in the new range.
Step S406 utilizes electronic chart, with the connected graph at location server place to be updated, generates the message forwarding tree according to minimal spanning tree algorithm, and the root node of this message forwarding tree is this node.
Step S407, node use the message forwarding tree, to this more all location servers in the new range send multicast location update messages.
Comprise the current position of described node, the current current direction of motion and time of speed, described node of described node in the location update message.
After the location server of node receives this location update message, write down position, movement velocity, the direction of motion and the update time of this node.
In another embodiment, node sends location update message to all location servers of this node.
Step S408 upgrades position recorder R
1, R
2..., R
jThe position of middle record is the current location of this node, waits for next time and upgrading, execution in step S402.
In the communication sources querying node target node position process operating process of source node as shown in Figure 5, the operating process of the location server of destination node is as shown in Figure 6.
Step S501 when node communicates as source node, obtains the positional information of destination node if desired, then at first searches in this source node local cache.
Step S502, if do not find the positional information of destination node, the positional information of the destination node that perhaps finds is out-of-date, execution in step S503 then, otherwise, execution in step S508.
Step S503, node obtains its all location server collection according to destination node marking, is designated as Z.
Step S504 judges that whether location server collection Z is empty, if not, and execution in step S505 then, if, execution in step S508 then.
Step S505 searches the location server nearest apart from this source node from location server collection Z, be designated as S, sends position enquiring message to location server S.
Step S506, this source node is provided with overtime timer, judges whether the response message reporting errors not receiving response message or receive in overtime duration, if, execution in step S508 then, otherwise, execution in step S507.
Step S507 removes execution in step S504 with location server S from location server collection Z.
Step S508 finishes.
Step S601, location server receive node to its transmission or other location servers position enquiring message to its forwarding.
Step S602 searches its corresponding position information according to the destination node marking of being inquired about in database.
Whether step S603 exists the positional information of this destination node in the judgment data storehouse, if, execution in step S604 then, otherwise, execution in step S606.
Step S604, judge the current time with the difference of update time of this destination node of record whether less than default duration, if, execution in step S607 then, otherwise, execution in step S605.
Step S605 according to position, movement velocity, direction and the elapsed time chosen position server of destination node, and transmits this position enquiring message to it.
Elapsed time is the difference of current time with the update time of the destination node of record.
Select the method for other location servers to be historical position, movement velocity and direction according to destination node, and the current position of time estimation destination node that disappears, the location server that this destination node current location of chosen distance is nearest.
Step S606 sends position response message, reporting errors to the node that sends this position enquiring message.
Step S607 sends the position response message to the node that sends this position enquiring message, announces the position of its destination node.
System of the present invention comprises node, location server Candidate Set determination module, location server module.
Location server Candidate Set determination module, be used for selecting road from automobile self-organized network, selecteed road is divided into one or more roadway segment, select a node as the position candidate server from the node of each roadway segment, all position candidate servers are formed the location server Candidate Set.
Location server Candidate Set determination module is pressed the vehicle flowrate of each road in the automobile self-organized network and the time of selection, selects road from automobile self-organized network; Node in each roadway segment is formed one bunch, from bunch select bunch head of this bunch; With the first location server Candidate Set of forming of all bunches.
The location server module is used for automobile-used self-organizing network is divided into a plurality of zones, for node is selected from the location server Candidate Set corresponding to each regional location server.
The location server module is used hash function node is mapped in each zone after automobile-used self-organizing network is divided into a plurality of zones, makes the mapping position of node in each zone identical with respect to the side-play amount of this regional center; For each zone, from the location server Candidate Set the nearest position candidate server of the mapping position of this node of chosen distance in this zone as described node corresponding to this regional location server.
Node comprises: module 704 is replied in update module 701, position logging modle 702, position enquiring module 703, position.
The structure chart of node as shown in Figure 7.
Update module 701 is used for sending location update message to the location server of node, to upgrade the positional information of the node on the location server.
Update module 701 comprises selects module 711 and sending module 712.
Select module 711, be used for selecting this location server that upgrades from all location servers of node.
In one embodiment, node sends location update message to all location servers of this node, carries out the position and upgrades.
In another embodiment, node selects the part location server of this node to send location update message at every turn, carries out the position and upgrades.Select module 711 to comprise: rank is provided with module 801, rank is selected module 802, upgraded regional determination module 803 and position recorder update module 804, as shown in Figure 8.
Rank is provided with module 801, be used to be provided with Update Level, the renewal priority of the Update Level correspondence that rank is big more is low more, the corresponding position recorder of each Update Level, the initial value of all position recorders all is the initial position of this node, and the renewal threshold value of each Update Level correspondence is set and upgrades area size, the renewal threshold value of the Update Level correspondence that rank is big and upgrade area size respectively greater than the renewal threshold value of the little Update Level correspondence of rank with upgrade area size.
Automobile self-organized network is a rectangle in the present embodiment,
Rank is provided with module 801 and described Update Level is set for from 1 to n, wherein
A and B are the length of side of rectangle, and L is default renewal zone size parameter, and the renewal threshold value of Update Level i is 2
I-1* D, D is default renewal threshold parameter, the renewal area size of Update Level i is with 2
I-1* L is the square of the length of side.
Rank is selected module 802, be used for the distance between node location that computing node current location respectively writes down with each described position recorder, compare the distance of each Update Level correspondence and the renewal threshold value of each Update Level correspondence respectively, more than or equal to the Update Level of selecting the rank maximum the Update Level that upgrades threshold value, the rank of selecteed Update Level is the maximum level of this renewal from calculated distance.
Upgrade regional determination module 803, being used for the node current location is the center, and the renewal area size of selecteed Update Level is a size, determines to upgrade the zone, and the location server that upgrades all nodes in the zone is this location server that upgrades.
Position recorder update module 804 is used for after sending module 714 operation is finished, and the position of the node that writes down in the position recorder of rank smaller or equal to the Update Level correspondence of the maximum level of this renewal is updated to the current location of this node.
Sending module 712, be used to obtain the position of this location server that upgrades, press minimal spanning tree algorithm and generate the message forwarding tree, the root node of message forwarding tree is described node, uses described message forwarding tree and sends location update message to this location server that upgrades.
Comprise in the location update message that node sends: the current current direction of motion and the timestamp of speed, this node of position, this node that this node is current.
Position logging modle 702 is used for when node is the location server of other nodes, the positional information of record corresponding node.
Position logging modle 702 also is used for when node is location server, receives the location update message that sends, and record sends position, movement velocity, the direction of motion and the update time of the node of this updating message.
Position enquiring module 703 is used for selecting the location server of a destination node when node is the communication source node, sends position enquiring message to selecteed location server.
Position enquiring module 703 is selected the nearest location server of this node of location server middle distance of destination node, sends position enquiring message to it.
Module 704 is replied in the position, be used for when described node is location server, the described position enquiring message that reception is sent, whether the positional information of judging record meets the demands, if, then reply the positional information of record, otherwise, described position enquiring forwards is given by other location servers of query node.
After position answer module 704 receives the described position enquiring message of sending, judge the current time with the record by the difference of the update time of query node whether less than default duration, if, then to the node that sends position enquiring message reply record by the positional information of query node; Otherwise, according to the record by the position of query node, movement velocity, the direction of motion and current time difference with update time, from being selected a location server other location servers of query node, transmit this position enquiring message to selecteed location server.
Those skilled in the art can also carry out various modifications to above content under the condition that does not break away from the definite the spirit and scope of the present invention of claims.Therefore scope of the present invention is not limited in above explanation, but determine by the scope of claims.