Summary of the invention
It is an object of the invention to overcome the deficiencies of the prior art and provide carry out space distribution according to sub- application size and press
A kind of RFID tag of password setting is written and read using encryption level according to son.
The technical solution adopted by the present invention is that:
Index area is arranged in the safety zone of label in a kind of RFID tag, it is characterised in that: multiple ropes are arranged in index area
The digit L of tendering will, each index marker is more than or equal to log2(M/N)And L is integer, M is user area space, N is assignable
Minimum space, it is integer that the quantity G of index marker, which is less than or equal to M/N and G, and each index marker is successively compiled according to natural number
Number and be corresponding in turn to all N;
User area space is divided according to the quantity sequence of sub- application, every height application the space occupied is named as sub-district and son
Area is successively labeled according to natural number, and each sub-district occupies the total of the space of at least one N and all sub-district the space occupied
Be less than or equal to M;
The end position number of a upper sub-district for first sub-district is equal to -1, the end position of each remaining sub-district
Number is the number for the corresponding index marker of the last one N that the sub-district occupies, and the end position number of each sub-district is successively write
Enter in index marker, the subsequent all index markers of index marker that the last one sub-district occupies fill in identical numerical value and the number
Value is equal to the number for the corresponding index marker of the last one N that the last one sub-district occupies;
Each sub-district starts setting up a cipher mode mark, which is used to show the encryption side of the sub-district
Formula, cipher mode is divided into no password, read-write password separates and read-write password unification, removes cipher mode mark in the sub-district of no password
Whole spaces other than will are memory block, and read-write password separates and the space of the sub-district of read-write password unification is cipher mode mark
Will, password area and the summation of memory block.
It is a further object to provide a kind of division methods of RFID tag, it is characterised in that: including following step
It is rapid:
According to sub- application quantity sequence divide user area space, every height application the space occupied be named as sub-district and
Sub-district is successively labeled according to natural number, and each sub-district occupies the space of at least one N and all sub-district the space occupied
Summation is less than or equal to M;
(2) the end position number of a upper sub-district for first sub-district is equal to -1, the stop bits of each remaining sub-district
The number that number is the corresponding index marker of the last one N that the sub-district occupies is set, the end position number of each sub-district is successively
It is written in index marker;
(3) the subsequent all index markers of index marker that the last one sub-district occupies fill in identical numerical value and the numerical value
More than or equal to the number for the corresponding index marker of the last one N that the last one sub-district occupies;
(4) each sub-district starts setting up a cipher mode mark, which is used to show the encryption of the sub-district
Mode, cipher mode is divided into no password, read-write password separates and read-write password unification;
(5) the cipher mode according to step (4) carries out space allocation to every sub- application area, removes in the sub-district of no password
Whole spaces other than cipher mode mark are memory block, and read-write password separates and the space of the sub-district of read-write password unification is to add
Close mode mark, password area and memory block summation.
It is a further object to provide a kind of reading/writing methods of RFID tag, it is characterised in that: including following step
It is rapid:
(1) the index marker in the index area of safety zone is read, the end position number of each sub-district is obtained, calculates every height
The formula of area's occupied space: the number of each sub-district end position subtracts after a sub- end of extent Position Number multiplied by N;
(2) whether judgment formula result is 0,
If not being 0, the information of each sub-district is obtained, into next step;
If it is 0, return address Access Violation is exited;
(3) judge cipher mode, read the cipher mode mark in each sub-district, judge the cipher mode of each sub-district;
When cipher mode is no password, the read-write operation of memory block is carried out, and return to operation successful information;
When cipher mode is that read-write password is unified, enter step (4);
When cipher mode separates for read-write password, enter step (5);
(4) when cipher mode is that read-write password is unified, judge whether 32 read-write passwords are correct,
When correct, the read-write operation of memory block is carried out, and returns to operation successful information;
Cryptographic acess mistake is returned when incorrect, is exited;
(5) when cipher mode separates for read-write password, judge that current operation is reading or write operation, and judgement is read respectively
Password or whether write password correct;
When correct, read operation or the write operation of memory block are carried out, and returns to operation successful information;
Cryptographic acess mistake is returned when incorrect, is exited.
The advantages and positive effects of the present invention are:
In the present invention, son is dynamically distributed to using according to son application required space progress sub-district in user area
Distribution, the summation that each sub-district occupies the space of at least one N and all sub-district the space occupied is less than or equal to M, each sub-district
Beginning and end position determined by its number of the corresponding index marker of the last one N occupied, it is possible thereby to give biggish
Son application distributes continuous large space, and lesser son application distributes small space, avoids prior art neutron using sky
Between discontinuous and space waste the case where, and cipher mode can be arranged in each sub-district, to need the son of high secret grade to answer
With three kinds of password storage modes of distribution, memory block as big as possible is provided for the lower son application of secret grade, is realized higher
Security level, will not also waste the space of sub-district.
Specific embodiment
Below with reference to embodiment, the present invention is further described, following embodiments be it is illustrative, be not restrictive,
It cannot be limited the scope of protection of the present invention with following embodiments.
Index area, innovation of the invention is arranged as shown in Figure 1,2,3, 4 in a kind of RFID tag in the safety zone of label
It is: multiple index markers is set in index area, the digit L of each index marker is more than or equal to log2(M/N)And L is integer, M is
User area space, N are assignable minimum space, and the quantity G of index marker is less than or equal to M/N and G is integer, each index mark
Will is successively numbered according to natural number and is corresponding in turn to all N;
User area space is divided according to the quantity sequence of sub- application, every height application the space occupied is named as sub-district and son
Area is successively labeled according to natural number, and each sub-district occupies the total of the space of at least one N and all sub-district the space occupied
Be less than or equal to M;
The end position number of each sub-district is sequentially written in index marker, the end of a upper sub-district for first sub-district
Position Number is equal to -1, and the end position number of each remaining sub-district is the corresponding rope of the last one N that the sub-district occupies
The assignment of the number of tendering will, the subsequent all index markers of the corresponding index marker of the last one N is more than or equal to last
The number for the corresponding index marker of the last one N that a sub-district occupies;
Each sub-district starts setting up a cipher mode mark, which is used to show the encryption side of the sub-district
Formula, cipher mode is divided into no password, read-write password separates and read-write password unification, removes cipher mode mark in the sub-district of no password
Whole spaces other than will are memory block, and read-write password separates and the space of the sub-district of read-write password unification is cipher mode mark
Will, password area and the summation of memory block.
Above structure is described as follows:
As shown in Figure 1, setting L=4=log2(M/N), the total capacity of user area is M=4096bits, and sub-district is assignable
Minimum space is N=256bits, and the quantity G of sub-district is less than or equal to M/N, and G is that the remainder of above formula is rounded downwards, calculated result G=
16, i.e. sub-district 0~15, i.e. index marker share 16, and number is 0~15 respectively and corresponding with 16 N sequences, in figure most
Fritter 0~15 is N0~N15.
As shown in Fig. 2, being actually subjected to using the son application of user area be 5, if be allocated according to above-mentioned 16 N, gesture
A little application must be had and need to occupy discontinuous space, so being allocated according to the following rules:
Be allocated according to the space dosage of sub- application: son occupies a N using 0, is named as sub-district 0;Son is occupied using 1
2 N, are named as sub-district 1;Son occupies 3 N using 2, is named as sub-district 2;Son occupies 4 N using 3, is named as sub-district 3;Son is answered
5 N are occupied with 4, are named as sub-district 4;One N of residue is unallocated.
- 1 end position of a upper sub-district and index marker -1 of sub-district 0 are not present, institute upper one taking human as regulation
The number for the corresponding index marker of the last one N that sub-district -1 occupies is -1, i.e. the number of -1 end position of sub-district is -1.
Sub-district 0 occupies a N, so its end position number is the number of the corresponding index marker of the last one N, i.e., it is sub
The end position number in area 0 is 0, and similarly the number of the index marker of 1 the last one N of sub-district is 2, and the end position of sub-district 1 is compiled
Number be 2;The end position number of sub-district 2 is 5;The end position number of sub-district 3 is 9;The end position number of sub-district 4 is 14;
The end position number of sub-district 0~4 is sequentially written in index marker 0~4, completes the division of sub-district.
The number that the size in each sub-district space is equal to current sub-district end position subtracts a sub- end of extent position
Multiplied by N after number, specifically: the size of sub-district 0 subtracts -1 for 0, occupies 1 sub-district, space is assigned as 0~255bits;
The size of sub-district 1 subtracts 0 for 2, occupies 2 sub-districts, and 256~767bits is distributed in space, and so on, 2 allocation space of sub-district
For 768~1535bits, 3 allocation space of sub-district is 1536~2559bits, sub- 4 allocation space of application area is 2560~
The space of 3839bits, the last one remaining N are 3840~4095bits.
In order to avoid the influence that subsequent 5~15 pairs of sub-district spaces of index marker calculate, the index marker that sub-district 4 is occupied
4 subsequent all index markers 5~15 extend this as the number of the corresponding index marker 14 of the last one N14 of the occupancy of sub-district 4, tool
Body is equal to 14, two adjacent index markers number (being equivalent to sub-district end position number) in such index marker 5~15
Difference is 0 and index marker 5 is filled in numerical value and 4 end position of sub-district number the difference of (numerical value filled in index marker 4)
Value is also 0, indicates not corresponding to any sub-district in these index markers 5~15, also unallocated any space.
Each sub-district starts setting up a cipher mode mark, which is used to show the encryption side of the sub-district
Formula, cipher mode is divided into no password, read-write password separates and read-write password unification, removes cipher mode mark in the sub-district of no password
Whole spaces other than will are memory block, and read-write password separates and the space of the sub-district of read-write password unification is cipher mode mark
Will, password area and the summation of memory block.
As shown in figure 3, cipher mode mark occupies 2bits, numerical value is respectively 00,01,10 and 11, specifically: sub-district 0
Cipher mode mark is 00, means sub-district 0 without password;The cipher mode mark of sub-district 1 is 01, and reading and writing password separates and is
16;The cipher mode mark of sub-district 2,3 is 10, and read-write password is unified and length is 32;The cipher mode mark of sub-district 4 is
11, reading and writing password separates and is 32.
The division methods of the structure of above-mentioned RFID tag user area the following steps are included:
According to sub- application quantity sequence divide user area space, every height application the space occupied be named as sub-district and
Sub-district is successively labeled according to natural number, and each sub-district occupies the space of at least one N and all sub-district the space occupied
Summation is less than or equal to M;
(2) the end position number of a upper sub-district for first sub-district is equal to -1, the stop bits of each remaining sub-district
The number that number is the corresponding index marker of the last one N that the sub-district occupies is set, the end position number of each sub-district is successively
It is written in index marker;
(3) the subsequent all index markers of index marker that the last one sub-district occupies fill in identical numerical value and the numerical value
Equal to the number for the corresponding index marker of the last one N that the last one sub-district occupies;
(4) each sub-district starts setting up a cipher mode mark, which is used to show the encryption of the sub-district
Mode, cipher mode is divided into no password, read-write password separates and read-write password unification;
(5) the cipher mode according to step (4) carries out space allocation to every sub- application area, removes in the sub-district of no password
Whole spaces other than cipher mode mark are memory block, and read-write password separates and the space of the sub-district of read-write password unification is to add
Close mode mark, password area and memory block summation.
The reading/writing method of the structure of above-mentioned RFID tag user area the following steps are included:
(1) the index marker in the index area of safety zone is read, the end position number of each sub-district is obtained, calculates every height
The formula of area's occupied space: the number of each sub-district end position subtracts after a sub- end of extent Position Number multiplied by N;
(2) whether judgment formula result is 0,
If not being 0, the information of each sub-district is obtained, into next step;
If it is 0, return address Access Violation is exited;
(3) judge cipher mode, read the cipher mode mark in each sub-district, judge the cipher mode of each sub-district;
When cipher mode is no password, the read-write operation of memory block is carried out, and return to operation successful information;
When cipher mode is that read-write password is unified, enter step (4);
When cipher mode separates for read-write password, enter step (5);
(4) when cipher mode is that read-write password is unified, judge whether 32 read-write passwords are correct,
When correct, the read-write operation of memory block is carried out, and returns to operation successful information;
Cryptographic acess mistake is returned when incorrect, is exited;
(5) when cipher mode separates for read-write password, judge that current operation is reading or write operation, and judgement is read respectively
Password or whether write password correct;
When correct, read operation or the write operation of memory block are carried out, and returns to operation successful information;
Cryptographic acess mistake is returned when incorrect, is exited.
In the present invention, son is dynamically distributed to using according to son application required space progress sub-district in user area
Distribution, the summation that each sub-district occupies the space of at least one N and all sub-district the space occupied is less than or equal to M, each sub-district
Beginning and end position determined by its number of the corresponding index marker of the last one N occupied, it is possible thereby to give biggish
Son application distributes continuous large space, and lesser son application distributes small space, avoids prior art neutron using sky
Between discontinuous and space waste the case where, and cipher mode can be arranged in each sub-district, to need the son of high secret grade to answer
With three kinds of password storage modes of distribution, memory block as big as possible is provided for the lower son application of secret grade, is realized higher
Security level, will not also waste the space of sub-district.