The content of the invention
The technical problem to be solved in the present invention is for drawbacks described above of the prior art, there is provided one kind can be effectively improved
Message dilivery rate, reduces delivering the opportunistic network immunization method based on bitmap transmissions and system of expense.
The technical solution adopted for the present invention to solve the technical problems is:
A kind of opportunistic network immunization method based on bitmap transmissions is provided, is comprised the following steps:
Node generates and carries the confirmation of opportunistic network corresponding information and simultaneously store, the confirmation include validating that bitmap and
The past message vector, the past message vector are that the past message of a period of time interior efficient message generator generation in system is compiled
Number, the confirmation bitmap is numbering the disappearing after the past message vector of a period of time interior efficient message generator generation in system
Breath delivery situation;
When two nodes meet, adjust the past message vector of two nodes and confirm bitmap, by the past of two nodes
Message vector with confirm bitmap be updated to it is consistent, and according to after renewal confirmation clear up nodal cache in delivered successfully
Message or expired message, then according to select routing forwarding deliver message.
In method of the present invention, the past message vector for adjusting two nodes is specially for consistent:
When two nodes meet, local the past message vector is sent to into other side first;According to the Correspondent Node for receiving
The past message vector adjusts local the past message vector, and the past message vector of final two nodes is up to unanimously.
In method of the present invention, the confirmation bitmap for adjusting two nodes is specially for consistent:In the past message vector
After adjustment is finished, local acknowledgment bitmap is accordingly adjusted if local the past message vector updates, then mutually send acknowledgement bit
Figure, updates local acknowledgment bitmap again according to the confirmation bitmap that other side sends over.
In method of the present invention, if bitmap beginning has the continuous information for confirming to confirming after updating, adjustment is true
Recognize bitmap and update the past message vector.
In method of the present invention, if node successful delivery message or node have received as the destination of message
Message, then update the confirmation bitmap in confirmation.
The present invention additionally provides a kind of opportunistic network immune system based on bitmap transmissions to solve its technical problem, wraps
Include:
Confirmation is generated and memory module, for generating the confirmation of carrying opportunistic network corresponding information and storing,
The confirmation includes validating that bitmap and the past message vector, and the past message vector is a period of time interior efficient message in system
The past message numbering that generator is produced, the confirmation bitmap are the numbering of a period of time interior efficient message generator generation in system
Message dilivery situation after the past message vector;
Confirm information updating module, for adjusting the past message vector of two nodes and confirming bitmap, by two nodes
Confirmation information updating be it is consistent, and according to after renewal confirmation cleaning nodal cache in delivered successful message or
The expired message of person, then according to the routing forwarding message selected.
It is in system of the present invention, described to confirm that information updating module is consistent in the confirmation of two nodes of adjustment
When, specifically for the renewal for first carrying out the past message vector, the past message vector of two nodes is updated to unanimously;Then root
The confirmation bitmap of local node is adjusted according to the past message vector after adjustment.
In system of the present invention, the confirmation information updating module is additionally operable to finish in the adjustment of the past message vector
Afterwards, confirmation bitmap is mutually sent by two nodes for meeting, then updated according to the confirmation bitmap that other side sends over again
Local acknowledgment bitmap.
It is in system of the present invention, described to confirm that information updating module is additionally operable to confirmation bitmap beginning after the adjustment and deposits
In the information of continuous confirmation, adjustment confirms that bitmap simultaneously updates the past message vector.
In system of the present invention, it is described confirmation information updating module be additionally operable in node successful delivery message or
When node have received message as the destination of message, the confirmation bitmap in confirmation is updated.
The beneficial effect comprise that:Single confirmation information decomposition is using confirmation bitmap and the past by the present invention
The two-dimensional model of message vector is stored, and when node meets, local confirmation is sent to other side, then basis
What other side sended over confirms that information updating local acknowledgment information is new confirmation, is cached according to new confirmation information deletion
In delivered successfully or expired message, realize active immune function, substantially reduce general confirmation storage side
The great expense incurred that formula is brought, can effectively improve message dilivery rate, reduce delivering expense.
Specific embodiment
In order that the objects, technical solutions and advantages of the present invention become more apparent, it is below in conjunction with drawings and Examples, right
The present invention is further elaborated.It should be appreciated that specific embodiment described herein is only to explain the present invention, not
For limiting the present invention.
The opportunistic network immunization method based on bitmap transmissions of the present invention, comprises the following steps:
Node generates and carries the confirmation of opportunistic network corresponding information and simultaneously store, the confirmation include validating that bitmap and
The past message vector, the past message vector are that the past message of a period of time interior efficient message generator generation in system is compiled
Number, the confirmation bitmap is numbering the disappearing after the past message vector of a period of time interior efficient message generator generation in system
Breath delivery situation;When node does not meet, if node successful delivery message or node have received as the destination of message
Message, then update the confirmation bitmap in confirmation.After node receives message as destination, the confirmation of message is sent out
Give sender of the message.
When two nodes meet, adjust the past message vector of two nodes and confirm bitmap, two nodes of adjustment are really
It is consistent to recognize information, and according to having delivered successful message or passed through in the confirmation cleaning nodal cache after adjustment
The message of phase, then according to the routing forwarding message selected.
In one embodiment of the present of invention, step " confirmation of two nodes of adjustment is consistent " is specially:
When two nodes meet, local the past message vector is sent to into other side first, and according to the other side's section for receiving
The past message vector of point adjusts local the past message vector, and the past message vector of the node that meets is adjusted to consistent.This
In a bright specific embodiment, concrete grammar is:I-th component in the new the past message vector of node had both taken two nodes
The maximum of i-th component toward message vector.
After the adjustment of the past message vector is finished, if local the past message vector have passed through adjustment, need to accordingly adjust local
The confirmation bitmap of node.This node is being adjusted according to local the past vector really after positioning figure, two nodes for meeting are mutual
Adjusted confirmation bitmap is sent, local acknowledgment bitmap is updated again according to the confirmation bitmap that other side sends over then.
If bitmap beginning has the continuous information for confirming to confirming after updating, adjustment confirms bitmap and updates the past message
Vector.
The present invention stores confirmation using confirmation bitmap and the past message vector, so as to complete active immunity process;This
Invention is based on such a basis:In system, all message generators sequentially number (or numbering is unique), each message generator
The message of generation is sequentially numbered.Each node preserves one and confirms bitmap and the past message vector, when know have message dilivery into
After work(, local confirmation bitmap is updated, if being necessary to be updated the past message vector;When two nodes meet, pass through
First by local the past message vector and confirm that bitmap is sent to other side, realization is met the renewal of node confirmation;Whenever section
After the locally stored confirmation information updating of point, successful message, or expired message have been delivered in cleaning caching, then
Again by predetermined method forwarding message.Obviously, confirm that bitmap is the confirmation relative to previously vector, meet two nodes more
During new confirmation, after needing the past message vector is adjusted to consistent first, and local acknowledgment is updated according to the situation of local adjustment
Bitmap, then mutually sends and confirms bitmap, carries out confirming the renewal of bitmap, reaches the consistent purpose of finish node confirmation,
Then each cached according to new confirmation cleaning.Additionally, confirm bitmap size, and how the dimension of the past message vector sets
It is fixed also extremely important, can be according to the number of system efficient message generator in significant period of time, and message generator
The frequency and nodal cache capacity of the message of generation is designing initial bitmap size and the past message vector dimension size.
1. setting check bitmap and the past message vector.
Confirmation is constituted by confirming bitmap and the past message vector two parts.
In opportunistic network, the coding of message has uniqueness, and the message prefix that same website sends is identical, can be by
It is message coding from big to small according to the sequencing that message is produced.It is efficiently main as realizing using bitmap is confirmed based on this present invention
One of important memory module of dynamic immunization method.Variable-definition is as follows:The confirmation bitmap AckBitMap of given node, its size
For M*N positions, numbers of the wherein M for effective message generator in a very long time in system, N is by message generator in system
The frequency of the message of generation and nodal cache size comprehensively determine that default value can be set to 1024.Message dilivery in system
Situation is corresponding with corresponding bit in bitmap, and bit is that the message dilivery of 1 or 0 expression correspondence coding is successful or unsuccessful.
Based on this, AckBitMap can preserve the delivery situation of continuous 1024 message of M message generator.
Assume in the present invention that the message that same website sends has identical prefix, the priority numbering produced by message,
Number is less, and the time that this message is present in a network is more long, is delivered successfully, or dead probability is higher.The present invention
The past message vector VectorP is defined, the storage of confirmation is simplified by VectorP;VectorP dimensions are M, and M is system
The number of effective message generator in middle a very long time, the past that all message generators of VectorP preservations are produced disappear
Breath numbering, the confirmation of the message before the past message numbering are no longer stored in confirmation bitmap, can give tacit consent to these message
Successful delivery, or as life cycle has terminated " death " in a network;After introducing VectorP, AckBitMap can preserve M
The delivery situation of continuous 1024 message of the numbering that individual message generator is produced after M component of the past message vector.
Original state, in system, each of the AckBitMap of each node is each component of 0, VectorP for 0.
If node known message News (i, j) is delivered successfully, i.e. the node successful delivery message, or node disappears as this
The destination of breath have received the message, the sequence number of message generator wherein in i expressions system, and (i, j) represents disappearing for serial number i
J-th message that breath generator is produced, if not adding the past message vector, the AckBitMap of node presses formula (1) renewal.
AckBitMap (i, j)=1 (0<=i<M,0<=j<N) (1)
System operation delivers to after certain hour, that successful message is more and more, and the numbering of some of which message may
N can be equaled or exceeded, will be optimized to confirming bitmap using the past message vector.
Introduce the past message vector VectorP of node;For message generator i (1<=i<=M) for, will
In VectorP, i-th dimension component is designated as VectorP (i), then all message before VectorP (i) have been delivered, AckBitMap
The confirmation of all message of the middle storage numbering in VectorP after each component.
After adding the past message vector, if node known message News (i, j) is delivered successfully, work as j<During VectorP (i),
The information that node is considered expired is ignored, if VectorP (i)<=j<VectorP (i)+1024, AckBitMap press formula
(2) update.
AckBitMap (i, j-VectorP (i))=1 (0<=i<M,VectorP(i)<=j<N+VectorP(i)) (2)
Known message News (i, j) is delivered successfully, and j>=VectorP (i)+1024, confirmation is beyond current
The scope of AckBitMap and VectorP descriptions, first adjusts VectorP (i), updates further according to the step-length that VectorP (i) is adjusted
AckBitMap (i), finally again by j-th message correspondence position 1;Wherein VectorP (i) is adjusted by formula (3), AckBitMap
I () is updated by formula (4).
VectorPA ' (i)=j-1024+1 (3)
AckBitMap (i, k)=AckBitMap (i, k+VectorP ' (i)-VectorP (i))
(0<=k<1024-(VectorP’(i)-VectorP(i)))
AckBitMap (i, j-VectorP ' (i))=1 (4)
A is defined, the past message vector of B is respectively:VectorP_A, VectorP_B, confirm that bitmap is respectively
AckBitMap_A,AckBitMap_B.As shown in figure 1, working as A, when two nodes of B meet, they first exchange confirmation, i.e. A,
Local confirmation is first sent to other side by B, then according to the confirmation information updating local acknowledgment information for receiving, then basis
Successful message or expired message are delivered in confirmation erasing of information local cache after renewal, finally according still further to choosing
Fixed routing mechanism forwarding message.
The particular flow sheet that confirmation updates is as shown in Figure 3.The past message vector is updated first.As shown in Fig. 2 (a),
The confirmation bitmap of the past message vector and node A before meeting for node A and node B, in one embodiment of the present of invention,
Before updating confirmation, the past message vector is adjusted to consistent by formula (5).
VectorP_A ' (i)=VectorP_B ' (i)=max { VectorP_A (i), VectorP_B (i) } (0<=i<M)
(5)
Shown in the past message vector such as Fig. 2 (b) after node A and node B adjustment.The past message vector adjustment of node
Afterwards, which confirms that bitmap is adjusted by formula (6).
AckBitMap (i, j)=AckBitMap (i, j+VectorP ' (i)-VectorP (i))
(0<=i<M,0<=j<1024-VectorP’(i)-VectorP(i)) (6)
After the confirmation bitmap adjustment of node A as shown in Fig. 2 (c).Local confirmation bitmap is sent to other side by node A, B,
Then local acknowledgment bitmap is updated again according to the confirmation bitmap for receiving.Local acknowledgment information is informed into other side, and root to reach
The purpose of local acknowledgment information is supplemented according to the confirmation that other side sends over.The AckBitMap of A, B is updated by formula (7).
AckBitMap_A '=AckBitMap_B '=AckBitMap_AUAckBitMap_B (7)
May there is the continuous information for confirming in the beginning part in bitmap after renewal, this information can cause the past message
Vector updates, i.e., after updating again confirm bitmap in there may be from start bit the continuous confirmation for starting, show from right
The some message that the message label of previously vector sign starts are answered to deliver successfully;Both can update again according to this category information
Toward message vector and confirmation bitmap.VectorP is adjusted by formula (8), and then confirmation bitmap is adjusted by formula (6).
2. the opportunistic network immunization method based on bitmap transmissions
Based on the opportunistic network immunization strategy of bitmap transmissions, including transmission confirmation, renewal confirmation, according to confirmation
Three aspects of the message of delivery in erasing of information local cache.
Using active transmission mechanism, node is received after message as destination, by the confirmation letter of message for confirmation transmission
Breath is sent to sender of the message.After two nodes meet, local confirmation is sent to into other side.This active immunity mechanism
So that confirmation spread speed than very fast, can have been delivered successful message in deletion of node buffering as early as possible, save in a network
Save caching expense, it is to avoid further consume the limited network bandwidth.
Confirmation updates the renewal for being mainly the past message vector and confirming bitmap.
The past message vector has continuously delivered successful message in describing system, while surviving in also illustrating system
The message that phase is over, after adding the past message vector, the false code of the opportunistic network immunologic mechanism transmitted based on bitmap is such as
Shown in lower.
The opportunistic network immune system based on bitmap transmissions of the present invention, including:
Confirmation is generated and memory module, for generating the confirmation of carrying opportunistic network corresponding information and storing,
The confirmation includes validating that bitmap and the past message vector, and the past message vector is a period of time interior efficient message in system
The past message numbering that generator is produced, the confirmation bitmap are the numbering of a period of time interior efficient message generator generation in system
Message dilivery situation after the past message vector;
Confirm information updating module, for adjusting the past message vector of two nodes and confirming bitmap, and according to adjustment
Successful message or expired message have been delivered in confirmation cleaning nodal cache afterwards, then according to select
Routing forwarding message.
Further, it is described to confirm that information updating module, when the confirmation of two nodes of adjustment is consistent, is specifically used
In the information updating for first carrying out the past message vector, the past message vector of two nodes is updated to unanimously;Then according to tune
The past message vector after whole adjusts the confirmation bitmap of local node.When the past message vector is updated to consistent, specially
I-th component in node new the past message vector is taken into the maximum of i-th component in two node the past message vectors;
If local the past message vector have passed through adjustment, the confirmation bitmap of local node need to be accordingly adjusted.
Further, the confirmation information updating module is additionally operable to after the adjustment of the past message vector is finished, and two are met
Node mutually send confirmation bitmap, local acknowledgment bitmap is updated again according to the confirmation bitmap that other side sends over then.
Further, it is described to confirm that information updating module is additionally operable to confirmation bitmap beginning after the adjustment and there is continuous confirmation
Information when, adjustment confirms that bitmap simultaneously updates the past message vector.
Further, the confirmation information updating module has been additionally operable in node successful delivery message or node as disappearing
When the destination of breath have received message, the confirmation bitmap in confirmation is updated.
It should be appreciated that for those of ordinary skills, can be improved according to the above description or be converted,
And all these modifications and variations should all belong to the protection domain of claims of the present invention.