CN112183697B - A method for batch generation of two-dimensional codes for garbage classification - Google Patents

A method for batch generation of two-dimensional codes for garbage classification Download PDF

Info

Publication number
CN112183697B
CN112183697B CN202011038759.0A CN202011038759A CN112183697B CN 112183697 B CN112183697 B CN 112183697B CN 202011038759 A CN202011038759 A CN 202011038759A CN 112183697 B CN112183697 B CN 112183697B
Authority
CN
China
Prior art keywords
sequence
garbage
code
binary
batch
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.)
Active
Application number
CN202011038759.0A
Other languages
Chinese (zh)
Other versions
CN112183697A (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.)
Shenzhen Hongyue Enterprise Management Consulting Co ltd
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 CN202011038759.0A priority Critical patent/CN112183697B/en
Publication of CN112183697A publication Critical patent/CN112183697A/en
Application granted granted Critical
Publication of CN112183697B publication Critical patent/CN112183697B/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
    • G06K19/06037Record 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 multi-dimensional coding
    • 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)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a garbage classification two-dimensional code batch generation method, which comprises the following steps: extracting an identity code and a hidden code from certain garbage bag identity information, and respectively carrying out conversion and combination operation to obtain a combined binary matrix B and high and low combined binary sequences B1 and B2; generating chaotic signal sequences by relying on the identity codes and the hidden codes and utilizing chaotic mapping, and respectively scrambling, grouping and diffusing the high-order binary sequences B1 and the low-order binary sequences B2 to finish the uniform encryption of the identity hidden codes of a certain batch of garbage bags; the chaos signal sequence is generated by relying on the batch identity codes of the single garbage bags and utilizing chaos mapping, and the identity hidden code unified encryption result is respectively scrambled according to different rules according to garbage categories, so that garbage classification two-dimensional codes are generated in batches. The garbage classification two-dimensional code batch generation method is simple and feasible, has strong safety, and generates garbage classification codes with uniqueness, safety and garbage classification guiding performance.

Description

一种垃圾分类二维码批量生成方法A method for batch generation of two-dimensional codes for garbage classification

技术领域technical field

本发明涉及垃圾分类技术领域,特别涉及一种垃圾分类二维码批量生成方法。The invention relates to the technical field of garbage classification, in particular to a method for batch generation of two-dimensional codes for garbage classification.

背景技术Background technique

随着科技和经济社会的高速发展、城市化进程的进一步推进,目前我国城市生活垃圾年产量过亿吨,许多城市正面临“垃圾围城”的严峻形势。“垃圾围城”已成为中国城市发展的绊脚石。破解“垃圾围城”的难题,首先是从源头上减少城市生活垃圾的产生,其次,将垃圾资源化处理也是一个必不可少的关键环节,因此推行垃圾分类迫在眉睫。早在1992年,我国宜昌市首次提出了推行“垃圾装袋分类”,并首次提出了制定专项立法来管理城市生活垃圾分类。随后垃圾分类逐渐在全国范围内开展开来,自上世纪九十年代垃圾分类推行以来,我国城市垃圾分类的理论研究已取得了明显的成效,由于目前城市居民缺乏垃圾分类知识、环境保护意识不足、活动参与热情不高。此外,垃圾回收站的基础设施过于简陋、垃圾回收运输过程太过粗放、居民对于垃圾袋个人隐私信息暴露的担忧而消极甚至不愿参与等种种问题逐渐显露,显然,我国城市垃圾分类的实施正面临着许多困难和挑战。针对上述问题,当务之急是研发一种安全可靠的垃圾分类码生成方法,从源头上保障生成具有“唯一性、安全性和垃圾分类引导性”垃圾分类码,促进垃圾分类工作的有效开展。With the rapid development of science and technology, economy and society, and the further advancement of the urbanization process, the current annual output of urban domestic waste in my country exceeds 100 million tons, and many cities are facing the severe situation of "garbage siege". The "garbage besieged city" has become a stumbling block for China's urban development. To solve the problem of "garbage siege", the first is to reduce the generation of urban domestic waste from the source, and secondly, the recycling of waste is also an indispensable key link, so the implementation of waste classification is imminent. As early as 1992, Yichang City in my country first proposed the implementation of "garbage bag classification", and for the first time proposed the formulation of special legislation to manage the classification of urban domestic waste. Subsequently, garbage classification was gradually carried out nationwide. Since the implementation of garbage classification in the 1990s, the theoretical research on urban garbage classification in my country has achieved obvious results. Due to the lack of knowledge of garbage classification and insufficient awareness of environmental protection among urban residents. , The enthusiasm for participating in activities is not high. In addition, the infrastructure of the garbage recycling station is too simple, the garbage recycling and transportation process is too extensive, and the residents are worried about the exposure of personal privacy information of garbage bags and are passive or even unwilling to participate. Obviously, the implementation of urban garbage classification in my country is positive. Faced with many difficulties and challenges. In view of the above problems, the most urgent task is to develop a safe and reliable method for generating garbage classification codes, which can ensure the generation of garbage classification codes with "uniqueness, security and guidance of garbage classification" from the source, and promote the effective development of garbage classification work.

发明内容SUMMARY OF THE INVENTION

发明目的:本发明的目的是为了解决现有技术中的不足,提供一种垃圾分类二维码批量生成方法,从某批垃圾袋的统一身份码中抽取出身份标识码和身份隐藏码,依赖身份标识码和隐藏码并利用混沌映射产生混沌信号序列,对身份隐藏码转换并组合而成的高、低位二进制序列分别进行置乱、分组及扩散,完成某批垃圾袋的身份隐藏码统一加密,依赖单件垃圾袋的批量身份码并利用混沌映射产生混沌信号序列,并根据垃圾类别对身份隐藏码统一加密结果分别进行不同规则的置乱,进而批量生成垃圾分类二维码。本发明所提垃圾分类二维码批量生成方法简单可行,具有很强的安全性,生成的垃圾分类码具有“唯一性、安全性和垃圾分类引导性”。Purpose of the invention: The purpose of the present invention is to solve the deficiencies in the prior art, and provide a method for batch generation of two-dimensional codes for garbage classification, which extracts the identity identification code and the identity hidden code from the unified identity code of a certain batch of garbage bags, and relies on The identity identification code and hidden code are used to generate chaotic signal sequence by chaotic mapping, and the high and low binary sequences converted and combined by the identity hidden code are scrambled, grouped and diffused respectively, and the unified encryption of the identity hidden code of a certain batch of garbage bags is completed. , relying on the batch identity code of a single garbage bag and using chaotic mapping to generate a chaotic signal sequence, and scrambling the unified encryption result of the identity hidden code according to the garbage category with different rules, and then generating garbage classification QR codes in batches. The method for batch generation of garbage classification two-dimensional codes provided by the present invention is simple and feasible, and has strong security, and the generated garbage classification codes have "uniqueness, security and guidance of garbage classification".

技术方案:一种垃圾分类二维码批量生成方法,其特征在于,包括如下几个步骤:Technical solution: a method for batch generation of two-dimensional codes for garbage classification, characterized in that it includes the following steps:

(1)编码、转码(1) Encoding and transcoding

首先,将某批垃圾袋的身份信息进行编码,包括某批垃圾袋的统一身份码、单件垃圾袋的批量身份码两部分,从而生成某批单件垃圾袋唯一的中英文字符型垃圾袋身份码,表示为M1M2...MkMk+1Mk+2...Mk+LMk+L+1Mk+L+2...Mk+L+pMk+L+p+1Mk+L+p+2...Mk+L+p+nMk+L+p+n+1Mk+L+p+n+ 2Mk+L+p+n+3Mk+L+p+n+4,其中M1M2...Mk为省市区,Mk+1Mk+2...Mk+L为具体居住地址,Mk+L+1Mk+L+ 2...Mk+L+p为联系人和联系电话,Mk+L+p+1Mk+L+p+2...Mk+L+p+n为制码时间(格式为年-月-日,其中最后两位Mk+L+p+n-1Mk+L+p+n为日期),Mk+L+p+n+1Mk+L+p+n+2为垃圾分类颜色信息(表征垃圾类别),Mk+L+p+n+3Mk+L+p+n+4为垃圾分类序号信息(表征某天某种类别垃圾袋的序号),相互用英文空格间隔,相应某批垃圾袋的统一身份码为M1M2...MkMk+1Mk+2...Mk+LMk+L+1Mk+L+2...Mk+L+pMk+L+p+ 1Mk+L+p+2...Mk+L+p+n-3Mk+L+p+n-2,相应单件垃圾袋的批量身份码为Mk+L+p+n-1Mk+L+p+nMk+L+p+n+ 1Mk+L+p+n+2Mk+L+p+n+3Mk+L+p+n+4First, encode the identity information of a batch of garbage bags, including the unified identity code of a batch of garbage bags and the batch identity code of a single garbage bag, so as to generate a garbage bag with Chinese and English characters that is unique to a single garbage bag. Identity code, expressed as M 1 M 2 ... M k M k+1 M k+2 ... M k+L M k+L+1 M k+L+2 ... M k+L+p M k+L+p+1 M k+L+p+2 ...M k+L+p+n M k+L+p+n+1 M k+L+p+n+ 2 M k+L +p+n+3 M k+L+p+n+4 , where M 1 M 2 ... M k are provinces and municipalities, and M k+1 M k+2 ... M k+L are specific residences Address, M k+L+1 M k+L+ 2 ... M k+L+p is the contact person and contact number, M k+L+p+1 M k+L+p+2 ... M k +L+p+n is the code time (the format is year-month-day, where the last two digits M k+L+p+n-1 M k+L+p+n is the date), M k+L+ p+n+1 M k+L+p+n+2 is the garbage classification color information (representing the garbage category), M k+L+p+n+3 M k+L+p+n+4 is the garbage classification serial number Information (representing the serial number of a certain type of garbage bags on a certain day), separated by English spaces, and the unified identity code of a corresponding batch of garbage bags is M 1 M 2 ... M k M k+1 M k+2 ... M k+L M k+L+1 M k+L+2 ...M k+L+p M k+L+p+ 1 M k+L+p+2 ...M k+L+p+ n-3 M k+L+p+n-2 , the batch ID code of the corresponding single garbage bag is M k+L+p+n-1 M k+L+p+n M k+L+p+n+ 1 M k+L+p+n+2 M k+L+p+n+3 M k+L+p+n+4 ,

然后,从某批垃圾袋的统一身份码中抽取出身份标识码(M1M2...MkMk+L+p+ 1Mk+L+p+2...Mk+L+p+n-2)和身份隐藏码(Mk+1Mk+2...Mk+LMk+L+1Mk+L+2...Mk+L+p),并将身份标识码逐个字符转换成数值型数据,得到对应的数值序列

Figure BDA0002705937450000021
同时将身份隐藏码逐个字符转换成数值型数据[Pi1,Pi2],得到高位数值序列P1={P11,P12,…,P1L+p,P1L+p+1}={P11,P21,…,P(L+p)1,P(L+p+1)1}和低位数值序列P2={P21,P22,…,P2L+p,P2L+p+1}={P12,P22,…,P(L+p)2,P(L+p+1)2},Then, the identification code (M 1 M 2 ... M k M k+L+p+ 1 M k+L+p+2 ... M k+L+ p+n-2 ) and identity concealment codes (M k+1 M k+2 ... M k+L M k+L+1 M k+L+2 ... M k+L+p ), and Convert the identification code into numerical data character by character to obtain the corresponding numerical sequence
Figure BDA0002705937450000021
At the same time, the identity hidden code is converted into numerical data [P i1 ,P i2 ] character by character, and the high-order numerical sequence P1={P1 1 ,P1 2 ,...,P1 L+p ,P1 L+p+1 }={P 11 ,P 21 ,…,P (L+p)1 ,P (L+p+1)1 } and the low-order numerical sequence P2={P2 1 ,P2 2 ,…,P2 L+p ,P2 L+p+ 1 }={P 12 ,P 22 ,...,P (L+p)2 ,P (L+p+1)2 },

最后,依次将数值序列S中元素Si逐个转换成8bits的二进制序列{BSi1,BSi2,BSi3,BSi4,BSi5,BSi6,BSi7,BSi8}、将数值序列P1中元素P1i逐个转换成8bits的二进制序列{BP1i1,BP1i2,BP1i3,BP1i4,BP1i5,BP1i6,BP1i7,BP1i8}、将数值序列P2中元素P2i逐个转换成8bits的二进制序列{BP2i1,BP2i2,BP2i3,BP2i4,BP2i5,BP2i6,BP2i7,BP2i8},Finally, convert the elements Si in the numerical sequence S into 8- bit binary sequences {BS i1 , BS i2 , BS i3 , BS i4 , BS i5 , BS i6 , BS i7 , BS i8 } one by one, and convert the elements in the numerical sequence P1 into Convert P1 i into a binary sequence of 8 bits one by one {BP1 i1 , BP1 i2 , BP1 i3 , BP1 i4 , BP1 i5 , BP1 i6 , BP1 i7 , BP1 i8 }, convert the elements P2 i in the numerical sequence P2 into a binary sequence of 8 bits one by one {BP2 i1 , BP2 i2 , BP2 i3 , BP2 i4 , BP2 i5 , BP2 i6 , BP2 i7 , BP2 i8 },

并将

Figure BDA0002705937450000022
个二进制序列{BSi1,BSi2,BSi3,BSi4,BSi5,BSi6,BSi7,BSi8}进行组合,其中
Figure BDA0002705937450000023
从而得到组合二进制矩阵B,and will
Figure BDA0002705937450000022
Binary sequences {BS i1 , BS i2 , BS i3 , BS i4 , BS i5 , BS i6 , BS i7 , BS i8 } are combined, where
Figure BDA0002705937450000023
Thus, the combined binary matrix B is obtained,

Figure BDA0002705937450000024
Figure BDA0002705937450000024

同时将L+p+1个二进制序列{BP1i1,BP1i2,BP1i3,BP1i4,BP1i5,BP1i6,BP1i7,BP1i8}进行组合,其中i=1,2,...,L+p,L+p+1,从而得到高位组合二进制序列B1={B11,B12,...,B18L+8p+7,B18L+8p+8}={BP11 1,BP11 2,BP113,BP114,BP115,BP116,BP117,BP118,BP121,BP122,...,BP127,BP128,...,BP1i1,BP1i2,...,BP1i7,BP1i8,...,BP1L+p+11,BP1L+p+12,BP1L+p+13,BP1L+p+14,BP1L+p+15,BP1L+p+1 6,BP1L+p+1 7,BP1L+p+18},并将L+p+1个二进制序列{BP2i1,BP2i2,BP2i3,BP2i4,BP2i5,BP2i6,BP2i7,BP2i8}进行组合,其中i=1,2,...,L+p,L+p+1,从而得到低位组合二进制序列B2={B21,B22,...,B28L+8p+7,B28L+8p+8}={BP211,BP212,BP213,BP214,BP215,BP216,BP217,BP218,BP221,BP222,...,BP227,BP228,...,BP2i1,BP2i2,...,BP2i7,BP2i8,...,BP2L+p+11,BP2L+p+12,BP2L+p+13,BP2L+p+14,BP2L+p+1 5,BP2L+p+1 6,BP2L+p+17,BP2L+p+18},Simultaneously combine L+p+1 binary sequences {BP1 i1 , BP1 i2 , BP1 i3 , BP1 i4 , BP1 i5 , BP1 i6 , BP1 i7 , BP1 i8 }, where i=1,2,...,L +p,L+p+1, so as to obtain the high-order combined binary sequence B1={B1 1 ,B1 2 ,...,B1 8L+8p+7 ,B1 8L+8p+8 }={BP1 1 1 ,BP1 1 2 ,BP1 13 ,BP1 14 ,BP1 15 ,BP1 16 ,BP1 17 ,BP1 18 ,BP1 21 ,BP1 22 ,...,BP1 27 ,BP1 28 ,...,BP1 i1 ,BP1 i2 ,..., BP1 i7 ,BP1 i8 ,...,BP1 L+p+11 ,BP1 L+p+12 ,BP1 L+p+13 ,BP1 L+p+14 ,BP1 L+p+15 ,BP1 L+p+ 1 6 , BP1 L+p+1 7 , BP1 L+p+18 }, and convert L+p+1 binary sequences {BP2 i1 , BP2 i2 , BP2 i3 , BP2 i4 , BP2 i5 , BP2 i6 , BP2 i7 ,BP2 i8 }, where i=1,2,...,L+p,L+p+1, so as to obtain the low-order combined binary sequence B2={B2 1 ,B2 2 ,...,B2 8L+ 8p+7 ,B2 8L+8p+8 }={BP2 11 ,BP2 12 ,BP2 13 ,BP2 14 ,BP2 15 ,BP2 16 ,BP2 17 ,BP2 18 ,BP2 21 ,BP2 22 ,...,BP2 27 , BP2 28 ,...,BP2 i1 ,BP2 i2 ,...,BP2 i7 ,BP2 i8 ,...,BP2 L+p+11 ,BP2 L+p+12 ,BP2 L+p+13 ,BP2 L +p+14 , BP2 L+p+1 5 , BP2 L+p+1 6 , BP2 L+p+17 , BP2 L+p+18 },

其中垃圾袋身份码包括GB2312字符集中双字节编码的汉字和ASCLL码值∈[32,126]的可见字符,垃圾袋身份码长度为k+L+p+n+6,数值序列S的长度为

Figure BDA0002705937450000031
数值序列P1、P2的长度为L+p+1,组合二进制矩阵B的大小为
Figure BDA0002705937450000032
组合二进制序列B1、B2的长度为8L+8p+8;Among them, the garbage bag identification code includes the double-byte encoded Chinese characters in the GB2312 character set and the visible characters with ASCLL code value ∈ [32,126]. The length of the garbage bag identification code is k+L+p+n+6, and the length of the numerical sequence S is
Figure BDA0002705937450000031
The length of the numerical sequences P1 and P2 is L+p+1, and the size of the combined binary matrix B is
Figure BDA0002705937450000032
The length of the combined binary sequence B1 and B2 is 8L+8p+8;

(2)某批垃圾袋的身份隐藏码统一加密(2) The identity hidden codes of a certain batch of garbage bags are uniformly encrypted

某批垃圾袋的身份隐藏码统一加密,表示利用身份标识码(M1M2…MkMk+L+p+ 1Mk+L+p+2...Mk+L+p+n-2)对身份隐藏码(Mk+1Mk+2...Mk+LMk+L+1Mk+L+2...Mk+L+p)进行加密,某批垃圾袋需且仅需经历一次身份隐藏码统一加密运算,The identity hidden code of a certain batch of garbage bags is uniformly encrypted, which means that the identity code (M 1 M 2 ... M k M k+L+p+ 1 M k+L+p+2 ... M k+L+p+n -2 ) Encrypt the identity hidden code (M k+1 M k+2 ... M k+L M k+L+1 M k+L+2 ... M k+L+p ), a batch of The garbage bag needs and only needs to undergo a unified encryption operation of the identity hidden code.

首先,利用数值序列S及其转换成的二进制矩阵B,数值序列P1、P2转换成的二进制序列B1、B2,以及外部密钥α和β,按照如下(1)-(5)公式分别计算得到Logistic混沌映射的初值x1和参数μ、抽取开始位置m,以及抽取间隔数n1、n2First, using the numerical sequence S and the binary matrix B converted into it, the binary sequences B1 and B2 converted from the numerical sequences P1 and P2, and the external keys α and β, they are calculated according to the following formulas (1)-(5) respectively. The initial value x 1 and parameter μ of the Logistic chaotic map, the extraction start position m, and the number of extraction intervals n 1 and n 2 ,

Figure BDA0002705937450000033
make
Figure BDA0002705937450000033

Figure BDA0002705937450000034
Figure BDA0002705937450000034

Figure BDA0002705937450000035
Figure BDA0002705937450000035
but

x1=α+mod(α+kp, 1-α), (1)x 1 =α+mod(α+kp, 1-α), (1)

μ=β+mod(β+1.5×kp, 4-β), (2)μ=β+mod(β+1.5×kp, 4-β), (2)

Figure BDA0002705937450000036
Figure BDA0002705937450000036

Figure BDA0002705937450000037
Figure BDA0002705937450000037

Figure BDA0002705937450000038
Figure BDA0002705937450000038

其中,〈B1,i,B2,i,B3,i,B4,i,B5,i,B6,i,B7,i,B8,i〉表示二进制矩阵B第i列或者二进制序列{BSi1,BSi2,BSi3,BSi4,BSi5,BSi6,BSi7,BSi8}中二进制位‘1’的个数,<B11,B12,...,B18L+8p+7,B18L+8p+8>表示二进制序列{B11,B12,...,B18L+8p+7,B18L+8p+8}中二进制位‘1’的个数,B21,B22,...,B28L+8p+7,B28L+8p+8>表示二进制序列{B21,B22,...,B28L+8p+7,B28L+8p+8}中二进制位‘1’的个数,外部密钥满足α∈(0,1)、β∈(3.57,4),Among them, <B 1,i ,B 2,i ,B 3,i ,B 4,i ,B 5,i ,B 6,i ,B 7,i ,B 8,i >represents the i-th column of binary matrix B Or the number of binary bits '1' in the binary sequence {BS i1 , BS i2 , BS i3 , BS i4 , BS i5 , BS i6 , BS i7 , BS i8 }, <B1 1 , B1 2 ,...,B1 8L+8p+7 ,B1 8L+8p+8 >represents the number of binary bits '1' in the binary sequence {B1 1 ,B1 2 ,...,B1 8L+8p+7 ,B1 8L+8p+8 } ,B2 1 ,B2 2 ,...,B2 8L+8p+7 ,B2 8L+8p+8 > represents the binary sequence {B2 1 ,B2 2 ,...,B2 8L+8p+7 ,B2 8L+8p The number of binary bits '1' in +8 }, the external key satisfies α∈(0,1), β∈(3.57,4),

由混沌映射的初值x1和外部密钥μ,对如下公式(6)所示Logistic混沌映射进行迭代,式中k表示迭代次数(k=1,2,...)、xk+1表示第k次迭代得到的混沌信号,From 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个元素以形成长度为8L+8p+8的混沌信号序列

Figure BDA0002705937450000041
同时从序列X中第m个元素开始依次间隔n2个元素取1个元素以形成长度为8L+8p+8的混沌信号序列Z={Z1,Z2,...,Z8L+8p+7,Z8L+8p+8},The chaotic signal sequence X={x 1 , x 2 ,...} is obtained, and starting from the mth element in the sequence X, one element is taken at intervals of n 1 elements to form a chaotic signal sequence with a length of 8L+8p+8
Figure BDA0002705937450000041
At the same time, starting from the mth element in the sequence X, 1 element is taken at intervals of n 2 elements to form a chaotic signal sequence with a length of 8L+8p+8 Z={Z 1 , Z 2 ,...,Z 8L+8p +7 ,Z 8L+8p+8 },

然后,将混沌信号序列Y按降序排序,根据混沌信号序列Y排序前、后的位置变化置乱规则,对高位组合二进制序列B1进行置乱,得到置乱后高位二进制序列

Figure BDA0002705937450000042
同时将混沌信号序列Z按降序排序,根据混沌信号序列Z排序前、后的位置变化置乱规则,对低位组合二进制序列B2进行置乱,得到置乱后低位二进制序列
Figure BDA0002705937450000043
Then, sort the chaotic signal sequence Y in descending order, and scramble the high-order combined binary sequence B1 according to the scrambling rules of the position change before and after the chaotic signal sequence Y is sorted to obtain the scrambled high-order binary sequence
Figure BDA0002705937450000042
At the same time, sort the chaotic signal sequence Z in descending order, and scrambling the low-order combined binary sequence B2 according to the scrambling rules of the position change before and after the chaotic signal sequence Z is sorted to obtain the scrambled low-order binary sequence
Figure BDA0002705937450000043

接着,令LB=mod(6-mod(8L+8p+8,6),6),将置乱后高位二进制序列

Figure BDA0002705937450000044
的末尾添加LB个二进制位‘0’,将置乱后低位二进制序列
Figure BDA0002705937450000045
的末尾添加LB个二进制位‘1’,得到二进制序列
Figure BDA0002705937450000046
Figure BDA0002705937450000047
和二进制序列
Figure BDA0002705937450000048
Figure BDA0002705937450000049
其中
Figure BDA00027059374500000410
Next, let LB=mod(6-mod(8L+8p+8,6),6), the scrambled high-order binary sequence
Figure BDA0002705937450000044
Add LB binary bits '0' at the end, which will scramble the low-order binary sequence
Figure BDA0002705937450000045
Add LB binary bits '1' at the end to get the binary sequence
Figure BDA0002705937450000046
Figure BDA0002705937450000047
and binary sequence
Figure BDA0002705937450000048
Figure BDA0002705937450000049
in
Figure BDA00027059374500000410

对二进制序列

Figure BDA00027059374500000411
Figure BDA00027059374500000412
分别进行分组,将二进制序列
Figure BDA00027059374500000413
中元素从头到尾依次正向以6个元素为单位进行分组,得到分组后的二进制序列,表示为
Figure BDA00027059374500000414
同时将二进制序列
Figure BDA00027059374500000415
中元素从头到尾依次正向以6个元素为单位进行分组,得到分组后的二进制序列,表示为
Figure BDA00027059374500000416
其中每一个二进制分组序列均包含6个二进制位,且
Figure BDA00027059374500000417
pair binary sequence
Figure BDA00027059374500000411
and
Figure BDA00027059374500000412
grouped separately, the binary sequence
Figure BDA00027059374500000413
The elements in the middle are grouped forward in units of 6 elements from the beginning to the end, and the binary sequence after the grouping is obtained, which is expressed as
Figure BDA00027059374500000414
Simultaneously convert the binary sequence
Figure BDA00027059374500000415
The elements in the middle are grouped forward in units of 6 elements from the beginning to the end, and the binary sequence after the grouping is obtained, which is expressed as
Figure BDA00027059374500000416
where each binary block sequence contains 6 binary bits, and
Figure BDA00027059374500000417

最后,将每一个二进制分组序列BF1{i}、BF2{i},依次进行如下扩散操作:Finally, each binary grouping sequence BF1{i}, BF2{i} is subjected to the following diffusion operations in turn:

S0:令i=1,且S0: let i=1, and

k1_switch=mod(3×<B11,B12,...,B18L+8p+7,B18L+8p+8>+2×(8L+8p+8-<B11,B12,...,B18L+8p+7,B18L+8p+8>),8),k1_switch=mod(3×<B1 1 ,B1 2 ,...,B1 8L+8p+7 ,B1 8L+8p+8 >+2×(8L+8p+8-<B1 1 ,B1 2 ,.. .,B1 8L+8p+7 ,B1 8L+8p+8 >),8),

k2_switch=mod(3×<B21,B22,...,B28L+8p+7,B28L+8p+8>-2×(8L+8p+8-<B21,B22,...,B28L+8p+7,B28L+8p+8>),25),k2_switch=mod(3×<B2 1 ,B2 2 ,...,B2 8L+8p+7 ,B2 8L+8p+8 >-2×(8L+8p+8-<B2 1 ,B2 2 ,.. .,B2 8L+8p+7 ,B2 8L+8p+8 >),25),

S1:将二进制分组序列BF1{i}、BF2{i},按如下公式(7)、(8)进行计算,S1: Calculate the binary grouping sequences BF1{i} and BF2{i} according to the following formulas (7) and (8),

CP1i=bin2dec(BF1{i})+176+k1_switch, (7)CP1 i =bin2dec(BF1{i})+176+k1_switch, (7)

CP2i=bin2dec(BF2{i})+161+k2_switch, (8)CP2 i =bin2dec(BF2{i})+161+k2_switch, (8)

S2:利用二进制分组序列BF1{i}计算而得的数值型数据CP1i,以及二进制分组序列BF2{i}计算而得的数值型数据CP2i,计算k1_switch=mod(CP1i+2×CP2i+3×k1_switch,8)、k2_switch=mod(CP2i+2×CP1i+3×k2_switch,25),且令i=i+1,接着判断i的大小,如果

Figure BDA0002705937450000051
则转入步骤S1,否则转入步骤S3,S2: The numerical data CP1 i calculated by using the binary block sequence BF1{i}, and the numerical data CP2 i calculated by the binary block sequence BF2{i}, calculate k1_switch=mod(CP1 i +2×CP2 i +3×k1_switch,8), k2_switch=mod(CP2 i +2×CP1 i +3×k2_switch,25), and let i=i+1, then judge the size of i, if
Figure BDA0002705937450000051
Then go to step S1, otherwise go to step S3,

S3:结束二进制分组序列的扩散操作,从而得到扩散后的数值序列CP1和CP2,即某批垃圾袋的身份隐藏码的加密信息,表示为

Figure BDA0002705937450000052
S3: End the diffusion operation of the binary packet sequence, so as to obtain the diffused numerical sequences CP1 and CP2, that is, the encrypted information of the identity hidden code of a certain batch of garbage bags, expressed as
Figure BDA0002705937450000052

(3)某批垃圾袋的垃圾分类号批量生成(3) Batch generation of garbage classification numbers for a certain batch of garbage bags

根据该批垃圾袋中单件垃圾袋的批量身份码(各个垃圾分类码制码日期、垃圾类别、垃圾分类序号信息)的不同,分别执行单个垃圾分类号生成步骤,即可实现该批垃圾袋的垃圾分类号批量生成,其中单件垃圾袋的垃圾分类号生成步骤描述如下,According to the difference in the batch identity code (code date of each garbage classification code, garbage category, garbage classification serial number information) of a single garbage bag in the batch of garbage bags, the steps of generating a single garbage classification number are performed respectively, and the batch of garbage bags can be realized. The garbage classification numbers are generated in batches, and the steps for generating the garbage classification numbers for a single garbage bag are described as follows:

首先,从垃圾袋身份码中抽取出垃圾分类码的制码日期(Mk+L+p+n-1Mk+L+p+n)、垃圾类别(Mk+L+p+n+1Mk+L+p+n+2)、垃圾分类序号信息(Mk+L+p+n+3Mk+L+p+n+4),将制码日期逐个字符利用bin2dec()函数转换成数值型数据,得到数值序列R={R1,R2},将垃圾分类序号信息逐个字符利用bin2dec()函数转换成数值型数据,得到数值序列F={F1,F2},First, extract the code date of the garbage classification code (M k+L+p+n-1 M k+L+p+n ), the garbage category (M k+L+p+n+ 1 M k+L+p+n+2 ), garbage classification serial number information (M k+L+p+n+3 M k+L+p+n+4 ), use bin2dec() to make code date character by character The function is converted into numerical data, and the numerical sequence R={R 1 , R 2 } is obtained, and the garbage classification serial number information is converted into numerical data character by character using the bin2dec() function to obtain the numerical sequence F={F 1 , F 2 } ,

然后,按照如下(9)、(10)公式分别计算得到Logistic混沌映射的初值

Figure BDA0002705937450000053
和参数
Figure BDA0002705937450000054
Then, according to the following formulas (9) and (10), the initial value of the Logistic chaotic map is calculated respectively
Figure BDA0002705937450000053
and parameters
Figure BDA0002705937450000054

Figure BDA0002705937450000055
则make
Figure BDA0002705937450000055
but

Figure BDA0002705937450000056
Figure BDA0002705937450000056

Figure BDA0002705937450000057
Figure BDA0002705937450000057

由混沌映射的初值

Figure BDA0002705937450000058
和外部密钥
Figure BDA0002705937450000059
对如下公式(11)所示Logistic混沌映射进行迭代,式中k表示迭代次数(k=1,2,...)、
Figure BDA00027059374500000510
表示第k次迭代得到的混沌信号,Initial value mapped by chaos
Figure BDA0002705937450000058
and external key
Figure BDA0002705937450000059
Iterate the Logistic chaotic map shown in the following formula (11), where k represents the number of iterations (k=1, 2,...),
Figure BDA00027059374500000510
represents the chaotic signal obtained at the kth iteration,

Figure BDA00027059374500000511
Figure BDA00027059374500000511

得到混沌信号序列

Figure BDA00027059374500000512
从序列
Figure BDA00027059374500000513
中第m个元素开始依次间隔n1个元素取1个元素以形成长度为
Figure BDA00027059374500000514
的混沌信号序列
Figure BDA00027059374500000515
同时从序列
Figure BDA00027059374500000516
中第m个元素开始依次间隔n2个元素取1个元素以形成长度为
Figure BDA00027059374500000517
的混沌信号序列
Figure BDA00027059374500000518
get chaotic signal sequence
Figure BDA00027059374500000512
from the sequence
Figure BDA00027059374500000513
The mth element in the middle starts to take 1 element at an interval of n 1 elements to form a length of
Figure BDA00027059374500000514
chaotic signal sequence of
Figure BDA00027059374500000515
Simultaneously from the sequence
Figure BDA00027059374500000516
The mth element in the middle starts to take 1 element at an interval of n 2 elements to form a length of
Figure BDA00027059374500000517
chaotic signal sequence of
Figure BDA00027059374500000518

接着,根据垃圾类别(Mk+L+p+n+1Mk+L+p+n+2)对某批垃圾袋的身份隐藏码加密信息,数值序列CP1、CP2采取如下操作,Next, according to the garbage category (M k+L+p+n+1 M k+L+p+n+2 ), the identity hidden code encryption information of a certain batch of garbage bags is performed, and the numerical sequences CP1 and CP2 take the following operations:

如果Mk+L+p+n+1Mk+L+p+n+2=“01”,则将混沌信号序列

Figure BDA00027059374500000519
按升序排序,根据混沌信号序列
Figure BDA00027059374500000520
排序前、后的位置变化置乱规则,对数值序列CP1进行置乱,得到置乱后的数值序列
Figure BDA0002705937450000061
Figure BDA0002705937450000062
同时将混沌信号序列
Figure BDA0002705937450000063
按升序排序,根据混沌信号序列
Figure BDA0002705937450000064
排序前、后的位置变化置乱规则,对低位组合二进制序列CP2进行置乱,得到置乱后的数值序列
Figure BDA0002705937450000065
Figure BDA0002705937450000066
If M k+L+p+n+1 M k+L+p+n+2 ="01", then the chaotic signal sequence
Figure BDA00027059374500000519
Sort in ascending order, according to the chaotic signal sequence
Figure BDA00027059374500000520
The position change scrambling rules before and after sorting, scrambling the numerical sequence CP1, and obtaining the scrambled numerical sequence
Figure BDA0002705937450000061
Figure BDA0002705937450000062
At the same time, the chaotic signal sequence
Figure BDA0002705937450000063
Sort in ascending order, according to the chaotic signal sequence
Figure BDA0002705937450000064
The position change scrambling rules before and after sorting, scrambling the low-order combination binary sequence CP2, and obtaining the scrambled numerical sequence
Figure BDA0002705937450000065
Figure BDA0002705937450000066

如果Mk+L+p+n+1Mk+L+p+n+2=“02”,则将混沌信号序列

Figure BDA0002705937450000067
按升序排序,根据混沌信号序列
Figure BDA0002705937450000068
排序前、后的位置变化置乱规则,对数值序列CP1进行置乱,得到置乱后的数值序列
Figure BDA0002705937450000069
Figure BDA00027059374500000610
同时将混沌信号序列
Figure BDA00027059374500000611
按降序排序,根据混沌信号序列
Figure BDA00027059374500000612
排序前、后的位置变化置乱规则,对低位组合二进制序列CP2进行置乱,得到置乱后的数值序列
Figure BDA00027059374500000613
Figure BDA00027059374500000614
If M k+L+p+n+1 M k+L+p+n+2 = "02", then the chaotic signal sequence
Figure BDA0002705937450000067
Sort in ascending order, according to the chaotic signal sequence
Figure BDA0002705937450000068
The position change scrambling rules before and after sorting, scrambling the numerical sequence CP1, and obtaining the scrambled numerical sequence
Figure BDA0002705937450000069
Figure BDA00027059374500000610
At the same time, the chaotic signal sequence
Figure BDA00027059374500000611
Sort in descending order, according to the chaotic signal sequence
Figure BDA00027059374500000612
The position change scrambling rules before and after sorting, scrambling the low-order combination binary sequence CP2, and obtaining the scrambled numerical sequence
Figure BDA00027059374500000613
Figure BDA00027059374500000614

如果Mk+L+p+n+1Mk+L+p+n+2=“03”,则先将混沌信号序列

Figure BDA00027059374500000615
重组,得重组后的混沌信号序列
Figure BDA00027059374500000616
Figure BDA00027059374500000617
再将混沌信号序列
Figure BDA00027059374500000618
按降序排序,根据混沌信号序列
Figure BDA00027059374500000619
排序前、后的位置变化置乱规则,对数值序列CP1进行置乱,得到置乱后的数值序列
Figure BDA00027059374500000620
Figure BDA00027059374500000621
同时将混沌信号序列
Figure BDA00027059374500000622
按升序排序,根据混沌信号序列
Figure BDA00027059374500000623
排序前、后的位置变化置乱规则,对低位组合二进制序列CP2进行置乱,得到置乱后的数值序列
Figure BDA00027059374500000624
Figure BDA00027059374500000625
If M k+L+p+n+1 M k+L+p+n+2 = "03", then the chaotic signal sequence
Figure BDA00027059374500000615
Recombination, get the reorganized chaotic signal sequence
Figure BDA00027059374500000616
Figure BDA00027059374500000617
Then the chaotic signal sequence
Figure BDA00027059374500000618
Sort in descending order, according to the chaotic signal sequence
Figure BDA00027059374500000619
The position change scrambling rules before and after sorting, scrambling the numerical sequence CP1, and obtaining the scrambled numerical sequence
Figure BDA00027059374500000620
Figure BDA00027059374500000621
At the same time, the chaotic signal sequence
Figure BDA00027059374500000622
Sort in ascending order, according to the chaotic signal sequence
Figure BDA00027059374500000623
The position change scrambling rules before and after sorting, scrambling the low-order combination binary sequence CP2, and obtaining the scrambled numerical sequence
Figure BDA00027059374500000624
Figure BDA00027059374500000625

如果

Figure BDA00027059374500000626
则先将混沌信号序列
Figure BDA00027059374500000627
重组,得重组后的混沌信号序列
Figure BDA00027059374500000628
Figure BDA00027059374500000629
再将混沌信号序列
Figure BDA00027059374500000630
按降序排序,根据混沌信号序列
Figure BDA00027059374500000631
排序前、后的位置变化置乱规则,对数值序列CP1进行置乱,得到置乱后的数值序列
Figure BDA00027059374500000632
Figure BDA00027059374500000633
同时先将混沌信号序列
Figure BDA00027059374500000634
重组,得重组后的混沌信号序列
Figure BDA00027059374500000635
Figure BDA00027059374500000636
再将混沌信号序列
Figure BDA00027059374500000637
按降序排序,根据混沌信号序列
Figure BDA00027059374500000638
排序前、后的位置变化置乱规则,对低位组合二进制序列CP2进行置乱,得到置乱后的数值序列
Figure BDA00027059374500000639
Figure BDA00027059374500000640
if
Figure BDA00027059374500000626
Then the chaotic signal sequence is first
Figure BDA00027059374500000627
Recombination, get the reorganized chaotic signal sequence
Figure BDA00027059374500000628
Figure BDA00027059374500000629
Then the chaotic signal sequence
Figure BDA00027059374500000630
Sort in descending order, according to the chaotic signal sequence
Figure BDA00027059374500000631
The position change scrambling rules before and after sorting, scrambling the numerical sequence CP1, and obtaining the scrambled numerical sequence
Figure BDA00027059374500000632
Figure BDA00027059374500000633
At the same time, the chaotic signal sequence is first
Figure BDA00027059374500000634
Recombination, get the reorganized chaotic signal sequence
Figure BDA00027059374500000635
Figure BDA00027059374500000636
Then the chaotic signal sequence
Figure BDA00027059374500000637
Sort in descending order, according to the chaotic signal sequence
Figure BDA00027059374500000638
The position change scrambling rules before and after sorting, scrambling the low-order combination binary sequence CP2, and obtaining the scrambled numerical sequence
Figure BDA00027059374500000639
Figure BDA00027059374500000640

其中,

Figure BDA00027059374500000641
运算表示得到一个不大于
Figure BDA00027059374500000642
的整数,in,
Figure BDA00027059374500000641
operation means to obtain a value not greater than
Figure BDA00027059374500000642
the integer,

最后,将数值序列

Figure BDA00027059374500000643
逐个元素组合并转换为汉字字符,得到汉字序列
Figure BDA00027059374500000644
即为垃圾分类号,其中汉字序列C的长度为
Figure BDA00027059374500000645
Finally, the numerical sequence
Figure BDA00027059374500000643
Element-by-element combination and conversion to Chinese characters to get the Chinese character sequence
Figure BDA00027059374500000644
is the garbage classification number, where the length of the Chinese character sequence C is
Figure BDA00027059374500000645

根据该批垃圾袋中单个垃圾分类号生成过程,依次进行该批垃圾袋的各个垃圾分类号的生成;According to the generation process of a single garbage classification number in the batch of garbage bags, the generation of each garbage classification number of the batch of garbage bags is performed in sequence;

(4)某批垃圾袋的垃圾分类码组合与垃圾分类二维码生成(4) Combination of garbage classification codes for a certain batch of garbage bags and generation of garbage classification QR codes

将垃圾袋身份标识码(M1M2...MkMk+L+p+1Mk+L+p+2...Mk+L+p+n-2)、制码日期(Mk+L+p+n- 1Mk+L+p+n)、垃圾分类号

Figure BDA0002705937450000071
垃圾类别(Mk+L+p+n+1Mk+L+p+n+2)、垃圾分类序号信息(Mk+L+p+n+3Mk+L+p+n+4)进行组合,生成该批垃圾袋中单个垃圾分类码,接着生成QR Code,即垃圾分类二维码,按此规则可批量组合生成该批垃圾袋的垃圾分类二维码。Put the garbage bag identification code (M 1 M 2 ... M k M k+L+p+1 M k+L+p+2 ... M k+L+p+n-2 ), the date of making the code (M k+L+p+n- 1 M k+L+p+n ), garbage classification number
Figure BDA0002705937450000071
Garbage category (M k+L+p+n+1 M k+L+p+n+2 ), garbage classification serial number information (M k+L+p+n+3 M k+L+p+n+4 ) to generate a single garbage classification code in the batch of garbage bags, and then generate a QR Code, that is, a garbage classification two-dimensional code. According to this rule, the garbage classification two-dimensional code of the batch of garbage bags can be generated by batch combination.

进一步地,一种垃圾分类二维码批量生成方法里步骤(1)中所述的将身份标识码逐个字符转换成数值型数据,是指将身份标识码逐个字符采用unicode2native()函数将ASCII码值属于[32,126]的可见字符转换为单个数值型数据,或将GB2312字符集中双字节编码的汉字转换为两个数值型数据,从而得到对应的数值序列

Figure BDA0002705937450000072
Further, converting the identity code into numerical data character by character as described in step (1) in a method for batch generation of two-dimensional codes for garbage classification means that the identity code is character-by-character using the unicode2native() function to convert the ASCII code. The visible characters whose value belongs to [32,126] are converted into a single numeric data, or the Chinese characters encoded by the double-byte encoding in the GB2312 character set are converted into two numeric data, so as to obtain the corresponding numeric sequence
Figure BDA0002705937450000072

进一步地,一种垃圾分类二维码批量生成方法里步骤(1)中所述的将身份隐藏码逐个字符转换成数值型数据[Pi1,Pi2],是指将身份隐藏码逐个字符采用unicode2native()函数将ASCII码值属于[32,126]的可见字符转换为单个数值型数据并进行重组,表示为[Pi1,Pi2]=[0,unicode2native(Mi)],或将GB2312字符集中双字节编码的汉字转换为两个数值型数据,表示为[Pi1,Pi2]=unicode2native(Mi),从而得到高位数值序列P1={P11,P12,…,P1L+p,P1L+p+1}={P11,P21,…,P(L+p)1,P(L+p+1)1}和低位数值序列P2={P21,P22,…,P2L+p,P2L+p+1}={P12,P22,…,P(L+p)2,P(L+p+1)2}。Further, converting the identity hidden code into numerical data [P i1 , P i2 ] character by character as described in step (1) in a method for batch generation of two-dimensional codes for garbage classification means that the identity hidden code is used character by character. The unicode2native() function converts the visible characters whose ASCII code value belongs to [32,126] into a single numeric data and reorganizes them, expressed as [P i1 ,P i2 ]=[0,unicode2native(M i )], or the GB2312 character set The double-byte encoded Chinese characters are converted into two numerical data, which are expressed as [P i1 ,P i2 ]=unicode2native(M i ), so as to obtain the high-order numerical sequence P1={P1 1 ,P1 2 ,...,P1 L+p ,P1 L+p+1 }={P 11 ,P 21 ,…,P (L+p)1 ,P (L+p+1)1 } and the low-order numerical sequence P2={P2 1 ,P2 2 ,… , P2 L+p , P2 L+p+1 }={P 12 , P 22 ,...,P (L+p)2 ,P (L+p+1)2 }.

进一步地,一种垃圾分类二维码批量生成方法里步骤(1)中所述的将数值序列S中元素Si逐个转换成8bits的二进制序列{BSi1,BSi2,BSi3,BSi4,BSi5,BSi6,BSi7,BSi8},是指采用dec2bin(Si,8)函数得到二进制序列{BSi1,BSi2,BSi3,BSi4,BSi5,BSi6,BSi7,BSi8}。Further, the step (1) in a method for batch generation of two-dimensional codes for garbage classification converts the elements S i in the numerical sequence S into 8-bit binary sequences {BS i1 , BS i2 , BS i3 , BS i4 , BS i5 , BS i6 , BS i7 , BS i8 }, which means that the binary sequence {BS i1 , BS i2 , BS i3 , BS i4 , BS i5 , BS i6 , BS i7 , BS is obtained by using the dec2bin(S i , 8) function i8 }.

进一步地,一种垃圾分类二维码批量生成方法里步骤(1)中所述的将数值序列P1中元素P1i逐个转换成8bits的二进制序列{BP1i1,BP1i2,BP1i3,BP1i4,BP1i5,BP1i6,BP1i7,BP1i8},是指采用dec2bin(P1i,8)函数得到二进制序列{BP1i1,BP1i2,BP1i3,BP1i4,BP1i5,BP1i6,BP1i7,BP1i8}。Further, as described in step (1) in a method for batch generation of two-dimensional codes for garbage classification, the elements P1 i in the numerical sequence P1 are converted one by one into a binary sequence of 8 bits {BP1 i1 , BP1 i2 , BP1 i3 , BP1 i4 , BP1 i5 , BP1 i6 , BP1 i7 , BP1 i8 }, which means that the binary sequence {BP1 i1 , BP1 i2 , BP1 i3 , BP1 i4 , BP1 i5 , BP1 i6 , BP1 i7 , BP1 is obtained by using the dec2bin(P1 i , 8) function i8 }.

进一步地,一种垃圾分类二维码批量生成方法里步骤(1)中所述的将数值序列P2中元素P2i逐个转换成8bits的二进制序列{BP2i1,BP2i2,BP2i3,BP2i4,BP2i5,BP2i6,BP2i7,BP2i8},是指采用dec2bin(P2i,8)函数得到二进制序列{BP2i1,BP2i2,BP2i3,BP2i4,BP2i5,BP2i6,BP2i7,BP2i8}。Further, as described in step (1) in a method for batch generation of two-dimensional codes for garbage classification, the elements P2 i in the numerical sequence P2 are converted one by one into a binary sequence of 8 bits {BP2 i1 , BP2 i2 , BP2 i3 , BP2 i4 , BP2 i5 , BP2 i6 , BP2 i7 , BP2 i8 }, which means that the binary sequence {BP2 i1 , BP2 i2 , BP2 i3 , BP2 i4 , BP2 i5 , BP2 i6 , BP2 i7 , BP2 is obtained by using the dec2bin(P2 i , 8) function i8 }.

进一步地,一种垃圾分类二维码批量生成方法里步骤(3)中所述的将数值序列

Figure BDA0002705937450000073
Figure BDA0002705937450000074
逐个元素组合并转换为汉字字符,是指先逐个元素组合[CP1i,CP2i],然后再转换为汉字字符,即Ci=native2unicode([CP1i,CP2i])。Further, the numerical sequence described in step (3) in a method for batch generation of two-dimensional codes for garbage classification
Figure BDA0002705937450000073
Figure BDA0002705937450000074
Combining elements one by one and converting them into Chinese characters refers to combining [CP1 i , CP2 i ] element by element and then converting them into Chinese characters, that is, C i =native2unicode([CP1 i ,CP2 i ]).

进一步地,一种垃圾分类二维码批量生成方法里步骤(4)中所述的将垃圾袋身份标识码(M1M2...MkMk+L+p+1Mk+L+p+2...Mk+L+p+n-2)、制码日期(Mk+L+p+n-1Mk+L+p+n)、垃圾分类号

Figure BDA0002705937450000081
垃圾类别(Mk+L+p+n+1Mk+L+p+n+2)、垃圾分类序号信息(Mk+L+p+n+3Mk+L+p+n+4)进行组合,生成该批垃圾袋中单个垃圾分类码,是指采用将垃圾袋身份标识码、制码日期、垃圾分类号、垃圾类别和垃圾分类序号信息插入连接的组合方式,生成该批垃圾袋中单个垃圾分类码,表示为
Figure BDA0002705937450000082
其中M1M2...Mk
Figure BDA0002705937450000083
Mk+L+p+1Mk+L+p+2...Mk+L+p+n-2Mk+L+p+n-1Mk+L+p+n、Mk+L+p+n+1Mk+L+p+n+2与Mk+L+p+n+3Mk+L+p+n+4之间相互用英文空格间隔。Further, in step (4) in a method for batch generation of two-dimensional codes for garbage classification, the garbage bag identification codes (M 1 M 2 ... M k M k+L+p+1 M k+L +p+2 ...M k+L+p+n-2 ), code date (M k+L+p+n-1 M k+L+p+n ), garbage classification number
Figure BDA0002705937450000081
Garbage category (M k+L+p+n+1 M k+L+p+n+2 ), garbage classification serial number information (M k+L+p+n+3 M k+L+p+n+4 ) to generate a single garbage classification code in the batch of garbage bags, which refers to the combination method of inserting the garbage bag identification code, code production date, garbage classification number, garbage category and garbage classification serial number information into the connection to generate the batch of garbage. A single garbage classification code in the bag, expressed as
Figure BDA0002705937450000082
where M 1 M 2 ... M k ,
Figure BDA0002705937450000083
M k+L+p+1 M k+L+p+2 ...M k+L+p+n-2 M k+L+p+n-1 M k+L+p+n , M k +L+p+n+1 M k+L+p+n+2 and M k+L+p+n+3 M k+L+p+n+4 are separated by English spaces.

有益效果:本发明依赖从垃圾袋身份码中提取的身份标识码和隐藏码并利用混沌映射产生混沌信号序列,对身份隐藏码转换并组合而成的高、低位二进制序列分别进行置乱、分组及扩散,完成某批垃圾袋的身份隐藏码统一加密,并依赖单件垃圾袋的批量身份码并利用混沌映射产生混沌信号序列,并根据垃圾类别对身份隐藏码统一加密结果分别进行不同规则的置乱,从而批量生成垃圾分类二维码,以此保证所提一种垃圾分类二维码批量生成方法简单可行,具有很强的安全性、不易破解,批量生成的垃圾分类码具有“唯一性、安全性和垃圾分类引导性”。Beneficial effect: the present invention relies on the identity identification code and hidden code extracted from the garbage bag identity code and uses chaotic mapping to generate a chaotic signal sequence, and scrambling and grouping the high and low binary sequences formed by the conversion and combination of the identity hidden code respectively. and diffusion, complete the unified encryption of the identity hidden codes of a certain batch of garbage bags, rely on the batch identity codes of a single garbage bag and use chaotic mapping to generate chaotic signal sequences, and perform different rules on the unified encryption results of the identity hidden codes according to the garbage category. Scrambling, thereby generating garbage classification two-dimensional codes in batches, so as to ensure that the proposed method for batch generation of garbage classification two-dimensional codes is simple and feasible, has strong security, and is not easy to crack. The garbage classification codes generated in batches have "uniqueness" , safety and guidance on waste sorting”.

附图说明Description of drawings

图1为本发明的一种垃圾分类二维码批量生成流程示意图;Fig. 1 is a schematic diagram of the batch generation process of a garbage classification two-dimensional code according to the present invention;

图2为本发明的垃圾分类二维码示意图,中间含有“可回收”绿色背景标志。Fig. 2 is a schematic diagram of a two-dimensional code for garbage classification according to the present invention, with a "recyclable" green background mark in the middle.

具体实施方式Detailed ways

如图1所示的一种垃圾分类二维码批量生成方法,包括如下几个步骤:As shown in Figure 1, a method for batch generation of two-dimensional codes for garbage classification includes the following steps:

(1)编码、转码(1) Encoding and transcoding

首先,将某批垃圾袋的身份信息进行编码,包括某批垃圾袋的统一身份码、单件垃圾袋的批量身份码两部分,从而生成某批单件垃圾袋唯一的中英文字符型垃圾袋身份码,表示为M1M2...MkMk+1Mk+2...Mk+LMk+L+1Mk+L+2...Mk+L+pMk+L+p+1Mk+L+p+2...Mk+L+p+nMk+L+p+n+1Mk+L+p+n+ 2Mk+L+p+n+3Mk+L+p+n+4,其中M1M2...Mk为省市区,Mk+1Mk+2...Mk+L为具体居住地址,Mk+L+1Mk+L+ 2...Mk+L+p为联系人和联系电话,Mk+L+p+1Mk+L+p+2...Mk+L+p+n为制码时间(格式为年-月-日,其中最后两位Mk+L+p+n-1Mk+L+p+n为日期),Mk+L+p+n+1Mk+L+p+n+2为垃圾分类颜色信息(表征垃圾类别),Mk+L+p+n+3Mk+L+p+n+4为垃圾分类序号信息(表征某天某种类别垃圾袋的序号),相互用英文空格间隔,相应某批垃圾袋的统一身份码为M1M2...MkMk+1Mk+2...Mk+LMk+L+1Mk+L+2...Mk+L+pMk+L+p+ 1Mk+L+p+2...Mk+L+p+n-3Mk+L+p+n-2,单件垃圾袋的批量身份码为Mk+L+p+n-1Mk+L+p+nMk+L+p+n+1Mk+L+p+n+ 2Mk+L+p+n+3Mk+L+p+n+4First, encode the identity information of a batch of garbage bags, including the unified identity code of a batch of garbage bags and the batch identity code of a single garbage bag, so as to generate a garbage bag with Chinese and English characters that is unique to a single garbage bag. Identity code, expressed as M 1 M 2 ... M k M k+1 M k+2 ... M k+L M k+L+1 M k+L+2 ... M k+L+p M k+L+p+1 M k+L+p+2 ...M k+L+p+n M k+L+p+n+1 M k+L+p+n+ 2 M k+L +p+n+3 M k+L+p+n+4 , where M 1 M 2 ... M k are provinces and municipalities, and M k+1 M k+2 ... M k+L are specific residences Address, M k+L+1 M k+L+ 2 ... M k+L+p is the contact person and contact number, M k+L+p+1 M k+L+p+2 ... M k +L+p+n is the code time (the format is year-month-day, where the last two digits M k+L+p+n-1 M k+L+p+n is the date), M k+L+ p+n+1 M k+L+p+n+2 is the garbage classification color information (representing the garbage category), M k+L+p+n+3 M k+L+p+n+4 is the garbage classification serial number Information (representing the serial number of a certain type of garbage bags on a certain day), separated by English spaces, and the unified identity code of a corresponding batch of garbage bags is M 1 M 2 ... M k M k+1 M k+2 ... M k+L M k+L+1 M k+L+2 ...M k+L+p M k+L+p+ 1 M k+L+p+2 ...M k+L+p+ n-3 M k+L+p+n-2 , the batch ID code of a single garbage bag is M k+L+p+n-1 M k+L+p+n M k+L+p+n+ 1 M k+L+p+n+ 2 M k+L+p+n+3 M k+L+p+n+4 ,

然后,从某批垃圾袋的统一身份码中抽取出身份标识码(M1M2...MkMk+L+p+ 1Mk+L+p+2...Mk+L+p+n-2)和身份隐藏码(Mk+1Mk+2...Mk+LMk+L+1Mk+L+2...Mk+L+p),并将身份标识码逐个字符采用unicode2native()函数将ASCII码值属于[32,126]的可见字符转换为单个数值型数据,或将GB2312字符集中双字节编码的汉字转换为两个数值型数据,从而得到对应的数值序列

Figure BDA0002705937450000091
同时将身份隐藏码逐个字符采用unicode2native()函数将ASCII码值属于[32,126]的可见字符转换为单个数值型数据并进行重组,表示为[Pi1,Pi2]=[0,unicode2native(Mi)],或将GB2312字符集中双字节编码的汉字转换为两个数值型数据,表示为[Pi1,Pi2]=unicode2native(Mi),从而得到高位数值序列P1={P11,P12,…,P1L+p,P1L+p+1}={P11,P21,…,P(L+p)1,P(L+p+1)1}和低位数值序列P2={P21,P22,…,P2L+p,P2L+p+1}={P12,P22,…,P(L+p)2,P(L+p+1)2},Then, the identification code (M 1 M 2 ... M k M k+L+p+ 1 M k+L+p+2 ... M k+L+ p+n-2 ) and identity concealment codes (M k+1 M k+2 ... M k+L M k+L+1 M k+L+2 ... M k+L+p ), and Use the unicode2native() function to convert the visible characters whose ASCII code value belongs to [32,126] into single numeric data, or convert the double-byte encoded Chinese characters in the GB2312 character set into two numeric data, thereby obtaining Corresponding numeric sequence
Figure BDA0002705937450000091
At the same time, the unicode2native() function is used to convert the visible characters whose ASCII code value belongs to [32, 126] into a single numerical data and recombine them by using the unicode2native() function, which is expressed as [P i1 ,P i2 ]=[0,unicode2native(M i )], or convert the double-byte encoded Chinese characters in the GB2312 character set into two numerical data, expressed as [P i1 ,P i2 ]=unicode2native(M i ), so as to obtain the high-order numerical sequence P1={P1 1 ,P1 2 ,...,P1 L+p ,P1 L+p+1 }={P 11 ,P 21 ,...,P (L+p)1 ,P (L+p+1)1 } and the low-order numerical sequence P2= {P2 1 ,P2 2 ,…,P2 L+p ,P2 L+p+1 }={P 12 ,P 22 ,…,P (L+p)2 ,P (L+p+1)2 },

最后,依次将数值序列S中元素Si逐个采用dec2bin(Si,8)函数转换成8bits的二进制序列{BSi1,BSi2,BSi3,BSi4,BSi5,BSi6,BSi7,BSi8}、将数值序列P1中元素P1i逐个采用dec2bin(P1i,8)函数转换成8bits的二进制序列{BP1i1,BP1i2,BP1i3,BP1i4,BP1i5,BP1i6,BP1i7,BP1i8}、将数值序列P2中元素P2i逐个采用dec2bin(P2i, 8)函数转换成8bits的二进制序列{BP2i1,BP2i2,BP2i3,BP2i4,BP2i5,BP2i6,BP2i7,BP2i8},Finally, the elements Si in the numerical sequence S are sequentially converted into binary sequences of 8 bits {BS i1 , BS i2 , BS i3 , BS i4 , BS i5 , BS i6 , BS i7 , BS by using the dec2bin (Si , 8) function one by one i8 }. Convert the elements P1 i in the numerical sequence P1 into a binary sequence of 8 bits using the dec2bin(P1 i , 8) function one by one {BP1 i1 , BP1 i2 , BP1 i3 , BP1 i4 , BP1 i5 , BP1 i6 , BP1 i7 , BP1 i8 }. Convert the elements P2 i in the numerical sequence P2 one by one using the dec2bin(P2 i , 8) function into a binary sequence of 8 bits {BP2 i1 , BP2 i2 , BP2 i3 , BP2 i4 , BP2 i5 , BP2 i6 , BP2 i7 , BP2 i8 },

并将

Figure BDA0002705937450000092
个二进制序列{BSi1,BSi2,BSi3,BSi4,BSi5,BSi6,BSi7,BSi8}进行组合,其中
Figure BDA0002705937450000093
从而得到组合二进制矩阵B,and will
Figure BDA0002705937450000092
Binary sequences {BS i1 , BS i2 , BS i3 , BS i4 , BS i5 , BS i6 , BS i7 , BS i8 } are combined, where
Figure BDA0002705937450000093
Thus, the combined binary matrix B is obtained,

Figure BDA0002705937450000094
Figure BDA0002705937450000094

同时将L+p+1个二进制序列{BP1i1,BP1i2,BP1i3,BP1i4,BP1i5,BP1i6,BP1i7,BP1i8}进行组合,其中i=1,2,...,L+p,L+p+1,从而得到高位组合二进制序列B1={B11,B12,...,B18L+8p+7,B18L+8p+8}={BP11 1,BP11 2,BP113,BP114,BP115,BP116,BP117,BP118,BP121,BP122,...,BP127,BP128,...,BP1i1,BP1i2,...,BP1i7,BP1i8,...,BP1L+p+11,BP1L+p+12,BP1L+p+13,BP1L+p+14,BP1L+p+15,BP1L+p+1 6,BP1L+p+1 7,BP1L+p+18},并将L+p+1个二进制序列{BP2i1,BP2i2,BP2i3,BP2i4,BP2i5,BP2i6,BP2i7,BP2i8}进行组合,其中i=1,2,...,L+p,L+p+1,从而得到低位组合二进制序列B2={B21,B22,...,B28L+8p+7,B28L+8p+8}={BP211,BP212,BP213,BP214,BP215,BP216,BP217,BP218,BP221,BP222,...,BP227,BP228,...,BP2i1,BP2i2,...,BP2i7,BP2i8,...,BP2L+p+11,BP2L+p+12,BP2L+p+13,BP2L+p+14,BP2L+p+15,BP2L+p+16,BP2L+p+17,BP2L+p+18},Simultaneously combine L+p+1 binary sequences {BP1 i1 , BP1 i2 , BP1 i3 , BP1 i4 , BP1 i5 , BP1 i6 , BP1 i7 , BP1 i8 }, where i=1,2,...,L +p,L+p+1, so as to obtain the high-order combined binary sequence B1={B1 1 ,B1 2 ,...,B1 8L+8p+7 ,B1 8L+8p+8 }={BP1 1 1 ,BP1 1 2 ,BP1 13 ,BP1 14 ,BP1 15 ,BP1 16 ,BP1 17 ,BP1 18 ,BP1 21 ,BP1 22 ,...,BP1 27 ,BP1 28 ,...,BP1 i1 ,BP1 i2 ,..., BP1 i7 ,BP1 i8 ,...,BP1 L+p+11 ,BP1 L+p+12 ,BP1 L+p+13 ,BP1 L+p+14 ,BP1 L+p+15 ,BP1 L+p+ 1 6 , BP1 L+p+1 7 , BP1 L+p+18 }, and convert L+p+1 binary sequences {BP2 i1 , BP2 i2 , BP2 i3 , BP2 i4 , BP2 i5 , BP2 i6 , BP2 i7 ,BP2 i8 }, where i=1,2,...,L+p,L+p+1, so as to obtain the low-order combined binary sequence B2={B2 1 ,B2 2 ,...,B2 8L+ 8p+7 ,B2 8L+8p+8 }={BP2 11 ,BP2 12 ,BP2 13 ,BP2 14 ,BP2 15 ,BP2 16 ,BP2 17 ,BP2 18 ,BP2 21 ,BP2 22 ,...,BP2 27 , BP2 28 ,...,BP2 i1 ,BP2 i2 ,...,BP2 i7 ,BP2 i8 ,...,BP2 L+p+11 ,BP2 L+p+12 ,BP2 L+p+13 ,BP2 L +p+14 , BP2 L+p+15 , BP2 L+p+16 , BP2 L+p+17 , BP2 L+p+18 },

其中垃圾袋身份码包括GB2312字符集中双字节编码的汉字和ASCLL码值∈[32,126]的可见字符,垃圾袋身份码长度为k+L+p+n+6,数值序列S的长度为

Figure BDA0002705937450000101
数值序列P1、P2的长度为L+p+1,组合二进制矩阵B的大小为
Figure BDA0002705937450000102
组合二进制序列B1、B2的长度为8L+8p+8;Among them, the garbage bag identification code includes the double-byte encoded Chinese characters in the GB2312 character set and the visible characters with ASCLL code value ∈ [32,126]. The length of the garbage bag identification code is k+L+p+n+6, and the length of the numerical sequence S is
Figure BDA0002705937450000101
The length of the numerical sequences P1 and P2 is L+p+1, and the size of the combined binary matrix B is
Figure BDA0002705937450000102
The length of the combined binary sequence B1 and B2 is 8L+8p+8;

(2)某批垃圾袋的身份隐藏码统一加密(2) The identity hidden codes of a certain batch of garbage bags are uniformly encrypted

某批垃圾袋的身份隐藏码统一加密,表示利用身份标识码(M1M2…MkMk+L+p+ 1Mk+L+p+2...Mk+L+p+n-2)对身份隐藏码(Mk+1Mk+2...Mk+LMk+L+1Mk+L+2...Mk+L+p)进行加密,某批垃圾袋需且仅需经历一次身份隐藏码统一加密运算,The identity hidden code of a certain batch of garbage bags is uniformly encrypted, which means that the identity code (M 1 M 2 ... M k M k+L+p+ 1 M k+L+p+2 ... M k+L+p+n -2 ) Encrypt the identity hidden code (M k+1 M k+2 ... M k+L M k+L+1 M k+L+2 ... M k+L+p ), a batch of The garbage bag needs and only needs to undergo a unified encryption operation of the identity hidden code.

首先,利用数值序列S及其转换成的二进制矩阵B,数值序列P1、P2转换成的二进制序列B1、B2,以及外部密钥α和β,按照如下所示公式分别计算得到Logistic混沌映射的初值x1和参数μ、抽取开始位置m,以及抽取间隔数n1、n2First, using the numerical sequence S and the binary matrix B converted into it, the binary sequences B1 and B2 converted from the numerical sequences P1 and P2, and the external keys α and β, respectively, according to the following formulas, the initial calculation of the Logistic chaotic mapping is obtained. the value x 1 and the parameter μ, the decimation start position m, and the decimation interval numbers n 1 , n 2 ,

Figure BDA0002705937450000103
make
Figure BDA0002705937450000103

Figure BDA0002705937450000104
Figure BDA0002705937450000104

Figure BDA0002705937450000105
Figure BDA0002705937450000105
but

x1=α+mod(α+kp,1-α),x 1 =α+mod(α+kp,1-α),

μ=β+mod(β+1.5×kp,4-β),μ=β+mod(β+1.5×kp,4-β),

Figure BDA0002705937450000106
Figure BDA0002705937450000106

Figure BDA0002705937450000107
Figure BDA0002705937450000107

Figure BDA0002705937450000108
Figure BDA0002705937450000108

其中,〈B1,i,B2,i,B3,i,B4,i,B5,i,B6,i,B7,i,B8,i〉表示二进制矩阵B第i列或者二进制序列{BSi1,BSi2,BSi3,BSi4,BSi5,BSi6,BSi7,BSi8}中二进制位‘1’的个数,<B11,B12,...,B18L+8p+7,B18L+8p+8表示二进制序列{B11,B12,...,B18L+8p+7,B18L+8p+8}中二进制位‘1’的个数,<B21,B22,...,B28L+8p+7,B28L+8p+8>表示二进制序列{B21,B22,...,B28L+8p+7,B28L+8p+8}中二进制位‘1’的个数,外部密钥满足α∈(0,1)、β∈(3.57,4),Among them, <B 1,i ,B 2,i ,B 3,i ,B 4,i ,B 5,i ,B 6,i ,B 7,i ,B 8,i >represents the i-th column of binary matrix B Or the number of binary bits '1' in the binary sequence {BS i1 , BS i2 , BS i3 , BS i4 , BS i5 , BS i6 , BS i7 , BS i8 }, <B1 1 , B1 2 ,...,B1 8L+8p+7 ,B1 8L+8p+8 represents the number of binary bits '1' in the binary sequence {B1 1 ,B1 2 ,...,B1 8L+8p+7 ,B1 8L+8p+8 }, <B2 1 ,B2 2 ,...,B2 8L+8p+7 ,B2 8L+8p+8 >represents the binary sequence {B2 1 ,B2 2 ,...,B2 8L+8p+7 ,B2 8L+8p The number of binary bits '1' in +8 }, the external key satisfies α∈(0,1), β∈(3.57,4),

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

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

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

Figure BDA0002705937450000111
同时从序列X中第m个元素开始依次间隔n2个元素取1个元素以形成长度为8L+8p+8的混沌信号序列Z={Z1,Z2,...,Z8L+8p+7,Z8L+8p+8},The chaotic signal sequence X={x 1 , x 2 ,...} is obtained, and starting from the mth element in the sequence X, one element is taken at intervals of n 1 elements to form a chaotic signal sequence with a length of 8L+8p+8
Figure BDA0002705937450000111
At the same time, starting from the mth element in the sequence X, 1 element is taken at intervals of n 2 elements to form a chaotic signal sequence with a length of 8L+8p+8 Z={Z 1 , Z 2 ,...,Z 8L+8p +7 ,Z 8L+8p+8 },

然后,将混沌信号序列Y按降序排序,根据混沌信号序列Y排序前、后的位置变化置乱规则,对高位组合二进制序列B1进行置乱,得到置乱后高位二进制序列

Figure BDA0002705937450000112
同时将混沌信号序列Z按降序排序,根据混沌信号序列Z排序前、后的位置变化置乱规则,对低位组合二进制序列B2进行置乱,得到置乱后低位二进制序列
Figure BDA0002705937450000113
Then, sort the chaotic signal sequence Y in descending order, and scramble the high-order combined binary sequence B1 according to the scrambling rules of the position change before and after the chaotic signal sequence Y is sorted to obtain the scrambled high-order binary sequence
Figure BDA0002705937450000112
At the same time, sort the chaotic signal sequence Z in descending order, and scrambling the low-order combined binary sequence B2 according to the scrambling rules of the position change before and after the chaotic signal sequence Z is sorted to obtain the scrambled low-order binary sequence
Figure BDA0002705937450000113

接着,令LB=mod(6-mod(8L+8p+8,6),6),将置乱后高位二进制序列

Figure BDA0002705937450000114
的末尾添加LB个二进制位‘0’,将置乱后低位二进制序列
Figure BDA0002705937450000115
的末尾添加LB个二进制位‘1’,得到二进制序列
Figure BDA0002705937450000116
Figure BDA0002705937450000117
和二进制序列
Figure BDA0002705937450000118
Figure BDA0002705937450000119
其中
Figure BDA00027059374500001110
Next, let LB=mod(6-mod(8L+8p+8,6),6), the scrambled high-order binary sequence
Figure BDA0002705937450000114
Add LB binary bits '0' at the end, which will scramble the low-order binary sequence
Figure BDA0002705937450000115
Add LB binary bits '1' at the end to get the binary sequence
Figure BDA0002705937450000116
Figure BDA0002705937450000117
and binary sequence
Figure BDA0002705937450000118
Figure BDA0002705937450000119
in
Figure BDA00027059374500001110

对二进制序列

Figure BDA00027059374500001111
Figure BDA00027059374500001112
分别进行分组,将二进制序列
Figure BDA00027059374500001113
中元素从头到尾依次正向以6个元素为单位进行分组,得到分组后的二进制序列,表示为
Figure BDA00027059374500001114
同时将二进制序列
Figure BDA00027059374500001115
中元素从头到尾依次正向以6个元素为单位进行分组,得到分组后的二进制序列,表示为
Figure BDA00027059374500001116
其中每一个二进制分组序列均包含6个二进制位,且
Figure BDA00027059374500001117
pair binary sequence
Figure BDA00027059374500001111
and
Figure BDA00027059374500001112
grouped separately, the binary sequence
Figure BDA00027059374500001113
The elements in the middle are grouped forward in units of 6 elements from the beginning to the end, and the binary sequence after the grouping is obtained, which is expressed as
Figure BDA00027059374500001114
Simultaneously convert the binary sequence
Figure BDA00027059374500001115
The elements in the middle are grouped forward in units of 6 elements from the beginning to the end, and the binary sequence after the grouping is obtained, which is expressed as
Figure BDA00027059374500001116
where each binary block sequence contains 6 binary bits, and
Figure BDA00027059374500001117

最后,将每一个二进制分组序列BF1{i}、BF2{i},依次进行如下扩散操作:Finally, each binary grouping sequence BF1{i}, BF2{i} is subjected to the following diffusion operations in turn:

S0:令i=1,且S0: let i=1, and

k1_switch=mod(3×<B11,B12,...,B18L+8p+7,B18L+8p+8>+2×(8L+8p+8-<B11,B12,...,B18L+8p+7,B18L+8p+8>),8),k1_switch=mod(3×<B1 1 ,B1 2 ,...,B1 8L+8p+7 ,B1 8L+8p+8 >+2×(8L+8p+8-<B1 1 ,B1 2 ,.. .,B1 8L+8p+7 ,B1 8L+8p+8 >),8),

k2_switch=mod(3×<B21,B22,...,B28L+8p+7,B28L+8p+8>-2×(8L+8p+8-<B21,B22,...,B28L+8p+7,B28L+8p+8>),25),k2_switch=mod(3×<B2 1 ,B2 2 ,...,B2 8L+8p+7 ,B2 8L+8p+8 >-2×(8L+8p+8-<B2 1 ,B2 2 ,.. .,B2 8L+8p+7 ,B2 8L+8p+8 >),25),

S1:将二进制分组序列BF1{i}、BF2{i},按如下所示公式进行计算,S1: Calculate the binary grouping sequence BF1{i}, BF2{i} according to the following formula,

CP1i=bin2dec(BF1{i})+176+k1_switch,CP1 i =bin2dec(BF1{i})+176+k1_switch,

CP2i=bin2dec(BF2{i})+161+k2_switch,CP2 i =bin2dec(BF2{i})+161+k2_switch,

S2:利用二进制分组序列BF1{i}计算而得的数值型数据CP1i,以及二进制分组序列BF2{i}计算而得的数值型数据CP2i,计算k1_switch=mod(CP1i+2×CP2i+3×k1_switch,8)、k2_switch=mod(CP2i+2×CP1i+3×k2_switch,25),且令i=i+1,接着判断i的大小,如果

Figure BDA0002705937450000121
则转入步骤S1,否则转入步骤S3,S2: The numerical data CP1 i calculated by using the binary block sequence BF1{i}, and the numerical data CP2 i calculated by the binary block sequence BF2{i}, calculate k1_switch=mod(CP1 i +2×CP2 i +3×k1_switch,8), k2_switch=mod(CP2 i +2×CP1 i +3×k2_switch,25), and let i=i+1, then judge the size of i, if
Figure BDA0002705937450000121
Then go to step S1, otherwise go to step S3,

S3:结束二进制分组序列的扩散操作,从而得到扩散后的数值序列CP1和CP2,即某批垃圾袋的身份隐藏码的加密信息,表示为

Figure BDA0002705937450000122
S3: End the diffusion operation of the binary packet sequence, so as to obtain the diffused numerical sequences CP1 and CP2, that is, the encrypted information of the identity hidden code of a certain batch of garbage bags, expressed as
Figure BDA0002705937450000122

(3)某批垃圾袋的垃圾分类号批量生成(3) Batch generation of garbage classification numbers for a certain batch of garbage bags

根据该批垃圾袋中单件垃圾袋的批量身份码(各个垃圾分类码制码日期、垃圾类别、垃圾分类序号信息)的不同,分别执行单个垃圾分类号生成步骤,即可实现该批垃圾袋的垃圾分类号批量生成,其中单件垃圾袋的垃圾分类号生成步骤描述如下,According to the difference in the batch identity code (code date of each garbage classification code, garbage category, garbage classification serial number information) of a single garbage bag in the batch of garbage bags, the steps of generating a single garbage classification number are performed respectively, and the batch of garbage bags can be realized. The garbage classification numbers are generated in batches, and the steps for generating the garbage classification numbers for a single garbage bag are described as follows:

首先,从垃圾袋身份码中抽取出垃圾分类码的制码日期(Mk+L+p+n-1Mk+L+p+n)、垃圾类别(Mk+L+p+n+1Mk+L+p+n+2)、垃圾分类序号信息(Mk+L+p+n+3Mk+L+p+n+4),将制码日期逐个字符利用bin2dec()函数转换成数值型数据,得到数值序列R={R1,R2},将垃圾分类序号信息逐个字符利用bin2dec()函数转换成数值型数据,得到数值序列F={F1,F2},First, extract the code date of the garbage classification code (M k+L+p+n-1 M k+L+p+n ), the garbage category (M k+L+p+n+ 1 M k+L+p+n+2 ), garbage classification serial number information (M k+L+p+n+3 M k+L+p+n+4 ), use bin2dec() to make code date character by character The function is converted into numerical data, and the numerical sequence R={R 1 , R 2 } is obtained, and the garbage classification serial number information is converted into numerical data character by character using the bin2dec() function to obtain the numerical sequence F={F 1 , F 2 } ,

然后,按照如下所示公式分别计算得到Logistic混沌映射的初值

Figure BDA0002705937450000123
和参数
Figure BDA0002705937450000124
Then, according to the following formulas, the initial values of the Logistic chaotic map are calculated respectively.
Figure BDA0002705937450000123
and parameters
Figure BDA0002705937450000124

Figure BDA0002705937450000125
则make
Figure BDA0002705937450000125
but

Figure BDA0002705937450000126
Figure BDA0002705937450000126

Figure BDA0002705937450000127
Figure BDA0002705937450000127

由混沌映射的初值

Figure BDA0002705937450000128
和外部密钥
Figure BDA0002705937450000129
对如下公式所示Logistic混沌映射进行迭代,式中k表示迭代次数(k=1,2,...)、
Figure BDA00027059374500001210
表示第k次迭代得到的混沌信号,Initial value mapped by chaos
Figure BDA0002705937450000128
and external key
Figure BDA0002705937450000129
Iterate the Logistic chaotic map shown in the following formula, where k represents the number of iterations (k=1, 2,...),
Figure BDA00027059374500001210
represents the chaotic signal obtained at the kth iteration,

Figure BDA00027059374500001211
Figure BDA00027059374500001211

得到混沌信号序列

Figure BDA00027059374500001212
从序列
Figure BDA00027059374500001213
中第m个元素开始依次间隔n1个元素取1个元素以形成长度为
Figure BDA00027059374500001214
的混沌信号序列
Figure BDA00027059374500001215
同时从序列
Figure BDA00027059374500001216
中第m个元素开始依次间隔n2个元素取1个元素以形成长度为
Figure BDA00027059374500001217
的混沌信号序列
Figure BDA00027059374500001218
get chaotic signal sequence
Figure BDA00027059374500001212
from the sequence
Figure BDA00027059374500001213
The mth element in the middle starts to take 1 element at an interval of n 1 elements to form a length of
Figure BDA00027059374500001214
chaotic signal sequence of
Figure BDA00027059374500001215
Simultaneously from the sequence
Figure BDA00027059374500001216
The mth element in the middle starts to take 1 element at an interval of n 2 elements to form a length of
Figure BDA00027059374500001217
chaotic signal sequence of
Figure BDA00027059374500001218

接着,根据垃圾类别(Mk+L+p+n+1Mk+L+p+n+2)对某批垃圾袋的身份隐藏码加密信息,数值序列CP1、CP2采取如下操作,Next, according to the garbage category (M k+L+p+n+1 M k+L+p+n+2 ), the identity hidden code encryption information of a certain batch of garbage bags is performed, and the numerical sequences CP1 and CP2 take the following operations:

如果Mk+L+p+n+1Mk+L+p+n+2=“01”,则将混沌信号序列

Figure BDA00027059374500001219
按升序排序,根据混沌信号序列
Figure BDA00027059374500001220
排序前、后的位置变化置乱规则,对数值序列CP1进行置乱,得到置乱后的数值序列
Figure BDA00027059374500001221
Figure BDA0002705937450000131
同时将混沌信号序列
Figure BDA0002705937450000132
按升序排序,根据混沌信号序列
Figure BDA0002705937450000133
排序前、后的位置变化置乱规则,对低位组合二进制序列CP2进行置乱,得到置乱后的数值序列
Figure BDA0002705937450000134
Figure BDA0002705937450000135
If M k+L+p+n+1 M k+L+p+n+2 ="01", then the chaotic signal sequence
Figure BDA00027059374500001219
Sort in ascending order, according to the chaotic signal sequence
Figure BDA00027059374500001220
The position change scrambling rules before and after sorting, scrambling the numerical sequence CP1, and obtaining the scrambled numerical sequence
Figure BDA00027059374500001221
Figure BDA0002705937450000131
At the same time, the chaotic signal sequence
Figure BDA0002705937450000132
Sort in ascending order, according to the chaotic signal sequence
Figure BDA0002705937450000133
The position change scrambling rules before and after sorting, scrambling the low-order combination binary sequence CP2, and obtaining the scrambled numerical sequence
Figure BDA0002705937450000134
Figure BDA0002705937450000135

如果Mk+L+p+n+1Mk+L+p+n+2=“02”,则将混沌信号序列

Figure BDA0002705937450000136
按升序排序,根据混沌信号序列
Figure BDA0002705937450000137
排序前、后的位置变化置乱规则,对数值序列CP1进行置乱,得到置乱后的数值序列
Figure BDA0002705937450000138
Figure BDA0002705937450000139
同时将混沌信号序列
Figure BDA00027059374500001310
按降序排序,根据混沌信号序列
Figure BDA00027059374500001311
排序前、后的位置变化置乱规则,对低位组合二进制序列CP2进行置乱,得到置乱后的数值序列
Figure BDA00027059374500001312
Figure BDA00027059374500001313
If M k+L+p+n+1 M k+L+p+n+2 = "02", then the chaotic signal sequence
Figure BDA0002705937450000136
Sort in ascending order, according to the chaotic signal sequence
Figure BDA0002705937450000137
The position change scrambling rules before and after sorting, scrambling the numerical sequence CP1, and obtaining the scrambled numerical sequence
Figure BDA0002705937450000138
Figure BDA0002705937450000139
At the same time, the chaotic signal sequence
Figure BDA00027059374500001310
Sort in descending order, according to the chaotic signal sequence
Figure BDA00027059374500001311
The position change scrambling rules before and after sorting, scrambling the low-order combination binary sequence CP2, and obtaining the scrambled numerical sequence
Figure BDA00027059374500001312
Figure BDA00027059374500001313

如果Mk+L+p+n+1Mk+L+p+n+2=“03”,则先将混沌信号序列

Figure BDA00027059374500001314
重组,得重组后的混沌信号序列
Figure BDA00027059374500001315
Figure BDA00027059374500001316
再将混沌信号序列
Figure BDA00027059374500001317
按降序排序,根据混沌信号序列
Figure BDA00027059374500001318
排序前、后的位置变化置乱规则,对数值序列CP1进行置乱,得到置乱后的数值序列
Figure BDA00027059374500001319
Figure BDA00027059374500001320
同时将混沌信号序列
Figure BDA00027059374500001321
按升序排序,根据混沌信号序列
Figure BDA00027059374500001322
排序前、后的位置变化置乱规则,对低位组合二进制序列CP2进行置乱,得到置乱后的数值序列
Figure BDA00027059374500001323
Figure BDA00027059374500001324
If M k+L+p+n+1 M k+L+p+n+2 = "03", then the chaotic signal sequence
Figure BDA00027059374500001314
Recombination, get the reorganized chaotic signal sequence
Figure BDA00027059374500001315
Figure BDA00027059374500001316
Then the chaotic signal sequence
Figure BDA00027059374500001317
Sort in descending order, according to the chaotic signal sequence
Figure BDA00027059374500001318
The position change scrambling rules before and after sorting, scrambling the numerical sequence CP1, and obtaining the scrambled numerical sequence
Figure BDA00027059374500001319
Figure BDA00027059374500001320
At the same time, the chaotic signal sequence
Figure BDA00027059374500001321
Sort in ascending order, according to the chaotic signal sequence
Figure BDA00027059374500001322
The position change scrambling rules before and after sorting, scrambling the low-order combination binary sequence CP2, and obtaining the scrambled numerical sequence
Figure BDA00027059374500001323
Figure BDA00027059374500001324

如果Mk+L+p+n+1Mk+L+p+n+2=“04”,则先将混沌信号序列

Figure BDA00027059374500001325
重组,得重组后的混沌信号序列
Figure BDA00027059374500001326
Figure BDA00027059374500001327
再将混沌信号序列
Figure BDA00027059374500001328
按降序排序,根据混沌信号序列
Figure BDA00027059374500001329
排序前、后的位置变化置乱规则,对数值序列CP1进行置乱,得到置乱后的数值序列
Figure BDA00027059374500001330
Figure BDA00027059374500001331
同时先将混沌信号序列
Figure BDA00027059374500001332
重组,得重组后的混沌信号序列
Figure BDA00027059374500001333
Figure BDA00027059374500001334
再将混沌信号序列
Figure BDA00027059374500001335
按降序排序,根据混沌信号序列
Figure BDA00027059374500001336
排序前、后的位置变化置乱规则,对低位组合二进制序列CP2进行置乱,得到置乱后的数值序列
Figure BDA00027059374500001337
Figure BDA00027059374500001338
If M k+L+p+n+1 M k+L+p+n+2 = "04", then the chaotic signal sequence
Figure BDA00027059374500001325
Recombination, get the reorganized chaotic signal sequence
Figure BDA00027059374500001326
Figure BDA00027059374500001327
Then the chaotic signal sequence
Figure BDA00027059374500001328
Sort in descending order, according to the chaotic signal sequence
Figure BDA00027059374500001329
The position change scrambling rules before and after sorting, scrambling the numerical sequence CP1, and obtaining the scrambled numerical sequence
Figure BDA00027059374500001330
Figure BDA00027059374500001331
At the same time, the chaotic signal sequence is first
Figure BDA00027059374500001332
Recombination, get the reorganized chaotic signal sequence
Figure BDA00027059374500001333
Figure BDA00027059374500001334
Then the chaotic signal sequence
Figure BDA00027059374500001335
Sort in descending order, according to the chaotic signal sequence
Figure BDA00027059374500001336
The position change scrambling rules before and after sorting, scrambling the low-order combination binary sequence CP2, and obtaining the scrambled numerical sequence
Figure BDA00027059374500001337
Figure BDA00027059374500001338

其中,

Figure BDA00027059374500001339
运算表示得到一个不大于
Figure BDA00027059374500001340
的整数,in,
Figure BDA00027059374500001339
operation means to obtain a value not greater than
Figure BDA00027059374500001340
the integer,

最后,将数值序列

Figure BDA00027059374500001341
先逐个元素组合[CP1i,CP2i],然后再转换为汉字字符,即Ci=native2unicode([CP1i,CP2i]),得到汉字序列
Figure BDA00027059374500001342
即为垃圾分类号,其中汉字序列C的长度为
Figure BDA00027059374500001343
Finally, the numerical sequence
Figure BDA00027059374500001341
First combine [CP1 i , CP2 i ] element by element, and then convert them into Chinese characters, that is, C i =native2unicode([CP1 i ,CP2 i ]), get the Chinese character sequence
Figure BDA00027059374500001342
is the garbage classification number, where the length of the Chinese character sequence C is
Figure BDA00027059374500001343

根据该批垃圾袋中单个垃圾分类号生成过程,依次进行该批垃圾袋的各个垃圾分类号的生成;According to the generation process of a single garbage classification number in the batch of garbage bags, the generation of each garbage classification number of the batch of garbage bags is performed in sequence;

(4)某批垃圾袋的垃圾分类码组合与垃圾分类二维码生成(4) Combination of garbage classification codes for a certain batch of garbage bags and generation of garbage classification QR codes

将垃圾袋身份标识码(M1M2...MkMk+L+p+1Mk+L+p+2...Mk+L+p+n-2)、制码日期(Mk+L+p+n- 1Mk+L+p+n)、垃圾分类号

Figure BDA0002705937450000141
垃圾类别(Mk+L+p+n+1Mk+L+p+n+2)、垃圾分类序号信息(Mk+L+p+n+3Mk+L+p+n+4)采用插入连接的组合方式,生成该批垃圾袋中单个垃圾分类码,表示为
Figure BDA0002705937450000142
其中M1M2...Mk
Figure BDA0002705937450000143
Mk+L+p+1Mk+L+p+2...Mk+L+p+n-2Mk+L+p+n-1Mk+L+p+n、Mk+L+p+n+1Mk+L+p+n+2与Mk+L+p+n+3Mk+L+p+n+4之间相互用英文空格间隔,生成该批垃圾袋中单个垃圾分类码,接着生成QR Code,即垃圾分类二维码,按此规则可批量组合生成该批垃圾袋的垃圾分类二维码。Put the garbage bag identification code (M 1 M 2 ... M k M k+L+p+1 M k+L+p+2 ... M k+L+p+n-2 ), the date of making the code (M k+L+p+n- 1 M k+L+p+n ), garbage classification number
Figure BDA0002705937450000141
Garbage category (M k+L+p+n+1 M k+L+p+n+2 ), garbage classification serial number information (M k+L+p+n+3 M k+L+p+n+4 ) adopts the combination of inserting and connecting to generate a single garbage classification code in the batch of garbage bags, which is expressed as
Figure BDA0002705937450000142
where M 1 M 2 ... M k ,
Figure BDA0002705937450000143
M k+L+p+1 M k+L+p+2 ...M k+L+p+n-2 M k+L+p+n-1 M k+L+p+n , M k +L+p+n+1 M k+L+p+n+2 and M k+L+p+n+3 M k+L+p+n+4 are separated by English spaces to generate the batch A single garbage classification code in the garbage bag, and then generate a QR Code, that is, a garbage classification two-dimensional code. According to this rule, the garbage classification two-dimensional code of the batch of garbage bags can be generated in batches.

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

实施例1Example 1

按照上述一种垃圾分类二维码批量生成方法,步骤如下:According to the above-mentioned method for batch generation of QR codes for garbage classification, the steps are as follows:

(1)编码、转码(1) Encoding and transcoding

将某批垃圾袋的身份信息进行编码,包括某批垃圾袋的统一身份码、单件垃圾袋的批量身份码两部分,生成某批单件垃圾袋唯一的中英文字符型垃圾袋身份码为“江苏省-南通市-海门区中南世纪城-12#1201李晓强15005709999 2020-08-02 01 03”,长度为k+L+p+n+9=11+13+14+10+9=57,其中“江苏省-南通市-崇川区”为省市区,“中南世纪城-12#1201”为具体居住地址(如小区-门牌),“李晓强15005709999”为联系人和联系电话,“2020-08-02”为制码时间,“01”为垃圾分类颜色信息(如绿色的可回收垃圾),“03”为垃圾分类序号信息,相应地,某批垃圾袋的统一身份码为“江苏省-南通市-海门区中南世纪城-12#1201李晓强15005709999 2020-08-”,单件垃圾袋的批量身份码为“02 01 03”,Encode the identity information of a batch of garbage bags, including the unified identity code of a batch of garbage bags and the batch identity code of a single garbage bag, and generate the unique Chinese and English character garbage bag identity code of a single garbage bag of a batch of garbage bags: "Jiangsu Province-Nantong City-Haimen District Zhongnan Century City-12#1201 Li Xiaoqiang 15005709999 2020-08-02 01 03", the length is k+L+p+n+9=11+13+14+10+9=57 , among which "Jiangsu Province-Nantong City-Chongchuan District" is the provincial and urban area, "Central South Century City-12#1201" is the specific residential address (such as the community-house number), "Li Xiaoqiang 15005709999" is the contact person and telephone number, " 2020-08-02" is the code production time, "01" is the color information of garbage classification (such as green recyclable garbage), and "03" is the information of the garbage classification serial number. Correspondingly, the unified identity code of a batch of garbage bags is " Jiangsu Province - Nantong City - Zhongnan Century City, Haimen District - 12#1201 Li Xiaoqiang 15005709999 2020-08-", the batch ID code for a single garbage bag is "02 01 03",

然后,从某批垃圾袋的统一身份码中分别抽取出身份标识码(江苏省-南通市-海门区2020-08-)和身份隐藏码(中南世纪城-12#1201李晓强15005709999),并将身份标识码逐个字符采用unicode2native()函数转换成数值型数据,得到对应的数值序列S={189,173,203,213,202,161,45,196,207,205,168,202,208,45,186,163,195,197,199,248,32,50,48,50,48,45,48,56,45},同时将身份隐藏码逐个字符转换成数值型数据,得到对应的高位数值序列P1={214,196,202,188,179,0,0,0,0,0,0,0,0,0,192,207,199,0,0,0,0,0,0,0,0,0,0,0}和低位数值序列P2={208,207,192,205,199,45,49,50,35,49,50,48,49,32,238,254,191,49,53,48,48,53,55,48,57,57,57,57},其中数值序列S的长度为

Figure BDA0002705937450000144
数值序列P1、P2的长度为L+p+1=13+14+1=28,Then, extract the identity code (Jiangsu Province-Nantong City-Haimen District 2020-08-) and the identity hidden code (Central South Century City-12#1201 Li Xiaoqiang 15005709999) from the unified identity code of a certain batch of garbage bags, and set the The identification code is converted into numerical data character by character using the unicode2native() function to obtain the corresponding numerical sequence S={189,173,203,213,202,161,45,196,207,205,168,202,208,45,186,163,195,197,199,248,32,50,48,50,5,8,45,48} Convert the identity hidden code character by character into numerical data to obtain the corresponding high-order numerical sequence P1={214,196,202,188,179,0,0,0,0,0,0,0,0,0,192,207,199,0,0,0,0,0 ,0,0,0,0,0,0} and low-order numerical sequence P2={208,207,192,205,199,45,49,50,35,49,50,48,49,32,238,254,191,49,53,48,48,53, 55,48,57,57,57,57}, where the length of the numerical sequence S is
Figure BDA0002705937450000144
The length of the numerical sequences P1 and P2 is L+p+1=13+14+1=28,

最后,依次将数值序列S中元素Si逐个转换成8bits的二进制序列,将数值序列P1中元素P1i逐个转换成8bits的二进制序列,将数值序列P2中元素P2i逐个转换成8bits的二进制序列,Finally, convert the elements S i in the numerical sequence S into a binary sequence of 8 bits one by one, convert the elements P1 i in the numerical sequence P1 into a binary sequence of 8 bits one by one, and convert the elements P2 i in the numerical sequence P2 into a binary sequence of 8 bits one by one ,

并将29个二进制序列{BSi1,BSi2,BSi3,BSi4,BSi5,BSi6,BSi7,BSi8}进行组合,从而得到组合二进制矩阵B,and combine 29 binary sequences {BS i1 , BS i2 , BS i3 , BS i4 , BS i5 , BS i6 , BS i7 , BS i8 } to obtain a combined binary matrix B,

Figure BDA0002705937450000151
Figure BDA0002705937450000151

同时将28个二进制序列{BP1i1,BP1i2,BP1i3,BP1i4,BP1i5,BP1i6,BP1i7,BP1i8}进行组合,从而得到高位组合二进制序列B1={B11,B12,...,B1223,B1224}={1,1,0,1,0,1,1,0,1,1,0,0,0,1,0,0,1,1,0,0,1,0,1,0,1,0,1,1,1,1,0,0,1,0,1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,1,0,0,1,1,1,1,1,1,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},At the same time, 28 binary sequences {BP1 i1 , BP1 i2 , BP1 i3 , BP1 i4 , BP1 i5 , BP1 i6 , BP1 i7 , BP1 i8 } are combined to obtain the high-order combined binary sequence B1={B1 1 ,B1 2 ,. ..,B1 223 ,B1 224 }={1,1,0,1,0,1,1,0,1,1,0,0,0,1,0,0,1,1,0,0 ,1,0,1,0,1,0,1,1,1,1,0,0,1,0,1,1,0,0,1,1,0,0,0,0,0 ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0 ,1,1,0,0,1,1,1,1,1,1,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0 ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ,0,0,0,0},

将28个二进制序列{BP2i1,BP2i2,BP2i3,BP2i4,BP2i5,BP2i6,BP2i7,BP2i8}进行组合,从而得到低位组合二进制序列B2={B21,B22,...,B2223,B2224}={1,1,0,1,0,0,0,0,1,1,0,0,1,1,1,1,1,1,0,0,0,0,0,0,1,1,0,0,1,1,0,1,1,1,0,0,0,1,1,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,0,1,0,0,1,1,0,0,1,0,0,0,1,0,0,0,1,1,0,0,1,1,0,0,0,1,0,0,1,1,0,0,1,0,0,0,1,1,0,0,0,0,0,0,1,1,0,0,0,1,0,0,1,0,0,0,0,0,1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,0,1,0,1,1,1,1,1,1,0,0,1,1,0,0,0,1,0,0,1,1,0,1,0,1,0,0,1,1,0,0,0,0,0,01,1,0,0,0,0,0,0,1,1,0,1,0,1,0,0,1,1,0,1,1,1,0,0,1,1,0,0,0,0,0,0,1,1,1,0,0,1,0,0,1,1,1,0,0,1,0,0,1,1,1,0,0,1,0,0,1,1,1,0,0,1};Combine 28 binary sequences {BP2 i1 , BP2 i2 , BP2 i3 , BP2 i4 , BP2 i5 , BP2 i6 , BP2 i7 , BP2 i8 } to obtain the low-order combined binary sequence B2={B2 1 , B2 2 , .. .,B2 223 ,B2 224 }={1,1,0,1,0,0,0,0,1,1,0,0,1,1,1,1,1,1,0,0, 0,0,0,0,1,1,0,0,1,1,0,1,1,1,0,0,0,1,1,1,0,0,1,0,1, 1,0,1,0,0,1,1,0,0,0,1,0,0,1,1,0,0,1,0,0,0,1,0,0,0, 1,1,0,0,1,1,0,0,0,1,0,0,1,1,0,0,1,0,0,0,1,1,0,0,0, 0,0,0,1,1,0,0,0,1,0,0,1,0,0,0,0,0,1,1,1,0,1,1,1,0, 1,1,1,1,1,1,1,0,1,0,1,1,1,1,1,1,0,0,1,1,0,0,0,1,0, 0,1,1,0,1,0,1,0,0,1,1,0,0,0,0,0,01,1,0,0,0,0,0,0,1, 1,0,1,0,1,0,0,1,1,0,1,1,1,0,0,1,1,0,0,0,0,0,0,1,1, 1,0,0,1,0,0,1,1,1,0,0,1,0,0,1,1,1,0,0,1,0,0,1,1,1, 0,0,1};

(2)某批垃圾袋的身份隐藏码统一加密(2) The identity hidden codes of a certain batch of garbage bags are uniformly encrypted

某批垃圾袋的身份隐藏码统一加密,表示利用身份标识码(江苏省-南通市-海门区2020-08-)对身份隐藏码(中南世纪城-12#1201李晓强15005709999)进行加密,某批垃圾袋需且仅需经历一次身份隐藏码统一加密运算,The identity hidden codes of a certain batch of garbage bags are uniformly encrypted, which means that the identity hidden codes (Central South Century City-12#1201 Li Xiaoqiang 15005709999) are encrypted with the identity code (Jiangsu Province-Nantong City-Haimen District 2020-08-), and a batch of The garbage bag needs and only needs to undergo a unified encryption operation of the identity hidden code.

首先,利用数值序列S及其转换成的二进制矩阵B,数值序列P1、P2转换成的二进制序列B1、B2,以及外部密钥α=0.12345和β=3.75,按照如下所示公式分别计算得到Logistic混沌映射的初值x1和参数μ、抽取开始位置m,以及抽取间隔数n1、n2First, using the numerical sequence S and the binary matrix B converted into it, the binary sequences B1 and B2 converted from the numerical sequences P1 and P2, and the external keys α=0.12345 and β=3.75, Logistic is calculated according to the following formulas respectively. The initial value x 1 of the chaotic map, the parameter μ, the extraction start position m, and the number of extraction intervals n 1 , n 2 ,

Figure BDA0002705937450000152
则make
Figure BDA0002705937450000152
but

x1=0.12345+mod(0.12345+0.527325318380424,1-0.12345)=0.774225318380424,x 1 =0.12345+mod(0.12345+0.527325318380424,1-0.12345)=0.774225318380424,

μ=3.75+mod(3.75+1.5×0.527325318380424,4-3.75)=3.790987977570636,μ=3.75+mod(3.75+1.5×0.527325318380424,4-3.75)=3.790987977570636,

m=987+mod(13295951060,67)=1037,m=987+mod(13295951060,67)=1037,

n1=1+mod(13295951060,57)=18,n 1 =1+mod(13295951060,57)=18,

n2=1+mod(13295951060,47)=36,n 2 =1+mod(13295951060,47)=36,

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

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

得到混沌信号序列X={x1,x2,...},从序列X中第1037个元素开始依次间隔18个元素取1个元素以形成长度为224的混沌信号序列Y={Y1,Y2,...,Y223,Y224},同时从序列X中第1037个元素开始依次间隔36个元素取1个元素以形成长度为224的混沌信号序列Z={Z1,Z2,...,Z223,Z224},The chaotic signal sequence X={x 1 , x 2 ,...} is obtained, starting from the 1037th element in the sequence X and taking 1 element at an interval of 18 elements to form a chaotic signal sequence of length 224 Y={Y 1 ,Y 2 ,...,Y 223 ,Y 224 }, and at the same time, starting from the 1037th element in the sequence X, one element is taken at an interval of 36 elements to form a chaotic signal sequence of length 224 Z={Z 1 ,Z 2 ,...,Z 223 ,Z 224 },

然后,将混沌信号序列Y按降序排序,根据混沌信号序列Y排序前、后的位置变化置乱规则,对高位组合二进制序列B1进行置乱,得到置乱后高位二进制序列

Figure BDA0002705937450000161
0,0,1,1,0,0,0,1,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,0,0,0,0,0,0,0,1,0,0,1,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0},同时将混沌信号序列Z按降序排序,根据混沌信号序列Z排序前、后的位置变化置乱规则,对低位组合二进制序列B2进行置乱,得到置乱后低位二进制序列
Figure BDA0002705937450000163
Figure BDA0002705937450000164
Then, sort the chaotic signal sequence Y in descending order, and scramble the high-order combined binary sequence B1 according to the scrambling rules of the position change before and after the chaotic signal sequence Y is sorted to obtain the scrambled high-order binary sequence
Figure BDA0002705937450000161
0,0,1,1,0,0,0,1,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,0,0,0, 0,0,0,0,1,0,0,1,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0, 1,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,0,1,0, 0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,1, 1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,1,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0} , at the same time sort the chaotic signal sequence Z in descending order, according to the scrambling rules of the position change before and after the sorting of the chaotic signal sequence Z, scramble the low-order combined binary sequence B2, and obtain the scrambled low-order binary sequence
Figure BDA0002705937450000163
Figure BDA0002705937450000164

接着,令LB=mod(6-mod(224,6),6)=4,将置乱后高位二进制序列

Figure BDA0002705937450000165
的末尾添加4个二进制位‘0’,将置乱后低位二进制序列
Figure BDA0002705937450000166
的末尾添加4个二进制位‘1’,得到二进制序列
Figure BDA0002705937450000167
Figure BDA0002705937450000168
Figure BDA0002705937450000169
和二进制序列
Figure BDA00027059374500001610
Figure BDA00027059374500001611
Figure BDA0002705937450000171
Figure BDA0002705937450000172
其中二进制序列
Figure BDA0002705937450000173
的长度为
Figure BDA0002705937450000174
Next, let LB=mod(6-mod(224,6),6)=4, and scramble the high-order binary sequence
Figure BDA0002705937450000165
Add 4 binary bits '0' at the end, which will scramble the low-order binary sequence
Figure BDA0002705937450000166
Add 4 binary bits '1' at the end to get the binary sequence
Figure BDA0002705937450000167
Figure BDA0002705937450000168
Figure BDA0002705937450000169
and binary sequence
Figure BDA00027059374500001610
Figure BDA00027059374500001611
Figure BDA0002705937450000171
Figure BDA0002705937450000172
where binary sequence
Figure BDA0002705937450000173
length is
Figure BDA0002705937450000174

将二进制序列

Figure BDA0002705937450000175
中元素从头到尾依次正向以6个元素为单位进行分组,得到分组后的二进制序列,BF1{1}={1,1,0,0,0,0},BF1{2}={0,0,0,0,0,0},…,BF1{19}={0,1,0,0,0,0},…,BF1{37}={0,0,0,1,0,0},BF1{38}={0,0,0,0,0,0},同时将二进制序列
Figure BDA0002705937450000176
中元素从头到尾依次正向以6个元素为单位进行分组,得到分组后的二进制序列,BF2{1}={0,0,1,0,1,1},BF2{2}={1,0,1,0,0,0},…,BF2{19}={1,1,0,0,0,1},…,BF2{37}={1,0,0,0,1,1},BF2{38}={1,1,1,1,1,1},binary sequence
Figure BDA0002705937450000175
The elements in the middle are grouped in units of 6 elements from the beginning to the end, and the binary sequence after the grouping is obtained, BF1{1}={1,1,0,0,0,0}, BF1{2}={0 ,0,0,0,0,0},…,BF1{19}={0,1,0,0,0,0},…,BF1{37}={0,0,0,1,0 ,0}, BF1{38}={0,0,0,0,0,0}, while converting the binary sequence
Figure BDA0002705937450000176
The elements in the middle are grouped in units of 6 elements from the beginning to the end, and the binary sequence after the grouping is obtained, BF2{1}={0,0,1,0,1,1}, BF2{2}={1 ,0,1,0,0,0},…,BF2{19}={1,1,0,0,0,1},…,BF2{37}={1,0,0,0,1 ,1}, BF2{38}={1,1,1,1,1,1},

最后,将每一个二进制分组序列BF1{i}、BF2{i}依次进行扩散操作,从而得到扩散后的数值序列,即某批垃圾袋的身份隐藏码的加密信息,CP1={227,176,182,184,188,206,180,182,178,182,176,234,178,213,178,177,182,178,194,197,190,181,176,186,217,179,178,178,178,190,184,178,178,182,181,185,184,180}和CP2={194,215,175,195,177,204,241,237,235,200,178,202,220,206,178,202,162,177,230,218,212,166,225,223,192,222,184,193,222,174,228,229,191,189,190,195,212,227};最后,将每一个二进制分组序列BF1{i}、BF2{i}依次进行扩散操作,从而得到扩散后的数值序列,即某批垃圾袋的身份隐藏码的加密信息,CP1={227,176,182,184,188,206,180,182,178,182,176,234,178,213,178,177,182,178,194,197,190,181,176,186,217,179,178,178,178,190,184,178,178,182,181,185,184,180}和CP2 ={194,215,175,195,177,204,241,237,235,200,178,202,220,206,178,202,162,177,230,218,212,166,225,223,192,222,184,193,222,174,228,229,191,189,190,195,212,227};

(3)某批垃圾袋的垃圾分类号批量生成(3) Batch generation of garbage classification numbers for a certain batch of garbage bags

根据该批垃圾袋中单件垃圾袋的批量身份码(各个垃圾分类码制码日期、垃圾类别、垃圾分类序号信息)的不同,分别执行单个垃圾分类号生成步骤,即可实现该批垃圾袋的垃圾分类号批量生成,其中单件垃圾袋的垃圾分类号生成步骤描述如下,According to the difference in the batch identity code (code date of each garbage classification code, garbage category, garbage classification serial number information) of a single garbage bag in the batch of garbage bags, the steps of generating a single garbage classification number are performed respectively, and the batch of garbage bags can be realized. The garbage classification numbers are generated in batches, and the steps for generating the garbage classification numbers for a single garbage bag are described as follows:

首先,从垃圾袋身份码中抽取出垃圾分类码制码日期“02”、垃圾类别“01”、垃圾分类序号信息“03”,将制码日期逐个字符利用bin2dec()函数转换成数值型数据,得到数值序列R={48,50},将垃圾分类序号信息逐个字符利用bin2dec()函数转换成数值型数据,得到数值序列F={48,51},First, extract the garbage classification code date "02", garbage category "01", and garbage classification serial number information "03" from the garbage bag identity code, and convert the code date into numerical data character by character using the bin2dec() function. , obtain the numerical sequence R={48,50}, convert the garbage classification serial number information into numerical data character by character using the bin2dec() function, and obtain the numerical sequence F={48,51},

然后,令

Figure BDA0002705937450000177
则Then, let
Figure BDA0002705937450000177
but

Figure BDA0002705937450000178
Figure BDA0002705937450000178

Figure BDA0002705937450000179
Figure BDA0002705937450000179

由混沌映射的初值

Figure BDA00027059374500001710
和外部密钥
Figure BDA00027059374500001711
对Logistic混沌映射进行迭代,式中k表示迭代次数(k=1,2,...)、
Figure BDA00027059374500001712
表示第k次迭代得到的混沌信号,Initial value mapped by chaos
Figure BDA00027059374500001710
and external key
Figure BDA00027059374500001711
Iterate the Logistic chaotic map, where k represents the number of iterations (k=1, 2,...),
Figure BDA00027059374500001712
represents the chaotic signal obtained at the kth iteration,

Figure BDA00027059374500001713
Figure BDA00027059374500001713

得到混沌信号序列

Figure BDA00027059374500001714
从序列
Figure BDA00027059374500001715
中第1037个元素开始依次间隔18个元素取1个元素以形成长度为38的混沌信号序列
Figure BDA00027059374500001716
同时从序列
Figure BDA00027059374500001717
中第1037个元素开始依次间隔36个元素取1个元素以形成长度为38的混沌信号序列
Figure BDA0002705937450000181
get chaotic signal sequence
Figure BDA00027059374500001714
from the sequence
Figure BDA00027059374500001715
The 1037th element in the middle starts to take 1 element at an interval of 18 elements to form a chaotic signal sequence with a length of 38
Figure BDA00027059374500001716
Simultaneously from the sequence
Figure BDA00027059374500001717
The 1037th element starts to take 1 element at intervals of 36 elements to form a chaotic signal sequence of length 38
Figure BDA0002705937450000181

接着,根据垃圾类别“01”对某批垃圾袋的身份隐藏码加密信息,数值序列CP1、CP2采取如下操作——将混沌信号序列

Figure BDA0002705937450000182
按升序排序,根据混沌信号序列
Figure BDA0002705937450000183
排序前、后的位置变化置乱规则,对数值序列CP1进行置乱,得到置乱后的数值序列
Figure BDA0002705937450000184
Figure BDA0002705937450000185
Figure BDA0002705937450000186
同时将混沌信号序列
Figure BDA0002705937450000187
按升序排序,根据混沌信号序列
Figure BDA0002705937450000188
排序前、后的位置变化置乱规则,对低位组合二进制序列CP2进行置乱,得到置乱后的数值序列
Figure BDA0002705937450000189
Figure BDA00027059374500001810
Then, according to the garbage category "01", the identity hidden code encryption information of a certain batch of garbage bags is performed, and the numerical sequences CP1 and CP2 take the following operations: the chaotic signal sequence
Figure BDA0002705937450000182
Sort in ascending order, according to the chaotic signal sequence
Figure BDA0002705937450000183
The position change scrambling rules before and after sorting, scrambling the numerical sequence CP1, and obtaining the scrambled numerical sequence
Figure BDA0002705937450000184
Figure BDA0002705937450000185
Figure BDA0002705937450000186
At the same time, the chaotic signal sequence
Figure BDA0002705937450000187
Sort in ascending order, according to the chaotic signal sequence
Figure BDA0002705937450000188
The position change scrambling rules before and after sorting, scrambling the low-order combination binary sequence CP2, and obtaining the scrambled numerical sequence
Figure BDA0002705937450000189
Figure BDA00027059374500001810

最后,将数值序列

Figure BDA00027059374500001812
先逐个元素组合再转换为汉字字符,得到汉字序列,即垃圾分类号为“静佘脖翠裁步案淀玖袄脖彩辎孤闶府舵搞晨疮嫁拨尾哆涸呸卞岗短霸柴册等码睹蹲站参”,Finally, the numerical sequence
Figure BDA00027059374500001812
First combine the elements one by one and then convert them into Chinese characters to get the sequence of Chinese characters, that is, the garbage classification number is "Jingshe Neck Cui Cui Step Case Dian Jiu Ao Neck Cai Y Gu Yu Fu Rudder Engaged in Morning Sore Marry Tail Duo Bian Gang Short Ba Chai Book and other codes see squatting and standing.”,

根据该批垃圾袋中单个垃圾分类号生成过程,依次进行该批垃圾袋的各个垃圾分类号的生成;According to the generation process of a single garbage classification number in the batch of garbage bags, the generation of each garbage classification number of the batch of garbage bags is performed in sequence;

(4)某批垃圾袋的垃圾分类码组合与垃圾分类二维码生成(4) Combination of garbage classification codes for a certain batch of garbage bags and generation of garbage classification QR codes

将垃圾袋身份标识码(“江苏省-南通市-海门区2020-08-”)、制码日期(“02”)、垃圾分类号(“静佘脖翠裁步案淀玖袄脖彩辎孤闶府舵搞晨疮嫁拨尾哆涸呸卞岗短霸柴册等码睹蹲站参”)、垃圾类别(“01”)、垃圾分类序号信息(“03”)采用插入连接的组合方式,生成该批垃圾袋中单个垃圾分类码为“江苏省-南通市-海门区静佘脖翠裁步案淀玖袄脖彩辎孤闶府舵搞晨疮嫁拨尾哆涸呸卞岗短霸柴册等码睹蹲站参2020-08-02 01 03”,生成该批垃圾袋中单个垃圾分类码,接着生成QR Code,即垃圾分类二维码,按此规则可批量组合生成该批垃圾袋的垃圾分类二维码。The identification code of the garbage bag ("Jiangsu Province-Nantong City-Haimen District 2020-08-"), the date of making the code ("02"), the garbage classification number ("Jingshe Neck Cui Cui Step Case Dian Jiu Ao Neck Cai Ying") The rudder of Gujiafu is engaged in morning sore, marriage, tail, duo dry, Biangang, short bar, firewood, etc. "), garbage category ("01"), garbage classification serial number information ("03") using a combination of plug-in connections method, the single garbage classification code in the batch of garbage bags is generated as "Jiangsu Province-Nantong City-Haimen District Jingshe Neck Cuisin Step Case Dian Jiu Ao Neck Cai Yi Gu Gu Fu Rui Engage in Morning Sore Marry the Tail Duo Dry Bian Gang" Codes such as Dianba Chai Book and other codes see squatting station refer to 2020-08-02 01 03” to generate a single garbage classification code in the batch of garbage bags, and then generate a QR Code, that is, a two-dimensional code for garbage classification. QR code for garbage classification of batch garbage bags.

实施例2Example 2

按照上述一种垃圾分类二维码批量生成方法,某批单件垃圾袋的垃圾分类二维码生成步骤以及外部密钥、制码日期、垃圾类别、垃圾分类序号信息与具体实施例1相似,对于垃圾袋身份标识码(“江苏省-南通市-海门区2020-08-”,或者“工苏省-南通市-海门区2020-08-”,或者“江苏省-南通市-海们区2020-08-”,或者“江苏省-南通市-海门区2020-09-”),仅原垃圾袋身份信息中的身份隐藏码(“中南世纪城-12#1201李晓强15005709999”)发生细微变化:“钟南世纪城-12#1201李晓强15005709999”;或“中南世纪城-12#1211李晓强1500570999”;或“中南世纪城-12#1201李晓强15005709998”,某件垃圾袋的垃圾分类二维码生成结果如表1所示。由下表可知,某批单件垃圾袋的身份隐藏码发生细微变化会引起垃圾分类二维码发生很大的变化,由此可见本专利所提一种垃圾分类二维码批量生成方法对垃圾袋身份信息中隐藏部分(即垃圾袋身份隐藏码)具有敏感性。According to the above-mentioned method for generating a batch of two-dimensional codes for garbage classification, the steps for generating a two-dimensional code for garbage classification of a batch of single garbage bags, as well as the external key, code production date, garbage category, and garbage classification serial number information are similar to those in the specific embodiment 1, For garbage bag identification code ("Jiangsu Province - Nantong City - Haimen District 2020-08-", or "Industry Jiangsu Province - Nantong City - Haimen District 2020-08-", or "Jiangsu Province - Nantong City - Haimen District" 2020-08-", or "Jiangsu Province-Nantong City-Haimen District 2020-09-"), only the identity hidden code in the identity information of the original garbage bag ("Central South Century City-12#1201 Li Xiaoqiang 15005709999") changed slightly : "Zhongnan Century City-12#1201 Li Xiaoqiang 15005709999"; or "Central South Century City-12#1211 Li Xiaoqiang 1500570999"; or "Central South Century City-12#1201 Li Xiaoqiang 15005709998", the QR code for garbage classification of a garbage bag The generated results are shown in Table 1. It can be seen from the table below that a slight change in the identity hidden code of a single batch of garbage bags will cause a great change in the QR code for garbage classification. It can be seen that the batch generation method of the QR code for garbage classification proposed in this patent is effective for garbage classification. The hidden part of the bag identity information (that is, the garbage bag identity hidden code) is sensitive.

表1某批单件垃圾袋的身份隐藏码发生微变时,垃圾分类二维码生成结果Table 1 When the identity hidden code of a batch of single garbage bags changes slightly, the generation results of the QR code for garbage classification

Figure BDA0002705937450000191
Figure BDA0002705937450000191

Figure BDA0002705937450000201
Figure BDA0002705937450000201

Figure BDA0002705937450000211
Figure BDA0002705937450000211

Figure BDA0002705937450000221
Figure BDA0002705937450000221

实施例3Example 3

按照上述一种垃圾分类二维码批量生成方法,某批单件垃圾袋的垃圾分类二维码生成步骤以及垃圾袋身份隐藏码、制码日期、垃圾类别、垃圾分类序号信息与具体实施例1相似,对于垃圾袋身份标识码(“江苏省-南通市-海门区2020-08-”,或者“工苏省-南通市-海门区2020-08-”,或者“江苏省-南通市-海们区2020-08-”,或者“江苏省-南通市-海门区2020-09-”),仅外部密钥(α=0.12345、β=3.75)单个发生细微变化:α=0.123450000000001;或β=3.750000000000001,某批单件垃圾袋的垃圾分类二维码生成结果如表2所示。由下表可见:一旦外部密钥发生即使细微变化,即“失之毫厘”,生成的垃圾分类二维码会“差之千里”,由此可见本专利所提一种垃圾分类二维码批量生成方法具有密钥敏感性。According to the above-mentioned method for generating a batch of two-dimensional codes for garbage classification, the steps for generating a two-dimensional code for garbage classification of a batch of single garbage bags, and the information of the identity hidden code of the garbage bags, the date of making the code, the garbage category, the garbage classification serial number, and the specific embodiment 1 Similarly, for the identification code of garbage bags ("Jiangsu Province-Nantong City-Haimen District 2020-08-", or "Industry Jiangsu Province-Nantong City-Haimen District 2020-08-", or "Jiangsu Province-Nantong City-Haimen District 2020-08-" Our District 2020-08-", or "Jiangsu Province-Nantong City-Haimen District 2020-09-"), only the external key (α=0.12345, β=3.75) changes slightly: α=0.123450000000001; or β= 3.750000000000001, the generation results of the garbage classification QR code for a batch of single garbage bags are shown in Table 2. It can be seen from the following table: once the external key changes even slightly, that is, "missing a tiny bit", the generated QR code for garbage classification will be "a thousand miles away". It can be seen that the batch of QR code for garbage classification proposed in this patent is in batches. The generation method is key sensitive.

表2外部密钥发生微变时,垃圾分类二维码的生成结果Table 2 The generation results of the QR code for garbage classification when the external key changes slightly

Figure BDA0002705937450000222
Figure BDA0002705937450000222

Figure BDA0002705937450000231
Figure BDA0002705937450000231

Figure BDA0002705937450000241
Figure BDA0002705937450000241

实施例4Example 4

按照上述一种垃圾分类二维码批量生成方法,某批单件垃圾袋的垃圾分类二维码生成步骤以及垃圾袋身份标识码、垃圾袋身份隐藏码、外部密钥与具体实施例1相似,某批垃圾袋的垃圾分类颜色信息分别为“01”、“02”、“03”、“04”;或者某批垃圾袋的制码日期分别为“02”、“06”、“12”、“16”、“22”、“26”;或者某批垃圾袋的垃圾分类序号信息分别为“01”、“02”、“03”、“04”、“05”、“06”,对应的三批垃圾分类二维码生成结果如表3所示。由下表可知,某批垃圾袋的垃圾分类颜色信息、制码日期、垃圾分类序号信息的依次变化可批量生成某批垃圾袋的垃圾分类二维码,且本专利所提一种垃圾分类二维码批量生成方法对垃圾袋身份信息中垃圾分类颜色信息、制码日期和垃圾分类序号信息均具有敏感性。According to the above-mentioned method for generating a batch of two-dimensional codes for garbage classification, the steps for generating a two-dimensional code for garbage classification of a batch of single garbage bags, as well as the garbage bag identification code, the garbage bag identity hidden code, and the external key are similar to those in the specific embodiment 1, The garbage classification color information of a certain batch of garbage bags is "01", "02", "03", "04"; or the code date of a certain batch of garbage bags is "02", "06", "12", "16", "22", "26"; or the garbage classification serial number information of a certain batch of garbage bags is "01", "02", "03", "04", "05", "06", the corresponding The three batches of garbage classification QR code generation results are shown in Table 3. It can be seen from the table below that the sequential changes of the garbage sorting color information, code production date, and garbage sorting serial number information of a certain batch of garbage bags can generate the garbage sorting QR code of a certain batch of garbage bags in batches. The dimensional code batch generation method is sensitive to the garbage classification color information, code production date and garbage classification serial number information in the garbage bag identity information.

表3垃圾分类二维码的批量生成结果Table 3 Batch generation results of QR codes for garbage classification

Figure BDA0002705937450000242
Figure BDA0002705937450000242

Figure BDA0002705937450000251
Figure BDA0002705937450000251

Figure BDA0002705937450000261
Figure BDA0002705937450000261

Figure BDA0002705937450000271
Figure BDA0002705937450000271

由上述具体实施例1-4分析可知,本专利所提一种垃圾分类码批量生成方法所批量生成的垃圾分类码不仅与外部密钥密切相关,而且依赖于垃圾袋身份信息(某批垃圾袋的统一身份码、单件垃圾袋的批量身份码),因此本专利所提的一种垃圾分类码批量生成方法具有很强的安全性,以保证批量生成的垃圾分类码具有“唯一性、安全性和垃圾分类引导性”。From the analysis of the above-mentioned specific embodiments 1-4, it can be seen that the garbage classification codes generated in batches by the method for batch generation of garbage classification codes proposed in this patent are not only closely related to the external key, but also depend on the identity information of garbage bags (a certain batch of garbage bags). Therefore, the method for batch generation of garbage classification codes proposed in this patent has strong security, so as to ensure that the garbage classification codes generated in batches are “unique, safe and secure”. Sexuality and Waste Sorting Guidance".

以上所述,仅是本发明的较佳实施例而已,并非对本发明作任何形式上的限制,虽然本发明已以较佳实施例揭露如上,然而并非用以限定本发明,任何熟悉本专业的技术人员,在不脱离本发明技术方案范围内,当可利用上述揭示的技术内容作出些许更动或修饰为等同变化的等效实施例,但凡是未脱离本发明技术方案的内容,依据本发明的技术实质对以上实施例所作的任何简单修改、等同变化与修饰,均仍属于本发明技术方案的范围内。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 (8)

1.一种垃圾分类二维码批量生成方法,其特征在于,包括如下几个步骤:1. a method for generating garbage classification two-dimensional codes in batches, is characterized in that, comprises the following steps: (1)编码、转码(1) Encoding and transcoding 首先,将某批垃圾袋的身份信息进行编码,包括某批垃圾袋的统一身份码、单件垃圾袋的批量身份码两部分,从而生成某批单件垃圾袋唯一的中英文字符型垃圾袋身份码,表示为M1M2...MkMk+1Mk+2...Mk+LMk+L+1Mk+L+2...Mk+L+pMk+L+p+1Mk+L+p+2...Mk+L+p+nMk+L+p+n+1Mk+L+p+n+ 2Mk+L+p+n+3Mk+L+p+n+4,其中M1M2...Mk为省市区,Mk+1Mk+2...Mk+L为具体居住地址,Mk+L+1Mk+L+ 2...Mk+L+p为联系人和联系电话,Mk+L+p+1Mk+L+p+2...Mk+L+p+n为制码时间(格式为年-月-日,其中最后两位Mk+L+p+n-1Mk+L+p+n为日期),Mk+L+p+n+1Mk+L+p+n+2为垃圾分类颜色信息(表征垃圾类别),Mk+L+p+n+3Mk+L+p+n+4为垃圾分类序号信息(表征某天某种类别垃圾袋的序号),相互用英文空格间隔,相应某批垃圾袋的统一身份码为M1M2...MkMk+1Mk+2...Mk+LMk+L+1Mk+L+2...Mk+L+pMk+L+p+ 1Mk+L+p+2...Mk+L+p+n-3Mk+L+p+n-2,相应单件垃圾袋的批量身份码为Mk+L+p+n-1Mk+L+p+nMk+L+p+n+ 1Mk+L+p+n+2Mk+L+p+n+3Mk+L+p+n+4First, encode the identity information of a batch of garbage bags, including the unified identity code of a batch of garbage bags and the batch identity code of a single garbage bag, so as to generate a garbage bag with unique Chinese and English characters for a single garbage bag. Identity code, expressed as M 1 M 2 ... M k M k+1 M k+2 ... M k+L M k+L+1 M k+L+2 ... M k+L+p M k+L+p+1 M k+L+p+2 ...M k+L+p+n M k+L+p+n+1 M k+L+p+n+ 2 M k+L +p+n+3 M k+L+p+n+4 , where M 1 M 2 ... M k are provinces and municipalities, and M k+1 M k+2 ... M k+L are specific residences Address, M k+L+1 M k+L+ 2 ... M k+L+p is the contact person and contact number, M k+L+p+1 M k+L+p+2 ... M k +L+p+n is the code time (the format is year-month-day, where the last two digits M k+L+p+n-1 M k+L+p+n is the date), M k+L+ p+n+1 M k+L+p+n+2 is the garbage classification color information (representing the garbage category), M k+L+p+n+3 M k+L+p+n+4 is the garbage classification serial number Information (representing the serial number of a certain type of garbage bags on a certain day), separated by English spaces, and the unified identity code of a corresponding batch of garbage bags is M 1 M 2 ... M k M k+1 M k+2 ... M k+L M k+L+1 M k+L+2 ...M k+L+p M k+L+p+ 1 M k+L+p+2 ...M k+L+p+ n-3 M k+L+p+n-2 , the batch ID code of the corresponding single garbage bag is M k+L+p+n-1 M k+L+p+n M k+L+p+n+ 1 M k+L+p+n+2 M k+L+p+n+3 M k+L+p+n+4 , 然后,从某批垃圾袋的统一身份码中抽取出身份标识码(M1M2...MkMk+L+p+1Mk+L+p+ 2...Mk+L+p+n-2)和身份隐藏码(Mk+1Mk+2...Mk+LMk+L+1Mk+L+2...Mk+L+p),并将身份标识码逐个字符转换成数值型数据,得到对应的数值序列
Figure FDA0002705937440000011
同时将身份隐藏码逐个字符转换成数值型数据[Pi1,Pi2],得到高位数值序列P1={P11,P12,...,P1L+p,P1L+p+1}={P11,P21,...,P(L+p)1,P(L+p+1)1}和低位数值序列P2={P21,P22,...,P2L+p,P2L+p+1}={P12,P22,...,P(L+p)2,P(L+p+1)2},
Then, extract the identity code (M 1 M 2 ... M k M k+L+p+1 M k+L+p+ 2 ... M k+L+ p+n-2 ) and identity concealment codes (M k+1 M k+2 ... M k+L M k+L+1 M k+L+2 ... M k+L+p ), and Convert the identification code into numerical data character by character to obtain the corresponding numerical sequence
Figure FDA0002705937440000011
At the same time, the identity hidden code is converted into numerical data [P i1 ,P i2 ] character by character, and the high-order numerical sequence P1={P1 1 ,P1 2 ,...,P1 L+p ,P1 L+p+1 }= {P 11 ,P 21 ,...,P (L+p)1 ,P (L+p+1)1 } and low-order value sequence P2={P2 1 ,P2 2 ,...,P2 L+p ,P2 L+p+1 }={P 12 ,P 22 ,...,P (L+p)2 ,P (L+p+1)2 },
最后,依次将数值序列S中元素Si逐个转换成8bits的二进制序列{BSi1,BSi2,BSi3,BSi4,BSi5,BSi6,BSi7,BSi8}、将数值序列P1中元素P1i逐个转换成8bits的二进制序列{BP1i1,BP1i2,BP1i3,BP1i4,BP1i5,BP1i6,BP1i7,BP1i8}、将数值序列P2中元素P2i逐个转换成8bits的二进制序列{BP2i1,BP2i2,BP2i3,BP2i4,BP2i5,BP2i6,BP2i7,BP2i8},Finally, convert the elements Si in the numerical sequence S into 8- bit binary sequences {BS i1 , BS i2 , BS i3 , BS i4 , BS i5 , BS i6 , BS i7 , BS i8 } one by one, and convert the elements in the numerical sequence P1 into Convert P1 i into a binary sequence of 8 bits one by one {BP1 i1 , BP1 i2 , BP1 i3 , BP1 i4 , BP1 i5 , BP1 i6 , BP1 i7 , BP1 i8 }, convert the elements P2 i in the numerical sequence P2 into a binary sequence of 8 bits one by one {BP2 i1 , BP2 i2 , BP2 i3 , BP2 i4 , BP2 i5 , BP2 i6 , BP2 i7 , BP2 i8 }, 并将
Figure FDA0002705937440000012
个二进制序列{BSi1,BSi2,BSi3,BSi4,BSi5,BSi6,BSi7,BSi8}进行组合,其中i=1,2,...,
Figure FDA0002705937440000013
从而得到组合二进制矩阵B,
and will
Figure FDA0002705937440000012
binary sequences {BS i1 , BS i2 , BS i3 , BS i4 , BS i5 , BS i6 , BS i7 , BS i8 }, where i=1,2,...,
Figure FDA0002705937440000013
Thus, the combined binary matrix B is obtained,
Figure FDA0002705937440000014
Figure FDA0002705937440000014
同时将L+p+1个二进制序列{BP1i1,BP1i2,BP1i3,BP1i4,BP1i5,BP1i6,BP1i7,BP1i8}进行组合,其中i=1,2,...,L+p,L+p+1,从而得到高位组合二进制序列B1={B11,B12,...,B18L+8p+7,B18L+8p+8}={BP111,BP112,BP113,BP114,BP115,BP116,BP117,BP118,BP121,BP122,...,BP127,BP128,...,BP1i1,BP1i2,...,BP1i7,BP1i8,...,BP1L+p+11,BP1L+p+12,BP1L+p+13,BP1L+p+14,BP1L+p+15,BP1L+p+16,BP1L+p+17,BP1L+p+18},并将L+p+1个二进制序列{BP2i1,BP2i2,BP2i3,BP2i4,BP2i5,BP2i6,BP2i7,BP2i8}进行组合,其中i=1,2,...,L+p,L+p+1,从而得到低位组合二进制序列B2={B21,B22,...,B28L+8p+7,B28L+8p+8}={BP211,BP212,BP213,BP214,BP215,BP216,BP217,BP218,BP221,BP222,...,BP227,BP228,...,BP2i1,BP2i2,...,BP2i7,BP2i8,...,BP2L+p+11,BP2L+p+12,BP2L+p+13,BP2L+p+14,BP2L+p+15,BP2L+p+16,BP2L+p+17,BP2L+p+18},Simultaneously combine L+p+1 binary sequences {BP1 i1 , BP1 i2 , BP1 i3 , BP1 i4 , BP1 i5 , BP1 i6 , BP1 i7 , BP1 i8 }, where i=1,2,...,L +p,L+p+1, so as to obtain the high-order combined binary sequence B1={B1 1 ,B1 2 ,...,B1 8L+8p+7 ,B1 8L+8p+8 }={BP1 11 ,BP1 12 , BP1 13 ,BP1 14 ,BP1 15 ,BP1 16 ,BP1 17 ,BP1 18 ,BP1 21 ,BP1 22 ,...,BP1 27 ,BP1 28 ,...,BP1 i1 ,BP1 i2 ,...,BP1 i7 ,BP1 i8 ,...,BP1 L+p+11 ,BP1 L+p+12 ,BP1 L+p+13 ,BP1 L+p+14 ,BP1 L+p+15 ,BP1 L+p+16 , BP1 L+p+17 , BP1 L+p+18 }, and convert L+p+1 binary sequences {BP2 i1 , BP2 i2 , BP2 i3 , BP2 i4 , BP2 i5 , BP2 i6 , BP2 i7 , BP2 i8 } Combine, where i=1,2,...,L+p,L+p+1, so as to obtain the low-order combined binary sequence B2={B2 1 ,B2 2 ,...,B2 8L+8p+7 , B2 8L+8p+8 }={BP2 11 ,BP2 12 ,BP2 13 ,BP2 14 ,BP2 15 ,BP2 16 ,BP2 17 ,BP2 18 ,BP2 21 ,BP2 22 ,...,BP2 27 ,BP2 28 ,. ..,BP2 i1 ,BP2 i2 ,...,BP2 i7 ,BP2 i8 ,...,BP2 L+p+11 ,BP2 L+p+12 ,BP2 L+p+13 ,BP2 L+p+14 , BP2 L+p+15 , BP2 L+p+16 , BP2 L+p+17 , BP2 L+p+18 }, 其中垃圾袋身份码包括GB2312字符集中双字节编码的汉字和ASCLL码值∈[32,126]的可见字符,垃圾袋身份码长度为k+L+p+n+6,数值序列S的长度为
Figure FDA0002705937440000021
Figure FDA0002705937440000022
数值序列P1、P2的长度为L+p+1,组合二进制矩阵B的大小为
Figure FDA0002705937440000023
组合二进制序列B1、B2的长度为8L+8p+8;
Among them, the garbage bag identification code includes the double-byte encoded Chinese characters in the GB2312 character set and the visible characters with ASCLL code value ∈ [32,126]. The length of the garbage bag identification code is k+L+p+n+6, and the length of the numerical sequence S is
Figure FDA0002705937440000021
Figure FDA0002705937440000022
The length of the numerical sequences P1 and P2 is L+p+1, and the size of the combined binary matrix B is
Figure FDA0002705937440000023
The length of the combined binary sequence B1 and B2 is 8L+8p+8;
(2)某批垃圾袋的身份隐藏码统一加密(2) The identity hidden codes of a certain batch of garbage bags are uniformly encrypted 某批垃圾袋的身份隐藏码统一加密,表示利用身份标识码(M1M2...MkMk+L+p+1Mk+L+p+ 2...Mk+L+p+n-2)对身份隐藏码(Mk+1Mk+2...Mk+LMk+L+1Mk+L+2...Mk+L+p)进行加密,某批垃圾袋需且仅需经历一次身份隐藏码统一加密运算,The identity hidden code of a certain batch of garbage bags is uniformly encrypted, indicating that the identity code (M 1 M 2 ... M k M k+L+p+1 M k+L+p+ 2 ... M k+L+p +n-2 ) encrypts the identity concealment code (M k+1 M k+2 ... M k+L M k+L+1 M k+L+2 ... M k+L+p ), A certain batch of garbage bags needs and only needs to undergo a unified encryption operation of the identity hidden code. 首先,利用数值序列S及其转换成的二进制矩阵B,数值序列P1、P2转换成的二进制序列B1、B2,以及外部密钥α和β,按照如下(1)-(5)公式分别计算得到Logistic混沌映射的初值x1和参数μ、抽取开始位置m,以及抽取间隔数n1、n2First, using the numerical sequence S and the binary matrix B converted into it, the binary sequences B1 and B2 converted from the numerical sequences P1 and P2, and the external keys α and β, they are calculated according to the following formulas (1)-(5) respectively. The initial value x 1 and parameter μ of the Logistic chaotic map, the extraction start position m, and the number of extraction intervals n 1 and n 2 ,
Figure FDA0002705937440000024
make
Figure FDA0002705937440000024
but
x1=α+mod(α+kp,1-α), (1)x 1 =α+mod(α+kp,1-α), (1) μ=β+mod(β+1.5×kp,4-β), (2)μ=β+mod(β+1.5×kp,4-β), (2)
Figure FDA0002705937440000031
Figure FDA0002705937440000031
Figure FDA0002705937440000032
Figure FDA0002705937440000032
Figure FDA0002705937440000033
Figure FDA0002705937440000033
其中,<B1,i,B2,i,B3,i,B4,i,B5,i,B6,i,B7,i,B8,i>表示二进制矩阵B第i列或者二进制序列{BSi1,BSi2,BSi3,BSi4,BSi5,BSi6,BSi7,BSi8}中二进制位‘1’的个数,<B11,B12,...,B18L+8p+7,B18L+8p+8>表示二进制序列{B11,B12,...,B18L+8p+7,B18L+8p+8}中二进制位‘1’的个数,<B21,B22,...,B28L+8p+7,B28L+8p+8>表示二进制序列{B21,B22,...,B28L+8p+7,B28L+8p+8}中二进制位‘1’的个数,外部密钥满足α∈(0,1)、β∈(3.57,4),Among them, <B 1,i ,B 2,i ,B 3,i ,B 4,i ,B 5,i ,B 6,i ,B 7,i ,B 8,i >represents the i-th column of binary matrix B Or the number of binary bits '1' in the binary sequence {BS i1 , BS i2 , BS i3 , BS i4 , BS i5 , BS i6 , BS i7 , BS i8 }, <B1 1 , B1 2 ,...,B1 8L+8p+7 ,B1 8L+8p+8 >represents the number of binary bits '1' in the binary sequence {B1 1 ,B1 2 ,...,B1 8L+8p+7 ,B1 8L+8p+8 } , <B2 1 ,B2 2 ,...,B2 8L+8p+7 ,B2 8L+8p+8 >represents the binary sequence {B2 1 ,B2 2 ,...,B2 8L+8p+7 ,B2 8L+ The number of binary bits '1' in 8p+8 }, the external key satisfies α∈(0,1), β∈(3.57,4), 由混沌映射的初值x1和外部密钥μ,对如下公式(6)所示Logistic混沌映射进行迭代,式中k表示迭代次数(k=1,2,...)、xk+1表示第k次迭代得到的混沌信号,From 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个元素以形成长度为8L+8p+8的混沌信号序列
Figure FDA0002705937440000034
同时从序列X中第m个元素开始依次间隔n2个元素取1个元素以形成长度为8L+8p+8的混沌信号序列Z={Z1,Z2,...,Z8L+8p+7,Z8L+8p+8},
The chaotic signal sequence X={x 1 , x 2 ,...} is obtained, and starting from the mth element in the sequence X, one element is taken at intervals of n 1 elements to form a chaotic signal sequence with a length of 8L+8p+8
Figure FDA0002705937440000034
At the same time, starting from the mth element in the sequence X, 1 element is taken at intervals of n 2 elements to form a chaotic signal sequence with a length of 8L+8p+8 Z={Z 1 , Z 2 ,...,Z 8L+8p +7 ,Z 8L+8p+8 },
然后,将混沌信号序列Y按降序排序,根据混沌信号序列Y排序前、后的位置变化置乱规则,对高位组合二进制序列B1进行置乱,得到置乱后高位二进制序列
Figure FDA0002705937440000035
同时将混沌信号序列Z按降序排序,根据混沌信号序列Z排序前、后的位置变化置乱规则,对低位组合二进制序列B2进行置乱,得到置乱后低位二进制序列
Figure FDA0002705937440000036
Then, sort the chaotic signal sequence Y in descending order, and scramble the high-order combined binary sequence B1 according to the scrambling rules of the position change before and after the chaotic signal sequence Y is sorted to obtain the scrambled high-order binary sequence
Figure FDA0002705937440000035
At the same time, sort the chaotic signal sequence Z in descending order, and scrambling the low-order combined binary sequence B2 according to the scrambling rules of the position change before and after the chaotic signal sequence Z is sorted to obtain the scrambled low-order binary sequence
Figure FDA0002705937440000036
接着,令LB=mod(6-mod(8L+8p+8,6),6),将置乱后高位二进制序列
Figure FDA0002705937440000037
的末尾添加LB个二进制位‘0’,将置乱后低位二进制序列
Figure FDA0002705937440000038
的末尾添加LB个二进制位‘1’,得到二进制序列
Figure FDA0002705937440000039
Figure FDA00027059374400000310
和二进制序列
Figure FDA00027059374400000311
Figure FDA00027059374400000312
其中
Figure FDA00027059374400000313
Next, let LB=mod(6-mod(8L+8p+8,6),6), the scrambled high-order binary sequence
Figure FDA0002705937440000037
Add LB binary bits '0' at the end, which will scramble the low-order binary sequence
Figure FDA0002705937440000038
Add LB binary bits '1' at the end to get the binary sequence
Figure FDA0002705937440000039
Figure FDA00027059374400000310
and binary sequence
Figure FDA00027059374400000311
Figure FDA00027059374400000312
in
Figure FDA00027059374400000313
对二进制序列
Figure FDA00027059374400000314
Figure FDA00027059374400000315
分别进行分组,将二进制序列
Figure FDA00027059374400000316
中元素从头到尾依次正向以6个元素为单位进行分组,得到分组后的二进制序列,表示为BF1{1},BF1{2},...,BF1{i},...
Figure FDA00027059374400000317
同时将二进制序列
Figure FDA00027059374400000318
中元素从头到尾依次正向以6个元素为单位进行分组,得到分组后的二进制序列,表示为BF2{1},BF2{2},...,BF2{i},...
Figure FDA00027059374400000319
其中每一个二进制分组序列均包含6个二进制位,且
Figure FDA00027059374400000320
pair binary sequence
Figure FDA00027059374400000314
and
Figure FDA00027059374400000315
grouped separately, the binary sequence
Figure FDA00027059374400000316
The elements in the middle are grouped forward in units of 6 elements from the beginning to the end, and the binary sequence after the grouping is obtained, which is expressed as BF1{1},BF1{2},...,BF1{i},...
Figure FDA00027059374400000317
Simultaneously convert the binary sequence
Figure FDA00027059374400000318
The elements in the middle are sequentially grouped in units of 6 elements from the beginning to the end, and the binary sequence after grouping is obtained, which is expressed as BF2{1},BF2{2},...,BF2{i},...
Figure FDA00027059374400000319
where each binary block sequence contains 6 binary bits, and
Figure FDA00027059374400000320
最后,将每一个二进制分组序列BF1{i}、BF2{i},依次进行如下扩散操作:Finally, each binary grouping sequence BF1{i}, BF2{i} is subjected to the following diffusion operations in turn: S0:令i=1,且S0: let i=1, and k1_switch=mod(3×<B11,B12,...,B18L+8p+7,B18L+8p+8>+2×(8L+8p+8-〈B11,B12,...,B18L+8p+7,B18L+8p+8>),8),k1_switch=mod(3×<B1 1 ,B1 2 ,...,B1 8L+8p+7 ,B1 8L+8p+8 >+2×(8L+8p+8-<B1 1 ,B1 2 ,.. .,B1 8L+8p+7 ,B1 8L+8p+8 >),8), k2_switch=mod(3×〈B21,B22,...,B28L+8p+7,B28L+8p+8>-2×(8L+8p+8-<B21,B22,...,B28L+8p+7,B28L+8p+8>),25),k2_switch=mod(3×<B2 1 ,B2 2 ,...,B2 8L+8p+7 ,B2 8L+8p+8 >-2×(8L+8p+8-<B2 1 ,B2 2 ,.. .,B2 8L+8p+7 ,B2 8L+8p+8 >),25), S1:将二进制分组序列BF1{i}、BF2{i},按如下公式(7)、(8)进行计算,S1: Calculate the binary grouping sequences BF1{i} and BF2{i} according to the following formulas (7) and (8), CP1i=bin2dec(BF1{i})+176+k1_switch, (7)CP1 i =bin2dec(BF1{i})+176+k1_switch, (7) CP2i=bin2dec(BF2{i})+161+k2_switch, (8)CP2 i =bin2dec(BF2{i})+161+k2_switch, (8) S2:利用二进制分组序列BF1{i}计算而得的数值型数据CP1i,以及二进制分组序列BF2{i}计算而得的数值型数据CP2i,计算k1_switch=mod(CP1i+2×CP2i+3×k1_switch,8)、k2_switch=mod(CP2i+2×CP1i+3×k2_switch,25),且令i=i+1,接着判断i的大小,如果
Figure FDA0002705937440000041
则转入步骤S1,否则转入步骤S3,
S2: The numerical data CP1 i calculated by using the binary block sequence BF1{i}, and the numerical data CP2 i calculated by the binary block sequence BF2{i}, calculate k1_switch=mod(CP1 i +2×CP2 i +3×k1_switch,8), k2_switch=mod(CP2 i +2×CP1 i +3×k2_switch,25), and let i=i+1, then judge the size of i, if
Figure FDA0002705937440000041
Then go to step S1, otherwise go to step S3,
S3:结束二进制分组序列的扩散操作,从而得到扩散后的数值序列CP1和CP2,即某批垃圾袋的身份隐藏码的加密信息,表示为
Figure FDA0002705937440000042
S3: End the diffusion operation of the binary packet sequence, so as to obtain the diffused numerical sequences CP1 and CP2, that is, the encrypted information of the identity hidden code of a certain batch of garbage bags, expressed as
Figure FDA0002705937440000042
(3)某批垃圾袋的垃圾分类号批量生成(3) Batch generation of garbage classification numbers for a certain batch of garbage bags 根据该批垃圾袋中单件垃圾袋的批量身份码(各个垃圾分类码制码日期、垃圾类别、垃圾分类序号信息)的不同,分别执行单个垃圾分类号生成步骤,即可实现该批垃圾袋的垃圾分类号批量生成,其中单件垃圾袋的垃圾分类号生成步骤描述如下,According to the difference in the batch identity code (code date of each garbage classification code, garbage category, garbage classification serial number information) of a single garbage bag in the batch of garbage bags, the steps of generating a single garbage classification number are performed respectively, and the batch of garbage bags can be realized. The garbage classification numbers are generated in batches, and the steps for generating the garbage classification numbers for a single garbage bag are described as follows: 首先,从垃圾袋身份码中抽取出垃圾分类码的制码日期(Mk+L+p+n-1Mk+L+p+n)、垃圾类别(Mk+L+p+n+1Mk+L+p+n+2)、垃圾分类序号信息(Mk+L+p+n+3Mk+L+p+n+4),将制码日期逐个字符利用bin2dec()函数转换成数值型数据,得到数值序列R={R1,R2},将垃圾分类序号信息逐个字符利用bin2dec()函数转换成数值型数据,得到数值序列F={F1,F2},First, extract the code date of the garbage classification code (M k+L+p+n-1 M k+L+p+n ), the garbage category (M k+L+p+n+ 1 M k+L+p+n+2 ), garbage classification serial number information (M k+L+p+n+3 M k+L+p+n+4 ), use bin2dec() to make code date character by character The function is converted into numerical data, and the numerical sequence R={R 1 , R 2 } is obtained, and the garbage classification serial number information is converted into numerical data character by character using the bin2dec() function to obtain the numerical sequence F={F 1 , F 2 } , 然后,按照如下(9)、(10)公式分别计算得到Logistic混沌映射的初值
Figure FDA0002705937440000043
和参数
Figure FDA0002705937440000044
Then, according to the following formulas (9) and (10), the initial value of the Logistic chaotic map is calculated respectively
Figure FDA0002705937440000043
and parameters
Figure FDA0002705937440000044
Figure FDA0002705937440000045
make
Figure FDA0002705937440000045
but
Figure FDA0002705937440000046
Figure FDA0002705937440000046
Figure FDA0002705937440000047
Figure FDA0002705937440000047
由混沌映射的初值
Figure FDA0002705937440000048
和外部密钥
Figure FDA0002705937440000049
对如下公式(11)所示Logistic混沌映射进行迭代,式中k表示迭代次数(k=1,2,...)、
Figure FDA00027059374400000410
表示第k次迭代得到的混沌信号,
Initial value mapped by chaos
Figure FDA0002705937440000048
and external key
Figure FDA0002705937440000049
Iterate the Logistic chaotic map shown in the following formula (11), where k represents the number of iterations (k=1, 2,...),
Figure FDA00027059374400000410
represents the chaotic signal obtained at the kth iteration,
Figure FDA00027059374400000411
Figure FDA00027059374400000411
得到混沌信号序列
Figure FDA0002705937440000051
从序列
Figure FDA0002705937440000052
中第m个元素开始依次间隔n1个元素取1个元素以形成长度为
Figure FDA0002705937440000053
的混沌信号序列
Figure FDA0002705937440000054
同时从序列
Figure FDA0002705937440000055
中第m个元素开始依次间隔n2个元素取1个元素以形成长度为
Figure FDA0002705937440000056
的混沌信号序列
Figure FDA0002705937440000057
get chaotic signal sequence
Figure FDA0002705937440000051
from the sequence
Figure FDA0002705937440000052
The mth element in the middle starts to take 1 element at an interval of n 1 elements to form a length of
Figure FDA0002705937440000053
chaotic signal sequence of
Figure FDA0002705937440000054
Simultaneously from the sequence
Figure FDA0002705937440000055
The mth element in the middle starts to take 1 element at an interval of n 2 elements to form a length of
Figure FDA0002705937440000056
chaotic signal sequence of
Figure FDA0002705937440000057
接着,根据垃圾类别(Mk+L+p+n+1Mk+L+p+n+2)对某批垃圾袋的身份隐藏码加密信息,数值序列CP1、CP2采取如下操作,Next, according to the garbage category (M k+L+p+n+1 M k+L+p+n+2 ), the identity hidden code encryption information of a certain batch of garbage bags is performed, and the numerical sequences CP1 and CP2 take the following operations: 如果Mk+L+p+n+1Mk+L+p+n+2=“01”,则将混沌信号序列
Figure FDA0002705937440000058
按升序排序,根据混沌信号序列
Figure FDA0002705937440000059
排序前、后的位置变化置乱规则,对数值序列CP1进行置乱,得到置乱后的数值序列
Figure FDA00027059374400000510
Figure FDA00027059374400000511
同时将混沌信号序列
Figure FDA00027059374400000512
按升序排序,根据混沌信号序列
Figure FDA00027059374400000513
排序前、后的位置变化置乱规则,对低位组合二进制序列CP2进行置乱,得到置乱后的数值序列
Figure FDA00027059374400000514
Figure FDA00027059374400000515
If M k+L+p+n+1 M k+L+p+n+2 ="01", then the chaotic signal sequence
Figure FDA0002705937440000058
Sort in ascending order, according to the chaotic signal sequence
Figure FDA0002705937440000059
The position change scrambling rules before and after sorting, scrambling the numerical sequence CP1, and obtaining the scrambled numerical sequence
Figure FDA00027059374400000510
Figure FDA00027059374400000511
At the same time, the chaotic signal sequence
Figure FDA00027059374400000512
Sort in ascending order, according to the chaotic signal sequence
Figure FDA00027059374400000513
The position change scrambling rules before and after sorting, scrambling the low-order combination binary sequence CP2, and obtaining the scrambled numerical sequence
Figure FDA00027059374400000514
Figure FDA00027059374400000515
如果Mk+L+p+n+1Mk+L+p+n+2=“02”,则将混沌信号序列
Figure FDA00027059374400000516
按升序排序,根据混沌信号序列
Figure FDA00027059374400000517
排序前、后的位置变化置乱规则,对数值序列CP1进行置乱,得到置乱后的数值序列
Figure FDA00027059374400000518
Figure FDA00027059374400000519
同时将混沌信号序列
Figure FDA00027059374400000520
按降序排序,根据混沌信号序列
Figure FDA00027059374400000521
排序前、后的位置变化置乱规则,对低位组合二进制序列CP2进行置乱,得到置乱后的数值序列
Figure FDA00027059374400000522
Figure FDA00027059374400000523
If M k+L+p+n+1 M k+L+p+n+2 = "02", then the chaotic signal sequence
Figure FDA00027059374400000516
Sort in ascending order, according to the chaotic signal sequence
Figure FDA00027059374400000517
The position change scrambling rules before and after sorting, scrambling the numerical sequence CP1, and obtaining the scrambled numerical sequence
Figure FDA00027059374400000518
Figure FDA00027059374400000519
At the same time, the chaotic signal sequence
Figure FDA00027059374400000520
Sort in descending order, according to the chaotic signal sequence
Figure FDA00027059374400000521
The position change scrambling rules before and after sorting, scrambling the low-order combination binary sequence CP2, and obtaining the scrambled numerical sequence
Figure FDA00027059374400000522
Figure FDA00027059374400000523
如果Mk+L+p+n+1Mk+L+p+n+2=“03”,则先将混沌信号序列
Figure FDA00027059374400000524
重组,得重组后的混沌信号序列
Figure FDA00027059374400000525
Figure FDA00027059374400000526
再将混沌信号序列
Figure FDA00027059374400000527
按降序排序,根据混沌信号序列
Figure FDA00027059374400000528
排序前、后的位置变化置乱规则,对数值序列CP1进行置乱,得到置乱后的数值序列
Figure FDA00027059374400000529
Figure FDA00027059374400000530
同时将混沌信号序列
Figure FDA00027059374400000531
按升序排序,根据混沌信号序列
Figure FDA00027059374400000532
排序前、后的位置变化置乱规则,对低位组合二进制序列CP2进行置乱,得到置乱后的数值序列
Figure FDA00027059374400000533
Figure FDA00027059374400000534
If M k+L+p+n+1 M k+L+p+n+2 = "03", then the chaotic signal sequence
Figure FDA00027059374400000524
Recombination, get the reorganized chaotic signal sequence
Figure FDA00027059374400000525
Figure FDA00027059374400000526
Then the chaotic signal sequence
Figure FDA00027059374400000527
Sort in descending order, according to the chaotic signal sequence
Figure FDA00027059374400000528
The position change scrambling rules before and after sorting, scrambling the numerical sequence CP1, and obtaining the scrambled numerical sequence
Figure FDA00027059374400000529
Figure FDA00027059374400000530
At the same time, the chaotic signal sequence
Figure FDA00027059374400000531
Sort in ascending order, according to the chaotic signal sequence
Figure FDA00027059374400000532
The position change scrambling rules before and after sorting, scrambling the low-order combination binary sequence CP2, and obtaining the scrambled numerical sequence
Figure FDA00027059374400000533
Figure FDA00027059374400000534
如果Mk+L+p+n+1Mk+L+p+n+2=“04”,则先将混沌信号序列
Figure FDA00027059374400000535
重组,得重组后的混沌信号序列
Figure FDA00027059374400000536
Figure FDA00027059374400000537
再将混沌信号序列
Figure FDA00027059374400000538
按降序排序,根据混沌信号序列
Figure FDA00027059374400000539
排序前、后的位置变化置乱规则,对数值序列CP1进行置乱,得到置乱后的数值序列
Figure FDA00027059374400000540
Figure FDA00027059374400000541
同时先将混沌信号序列
Figure FDA00027059374400000542
重组,得重组后的混沌信号序列
Figure FDA00027059374400000543
Figure FDA00027059374400000544
再将混沌信号序列
Figure FDA00027059374400000545
按降序排序,根据混沌信号序列
Figure FDA00027059374400000546
排序前、后的位置变化置乱规则,对低位组合二进制序列CP2进行置乱,得到置乱后的数值序列
Figure FDA00027059374400000547
Figure FDA0002705937440000061
If M k+L+p+n+1 M k+L+p+n+2 = "04", then the chaotic signal sequence
Figure FDA00027059374400000535
Recombination, get the reorganized chaotic signal sequence
Figure FDA00027059374400000536
Figure FDA00027059374400000537
Then the chaotic signal sequence
Figure FDA00027059374400000538
Sort in descending order, according to the chaotic signal sequence
Figure FDA00027059374400000539
The position change scrambling rules before and after sorting, scrambling the numerical sequence CP1, and obtaining the scrambled numerical sequence
Figure FDA00027059374400000540
Figure FDA00027059374400000541
At the same time, the chaotic signal sequence is first
Figure FDA00027059374400000542
Recombination, get the reorganized chaotic signal sequence
Figure FDA00027059374400000543
Figure FDA00027059374400000544
Then the chaotic signal sequence
Figure FDA00027059374400000545
Sort in descending order, according to the chaotic signal sequence
Figure FDA00027059374400000546
The position change scrambling rules before and after sorting, scrambling the low-order combination binary sequence CP2, and obtaining the scrambled numerical sequence
Figure FDA00027059374400000547
Figure FDA0002705937440000061
其中,
Figure FDA0002705937440000062
运算表示得到一个不大于
Figure FDA0002705937440000063
的整数,
in,
Figure FDA0002705937440000062
operation means to obtain a value not greater than
Figure FDA0002705937440000063
the integer,
最后,将数值序列
Figure FDA0002705937440000064
逐个元素组合并转换为汉字字符,得到汉字序列
Figure FDA0002705937440000065
即为垃圾分类号,其中汉字序列C的长度为
Figure FDA0002705937440000066
Finally, the numerical sequence
Figure FDA0002705937440000064
Element-by-element combination and conversion to Chinese characters to get the Chinese character sequence
Figure FDA0002705937440000065
is the garbage classification number, where the length of the Chinese character sequence C is
Figure FDA0002705937440000066
根据该批垃圾袋中单个垃圾分类号生成过程,依次进行该批垃圾袋的各个垃圾分类号的生成;According to the generation process of a single garbage classification number in the batch of garbage bags, the generation of each garbage classification number of the batch of garbage bags is performed in sequence; (4)某批垃圾袋的垃圾分类码组合与垃圾分类二维码生成(4) Combination of garbage classification codes for a certain batch of garbage bags and generation of garbage classification QR codes 将垃圾袋身份标识码(M1M2...MkMk+L+p+1Mk+L+p+2...Mk+L+p+n-2)、制码日期(Mk+L+p+n- 1Mk+L+p+n)、垃圾分类号
Figure FDA0002705937440000067
垃圾类别(Mk+L+p+n+1Mk+L+p+n+2)、垃圾分类序号信息(Mk+L+p+n+3Mk+L+p+n+4)进行组合,生成该批垃圾袋中单个垃圾分类码,接着生成QR Code,即垃圾分类二维码,按此规则可批量组合生成该批垃圾袋的垃圾分类二维码。
Put the garbage bag identification code (M 1 M 2 ... M k M k+L+p+1 M k+L+p+2 ... M k+L+p+n-2 ), the date of making the code (M k+L+p+n- 1 M k+L+p+n ), garbage classification number
Figure FDA0002705937440000067
Garbage category (M k+L+p+n+1 M k+L+p+n+2 ), garbage classification serial number information (M k+L+p+n+3 M k+L+p+n+4 ) to generate a single garbage classification code in the batch of garbage bags, and then generate a QR Code, that is, a garbage classification two-dimensional code. According to this rule, the garbage classification two-dimensional code of the batch of garbage bags can be generated by batch combination.
2.根据权利要求1所述的一种垃圾分类二维码批量生成方法,其特征在于:步骤(1)中所述的将身份标识码逐个字符转换成数值型数据,是指将身份标识码逐个字符采用unicode2native()函数将ASCII码值属于[32,126]的可见字符转换为单个数值型数据,或将GB2312字符集中双字节编码的汉字转换为两个数值型数据,从而得到对应的数值序列
Figure FDA0002705937440000068
2. a kind of garbage classification two-dimensional code batch generation method according to claim 1, is characterized in that: described in step (1), the identity code is converted into numerical data character by character, refers to the identity code Use the unicode2native() function to convert the visible characters whose ASCII code value belongs to [32,126] into a single numeric data character by character, or convert the double-byte encoded Chinese characters in the GB2312 character set into two numeric data, so as to obtain the corresponding numeric sequence
Figure FDA0002705937440000068
3.根据权利要求1所述的一种垃圾分类二维码批量生成方法,其特征在于:步骤(1)中所述的将身份隐藏码逐个字符转换成数值型数据[Pi1,Pi2],是指将身份隐藏码逐个字符采用unicode2native()函数将ASCII码值属于[32,126]的可见字符转换为单个数值型数据并进行重组,表示为[Pi1,Pi2]=[0,unicode2native(Mi)],或将GB2312字符集中双字节编码的汉字转换为两个数值型数据,表示为[Pi1,Pi2]=unicode2native(Mi),从而得到高位数值序列P1={P11,P12,...,P1L+p,P1L+p+1}={P11,P21,...,P(L+p)1,P(L+p+1)1}和低位数值序列P2={P21,P22,...,P2L+p,P2L+p+1}={P12,P22,...,P(L+p)2,P(L+p+1)2}。3. a kind of garbage classification two-dimensional code batch generation method according to claim 1 is characterized in that: described in step (1), the identity hidden code is converted into numerical data [P i1 , P i2 ] character by character , refers to converting the visible characters whose ASCII code value belongs to [32,126] into a single numerical data and recombining them by using the unicode2native() function to convert the identity hidden code character by character, expressed as [P i1 ,P i2 ]=[0,unicode2native( M i )], or convert the double-byte encoded Chinese characters in the GB2312 character set into two numerical data, expressed as [P i1 , P i2 ]=unicode2native(M i ), so as to obtain the high-order numerical sequence P1={P1 1 ,P1 2 ,...,P1 L+p ,P1 L+p+1 }={P 11 ,P 21 ,...,P (L+p)1 ,P (L+p+1)1 } and low-order value sequence P2={P2 1 ,P2 2 ,...,P2 L+p ,P2 L+p+1 }={P 12 ,P 22 ,...,P (L+p)2 ,P (L+p+1)2 }. 4.根据权利要求1所述的一种垃圾分类二维码批量生成方法,其特征在于:步骤(1)中所述的将数值序列S中元素Si逐个转换成8bits的二进制序列{BSi1,BSi2,BSi3,BSi4,BSi5,BSi6,BSi7,BSi8},是指采用dec2bin(Si,8)函数得到二进制序列{BSi1,BSi2,BSi3,BSi4,BSi5,BSi6,BSi7,BSi8}。4. a kind of garbage classification two-dimensional code batch generation method according to claim 1, is characterized in that: described in step (1), element S i in numerical sequence S is converted into the binary sequence {BS i1 of 8bits one by one ,BS i2 ,BS i3 ,BS i4 ,BS i5 ,BS i6 ,BS i7 ,BS i8 }, which means that the binary sequence {BS i1 , BS i2 ,BS i3 ,BS i4 , BS i5 , BS i6 , BS i7 , BS i8 }. 5.根据权利要求1所述的一种垃圾分类二维码批量生成方法,其特征在于:步骤(1)中所述的将数值序列P1中元素P1i逐个转换成8bits的二进制序列{BP1i1,BP1i2,BP1i3,BP1i4,BP1i5,BP1i6,BP1i7,BP1i8},是指采用dec2bin(P1i,8)函数得到二进制序列{BP1i1,BP1i2,BP1i3,BP1i4,BP1i5,BP1i6,BP1i7,BP1i8}。5. a kind of garbage classification two-dimensional code batch generation method according to claim 1, is characterized in that: described in step (1), the element P1 i in the numerical sequence P1 is converted into the binary sequence {BP1 i1 of 8bits one by one ,BP1 i2 ,BP1 i3 ,BP1 i4 ,BP1 i5 ,BP1 i6 ,BP1 i7 ,BP1 i8 }, which means that the binary sequence {BP1 i1 , BP1 i2 ,BP1 i3 ,BP1 i4 , BP1 i5 , BP1 i6 , BP1 i7 , BP1 i8 }. 6.根据权利要求1所述的一种垃圾分类二维码批量生成方法,其特征在于:步骤(1)中所述的将数值序列P2中元素P2i逐个转换成8bits的二进制序列{BP2i1,BP2i2,BP2i3,BP2i4,BP2i5,BP2i6,BP2i7,BP2i8},是指采用dec2bin(P2i,8)函数得到二进制序列{BP2i1,BP2i2,BP2i3,BP2i4,BP2i5,BP2i6,BP2i7,BP2i8}。6. a kind of garbage classification two-dimensional code batch generation method according to claim 1, is characterized in that: described in step (1), element P2 i in numerical sequence P2 is converted into the binary sequence {BP2 i1 of 8bits one by one ,BP2 i2 ,BP2 i3 ,BP2 i4 ,BP2 i5 ,BP2 i6 ,BP2 i7 ,BP2 i8 }, which means that the binary sequence {BP2 i1 , BP2 i2 ,BP2 i3 ,BP2 i4 , BP2 i5 , BP2 i6 , BP2 i7 , BP2 i8 }. 7.根据权利要求1所述的一种垃圾分类二维码批量生成方法,其特征在于:步骤(3)中所述的将数值序列
Figure FDA0002705937440000071
逐个元素组合并转换为汉字字符,是指先逐个元素组合[CP1i,CP2i],然后再转换为汉字字符,即Ci=native2unicode([CP1i,CP2i])。
7. a kind of garbage classification two-dimensional code batch generation method according to claim 1 is characterized in that: the numerical sequence described in step (3)
Figure FDA0002705937440000071
Combining elements one by one and converting them into Chinese characters refers to combining [CP1 i , CP2 i ] element by element and then converting them into Chinese characters, that is, C i =native2unicode([CP1 i ,CP2 i ]).
8.根据权利要求1所述的一种垃圾分类二维码批量生成方法,其特征在于:步骤(4)中所述的将垃圾袋身份标识码(M1M2...MkMk+L+p+1Mk+L+p+2...Mk+L+p+n-2)、制码日期(Mk+L+p+n- 1Mk+L+p+n)、垃圾分类号
Figure FDA0002705937440000072
垃圾类别(Mk+L+p+n+1Mk+L+p+n+2)、垃圾分类序号信息(Mk+L+p+n+3Mk+L+p+n+4)进行组合,生成该批垃圾袋中单个垃圾分类码,是指采用将垃圾袋身份标识码、制码日期、垃圾分类号、垃圾类别和垃圾分类序号信息插入连接的组合方式,生成该批垃圾袋中单个垃圾分类码,表示为M1M2...Mk
Figure FDA0002705937440000073
Mk+L+p+1Mk+L+p+2...Mk+L+p+n- 2Mk+L+p+n-1Mk+L+p+nMk+L+p+n+1Mk+L+p+n+2Mk+L+p+n+3Mk+L+p+n+4,其中M1M2...Mk
Figure FDA0002705937440000074
Mk+L+p+ 1Mk+L+p+2...Mk+L+p+n-2Mk+L+p+n-1Mk+L+p+n、Mk+L+p+n+1Mk+L+p+n+2与Mk+L+p+n+3Mk+L+p+n+4之间相互用英文空格间隔。
8. The method for batch generation of two-dimensional codes for garbage classification according to claim 1, characterized in that: in step (4), the garbage bag identification codes (M 1 M 2 ... M k M k +L+p+1 M k+L+p+2 ...M k+L+p+n-2 ), code date (M k+L+p+n- 1 M k+L+p+ n ), garbage classification number
Figure FDA0002705937440000072
Garbage category (M k+L+p+n+1 M k+L+p+n+2 ), garbage classification serial number information (M k+L+p+n+3 M k+L+p+n+4 ) to generate a single garbage classification code in the batch of garbage bags, which refers to the combination method of inserting the garbage bag identification code, code production date, garbage classification number, garbage category and garbage classification serial number information into the connection to generate the batch of garbage. A single garbage classification code in the bag, expressed as M 1 M 2 ... M k
Figure FDA0002705937440000073
M k+L+p+1 M k+L+p+2 ...M k+L+p+n- 2 M k+L+p+n-1 M k+L+p+n M k+ L+p+n+1 M k+L+p+n+2 M k+L+p+n+3 M k+L+p+n+4 , where M 1 M 2 ... M k ,
Figure FDA0002705937440000074
M k+L+p+ 1 M k+L+p+2 ...M k+L+p+n-2 M k+L+p+n-1 M k+L+p+n , M k+ L+p+n+1 M k+L+p+n+2 and M k+L+p+n+3 M k+L+p+n+4 are separated by English spaces.
CN202011038759.0A 2020-09-28 2020-09-28 A method for batch generation of two-dimensional codes for garbage classification Active CN112183697B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011038759.0A CN112183697B (en) 2020-09-28 2020-09-28 A method for batch generation of two-dimensional codes for garbage classification

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011038759.0A CN112183697B (en) 2020-09-28 2020-09-28 A method for batch generation of two-dimensional codes for garbage classification

Publications (2)

Publication Number Publication Date
CN112183697A CN112183697A (en) 2021-01-05
CN112183697B true CN112183697B (en) 2022-05-03

Family

ID=73944697

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011038759.0A Active CN112183697B (en) 2020-09-28 2020-09-28 A method for batch generation of two-dimensional codes for garbage classification

Country Status (1)

Country Link
CN (1) CN112183697B (en)

Citations (5)

* 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
CN109472338A (en) * 2018-11-19 2019-03-15 南通大学 A batch generation method of commodity anti-counterfeiting two-dimensional code
CN109933755A (en) * 2019-03-21 2019-06-25 江苏工程职业技术学院 A kind of generation method of garbage classification code
CN109977371A (en) * 2019-03-21 2019-07-05 江苏工程职业技术学院 A kind of generation method of character type garbage classification code
CN110033066A (en) * 2019-03-21 2019-07-19 江苏工程职业技术学院 A kind of generation method of colour garbage classification two dimensional code

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100571750B1 (en) * 2003-06-18 2006-04-18 삼성전자주식회사 Method and apparatus for generating preamble using chaotic sequence
US20160234009A1 (en) * 2015-02-08 2016-08-11 Wenhua Li Chaotic Baseband Modulation Hopping Based Post-Quantum Physical-Layer Encryption

Patent Citations (5)

* 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
CN109472338A (en) * 2018-11-19 2019-03-15 南通大学 A batch generation method of commodity anti-counterfeiting two-dimensional code
CN109933755A (en) * 2019-03-21 2019-06-25 江苏工程职业技术学院 A kind of generation method of garbage classification code
CN109977371A (en) * 2019-03-21 2019-07-05 江苏工程职业技术学院 A kind of generation method of character type garbage classification code
CN110033066A (en) * 2019-03-21 2019-07-19 江苏工程职业技术学院 A kind of generation method of colour garbage classification two dimensional code

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
混沌数码防伪技术研究与应用;盛苏英等;《微电子学与计算机》;20120831;第169-174页 *

Also Published As

Publication number Publication date
CN112183697A (en) 2021-01-05

Similar Documents

Publication Publication Date Title
CN112116046B (en) Garbage classification two-dimensional code generation method based on layered encryption
CN110033066B (en) Method for generating color garbage classification two-dimensional code
CN109933755B (en) Method for generating garbage classification code
CN104486073B (en) A kind of encryption and decryption method of character type data
CN101599118A (en) Method for detecting and locating HTML page tampering
CN112001468B (en) A method for generating and recognizing anti-counterfeiting codes for character-type commodities
CN106095735A (en) A kind of method plagiarized based on deep neural network detection academic documents
CN112183697B (en) A method for batch generation of two-dimensional codes for garbage classification
CN106021344B (en) A Multi-adaptive CIME Grid Model Sharing Method
CN112163230B (en) A method for generating anti-counterfeiting code of goods with Chinese character encryption
CN112183698B (en) A method for generating two-dimensional codes for Chinese garbage classification
CN111680316B (en) Information security sharing method for multiple business entities in the power industry
CN109977371B (en) Method for generating character type garbage classification code
CN111382820A (en) Four-lattice pure-color commodity anti-counterfeiting code generation method
CN114741712A (en) Chinese character encryption method based on hierarchical scrambling
CN113935345B (en) A batch generation method of commodity anti-counterfeiting code based on string-to-image encryption
CN113159252A (en) Commodity anti-counterfeiting two-dimensional code generation method based on different scrambling rules
CN102509058B (en) Point type GIS vector data disguise and recovery method based on redundant bit replacement
CN114997353A (en) Garbage classification two-dimensional code generation method based on block encryption
CN114881189A (en) Garbage classification two-dimensional code generation method based on different combination modes
CN115358361A (en) Garbage classification code generation method based on combined encryption
CN114722409A (en) Character string decryption method based on layered bidirectional diffusion
Zhang et al. A Study on Encoding of Urban Underground Space Facilities Based
CN113935343B (en) Commodity anti-counterfeiting code generation method based on character string-to-picture encryption
CN115913792B (en) DGA domain name identification method, system and readable medium

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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20241206

Address after: 518000 1104, Building A, Zhiyun Industrial Park, No. 13, Huaxing Road, Henglang Community, Longhua District, Shenzhen, Guangdong Province

Patentee after: Shenzhen Hongyue Enterprise Management Consulting Co.,Ltd.

Country or region after: China

Address before: 226000 Jiangsu city of Nantong province sik Road No. 9

Patentee before: NANTONG University

Country or region before: China