CN112149774A - Chinese character commodity anti-counterfeiting code generation method - Google Patents

Chinese character commodity anti-counterfeiting code generation method Download PDF

Info

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
counterfeiting
commodity
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
Application number
CN202010972003.7A
Other languages
Chinese (zh)
Other versions
CN112149774B (en
Inventor
盛苏英
吴新华
张小美
陆国平
张振娟
高岩波
周磊
任洁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nantong University
Original Assignee
Nantong University
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Nantong University filed Critical Nantong University
Priority to CN202010972003.7A priority Critical patent/CN112149774B/en
Publication of CN112149774A publication Critical patent/CN112149774A/en
Application granted granted Critical
Publication of CN112149774B publication Critical patent/CN112149774B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K19/00Record carriers for use with machines and with at least a part designed to carry digital markings
    • G06K19/06Record 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/06009Record 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K19/00Record carriers for use with machines and with at least a part designed to carry digital markings
    • G06K19/06Record 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/06009Record 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/06046Constructional details
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION 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/00Commerce
    • G06Q30/018Certifying business or products
    • G06Q30/0185Product, service or business identity fraud
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/001Cryptographic 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

本发明公开了一种汉字商品防伪码生成方法,包括如下步骤:将表征某件商品唯一身份信息的汉字商品标识码A,进行数值型数据和8bits二进制转换,以及二进制增补操作得到二进制序列

Figure DDA0002684420160000011
Figure DDA0002684420160000012
计算得到混沌系统的初值和参数、抽取开始位置、抽取间隔数,混沌迭代得到混沌序列X1和X2,利用序列X1和X2的降序排序前、后的位置变化规则,分别对二进制序列
Figure DDA0002684420160000013
Figure DDA0002684420160000014
进行置乱,得到置乱后的二进制序列
Figure DDA0002684420160000015
Figure DDA0002684420160000016
分别将二进制序列
Figure DDA0002684420160000017
Figure DDA0002684420160000018
中元素正向以5个元素为单位进行分组,再将奇偶分组序列分别进行重组,从而生成商品防伪号,进而组合生成汉字商品防伪码。本发明所提汉字商品防伪码生成方法简单可行,具有很强的安全性、不易破解,生成的汉字商品防伪码具有“唯一性和不可伪造性”。

Figure 202010972003

The invention discloses a method for generating an anti-counterfeiting code for Chinese characters, comprising the following steps: converting a Chinese character product identification code A, which represents the unique identity information of a certain product, to numerical data and 8-bit binary conversion, and performing a binary supplement operation to obtain a binary sequence

Figure DDA0002684420160000011
and
Figure DDA0002684420160000012
The initial value and parameters of the chaotic system, the starting position of extraction, and the number of extraction intervals are calculated, and the chaotic sequences X1 and X2 are obtained by chaotic iteration. Using the position change rules before and after the descending order of the sequences X1 and X2, the binary sequence
Figure DDA0002684420160000013
and
Figure DDA0002684420160000014
Scramble to get the scrambled binary sequence
Figure DDA0002684420160000015
and
Figure DDA0002684420160000016
separate binary sequences
Figure DDA0002684420160000017
and
Figure DDA0002684420160000018
The middle elements are grouped in units of 5 elements in the forward direction, and then the parity grouping sequences are recombined respectively, so as to generate the product anti-counterfeiting number, and then combine to generate the Chinese character product anti-counterfeiting code. The method for generating Chinese character commodity anti-counterfeiting codes provided by the invention is simple and feasible, has strong security, and is not easy to be deciphered, and the generated Chinese character commodity anti-counterfeiting codes have "uniqueness and unforgeability".

Figure 202010972003

Description

一种汉字商品防伪码生成方法A method for generating anti-counterfeiting codes for Chinese characters

技术领域technical field

本发明涉及数码防伪技术领域,特别涉及一种汉字商品防伪码生成方法。The invention relates to the technical field of digital anti-counterfeiting, in particular to a method for generating anti-counterfeiting codes for Chinese characters.

背景技术Background technique

假冒伪劣产品屡见不鲜,需要我们切实地采取行动去维护厂家及消费者的权益。假冒产品对各行各业构成严重威胁,尤其是药品、农产品、汽车零部件、计算机软件以及昂贵的香水、化妆品、珠宝、手表和名牌服装等奢侈品。日内瓦国际商会估计,全球每年假冒产品的销售额达6,500亿美元。假冒药品和酒类产品尤其成问题,这不单单是造假,造假者做出的行为,严重危害了消费者的权益:药品的假冒使得病情延误甚至加重病情;假酒害人的事情更是屡见不鲜,这也沉重打击了商家的信誉,消费者的信心,对于经济社会秩序的良好建立危害极大。因而诞生了众多的防伪手段,例如:特别的包装,设计复杂的图标,提供小样等等。但这些手段常常因为缺乏技术,导致防伪性能不够,容易让造假者钻了空子。随着时代的进步,防伪技术有了很大的突破。例如芯片技术,生物技术等等,但由于其高成本,查询端限制颇多等特点,应用于众多领域的实际可操作性不大。数码防伪技术自上世纪90年代中期推向市场以来,其自身得到了空前的发展。Counterfeit and shoddy products are common, and we need to take practical actions to protect the rights and interests of manufacturers and consumers. Counterfeit products pose a serious threat to all walks of life, especially pharmaceuticals, agricultural products, auto parts, computer software, and luxury goods such as expensive perfumes, cosmetics, jewelry, watches, and designer clothing. The International Chamber of Commerce in Geneva estimates that global sales of counterfeit products amount to $650 billion annually. Counterfeit medicines and alcoholic products are particularly problematic. This is not just counterfeiting. The actions of counterfeiters have seriously endangered the rights and interests of consumers: counterfeiting of medicines delays or even aggravates the disease; it is not uncommon for counterfeit alcohol to harm people. , which has also severely damaged the reputation of businesses and the confidence of consumers, and is extremely harmful to the establishment of a good economic and social order. As a result, many anti-counterfeiting measures have been born, such as: special packaging, designing complex icons, providing samples and so on. However, these methods are often insufficient in anti-counterfeiting performance due to lack of technology, and it is easy for counterfeiters to take advantage of the loopholes. With the progress of the times, anti-counterfeiting technology has made great breakthroughs. For example, chip technology, biotechnology, etc., but due to its high cost and many restrictions on the query side, it is not practical to apply in many fields. Since the digital anti-counterfeiting technology was introduced to the market in the mid-1990s, it has developed unprecedentedly.

数码防伪由于其结合了防伪印刷和数字加密技术、使用权限的一次性、生成密码的随机性以及不可揣测性等特点,使商品防伪得到了空前的保障,同时可以多种方式查询产品的真假性,能有效抑制假冒伪劣产品的猖獗。同时混沌信号作为一种天然的密码,被引入到商品防伪码生成过程中,具有更高的安全性。在此情况下,利用混沌密码技术,提出一种汉字商品防伪码生成方法,以生成具有“唯一性和不可伪造性”的汉字商品防伪码,具有很好的实际应用推广价值。Due to its combination of anti-counterfeiting printing and digital encryption technology, one-time use authority, randomness and unpredictability of generated passwords, digital anti-counterfeiting has made the anti-counterfeiting of goods unprecedentedly guaranteed, and can check the authenticity of products in various ways. It can effectively restrain the rampant of counterfeit and shoddy products. At the same time, chaotic signal, as a natural password, is introduced into the process of generating anti-counterfeiting codes of commodities, which has higher security. Under this circumstance, using the chaotic cryptography technology, a method for generating anti-counterfeiting codes of Chinese characters is proposed to generate anti-counterfeiting codes of Chinese characters with "uniqueness and unforgeability", which has good practical application and promotion value.

发明内容SUMMARY OF THE INVENTION

发明目的:本发明的目的是为了解决现有技术中的不足,提供一种汉字商品防伪码生成方法,利用混沌映射产生混沌信号序列,对汉字商品标识码转换而成的2个二进制序列分别进行置乱,并将置乱后的二进制序列中元素进行分组,以及根据分组序列的奇偶个数分别进行不同的重组操作,从而生成商品防伪号,进而组合生成汉字商品防伪码,以此保证所提汉字商品防伪码生成方法简单可行,具有很强的安全性、不易破解,生成的汉字商品防伪码具有“唯一性和不可伪造性”。Purpose of the invention: The purpose of the present invention is to solve the deficiencies in the prior art, and to provide a method for generating anti-counterfeiting codes for Chinese products, which utilizes chaotic mapping to generate chaotic signal sequences, and carries out 2 binary sequences converted from the Chinese character product identification codes. Scramble, group the elements in the scrambled binary sequence, and perform different recombination operations according to the odd and even numbers of the grouping sequence, so as to generate the product anti-counterfeiting number, and then combine to generate the Chinese character product anti-counterfeiting code, so as to ensure the proposed The method for generating Chinese character commodity anti-counterfeiting codes is simple and feasible, has strong security, and is not easy to crack, and the generated Chinese character commodity anti-counterfeiting codes have "uniqueness and unforgeability".

技术方案:一种汉字商品防伪码生成方法,其特征在于,包括如下几个步骤:Technical solution: a method for generating anti-counterfeiting codes for Chinese characters, characterized in that it includes the following steps:

(1)转码(1) Transcoding

首先,将表征某件商品唯一身份信息的汉字商品标识码A,逐个汉字转换为数值型数据[Pi1,Pi2],得到高位数值序列P1={P11,P21,...,Pi1,....,PL1}和低位数值序列P2={P12,P22,...,Pi2,....,PL2},First, convert the Chinese character product identification code A, which represents the unique identity information of a certain product, into numerical data [P i1 , P i2 ] one by one, and obtain a high-order numerical sequence P1={P 11 , P 21 ,...,P i1 ,....,P L1 } and low-order value sequence P2={P 12 ,P 22 ,...,P i2 ,....,P L2 },

然后,将高位数值序列P1逐个元素转换成8bits的二进制数据,得到高位二进制序列PB1={PB11,PB12,...,PB1i,....,PB18×L},同时将低位数值序列P2逐个元素转换成8bits的二进制数据,得到低位二进制序列PB2={PB21,PB22,...,PB2i,....,PB28×L},Then, convert the high-order numerical sequence P1 into 8-bit binary data element by element, and obtain the high-order binary sequence PB1={PB1 1 ,PB1 2 ,...,PB1 i ,....,PB1 8×L }, and at the same time convert the low-order The numerical sequence P2 is converted into binary data of 8bits element by element, and the low-order binary sequence PB2={PB2 1 ,PB2 2 ,...,PB2 i ,....,PB2 8×L } is obtained,

最后,令LB=mod(5-mod(8×L,5),5),将高位二进制序列PB1的末尾添加LB个‘0’二进制位,将低位二进制序列PB2的末尾添加LB个‘1’二进制位,得到二进制序列

Figure BDA0002684420140000021
Figure BDA0002684420140000022
和二进制序列
Figure BDA0002684420140000023
Figure BDA0002684420140000024
Finally, let LB=mod(5-mod(8×L,5),5), add LB '0' binary bits to the end of the high-order binary sequence PB1, and add LB '1' bits to the end of the low-order binary sequence PB2 binary bit, get binary sequence
Figure BDA0002684420140000021
Figure BDA0002684420140000022
and binary sequence
Figure BDA0002684420140000023
Figure BDA0002684420140000024

其中汉字商品标识码A包括GB2312字符集中的中文标点符号、GB2312字符集中双字节编码的汉字,汉字商品标识码A的长度表示为L,数值序列P1和P2的长度均为L,二进制序列PB1和PB2的长度均为8×L,二进制序列

Figure BDA0002684420140000025
Figure BDA0002684420140000026
的长度均为
Figure BDA0002684420140000027
The Chinese character product identification code A includes Chinese punctuation marks in the GB2312 character set and Chinese characters encoded in double-byte characters in the GB2312 character set. The length of the Chinese character product identification code A is expressed as L, the lengths of the numerical sequences P1 and P2 are both L, and the binary sequence PB1 and PB2 are both 8×L in length, a binary sequence
Figure BDA0002684420140000025
and
Figure BDA0002684420140000026
length of
Figure BDA0002684420140000027

(2)二进制序列

Figure BDA0002684420140000028
Figure BDA0002684420140000029
的置乱(2) Binary sequence
Figure BDA0002684420140000028
and
Figure BDA0002684420140000029
scramble

首先,利用高位数值序列P1和低位数值序列P2,以及外部密钥α和β,按照如下(1)-(5)公式分别计算得到Logistic混沌映射的初值x1和参数μ、抽取开始位置m,以及抽取间隔数n1、n2First, using the high-order numerical sequence P1 and the low-order numerical sequence P2, as well as the external keys α and β, according to the following formulas (1)-(5), the initial value x 1 and parameter μ of the Logistic chaotic map, and the extraction start position m are calculated respectively. , and the number of decimation intervals n 1 , n 2 ,

Figure BDA00026844201400000210
则make
Figure BDA00026844201400000210
but

x1=0.00001+mod(α-kp1,0.99999) (1)x 1 =0.00001+mod(α-kp1,0.99999) (1)

μ=β+mod(kp1,4-β) (2)μ=β+mod(kp1,4-β) (2)

Figure BDA00026844201400000211
Figure BDA00026844201400000211

Figure BDA00026844201400000212
Figure BDA00026844201400000212

Figure BDA00026844201400000213
Figure BDA00026844201400000213

其中,外部密钥满足α∈(0,1),β∈(3.57,4),Among them, the external key satisfies α∈(0,1), β∈(3.57,4),

然后,由混沌映射的初值x1和外部密钥μ,对如下公式(6)所示Logistic混沌映射进行迭代,式中k表示迭代次数(k=1,2,...)、xk+1表示第k次迭代得到的混沌信号,Then, based on the initial value x 1 of the chaotic map and the external key μ, the Logistic chaotic map shown in the following formula (6) is iterated, where k represents the number of iterations (k=1, 2,...), x k +1 represents the chaotic signal obtained at the kth iteration,

xk+1=μ×xk×(1-xk) (6)x k+1 = μ×x k ×(1-x k ) (6)

得到混沌信号序列X={x1,x2,...},从序列X中第m个元素开始依次间隔n1个元素取1个元素以形成长度为

Figure BDA00026844201400000214
的混沌信号序列
Figure BDA00026844201400000217
同时从序列X中第m个元素开始依次间隔n2个元素取1个元素以形成长度为
Figure BDA00026844201400000215
的混沌信号序列
Figure BDA00026844201400000216
The chaotic signal sequence X={x 1 , x 2 ,...} is obtained, starting from the mth element in the sequence X and taking 1 element at intervals of n 1 elements to form a length of
Figure BDA00026844201400000214
chaotic signal sequence of
Figure BDA00026844201400000217
At the same time, starting from the mth element in the sequence X, take 1 element at an interval of n 2 elements to form a length of
Figure BDA00026844201400000215
chaotic signal sequence of
Figure BDA00026844201400000216

最后,将混沌信号序列X1按降序排序,根据混沌信号序列X1排序前、后的位置变化置乱规则,对二进制序列

Figure BDA0002684420140000031
进行置乱,得到置乱后的二进制序列
Figure BDA0002684420140000032
同时将混沌信号序列X2按降序排序,根据混沌信号序列X2排序前、后的位置变化置乱规则,对二进制序列
Figure BDA0002684420140000033
进行置乱,得到置乱后的二进制序列
Figure BDA0002684420140000034
Finally, sort the chaotic signal sequence X1 in descending order, and scrambling the rules according to the position change before and after the sorting of the chaotic signal sequence X1.
Figure BDA0002684420140000031
Scramble to get the scrambled binary sequence
Figure BDA0002684420140000032
At the same time, sort the chaotic signal sequence X2 in descending order, and scrambling the rules according to the position change before and after the sorting of the chaotic signal sequence X2, and then the binary sequence
Figure BDA0002684420140000033
Scramble to get the scrambled binary sequence
Figure BDA0002684420140000034

(3)置乱后二进制序列

Figure BDA0002684420140000035
Figure BDA0002684420140000036
的分组、重组(3) Scrambled binary sequence
Figure BDA0002684420140000035
and
Figure BDA0002684420140000036
grouping, reorganization

首先,将置乱后的二进制序列

Figure BDA0002684420140000037
中元素从头到尾依次正向以5个元素为单位进行分组,得到分组后的二进制序列,表示为
Figure BDA0002684420140000038
同时将置乱后的二进制序列
Figure BDA0002684420140000039
中元素从头到尾依次正向以5个元素为单位进行分组,得到分组后的二进制序列,表示为
Figure BDA00026844201400000310
其中每一个二进制分组序列BF1{i}和BF2{i}均包含5个二进制位,且
Figure BDA00026844201400000311
First, the scrambled binary sequence
Figure BDA0002684420140000037
The elements in the middle are grouped in units of 5 elements from the beginning to the end, and the binary sequence after the grouping is obtained, which is expressed as
Figure BDA0002684420140000038
At the same time, the scrambled binary sequence will be
Figure BDA0002684420140000039
The elements in the middle are grouped in units of 5 elements from the beginning to the end, and the binary sequence after the grouping is obtained, which is expressed as
Figure BDA00026844201400000310
where each binary block sequence BF1{i} and BF2{i} contains 5 binary bits, and
Figure BDA00026844201400000311

然后,将每一个二进制分组序列BF1{i}和BF2{i},其中

Figure BDA00026844201400000312
依次进行如下重组操作:Then, each binary grouping sequence BF1{i} and BF2{i}, where
Figure BDA00026844201400000312
Perform the following reorganization operations in sequence:

如果mod(i,2)=1,则将二进制分组序列BF1{i}的最前面添上二进制‘110’,表示为

Figure BDA00026844201400000313
同时将二进制分组序列BF2{i}的最前面添上二进制‘101’,表示为
Figure BDA00026844201400000314
If mod(i,2)=1, then add binary '110' to the front of the binary block sequence BF1{i}, which is expressed as
Figure BDA00026844201400000313
At the same time, add binary '101' to the front of the binary grouping sequence BF2{i}, which is expressed as
Figure BDA00026844201400000314

如果mod(i,2)=0,则先将二进制分组序列BF1{i}中元素前后顺序翻转再在其最前面添上二进制‘110’,得到重组后的二进制分组序列

Figure BDA00026844201400000315
表示为
Figure BDA00026844201400000316
同时先将二进制分组序列BF2{i}中元素前后顺序翻转再在其最前面添上二进制‘101’,得到重组后的二进制分组序列
Figure BDA00026844201400000317
表示为
Figure BDA00026844201400000318
If mod(i, 2)=0, firstly reverse the order of the elements in the binary grouping sequence BF1{i}, and then add binary '110' to the front of the binary grouping sequence to obtain the reorganized binary grouping sequence
Figure BDA00026844201400000315
Expressed as
Figure BDA00026844201400000316
At the same time, the order of the elements in the binary grouping sequence BF2{i} is reversed, and the binary '101' is added to the front to obtain the reorganized binary grouping sequence.
Figure BDA00026844201400000317
Expressed as
Figure BDA00026844201400000318

最后,利用bin2dec(·)函数,依次将每一个重组后的二进制分组序列

Figure BDA00026844201400000319
转换成数值型数据
Figure BDA00026844201400000320
同时依次将每一个重组后的二进制分组序列
Figure BDA00026844201400000321
转换成数值型数据
Figure BDA00026844201400000322
其中
Figure BDA00026844201400000323
从而得到数值序列
Figure BDA00026844201400000324
Figure BDA00026844201400000325
Finally, use the bin2dec( ) function to sequentially divide each recombined binary grouping sequence
Figure BDA00026844201400000319
Convert to numeric data
Figure BDA00026844201400000320
At the same time, each recombined binary grouping sequence is sequentially
Figure BDA00026844201400000321
Convert to numeric data
Figure BDA00026844201400000322
in
Figure BDA00026844201400000323
to get the sequence of numbers
Figure BDA00026844201400000324
and
Figure BDA00026844201400000325

(4)转码:将数值序列

Figure BDA00026844201400000326
Figure BDA00026844201400000327
对应元素依次组合并进行数值与汉字的转换,得到汉字序列C,即为商品防伪号,其中汉字序列C的长度为
Figure BDA00026844201400000328
并将汉字商品标识码A和商品防伪号进行组合,生成汉字商品防伪码。(4) Transcoding: convert the sequence of values
Figure BDA00026844201400000326
and
Figure BDA00026844201400000327
Corresponding elements are combined in turn, and the numerical value and Chinese characters are converted, and the Chinese character sequence C is obtained, which is the product anti-counterfeiting number, and the length of the Chinese character sequence C is
Figure BDA00026844201400000328
Combining the Chinese character product identification code A and the product anti-counterfeiting number to generate the Chinese character product anti-counterfeiting code.

进一步地,一种汉字商品防伪码生成方法里步骤(1)中所述的将表征某件商品唯一身份信息的汉字商品标识码A,逐个汉字转换为数值型数据[Pi1,Pi2],是指将汉字商品标识码A中逐个汉字采用unicode2native(·)函数转换为数值型数据,即[Pi1,Pi2]=unicode2native(Ai),从而得到高位数值序列P1={P11,P21,...,Pi1,....,PL1}和低位数值序列P2={P12,P22,...,Pi2,....,PL2}。Further, described in step (1) in a kind of Chinese character commodity anti-counterfeiting code generation method, will characterize the Chinese character commodity identification code A of the unique identity information of a certain commodity, one by one Chinese character is converted into numerical data [P i1 , P i2 ], It refers to converting each Chinese character in the Chinese character product identification code A into numerical data using the unicode2native(·) function, that is, [P i1 , P i2 ]=unicode2native(A i ), thereby obtaining a high-order numerical sequence P1={P 11 ,P 21 ,...,P i1 ,....,P L1 } and the lower order numerical sequence P2={P 12 ,P 22 ,...,P i2 ,....,P L2 }.

进一步地,一种汉字商品防伪码生成方法里步骤(4)中所述的将数值序列

Figure BDA00026844201400000329
Figure BDA00026844201400000330
对应元素依次组合并进行数值与汉字的转换,是指将数值序列
Figure BDA0002684420140000041
Figure BDA0002684420140000042
中每个对应元素进行组合,即
Figure BDA0002684420140000043
并采用native2unicode(·)函数将数值型数据转换汉字,
Figure BDA0002684420140000044
其中
Figure BDA0002684420140000045
Further, the numerical sequence described in step (4) in a method for generating Chinese character commodity anti-counterfeiting codes
Figure BDA00026844201400000329
and
Figure BDA00026844201400000330
Corresponding elements are combined in turn and converted between numerical values and Chinese characters, which refers to the sequence of numerical values.
Figure BDA0002684420140000041
and
Figure BDA0002684420140000042
Combining each corresponding element in
Figure BDA0002684420140000043
And use the native2unicode(·) function to convert the numerical data into Chinese characters,
Figure BDA0002684420140000044
in
Figure BDA0002684420140000045

进一步地,一种汉字商品防伪码生成方法里步骤(4)中所述的将汉字商品标识码A和商品防伪号进行组合,生成商品防伪码,是指采用汉字商品标识码A和商品防伪号直接顺序连接,或者直接逆序连接,或者间隔插序连接的组合方式。Further, the combination of the Chinese character commodity identification code A and the commodity anti-counterfeiting number described in the step (4) in a method for generating a Chinese character commodity anti-counterfeiting code to generate a commodity anti-counterfeiting code refers to adopting the Chinese character commodity identification code A and the commodity anti-counterfeiting number. Direct sequential connection, or direct reverse sequence connection, or a combination of intervening and intervening sequence connections.

有益效果:本发明利用混沌映射产生混沌信号序列,对汉字商品标识码转换而成的2个二进制序列分别进行置乱,并将置乱后的二进制序列中元素进行分组,以及根据分组序列的奇偶个数分别进行不同的重组操作,从而生成商品防伪号,进而组合生成汉字商品防伪码,以此保证所提汉字商品防伪码生成方法简单可行,具有很强的安全性、不易破解,生成的汉字商品防伪码具有“唯一性和不可伪造性”。Beneficial effects: the present invention utilizes chaotic mapping to generate chaotic signal sequences, scrambles the two binary sequences converted from the Chinese character commodity identification codes respectively, groups the elements in the scrambled binary sequences, and groups the elements according to the parity of the grouping sequence. Perform different recombination operations on the number of items to generate the product anti-counterfeiting number, and then combine to generate the Chinese character product anti-counterfeiting code, so as to ensure that the proposed Chinese character product anti-counterfeiting code generation method is simple and feasible, has strong security, and is not easy to crack. The generated Chinese characters Commodity security codes are "unique and unforgeable".

附图说明Description of drawings

图1为本发明的一种汉字商品防伪码生成流程示意图。FIG. 1 is a schematic diagram of the generation process of a Chinese character commodity anti-counterfeiting code according to the present invention.

具体实施方式Detailed ways

如图1所示的一种汉字商品防伪码生成方法,包括如下几个步骤:A method for generating anti-counterfeiting codes for Chinese characters as shown in Figure 1 includes the following steps:

(1)转码(1) Transcoding

首先,将表征某件商品唯一身份信息的汉字商品标识码A,逐个汉字转换为数值型数据[Pi1,Pi2],是指将汉字商品标识码A中逐个汉字采用unicode2native(·)函数转换为数值型数据,即[Pi1,Pi2]=unicode2native(Ai),得到高位数值序列P1={P11,P21,...,Pi1,....,PL1}和低位数值序列P2={P12,P22,...,Pi2,....,PL2}。First, the Chinese character product identification code A representing the unique identity information of a certain product is converted into numerical data [P i1 , P i2 ] one by one, which means that the Chinese character product identification code A is converted one by one using the unicode2native( ) function It is numerical data, ie [P i1 ,P i2 ]=unicode2native(A i ), and the high-order numerical sequence P1={P 11 ,P 21 ,...,P i1 ,....,P L1 } and the low-order numerical sequence are obtained Numerical sequence P2={P 12 ,P 22 ,...,P i2 ,....,P L2 }.

然后,将高位数值序列P1逐个元素转换成8bits的二进制数据,得到高位二进制序列PB1={PB11,PB12,...,PB1i,....,PB18×L},同时将低位数值序列P2逐个元素转换成8bits的二进制数据,得到低位二进制序列PB2={PB21,PB22,...,PB2i,....,PB28×L},Then, convert the high-order numerical sequence P1 into 8-bit binary data element by element, and obtain the high-order binary sequence PB1={PB1 1 ,PB1 2 ,...,PB1 i ,....,PB1 8×L }, and at the same time convert the low-order The numerical sequence P2 is converted into binary data of 8bits element by element, and the low-order binary sequence PB2={PB2 1 ,PB2 2 ,...,PB2 i ,....,PB2 8×L } is obtained,

最后,令LB=mod(5-mod(8×L,5),5),将高位二进制序列PB1的末尾添加LB个‘0’二进制位,将低位二进制序列PB2的末尾添加LB个‘1’二进制位,得到二进制序列

Figure BDA0002684420140000046
Figure BDA0002684420140000047
和二进制序列
Figure BDA0002684420140000048
Figure BDA0002684420140000049
Finally, let LB=mod(5-mod(8×L,5),5), add LB '0' binary bits to the end of the high-order binary sequence PB1, and add LB '1' bits to the end of the low-order binary sequence PB2 binary bit, get binary sequence
Figure BDA0002684420140000046
Figure BDA0002684420140000047
and binary sequence
Figure BDA0002684420140000048
Figure BDA0002684420140000049

其中汉字商品标识码A包括GB2312字符集中的中文标点符号、GB2312字符集中双字节编码的汉字,汉字商品标识码A的长度表示为L,数值序列P1和P2的长度均为L,二进制序列PB1和PB2的长度均为8×L,二进制序列

Figure BDA00026844201400000410
Figure BDA00026844201400000411
的长度均为
Figure BDA00026844201400000412
The Chinese character product identification code A includes Chinese punctuation marks in the GB2312 character set and Chinese characters encoded in double-byte characters in the GB2312 character set. The length of the Chinese character product identification code A is expressed as L, the lengths of the numerical sequences P1 and P2 are both L, and the binary sequence PB1 and PB2 are both 8×L in length, a binary sequence
Figure BDA00026844201400000410
and
Figure BDA00026844201400000411
length of
Figure BDA00026844201400000412

(2)二进制序列

Figure BDA0002684420140000051
Figure BDA0002684420140000052
的置乱(2) Binary sequence
Figure BDA0002684420140000051
and
Figure BDA0002684420140000052
scramble

首先,利用高位数值序列P1和低位数值序列P2,以及外部密钥α和β,按照如下所示公式分别计算得到Logistic混沌映射的初值x1和参数μ、抽取开始位置m,以及抽取间隔数n1、n2First, using the high-order numerical sequence P1 and the low-order numerical sequence P2, as well as the external keys α and β, the initial value x 1 and parameter μ of the Logistic chaotic map, the extraction start position m, and the number of extraction intervals are calculated according to the following formulas respectively. n 1 , n 2 ,

Figure BDA0002684420140000053
make
Figure BDA0002684420140000053

x1=0.00001+mod(α-kp1,0.99999) (1)x 1 =0.00001+mod(α-kp1,0.99999) (1)

μ=β+mod(kp1,4-β) (2)μ=β+mod(kp1,4-β) (2)

Figure BDA0002684420140000054
Figure BDA0002684420140000054

Figure BDA0002684420140000055
Figure BDA0002684420140000055

Figure BDA0002684420140000056
Figure BDA0002684420140000056

其中,外部密钥满足α∈(0,1),β∈(3.57,4),Among them, the external key satisfies α∈(0,1), β∈(3.57,4),

然后,由混沌映射的初值x1和外部密钥μ,对如下公式所示Logistic混沌映射进行迭代,式中k表示迭代次数(k=1,2,...)、xk+1表示第k次迭代得到的混沌信号,Then, based on the initial value x 1 of the chaotic map and the external key μ, the Logistic chaotic map shown in the following formula is iterated, where k represents the number of iterations (k=1, 2,...), and x k+1 represents The chaotic signal obtained at the kth iteration,

xk+1=μ×xk×(1-xk) (6)x k+1 = μ×x k ×(1-x k ) (6)

得到混沌信号序列X={x1,x2,...},从序列X中第m个元素开始依次间隔n1个元素取1个元素以形成长度为

Figure BDA0002684420140000057
的混沌信号序列
Figure BDA00026844201400000520
同时从序列X中第m个元素开始依次间隔n2个元素取1个元素以形成长度为
Figure BDA0002684420140000058
的混沌信号序列
Figure BDA0002684420140000059
The chaotic signal sequence X={x 1 , x 2 ,...} is obtained, starting from the mth element in the sequence X and taking 1 element at intervals of n 1 elements to form a length of
Figure BDA0002684420140000057
chaotic signal sequence of
Figure BDA00026844201400000520
At the same time, starting from the mth element in the sequence X, take 1 element at an interval of n 2 elements to form a length of
Figure BDA0002684420140000058
chaotic signal sequence of
Figure BDA0002684420140000059

最后,将混沌信号序列X1按降序排序,根据混沌信号序列X1排序前、后的位置变化置乱规则,对二进制序列

Figure BDA00026844201400000510
进行置乱,得到置乱后的二进制序列
Figure BDA00026844201400000511
同时将混沌信号序列X2按降序排序,根据混沌信号序列X2排序前、后的位置变化置乱规则,对二进制序列
Figure BDA00026844201400000512
进行置乱,得到置乱后的二进制序列
Figure BDA00026844201400000513
Finally, sort the chaotic signal sequence X1 in descending order, and scrambling the rules according to the position change before and after the sorting of the chaotic signal sequence X1.
Figure BDA00026844201400000510
Scramble to get the scrambled binary sequence
Figure BDA00026844201400000511
At the same time, sort the chaotic signal sequence X2 in descending order, and scrambling the rules according to the position change before and after the sorting of the chaotic signal sequence X2, and then the binary sequence
Figure BDA00026844201400000512
Scramble to get the scrambled binary sequence
Figure BDA00026844201400000513

(3)置乱后二进制序列

Figure BDA00026844201400000514
Figure BDA00026844201400000515
的分组、重组(3) Scrambled binary sequence
Figure BDA00026844201400000514
and
Figure BDA00026844201400000515
grouping, reorganization

首先,将置乱后的二进制序列

Figure BDA00026844201400000516
中元素从头到尾依次正向以5个元素为单位进行分组,得到分组后的二进制序列,表示为
Figure BDA00026844201400000517
同时将置乱后的二进制序列
Figure BDA00026844201400000518
中元素从头到尾依次正向以5个元素为单位进行分组,得到分组后的二进制序列,表示为
Figure BDA00026844201400000519
其中每一个二进制分组序列BF1{i}和BF2{i}均包含5个二进制位,且
Figure BDA0002684420140000061
First, the scrambled binary sequence
Figure BDA00026844201400000516
The elements in the middle are grouped in units of 5 elements from the beginning to the end, and the binary sequence after the grouping is obtained, which is expressed as
Figure BDA00026844201400000517
At the same time, the scrambled binary sequence will be
Figure BDA00026844201400000518
The elements in the middle are grouped in units of 5 elements from the beginning to the end, and the binary sequence after the grouping is obtained, which is expressed as
Figure BDA00026844201400000519
where each binary block sequence BF1{i} and BF2{i} contains 5 binary bits, and
Figure BDA0002684420140000061

然后,将每一个二进制分组序列BF1{i}和BF2{i},其中

Figure BDA0002684420140000062
依次进行如下重组操作:Then, each binary grouping sequence BF1{i} and BF2{i}, where
Figure BDA0002684420140000062
Perform the following reorganization operations in sequence:

如果mod(i,2)=1,则将二进制分组序列BF1{i}的最前面添上二进制‘110’,表示为

Figure BDA0002684420140000063
同时将二进制分组序列BF2{i}的最前面添上二进制‘101’,表示为
Figure BDA0002684420140000064
If mod(i,2)=1, then add binary '110' to the front of the binary block sequence BF1{i}, which is expressed as
Figure BDA0002684420140000063
At the same time, add binary '101' to the front of the binary grouping sequence BF2{i}, which is expressed as
Figure BDA0002684420140000064

如果mod(i,2)=0,则先将二进制分组序列BF1{i}中元素前后顺序翻转再在其最前面添上二进制‘110’,得到重组后的二进制分组序列

Figure BDA0002684420140000065
表示为
Figure BDA0002684420140000066
同时先将二进制分组序列BF2{i}中元素前后顺序翻转再在其最前面添上二进制‘101’,得到重组后的二进制分组序列
Figure BDA0002684420140000067
表示为
Figure BDA0002684420140000068
If mod(i, 2)=0, firstly reverse the order of the elements in the binary grouping sequence BF1{i}, and then add binary '110' to the front of the binary grouping sequence to obtain the reorganized binary grouping sequence
Figure BDA0002684420140000065
Expressed as
Figure BDA0002684420140000066
At the same time, the order of the elements in the binary grouping sequence BF2{i} is reversed, and the binary '101' is added to the front to obtain the reorganized binary grouping sequence.
Figure BDA0002684420140000067
Expressed as
Figure BDA0002684420140000068

最后,利用bin2dec(·)函数,依次将每一个重组后的二进制分组序列

Figure BDA0002684420140000069
转换成数值型数据
Figure BDA00026844201400000610
同时依次将每一个重组后的二进制分组序列
Figure BDA00026844201400000611
转换成数值型数据
Figure BDA00026844201400000612
其中
Figure BDA00026844201400000613
从而得到数值序列
Figure BDA00026844201400000614
Figure BDA00026844201400000615
Finally, use the bin2dec( ) function to sequentially divide each recombined binary grouping sequence
Figure BDA0002684420140000069
Convert to numeric data
Figure BDA00026844201400000610
At the same time, each recombined binary grouping sequence is sequentially
Figure BDA00026844201400000611
Convert to numeric data
Figure BDA00026844201400000612
in
Figure BDA00026844201400000613
to get the sequence of numbers
Figure BDA00026844201400000614
and
Figure BDA00026844201400000615

(4)转码:将数值序列

Figure BDA00026844201400000616
Figure BDA00026844201400000617
对应元素依次组合
Figure BDA00026844201400000618
并采用native2unicode(·)函数将数值型数据转换汉字,即
Figure BDA00026844201400000619
其中
Figure BDA00026844201400000620
从而得到汉字序列C,即为商品防伪号,并将汉字商品标识码A和商品防伪号采用直接顺序连接,或者直接逆序连接,或者间隔插序连接的组合方式进行组合,生成汉字商品防伪码。(4) Transcoding: convert the sequence of values
Figure BDA00026844201400000616
and
Figure BDA00026844201400000617
Corresponding elements are combined in sequence
Figure BDA00026844201400000618
And use the native2unicode( ) function to convert the numeric data into Chinese characters, that is
Figure BDA00026844201400000619
in
Figure BDA00026844201400000620
Thereby, the Chinese character sequence C is obtained, which is the product anti-counterfeiting number, and the Chinese character product identification code A and the product anti-counterfeiting number are combined in a direct sequence, or a direct reverse sequence connection, or a combination of interleaved sequence connections to generate a Chinese character product anti-counterfeiting code.

下面结合具体的实施例对本发明作进一步说明:Below in conjunction with specific embodiment, the present invention will be further described:

实施例1Example 1

按照上述一种汉字商品防伪码生成方法,步骤如下:According to the above-mentioned method for generating an anti-counterfeiting code for Chinese characters, the steps are as follows:

(1)首先,将表征某件商品唯一身份信息的汉字商品标识码A=“江苏省##集团××子公司 @@商品 生产日期2020-02-01 生产线12序列号1 2 3 4 5 6”,逐个汉字转换为数值型数据,得到高位数值序列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}和低位数值序列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}。(1) First of all, the Chinese character product identification code A that characterizes the unique identity information of a certain product = "Jiangsu Province ##GroupXX Subsidiary@@@Commodity Production Date 2020-02-01 Production Line 12 Serial Number 1 2 3 4 5 6 ”,逐个汉字转换为数值型数据,得到高位数值序列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}和低位数值序列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}。

然后,将高位数值序列P1逐个元素转换成8bits的二进制数据,得到高位二进制序列PB1={1,0,1,1,1,1,0,1,1,1,0,0,1,0,1,1,1,1,0,0,1,0,1,0,1,0,1,0,0,0,1,1,1,0,1,0,0,0,1,1,1,0,1,1,1,1,0,0,1,1,0,0,1,1,0,1,1,0,1,0,0,0,0,1,1,0,1,0,0,0,0,1,1,1,0,1,0,1,1,1,1,0,1,1,1,0,0,1,1,1,0,0,1,0,1,1,1,0,1,0,0,0,0,1,1,0,1,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},同时将低位数值序列P2逐个元素转换成8bits的二进制数据,得到低位二进制序列PB2={1,0,1,0,1,1,0,1,1,1,0,1,0,1,0,1,1,0,1,0,0,0,0,1,1,0,1,0,0,0,1,1,1,0,1,0,0,0,1,1,1,0,1,0,1,1,1,1,1,1,0,0,0,1,0,1,1,1,0,0,0,0,0,1,1,1,0,0,0,0,0,1,1,1,0,1,0,0,1,1,1,0,1,0,1,0,1,1,1,0,1,1,1,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},Then, convert the high-order numerical sequence P1 into 8-bit binary data element by element, and obtain the high-order binary sequence PB1={1,0,1,1,1,1,0,1,1,1,0,0,1,0 ,1,1,1,1,0,0,1,0,1,0,1,0,1,0,0,0,1,1,1,0,1,0,0,0,1 ,1,1,0,1,1,1,1,0,0,1,1,0,0,1,1,0,1,1,0,1,0,0,0,0,1 ,1,0,1,0,0,0,0,1,1,1,0,1,0,1,1,1,1,0,1,1,1,0,0,1,1 ,1,0,0,1,0,1,1,1,0,1,0,0,0,0,1,1,0,1,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}, at the same time convert the low-order numerical sequence P2 into 8-bit binary data element by element, and obtain the low-order binary sequence PB2={1, 0,1,0,1,1,0,1,1,1,0,1,0,1,0,1,1,0,1,0,0,0,0,1,1,0, 1,0,0,0,1,1,1,0,1,0,0,0,1,1,1,0,1,0,1,1,1,1,1,1,0, 0,0,1,0,1,1,1,0,0,0,0,0,1,1,1,0,0,0,0,0,1,1,1,0,1, 0,0,1, 1,1,0,1,0,1,0,1,1,1,0,1,1,1,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},

最后,令LB=mod(5-mod(8×47,5),5)=4,将高位二进制序列PB1的末尾添加4个‘0’二进制位,将低位二进制序列PB2的末尾添加4个‘1’二进制位,得到二进制序列

Figure BDA0002684420140000071
Figure BDA0002684420140000072
和二进制序列
Figure BDA0002684420140000073
Figure BDA0002684420140000074
Finally, let LB=mod(5-mod(8×47,5),5)=4, add 4 '0' binary bits to the end of the high-order binary sequence PB1, and add 4'' to the end of the low-order binary sequence PB2 1' binary bit, get binary sequence
Figure BDA0002684420140000071
Figure BDA0002684420140000072
and binary sequence
Figure BDA0002684420140000073
Figure BDA0002684420140000074

Figure BDA0002684420140000081
Figure BDA0002684420140000081

其中汉字商品标识码A的长度为L=47,数值序列P1和P2的长度均为L=47,二进制序列PB1和PB2的长度均为8×L=376,二进制序列

Figure BDA0002684420140000082
Figure BDA0002684420140000083
的长度均为
Figure BDA0002684420140000084
The length of the Chinese character product identification code A is L=47, the lengths of the numerical sequences P1 and P2 are both L=47, the lengths of the binary sequences PB1 and PB2 are both 8×L=376, the binary sequence
Figure BDA0002684420140000082
and
Figure BDA0002684420140000083
length of
Figure BDA0002684420140000084

(2)首先,利用数值序列P1和P2,以及外部密钥α=0.12345和β=3.75,按照如下公式分别计算得到Logistic混沌映射的初值x1和参数μ、抽取开始位置m,以及抽取间隔数n1、n2(2) First, using the numerical sequences P1 and P2, and the external keys α=0.12345 and β=3.75, the initial value x 1 and parameter μ of the Logistic chaotic map, the extraction start position m, and the extraction interval are calculated according to the following formulas respectively. Numbers n 1 , n 2 ,

Figure BDA0002684420140000085
则make
Figure BDA0002684420140000085
but

x1=0.00001+mod(0.12345-0.172389696730833,0.99999)=0.951060303269167x 1 =0.00001+mod(0.12345-0.172389696730833,0.99999)=0.951060303269167

μ=3.75+mod(0.172389696730833,4-3.75)=3.922389696730833μ=3.75+mod(0.172389696730833,4-3.75)=3.922389696730833

Figure BDA0002684420140000086
Figure BDA0002684420140000086

Figure BDA0002684420140000087
Figure BDA0002684420140000087

Figure BDA0002684420140000088
Figure BDA0002684420140000088

然后,由混沌映射的初值x1=0.951060303269167和外部密钥μ=3.922389696730833,对Logistic混沌映射进行迭代,得到混沌信号序列X={x1,x2,...},从序列X中第334个元素开始依次间隔22个元素取1个元素以形成长度为380的混沌信号序列X1={X11,X12,...,X1380},同时从序列X中第334个元素开始依次间隔24个元素取1个元素以形成长度为380的混沌信号序列X2={X21,X22,...,X2380},Then, based on the initial value of the chaotic map x 1 =0.951060303269167 and the external key μ = 3.922389696730833, the Logistic chaotic map is iterated to obtain the chaotic signal sequence X={x 1 ,x 2 ,...}, Starting from 334 elements, take 1 element at an interval of 22 elements to form a chaotic signal sequence X1={X1 1 , X1 2 ,..., X1 380 } with a length of 380, and start from the 334th element in the sequence X in sequence Take 1 element every 24 elements to form a chaotic signal sequence with length 380 X2={X2 1 , X2 2 ,...,X2 380 },

最后,将混沌信号序列X1按降序排序,根据混沌信号序列X1排序前、后的位置变化置乱规则,对二进制序列

Figure BDA0002684420140000089
进行置乱,得到置乱后的二进制序列
Figure BDA00026844201400000810
Figure BDA00026844201400000811
Figure BDA0002684420140000091
Figure BDA0002684420140000092
同时将混沌信号序列X2按降序排序,根据混沌信号序列X2排序前、后的位置变化置乱规则,对二进制序列
Figure BDA0002684420140000093
Figure BDA0002684420140000094
得到置乱后的二进制序列
Figure BDA0002684420140000095
Figure BDA0002684420140000096
Finally, sort the chaotic signal sequence X1 in descending order, and scrambling the rules according to the position change before and after the sorting of the chaotic signal sequence X1.
Figure BDA0002684420140000089
Scramble to get the scrambled binary sequence
Figure BDA00026844201400000810
Figure BDA00026844201400000811
Figure BDA0002684420140000091
Figure BDA0002684420140000092
At the same time, sort the chaotic signal sequence X2 in descending order, and scrambling the rules according to the position change before and after the sorting of the chaotic signal sequence X2, and then the binary sequence
Figure BDA0002684420140000093
Figure BDA0002684420140000094
get the scrambled binary sequence
Figure BDA0002684420140000095
Figure BDA0002684420140000096

(3)首先,对置乱后的二进制序列

Figure BDA0002684420140000097
Figure BDA0002684420140000098
分别进行分组,将二进制序列
Figure BDA0002684420140000099
中元素从头到尾依次正向以5个元素为单位进行分组,得到分组后的二进制序列,表示为BF1{1}={0,0,0,1,1},BF1{2}={1,1,0,0,0},…,BF1{38}={0,0,1,0,0},…,BF1{75}={0,0,1,1,1},BF1{76}={0,0,1,1,0},同时将二进制序列
Figure BDA00026844201400000910
中元素从头到尾依次正向以5个元素为单位进行分组,得到分组后的二进制序列,表示为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},(3) First, for the scrambled binary sequence
Figure BDA0002684420140000097
and
Figure BDA0002684420140000098
grouped separately, the binary sequence
Figure BDA0002684420140000099
The elements in the middle are grouped in units of 5 elements from the beginning to the end, and the binary sequence after the grouping is obtained, which is expressed as BF1{1}={0,0,0,1,1}, BF1{2}={1 ,1,0,0,0},…,BF1{38}={0,0,1,0,0},…,BF1{75}={0,0,1,1,1},BF1{ 76}={0,0,1,1,0}, while converting the binary sequence
Figure BDA00026844201400000910
The elements in the middle are grouped in units of 5 elements from the beginning to the end, and the binary sequence after the grouping is obtained, 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},

然后,将每一个二进制分组序列BF1{i}和BF2{i},其中

Figure BDA00026844201400000911
依次进行重组操作,得到重组后的二进制分组序列,表示为
Figure BDA00026844201400000912
Figure BDA00026844201400000913
Figure BDA00026844201400000914
以及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,1,1,0,1,0},…,BF2{75}={1,0,1,0,0,1,0,1},BF2{76}={1,0,1,1,1,0,0,0},Then, each binary grouping sequence BF1{i} and BF2{i}, where
Figure BDA00026844201400000911
Perform the recombination operation in turn to obtain the recombined binary grouping sequence, which is expressed as
Figure BDA00026844201400000912
Figure BDA00026844201400000913
Figure BDA00026844201400000914
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,1,1,0,1,0},...,BF2{75}={1,0,1,0,0,1,0,1},BF2{76 }={1,0,1,1,1,0,0,0},

最后利用bin2dec(·)函数,依次将每一个重组后的二进制分组序列

Figure BDA00026844201400000915
转换成数值型数据
Figure BDA00026844201400000916
同时依次将每一个重组后的二进制分组序列
Figure BDA00026844201400000917
转换成数值型数据
Figure BDA00026844201400000918
其中i=1,2,3,...,76,从而得到数值序列
Figure BDA00026844201400000919
Figure BDA00026844201400000920
Figure BDA00026844201400000921
Figure BDA00026844201400000922
Figure BDA00026844201400000923
Finally, use the bin2dec(·) function to sequentially combine each recombined binary grouping sequence
Figure BDA00026844201400000915
Convert to numeric data
Figure BDA00026844201400000916
At the same time, each recombined binary grouping sequence is sequentially
Figure BDA00026844201400000917
Convert to numeric data
Figure BDA00026844201400000918
where i = 1, 2, 3,..., 76, thus obtaining a numerical sequence
Figure BDA00026844201400000919
Figure BDA00026844201400000920
Figure BDA00026844201400000921
and
Figure BDA00026844201400000922
Figure BDA00026844201400000923

Figure BDA0002684420140000101
Figure BDA0002684420140000101

(4)将数值序列

Figure BDA0002684420140000102
Figure BDA0002684420140000103
每个元素组合并进行数值与汉字的转换,得到汉字商品防伪号为“煤冒蟹揽券纬司啸联嘶桶貭甙纱霉伪嘶毯缀尉思驶薪辗转蟹薁指莼贫鄱炭庸袪亩卸煤暮玫吒劢罓爽锥诏援滩媒荬帧学透之蔂坍薪踊埽诂尾嘶泳赢斯胎荸峡片莺逘纬芯喂霜钎谈”,并将汉字商品标识码A和商品防伪号采用直接顺序连接,或者直接逆序连接,或者间隔插序连接的组合方式进行组合,生成汉字商品防伪码分别如下,(4) put the numerical sequence
Figure BDA0002684420140000102
and
Figure BDA0002684420140000103
Combining each element and converting the numerical value and Chinese characters, the anti-counterfeiting number of the Chinese character product is obtained as "Coal, crab, coupon, Wei Si Xiao Lian, sizzling, saccharin, gauze mold, pseudo-hiss blanket, Wei Si sailing, rolling, crab, scorpion, and poor po charcoal." Unloading coal in yongwamu, twilight, Meizha, shuangshuangzhuan, aided beach, mediator, frame, learn-through, slump, slump, dance, tail, swirl, win, tibia, gorge, piece, ying, weft, core, cream, brazing talk, and put Chinese character goods The identification code A and the commodity anti-counterfeiting number are combined in a direct sequence, or a direct reverse sequence connection, or a combination of spaced and interpolated sequence connections, and the generated Chinese character commodity security codes are as follows:

直接顺序连接:“江苏省##集团××子公司 @@商品 生产日期2020-02-01 生产线12序列号1 2 3 4 5 6煤冒蟹揽券纬司啸联嘶桶貭甙纱霉伪嘶毯缀尉思驶薪辗转蟹薁指莼贫鄱炭庸袪亩卸煤暮玫吒劢罓爽锥诏援滩媒荬帧学透之蔂坍薪踊埽诂尾嘶泳赢斯胎荸峡片莺逘纬芯喂霜钎谈”,Direct sequence connection: "Jiangsu Province ##Group XX Subsidiary@@@Commodity Production Date 2020-02-01 Production Line 12 Serial Number 1 2 3 4 5 6 Coal Crab Tickets Weixiaolian Hiss Barrel Saccharomyces Hissing blanket, Weisi, driving salary, turning crabs, pointing to Ulva, poor, charcoal, and unloading coal, twilight, Meizha, shuangshuang, jiu, aid, beach, matchmaking, frame, learning, slump, slump, slugging, tail, swimming, and winning the tidal gorge Pian Yingli Weft Core Feeding Frost and Drilling",

直接逆序连接:“谈钎霜喂芯纬逘莺片峡荸胎斯赢泳嘶尾诂埽踊薪坍蔂之透学帧荬媒滩援诏锥爽罓劢吒玫暮煤卸亩袪庸炭鄱贫莼指薁蟹转辗薪驶思尉缀毯嘶伪霉纱甙貭桶嘶联啸司纬券揽蟹冒煤6 5 4 3 2 1号列序21线产生 10-20-0202期日产生 品商@@司公子××团集##省苏江”,Direct reverse order connection: "Talking about brazing cream, feeding core, weaving, warping, kataya, water chestnut, winning, swimming, slaughtering, slumping, learning frame, media beach, aid, cone, cooling, coal, coal unloading, and charcoal Po poor Ulva finger crabs turn over the salary, Siwei carpet, pseudomycoside, cask sizzle, joint Xiao Siwei coupons, crabs and coals Commodities@@Company's subsidiary XX Group ##Sujiang Province",

间隔插序连接:“江煤苏冒省蟹#揽#券集纬团司×啸×联子嘶公桶司貭 甙@纱@霉商伪品嘶 毯生缀产尉日思期驶2薪0辗2转0蟹-薁0指2莼-贫0鄱1炭 庸生袪产亩线卸1煤2暮序玫列吒号劢1罓2爽3锥4诏5援6滩媒荬帧学透之蔂坍薪踊埽诂尾嘶泳赢斯胎荸峡片莺逘纬芯喂霜钎谈”,Interleaved sequence connection: "Jiangsu Coal, Jiangsu Province, Crab#Lan#Coupon Group Weft Group Company×Xiao×Lianzixi Company Barrel Company Siposide @ Yarn @ Mold Merchant Counterfeit Hiss Blanket Production Wet Risiqi Drive 2 Salary 0 rolls, 2 turns, 0 crabs, 0 fingers, 2 scallops, poor 0, 1, charcoal, yield, mu line, unloading, 1 coal, 2 twilight sequence, Meilie Zha, 1, 2, 3 cones, 4 edicts, 5 aids, 6 beach matchmaking, framing Through the slump, the salary, the squat, the tail, the swirl, and the win, the tibia, the gorge, the Yingli, the weft, the core, the frost and the drill",

实施例2Example 2

按照上述汉字商品防伪码生成方法,某件商品的商品标识码字符串A及其商品防伪码生成步骤与具体实施例1相似,仅某个外部密钥发生细微变化:α=0.12345000000001;或β=3.74999999999999,汉字商品防伪码的生成结果如表1所示。由下表可见:一旦外部密钥即使发生细微变化,生成的商品防伪号以及汉字商品防伪码会发生极大的变化,由此可见本专利所提一种汉字商品防伪码生成方法具有密钥敏感性。According to the above-mentioned method for generating anti-counterfeiting codes for Chinese characters, the steps for generating a commodity identification code string A of a certain commodity and its commodity anti-counterfeiting codes are similar to those in the specific embodiment 1, except that only a slight change occurs in a certain external key: α=0.12345000000001; or β= 3.74999999999999, the generation results of anti-counterfeiting codes for Chinese characters are shown in Table 1. It can be seen from the following table: once the external key changes slightly, the generated product anti-counterfeiting number and Chinese character product anti-counterfeiting code will change greatly. It can be seen that the method for generating a Chinese character product anti-counterfeiting code proposed in this patent is key sensitive. sex.

表1外部密钥发生微变时,汉字商品防伪码的生成结果Table 1 The generation results of anti-counterfeiting codes for Chinese characters when the external key changes slightly

Figure BDA0002684420140000104
Figure BDA0002684420140000104

Figure BDA0002684420140000111
Figure BDA0002684420140000111

Figure BDA0002684420140000121
Figure BDA0002684420140000121

实施例3Example 3

按照上述汉字商品防伪码生成方法,外部密钥及其商品防伪码生成步骤与具体实施例1相似,仅某件商品的商品标识码字符串A(江苏省##集团××子公司 @@商品 生产日期2020-02-01 生产线12序列号1 2 3 4 5 6)发生细微变化:“冮苏省##集团××子公司 @@商品 生产日期2020-02-01 生产线12序列号1 2 3 4 5 6”;或者“江苏省##集团××子公司 @@商品 生产日期2020-12-01 生产线12序列号1 2 3 4 5 6”;或者“江苏省##集团××子公司 @@商品 生产日期2020-02-01 生产线12序列号1 2 3 4 5 9”,汉字商品防伪码的生成结果如表2所示。由下表可见:一旦表征某件商品唯一身份信息的商品标识码字符串即使发生细微变化,生成的商品防伪号以及汉字商品防伪码会发生极大的变化,由此可见本专利所提一种汉字商品防伪码生成方法对商品身份信息(即商品标识码字符串)具有敏感性。According to the above-mentioned method for generating Chinese character commodity anti-counterfeiting codes, the steps for generating an external key and its commodity anti-counterfeiting codes are similar to those in the specific embodiment 1. Production date 2020-02-01 Production line 12 serial number 1 2 3 4 5 6) Minor changes: "冮Su Province ##Group XX Subsidiary @ @ @ Commodity production date 2020-02-01 Production line 12 serial number 1 2 3 4 5 6"; or "Jiangsu Province ##Group XX Subsidiary@@@Commodity Production Date 2020-12-01 Production Line 12 Serial Number 1 2 3 4 5 6"; or "Jiangsu Province ##Group XX Subsidiary @  @Product production date 2020-02-01 Production line 12 serial number 1 2 3 4 5 9", the generation results of Chinese character product security codes are shown in Table 2. It can be seen from the following table: once the product identification code string representing the unique identity information of a certain product changes slightly, the generated product anti-counterfeiting number and Chinese character product anti-counterfeiting code will undergo great changes. The method for generating Chinese character commodity anti-counterfeiting codes is sensitive to commodity identity information (ie, commodity identification code strings).

表2商品标识码发生微变时,商品防伪码的生成结果Table 2 When the product identification code changes slightly, the generation results of the product anti-counterfeiting code

Figure BDA0002684420140000122
Figure BDA0002684420140000122

Figure BDA0002684420140000131
Figure BDA0002684420140000131

Figure BDA0002684420140000141
Figure BDA0002684420140000141

由上述具体实施例2和例3分析可知,本专利所提一种汉字商品防伪码生成方法所生成汉字商品防伪码不仅与外部密钥密切相关,而且依赖于表征某件商品唯一身份信息的商品标识码字符串,因此本专利所提的一种汉字商品防伪码生成方法具有很强的安全性,可以较好地抵抗已知/选择明文攻击,不易破解,以保证生成的汉字商品防伪码具有“唯一性和不可伪造性”。From the analysis of the above-mentioned specific embodiment 2 and example 3, it can be seen that the Chinese character commodity anti-counterfeiting code generated by the Chinese character commodity anti-counterfeiting code generation method proposed in this patent is not only closely related to the external key, but also depends on the commodity representing the unique identity information of a certain commodity. Therefore, the method for generating an anti-counterfeiting code for Chinese characters proposed in this patent has strong security, can better resist known/selected plaintext attacks, and is not easy to crack, so as to ensure that the generated anti-counterfeiting code for Chinese characters has "Uniqueness and Unforgeability".

以上所述,仅是本发明的较佳实施例而已,并非对本发明作任何形式上的限制,虽然本发明已以较佳实施例揭露如上,然而并非用以限定本发明,任何熟悉本专业的技术人员,在不脱离本发明技术方案范围内,当可利用上述揭示的技术内容作出些许更动或修饰为等同变化的等效实施例,但凡是未脱离本发明技术方案的内容,依据本发明的技术实质对以上实施例所作的任何简单修改、等同变化与修饰,均仍属于本发明技术方案的范围内。The above are only preferred embodiments of the present invention, and do not limit the present invention in any form. Although the present invention has been disclosed above with preferred embodiments, it is not intended to limit the present invention. Technical personnel, within the scope of the technical solution of the present invention, can make some changes or modifications to equivalent embodiments of equivalent changes by using the technical content disclosed above, but any content that does not depart from the technical solution of the present invention, according to the present invention Any simple modifications, equivalent changes and modifications made to the above embodiments still fall within the scope of the technical solutions of the present invention.

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
Figure FDA0002684420130000011
Figure FDA0002684420130000012
And binary sequence
Figure FDA0002684420130000013
Figure FDA0002684420130000014
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 xL
Figure FDA0002684420130000015
And
Figure FDA0002684420130000016
all have the length of
Figure FDA0002684420130000017
(2) Binary sequence
Figure FDA0002684420130000018
And
Figure FDA0002684420130000019
scrambling of (1):
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 order
Figure FDA00026844201300000110
Then
x1=0.00001+mod(α-kp1,0.99999) (1)
μ=β+mod(kp1,4-β) (2)
Figure FDA00026844201300000111
Figure FDA00026844201300000112
Figure FDA00026844201300000113
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 of
Figure FDA0002684420130000021
Of the chaotic signal sequence
Figure FDA0002684420130000022
At the same time, the m-th element in the sequence X is sequentially spaced by n2Each element is 1 element to form a length of
Figure FDA0002684420130000023
Of the chaotic signal sequence
Figure FDA0002684420130000024
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 sorted
Figure FDA0002684420130000025
Scrambling is carried out to obtain a scrambled binary sequence
Figure FDA0002684420130000026
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
Figure FDA0002684420130000027
Scrambling is carried out to obtain a scrambled binary sequence
Figure FDA0002684420130000028
(3) Scrambled binary sequence
Figure FDA0002684420130000029
And
Figure FDA00026844201300000210
grouping and recombining:
first, the scrambled binary sequence is decoded
Figure FDA00026844201300000211
The 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 as
Figure FDA00026844201300000212
Simultaneously scrambling the binary sequences
Figure FDA00026844201300000213
The 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 as
Figure FDA00026844201300000214
Wherein each of the binary packet sequences BF1{ i } and BF2{ i } includes 5 binary bits, and
Figure FDA00026844201300000215
then, each sequence of binary packets BF1{ i } and BF2{ i }, where i is 1,2, 3.,
Figure FDA00026844201300000216
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 as
Figure FDA00026844201300000217
While the top of the binary packet sequence BF2{ i } is padded with binary '101', denoted as
Figure FDA00026844201300000218
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 sequence
Figure FDA00026844201300000219
Is shown as
Figure FDA00026844201300000220
Simultaneously, 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 sequence
Figure FDA00026844201300000221
Is shown as
Figure FDA00026844201300000222
Finally, each recombined binary grouping sequence is sequentially generated by using a bin2dec (-) function
Figure FDA00026844201300000223
Conversion into numerical data
Figure FDA00026844201300000224
Figure FDA00026844201300000225
Figure FDA00026844201300000226
Conversion into numerical data
Figure FDA00026844201300000227
Wherein i is 1,2, 3.,
Figure FDA00026844201300000228
thereby obtaining a numerical sequence
Figure FDA00026844201300000229
And
Figure FDA00026844201300000230
(4) transcoding:
sequence of values
Figure FDA00026844201300000231
And
Figure FDA00026844201300000232
corresponding 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 is
Figure FDA00026844201300000233
And 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)
Figure FDA0002684420130000031
And
Figure FDA0002684420130000032
corresponding elements are combined in sequence and the conversion between numerical values and Chinese characters is carried out, which means that numerical value sequences are combined
Figure FDA0002684420130000033
And
Figure FDA0002684420130000034
in which corresponding elements are combined, i.e.
Figure FDA0002684420130000035
And converting numerical data into Chinese characters by using native2unicode (·) function, i.e. converting numerical data into Chinese characters
Figure FDA0002684420130000036
Wherein i is 1,2, 3.,
Figure FDA0002684420130000037
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.
CN202010972003.7A 2020-09-16 2020-09-16 Chinese character commodity anti-counterfeiting code generation method Active CN112149774B (en)

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)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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

Patent Citations (4)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
Title
吴新华: "基于混沌密码的数码防伪追溯系统设计", 《计算机与数字工程》 *
盛苏英等: "基于混沌的数码防伪系统研究与实现", 《微电子学与计算机》 *
盛苏英等: "混沌密码技术在数码防伪中的应用研究", 《信息技术》 *

Cited By (6)

* Cited by examiner, † Cited by third party
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 南通大学 A method for generating anti-counterfeiting two-dimensional code based on chaos 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 南通大学 A product 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
CN109472338B (en) Batch generation method of commodity anti-counterfeiting two-dimensional codes
CN112149774A (en) Chinese character commodity anti-counterfeiting code generation method
CN109284803B (en) Commodity anti-counterfeiting two-dimensional code generation method
CN112001468B (en) A method for generating and recognizing anti-counterfeiting codes for character-type commodities
CN107425956B (en) A method for generating anti-counterfeiting codes for character-type commodities
CN104486073B (en) A kind of encryption and decryption method of character type data
CN111985591B (en) A method for generating commodity anti-counterfeiting code based on string encryption
CN107609356B (en) Text carrier-free information hiding method based on label model
CN112884104B (en) A method for generating anti-counterfeiting two-dimensional code based on chaos encryption
CN112149773B (en) Commodity anti-counterfeiting code generation method based on Chinese character encryption
CN104680220B (en) A kind of commodity counterfeit prevention code Mass production method
CN104657871B (en) A kind of commodity counterfeit prevention code generating method
CN112163230B (en) A method for generating anti-counterfeiting code of goods with Chinese character encryption
CN105354717B (en) A method for generating anti-counterfeiting codes for color commodities
CN113255860B (en) A product anti-counterfeiting two-dimensional code generation method based on layered encryption
CN108009253A (en) A kind of improved character string Similar contrasts method
CN102752108B (en) Magic cube encryption and decryption method
CN112001467A (en) Commodity anti-counterfeiting code generation and identification method based on picture encryption and decryption
CN112016061A (en) A Data Protection Method for Excel Documents Based on Robust Watermarking Technology
CN111353166A (en) An encryption method for converting pictures to Chinese characters
CN112217627B (en) Layered encrypted commodity anti-counterfeiting code generation method
CN104376236B (en) Scheme self-adaptive digital watermark embedding grammar and extracting method based on camouflage science
CN102509058B (en) Point type GIS vector data disguise and recovery method based on redundant bit replacement
CN111447188A (en) Carrier-free text steganography method based on language steganography feature space
CN116582314A (en) Optimal hidden double-protection text method

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