Background technology
Radio-frequency (RF) identification (RFID) is a kind of low-power consumption, the in-plant communication technology.As one of recognition technology of tool potentiality, REID has become the research focus of IT field.
The recognition principle of radio-frequency (RF) identification is to utilize inductive coupling (Inductive Coupling) or back scattering (Backscatter), realizes the information transmission between label and the reader.Communication frequency between reader and the label mainly concentrates on low frequency (135KHz is following), high frequency (13.553~13.567MHz), and ultrahigh frequency (400~1000MHz), microwave frequency ranges such as (2.45GHz).Simple radio-frequency recognition system is made of label, reader, application software usually.In the present invention, described label is made of coupling element and chip, and a unique sign (ID number) is all arranged in each label.
In application; run into the situation that a plurality of labels and same reader communicate through regular meeting; when a plurality of labels respond the querying command of reader simultaneously, send ID number of label self to reader after, reader can't obtain correct information from the response of receiving.That is to say, in the communication process of label and reader, can run into the problem of communication contention aware.In addition, the collision problem that in communication process, also has Channel Sharing.If there is not corresponding contention resolution, will inevitably cause conflict, cause a plurality of labels can't correctly be distinguished or take place the skip phenomenon.
The solution of conflict just provides a kind of mechanism, makes between reader and the label and works harmoniously, and making reader read a plurality of labels simultaneously becomes possibility.
Existing radio-frequency (RF) identification contention resolution can be divided into based on Aloha with based on binary tree (BinaryTree) two big classes.The Aloha protocol suite can be divided into pure Aloha, time slot A loha (Slotted Aloha), frame one time slot Aloha (Frame-Slotted Aloha) again.
The operation of pure Aloha method is very simple, when label receives the querying command of reader, just sends data immediately, if clash, then waits for one section with retransmitting the colliding data bag after captain's time.
In the time slot A loha method, the time is divided into the discrete time period, and each time period is called a time slot, and its size equals to send a frame required time.Label only each time slot begin the place can send data.If clash, then retransmit the colliding data frame at next time slot.
Frame one time slot Aloha in order further to reduce the frequency of label response reader querying command, reduces unnecessary conflict and takes place, and on the basis of time slot A loha, organizes the communication of label to reader according to the form of frame.Each frame is made up of some time slots, and label selects a time slot to send data according to the principle of time slot A loha at random in each frame, if conflict, label must be waited for the arrival of next frame, could continue to send data.
The binary tree contention resolution is based on the binary tree agreement in the legacy network, and the label that clashes generates conflict with the principle of throwing coin and solves tree, by " reader is first talked about " mechanism and Management Information Base, label is kept synchronously and division.Another is " by turn " search algorithm by the binary tree deformation algorithm that rfid system extensively adopts.Protocol implementation is: reader begins to inquire about by turn the ID position of all labels to be identified from label ID number most significant digit, as what return is one group 0 or one group 1, then reader is preserved this position, comprise 0 and 1 simultaneously as return results, represent that then tag recognition clashes, reader preserves 0, selection is returned as 0 label continuation inquiry, enter slumber and be returned as 1 label, reader sends the order of resetting after successfully identifying a label, wake the label of being sunk into sleep up, repeat aforesaid identifying then.This agreement implementation is a definite process, as label ID number be the n position, then discern labeling requirement and send n querying command, be nk for k the total inquiry times of label.
The advantage of Aloha method be realize simple relatively, but its theoretical performance is not as the binary tree contention resolution, but the binary tree contention resolution is to synchronous having relatively high expectations, realize comparatively difficulty, for inquiring about binary-tree method by turn, reader is every successfully inquires about a label, needs to repeat n (n=ID length) inferior position inquiry, thereby exists identification to postpone length, tag logic function complexity, position transmission frequently and problems such as information leakage.
Summary of the invention
Purpose of the present invention overcomes inquires about in the binary-tree method existing identification by turn and postpones length, tag logic function complexity, position transmission frequently and shortcomings such as information leakage, and a kind of solution of quick, easy multi-label collision is provided.
To achieve these goals, the invention provides the solution of multi-label collision in a kind of radio-frequency recognition system, specifically may further comprise the steps:
1), reader sends initialization command, activation and initialization label;
2), reader is to all labels to be identified, from a high position to the low level, inquire about and write down each value of tag identifier successively, and judge whether each tag identifier is identical in this value, if difference promptly clashes, with designated character mark conflict position, otherwise, write down this original value, inquired about all the position after, Query Result is preserved;
3), reader from a high position, does replacement to each conflict position with 0,1 to the conflict position in the Query Result, and does identification to replacing the result, sends corresponding instruction according to the result who discerns to label;
4), after label receives instruction,, between each state, do conversion, solve the conflict of many labels according to the current state of label and the information of instruction.
In the technique scheme, in the described step 1), the initialization label is that the stack counter of label is clear 0, and changes active state over to.
In the technique scheme, in the described step 3), replacement is done in the conflict position, the process that the result is replaced in identification specifically may further comprise the steps:
3-1, reader are with step 2) Query Result that obtains gives a string, and should string with the S mark;
3-2, the designated character of the highest conflict position of S of will going here and there are alternative with 0 and 1, obtain two different strings, respectively with S0 and S1 sign, wherein, S0 is that S1 replaces the resulting string of the highest conflict position designated character with 1 with the resulting string of the highest conflict position designated character of 0 replacement;
Whether the current the highest conflict position among 3-3, the judgement string S is last bit swiping position, if, forward step 3-4 to, otherwise, forward step 3-5 to;
3-4, S0 and S1 are exactly the sign of two labels to be identified, send " sleep command " to the label that is identified, and label changes dormant state over to, forwards step 3-8 then to;
3-5, the value of S0 of will going here and there are composed to S, and the S1 that will go here and there is stacked, and send " stacked order ", forward step 3-6 then to;
3-6, get the next one conflict position among the S, execution in step 3-7;
3-7, the current conflict position of all labels is sent " position querying command ", return a Query Result, according to return results, judge whether to clash, if clash, forward step 3-2 to, if return results does not clash, then return results is kept at the correspondence conflict position of string S, judge then whether current conflict position is last bit swiping position, if, the S that then goes here and there is exactly the identification number of label, preserves S and sends " sleep command ", changes step 3-8 then over to, if current conflict position is not last bit swiping position, then forward step 3-6 to;
3-8, judge that whether current stack is empty, if non-NULL, then reader sends " order of popping ", and the stack top string is popped, and composes and give S, and current conflict position is converted to the highest conflict position of S, and then execution in step 3-7, if be sky, the entire identification process end.
In the technique scheme, in the described step 4), described state comprises original state, active state, blocked state and dormant state, and in any moment, label can only be in a certain state wherein.
In the technique scheme, in the described step 4), after described label is received instruction,, between each state, do conversion, specifically comprise according to the information of current state and instruction:
4-1, label are received " position querying command ", if the stack counter equals 0, then according to the address information of " position querying command " indication, send this value to reader, if the stack counter, does not then respond " position querying command " greater than 0;
4-2, label are received " stacked order ", if the stack counter equals 0, then judge the value of the position that address information that " stacked order " carry is indicated, if the value of this position equals 0, then the stack Counter Value adds 1, and label changes blocked state over to, if the value of this position is 0, label still remains on active state; If the stack counter is greater than 0, then the stack Counter Value adds 1, and label still remains on blocked state;
4-3, label are received " order of popping ", and greater than 0, then the stack counter subtracts 1 as if the stack counter, if the result that the stack counter subtracts after 1 equals 0, then label changes active state over to, otherwise label still remains on blocked state;
4-4, label are received " sleep command ", and the stack counter equals 0, and then label changes dormant state over to, and after this label no longer responds any order except " initialization command ".
The invention has the advantages that:
1, the position inquiry times obviously reduces, because reader utilizes stack to preserve the historical information in the identifying, utilize the historical identifying information that has obtained, reader can be skipped the position of having discerned, only inquire about, thereby reduced the position inquiry times at the conflict position;
2, minimizing is discerned and is postponed, owing to obviously reduced the position inquiry times that repeats, the data of label loopback are minimizing thereupon also, thereby has reduced the identification delay of reader;
3, reduce the label power consumption, the present invention can obviously reduce the data traffic volume of label and the contention resolution complexity in tab end, thereby has reduced the power consumption of label;
4, there is not the information leakage problem,, avoided by turn in the binary tree conflict resolution algorithm problem, the problem includes: the information leakage problem because reader does not need to broadcast each information of label in whole query script;
Purpose of the present invention overcomes inquires about in the binary-tree method existing identification by turn and postpones length, tag logic function complexity, position transmission frequently and shortcomings such as information leakage, and a kind of solution of quick, easy multi-label collision is provided.
To achieve these goals, the invention provides the solution of multi-label collision in a kind of radio-frequency recognition system, specifically may further comprise the steps:
1), reader sends initialization command, activation and initialization label;
2), reader is to all labels to be identified, from a high position to the low level, inquire about and write down each value of tag identifier successively, and judge whether each tag identifier is identical in this value, if difference promptly clashes, with designated character mark conflict position, otherwise, write down this original value, inquired about all the position after, Query Result is preserved;
3), reader from a high position, does replacement to each conflict position with 0,1 to the conflict position in the Query Result, and does identification to replacing the result, sends corresponding instruction according to the result who discerns to label;
4), after label receives instruction,, between each state, do conversion, solve the conflict of many labels according to the current state of label and the information of instruction.
In the technique scheme, in the described step 1), the initialization label is that the stack counter of label is clear 0, and changes active state over to.
In the technique scheme, in the described step 3), replacement is done in the conflict position, the process that the result is replaced in identification specifically may further comprise the steps:
3-1, reader are with step 2) Query Result that obtains gives a string, and should string with the S mark;
3-2, the designated character of the highest conflict position of S of will going here and there are alternative with 0 and 1, obtain two different strings, respectively with S0 and S1 sign, wherein, S0 is that S1 replaces the resulting string of the highest conflict position designated character with 1 with the resulting string of the highest conflict position designated character of 0 replacement;
Whether the current the highest conflict position among 3-3, the judgement string S is last bit swiping position, if, forward step 3-4 to, otherwise, forward step 3-5 to;
3-4, S0 and S1 are exactly the sign of two labels to be identified, send " sleep command " to the label that is identified, and label changes dormant state over to, forwards step 3-8 then to;
3-5, the value of S0 of will going here and there are composed to S, and the S1 that will go here and there is stacked, and send " stacked order ", forward step 3-6 then to;
3-6, get the next one conflict position among the S, execution in step 3-7;
3-7, the current conflict position of all labels is sent " position querying command ", return a Query Result, according to return results, judge whether to clash, if clash, forward step 3-5 to, if return results does not clash, then return results is kept at the correspondence conflict position of string S, judge then whether current conflict position is last bit swiping position, if, the S that then goes here and there is exactly the identification number of label, preserves S and sends " sleep command ", changes step 3-8 then over to, if current conflict position is not last bit swiping position, then forward step 3-6 to;
3-8, judge that whether current stack is empty, if non-NULL, then reader sends " order of popping ", and the stack top string is popped, and composes and give S, and current conflict position is converted to the highest conflict position of S, and then execution in step 3-7, if be sky, the entire identification process end.
In the technique scheme, in the described step 4), described state comprises original state, active state, blocked state and dormant state, and in any moment, label can only be in a certain state wherein.
In the technique scheme, in the described step 4), after described label is received instruction,, between each state, do conversion, specifically comprise according to the information of current state and instruction:
4-1, label are received " position querying command ", if the stack counter equals 0, then according to the address information of " position querying command " indication, send this value to reader, if the stack counter, does not then respond " position querying command " greater than 0;
4-2, label are received " stacked order ", if the stack counter equals 0, then judge the value of the position that address information that " stacked order " carry is indicated, if the value of this position equals 0, then the stack Counter Value adds 1, and label changes blocked state over to, if the value of this position is 0, label still remains on active state; If the stack counter is greater than 0, then the stack Counter Value adds 1, and label still remains on blocked state;
4-3, label are received " order of popping ", and greater than 0, then the stack counter subtracts 1 as if the stack counter, if the result that the stack counter subtracts after 1 equals 0, then label changes active state over to, otherwise label still remains on blocked state;
4-4, label are received " sleep command ", and the stack counter equals 0, and then label changes dormant state over to, and after this label no longer responds any order except " initialization command ".
The invention has the advantages that:
1, the position inquiry times obviously reduces, because reader utilizes stack to preserve the historical information in the identifying, utilize the historical identifying information that has obtained, reader can be skipped the position of having discerned, only inquire about, thereby reduced the position inquiry times at the conflict position;
2, minimizing is discerned and is postponed, owing to obviously reduced the position inquiry times that repeats, the data of label loopback are minimizing thereupon also, thereby has reduced the identification delay of reader;
3, reduce the label power consumption, the present invention can obviously reduce the data traffic volume of label and the contention resolution complexity in tab end, thereby has reduced the power consumption of label;
4, there is not the information leakage problem,, avoided by turn in the binary tree conflict resolution algorithm problem, the problem includes: the information leakage problem because reader does not need to broadcast each information of label in whole query script;
5, instruction is simple, is easy to realize that because the instruction that the present invention comprises is few, tag state is simple, and to take resource few for label in the identifying, thereby be easy to realize having good practical value.
Embodiment
The present invention is described in further detail below in conjunction with accompanying drawing and embodiment.
In the radio-frequency recognition system of the present invention the solution of multi-label collision may further comprise the steps, and wherein, Fig. 1 has represented in the inventive method that step 40 is to the performing step of step 80:
Step 10, with label energising, make it to be in init state.
Step 20, reader send " initialization command ", and after label received this order, counter (count) zero clearing changed active state then over to.The meaning of counter O reset is to guarantee that each label all is in active state when initial, can respond the querying command of reader.When label is in active state, can send information to reader, when other states, the operation that then can not execution information sends.
Step 30, reader send " position querying command ", inquire about the ID position of all labels from a high position to the low level by turn.The process of inquiry tag ID position as shown in Figure 2, if when inquiry k position, what return is one group 0, then preserving this position is 0, if a group 1 of returning, also preserving this position is 1, but if in the binary digit that returns, have 0 and 1 simultaneously, then there is conflict in each label in this position, preserves this position and is x.After whole position query manipulation finished, reader obtained one by some 0,1 and the string S that forms of x, and string is long identical with the figure place of label.By S, reader can determine that there is conflict in which position.Obtain going here and there behind the S, carry out next step.
There is a conflict bit pointer in step 40, the reader, is used to indicate current conflict position.First x position with among the conflict bit pointer sensing S changes step 50 over to.
Step 50, replace current conflict position with 0 and 1, produce corresponding string S0 and S1, and judge whether last bit swiping position, conflict bit pointer current conflict position pointed, if then no matter current conflict all can determine to exist two labels in which position of going here and there S.The ID position of these two labels is except when outside the difference of preceding conflict position, and all the other everybody all identical, and therefore, reader can identify two labels simultaneously, and promptly S0 and S1 are exactly ID number of conflict label as can be known to need not further inquiry.Preserve S0 and S1 and send " sleep command ", change step 80 then over to.If current conflict position is not last bit swiping position, then give S with the S0 assignment, transmission " stacked order ", and it is stacked to go here and there S1, changes step 60 then over to.
Step 60, conflict bit pointer point to the next x position of S.
Step 70, conflict bit pointer current conflict position pointed is sent " position querying command ", all labels to be identified that are in active state to " position querying command " specified do inquiry, return Query Result.Judge whether return results clashes,, then change step 50 over to if clash; If return results does not clash, then return results is kept at the corresponding position of string S, judge then whether conflict bit pointer current conflict position pointed is last bit swiping position of string S, if, the S that then goes here and there is exactly ID number of label, preserve S and send " sleep command ", change step 80 then over to.If current conflict position is not last bit swiping position, forward step 60 to.
Step 80, judge that whether current stack is empty, if non-NULL, then reader sends " order of popping ", and the stack top string is popped, and composes and give S, and the conflict bit pointer points to first conflict position of S, changes step 70 over to, if be empty, and the entire identification process end.
In tag recognition process of the present invention, relate to a plurality of operational orders, these orders are sent by reader, under the operation of these orders, each label is changed between different conditions, its transfer process describes the transfer process of tag state and the concrete function of operational order as shown in Figure 3 below.
1), after label powers on, is in original state;
2), after label receives " initialization command ", the zero clearing of label counting device changes active state then over to;
3), label receives " position querying command ", if current state is an active state, then according to " position querying command " indicated address information, sends this information to reader, the label that is in other state will not respond " position querying command ";
4), label receives " stacked order ", in stacked order.If the label current state is an active state, then label is judged the information of address bit indicated in " stacked order ", if this position equals 1, then label count adds 1 and change blocked state over to, if this position equals 0, then label still remains on active state, if the label current state is a blocked state, then count adds 1 and still remain on blocked state.The label that is in other state will not respond " stacked order ".
5), label receives " order of popping ".If the label current state is a blocked state, then count subtracts 1, if the result who subtracts after 1 equals 0, then label changes active state over to, otherwise label still remains on blocked state.The label that is in other state will not respond " order of popping ";
6), label receives " sleep command ".If the label current state is an active state, then label changes dormant state over to, and the label of dormant state only responds " initialization command ", and the label that is in dormant state changes active state over to after receiving " initialization command ".
In order to further specify the operating process of the method for the invention, below in conjunction with embodiment, the present invention will be described.
Suppose the set of tags that has one to comprise four labels, the ID length of the label in this group is 4, and the ID of this set of tags is as follows: and 0001,0010,1010,1011}.As shown in Figure 4, as follows to the settlement steps to deal of multi-label collision in this set of tags.
1, in reader, all labels in the set of tags are done position inquiry according to the order from a high position to the low level, Query Result is done conflict judge, obtain going here and there S (x0xx), promptly in this set of tags, have only the 2nd not have conflict, there is conflict in everybody for all the other.This moment, stack was empty, and label all is in active state.
2, in reader, the primary x of S (x0xx) that will go here and there replaces with 0 and 1 respectively, obtain two binary strings, be respectively (00xx) and (10xx), the method according to this invention, will go here and there (10xx) stacked, and transmission " stacked order ", also include address information in " stacked order ", in this step, the value of address information is 1.Go here and there (00xx) then replace the string S value.After label is received " stacked order ",, the value of the stack counter of label (1010) and label (1011) is added 1, change label (1010) and label (1011) over to blocked state then according to address information.
3, in reader, inquire about for the 3rd to the label that is in active state, have only label (0001) and label (0010) to be in active state this moment, and these two label responses " position querying command " are owing to clash on the 3rd, therefore replace x with 0 and 1 respectively, obtain string (000x) and (001x), the method according to this invention, the value of S is gone here and there in (000x) replacement of will go here and there, to go here and there (001x) be pressed in the stack, send " stacked order ".After label is received " stacked order ", change label (0010) over to blocked state, the stack counter adds 1.And the stack counter of label (1010) and label (1011) also will add 1.
4, in reader, the 4th of the label that is in active state inquired about, because have only label (0001) to be in active state this moment, the rreturn value of inquiry is 1, do not have conflict, S replaces with (0001) by (000x), has realized the successful identification to label (0001).Then, reader sends " sleep command ", owing to have only label (0001) to be in active state, thereby label (0001) changes dormant state over to.
5, in reader, make stack operation, will go out the resulting result of stack operation (001x) and replace S, send " order of popping ", after label is received the order of popping, be in the label (1010) of blocked state, the counter of (1011) and (0010) subtracts 1.Because the value of the counter of label (0010) equals 0, thereby label (0010) changes active state over to, and label (1010), (1011) still remain on blocked state.
6, among the current string S, have x at the 4th, the 4th to the label that is in active state inquires about once more.Owing to have only label (0010) to be in active state, the rreturn value of inquiry is 0, does not have conflict.S replaces with (0010) by (001x), has realized the successful identification to label (0010).Then, reader sends " sleep command ", and label (0010) changes dormant state over to from active state.
7, in reader, make stack operation, will go out the resulting result of stack operation (10xx) and replace S, send " order of popping ", be in the label (1010) of blocked state, the counter of (1011) subtracts 1.After subtracting 1, the value of the counter of these two labels all is 0, therefore, changes two labels over to active state.
8, in current string, third and fourth all exists x, from a high position, the 3rd of label is inquired about, and the result of inquiry is the 3rd and does not have conflict.
9, the 4th to label inquires about, and the result of inquiry is the 4th and has conflict, gives 0 and 1 respectively for the conflict position.Because the 4th is last conflict position, therefore, can realize the identification to label (1010) and label (1011).Also just realized identification to all labels in the set of tags.
In the entire identification process of this embodiment, needed position inquiry times is 9, is 16 times and adopt the position required inquiry times of inquiry binary approach in the background technology, can reduce the burden of system significantly.And in actual use, because employed ID mark number is generally 64,96 even 256, therefore, the advantage of the inventive method is more obvious.
In the identifying of present embodiment to label, when running into when position conflict, acquiescence is that 0 string continues to do identification to the conflict position, is that 1 string deposits in the storehouse and will conflict.But in application, can this identifying is reverse, be about to the conflict position and be 1 string and continue to do identification, be that 0 string deposits in the storehouse with the conflict position.In the identifying, the variation of this recognition sequence does not influence final recognition effect.As long as the function of operational order is done corresponding modify, those skilled in the art can realize identification to many labels easily according to the description of present embodiment.