Background technology
At present, market exists some product false proof identification tags, when buying product for consumer, implement the True-false distinguish to product.Anti-counterfeit recognition marker great majority on these product false proof identification labels are digital forms, and these numerals often figure place are shorter, only can represent the unique identities of a certain series products, and can not the product of compatible magnanimity.And these numerals have certain rule usually, randomness is more weak, is easily guessd out rule by fake producer and copys out.
The design of existing false proof identification tag has following defect:
1) form of expression is single
At present, nearly all false proof identification tag is all adopt the form of numeral to indicate its identity, and does not adopt the form of bar code or Quick Response Code and RFID.Digital form is adopted to carry out false proof, the subject matter brought is the not convenient property of inquiry, consumer needs step-by-step one by one by digital anti-counterfeiting identity code entry terminal query facility (note, portal website), and inputing to consumer brings inconvenience by hand, also causes the possibility of input error simultaneously.Simultaneously, owing to have employed the false proof identity code of digital form, cannot gather its identity information at the collecting device (as POS, PDA) of intermediate links technical grade, the result caused to record the circulation path of this product, cannot carry out deeper trace to the source false proof.
2) capacity is less
At present, the product false proof identification code bit number on market is all shorter, and often only have 12 ~ 14, the longest also generally only have 16.The figure place of this length is enough for only its capacity of a series products, but does not possess the compatible ability representing more products.When accessing more products, its capacity does not just reach the requirement of actual product quantity far away, the result caused like this is necessary for the generating algorithm that each series products customizes separately a set of false proof identity code, is also unfavorable for being incorporated into same false proof identity authentication platform while adding cost.
3) be easy to deduce
At present, the product false proof identity code randomness on market is all more weak, the structure of security code all exists certain logicality and coupling, generally can find certain rule by visual inspection.Such as, the false proof identity code of the some products for A in the product of Class A batch is 0,100 2,023 7584, and another batch is the false proof identity code of the product of B is 0,100 2,024 7585.The false proof identity code of the product having batch to be B is again 0,100 2,024 7482.Can infer that 2024 representatives batch are the product of B by observing, and 2023 representatives batch are a product of A, 0100 represents Class A product.This coded system is beneficial to and divides an one's own coding range to every series products each batch, structure comparison is clear, be convenient to data volume larger time physical store and inquiry, but the problem brought can obtain certain rule by analogy or deduction, to fake producer provide certain can operating space.If but adopt the generating algorithm of the not false proof identity code of logically segmentation, all huge expense can be brought when physical store and data query when mass data accesses, and itself cannot obtain its more product related information from false proof identity code, so the generating algorithm of current most of false proof identity code takes the form of logically segmentation.
4) product bar code information cannot be comprised
At present, the product false proof identity code on market and product bar code do not have any contacting, and namely cannot be obtained the product bar code of this product by product false proof identity code, cannot obtain the base attribute that this product has from product bar code.Meanwhile, because product bar code cannot be obtained, so can not be classification with product, be incorporated into same false proof identity authentication platform.Even if can product bar code manually in input product packaging, but also will greatly improve the complicacy of operation.
Summary of the invention
The object of the invention is to provide a kind of identity code to generate methods and applications for above-mentioned weak point, is a kind of out of order, irregular, irregular but include certain logicality and product bar code information can be incorporated algorithm and the application of the false proof identity code long in interior, the term of validity, access product capacity is huge.The product capacity accessed can be made greatly to improve by adopting said method, ensure a thing one yard simultaneously and any rule cannot be found, but logicality and the product bar code information of its inside can be found fast by the reduction of certain algorithm, be convenient to the physical store of carrying out mass data according to its logicality, substantially increase the relevance on physical storage device between data, improve the time of inquiry response.Meanwhile, because single job can obtain product bar code information while acquisition security code, so also inquire the essential information of this series products while false proof more easily, as specification, price, the place of production etc.Even surpass business, also can scan false proof identity code thus obtain product bar code and settle accounts.
Particularly, the invention discloses a kind of identity code generating method, described identity code comprises product code, date code, random code and check code successively; Described method comprises the steps:
1) Random Maps relation between pre-generatmg product code and product bar code;
2) pre-generatmg date code and the Random Maps relation on date every day at least 20 years;
3) pre-generatmg random code data, described random code data are that timing every day generates;
4) from the mapping relations that step 1) generates, corresponding product code is obtained according to product bar code;
5) according to current date from step 2) obtain corresponding date code the mapping relations that generate;
6) obtain random code, in the random code data that step 3) generates, Stochastic choice starting point and terminal obtain the random code of certain number, and start of record, terminal, application number and product IDs;
7) coding generates new product code, encodes, utilize random number to do computing to product code, thus upset product code the product code that step 4) obtains;
8) coding generates new date code, encodes, utilize random number to do computing to date code, thus upset date code the date code that step 5) obtains;
9) be assembled into temporary identity code, the new date code that new product code step 7) obtained and step 8) obtain and the random code that step 6) obtains are combined into temporary identity code in order;
10) calculate 1 bit check code, and calculate 1 bit check code according to the temporary identity code that step 9) obtains;
11) check code that temporary identity code step 9) obtained and step 10) obtain is combined into final required identity code.
Further, in identity code generating method disclosed by the invention, the compatible Multi-encoding mode of identity code, identity code can depend on multiple external expressive form and medium simultaneously.Identity code foundation length is 20, dynamically expands position according to actual needs.The foundation length of described new product code is 7, and the foundation length of new date code is 4, and the foundation length of random code is 8, and check code length is 1.Product code at least provides 10,000,000 kinds of products to access simultaneously.The kind of required access product can also be increased by the length increasing product code.The numeral that described check bit is made up of preceding digital and product code, date code and random code is done plus-minus modular arithmetic and is obtained.
The coded system of described identity code comprises Code39 code (standard 39 yards), Codabar code (Ku Deba code), Code25 code (standard 25 yards), ITF25 code (intersecting 25 yards), Matrix25 code (25 yards, matrix), UPC-A code, UPC-E code, EAN-13 code (EAN-13 international product bar code), EAN-8 code (EAN-8 international product bar code), EAN-39 code, China Post's code (a kind of variant of 25 yards, matrix), Code-B code, MSI code, Code11 code, Code93 code, ISBN code, ISSN code, Code128 code (Code128 code, comprise EAN128 code) and special 39 yards of Code39EMS(EMS) etc.
In addition, the identity code multiple external expressive form that can depend on and medium comprise bar code, Quick Response Code and RFID etc.
Embodiment
Below with reference to accompanying drawing, the invention will be further described:
With reference to accompanying drawing 1, the identity code of generation of the present invention comprises product code, date code, random code and check code successively.The compatible Multi-encoding mode of identity code, identity code can depend on multiple external expressive form and medium simultaneously.Identity code foundation length is 20, dynamically expands position according to actual needs.The foundation length of described product code is 7, and the foundation length of date code is 4, and the foundation length of random code is 8, and check code length is 1.Product code at least provides 10,000,000 kinds of products to access simultaneously.The kind of required access product can also be increased by the length increasing product code.The numeral that described check bit is made up of preceding digital and product code, date code and random code is done plus-minus modular arithmetic and is obtained.
Described coded system comprises Code39 code (standard 39 yards), Codabar code (Ku Deba code), Code25 code (standard 25 yards), ITF25 code (intersecting 25 yards), Matrix25 code (25 yards, matrix), UPC-A code, UPC-E code, EAN-13 code (EAN-13 international product bar code), EAN-8 code (EAN-8 international product bar code), EAN-39 code, China Post's code (a kind of variant of 25 yards, matrix), Code-B code, MSI code, Code11 code, Code93 code, ISBN code, ISSN code, Code128 code (Code128 code, comprise EAN128 code) and special 39 yards of Code39EMS(EMS) etc.
The multiple external expressive form that identity code can depend on and medium comprise bar code, Quick Response Code and RFID etc.
Identity code generating method of the present invention, comprises step:
1) Random Maps relation between pre-generatmg product code and product bar code.
2) pre-generatmg date code and the Random Maps relation on date every day at least 20 years.
3) pre-generatmg random code data, described random code data are that timing every day generates.
4) from the mapping relations that step 1) generates, corresponding product code is obtained according to product bar code.
5) according to current date from step 2) obtain corresponding date code the mapping relations that generate.
6) random code is obtained
In the random code data that step 3) generates, Stochastic choice starting point and terminal obtain the random code of certain number, and start of record, terminal, application number and product IDs.If the same day is same class product again obtain random number, need the starting point according to the last time, terminal and this acquisition number to calculate the starting point and terminal made new advances, to ensure in one day being that the interval of same class request for product does not have overlapping interval and is continuous print at every turn.
7) coding generates new product code.The product code that step 4) obtains is encoded, utilizes random number to do computing to product code, thus upset product code.As: by step 4) the m position product code that obtains and step 6) one, the rear m position of n position random code that obtains to the addition modular arithmetic of the doing mathematics of.
8) coding generates new date code.The date code that step 5) obtains is encoded, utilizes random number to do computing to date code, thus upset date code.As: to step 5) a position date code that obtains and step 6) one, the rear a position of n position random code that obtains to the addition modular arithmetic of the doing mathematics of.
9) temporary identity code is assembled into.The new date code that new product code step 7) obtained, step 8) obtain and the random code that step 6) obtains are combined into temporary identity code in order.
10) 1 bit check code is calculated.1 bit check code is calculated according to the temporary identity code that step 9) obtains.The verification rule of check code is 10-(odd bits+3* even bit) %10.
11) check code that temporary identity code step 9) obtained and step 10) obtain is combined into final required identity code.
By the generating algorithm of above-mentioned identity code, can generate random false proof identity code for product, the false proof identity code generated every day keeps uniqueness and randomness, cannot from finding inherent law on the surface.And capacity is huge, can be a kind of product limit every day and generate at least 1 hundred million false proof identity code (dynamically can expand position as required, strengthen the capacity of each product access).The product (dynamically can expand position as required, strengthen the capacity of access product type) of at least 1 thousand ten thousand type can be accessed, for it generates false proof identity code simultaneously.Such as, 7 product codes, can access the product of 1,000 ten thousand types simultaneously; When being extended to 8 product codes, then the capacity of access product increases to 100,000,000; When being extended to 9 product codes, then capacity increases to 1,000,000,000.And the term of validity of identity code is at least 20 years (dynamically can expand position as required, strengthen the capacity on date), ensures that the data at least 20 years can not repeat.
Table 1: the product code example 13 of current national regulation product bar code Random Maps being become 7.
ID |
13 product bar codes |
7 product codes |
1 |
6922266438844 |
5872576 |
2 |
6923450656150 |
9478325 |
… |
… |
… |
Employing foundation length is that the date code of 4 can ensure that the term of validity of every part product is at least 20 years, namely there will not be the identity code of repetition at least 20 years.4 date codes adopt the method generated in advance, each number in 0000 ~ 9999 is randomly assigned to a date and preserves.
Table 2: date Random Maps is become 4 date code examples.
ID |
Date |
Random number |
1 |
2012/01/01 |
2750 |
2 |
2012/01/02 |
1218 |
… |
… |
… |
9999 |
2038/12/31 |
8547 |
Foundation length is that the random code of 8 can ensure that every day is the false proof identity code that a certain series products generates 100,000,000.8 random codes adopt the method generated in advance, upset by 00000000 ~ 99999999 and preserve (see table 3) through too much taking turns.
8 random numbers are taken regular as follows: the same day is when A product first time obtaining 8 random numbers, first a random number X1 is generated, X1 <=100,000,000-requirement, and by its origin information X1 and endpoint information Y1=X1+requirement-1, preserve, with reference to shown in table 4.The same day is when being A product second time acquisition 8 random numbers, if Y1+1+requirement <=100,000,000, using Y1+1 as secondary starting point, i.e. X2=Y1+1, secondary terminal is Y2=X2+needed number amount – 1, with reference to shown in table 5.If Y1+1+requirement >1 hundred million, X1-1 is as secondary starting point, i.e. X2=X1-1, secondary terminal is that Y2=X2+1-this obtains quantity, with reference to shown in table 6.When repeatedly obtaining 8 figure place more by that analogy.
Table 3: 8 random numbers are carried out out of order arrangement example.
ID |
Random number |
1 |
73678984 |
2 |
67376532 |
… |
… |
99999999 |
54675462 |
Table 4: first time gets the starting and terminal point example corresponding to 8 random numbers.
Sequence |
Product |
Random number starting point |
Random number terminal |
Application number |
Index |
Date of application |
000001 |
A |
5001 |
15000 |
10000 |
1 |
2012-1-1 |
Table 5: second time gets 8 random numbers and the starting and terminal point example of this application of last random number terminal+1+ corresponding to number <=1 hundred million.
Sequence |
Product |
Random number starting point |
Random number terminal |
Application number |
Index |
Date of application |
000001 |
A |
5001 |
15000 |
10000 |
1 |
2012-1-1 |
000002 |
A |
15001 |
25000 |
10000 |
2 |
2012-1-1 |
Table 6: second time gets 8 random numbers and the starting and terminal point example of this application of last random number terminal+1+ corresponding to number >1 hundred million.
Sequence |
Product |
Random number starting point |
Random number terminal |
Application number |
Index |
Date of application |
000001 |
A |
99985001 |
99995000 |
10000 |
1 |
2012-1-1 |
000002 |
A |
99985000 |
99975001 |
10000 |
2 |
2012-1-1 |
Check bit operation rule: 10-(odd bits+3* even bit) %10.
Involved by identity code generating method of the present invention coding method be select a kind of reversible algorithm, it utilizes random code and fixed number to do computing, is upset by fixed number.As: by rear 7 one the addition modular arithmetic to the doing mathematics of of 7 product codes and 8 random codes.Equally, by rear 4 one the addition modular arithmetic to the doing mathematics of of 4 date codes and 8 random codes.Even if the result done like this can make fixing product code and date code, also can generate new random digit, even thus ensure that each series products also can generate the false proof identity code not having arbitrarily rule and repeating part on the same day at every turn.Ensure that false proof identity code is out of order, irregular, irregular.
Such as, the content of former 20 false proof identity code is that 23***** * * * * * 94*****(* is represented as Any Digit), the 1st of 7 product codes is 2, and after 8 random codes, the 1st of 7 is 9, and both are added mould 10, i.e. (2+9) %10=1.The 2nd of 7 product codes is 3, and after 8 random codes, the 2nd of 7 is 4, and both are added mould 10, i.e. (3+4) %10=7.20 after coding are 17***** * * * * * 94*****.
The corresponding coding/decoding method of identity code generating method of the present invention is the inverse operation random code generated after coding being done encryption algorithm according to random number when upsetting before, is reduced into original fixed number.As: the product code of 7 and 8 random codes rear 7 one to the inverse operation of encryption algorithm before one do, can the identity code after encoded be decoded.Thus find regularity and the logicality of false proof identity code inside, reduce its original had information, the physical storage structure of mass data can be optimized and improve the response time of inquiry.
Such as, 20 after coding is 17***** * * * * * 94*****.After the 1st 1,8 random codes after coding, the 1st of 7 is 9, and before doing, the inverse operation of encryption algorithm is, both subtract each other the result mould 10 adding modulus 10, i.e. (1+10-9) % 10=2.After the 2nd 7,8 random codes after coding, the 2nd of 7 is 4, and both subtract each other the result mould 10 adding modulus 10, i.e. (7+10-4) % 10=3.20 original identity code 23***** * * * * * 94***** can be decoded.
In the application of reality, identity code generating method of the present invention can be applied in product false proof, wherein production person generates false proof identity code for this request for product, consumer or dealer carry out identity code scanning by POS terminal, intelligent mobile phone terminal and resolve, or use note, voice and WEB to carry out the input of identity code numeral; Thus complete the inquiry of the additional of circulation path or the true and false.
When, when being applied in product false proof by identity code generating method of the present invention, correspondingly, it comprises the steps:
1) production person generates false proof identity code for this request for product.
2) be that this product generates the identity code of specified quantity as false proof identity code according to above-mentioned identity code generating algorithm.When generating identity code, the front three according to the product bar code of application product filters, and avoids the front three of the identity code generated consistent with the front three of product bar code, reaches the object better distinguishing identity code and product bar code.
3) by step 2) the false proof identity code that generates carries out physical store, and the storage of data does subregion by product category and time.
4) enclose an identity for each part product to indicate, namely stick the false proof identity code of generation.
5) consumer or dealer carry out identity code scanning parsing by POS terminal, intelligent mobile phone terminal, or use note, voice and WEB to carry out the input of identity code numeral.
6) identity code content step 5) be resolved to is decoded, and reduces its real identity code content.According to the inverse operation of the computing of encoded product code before, decode real product code.According to the inverse operation of the computing of date code of encoding before, decode real date code.
7) in physical store, these data are navigated to rapidly as subregion querying condition using the real product code got and date code.Can make to these data the operation read in and revise, complete the inquiry of the additional of circulation path or the true and false.
8) corresponding relation that the product code obtained with step 6) inquires about product code and product bar code finds original product bar code, according to the essential information that product bar code can utilize market, the original POS system in supermarket obtains product, and then directly settles accounts.
In summary, the present invention possesses following advantage:
1) false proof identity code depends on multiple external expressive form and medium, comprises: bar code, Quick Response Code and RFID etc., facilitate the information acquisition of intermediate links.
2) identity code capacity is huge.Identity code adopts foundation length to be 20 codings, and at least can access 1,000 ten thousand kinds of products, every day is the false proof identity code that often kind of product can generate 100,000,000.And the limited period of each identity code is at least 20 years.And expansion position can be carried out according to actual requirement.
3) identity code adopts coding techniques, and regular interval is dynamically upset, cannot from finding any regular contact on the surface.But original identity code can be reduced by decoding technique, be convenient to the rapid inquiry response under the physical store of big data quantity and mass data by its internal connection.
4) identity code replaces product bar code.Include the information of product bar code in identity code, can find by algorithm the product bar code information be associated.Surpass with business in the process of circulation, run-down identity code just can replace the action of original scanning product bar code, in false proof process of reviewing, automatically complete checkout.
5) identity code adopts pregenerated scheme, have generate request time can rapidly for its generation required for false proof identity code.
Although accompanying drawing and aforementioned explanation give embodiments of the invention.But be understandable that, from the considering of above-mentioned disclosed content of the present invention and embodiment, it will be appreciated by those skilled in the art that other embodiments of the present invention.And instructions of the present invention and embodiment should only be thought exemplary, scope of the present invention and the spirit contained should be limited by appended claim, and no matter whether it is clearly provided in the description.The scope that scope of the present invention at least provides with claims is equally wide.