Summary of the invention
In order to overcome the deficiency that exists in the background technology, the purpose of this invention is to provide a kind of car networking efficient broadcast method of using towards traffic safety, mainly be devoted to solve the efficient broadcast problem of emergency message.Through relative distance information between the direction of motion between source node and destination node (in the same way or oppositely), position relation (destination node is positioned at the place ahead or the rear of source node) and node (relative distance whether in given threshold value) is judged, thereby whether decision transmits emergency message.This broadcasting method utilizes between the car node that vehicle GPS (GPS) obtains real-time positional information to come selective forwarding message; Make message only pass to the node of needs; Not only make the transmission of message more efficient, and help to suppress broadcast storm, improve the utilance of channel.
In order to solve these problems of the prior art, technical scheme provided by the invention is:
A kind of car networking efficient broadcast method towards the actual Secure Application of driving; Vehicle-mounted node not only sends location update message to the vehicle-mounted node of neighbours periodically in the said car networking; Vehicle-mounted node also sends emergency message to the vehicle-mounted node of neighbours when producing accident, it is characterized in that said method comprising the steps of:
(1) source node begins to the destination node broadcast message as the vehicle-mounted node of its neighbours;
(2) after destination node receives this message, judge whether the message that receives is location update message; If the message that receives is location update message then upgrades the information of neighbor nodes table; Otherwise judge that this message is emergency message, and carry out one of following judgement at least:
I) judge according to the difference at two vehicle-mounted node direction angles whether destination node is consistent with the source node direction of motion;
Ii) judge relatively according to node direction angle and coordinate whether destination node is positioned at the source node rear;
Iii) the gps data according to vehicle-mounted node calculates relative distance between two vehicle-mounted nodes, and whether the relative distance of judging destination node and source node is in given distance threshold;
(3) destination node that and if only if is consistent with the source node direction of motion, destination node is positioned at the source node rear and the relative distance of destination node and source node when given distance threshold is set up with three conditions simultaneously, this destination node is just transmitted this message to the vehicle-mounted node of the neighbours of self; Otherwise this destination node directly abandons this message.
Preferably, after destination node receives the message of source node broadcasting, judge according to the message bag whether source node is identical with destination node earlier in the said method step (2); When source node was identical with destination node, this destination node directly abandoned this message; Otherwise whether the message that this destination node receives is the determining step of location update message.
Preferably, after judging that this message is emergency message, judge earlier the record that whether has this message in the destination node in the broadcast sequence table in the said method step (2); When having the record of this message in the broadcast sequence table, this destination node abandons this message; Otherwise this destination node is upgraded broadcast sequence table, carry out then whether destination node consistent with the source node direction of motion, whether destination node is positioned at the source node rear and the relative distance of destination node and source node whether given distance threshold with judgement.
Preferably; In the said method step (3) when destination node is consistent with the source node direction of motion, destination node is positioned at the source node rear and the relative distance of destination node and source node when given distance threshold is set up with three conditions simultaneously; This destination node is carried out delay function earlier and is carried out processing time of delay, and the record that whether has this message in the destination node in the broadcast sequence table is judged in the back of expiring time of delay then; When in the broadcast sequence table in the destination node not during the record of this message, after the message existence jumping figure of this message successively decreased, transmit this message to the vehicle-mounted node of the neighbours of self.
Preferably, after expiring time of delay, have the record of this message in the said method in the destination node in the broadcast sequence table, this destination node abandons this message.
Preferably, delay function is in the said method:
Wherein k is a positive constant, and gets k and make t<2 δ, and d is the relative distance between destination node and source node, and δ is the emission time delay of individual data bag, and this function is output as delay time t, and chronomere is ms.
Preferably, whether consistent judgement comprises the middle destination node of said method step (2) with the source node direction of motion:
A1) if when the difference α of the ground course angle of source node, destination node drops in interval (45 °, 45 °) or (315 °, 359.9 °) or (359.9 ° ,-315 °), represent that the two in the same way;
A2) when the difference α of the ground of source node, destination node course angle drops in interval (225 ° ,-135 °) or (135 °, 225 °), represent that the two is reverse;
(Lng1, Lat1) (Lng2, ground course angle Lat2) is respectively α with destination node B wherein to suppose source node A1And α2, and the difference α=α of the ground course angle of source node, destination node1-α2Absolute value.
Preferably, the judgement that whether destination node is positioned at the source node rear in the said method step (2) comprises:
B1) as 0 °<α1<90 ° or 270 °<α1In the time of<359.9 °, Lat2-Lat1>0 expression B is positioned at the place ahead of A, when Lat2-Lat1<0 expression B is positioned at the rear of A;
B2) in the time of α 1=90 °, Lng2-Lng1<0 expression B is positioned at the place ahead of A, and Lng2-Lng1>0 expression B is positioned at the rear of A;
B3) work as α1In the time of=270 °, Lng2-Lng1>0 expression B is positioned at the place ahead of A, and Lng2-Lng1<0 expression B is positioned at the rear of A;
B4) as 90 °<α1In the time of<270 °, Lat2-Lat1<0 expression B is positioned at the place ahead of A, and Lat2-Lat1>0 expression B is positioned at the rear of A;
(Lng1, Lat1) (Lng2, ground course angle Lat2) is respectively α with destination node B wherein to suppose source node A1And α2
Preferably, the relative distance of destination node and source node comprises with interior judgement at given distance threshold in the said method step (2):
If destination node B and source node A longitude and latitude data (Circular measure) be respectively (rLng1, rLat1), (rLng2, rLat2), then the relative distance D of A, B is:
RLat=rLat1-rLat2 wherein; RLng=rLng1-rLng2; REarthBe earth radius.
The present invention relates to a kind ofly come the efficient broadcast strategy of selective forwarding message according to direction of relative movement between the car node, position relation and relative distance information.The present invention improves the message broadcasting method of routine; Add the criterion that direction of relative movement between ingress, relative position relation and relative distance information are transmitted as broadcasting; Make message only broadcast, make and when suppressing broadcast storm, improve broadcasting efficiency towards the car working application in the zone of needs.
The present invention is conceived to the actual Secure Application communication scenes of vehicle node, optimizes existing broadcast strategy to realize the efficient broadcast of message.Comprise updating message and shocking flash in this agreement, only consistent with the source node direction of motion, be positioned at the source node rear for emergency message when destination node, and the two relative distance is carried out forwards when being no more than given threshold value.
Route layer Radio Broadcasting Agreements is described below:
(1) node sends the location update message bag periodically;
(2) after node is received the shocking flash of application layer, begin broadcast message to neighbours;
(3) receive that the treatment step after the message is following:
A), otherwise change step b if location update message then upgrades the information of neighbor nodes table;
B) if whether emergency message is judged consistent with the source node direction of motion according to the difference at two node direction angles; If then change step c, otherwise abandon this message;
C) relatively judging whether to be positioned at the source node rear according to node direction angle and coordinate, is then to change steps d, otherwise abandons this message;
D) calculate relative distance between two nodes according to gps data, judge that relative distance whether in given distance threshold, is then to transmit this message, otherwise abandons this message.
In the technical scheme of the present invention destination node after receiving emergency message according to the GPS real-time position information judge with source node whether the direction of motion consistent, be positioned at source node rear and relative distance in given threshold value, determine whether to transmit this message then.
Concrete route layer Radio Broadcasting Agreements is described below: node is all nodes transmission location update messages in communication range periodically.Each node is maintenance of neighbor informational table of nodes and broadcast sequence table respectively.The information of neighbor nodes table is used to write down the information such as position, course, ground and speed of neighbor node.The broadcast sequence table is used for the source node ID and the sequence number of recording messages.
(1) after node is received the emergency message of application layer, begins broadcast to neighbours;
(2) receive that the treatment step after the message is following:
If a) source node is identical with destination node, then abandon this message.Otherwise go to step b;
B), otherwise change step c if location update message then upgrades the information of neighbor nodes table;
C) if emergency message; With source node ID and message SN is the sequence table of keyword search broadcast, if the source node ID and the sequential recording of this message are arranged in the table, then abandons this message; And putting message, to abandon flag bit Dflag be 1; Otherwise record information source ID and message SN, it is 0 that Dflag is set, and jumps to steps d;
D) judge that message existence jumping figure whether greater than 0, if greater than 0, then goes to step e, otherwise is committed to processing unit to message, do not transmit.
E) judge whether source, the destination node direction of motion be consistent, if unanimity then change step f, otherwise be committed to processing unit to message, do not transmit.The method of judging is: (Lng1, Lat1) (Lng2, ground course angle Lat2) is respectively α with destination node B to establish source node A1And α2, and note α=α1-α2Absolute value.α representes that the two in the same way when interval (45 °, 45 °) or (315 °, 359.9 °) or (359.9 ° ,-315 °) are middle if the difference of the ground course angle of source, destination node falls; When difference drops in interval (225 ° ,-135 °) or (135 °, 225 °), represent that the two is reverse.
F) judge whether destination node is positioned at the source node rear, and being then changes step g, otherwise be sent to processing unit, do not transmit.Determination methods is: as 0 °<α1<90 ° or 270 °<α1In the time of<359.9 °, Lat2-Lat1>0 (<0) expression B is positioned at the place ahead (rear) of A; Work as α1In the time of=90 °, Lng2-Lng1<0 (>0) expression B is positioned at the place ahead (rear) of A; Work as α1In the time of=270 °, Lng2-Lng1>0 (<0) expression B is positioned at the place ahead (rear) of A; As 90 °<α1In the time of<270 °, Lat2-Lat1<0 (>0) expression B is positioned at the place ahead (rear) of A.
G) according to vehicle-mounted node in the longitude and latitude coordinate Calculation destination node of synchronization and the relative distance d between information source node, judge that whether relative distance is at given distance threshold DMaxIn, if then go to step h, otherwise be committed to processing unit to message, do not transmit.The method of calculating two euclidean distance between node pair is: establish node A, B longitude and latitude data (Circular measure) and be respectively (rLng1, rLat1), (rLng2, rLat2), then the relative distance D of A, B is:
RLat=rLat1-rLat2 wherein; RLng=rLng1-rLng2; REarthBe earth radius.
H) time-delay t (ms), if Dflag is zero, then message existence jumping figure subtracts one, transmits this message then and is committed to processing unit, otherwise abandon.Delay function Delayfun is:
(II); Wherein k is a positive constant, and gets k and make t<2 δ, and d is the relative distance between destination node and information source node, and δ is the emission time delay of individual data bag, and function is output as delay time t, and chronomere is ms.
The invention discloses a kind of car networking efficient broadcast method of using towards traffic safety; With the vehicle GPS locating information as a reference; Through direction of relative movement, relative position between the car node are judged; And calculate relative distance and judge whether to confirm suitable information broadcast territory with interior, realized the efficient broadcast of message, for the transmission of car networked information provides a kind of effective method at given distance threshold.Compared with prior art, the present invention has following significant advantage:
(1) confirms broadcast domain according to direction of relative movement, relative position and relative distance information between node earlier before the broadcast; Guarantee the car node that message only passes to be needed; Make that so not only information broadcast is more efficient, and help to suppress broadcast storm, improve the utilance of channel;
(2) this broadcasting method is specially adapted to the broadcasting of urgent shocking flash, for the space has been expanded in the technological progress of traffic safety application;
(3) direction of motion, relative position between decision node calculate relative distance and have only used location coordinate information and deflection, calculate easy.
Embodiment
Above-mentioned explanation only is the general introduction of technical scheme of the present invention, understands technological means of the present invention in order can more to know, and can implement according to the content of specification, below with preferred embodiment of the present invention and conjunction with figs. specify as after.Below in conjunction with specific embodiment such scheme is further specified.Should be understood that these embodiment are used to the present invention is described and are not limited to limit scope of the present invention.
Embodiment
Be illustrated in figure 4 as the work figure of present embodiment broadcasting method under concrete communication scenes (1).Wherein represent the car node with the band arrow square frame of capitalization English letter sign, arrow is represented the direction of motion; Connect the direction of transfer of solid line (or dotted line) the expression message of two car nodes, solid line is represented the Actual path of forwards.The neighbor node relation of each node is as shown in table 1 below.Each node periodic broadcast location update message, node upgrade the information of neighbor nodes table after receiving the location update message of neighbor node.The A node at a time produces event message MSG among the figure, and it is 3 that message existence jumping figure is set, and message SN is x (message sequence increases progressively generation for circulating according to the order of sequence), broadcasts this message.Neighbor node B, C, G, K and the L of A receive this message, receive that each node is carried out Processing Algorithm after this message, and detailed process is:
The a.K node is because different with the information source node A direction of motion, and the sequence table of renewal broadcast sends a message to processing unit, does not transmit.
The b.L node is to receiving that processing behind the message MSG is with the K node.
C. for the G node,, upgrade the broadcast sequence table, submit to MSG, do not transmit to processing unit because information source node A is positioned at own rear.
D. for the B node, upgrade the broadcast sequence table, submit to MSG to processing unit, putting simultaneously and abandoning flag bit Dflag is 0.Again because be in the A node the rear and with the A node in the same way, carry out delay function delay time Tb
E. for the C node, upgrade the broadcast sequence table, submit to MSG to processing unit, putting simultaneously and abandoning flag bit Dflag is 0.Again because be in the A node the rear and with the A node in the same way, carry out delay function delay time Tc
F. can know according to delay function Delayfun and since the C node to the relative distance of A node greater than the relative distance of B node, so the delay time T of C node to the A nodecDelay time T less than the B nodebThe C node subtracts one with the existence jumping figure of message MSG at time-delay Ta after the time, transmits this message then.The B node has been received the MSG that C transmits in delay time, this moment, B received same message for the second time, and B will be by receiving that the Processing Algorithm after the broadcast abandons message, does not transmit.
By this broadcasting method, the C node is transmitted this message MSG, and its neighbor node A, B, D, J and K will receive this message, but has only the D node to transmit this message MSG.According to above explanation, the event message MSG that A produces will be forwarded through A-C-D-E-F along the road.After message MSG arrives node F, because the existence jumping figure is 0 and no longer transmit.Under this communication scenes, transmit through three times, message MSG effectively is transmitted to node A, B, C, D, E, F, G, I, J, K and L.
Table 1 communication scenes (1) node neighborhood table
The message of car networking broadcasting comprises two types in the present embodiment: the one, with 1 second be the location update message of periodic broadcasting, another kind of is the emergency message of Event triggered.After vehicle-mounted node is received message, if location update message then upgrades the information of neighbor nodes table; If emergency message; Judge successively then whether destination node is consistent with the source node direction of motion, whether be positioned at relative distance between source node rear and source node whether in given distance threshold; If all satisfy, then transmit this message, otherwise abandon this message.To further describe receiving that specifically processing method after the broadcast is done below.
1) when receiving location update message, it is following specifically to upgrade the information of neighbor nodes table algorithm:
S101) be that the information of neighbor nodes table looked in keyword with the node ID, if there is then more new record in nodes records, updating mark position 0x80 changes step S104); Otherwise change step S102).
S102) if routing table less than, then increase a nodes records and updating mark position 0x80, change step S104); Otherwise change step S103).
S103) by using priciple not at most recently, delete one not have the nodes records (being that the updating mark position is 0x00) used at most, and writes the record of new node, while updating mark position 0x80, commentaries on classics step S104).
S104), upgrade and finish with one of the updating mark gt of other records in the routing table.
2) after receiving emergency message, carry out the judgement of direction of relative movement, relative position between the car node and the calculating of relative distance successively.
At first judge the direction of relative movement of two car nodes.The judgement of node direction of relative movement is foundation (span in course, ground is 0.0 ° to 359.9 °) with the difference in course, two node ground.Reference frame is decided to be approximately in the computational process: for just, the west longitude longitude is for negative with the east longitude longitude; The north latitude latitude value is for just, and the south latitude latitude value is for negative, and the ground course angle is reference data with the direct north, and is as shown in Figure 2.
If the deflection of source node a and destination node b is respectively α1And α2, difference α=α when two node direction angles1-α2When interval (45 °, 45 °) or (315 °, 359.9 °) or (359.9 ° ,-315 °), expression node a, b are in the same way; When difference in interval (225 ° ,-135 °) or (135 °, 225 °) time, expression node a, b are reverse.As shown in Figure 3, arrow is represented certain direction of motion vector of node constantly among the figure, and node vectorial span is in the same way therewith represented in the a-quadrant, and the B region representation is the reverse vectorial span of node therewith.If destination node b direction of motion vector drops on the a-quadrant, promptly b and a then carry out next step judgement in the same way, otherwise abandon this emergency message.
After the direction of motion of decision node a, b, carry out the judgement of relative position between node, determine jointly that by deflection and coordinate coordinate is chosen two nodes, and (Longitude Latitude) representes with Circular measure at the gps data of synchronization.If the coordinate of a is that (rLng1, rLat1), the course, ground is α1The coordinate of b is that (rLng2, rLat2), the course, ground is α2Determination methods is following:
1) 0 °≤α1<90 ° or 270 °<α1In the time of≤359.9 °, rLat2-rLat1>0, expression b is positioned at the place ahead of a; RLat2-rLat1<0, expression b is positioned at the rear of a.
2) α1In the time of=90 °, rLng2-rLng1>0, expression b is positioned at the place ahead of a; RLng2-rLng1<0, expression b is positioned at the rear of a.
3) α1In the time of=270 °, rLng2-rLng1<0, expression b is positioned at the place ahead of a; RLng2-rLng1>0, expression b is positioned at the rear of a.
4) 90 °<α1In the time of<270 °, rLat2-rLat1<0, expression b is positioned at the place ahead of a;
RLat2-rLat1>0, expression b is positioned at the rear of a.
And if only if when b is positioned at a rear, carries out next step judgement; Otherwise abandon this emergency message.
Carry out the calculating of relative distance between node at last, adopt following computing formula, promptly a, b relative distance D are:
RLat=rLat1-rLat2 wherein; RLng=rLng1-rLng2; REarthBe earth radius, value is 6378.137 kms.If given distance threshold is DMax, then as D≤DMaxThe time, transmit this emergency message; Otherwise abandon this message.Node receives that the Processing Algorithm flow process after the broadcast sees Fig. 3.
In sum, behind employing the present invention, can select suitable broadcast domain for emergency message, make message can pass to the node of needs efficiently, the broadcast storm problem also can be effectively suppressed simultaneously.This shows that the present invention has substantive technical characterstic and significant technological progress, its application prospect is boundless.
Above-mentioned instance only is explanation technical conceive of the present invention and characteristics, and its purpose is to let the people who is familiar with this technology can understand content of the present invention and enforcement according to this, can not limit protection scope of the present invention with this.All equivalent transformations that spirit is done according to the present invention or modification all should be encompassed within protection scope of the present invention.