Background technology
Radio frequency identification system (RFID) is an automatic identification technology that moves to maturity from the eighties in last century, and development in recent years is very rapid.REID can be used for identification and follow the tracks of nearly all physical object, and can make up one thus and hold and link the intelligent network widely of all article in the world.RFID is a kind of contactless automatic identification technology, and its ultimate principle is to utilize the transport property of radiofrequency signal and space coupling (inductance or electromagnetic coupled), realizes by the automatic identification of certain objects.
The RFID technology does not also form a unified international standard at present.The standardization of RFID comprises the standardization of a plurality of parts such as identification code standard, operating protocol and application system interface specification.Current main RFID related specifications has UID (Ubiquitous ID) standard of American-European EPC (Electronic Product Code) standard, Japan and the ISO (International Standards Organization) ISO radio-frequency (RF) identification standard ISO18000 series of canonical based on Item Management.Wherein, American-European EPC standard and ISO 18000 standards because application is more extensive, become the RFID standard of current main-stream.
Rfid system generally is made up of reader and two parts of label, and reader has the function that reads a plurality of labels simultaneously.In the rfid system of a plurality of labels to a reader, a plurality of labels often can be simultaneously to reader transmission data, and this just requires rfid system to set up a kind of arbitration mechanism to be avoided data to bump.Consider the restriction of the size of label own, energy consumption etc., anticollision mechanism also requires simple in security function.
The solution that RFID is collided problem generally has 4 kinds of modes: space division multiplexing method, time-division multiplex method, Code Division Multiplex method, frequency multiplexing method.Wherein, the time-division multiplex mode realizes the read-write of a large amount of labels easily owing to use simply, so by most anti-algorithms employings that collide.The existing anti-algorithm that collides mainly comprises two kinds of ALOHA algorithm and binary tree searching algorithms.Wherein, ALOHA algorithm randomness is big, and when a large amount of labels and when depositing, frame collision is serious, causes the performance rapid deterioration, is not suitable for extensive label and reads.So mainly adopt binary search algorithm.
Summary of the invention
At problems of the prior art, the invention provides a kind of multiple tag dynamic bit arbitration anti-collision method that is applicable to rfid system.This method effectively avoids data to bump, and has reduced energy consumption and the complexity of having simplified circuit largely.
Purpose of the present invention is achieved through the following technical solutions:
Be used for the multiple tag dynamic bit arbitration anti-collision method of rfid system, comprise the steps:
(1) reader initialization label, make all labels be in active state, all labels of reader requests send whole identification code then, and the position that bumps is represented with X, do not have the data of this position of location records of collision, and record the information in the reader register;
(2) from the described reader register of step (1), read first position number that bumps and count k0, make this bit data in the label identity code enter waiting status, and the value of the register in this label is changed into k0 for ' 1 ' or ' 0 ' label; Data are pressed in the prefix storehouse for ' 1 ' or ' 0 ', k0 is pressed into collision position storehouse; Make tag identifier sign indicating number k0 position keep active state for ' 0 ' or ' 1 ' label;
(3) reader begins the label that the step-by-step inquiry is in active state from next one collision position k, and as if not bumping, reader writes this bit data in the temporary register k position; If bump, then reader makes tag identifier sign indicating number k position keep active state for ' 0 ' or ' 1 ' label, and tag identifier sign indicating number k position enters waiting status for ' 1 ' or ' 0 ' label, and k is write in the register of label, and k is pressed in the storehouse of reader collision position;
(4) when reader was inquired about last collision position, if bump, reader can be discerned two labels;
(5) after having discerned one or two label, reader ejects up-to-date position, the collision position numerical value k that enters storehouse from the storehouse of collision position, making register in the label that is in waiting status is that the label of k enters active state, remove the content of this tag register subsequently, and from next collision position beginning step-by-step inquiry, get back to step (3), to discerning all labels.
Described step (3) also comprises when reader is inquired about the k position, if bump, the value of temporary register k position is changed into ' 0 ' or ' 1 '; Data with temporary register 1 to k-1 position add that data ' 1 ' or ' 0 ' are pressed in the prefix storehouse together simultaneously.The data that in the temporary register of step (3) are not the collision position can obtain from the reader register.
Described step (4) reader can be discerned two labels and be meant: establish last collision position of writing down in step (1) the reader register and be K, then from temporary register, obtain 1 to K-1 bit data, the K position is respectively ' 0 ' and ' 1 ', from step (1) reader register, obtain the data of back, K position, two tag identifier sign indicating numbers are write in the reader stores device.
Described step (5) also ejects the latest data in the prefix storehouse and writes in temporary register 1 to the k position when ejecting position, collision position numerical value.After step (5) reader has been discerned certain label, obtain identity code from temporary register, write in the reader stores device and remove data in the temporary register, this label directly enters the affirmation state.
Compared with prior art, the present invention has following advantage and beneficial effect:
(1) the present invention makes full use of the internal memory and the computing power of reader itself, and described rfid system only needs to be provided with the register of one 8 bit in label; A collision position storehouse, a prefix storehouse, a temporary register are set in reader, simple in structure, to carry out difficulty low.
(2) cut down the consumption of energy, speed is fast: the present invention can obtain minimum request number and receive bit number by the register in the label, fast a plurality of labels is discerned in batches, cuts down the consumption of energy, and saves recognition time.
(3) the technical program is simple, but the identification label number is huge, and the number of tags that can discern is 2 in theory
(128-1), and for continuous or same company, faster with the execution speed of the tag identifier code system of organizing.
On the whole, the present invention has given full play to the advantage of binary tree searching algorithm, and utilizes the register in label and the reader, reduces inquiry times and receives bit number, identification label in batches; Simple for structure, speed is fast, and energy consumption is low, is highly suitable in the rfid system and uses.
Embodiment
The present invention is further illustrated below in conjunction with drawings and Examples, but the scope of protection of present invention is not limited to the scope of embodiment statement.
Rfid system generally is made up of reader and two parts of label, and reader has the function that reads a plurality of labels simultaneously.When rfid system is worked, often there is more than one label to be in the reach of reader.Occur the conflict data collision when data of these labels are sent to reader simultaneously, the receiver that causes reader can not sense data.The present invention adopts the time-division multiplex method, presses bit inquiry arbitration mode, makes a plurality of labels of reader effective recognition.
The register (being designated as TR) of one 8 bit is set in the label of rfid system; A collision position storehouse (being designated as B), a prefix storehouse (being designated as S), a temporary register (being designated as TM) are set in reader.In the following embodiment, waiting state is the state that unrecognized label is waited for reader identification; The activity attitude is the state that label is being discerned by reader; Confirm that attitude is the state that label has been discerned by reader.
The tag state transition rule is as follows: initialization makes all labels all enter active state; The label that is in waiting state can enter the activity attitude; Be in the dynamic label of living and return waiting state; Be in the dynamic label of living and enter the affirmation attitude; Be in the label of confirming attitude and can not return the activity attitude; Confirm that attitude and waiting state can not directly shift.
As shown in Figure 1, the present invention is applicable to the multiple tag dynamic bit arbitration anti-collision method of rfid system, comprises step:
(1) reader initialization makes B, S, TM for empty; Reader makes all labels enter active state, and simultaneously, making TR is empty (step 00).
(2) (step 10), ID is meant the unique identification (ID is that each label has, and ID length, definition etc. must be provided with according to standard) of label to reader requests label transmission entire I D.Reader is recorded in the id information of receiving in the reader register, is designated as Mc; The position that bumps is with X sign (collision be meant this position receive data ' 0 ' and ' 1 ' simultaneously), and this data are then write down in the position that not have to collide.The position that bumps among the Mc is all only inquired about in all inquiries in the reader following step, and inquiry is that a high position from identification code is to low level (step 11).
(3) reader reads first collision position k0 (starting at from a high position) among the Mc, make among the label ID that this bit data (is that another kind carries into execution a plan in the bracket for ' 1 ' (or ' 0 '), the effect of two kinds of schemes is the same) label enter waiting status, and the register TR in this label is changed into k0.Simultaneously, reader is pressed into data ' 1 ' (or ' 0 ') among the prefix storehouse S, and k0 is pressed into collision position storehouse B.Then begin inquiry (step 12~14) from next one collision position.
(4) data among the reader step-by-step inquiry tag ID.The k position of reader inquiry tag ID, if do not bump, reader writes these data in the k position of temporary register; If bump, then reader carries out following operation: to label, reader makes and sends data and enter waiting status for the label of ' 1 ' (or ' 0 '), and k is write among the register TR of this label, keeps active state and send data for the label of ' 0 ' (or ' 1 '); To reader itself, reader is pressed into k among the reader collision position storehouse B, temporary register TM k position ' 0 ' (or putting ' 1 '), the data with 1 to k-1 position among the temporary register TM add that data ' 1 ' (or ' 0 ') are pressed among the prefix storehouse S together simultaneously.Reader preserved collision position information, and established the condition (step 16~19) that label reenters active state.
(5) in identifying, reader is inquired about last collision position, if bump, reader can be discerned two labels simultaneously.If last collision position is K, then from temporary register, obtain 1 to K-1 bit data, the K position is respectively ' 0 ', ' 1 ', from Mc, obtain the data of back, K position, two tag identifier sign indicating numbers are write in the reader stores device, also make these two labels enter the affirmation state, then enter step 23 ( step 15,20~22).
(6) reader has been discerned (or two a) label, ejects the up-to-date collision position position data k that enters storehouse from the storehouse B of collision position, ejects the latest data among the prefix storehouse S then and writes in 1 to the k position of temporary storage TM.If the k value is empty, then all labels have been discerned in expression, finish this execution.If the k value is not empty, then reader makes in the label that is in waiting status, and register TR is that the label of k enters active state, removes the data among this tag register TR subsequently; Register TR does not keep waiting status for the label of k in the label of waiting status and be in, and returns step 14.According to set condition, make some label enter active state and be convenient to other label of reader continuation identification, also reduced the inquiry times of reader and the bit number of receiving ( step 21,22,23~27,30) simultaneously.
Below, come more detailed explanation execution in step of the present invention with reference to an instantiation and table 1.In this example, rfid system comprises a reader and four labels.Four labels are respectively Tag1 (' 0001 '), Tag2 (' 0010 '), Tag3 (' 1010 '), Tag4 (' 1011 ').Wherein, in the bracket be the ID of each label.
One, the reader requests label sends entire I D.Reader is received ' X0XX ', and it is deposited among the Mc.Reader carries out following operation subsequently: initial collision position k0=1; TM=00; B=1; S=1; Make Tag3 and Tag4 enter waiting status and all change their value of register TR into 1.
Two, the reader requests label sends next collision position, receives X, bumps.Reader operation: TM=000; K=3; B=1,3; S=1,001; Make Tag2 enter waiting status and change the value of its register TR into 3.
Three, the reader requests label sends next collision position, and reader receives 1.Reader operation: TM=0001, k=4 has been last position, identification Tag1 makes Tag1 enter the affirmation state simultaneously, and is kept in the storer (being designated as M) ' 0001 '; Remove TM, and from storehouse S, eject data ' 001 ', then TM=001; From storehouse B, eject data 3, then k=3; Make Tag2 enter active state (its TR=3 removes this value immediately); B=1; S=1;
Four, the reader requests label sends next collision position, and reader receives 0.Reader operation: TM=0010, k=4 (in like manner, being last position), identification Tag2 makes Tag2 enter status recognition, and is kept among the storer M ' 0010 '.Remove TM, and from storehouse S, eject data 1, then TM=1; From storehouse B, eject numerical value 1, then k=1; Make Tag3 and Tag4 enter active state (their TR is 1, removes this value immediately).
Five, the reader requests label sends the data of next collision position, and reader receives 1, reader operation: TM=101; K=3.
Six, the reader requests label sends the data of next collision position, and reader is received X, bumps.Reader operation: k=4 has been last collision position, can discern two labels simultaneously, incite somebody to action ' 1010 ' and ' 1010 ' and be kept among the storer M, and identification Tag3 and Tag4, and make them enter the affirmation state; Because B, S have been empty, can not eject data, have discerned whole labels, are finished.
In this example, reader only needs 6 inquiries, receives the data of 9 bits, just can discern whole 4 labels.The present invention is described owing to utilize the storer of label, has simplified circuit, the inquiry times and the reader that have reduced reader receive bit number, have reduced energy consumption largely.The technical program is simple, is highly suitable in the rfid system to use.
Table 1
Step | Reader requests | S | TM | B | Tag1 0001 | Tag2 0010 | Tag3 1010 | Tag4 1011 | M (Mc) |
TA | TR | TA | TR | TA | TR | TA | TR |
1 | Ask all positions | 1 | 00 | 1 | 0001 | | 0010 | | 1010 | 1 | 1011 | 1 | (X0XX) |
2 | Request | 1,001 | 000 | 1,3 | 0 | | 1 | 3 | | 1 | | 1 | |
3 | Request | 1,001 | 001 | 1,3 | 1 | | | 3 | | 1 | | 1 | 0001 |
4 | Request | 1 | 10 | 1 | | | 0 | | | 1 | | 1 | 0001,0010 |
5 | Request | | 101 | | | | | | 1 | | 1 | | 0001,0010 |
6 | Request | | | | | | | | 0 | | 1 | | 0001,0010 1010,1011 |
TR: tag register TA: tag responses