Summary of the invention
The object of the invention is to overcome the deficiencies in the prior art, provide and carry out allocation of space according to sub-application size and the structure of carrying out a kind of RFID label tag user area of read-write password setting according to sub-application encipher rank.
The technical scheme that the present invention takes is:
A structure for RFID label tag user area, arranges index area in described place of safety, it is characterized in that: arrange multiple index mark in index area, and the figure place L of each index mark is more than or equal to log2
(M/N)and L be integer, M is space, user area, N is assignable minimum space, the quantity G of index mark is less than or equal to M/N and G is integer, and each index mark is numbered successively according to natural number and is corresponding in turn to all N;
Divide space, user area according to the quantity order of son application, every height applies the called after subarea, space that takies and subarea marks successively according to natural number, and each subarea takies the space of at least one N and the summation in space that all subareas take is less than or equal to M;
The end position numbering in a upper subarea in first subarea equals-1, the end position in each subarea remaining is numbered the numbering of index mark corresponding to last N that this subarea takies, the end position numbering in each subarea writes in index mark successively, and the index mark that last subarea takies all index marks below fill in identical numerical value and this numerical value equals the numbering of index mark corresponding to last N that last subarea takies;
Each subarea starts to arrange a cipher mode mark, this cipher mode mark is for showing the cipher mode in this subarea, cipher mode is divided into and separates and read-write password unification without password, read-write password, be memory block without the whole spaces removed in the subarea of password beyond cipher mode mark, read-write password separately and the space in subarea unified of read-write password be the summation of cipher mode mark, password area and memory block.
Another object of the present invention is to provide a kind of division methods of structure of RFID label tag user area, it is characterized in that: comprise the following steps:
(1) divide space, user area according to the quantity order of son application, every height applies the called after subarea, space that takies and subarea marks successively according to natural number, and each subarea takies the space of at least one N and the summation in space that all subareas take is less than or equal to M;
(2) the end position numbering in a upper subarea in first subarea equals-1, the end position in each subarea remaining is numbered the numbering of index mark corresponding to last N that this subarea takies, and the end position numbering in each subarea writes in index mark successively;
(3) index mark all index marks below that last subarea takies fill in identical numerical value and this numerical value is more than or equal to the numbering of index mark corresponding to last N that last subarea takies;
(4) each subarea starts to arrange a cipher mode mark, and this cipher mode mark is for showing the cipher mode in this subarea, and cipher mode is divided into and separates and read-write password unification without password, read-write password;
(5) according to step cipher mode (4), space allocation is carried out to every sub-application area, be memory block without the whole spaces removed in the subarea of password beyond cipher mode mark, read-write password separately and the space in subarea unified of read-write password be the summation of cipher mode mark, password area and memory block.
Another object of the present invention is to provide a kind of reading/writing method of structure of RFID label tag user area, it is characterized in that: comprise the following steps:
(1) read the index mark in index area, place of safety, obtain the end position numbering in each subarea, calculate the formula that each subarea takes up room: after the numbering of each subarea end position deducts a sub-end of extent Position Number, be multiplied by N again;
(2) whether judgment formula result is 0,
If be not 0, obtain the information in each subarea, enter next step;
If be 0, return address Access Violation, exits;
(3) judge cipher mode, read the cipher mode mark in each subarea, judge the cipher mode in each subarea;
When cipher mode is without password, carry out the read-write operation of memory block, and return successful operation information;
When cipher mode is read-write password unification, enter step (4);
When cipher mode be read-write password separate time, enter step (5);
(4), when cipher mode is read-write password unification, judge that whether 32 read-write passwords are correct,
Time correct, carry out the read-write operation of memory block, and return successful operation information;
Return cryptographic acess mistake time incorrect, exit;
When cipher mode be read-write password separate time, judge that current operation is read or write operation, and respectively judge read password or write password whether correct;
Time correct, carry out read operation or the write operation of memory block, and return successful operation information;
Return cryptographic acess mistake time incorrect, exit.
Advantage of the present invention and good effect are:
In the present invention, user area is distributed to son application dynamically and is used, it carries out the distribution in subarea according to son application requisite space, each subarea takies the space of at least one N and the summation in space that all subareas take is less than or equal to M, the numbering of the index mark that last N that the beginning in each subarea and end position are taken by it is corresponding determines, distribute continuous print large space can to thus larger son application, and less son application distributes little space, avoid the discontinuous and situation of space waste of prior art neutron application usage space, and each subarea all can arrange cipher mode, for needing son application distribution three kinds of password storage modes of high secret grade, the son application lower for secret grade provides memory block large as far as possible, achieve higher level of security, also can not waste the space in subarea.
Embodiment
Below in conjunction with embodiment, the present invention is further described, and following embodiment is illustrative, is not determinate, can not limit protection scope of the present invention with following embodiment.
A structure for RFID label tag user area, as shown in Figure 1,2,3, 4, arrange index area in described place of safety, innovation of the present invention is: arrange multiple index mark in index area, and the figure place L of each index mark is more than or equal to log2
(M/N)and L be integer, M is space, user area, N is assignable minimum space, the quantity G of index mark is less than or equal to M/N and G is integer, and each index mark is numbered successively according to natural number and is corresponding in turn to all N;
Divide space, user area according to the quantity order of son application, every height applies the called after subarea, space that takies and subarea marks successively according to natural number, and each subarea takies the space of at least one N and the summation in space that all subareas take is less than or equal to M;
The end position numbering in each subarea writes in index mark successively, the end position numbering in a upper subarea in first subarea equals-1, the end position in each subarea remaining is numbered the numbering of index mark corresponding to last N that this subarea takies, and the assignment of index mark all index marks below that this last N is corresponding is more than or equal to the numbering of index mark corresponding to last N that last subarea takies;
Each subarea starts to arrange a cipher mode mark, this cipher mode mark is for showing the cipher mode in this subarea, cipher mode is divided into and separates and read-write password unification without password, read-write password, be memory block without the whole spaces removed in the subarea of password beyond cipher mode mark, read-write password separately and the space in subarea unified of read-write password be the summation of cipher mode mark, password area and memory block.
Said structure is described as follows:
As shown in Figure 1, L=4=log2 is set
(M/N)the total volume of user area is M=4096bits, the assignable minimum space in subarea is N=256bits, the quantity G in subarea is less than or equal to M/N, and G is that the remainder of above formula rounds downwards, result of calculation G=16, i.e. subarea 0 ~ 15, namely index mark has 16, and its numbering is 0 ~ 15 and corresponding with 16 N order respectively, and the smallest blocks 0 ~ 15 in figure is N0 ~ N15.
As shown in Figure 2, the actual son of user area that will use is applied as 5, if distributed according to above-mentioned 16 N, certainly will have a little application needs to take discontinuous space, so distribute according to the following rules:
Distribute according to the space consumption of son application: son application 0 takies a N, called after subarea 0; Son application 1 takies 2 N, called after subarea 1; Son application 2 takies 3 N, called after subarea 2; Son application 3 takies 4 N, called after subarea 3; Son application 4 takies 5 N, called after subarea 4; Remain a N unallocated.
Upper subarea-1 end position in subarea 0 and index mark-1 are non-existent, thus index mark corresponding to last N of taking of the upper subarea-1 of artificial regulation be numbered-1, namely subarea-1 end position be numbered-1.
Subarea 0 takies a N, so its end position is numbered the numbering of index mark corresponding to last N, namely the end position in subarea 0 is numbered 0, in like manner last N of subarea 1 index mark be numbered 2, the end position in subarea 1 is numbered 2; The end position in subarea 2 is numbered 5; The end position in subarea 3 is numbered 9; The end position in subarea 4 is numbered 14; The end position in subarea 0 ~ 4 numbering is write index mark 0 ~ 4 successively, completes the division in subarea.
N is multiplied by again, specifically: the size in subarea 0 is 0 deduct-1, and it takies 1 subarea, and allocation of space is 0 ~ 255bits after the numbering that the size in space, each subarea equals current subarea end position deducts the numbering of a sub-end of extent position; The size in subarea 1 is 2 deduct 0, it takies 2 subareas, allocation of space 256 ~ 767bits, the like, subarea 2 allocation space is 768 ~ 1535bits, subarea 3 allocation space is 1536 ~ 2559bits, and sub-application area 4 allocation space is 2560 ~ 3839bits, and the space of last remaining N is 3840 ~ 4095bits.
In order to avoid the impact that follow-up index mark 5 ~ 15 calculates space, subarea, all index marks 5 ~ 15 after the index mark 4 taken in subarea 4 extend this as the numbering of index mark 14 corresponding to last N14 that subarea 4 takies, specifically equal 14, the difference of adjacent in such index mark 5 ~ 15 two index marks numbering (being equivalent to subarea end position numbering) be 0 and the numerical value filled in of index mark 5 and the subarea 4 end position difference of numbering (numerical value filled in index mark 4) be also 0, represent not corresponding any subarea in these index marks 5 ~ 15, also unallocated any space.
Each subarea starts to arrange a cipher mode mark, this cipher mode mark is for showing the cipher mode in this subarea, cipher mode is divided into and separates and read-write password unification without password, read-write password, be memory block without the whole spaces removed in the subarea of password beyond cipher mode mark, read-write password separately and the space in subarea unified of read-write password be the summation of cipher mode mark, password area and memory block.
As shown in Figure 3, cipher mode mark takies 2bits, and numerical value is respectively 00,01,10 and 11, and specifically: the cipher mode in subarea 0 is masked as 00, meaning subarea 0 is without password; The cipher mode in subarea 1 is masked as 01, and reading and writing password separates and is 16; The cipher mode in subarea 2,3 is masked as 10, and read-write password unifies and length is 32; The cipher mode in subarea 4 is masked as 11, and reading and writing password separates and is 32.
The division methods of the structure of above-mentioned RFID label tag user area comprises the following steps:
(1) divide space, user area according to the quantity order of son application, every height applies the called after subarea, space that takies and subarea marks successively according to natural number, and each subarea takies the space of at least one N and the summation in space that all subareas take is less than or equal to M;
(2) the end position numbering in a upper subarea in first subarea equals-1, the end position in each subarea remaining is numbered the numbering of index mark corresponding to last N that this subarea takies, and the end position numbering in each subarea writes in index mark successively;
(3) index mark all index marks below that last subarea takies fill in identical numerical value and this numerical value equals the numbering of index mark corresponding to last N that last subarea takies;
(4) each subarea starts to arrange a cipher mode mark, and this cipher mode mark is for showing the cipher mode in this subarea, and cipher mode is divided into and separates and read-write password unification without password, read-write password;
(5) according to step cipher mode (4), space allocation is carried out to every sub-application area, be memory block without the whole spaces removed in the subarea of password beyond cipher mode mark, read-write password separately and the space in subarea unified of read-write password be the summation of cipher mode mark, password area and memory block.
The reading/writing method of the structure of above-mentioned RFID label tag user area comprises the following steps:
(1) read the index mark in index area, place of safety, obtain the end position numbering in each subarea, calculate the formula that each subarea takes up room: after the numbering of each subarea end position deducts a sub-end of extent Position Number, be multiplied by N again;
(2) whether judgment formula result is 0,
If be not 0, obtain the information in each subarea, enter next step;
If be 0, return address Access Violation, exits;
(3) judge cipher mode, read the cipher mode mark in each subarea, judge the cipher mode in each subarea;
When cipher mode is without password, carry out the read-write operation of memory block, and return successful operation information;
When cipher mode is read-write password unification, enter step (4);
When cipher mode be read-write password separate time, enter step (5);
(4), when cipher mode is read-write password unification, judge that whether 32 read-write passwords are correct,
Time correct, carry out the read-write operation of memory block, and return successful operation information;
Return cryptographic acess mistake time incorrect, exit;
When cipher mode be read-write password separate time, judge that current operation is read or write operation, and respectively judge read password or write password whether correct;
Time correct, carry out read operation or the write operation of memory block, and return successful operation information;
Return cryptographic acess mistake time incorrect, exit.
In the present invention, user area is distributed to son application dynamically and is used, it carries out the distribution in subarea according to son application requisite space, each subarea takies the space of at least one N and the summation in space that all subareas take is less than or equal to M, the numbering of the index mark that last N that the beginning in each subarea and end position are taken by it is corresponding determines, distribute continuous print large space can to thus larger son application, and less son application distributes little space, avoid the discontinuous and situation of space waste of prior art neutron application usage space, and each subarea all can arrange cipher mode, for needing son application distribution three kinds of password storage modes of high secret grade, the son application lower for secret grade provides memory block large as far as possible, achieve higher level of security, also can not waste the space in subarea.