CN112149774A - Chinese character commodity anti-counterfeiting code generation method - Google Patents
Chinese character commodity anti-counterfeiting code generation method Download PDFInfo
- Publication number
- CN112149774A CN112149774A CN202010972003.7A CN202010972003A CN112149774A CN 112149774 A CN112149774 A CN 112149774A CN 202010972003 A CN202010972003 A CN 202010972003A CN 112149774 A CN112149774 A CN 112149774A
- Authority
- CN
- China
- Prior art keywords
- sequence
- binary
- chinese character
- commodity
- counterfeiting
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K19/00—Record carriers for use with machines and with at least a part designed to carry digital markings
- G06K19/06—Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
- G06K19/06009—Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K19/00—Record carriers for use with machines and with at least a part designed to carry digital markings
- G06K19/06—Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
- G06K19/06009—Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking
- G06K19/06046—Constructional details
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q30/00—Commerce
- G06Q30/018—Certifying business or products
- G06Q30/0185—Product, service or business identity fraud
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/001—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using chaotic signals
Landscapes
- Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Business, Economics & Management (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Entrepreneurship & Innovation (AREA)
- Signal Processing (AREA)
- Computer Networks & Wireless Communication (AREA)
- Computer Security & Cryptography (AREA)
- Accounting & Taxation (AREA)
- Development Economics (AREA)
- Economics (AREA)
- Finance (AREA)
- Marketing (AREA)
- Strategic Management (AREA)
- General Business, Economics & Management (AREA)
- Complex Calculations (AREA)
Abstract
The invention discloses a method for generating anti-counterfeiting codes of Chinese character commodities, which comprises the following steps: the Chinese character commodity identification code A representing the unique identity information of a certain commodity is subjected to numerical data and 8bits binary conversion and binary supplement operation to obtain a binary sequenceAndcalculating to obtain initial values and parameters of the chaotic system, an extraction starting position and an extraction interval number, performing chaotic iteration to obtain chaotic sequences X1 and X2, and respectively performing binary sequence comparison on binary sequences by using position change rules before and after descending order of the sequences X1 and X2Andscrambling is carried out to obtain a scrambled binary sequenceAndrespectively combining binary sequencesAndthe medium elements are grouped by taking 5 elements as units in the forward direction, and the odd-even grouping sequences are recombined respectively, so that the commodity anti-counterfeiting number is generated, and then the Chinese character commodity anti-counterfeiting code is generated by combination. The method for generating the anti-counterfeiting code of the Chinese character commodity is simple and feasible, has strong safety and is not easy to crack, and the generated anti-counterfeiting code of the Chinese character commodity has uniqueness and non-forgeability.
Description
Technical Field
The invention relates to the technical field of digital anti-counterfeiting, in particular to a method for generating anti-counterfeiting codes of Chinese character commodities.
Background
Counterfeit products are often not fresh, and it is necessary to take action to maintain the rights of the manufacturer and the consumer. Counterfeit products pose a serious threat to various industries, particularly luxuries such as pharmaceuticals, agricultural products, automotive parts, computer software, and expensive perfumes, cosmetics, jewelry, watches, and famous costumes. The geneva international business estimates that worldwide annual sales of counterfeit products amount to $ 6,500 billion. Counterfeit drugs and wine products are particularly problematic, not only are they counterfeits, but the actions made by counterfeiters seriously jeopardize the rights and interests of consumers: the counterfeit of the medicine delays or even aggravates the illness; the things of fake wine harm to people are more frequent, the reputation of merchants and the confidence of consumers are stricken heavily, and the good establishment of economic and social orders is greatly damaged. Therefore, numerous anti-counterfeiting means are created, such as: special packaging, designing complex icons, providing a thumbnail, etc. However, these measures often result in insufficient anti-counterfeiting performance due to lack of technology, and are easy for counterfeiters to drill blanks. With the progress of the times, the anti-counterfeiting technology has great breakthrough. Such as chip technology, biotechnology, etc., but the practical operability for many fields is not great due to the characteristics of high cost, rather limited inquiry terminal, etc. Since the digital anti-counterfeiting technology is brought to the market in the middle of the 90 th century, the digital anti-counterfeiting technology is unprecedented.
The digital anti-counterfeiting combines the characteristics of anti-counterfeiting printing and digital encryption technology, one-time use authority, randomness of generated passwords, invisibility and the like, so that the anti-counterfeiting of commodities is unprecedentedly guaranteed, meanwhile, the authenticity of products can be inquired in multiple ways, and the rampant of counterfeit and shoddy products can be effectively inhibited. Meanwhile, the chaotic signal is used as a natural password and is introduced into the generation process of the commodity anti-counterfeiting code, so that the safety is higher. Under the condition, a chaos cipher technology is utilized to provide a Chinese character commodity anti-counterfeiting code generation method so as to generate a Chinese character commodity anti-counterfeiting code with uniqueness and non-forgeability, and the method has good practical application and popularization values.
Disclosure of Invention
The purpose of the invention is as follows: the invention aims to solve the defects in the prior art and provides a method for generating anti-counterfeiting codes of Chinese character commodities, which generates chaotic signal sequences by chaotic mapping, scrambles 2 binary sequences converted from identification codes of the Chinese character commodities respectively, groups elements in the scrambled binary sequences, and performs different recombination operations according to the parity numbers of the grouped sequences, thereby generating commodity anti-counterfeiting numbers and further combining to generate the anti-counterfeiting codes of the Chinese character commodities.
The technical scheme is as follows: a Chinese character commodity anti-counterfeiting code generation method is characterized by comprising the following steps:
(1) transcoding
Firstly, Chinese character commodity identification code A representing unique identity information of a certain commodity is converted into numerical data [ P ] one by onei1,Pi2]To obtain a high-order numerical sequence P1 ═ { P ═ P11,P21,...,Pi1,....,PL1And a low order value sequence P2 ═ P12,P22,...,Pi2,....,PL2},
Then, the high-order binary sequence P1 is converted into binary data of 8bits element by element, resulting in a high-order binary sequence PB1 ═ PB11,PB12,...,PB1i,....,PB18×LSimultaneously, the low-order value sequence P2 is converted into binary data of 8bits element by element, and a low-order binary sequence PB2 ═ PB2 is obtained1,PB22,...,PB2i,....,PB28×L},
Finally, let LB ═ mod (5-mod (8 × L,5),5), add LB '0' binary bits to the end of the higher binary sequence PB1, and LB '1' binary bits to the end of the lower binary sequence PB2, to obtain a binary sequence And binary sequence
The Chinese character commodity identification code A comprises Chinese punctuation marks in a GB2312 character set and Chinese characters of double-byte codes in the GB2312 character set, the length of the Chinese character commodity identification code A is represented by L, the lengths of numerical value sequences P1 and P2 are L, the lengths of binary sequences PB1 and PB2 are 8 xL, and the binary sequencesAndall have the length of
Firstly, an initial value x of the Logistic chaotic map is respectively calculated and obtained by utilizing a high-order numerical value sequence P1, a low-order numerical value sequence P2 and external keys alpha and beta according to the following formulas (1) - (5)1A sum parameter mu, an extraction start position m, and an extraction interval number n1、n2,
x1=0.00001+mod(α-kp1,0.99999) (1)
μ=β+mod(kp1,4-β) (2)
Wherein the external key satisfies α ∈ (0,1), β ∈ (3.57,4),
then, the initial value x mapped by chaos1And an external key mu, iterating the Logistic chaotic mapping shown in the following formula (6), wherein k represents iteration times (k is 1, 2), xk+1Represents the chaotic signal obtained by the k-th iteration,
xk+1=μ×xk×(1-xk) (6)
obtaining a chaotic signal sequence X ═ X1,x2,., spaced by n from the m-th element in the sequence X1Each element is 1 element to form a length ofOf the chaotic signal sequenceAt the same time, the m-th element in the sequence X is sequentially spaced by n2Each element is 1 element to form a length ofOf the chaotic signal sequence
Finally, the chaotic signal sequence X1 is sorted in descending order, and the binary sequence is scrambled according to the position change scrambling rule before and after the chaotic signal sequence X1 is sortedScrambling is carried out to obtain a scrambled binary sequenceSimultaneously, the chaotic signal sequence X2 is sorted in a descending order, and the binary sequence is scrambled according to the position change scrambling rule before and after the chaotic signal sequence X2 is sortedScrambling is carried out to obtainTo scrambled binary sequences
First, the scrambled binary sequence is decodedThe middle elements are sequentially and positively grouped by taking 5 elements as a unit from the beginning to the end to obtain a grouped binary sequence which is expressed asSimultaneously scrambling the binary sequencesThe middle elements are sequentially and positively grouped by taking 5 elements as a unit from the beginning to the end to obtain a grouped binary sequence which is expressed asWherein each of the binary packet sequences BF1{ i } and BF2{ i } includes 5 binary bits, and
then, each binary packet sequence BF1{ i } and BF2{ i }, whereinThe following recombination operations were performed in sequence:
if mod (i,2) ═ 1, the most forward binary sequence of packets BF1{ i } is added with binary '110', denoted asWhile the top of the binary packet sequence BF2{ i } is padded with binary '101', denoted as
If mod (i,2) is 0, the elements in the binary grouping sequence BF1{ i } are firstly turned back and forth sequentially, and then binary '110' is added at the forefront of the elements to obtain a recombined binary grouping sequenceIs shown asSimultaneously, the elements in the binary grouping sequence BF2{ i } are firstly turned over in the front-back order and then added with binary '101' at the forefront to obtain a recombined binary grouping sequenceIs shown as
Finally, each recombined binary grouping sequence is sequentially generated by using a bin2dec (-) functionConversion into numerical dataSequentially grouping each recombined binary sequence at the same timeConversion into numerical dataWhereinThereby obtaining a numerical sequenceAnd
(4) transcoding: sequence of valuesAndcorresponding elements are combined in sequence and the numerical value and the Chinese character are converted to obtain a Chinese character sequence C, namely the commodity anti-counterfeiting number, wherein the length of the Chinese character sequence C isAnd combining the Chinese character commodity identification code A and the commodity anti-counterfeiting number to generate the Chinese character commodity anti-counterfeiting code.
Further, the Chinese character commodity anti-counterfeiting code generation method converts the Chinese character commodity identification code A representing the unique identity information of a certain commodity into numerical data [ P ] one by one according to the Chinese characters in the step (1)i1,Pi2]It is to convert the Chinese characters in the Chinese character commodity identification code A into numerical data by adopting unicode2native (·) function one by one, namely [ Pi1,Pi2]=unicode2native(Ai) So as to obtain a high-order numerical value sequence P1 ═ { P ═ P11,P21,...,Pi1,....,PL1And a low order value sequence P2 ═ P12,P22,...,Pi2,....,PL2}。
Further, the numerical sequence in the step (4) of the Chinese character commodity anti-counterfeiting code generation methodAndcorresponding elementThe elements are combined in sequence and the conversion between numerical values and Chinese characters is carried out, which means that numerical value sequences are combinedAndeach corresponding element in (a) is combined, i.e.And the numerical data is converted into Chinese characters by adopting a native2unicode (·) function,wherein
Further, the method for generating the Chinese character commodity anti-counterfeiting code combines the Chinese character commodity identification code A and the commodity anti-counterfeiting number in the step (4) to generate the commodity anti-counterfeiting code, and the method is a combination mode that the Chinese character commodity identification code A and the commodity anti-counterfeiting number are directly connected in sequence, or directly connected in reverse order, or connected in spaced insertion order.
Has the advantages that: the invention utilizes chaotic mapping to generate chaotic signal sequences, carries out scrambling on 2 binary sequences converted from Chinese character commodity identification codes respectively, groups elements in the scrambled binary sequences, and carries out different recombination operations according to the odd-even number of the grouped sequences, thereby generating commodity anti-counterfeiting numbers and further generating Chinese character commodity anti-counterfeiting codes in a combined manner.
Drawings
FIG. 1 is a schematic diagram of a process for generating anti-counterfeit codes for Chinese character commodities.
Detailed Description
The method for generating the anti-counterfeiting code of the Chinese character commodity as shown in figure 1 comprises the following steps:
(1) transcoding
Firstly, Chinese character commodity identification code A representing unique identity information of a certain commodity is converted into numerical data [ P ] one by onei1,Pi2]It is to convert the Chinese characters in the Chinese character commodity identification code A into numerical data by adopting unicode2native (·) function one by one, namely [ Pi1,Pi2]=unicode2native(Ai) To obtain a high-order numerical sequence P1 ═ { P ═ P11,P21,...,Pi1,....,PL1And a low order value sequence P2 ═ P12,P22,...,Pi2,....,PL2}。
Then, the high-order binary sequence P1 is converted into binary data of 8bits element by element, resulting in a high-order binary sequence PB1 ═ PB11,PB12,...,PB1i,....,PB18×LSimultaneously, the low-order value sequence P2 is converted into binary data of 8bits element by element, and a low-order binary sequence PB2 ═ PB2 is obtained1,PB22,...,PB2i,....,PB28×L},
Finally, let LB ═ mod (5-mod (8 × L,5),5), add LB '0' binary bits to the end of the higher binary sequence PB1, and LB '1' binary bits to the end of the lower binary sequence PB2, to obtain a binary sequence And binary sequence
The Chinese character commodity identification code A comprises Chinese punctuation marks in a GB2312 character set and Chinese characters of double-byte codes in the GB2312 character set, the length of the Chinese character commodity identification code A is represented as L, and the lengths of numerical value sequences P1 and P2 are bothFor L, the binary sequences PB1 and PB2 are both 8 × L in lengthAndall have the length of
Firstly, an initial value x of Logistic chaotic mapping is respectively calculated and obtained by utilizing a high-order numerical value sequence P1, a low-order numerical value sequence P2 and external keys alpha and beta according to the following formula1A sum parameter mu, an extraction start position m, and an extraction interval number n1、n2,
x1=0.00001+mod(α-kp1,0.99999) (1)
μ=β+mod(kp1,4-β) (2)
Wherein the external key satisfies α ∈ (0,1), β ∈ (3.57,4),
then, the initial value x mapped by chaos1And an external key mu, and iterating the Logistic chaotic mapping shown in the following formula, wherein k represents iteration times (k is 1,2, and.) and xk+1Represents the chaotic signal obtained by the k-th iteration,
xk+1=μ×xk×(1-xk) (6)
obtaining a chaotic signal sequence X ═ X1,x2,., spaced by n from the m-th element in the sequence X1Each element is 1 element to form a length ofOf the chaotic signal sequenceAt the same time, the m-th element in the sequence X is sequentially spaced by n2Each element is 1 element to form a length ofOf the chaotic signal sequence
Finally, the chaotic signal sequence X1 is sorted in descending order, and the binary sequence is scrambled according to the position change scrambling rule before and after the chaotic signal sequence X1 is sortedScrambling is carried out to obtain a scrambled binary sequenceSimultaneously, the chaotic signal sequence X2 is sorted in a descending order, and the binary sequence is scrambled according to the position change scrambling rule before and after the chaotic signal sequence X2 is sortedScrambling is carried out to obtain a scrambled binary sequence
First, the scrambled binary sequence is decodedThe middle elements are sequentially and positively grouped by taking 5 elements as a unit from the beginning to the end to obtain a grouped binary sequence which is expressed asSimultaneously scrambling the binary sequencesThe middle elements are sequentially and positively grouped by taking 5 elements as a unit from the beginning to the end to obtain a grouped binary sequence which is expressed asWherein each of the binary packet sequences BF1{ i } and BF2{ i } includes 5 binary bits, and
then, each binary packet sequence BF1{ i } and BF2{ i }, whereinThe following recombination operations were performed in sequence:
if mod (i,2) ═ 1, the first of the sequence of binary packets BF1{ i }, thenThe faces are added with binary '110', denoted asWhile the top of the binary packet sequence BF2{ i } is padded with binary '101', denoted as
If mod (i,2) is 0, the elements in the binary grouping sequence BF1{ i } are firstly turned back and forth sequentially, and then binary '110' is added at the forefront of the elements to obtain a recombined binary grouping sequenceIs shown asSimultaneously, the elements in the binary grouping sequence BF2{ i } are firstly turned over in the front-back order and then added with binary '101' at the forefront to obtain a recombined binary grouping sequenceIs shown as
Finally, each recombined binary grouping sequence is sequentially generated by using a bin2dec (-) functionConversion into numerical dataSequentially grouping each recombined binary sequence at the same timeConversion into numerical dataWhereinThereby obtaining a numerical sequenceAnd
(4) transcoding: sequence of valuesAndcorresponding elements are combined in sequenceAnd converting numerical data into Chinese characters by using native2unicode (·) function, i.e. converting numerical data into Chinese charactersWhereinAnd combining the Chinese character commodity identification code A and the commodity anti-counterfeiting number in a combination mode of direct sequence connection, direct reverse sequence connection or interval insertion sequence connection to generate the Chinese character commodity anti-counterfeiting code.
The invention is further illustrated by the following specific examples:
example 1
The method for generating the anti-counterfeiting code of the Chinese character commodity comprises the following steps:
(1) firstly, the Chinese character commodity identification code A which represents the unique identification information of a certain commodity is converted into numerical data one by one according to the commodity production date 2020-02-01 production line 12 serial number 123456 so as to obtain a high-order value sequence P1 ═ 189,203,202,163,163,188,205,161,161,215,185,203,161,163,163,201,198,161,201,178,200,198,163,163,163,163,163,163,163,163,163,163,161,201,178,207,163,163,208,193,186,163,163,163,163,163,163 and a low-order value sequence P2 ═ 173,213,161,163,163,175,197,193,193,211,171,190,161,192,192,204,183,161,250,250,213,218,178,176,178,176,173,176,178,173,176,177,161,250,250,223,177,178,242,208,197,177,178,179,180,181,182.
Then, the high-order bit value sequence P1 is converted into binary data of 8bits element by element, so as to obtain a high-order binary sequence PB1, which is {1,0,1,1,1,1, 1,0,0,1,0,1,0,1,0, 0,0,0,1,1,1,0,1,1, 0,0,1,1,0,0,0,0, 1,1,1,1,1,0,0,0,1, 1,0,1,0,0,0,1,1,1,1, 1,0,1,0,0,0,1,1,1,0,1,0,1, 0,0,0,0,0,0,1,1,1,0,1,0,0,0,1,1,1,1,0,0,1,0,0,1,1,1,0,0,0,1,1,0,1,0,1,0,0,0,0,1,1,1,0,0,1,0,0,1,1,0,1,1,0,0,1,0,1,1,0,0,1,0,0,0,1,1,0,0,0,1,1,0,1,0,1,0,0,0,1,1,1,0,1,0,0,0,1,1,1,0,1,0,0,0,1,1,1,0,1,0,0,0,1,1,1,0,1,0,0,0,1,1,1,0,1,0,0,0,1,1,1,0,1,0,0,0,1,1,1,0,1,0,0,0, 1,1,1,0,1,0,0,0,1,1,1,0,1,0,0,0,1,1,1,0,1,0,0,0,0,1,1,1,0,0,1,0,0,1,1,0,1,1,0,0,1,0,1,1,0,0,1,1,1,1,1,0,1,0,0,0,1,1,1,0,1,0,0,0,1,1,1,1,0,1,0,0,0,0,1,1,0,0,0,0,0,1,1,0,1,1,1,0,1,0,1,0,1,0,0,0,1,1,1,0,1,0,0,0,1,1,1,0,1,0,0,0,1,1,1,0,1,0,0,0,1,1,1,0,1,0,0,0,1,1,1,0,1,0,0,0,1,1}, and simultaneously converting the low-order bit value sequence P2 into binary data of 8bits one by one, to obtain a low-order binary sequence PB2, which is {1,0,1,0,1, 0,1,0,0,0,0, 0,1,0,1,0,1,1,1, 1,0,1,0,1,1,0,1,1,1,0, 0,0,1,1,0,1,0,1,0, 1,1,0,1,0,1,0,0,0,0,1,1,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,1,0,0,1,1,0,0,1,0,1,1,0,1,1,1,1,0,1,0,0,0,0,1,1,1,1,1,1,0,1,0,1,1,1,1,1,0,1,0,1,1,0,1,0,1,0,1,1,1,0,1,1,0,1,0,1,0,1,1,0,0,1,0,1,0,1,1,0,0,0,0,1,0,1,1,0,0,1,0,1,0,1,1,0,0,0,0,1,0,1,0,1,1,0,1,1,0,1,1,0,0,0,0,1,0,1,1,0,0,1,0,1,0,1,0,1,1,0,1,1,0,1,1,0,0,0,0,1,0,1,1,0,0,0,1,1,0,1,0,0,0,0,1,1,1,1,1,1,0,1,0,1,1,1,1,1,0,1,0,1,1,0,1,1,1,1,1,1,0,1,1,0,0,0,1,1,0,1,1,0,0,1,0,1,1,1,1,0,0,1,0,1,1,0,1,0,0,0,0,1,1,0,0,0,1,0,1,1,0,1,1,0,0,0,1,1,0,1,1,0,0,1,0,1,0,1,1,0,0,1,1,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,1,1,0,1,1,0,1,1,0},
finally, let LB be mod (5-mod (8 × 47,5),5 be 4, add 4 '0' binary bits to the end of the higher binary sequence PB1, and add 4 '1' binary bits to the end of the lower binary sequence PB2, to obtain a binary sequence PB2 And binary sequence
The length of the Chinese character commodity identification code A is L-47, the length of each of the numerical sequence P1 and P2 is L-47, the length of each of the binary sequence PB1 and PB2 is 8 xL-376, and the length of each of the binary sequence PB1 and PB2 is 8 xL-376Andall have the length of
(2) First, using the numerical value sequences P1 and P2 and the external keys α ═ 0.12345 and β ═ 3.75, the initial value x of the Logistic chaotic map is calculated according to the following formula1A sum parameter mu, an extraction start position m, and an extraction interval number n1、n2,
x1=0.00001+mod(0.12345-0.172389696730833,0.99999)=0.951060303269167
μ=3.75+mod(0.172389696730833,4-3.75)=3.922389696730833
Then, the initial value x mapped by chaos10.951060303269167 and 3.922389696730833 of an external key mu, iterating the Logistic chaotic mapping to obtain a chaotic signal sequence X { X ═ X }1,x2,., taking 1 element at 22 elements in sequence starting from the 334 th element in the sequence X to form a chaotic signal sequence X1 with the length of 380 ═ X11,X12,...,X1380And simultaneously taking 1 element from the 334 th element in the sequence X at intervals of 24 elements to form a chaotic signal sequence X2 with the length of 380 (X2)1,X22,...,X2380},
Finally, the chaotic signal sequence X1 is sorted in descending order, and the binary sequence is scrambled according to the position change scrambling rule before and after the chaotic signal sequence X1 is sortedScrambling is carried out to obtain a scrambled binary sequence Simultaneously, the chaotic signal sequence X2 is sorted in a descending order, and the binary sequence is scrambled according to the position change scrambling rule before and after the chaotic signal sequence X2 is sorted Obtaining a scrambled binary sequence
(3) First, the scrambled binary sequence is alignedAndgrouping the binary sequences separatelyThe middle elements are sequentially grouped by 5 elements in the forward direction from beginning to end to obtain a binary sequence after grouping, which is represented as BF1{1} {0,0,0,1,1}, BF1{2} {1,1,0, 0}, …, BF1{38} {0,0,1,0,0}, …, BF1{75} {0,0,1,1,1}, BF1{76} {0,0,1,1,0}, and the binary sequence is simultaneously grouped in the forward direction from beginning to end to represent the binary sequence as {0,0,0,1,1, 0}, and the binary sequence is also represented as BFThe middle elements are grouped by 5 elements in the forward direction from beginning to end to obtain a binary sequence after grouping, which is expressed as BF2{1} - {1,1,0,1,0}, BF2{2} - {0,0,0,0,1},…,BF2{38}={0,1,0,1,1},…,BF2{75}={0,0,1,0,1},BF2{76}={0,0,0,1,1},
then, each binary packet sequence BF1{ i } and BF2{ i }, whereinSequentially carrying out recombination operation to obtain recombined binary grouping sequence expressed as And BF2{1} - {1,0,1,1,1,0,1,0}, BF2{2} - {1,0,1,1,0,0,0,0}, …, BF2{38} - {1,0,1,0, 0}, …, BF2{75} - {1,0,1,0,0,1,0,1}, BF2{76} - {1,0,1,1,0,0, 0},
finally, each recombined binary grouping sequence is sequentially divided into groups by utilizing a bin2dec (-) functionConversion into numerical dataSequentially grouping each recombined binary sequence at the same timeConversion into numerical dataWherein i is 1,2, 3.., 76, thereby obtaining a sequence of values And
(4) sequence of valuesAndeach element is combined and the numerical value and the Chinese character are converted, the Chinese character commodity anti-counterfeiting code is obtained as follows, wherein the Chinese character commodity anti-counterfeiting code is 'the coal majestic crab fasciculation weft department tsunami linkage hissing barrel morningglory pseudo hissing blanket yusi running cany crab azulene means either lean carbon and inferior mu coal unloading twitch uned in names of mythical beings exert oneself yellow jacket zhao shuang zhao amu Yingzhao amu best relation collapse salary special bags of willow branches, framed by bamboo, for building dykes yu tail hisyuyan tai water chestnut istian Yingpian Yishuang weft core frost-feeding chatting borer', the Chinese character commodity anti-counterfeiting code A and the commodity anti-counterfeiting code are combined in a direct sequence connection mode, or direct reverse sequence connection mode, or interval insertion connection mode,
direct sequential connection: "Jiangsu # # group x son company @ production line 12 serial number 123456 commercial production date 2020-02-01 production line 12 serial number 123456 coal seizing coupon latitude linkage hissing barrel glycoside yarn mildew fake hissing blanket Yulin Jiangxi post crab Yulin barren charcoal inferior sea grass rather than Yulin Jiang post crab azulene Yulin charcoal inferior sea grass unloading coal curtain yellow mu uned in names of mythical beings exert oneself Shushuang awl rescue Yizhen Yinyang frame good relation collapse salary special bags of willow branches, framed by bamboo, for building dykes whorl fiver Yinyang water chestnut isthmus piece Ying latitude core cream feeding talk,
direct reverse order connection: "talk about Han cream feeding core latitude Yingpian fxia water chestnut Feishi Ying Yuan Xuan Yuan special bags of willow branches, framed by bamboo, for building dykes Jian Yuan Jian Ying Sha Yuan Jian exert oneself uned in names of mythical beings Twen coal unloading Yuan Zhi Cao Xiao Zao Zhi Yuan Cao Yuan Yi Bian Yan Yi Fu Lin Yi Cao Yi Yuan Cao Yi Xuan Yao Jian coal 6521 # sequence 21 line produces 10-20-0202 day product Shangen Shi Gong Yi (Du prince x Yuan Jiang # # province Su Jiang #,
interval insertion connection: "Jiangsu maoyan province crab # baozhou jianyan jianggong barrel extract x howl x lianzi yangong extract a glycoside @ a mould commercial fake product hissing blanket production on the best stage of Yu Si is driven 2 salary 0 rolling 2 to 0 crab-azulene 0 means 2 water shield-poor 0 1 carbon sea producing mu line unloading 1 coal 2 sequence rose column uned in names of mythical beings No. exert oneself 1 shuang 2 shuang 3 cone 4 rescue 5 rescue 6 Tibet zhang frame through relation collapse salary special bags of willow branches, framed by bamboo, for building dykes zilian shanghai Yingsi fetus water chestnut Yingjiangxian latitude core feeding cream talk",
example 2
According to the method for generating the anti-counterfeiting code of the Chinese character commodity, the commodity identification code character string A of a certain commodity and the generation steps of the anti-counterfeiting code of the commodity are similar to those of the specific embodiment 1, and only a certain external secret key is slightly changed: 0.12345000000001; or beta-3.74999999999999, the result of the generation of the anti-counterfeiting code of the Chinese character commodity is shown in table 1. As can be seen from the following table: once the external secret key slightly changes, the generated commodity anti-counterfeiting number and the Chinese character commodity anti-counterfeiting code can greatly change, so that the Chinese character commodity anti-counterfeiting code generation method provided by the patent has secret key sensitivity.
TABLE 1 Generation result of anti-counterfeit code for Chinese character commodities when external secret key is slightly changed
Example 3
According to the above method for generating the anti-counterfeit code of the Chinese character product, the steps for generating the external secret key and the anti-counterfeit code are similar to those of the embodiment 1, only the character string A of the product identification code of a certain product (the product production date 2020-02-01 production line 12 serial No. 123456 in Jiangsu province # # group x. a subsidiary company @) is slightly changed: "Gang Suzhou # group x a company @ commercial production date 2020-02-01 production line 12 serial No. 123456"; or "Jiangsu province # # group x son company @ brand product production date 2020-12-01 production line 12 serial No. 123456"; or "Jiangsu province # # group x son company @ product production date 2020-02-01 production line 12 serial number 123459", the generation result of Chinese character commodity anti-counterfeiting code is shown in Table 2. As can be seen from the following table: once the commodity identification code character string representing the unique identification information of a certain commodity slightly changes, the generated commodity anti-counterfeiting number and the Chinese character commodity anti-counterfeiting code can greatly change, so that the Chinese character commodity anti-counterfeiting code generation method provided by the patent has sensitivity to the commodity identification information (namely the commodity identification code character string).
TABLE 2 Generation result of commodity anti-counterfeit code when commodity identification code is slightly changed
It can be seen from the above specific embodiments 2 and 3 that the anti-counterfeiting code generated by the anti-counterfeiting code generation method for Chinese character commodities provided by the present patent is not only closely related to an external secret key, but also depends on a commodity identification code character string representing unique identity information of a certain commodity, so that the anti-counterfeiting code generation method for Chinese character commodities provided by the present patent has strong security, can better resist known/selected plaintext attacks, is not easy to crack, and ensures that the generated anti-counterfeiting code for Chinese character commodities has "uniqueness" and "unforgeability".
Although the present invention has been described with reference to a preferred embodiment, it should be understood that various changes, substitutions and alterations can be made herein without departing from the spirit and scope of the invention as defined by the appended claims.
Claims (4)
1. A Chinese character commodity anti-counterfeiting code generation method is characterized by comprising the following steps:
(1) transcoding:
firstly, Chinese character commodity identification code A representing unique identity information of a certain commodity is converted into numerical data [ P ] one by onei1,Pi2]To obtain a high-order numerical sequence P1 ═ { P ═ P11,P21,...,Pi1,....,PL1And a low order value sequence P2 ═ P12,P22,...,Pi2,....,PL2},
Then, the high-order binary sequence P1 is converted into binary data of 8bits element by element, resulting in a high-order binary sequence PB1 ═ PB11,PB12,...,PB1i,....,PB18×LSimultaneously, the low-order value sequence P2 is converted into binary data of 8bits element by element, and a low-order binary sequence PB2 ═ PB2 is obtained1,PB22,...,PB2i,....,PB28×L},
Finally, let LB ═ mod (5-mod (8 × L,5),5), add LB '0' binary bits to the end of the higher binary sequence PB1, and LB '1' binary bits to the end of the lower binary sequence PB2, to obtain a binary sequence And binary sequence
The Chinese character commodity identification code A comprises Chinese punctuation marks in a GB2312 character set and double-byte coded Chinese characters in the GB2312 character set, the length of the Chinese character commodity identification code A is represented as L, the lengths of numerical value sequences P1 and P2 are L, the lengths of binary sequences PB1 and PB2 are 8 xL, and the lengths of the binary sequences are 8 xLAndall have the length of
firstly, an initial value x of the Logistic chaotic map is respectively calculated and obtained by utilizing a high-order numerical value sequence P1, a low-order numerical value sequence P2 and external keys alpha and beta according to the following formulas (1) - (5)1A sum parameter mu, an extraction start position m, and an extraction interval number n1、n2Let us orderThen
x1=0.00001+mod(α-kp1,0.99999) (1)
μ=β+mod(kp1,4-β) (2)
Wherein the external key satisfies α ∈ (0,1), β ∈ (3.57,4),
then, the initial value x mapped by chaos1And an external key mu, iterating the Logistic chaotic mapping shown in the following formula (6), wherein k represents iteration times (k is 1, 2), xk+1Represents the chaotic signal obtained by the k-th iteration,
xk+1=μ×xk×(1-xk) (6)
obtaining a chaotic signal sequence X ═ X1,x2,., spaced by n from the m-th element in the sequence X1Each element is 1 element to form a length ofOf the chaotic signal sequenceAt the same time, the m-th element in the sequence X is sequentially spaced by n2Each element is 1 element to form a length ofOf the chaotic signal sequence
Finally, the chaotic signal sequence X1 is sorted in descending order, and the binary sequence is scrambled according to the position change scrambling rule before and after the chaotic signal sequence X1 is sortedScrambling is carried out to obtain a scrambled binary sequenceSimultaneously, the chaotic signal sequence X2 is sorted in a descending order, and the binary sequence is scrambled according to the position change scrambling rule before and after the chaotic signal sequence X2 is sortedScrambling is carried out to obtain a scrambled binary sequence
first, the scrambled binary sequence is decodedThe middle elements are sequentially and positively grouped by taking 5 elements as a unit from the beginning to the end to obtain a grouped binary sequence which is expressed asSimultaneously scrambling the binary sequencesThe middle elements are sequentially and positively grouped by taking 5 elements as a unit from the beginning to the end to obtain a grouped binary sequence which is expressed asWherein each of the binary packet sequences BF1{ i } and BF2{ i } includes 5 binary bits, and
then, each sequence of binary packets BF1{ i } and BF2{ i }, where i is 1,2, 3.,the following recombination operations were performed in sequence:
if mod (i,2) ═ 1, the most forward binary sequence of packets BF1{ i } is added with binary '110', denoted asWhile the top of the binary packet sequence BF2{ i } is padded with binary '101', denoted as
If mod (i,2) is 0, the elements in the binary grouping sequence BF1{ i } are firstly turned back and forth sequentially, and then binary '110' is added at the forefront of the elements to obtain a recombined binary grouping sequenceIs shown asSimultaneously, the elements in the binary grouping sequence BF2{ i } are firstly turned over in the front-back order and then added with binary '101' at the forefront to obtain a recombined binary grouping sequenceIs shown as
Finally, each recombined binary grouping sequence is sequentially generated by using a bin2dec (-) functionConversion into numerical data Conversion into numerical dataWherein i is 1,2, 3.,thereby obtaining a numerical sequenceAnd
(4) transcoding:
sequence of valuesAndcorresponding elements in the groupCombining the numerical values and the Chinese characters to obtain a Chinese character sequence C, namely the commodity anti-counterfeiting number, wherein the length of the Chinese character sequence C isAnd combining the Chinese character commodity identification code A and the commodity anti-counterfeiting number to generate the Chinese character commodity anti-counterfeiting code.
2. The method for generating anti-counterfeiting codes for Chinese character commodities as claimed in claim 1, wherein: the Chinese character commodity identification code A representing the unique identity information of a certain commodity in the step (1) is converted into numerical data [ P ] one by onei1,Pi2]It is to convert the Chinese characters in the Chinese character commodity identification code A into numerical data by adopting unicode2native (·) function one by one, namely [ Pi1,Pi2]=unicode2native(Ai) So as to obtain a high-order numerical value sequence P1 ═ { P ═ P11,P21,...,Pi1,....,PL1And a low order value sequence P2 ═ P12,P22,...,Pi2,....,PL2}。
3. The method for generating anti-counterfeiting codes for Chinese character commodities as claimed in claim 1, wherein: the numerical sequence in step (4)Andcorresponding elements are combined in sequence and the conversion between numerical values and Chinese characters is carried out, which means that numerical value sequences are combinedAndin which corresponding elements are combined, i.e.And converting numerical data into Chinese characters by using native2unicode (·) function, i.e. converting numerical data into Chinese charactersWherein i is 1,2, 3.,
4. the method for generating anti-counterfeiting codes for Chinese character commodities as claimed in claim 1, wherein: the step (4) of combining the Chinese character commodity identification code A and the commodity anti-counterfeiting number to generate the commodity anti-counterfeiting code is to adopt a combination mode of directly connecting the Chinese character commodity identification code A and the commodity anti-counterfeiting number in sequence, or directly connecting the Chinese character commodity identification code A and the commodity anti-counterfeiting number in reverse sequence, or connecting the Chinese character commodity identification code A and the commodity anti-counterfeiting number in sequence at intervals.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010972003.7A CN112149774B (en) | 2020-09-16 | 2020-09-16 | Chinese character commodity anti-counterfeiting code generation method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010972003.7A CN112149774B (en) | 2020-09-16 | 2020-09-16 | Chinese character commodity anti-counterfeiting code generation method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112149774A true CN112149774A (en) | 2020-12-29 |
CN112149774B CN112149774B (en) | 2021-11-30 |
Family
ID=73892896
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010972003.7A Active CN112149774B (en) | 2020-09-16 | 2020-09-16 | Chinese character commodity anti-counterfeiting code generation method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112149774B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112884104A (en) * | 2021-03-24 | 2021-06-01 | 南通大学 | Commodity anti-counterfeiting two-dimensional code generation method based on chaotic encryption |
CN113255860A (en) * | 2021-03-26 | 2021-08-13 | 南通大学 | Commodity anti-counterfeiting two-dimensional code generation method based on layered encryption |
CN113343639A (en) * | 2021-05-19 | 2021-09-03 | 网易(杭州)网络有限公司 | Product identification code image generation and information query method based on product identification code image |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104680220A (en) * | 2015-03-24 | 2015-06-03 | 南通大学 | Commodity anti-counterfeiting code batch generation method |
CN105354717A (en) * | 2015-11-30 | 2016-02-24 | 南通大学 | Colorful commodity anti-counterfeiting code generating method |
CN107425956A (en) * | 2017-07-27 | 2017-12-01 | 南通大学 | A kind of character type commodity counterfeit prevention code generating method |
CN111382820A (en) * | 2020-02-25 | 2020-07-07 | 南通大学 | Four-lattice pure-color commodity anti-counterfeiting code generation method |
-
2020
- 2020-09-16 CN CN202010972003.7A patent/CN112149774B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104680220A (en) * | 2015-03-24 | 2015-06-03 | 南通大学 | Commodity anti-counterfeiting code batch generation method |
CN105354717A (en) * | 2015-11-30 | 2016-02-24 | 南通大学 | Colorful commodity anti-counterfeiting code generating method |
CN107425956A (en) * | 2017-07-27 | 2017-12-01 | 南通大学 | A kind of character type commodity counterfeit prevention code generating method |
CN111382820A (en) * | 2020-02-25 | 2020-07-07 | 南通大学 | Four-lattice pure-color commodity anti-counterfeiting code generation method |
Non-Patent Citations (3)
Title |
---|
吴新华: "基于混沌密码的数码防伪追溯***设计", 《计算机与数字工程》 * |
盛苏英等: "基于混沌的数码防伪***研究与实现", 《微电子学与计算机》 * |
盛苏英等: "混沌密码技术在数码防伪中的应用研究", 《信息技术》 * |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112884104A (en) * | 2021-03-24 | 2021-06-01 | 南通大学 | Commodity anti-counterfeiting two-dimensional code generation method based on chaotic encryption |
CN112884104B (en) * | 2021-03-24 | 2022-07-05 | 南通大学 | Commodity anti-counterfeiting two-dimensional code generation method based on chaotic encryption |
CN113255860A (en) * | 2021-03-26 | 2021-08-13 | 南通大学 | Commodity anti-counterfeiting two-dimensional code generation method based on layered encryption |
CN113255860B (en) * | 2021-03-26 | 2022-08-02 | 南通大学 | Commodity anti-counterfeiting two-dimensional code generation method based on layered encryption |
CN113343639A (en) * | 2021-05-19 | 2021-09-03 | 网易(杭州)网络有限公司 | Product identification code image generation and information query method based on product identification code image |
CN113343639B (en) * | 2021-05-19 | 2023-10-03 | 网易(杭州)网络有限公司 | Product identification code diagram generation and information query method based on product identification code diagram |
Also Published As
Publication number | Publication date |
---|---|
CN112149774B (en) | 2021-11-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112149774B (en) | Chinese character commodity anti-counterfeiting code generation method | |
CN109472338B (en) | Batch generation method of commodity anti-counterfeiting two-dimensional codes | |
CN109284803B (en) | Commodity anti-counterfeiting two-dimensional code generation method | |
CN112149773B (en) | Commodity anti-counterfeiting code generation method based on Chinese character encryption | |
CN112163230B (en) | Commodity anti-counterfeiting code generation method based on Chinese character encryption | |
CN111985591B (en) | Commodity anti-counterfeiting code generation method based on character string encryption | |
CN112884104B (en) | Commodity anti-counterfeiting two-dimensional code generation method based on chaotic encryption | |
CN103310255B (en) | A kind of coding method of color character and its coding/decoding method | |
CN112001468B (en) | Character type commodity anti-counterfeiting code generation and identification method | |
CN109995504B (en) | Encryption and decryption method for character string | |
CN105354717B (en) | A kind of colour commodity counterfeit prevention code generating method | |
CN104680220A (en) | Commodity anti-counterfeiting code batch generation method | |
CN112001467B (en) | Commodity anti-counterfeiting code generation and identification method based on picture encryption and decryption | |
CN113255860B (en) | Commodity anti-counterfeiting two-dimensional code generation method based on layered encryption | |
CN111382820B (en) | Four-lattice pure-color commodity anti-counterfeiting code generation method | |
CN106375083A (en) | Encryption-decryption method based on Base64 and device thereof | |
CN112217627B (en) | Layered encrypted commodity anti-counterfeiting code generation method | |
CN107425956A (en) | A kind of character type commodity counterfeit prevention code generating method | |
CN111353166A (en) | Encryption method for converting picture into Chinese character | |
CN103824197B (en) | Security code generating means | |
CN110650006B (en) | Encryption and decryption method for Chinese and English character strings | |
CN107659399A (en) | It is a kind of to be pretended, solved the method for camouflage to character based on not repeating key | |
CN113935345B (en) | Commodity anti-counterfeiting code batch generation method based on character string-to-picture encryption | |
CN114707165A (en) | Character string encryption method based on hierarchical scrambling | |
CN102904796A (en) | Mailbox sharing method and mail server |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |