Summary of the invention
The invention provides a kind of communication means based on radio-frequency recognition system, Apparatus and system, in order to realize the two-way communication in radio-frequency recognition system between electronic tag and reader, and save the energy content of battery consumption of active electronic label, ensure the stability communicated between electronic tag and reader.
The concrete technical scheme that the embodiment of the present invention provides is as follows:
Based on a communication means for radio-frequency recognition system, comprising:
Receive reader and check current the Frame sent in the cycle;
Resolve described Frame and extract frame number from predetermined field, the frame number calculating described current cycle of checking based on extraction enters the duration that channel clear need be waited for, and when determining that described reader is channel clear, select a time slot from described current checking the time slot that periodic packets contains;
Message is sent to described reader based on the time slot selected.
Receive reader current check the Frame sent in the cycle before, comprising: preset the form of Frame that reader sends, the frame number of preset described Frame in predetermined field in a data frame.
The frame number calculating described current cycle of checking based on extraction enters the duration that channel clear need be waited for, comprise: check in the cycle according to current the T.T. sending and take, send the time that individual data frame takies, and from the frame number that the predetermined field of described Frame is extracted, calculate the time entering channel clear and need wait for.
When determining that described reader is channel clear, a time slot is selected from described current checking the time slot that periodic packets contains, comprise: determine currently to check in the cycle number of time slot being in channel clear, and generate random number according to described number of time slot, select the time slot that described random number is corresponding.
When generating random number according to described number of time slot, comprising: the bit number taken according to described number of time slot determination random number, and random number described in initialization; Judge whether catch number of times reaches the bit number that random number takies, if do not reach the bit number that random number takies, move to left random number a bit, start timer and based on low-frequency clock, high frequency clock caught, using the value of the lowest bit position of data of the catching value as the lowest bit position of described random number, and add and again to judge to catch number of times by catching number of times after 1 and whether reach the bit number that random number takies; If reach the bit number that random number takies, select the time slot that described random number is corresponding.
Based on a communicator for radio-frequency recognition system, comprising:
Radio frequency chip, checks current the Frame sent in the cycle for receiving reader, and sends message based on the time slot that central processing unit is selected to reader;
Central processing unit, for resolving the Frame that radio frequency chip receives, and extract frame number from predetermined field, the frame number calculating described current cycle of checking based on extraction enters the duration that channel clear need be waited for, and when determining that described reader is channel clear, select a time slot from described current checking the time slot that periodic packets contains.
Radio frequency chip receive reader current check the Frame sent in the cycle before, preset the form of Frame that reader sends, the frame number of preset described Frame in predetermined field in a data frame.
Central processing unit calculates the described current cycle of checking based on the frame number extracted and enters the duration that channel clear need wait for, be specially: check in the cycle according to current the T.T. sending and take, send the time that individual data frame takies, and from the frame number that the predetermined field of described Frame is extracted, calculate the time entering channel clear and need wait for.
Central processing unit is when determining that described reader is channel clear, a time slot is selected from described current checking the time slot that periodic packets contains, be specially: determine currently to check in the cycle number of time slot being in channel clear, and generate random number according to described number of time slot, select the time slot that described random number is corresponding.
Central processing unit generates random number according to described number of time slot, is specially: the bit number taken according to described number of time slot determination random number, and random number described in initialization; Judge whether catch number of times reaches the bit number that random number takies, if do not reach the bit number that random number takies, move to left random number a bit, start timer and based on low-frequency clock, high frequency clock caught, using the value of the lowest bit position of data of the catching value as the lowest bit position of described random number, and add and again to judge to catch number of times by catching number of times after 1 and whether reach the bit number that random number takies; If reach the bit number that random number takies, select the time slot that described random number is corresponding.
Based on a communication system for radio-frequency (RF) identification, comprising:
Reader, for sending Frame to electronic tag, and receives the message of electronic tag transmission;
Electronic tag, check current the Frame sent in the cycle for receiving reader, resolve described Frame and extract frame number from predetermined field, the frame number calculating described current cycle of checking based on extraction enters the duration that channel clear need be waited for, when determining that described reader is channel clear, select a time slot from described current checking the time slot that periodic packets contains, and send message based on the time slot selected to described reader.
Based on technique scheme, in the embodiment of the present invention, electronic tag reception reader current check the Frame sent in the cycle after, resolve this Frame and extract frame number from predetermined field, calculate the current cycle of checking based on the frame number extracted again and enter the duration that channel clear need wait for, and after this duration of wait, when determining that reader is channel clear, time slot is selected to send message to reader, thus the two-way communication achieved between electronic tag and reader, and, the consumption of active electronic label to the energy content of battery can not be increased, ensure that the stability communicated between electronic tag and reader, also without the need to changing the original hardware configuration of radio-frequency (RF) communication system, realize simple.
Embodiment
In order to realize the two-way communication in radio-frequency (RF) identification (RFID) system between electronic tag and reader, and save the energy content of battery consumption of active electronic label, ensure the stability communicated between electronic tag and reader, embodiments provide a kind of communication means based on radio-frequency recognition system, Apparatus and system.The method is: electronic tag receives reader and checks current the Frame sent in the cycle, resolve this Frame and extract frame number from predetermined field, the frame number calculating current cycle of checking based on extraction enters the duration that channel clear need be waited for, and when determining that reader is channel clear, select a time slot from current checking the time slot that periodic packets contains, send message based on the time slot selected to reader.
Below in conjunction with accompanying drawing, the preferred embodiment of the invention is described in detail.
As shown in Figure 1, in the embodiment of the present invention, radio-frequency recognition system mainly contains reader 101 and electronic tag 102 forms, wherein,
Reader 101, for sending Frame to electronic tag 102, and receives the message of electronic tag 102 transmission;
Electronic tag 102, check current the Frame sent in the cycle for receiving reader, resolve this Frame and extract frame number from predetermined field, the frame number calculating current cycle of checking based on extraction enters the duration that channel clear need be waited for, when determining that reader is channel clear, select a time slot from current checking the time slot that periodic packets contains, send message based on the time slot selected to reader.
As shown in Figure 2, electronic tag 102 mainly comprises central processing unit 201, radio frequency chip 202, battery and peripheral circuit 203 thereof and antenna 204.In the embodiment of the present invention, radio frequency chip 202 receives reader by antenna 204 and sends central processing unit 201 at the current Frame sent in the cycle of checking, and sends message by antenna 204 to reader based on the time slot that central processing unit 201 is selected; Central processing unit 201 resolution data frame also extracts frame number from predetermined field, the frame number calculating current cycle of checking based on extraction enters the duration that channel clear need be waited for, when determining that reader is channel clear, select a time slot from current checking the time slot that periodic packets contains, radio frequency chip 202 sends message by antenna 204 to reader based on the time slot selected.Wherein, battery and peripheral circuit 203 thereof are for powering to central processing unit 201.
Based on said system framework, as shown in Figure 3, in the embodiment of the present invention, the method detailed flow process of carrying out communicating based on radio-frequency recognition system is as follows:
Step 301: receive reader and check current the Frame sent in the cycle.
As shown in Figure 4, according to the difference of application scenarios, the number that of reader checks the number of the Frame comprised in the cycle and time slot is not identical yet, in the embodiment of the present invention, sets one and checks periodic packets containing N number of Frame and N
sindividual time slot.In the embodiment of the present invention, electronic tag receive reader current check the Frame sent in the cycle before, need configuration electronic tag to be timing wake-up pattern, namely for the parameter needed for electronic tag configuration timing wake-up pattern, such as, sleep time and wake duration up.
Preferably, in electronic tag, by radio frequency chip receive reader current check the Frame sent in the cycle before, configuring radio frequency chip by central processing unit is timing wake-up pattern, and send control command by central processing unit to radio frequency chip, make radio frequency chip be in timing wake-up state, check current the Frame sent in the cycle to receive reader under this timing wake-up state.
Wherein, after electronic tag enters timing wake-up state at every turn, under being recorded in this timing wake-up state, receive the time of the Frame that reader sends first.
Step 302: resolution data frame also extracts frame number from predetermined field, the frame number calculating current cycle of checking based on extraction enters the duration that channel clear need be waited for, and when determining that reader is channel clear, select a time slot from current checking the time slot that periodic packets contains.
In the embodiment of the present invention, the form of the Frame that definition reader sends as shown in Figure 5, after raw information field and frame originating point information and reader information, increases new field, to preserve the frame number of current data frame in the field of this increase.Preferably, the field of increase is 2 bytes.
Wherein, resolution data frame from after predetermined field extracts frame number, calculating the current cycle of checking enters the duration that channel clear need wait for, be specially: send according to the current cycle of checking the T.T. taken, send the time that individual data frame takies, and from the frame number that the predetermined field of Frame is extracted, calculate the time that channel idle need be waited for.
Defining the current cycle of checking, to send the T.T. taken be T
q, the time that transmission individual data frame takies is T
f, the time receiving the Frame that reader sends first is T
r, the frame number extracted from the predetermined field of Frame is N
f, then the initial time T entering channel clear is calculated
iformula as follows: T
i=T
r+ T
q-N
f× T
f, then the time Δ T entering channel clear and need wait for can be calculated further
ifor: Δ T
i=T
i-T
r=T
q-N
f× T
f.
In the embodiment of the present invention, in electronic tag, sending according to the current cycle of checking the T.T. taken by central processing unit is T
q, the time that transmission individual data frame takies is T
f, and be N from the frame number that the predetermined field of Frame is extracted
f, calculate the time Δ T entering channel clear and need wait for
i, and according to this Δ T
iarrange the timer of central processing unit inside, now radio frequency chip is in dormant state, the timer of Real-Time Monitoring central processing unit inside, and after the time that timer reaches setting, determines to enter current idle condition of checking the cycle.
Wherein, when determining that reader is channel clear, carrying out Slot selection, in the embodiment of the present invention, determining currently to check in the cycle number of time slot being in channel clear, and generating random number according to this number of time slot, selecting the time slot that this random number is corresponding.
If one is checked the number of time slot comprised in the cycle is N
s, wherein, the time of each Time Slot Occupancy is T
s, then electronic tag sends the initial time T of message to reader
ufor: T
u=T
i+ random (0 ~ N
s) × T
s.
Preferably, check according to one the number of time slot comprised in the cycle, when generating a random number, generation random number can be caught based on the low-frequency clock of central processing unit inside to high frequency clock.Be specially, according to the bit number that is checked the number of time slot determination random number that comprises in the cycle and takies, and this random number of initialization; Then judge whether catch number of times reaches the bit number that random number takies, if do not reach the bit number that random number takies, move to left random number a bit, start timer and based on low-frequency clock, high frequency clock caught, using the value of the lowest bit position of data of the catching value as the lowest bit position of random number, and add and again to judge to catch number of times by catching number of times after 1 and whether reach the bit number that random number takies; If reach the bit number that random number takies, the time slot corresponding with this random number is selected to send message to reader.
Such as, the number of time slot N comprised in the cycle is checked for one
sbe 7, then the bit number that random number takies is 3, and random number is initialized as zero; Judge that catching number of times is zero degree, then move to left random number a bit, start timer and based on low-frequency clock, high frequency clock caught, if the lowest bit position of the data of catching is 1, be then 1 by the lowest bit position of random number, and number of times will be caught add 1 (catching number of times is 1); Again judge that catching number of times is 1, then move to left random number a bit, start timer and based on low-frequency clock, high frequency clock caught, if the lowest bit position of the data of catching is 0, be then 0 by the lowest bit position of random number, and number of times will be caught add 1 (catching number of times is 2); Judge that catching number of times is 2, then move to left random number a bit, starts timer and catch high frequency clock based on low-frequency clock, if the lowest bit position of the data of catching is 1, be then 1 by the lowest bit position of random number, and number of times will be caught add 1 (catching number of times is 3); Then judge that catching number of times is 3, reach the bit number that random number takies, then generate random number, and random number binary representation is 101, is 5, then from the 5th time slot, send information to reader.
Step 303: send message to reader based on the time slot selected.
In practical application, after generation random number R andom, stand-by period Δ T can be calculated according to this random number
s, and be Δ T according to the timer of waiting time configuration central processing unit inside
s, at wait Δ T
smessage is sent to reader after duration.
Based on technique scheme, in the embodiment of the present invention, by increasing field in the Frame of reader, and in the field increased, place the frame number of Frame, electronic tag reception reader current check the Frame sent in the cycle after, resolve this Frame and extract frame number from predetermined field, calculate the current cycle of checking based on the frame number extracted again and enter the duration that channel clear need wait for, and after this duration of wait, when determining that reader is channel clear, time slot is selected to send message to reader, thus the two-way communication achieved between electronic tag and reader, and, the consumption of active electronic label to the energy content of battery can not be increased, ensure that the stability communicated between electronic tag and reader.In addition, the technical scheme that the embodiment of the present invention provides does not need to change the original hardware configuration of radio-frequency (RF) communication system, realizes simple.
Obviously, those skilled in the art can carry out various change and modification to the present invention and not depart from the spirit and scope of the present invention.Like this, if these amendments of the present invention and modification belong within the scope of the claims in the present invention and equivalent technologies thereof, then the present invention is also intended to comprise these change and modification.