RFID anti-collision algorithm based on feedback mechanism
Technical field
The invention belongs to RFID(RF identification) technical field.Relate to RFID based on feedback mechanism under a kind of capture effect
Anti-collision algorithm.
Background technology
Radio RF recognition technology (RFID) is a kind of automatic identification technology, is widely used in logistics, military affairs, traffic, doctor
The fields such as medicine.One basic rfid system mainly includes reader, label and antenna.Each label there is uniquely identified
No. ID, communicated by radiofrequency signal between label and reader.In same rfid system, all labeling task are same
Channel, when there is multiple label in read write line sphere of action, and may have multiple label simultaneously and reader at synchronization
Communicating, now will produce collision between label, reader causes loss of data because can not receive all information simultaneously,
I.e. create the collision between label.
Existing label anti-collision algorithm mainly has two classes: random algorithm based on ALOHA and definitiveness based on tree
Algorithm.When multiple tag responses in the sphere of action of read write line, the label close to read write line is probably due to its signal is stronger
And cover the signal of other labels, thereby produce capture effect.Random algorithm based on ALOHA by randomly choose time slot to
Read write line sends data, and comparatively speaking it cannot be guaranteed that the reliability of whole system, the utilization rate of channel also ratio is relatively low.Based on tree
Algorithm, by conflicting nodes is divided into 0 and about 1 two subset, solves the collision problem in label in an orderly manner, but is knowing
The initial stage in other stage can produce substantial amounts of collision, and the process to capture effect is poor.In practice owing to there is capture
Effect and channel disturbance etc. cause the phenomenon of label skip, clearly can not accomplish whole labels in existing both algorithms
Identification.
Summary of the invention
The main object of the present invention is to provide RFID anti-collision algorithm based on feedback mechanism under a kind of capture effect, in order to
Overcoming tradition anti-collision poor reliability, channel utilization low, due to a large amount of collisions, the distance between label from read write line is different
Etc. cause capture effect process poor, can not accomplish problems such as whole tag recognition.
The solution of the present invention is by being achieved in that: a kind of RFID anti-collision algorithm based on feedback mechanism, this algorithm
Agreement label object includes tandom number generator TC, enumerator GC, label group number memorizer TG, and read write line object includes currently looking into
Asking dimension RN, organize number GN, this algorithm steps also includes:
Step 1) labeled packet: read write line sends Req (GN) order, GN=15 time initial, it is random that label utilizes in label
Number producer TC generates the random number between 0-GN, is then saved in by the random number generated in label group number memorizer TG,
The value of TG is the group number at label place, and label is randomly divided into GN+1 group, and i.e. 16 groups, the label that group number is " 0 " is entered by read write line
Row identifies, after completing the identification organizing " 0 ", group number is all subtracted one more than the label of " 0 " by remaining group number, then starts next round to newly
The identification of " 0 " group label.
Step 2) interior point of dimension identification of set of tags: first read write line initializes current queries dimension RN, transmission querying command Req
(X, RN), the corresponding relation of foundation label prefix and enumerator GC is to GC assignment, and then read write line receives data GC value, and transmission is looked into
Ask order Request (X, RN, gc), last read write line detection collision situation, close according to the judgement of data collision with label prefix
System obtains command parameter, it is judged that storehouse.
Step 3) tag feedback identification: first read write line obtains [M/V], makes GN=[M/V]-1 and feeds back to label, so
Random number between rear label generation 0-GN, as label group number, is stored in label group number memorizer TG, and selecting group number is the mark of 0
Signing response, finally detect collision situation, algorithm terminates.
Further explaining as the present invention, described label its No. ID is by non-" 0 " the i.e. binary system hyte of " 1 "
Becoming, the most every for its ID four binary digits are divided into one-dimensional by each label.
As a further improvement on the present invention, described step 2) a point dimension identifies that it identifies that process steps includes in set of tags:
Step 2-1, read write line initializes current queries dimension RN=1, inquires about prefix X=null, when X is null, group number
Be 0 label the most corresponding.
Step 2-2, sends querying command Req (X, RN), RN, X informing, label, label detect the number of " 1 " in its RN
And position relationship, according to the corresponding relation of label prefix and enumerator GC to GC assignment, and to read write line feedback representation GC value
Information sequence.
Step 2-3, read write line receives data GC value, by stacked for GC value, X, the RN known, and obtains stack top element.
Step 2-4, sends querying command Request (X, RN, gc) and requires prefix to mate with X and the label return of GC=gc
Its RN dimension and later data thereof.
Step 2-5, read write line detection collision situation, if generation collision and RN are not the most one-dimensional, then according in inquiry dimension
The judgement relation of data collision and label prefix, obtain the label prefix that there is currently and by prefix, current GC value and looking into
Ask dimension RN=RN+1 stacked, obtain stack top element, return step 2-2;If collisionless or RN are the most one-dimensional, then Direct Recognition
Label also forwards step 2-6 to after being shielded.
Step 2-6, it is judged that storehouse, if storehouse is empty, then goes to step 2-7;If not empty, then use and retreat strategy, from
Storehouse obtains stack top element, returns step 2-4.
Step 2-7, if storehouse is empty, group number is all subtracted one, owing to the group number of skip is more than the label of " 0 " by remaining group number
The label of " 0 " keeps group number " 0 " constant, then is identified new " 0 " group label, returns step 2-1;If all label group numbers
Be empty for " 0 " and storehouse, then end step 2).
Further explaining as the present invention, its identification process steps of described step 3) tag feedback identification includes:
Step 3-1,16 groups of label informations of read write line identified feed back, and obtain and identify label in 16 groups
Maximum number M and average V, obtains [M/V], makes GN=[M/V]-1, sends order Req (GN).
Step 3-2, the random number between label generation 0-[GN], as label group number, is stored in label group number memorizer TG
In, the label response that read write line selects group number to be " 0 ".
Step 3-3, group number is that the label of " 0 " produces " 0 ", " 1 " random number, the label response selecting random number to be " 0 ".
Step 3-4, detects collision situation, if producing collision, then its random number is added one by the label of random number non-" 0 ", with
Machine number is that the label of " 0 " regenerates " 0 ", " 1 " random number, returns step 3-4, again detects collision situation;If only one of which
Label responds, then identify label and shielded backward its ID of other tag feedback, going to step 3-5;If responding without label, then
Read write line requires that Unidentified label returns its random number, the data that detection receives, if there being label to respond, goes to step 3-5;
If returning its random number without label, then go to step 3-6.
Step 3-5, random number is subtracted one by the label of random number non-" 0 ", returns step 3-4.
Step 3-6, all label group numbers are " 0 ", then terminate whole identification process;Otherwise the label of group number non-" 0 " is by group
Number subtracting one, reselection group number is that the label response of " 0 " returns step 3-3.
As the further restriction of the present invention, described step 2) in the corresponding relation of label prefix and enumerator GC be GC
When=1, label prefix is 0,001 0,010 0,100 1000;During GC=2, label prefix is 1,010 1,001 1100;During GC=3, mark
Signing prefix is 0,111 1,011 1,110 1101;During GC=4, label prefix is 0,000 1111;During GC=5, label prefix is 0011
0110 0101。
As the further restriction of the present invention, described step 2) in the judgement relation of data collision and label prefix be:
In GC=1, only one of which binary digit is 1, if a certain position collides, the most respectively by this position of collision 1, remaining
Position 0, obtains label prefix present in current queries dimension successively.
In GC=3, only one of which binary digit is 0, if a certain position collides, the most respectively by this position of collision 0, remaining
Position 1, obtains label prefix present in current queries dimension successively.
During in GC=4, only current queries is tieed up, prefix is the label of 0000 or 1111, if colliding, i.e. illustrates simultaneously
Have 0000 and 1111.
In GC=2, the number of 1 is 2, but leftmost bit is 1, if a certain position collides, the most respectively corresponding collision
Position 1, remaining position 0, obtain label prefix present in current queries dimension successively.
In GC=5, the number of 1 is 2, but leftmost bit is 0, if a certain position collides, the most respectively corresponding collision bit
Set to 0, remaining position 1, obtain label prefix present in current queries dimension successively.
The present invention possesses good result and substantial advance: decrease the too much collision of identification initial stage generation, by marking
Label carry out a point dimension and identify, accelerate label and produce processing speed when colliding, and under the same conditions, label produces place during collision
Reason speed averagely improves about 25%, and recognition time averagely reduces about 28%, greatly reduces recognition time;Consider simultaneously and catch
The label skip problem obtaining effect and channel disturbance etc. and produce, feeds back identified label information, and discrimination is average
Bring up to more than 99%, substantially increase the discrimination of label.
Accompanying drawing explanation
Fig. 1. point dimension identification step algorithm flow chart in labeled packet of the present invention and set of tags.
Fig. 2. tag feedback identification step algorithm flow chart of the present invention.
Detailed description of the invention
Describing the present invention below in conjunction with embodiment and accompanying drawing, these describe not is that present invention is made further limit
Fixed.In embodiment, algorithm agreement label object includes tandom number generator TC, enumerator GC, label group number memorizer TG, read-write
Device object includes current queries dimension RN, organizes number GN.
Embodiment 1
(1) step 1) labeled packet: produce substantial amounts of collision because number of labels is too much for reducing the cognitive phase initial stage, first
First label is carried out random packet.In the present invention, read write line sends order Req (GN), GN=15, label utilize in label with
Machine number producer TC generates the random number between 0-15, and then the random number generated is saved in label group number memorizer TG
In, the value of TG is the group number at label place.The label that read write line selects group number to be 0 is identified.
(2) step 2) interior point of dimension identification of set of tags: an employing point dimension recognizer in group.Its idiographic flow such as Fig. 1 institute
Showing, algorithm is divided into the following steps:
1) tag ID is made up of the non-zero binary digit of i.e. 1, one label of unique mark, and the left side is high-order.First label will
Its ID every four binary digits from a high position to low level are divided into one-dimensional, thus label can be divided into some dimensions, such as 1, and 2,3-dimensional.Such as
Tag ID is 0100110001111110, then can be divided into the four-dimension, wherein the 1st, 2,3,4 dimensions be 0100 respectively, 1100,
0111、 1110 。
2) read write line initializes current queries dimension RN=1, inquires about prefix X=null, and as X=null, group number is the institute of 0
Label is had all to respond.
3) send querying command Req (X, RN), X, RN are informed label;Read write line according to RN tie up in 1 number and position
Put relation, to GC assignment and anti-to read write line with the corresponding relation (such as table 1) of enumerator GC according to the label prefix in inquiry dimension
Feedback represents the information sequence of GC value.
1. the label prefix in inquiry dimension is as follows with the relation of GC: such as the RN dimension data of current queries label, label the
In RN dimension, the number of 1 is respectively 1 and 3, then corresponding GC is respectively 1 and 3;The number of 1 is 0 or 4, then GC=4;The number of 1 is 2
And highest order is 1, then GC=2,;The number of 1 is 2 and highest order is 0, then GC=5.
2. label sends the regular as follows of GC value to read write line: label by GC value with a length of 5 binary representation, with 1
The value of positional representation GC.Such as the GC=4 of label, then the data that label sends are 01000.
Label prefix in table 1. inquiry dimension and the corresponding relation of enumerator GC
|
GC=1 |
GC=2 |
GC=3 |
GC=4 |
GC=5 |
Label prefix |
0001 0010 0100 1000 |
1010 1001 1100 |
0111 1011 1110 1101 |
0000 1111 |
0011 0110 0101 |
4) read write line receives data, will know that the GC value of existence, X, RN are stacked, obtains stack top element.
5) querying command Request (X, RN, gc) is sent, it is desirable to prefix is mated with X and the label of GC=gc returns its RN
Dimension and later data thereof;Such as X=0100, gc=3, RN=1, then require that label prefix is 0100 and the label of enumerator GC=3 returns
Return its 1st dimension and the 1st and tie up later data.
6) read write line detection collision situation, if generation collision and RN are not the most one-dimensional, then touches according to the data of inquiry dimension
Hit the judgement relation with label prefix, obtain the label prefix that there is currently and by prefix, current GC value and inquiry dimension RN=RN
+ 1 is stacked.Obtain stack top element, return 3);If collisionless or RN are the most one-dimensional, then Direct Recognition label being shielded, turn
To 7).
The data collision of dimension is as follows with the judgement relation of label prefix:
A: because only that bit is 1 in GC=1, if so a certain position collides, touched this most respectively
Hit a set, remaining reset, obtain label prefix present in current queries dimension successively.As in GC=1, read write line is examined
The situation measuring collision bit is xxx0, then explanation exists prefix 1000,0100,0010 prefix.
B: because only that bit is " 0 " in GC=3, if so a certain position collides, the most respectively should
Collision bit reset, remaining set, obtain label prefix present in current queries dimension successively.As in GC=1, read write line
Situation collision bit being detected is xxx0, then explanation exists prefix 1000,0100,0010 prefix.
C: in GC=4, because only that in current queries dimension, prefix is the label of 0000 or 1111, so if it occur that touching
Hit, i.e. xxxx, then illustrate to have 0000 and 1111 simultaneously.
In D:GC=2 and GC=5, the number of " 1 " is 2, and difference is that highest order is " 0 " or " 1 ".In GC=2, the highest
Position is " 1 ", and because the number of " 1 " is 2, if so a certain position collides, the most respectively corresponding position of collision
" 1 ", remaining reset, obtain label prefix present in current queries dimension successively.As, in GC=2, read write line receives
Data are 1x0x, then the prefix existed is 1100, and 1001.
E: in GC=5, in the dimension inquired about, highest order is " 0 ", because the number of " 1 " is 2, if so a certain
Position collides, and the most respectively corresponding collision bit reset, remaining set, obtains the prefix that there is currently successively.
7) if storehouse is empty, then 8 are gone to);If not empty, then use and retreat strategy, from storehouse, obtain stack top element,
Return 5).
8) if storehouse is empty, group number is all subtracted one, due to the mark that group number is " 0 " of skip by remaining group number label more than 0
Sign and keep group number " 0 " constant, then 0 group of new label is identified, return 2-2;If all label group numbers are 0 and storehouse is
Sky, then end loop.
(3) step 3) tag feedback identification, its idiographic flow is as in figure 2 it is shown, specifically include following steps:
1) 16 groups of label informations of read write line identified feed back, and obtain the maximum number identifying label in 16 groups
M and average V, obtains [M/V], makes GN=[M/V]-1 and feeds back to label, makes GN=[M/V]-1, and read write line sends order
Req(GN);Such as also having 6 labels unrecognized because of the impact such as capture effect or channel disturbance, read write line obtains the ratio of M and V
Value is 2, then GN=[M/V]-1=1 feeds back to this 6 unrecognized labels.
2) label produces the random number between 0-GN, and is stored in TG as group number by random number, and selecting group number is the mark of 0
Sign response;Assuming that in these 6 labels, the group number of tagA, tagB, tagC is " 0 ", the group number of tagD, tagE, tagF is " 1 ",
The most first identify tagA, tri-labels of tagB, tagC.
3) group number is label generation " 0 ", " 1 " random number of 0, the label selecting random number to be " 0 " response;TagA herein,
TagB, tagC produce " 0 " or " 1 " random number respectively, it is assumed here that tagA and tagB produces random number " 0 ", and tagC produces
Random number " 1 ", then tagA and tagB returns himself ID to read write line simultaneously.
4) detection collision situation, if producing collision, then its random number is added 1 by the label of random number non-" 0 ", and random number is
The label of " 0 " regenerates " 0 ", " 1 " random number, returns 4), again detect collision situation;If only one of which label responds, then
Identify label and shield backward its ID of other tag feedback, going to 5);If responding without label, the most then read write line requires Unidentified
Label returns its random number, the data that detection receives, if there being label to respond, goes to step 5);If it is random to return it without label
Number, then go to 6);It is assumed here that owing to tagA is close to read write line, although transmit data with tagB simultaneously, but because of the letter of tagA
Number relatively strong, cover the signal of tagB, collision should be produced the most in theory, and now become readable time slot.Read write line identification
The information of complete tagA after being shielded, feeds back to remaining label by the ID of tagA, and tagB finds self after receiving feedback signal
ID do not mate with it, learn that oneself information is by skip.
5) random number is subtracted one by the label of random number non-" 0 ", returns 4);Here the random number of tagB is constant, tagC with
Machine number subtracts one, is then back to 4), read write line receives the data of tagB and tagC again, detects collision situation.It is assumed here that without dry
Disturbing or the impact of capture effect, tagB and tagC creates collision.Because its random number is " 0 ", then regenerate random number " 0 "
Or " 1 ", as tagB produces " 0 ", and tagC produces " 1 ", then next time slot receives the information being identified of tagB and shields
After, the random number of tagC subtracts one, then communicates with read write line.
6) all label group numbers are " 0 ", then terminate whole identification process;Otherwise group number is subtracted one by the label of group number non-zero,
Reselection group number is the label response return 3 of " 0 ");Here tagD, the group number of tagE, tagF uses same method to open after subtracting one
The identification to these three label of the beginning next round.
This embodiment reduces the too much collision of identification initial stage generation, identifying by label being carried out a point dimension, accelerating mark
Signing processing speed when producing collision, under the same conditions, processing speed when label produces collision averagely improves about 25%,
Recognition time averagely reduces about 28%, greatly reduces recognition time;Consider capture effect and channel disturbance etc. simultaneously and produce
Raw label skip problem, feeds back identified label information, and discrimination averagely brings up to more than 99%, is greatly improved
The discrimination of label, has marked improvement and a substantive distinguishing features.
Finally illustrating, above example is only in order to illustrate technical scheme and unrestricted.Although with reference to real
Execute example the present invention has been described in detail, it will be understood by those within the art that, technical scheme is entered
Row amendment or equivalent, without departure from the spirit and scope of technical solution of the present invention, it all should contain the power in the present invention
In profit requires.