CN112183697B - Garbage classification two-dimensional code batch generation method - Google Patents
Garbage classification two-dimensional code batch generation method Download PDFInfo
- 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
- garbage classification
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 46
- 230000000739 chaotic effect Effects 0.000 claims abstract description 143
- 108010076504 Protein Sorting Signals Proteins 0.000 claims abstract description 80
- 238000013507 mapping Methods 0.000 claims abstract description 18
- 239000011159 matrix material Substances 0.000 claims abstract description 15
- 238000006243 chemical reaction Methods 0.000 claims abstract description 11
- 102100020871 Forkhead box protein G1 Human genes 0.000 claims description 43
- 230000008859 change Effects 0.000 claims description 35
- 101710087964 Forkhead box protein G1 Proteins 0.000 claims description 22
- 230000001174 ascending effect Effects 0.000 claims description 14
- 230000008569 process Effects 0.000 claims description 9
- 238000009792 diffusion process Methods 0.000 claims description 8
- 238000000605 extraction Methods 0.000 claims description 8
- LTXREWYXXSTFRX-QGZVFWFLSA-N Linagliptin Chemical compound N=1C=2N(C)C(=O)N(CC=3N=C4C=CC=CC4=C(C)N=3)C(=O)C=2N(CC#CC)C=1N1CCC[C@@H](N)C1 LTXREWYXXSTFRX-QGZVFWFLSA-N 0.000 claims description 3
- 238000012163 sequencing technique Methods 0.000 claims 2
- 230000035945 sensitivity Effects 0.000 description 3
- 229940060587 alpha e Drugs 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000004064 recycling Methods 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 239000003784 tall oil Substances 0.000 description 2
- 241000208340 Araliaceae Species 0.000 description 1
- 206010017577 Gait disturbance Diseases 0.000 description 1
- 241000720945 Hosta Species 0.000 description 1
- 235000005035 Panax pseudoginseng ssp. pseudoginseng Nutrition 0.000 description 1
- 235000003140 Panax quinquefolius Nutrition 0.000 description 1
- 230000004075 alteration Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 230000007613 environmental effect Effects 0.000 description 1
- 235000008434 ginseng Nutrition 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 239000004575 stone Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K19/00—Record carriers for use with machines and with at least a part designed to carry digital markings
- G06K19/06—Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
- G06K19/06009—Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking
- G06K19/06037—Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking multi-dimensional coding
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/001—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using chaotic signals
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (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
Technical Field
The invention relates to the technical field of garbage classification, in particular to a garbage classification two-dimensional code batch generation method.
Background
With the rapid development of science and technology and economic society and the further promotion of urbanization process, the annual output of domestic garbage in cities in China is over hundred million tons at present, and a plurality of cities face a severe situation of 'refuse surrounding cities'. The 'garbage enclosing city' has become a stumbling stone for the development of cities in China. The problem of breaking the 'garbage enclosing city' is that firstly, the generation of urban domestic garbage is reduced from the source, and secondly, the resource treatment of the garbage is also an indispensable key link, so that the classification of the garbage is pushed to the forefront. As early as 1992, the 'garbage bagging classification' is proposed for the first time in Yichang city in China, and a special legislation is proposed for the first time to manage the classification of municipal domestic garbage. Subsequently, garbage classification is gradually developed nationwide, and since the garbage classification in the nineties of the last century is carried out, the theoretical research of urban garbage classification in China has achieved obvious effect, because urban residents lack garbage classification knowledge, the environmental protection consciousness is insufficient, and the activity participation enthusiasm is not high at present. In addition, various problems such as too crude infrastructure of the garbage recycling station, too extensive garbage recycling and transportation process, negative or even unwilling participation caused by worries of residents about personal private information exposure of garbage bags and the like gradually appear, and obviously, implementation of urban garbage classification in China faces many difficulties and challenges. In view of the above problems, it is urgent to develop a safe and reliable method for generating garbage classification codes, so as to ensure generation of garbage classification codes with "uniqueness", safety and garbage classification guidance "from the source, and promote effective development of garbage classification work.
Disclosure of Invention
The purpose of the invention is as follows: the invention aims to solve the defects in the prior art and provides a garbage classification two-dimensional code batch generation method, which comprises the steps of extracting an identity identification code and an identity hidden code from uniform identity codes of a certain batch of garbage bags, relying on the identity identification code and the hidden code and utilizing chaotic mapping to generate a chaotic signal sequence, scrambling, grouping and diffusing high-order and low-order binary sequences formed by converting and combining the identity hidden codes respectively to complete uniform encryption of the identity hidden codes of the certain batch of garbage bags, relying on the batch identity codes of a single garbage bag and utilizing chaotic mapping to generate the chaotic signal sequence, scrambling the uniform encryption result of the identity hidden codes according to garbage categories and different rules respectively, and further generating the garbage classification two-dimensional codes 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.
The technical scheme is as follows: a garbage classification two-dimensional code batch generation method is characterized by comprising the following steps:
(1) coding and transcoding
Firstly, identity information of a certain batch of garbage bags is coded, and the identity information comprises a uniform identity code of the certain batch of garbage bags and a batch identity code of a single garbage bag, so that a unique Chinese and English character type garbage bag identity code of the certain batch of single garbage bags is generated, and is expressed as 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+4Wherein M is1M2...MkIs a city region, Mk+1Mk+2...Mk+LTo a specific residential address, Mk+L+1Mk+L+ 2...Mk+L+pFor contacts and contact phones, Mk+L+p+1Mk+L+p+2...Mk+L+p+nFor coding time (in the form of year-month-day, wherein the last two bits Mk+L+p+n-1Mk+L+p+nAs date), Mk+L+p+n+1Mk+L+p+n+2Classifying color information for garbage (characterizing garbage classes), Mk+L+p+n+3Mk+L+p+n+4The garbage classification serial number information (serial number representing a certain class of garbage bags on a certain day) is mutually spaced by English blank spaces, and the unified identity code of a corresponding garbage bag batch is 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-2The batch identity code of the corresponding single garbage bag is Mk+L+p+n-1Mk+L+p+nMk+L+p+n+ 1Mk+L+p+n+2Mk+L+p+n+3Mk+L+p+n+4,
Then, extracting the identification code (M) from the uniform identification code of a certain batch of garbage bags1M2...MkMk+L+p+ 1Mk+L+p+2...Mk+L+p+n-2) And identity hiding code (M)k+1Mk+2...Mk+LMk+L+1Mk+L+2...Mk+L+p) And make the body feel beautifulThe identification code is converted into numerical data one by one to obtain corresponding numerical sequenceSimultaneously converting the identity hiding code into numerical data P one by onei1,Pi2]Obtaining a high-order numerical value sequence P1 ═ { P1 ═ P11,P12,…,P1L+p,P1L+p+1}={P11,P21,…,P(L+p)1,P(L+p+1)1H and a low order bit value sequence P2 ═ { P2 }1,P22,…,P2L+p,P2L+p+1}={P12,P22,…,P(L+p)2,P(L+p+1)2},
Finally, sequentially combining the elements S in the numerical sequence SiOne by one conversion into a binary sequence of 8bits BSi1,BSi2,BSi3,BSi4,BSi5,BSi6,BSi7,BSi8The element P1 in the numerical sequence P1iOne by one into a binary sequence of 8bits BP1i1,BP1i2,BP1i3,BP1i4,BP1i5,BP1i6,BP1i7,BP1i8The element P2 in the numerical sequence P2iOne by one into a binary sequence of 8bits BP2i1,BP2i2,BP2i3,BP2i4,BP2i5,BP2i6,BP2i7,BP2i8},
And will beA binary sequence BSi1,BSi2,BSi3,BSi4,BSi5,BSi6,BSi7,BSi8Are combined, whereinResulting in a combined binary matrix B,
simultaneously combining L + p +1 binary sequences { BP1i1,BP1i2,BP1i3,BP1i4,BP1i5,BP1i6,BP1i7,BP1i8Combine, where i is 1, 2.., L + p +1, resulting in a high-order combined binary sequence B1 { 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+18And the L + p +1 binary sequences { BP 2}i1,BP2i2,BP2i3,BP2i4,BP2i5,BP2i6,BP2i7,BP2i8Combine, where i is 1, 2.., L + p +1, resulting in a low-bit combined binary sequence B2 { 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},
The garbage bag identity code comprises double-byte coded Chinese characters in a GB2312 character set and ASCLL code value E [32,126 ]]The length of the identity code of the garbage bag is k + L + p + n +6, and the length of the numerical sequence S isThe length of the numerical sequences P1, P2 is L + P +1, the binary moments are combinedThe size of matrix B isThe length of the combined binary sequences B1 and B2 is 8L +8p + 8;
(2) identity hidden code unified encryption of certain batch of garbage bags
The identity hiding codes of a certain batch of garbage bags are uniformly encrypted to show that the identity identification codes (M) are utilized1M2…MkMk+L+p+ 1Mk+L+p+2...Mk+L+p+n-2) To identity hiding code (M)k+1Mk+2...Mk+LMk+L+1Mk+L+2...Mk+L+p) The encryption is carried out, a certain batch of garbage bags need to be subjected to the identity hiding code unified encryption operation only once,
firstly, an initial value x of the Logistic chaotic map is respectively calculated and obtained according to the following formulas (1) - (5) by utilizing a numerical sequence S and a binary matrix B converted from the numerical sequence S, binary sequences B1 and B2 converted from the numerical sequences P1 and P2, and external keys alpha and beta1A sum parameter mu, an extraction start position m, and an extraction interval number n1、n2,
x1=α+mod(α+kp, 1-α), (1)
μ=β+mod(β+1.5×kp, 4-β), (2)
Wherein, B1,i,B2,i,B3,i,B4,i,B5,i,B6,i,B7,i,B8,iDenotes the ith column of the binary matrix B or the binary sequence BSi1,BSi2,BSi3,BSi4,BSi5,BSi6,BSi7,BSi8The number of binary bits '1',<B11,B12,...,B18L+8p+7,B18L+8p+8>representing a binary sequence B11,B12,...,B18L+8p+7,B18L+8p+8Number of binary bits '1', B21,B22,...,B28L+8p+7,B28L+8p+8>Representing a binary sequence B21,B22,...,B28L+8p+7,B28L+8p+8The number of binary bits '1', the external key satisfies the relation of alpha e (0,1) and beta e (3.57,4),
initial value x mapped by chaos1And an external key mu, iterating the Logistic chaotic mapping shown in the following formula (6), wherein k represents iteration times (k is 1, 2), xk+1Represents the chaotic signal obtained by the k-th iteration,
xk+1=μ×xk×(1-xk) (6)
obtaining a chaotic signal sequence X ═ X1,x2,., spaced by n from the m-th element in the sequence X1Taking 1 element as each element to form a chaotic signal sequence with the length of 8L +8p +8At the same time, the m-th element in the sequence X is sequentially spaced by n2Taking 1 element as one element to form a chaotic signal sequence Z ═ Z with the length of 8L +8p +81,Z2,...,Z8L+8p+7,Z8L+8p+8},
Then, the chaotic signal sequence Y is sorted in descending order, and the high-order combined binary sequence B1 is scrambled according to the position change scrambling rule before and after the chaotic signal sequence Y is sorted to obtain a scrambled high-order binary sequenceSimultaneously, the chaotic signal sequence Z is sorted in a descending order, and the low-order combined binary sequence B2 is scrambled according to the position change scrambling rule before and after the chaotic signal sequence Z is sorted to obtain a low-order binary sequence after scrambling
Next, let LB be mod (6-mod (8L +8p +8,6),6), and scramble the higher binary sequenceLB binary bits '0' are added at the end of the sequence, the lower binary sequence after scrambling is carried outLB binary bits '1' are added at the end of the sequence to obtain a binary sequence And binary sequence Wherein
For binary sequencesAndgrouping the binary sequences separatelyThe middle elements are sequentially and positively grouped by taking 6 elements as a unit from the beginning to the end to obtain a grouped binary sequence which is expressed asSimultaneously converting binary sequencesThe middle elements are sequentially and positively grouped by taking 6 elements as a unit from the beginning to the end to obtain a grouped binary sequence which is expressed asWherein each binary block sequence comprises 6 binary bits, an
Finally, each binary packet sequence BF1{ i }, BF2{ i }, in turn, is subjected to the following diffusion operation:
s0: let i equal to 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),
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),
s1: the binary packet sequences BF1{ i }, BF2{ i } are calculated according to the following formulas (7), (8),
CP1i=bin2dec(BF1{i})+176+k1_switch, (7)
CP2i=bin2dec(BF2{i})+161+k2_switch, (8)
s2: numerical data CP1 calculated from binary packet sequence BF1{ i }iAnd numerical data CP2 calculated from a binary packet sequence BF2{ i }iAnd k1_ switch mod is calculated (CP 1)i+2×CP2i+3×k1_switch,8)、k2_switch=mod(CP2i+2×CP1i+3 × k2_ switch,25), and let i equal i +1, then judge the size of i if it isThe process proceeds to step S1, otherwise, to step S3,
s3: finishing the diffusion operation of the binary grouping sequence to obtain diffused numerical value sequences CP1 and CP2, namely the encrypted information of the identity hidden codes of a certain garbage bag batch, which is represented as
(3) Batch generation of garbage classification numbers of certain batch of garbage bags
According to the different batch identity codes (code making date of each garbage classification code, garbage classification and garbage classification serial number information) of the single garbage bags in the batch of garbage bags, respectively executing a single garbage classification number generation step to realize the batch generation of the garbage classification numbers of the batch of garbage bags, wherein the garbage classification number generation step of the single garbage bags is described as follows,
firstly, extracting the code making date (M) of the garbage classification code from the identity code of the garbage bagk+L+p+n-1Mk+L+p+n) Garbage category (M)k+L+p+n+1Mk+L+p+n+2) Garbage classification serial number information (M)k+L+p+n+3Mk+L+p+n+4) Converting the code date into numerical data by using bin2dec () function one by one to obtain numerical sequence R ═ { R }1,R2Converting the garbage classification serial number information into numerical data by using a bin2dec () function one by one to obtain a numerical sequence F ═ F { (F })1,F2},
Then, respectively calculating according to the following formulas (9) and (10) to obtain initial values of Logistic chaotic mappingAnd parameters
Initial values mapped by chaosAnd an external keyIterating a Logistic chaotic mapping shown in a formula (11), wherein k represents iteration times (k is 1, 2.),represents the chaotic signal obtained by the k-th iteration,
obtaining a chaotic signal sequenceSlave sequenceThe m-th element is sequentially spaced by n1Each element is 1 element to form a length ofChaotic signal sequence of (1)Simultaneous slave sequenceThe m-th element is sequentially spaced by n2Each element is 1 element to form a length ofOf the chaotic signal sequence
Next, the garbage classification (M) is usedk+L+p+n+1Mk+L+p+n+2) For encrypting the identity hidden code encryption information of a certain batch of garbage bags, the numerical value sequences CP1 and CP2 take the following operations,
if M isk+L+p+n+1Mk+L+p+n+2If it is 01, the chaotic signal sequence is appliedIn ascending order, according to chaotic signal sequenceThe position change scrambling rule before and after the ordering is used for scrambling the numerical value sequence CP1 to obtain a scrambled numerical value sequence Simultaneously converting the chaotic signal sequenceIn ascending order, according to chaotic signal sequenceThe position change scrambling rule before and after the ordering is used for scrambling the low-order combined binary sequence CP2 to obtain a scrambled numerical sequence
If M isk+L+p+n+1Mk+L+p+n+2When the signal sequence is '02', the chaotic signal sequence is processedIn ascending order, according to chaotic signal sequenceThe position change scrambling rule before and after the ordering is used for scrambling the numerical value sequence CP1 to obtain a scrambled numerical value sequence Simultaneously converting the chaotic signal sequenceIn descending order, according to chaotic signal sequenceThe position change scrambling rule before and after the ordering is used for scrambling the low-order combined binary sequence CP2 to obtain a scrambled numerical sequence
If M isk+L+p+n+1Mk+L+p+n+2When the signal sequence is 03, the chaotic signal sequence is firstly generatedRecombining to obtain a recombined chaotic signal sequence Then, the chaotic signal sequence is processedIn descending order, according to chaotic signal sequenceThe position change scrambling rule before and after the ordering is used for scrambling the numerical value sequence CP1 to obtain a scrambled numerical value sequence Simultaneously converting the chaotic signal sequenceIn ascending order, according to chaotic signal sequenceThe position change scrambling rule before and after the ordering is used for scrambling the low-order combined binary sequence CP2 to obtain a scrambled numerical sequence
If it is notThe chaotic signal sequence is first generatedRecombining to obtain a recombined chaotic signal sequence Then, the chaotic signal sequence is processedIn descending order, according to chaotic signal sequenceThe position change scrambling rule before and after the ordering is used for scrambling the numerical value sequence CP1 to obtain a scrambled numerical value sequence Simultaneously firstly chaotic signal sequenceRecombining to obtain a recombined chaotic signal sequence Then, the chaotic signal sequence is processedIn descending order, according to chaotic signal sequenceThe position change scrambling rule before and after the ordering is used for scrambling the low-order combined binary sequence CP2 to obtain a scrambled numerical sequence
finally, the numerical value sequence isElement-by-element combination and conversion into Chinese character to obtain Chinese character sequenceI.e. the garbage classification number, wherein the length of the Chinese character sequence C is
Sequentially generating the garbage classification numbers of the garbage bags according to the generation process of the single garbage classification number in the garbage bags;
(4) garbage classification code combination and garbage classification two-dimensional code generation of certain batch of garbage bags
Identify the identity code (M) of the garbage bag1M2...MkMk+L+p+1Mk+L+p+2...Mk+L+p+n-2) Code making date (M)k+L+p+n- 1Mk+L+p+n) Garbage classification numberGarbage category (M)k+L+p+n+1Mk+L+p+n+2) Garbage classification serial number information (M)k+L+p+n+3Mk+L+p+n+4) And combining to generate a single garbage classification Code in the garbage bags, then generating a QR Code, namely a garbage classification two-dimensional Code, and combining in batches to generate the garbage classification two-dimensional codes of the garbage bags according to the rule.
Further, the step (1) of converting the identity codes into numerical data one by one in the garbage classification two-dimensional code batch generation method means that the identity codes are converted into ASCII code values one by adopting a unicode2native () function to belong to [32,126 ]]Converting the visible characters into single numerical data, or converting double-byte coded Chinese characters in GB2312 character set into two numerical data, thereby obtaining corresponding numerical sequence
Further, in the garbage classification two-dimensional code batch generation method, the identity hidden codes are converted into numerical data [ P ] one by one in the step (1)i1,Pi2]The method is to adopt unicode2native () function to belong the ASCII code value to [32,126 ]]Is converted into single numerical data and recombined, denoted as Pi1,Pi2]=[0,unicode2native(Mi)]Or converting double-byte coded Chinese characters in GB2312 character set into two numerical data, which are expressed as [ P ]i1,Pi2]=unicode2native(Mi) So as to obtain the high-order numerical value sequence P1 ═ { P1 ═ P11,P12,…,P1L+p,P1L+p+1}={P11,P21,…,P(L+p)1,P(L+p+1)1And low order value sequence P2 ═ P21,P22,…,P2L+p,P2L+p+1}={P12,P22,…,P(L+p)2,P(L+p+1)2}。
Further, in the method for generating the two-dimensional code for garbage classification in batches, the element S in the numerical sequence S is used in the step (1)iOne by one conversion into a binary sequence of 8bits BSi1,BSi2,BSi3,BSi4,BSi5,BSi6,BSi7,BSi8Means that dec2bin (S) is usedi8) the function yields a binary sequence BSi1,BSi2,BSi3,BSi4,BSi5,BSi6,BSi7,BSi8}。
Further, in the method for batch generation of two-dimensional codes for garbage classification, in step (1), the element P1 in the numerical sequence P1 is usediOne by one into a binary sequence of 8bits BP1i1,BP1i2,BP1i3,BP1i4,BP1i5,BP1i6,BP1i7,BP1i8Means that dec2bin (P1) is usedi8) the function yields a binary sequence { BP1i1,BP1i2,BP1i3,BP1i4,BP1i5,BP1i6,BP1i7,BP1i8}。
Further, in the method for batch generation of two-dimensional codes for garbage classification, in step (1), the element P2 in the numerical sequence P2 is usediOne by one into a binary sequence of 8bits BP2i1,BP2i2,BP2i3,BP2i4,BP2i5,BP2i6,BP2i7,BP2i8Means that dec2bin (P2) is usedi8) the function yields a binary sequence { BP2i1,BP2i2,BP2i3,BP2i4,BP2i5,BP2i6,BP2i7,BP2i8}。
Further, the numerical sequence in step (3) of the garbage classification two-dimensional code batch generation method Element by element combination and conversion into Chinese characters areRefer to element-by-element combination [ CP1 ]i,CP2i]Then converted into kanji characters, i.e. Ci=native2unicode([CP1i,CP2i])。
Further, the garbage classification two-dimensional code batch generation method is characterized in that the garbage bag identity identification code (M) in the step (4) is used1M2...MkMk+L+p+1Mk+L+p+2...Mk+L+p+n-2) Code making date (M)k+L+p+n-1Mk+L+p+n) Garbage classification numberGarbage category (M)k+L+p+n+1Mk+L+p+n+2) Garbage classification serial number information (M)k+L+p+n+3Mk+L+p+n+4) The step of combining to generate the single garbage classification code in the garbage bag batch refers to the step of generating the single garbage classification code in the garbage bag batch by adopting a combination mode of inserting and connecting the garbage bag identity identification code, the code making date, the garbage classification number, the garbage classification and the garbage classification serial number information, and the code is expressed asWherein M is1M2...Mk、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+2And Mk+L+p+n+3Mk+L+p+n+4The English spaces are mutually spaced.
Has the advantages that: the invention relies on the identity identification code and the hidden code extracted from the identity code of the garbage bag and utilizes chaotic mapping to generate a chaotic signal sequence, carries out scrambling, grouping and diffusion on the high-order binary sequence and the low-order binary sequence formed by converting and combining the identity hidden codes respectively to finish the uniform encryption of the identity hidden codes of a certain batch of garbage bags, relies on the batch identity code of a single garbage bag and utilizes chaotic mapping to generate the chaotic signal sequence, and carries out scrambling with different rules respectively on the uniform encryption result of the identity hidden code according to garbage categories, thereby generating the garbage classification two-dimensional codes in batches.
Drawings
FIG. 1 is a schematic diagram of a batch generation process of a two-dimensional code for garbage classification according to the present invention;
fig. 2 is a schematic diagram of a garbage classification two-dimensional code of the present invention, which includes a "recyclable" green background mark in the middle.
Detailed Description
As shown in fig. 1, a method for batch generation of two-dimensional codes for garbage classification includes the following steps:
(1) coding and transcoding
Firstly, identity information of a certain batch of garbage bags is coded, and the identity information comprises a uniform identity code of the certain batch of garbage bags and a batch identity code of a single garbage bag, so that a unique Chinese and English character type garbage bag identity code of the certain batch of single garbage bags is generated, and is expressed as 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+4Wherein M is1M2...MkIs a city region, Mk+1Mk+2...Mk+LTo a specific residential address, Mk+L+1Mk+L+ 2...Mk+L+pFor contacts and contact phones, Mk+L+p+1Mk+L+p+2...Mk+L+p+nFor coding time (in the form of year-month-day, wherein the last two bits Mk+L+p+n-1Mk+L+p+nAs date), Mk+L+p+n+1Mk+L+p+n+2Classifying color information for garbage (characterizing garbage classes), Mk+L+p+n+3Mk+L+p+n+4The garbage classification serial number information (serial number for representing a certain class of garbage bags on a certain day) is mutually separated by English blank spaces, and the corresponding garbage bags of a certain batch are unifiedThe share code is 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-2The batch identity code of the single garbage bag is Mk+L+p+n-1Mk+L+p+nMk+L+p+n+1Mk+L+p+n+ 2Mk+L+p+n+3Mk+L+p+n+4,
Then, extracting the identification code (M) from the uniform identification code of a certain batch of garbage bags1M2...MkMk+L+p+ 1Mk+L+p+2...Mk+L+p+n-2) And identity hiding code (M)k+1Mk+2...Mk+LMk+L+1Mk+L+2...Mk+L+p) And the identity code is subjected to character-by-character adoption of unicode2native () function to belong the value of ASCII code to 32,126]Converting the visible characters into single numerical data, or converting double-byte coded Chinese characters in GB2312 character set into two numerical data, thereby obtaining corresponding numerical sequenceSimultaneously, the identity hiding code adopts unicode2native () function to belong the ASCII code value to [32,126 ]]Is converted into single numerical data and recombined, denoted as Pi1,Pi2]=[0,unicode2native(Mi)]Or converting double-byte coded Chinese characters in GB2312 character set into two numerical data, which are expressed as [ P ]i1,Pi2]=unicode2native(Mi) So as to obtain the high-order numerical value sequence P1 ═ { P1 ═ P11,P12,…,P1L+p,P1L+p+1}={P11,P21,…,P(L+p)1,P(L+p+1)1And low order value sequence P2 ═ P21,P22,…,P2L+p,P2L+p+1}={P12,P22,…,P(L+p)2,P(L+p+1)2},
Finally, sequentially combining the elements S in the numerical sequence SiAdopt dec2bin (S) one by onei8) function conversionBinary sequence BS of 8bitsi1,BSi2,BSi3,BSi4,BSi5,BSi6,BSi7,BSi8H, dividing the element P1 in the numerical value sequence P1iAdopt dec2bin (P1) one by onei8) conversion of the function into a binary sequence of 8bits { BP1i1,BP1i2,BP1i3,BP1i4,BP1i5,BP1i6,BP1i7,BP1i8The element P2 in the numerical sequence P2iAdopt dec2bin (P2) one by onei8) conversion of the function into a binary sequence of 8bits { BP2i1,BP2i2,BP2i3,BP2i4,BP2i5,BP2i6,BP2i7,BP2i8},
And will beA binary sequence BSi1,BSi2,BSi3,BSi4,BSi5,BSi6,BSi7,BSi8Are combined, whereinResulting in a combined binary matrix B,
simultaneously combining L + p +1 binary sequences { BP1i1,BP1i2,BP1i3,BP1i4,BP1i5,BP1i6,BP1i7,BP1i8Combine, where i is 1, 2.., L + p +1, resulting in a high-order combined binary sequence B1 { 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+18And the L + p +1 binary sequences { BP 2}i1,BP2i2,BP2i3,BP2i4,BP2i5,BP2i6,BP2i7,BP2i8Combine, where i is 1, 2.., L + p +1, resulting in a low-bit combined binary sequence B2 { 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},
The garbage bag identity code comprises double-byte coded Chinese characters in a GB2312 character set and ASCLL code value E [32,126 ]]The length of the identity code of the garbage bag is k + L + p + n +6, and the length of the numerical sequence S isThe length of the numerical sequences P1, P2 is L + P +1, and the size of the combined binary matrix B isThe length of the combined binary sequences B1, B2 is 8L +8p + 8;
(2) identity hidden code unified encryption of certain batch of garbage bags
The identity hiding codes of a certain batch of garbage bags are uniformly encrypted to show that the identity identification codes (M) are utilized1M2…MkMk+L+p+ 1Mk+L+p+2...Mk+L+p+n-2) To identity hiding code (M)k+1Mk+2...Mk+LMk+L+1Mk+L+2...Mk+L+p) Encryption is carried out, and a certain batch of garbage bags need to be processed only onceThe identity hiding code is subjected to unified encryption operation,
firstly, an initial value x of Logistic chaotic mapping is respectively calculated and obtained by utilizing a numerical sequence S and a binary matrix B converted from the numerical sequence S, binary sequences B1 and B2 converted from the numerical sequences P1 and P2, and external keys alpha and beta according to the following formula1A sum parameter mu, an extraction start position m, and an extraction interval number n1、n2,
x1=α+mod(α+kp,1-α),
μ=β+mod(β+1.5×kp,4-β),
Wherein, B1,i,B2,i,B3,i,B4,i,B5,i,B6,i,B7,i,B8,iDenotes the ith column of the binary matrix B or the binary sequence BSi1,BSi2,BSi3,BSi4,BSi5,BSi6,BSi7,BSi8The number of binary bits '1',<B11,B12,...,B18L+8p+7,B18L+8p+8representing a binary sequence B11,B12,...,B18L+8p+7,B18L+8p+8The number of binary bits '1',<B21,B22,...,B28L+8p+7,B28L+8p+8>representing a binary sequence B21,B22,...,B28L+8p+7,B28L+8p+8The number of binary bits '1', the external key satisfies the relation of alpha e (0,1) and beta e (3.57,4),
initial value x mapped by chaos1And an external key mu, and iterating the Logistic chaotic mapping shown in the following formula, wherein k represents iteration times (k is 1,2, and.) and xk+1Represents the chaotic signal obtained by the k-th iteration,
xk+1=μ×xk×(1-xk)
obtaining a chaotic signal sequence X ═ X1,x2,., spaced by n from the m-th element in the sequence X1Taking 1 element as one element to form a chaotic signal sequence with the length of 8L +8p +8At the same time, the m-th element in the sequence X is sequentially spaced by n2Taking 1 element as one element to form a chaotic signal sequence Z with the length of 8L +8p +8 ═ Z1,Z2,...,Z8L+8p+7,Z8L+8p+8},
Then, the chaotic signal sequence Y is sorted in descending order, and the high-order combined binary sequence B1 is scrambled according to the position change scrambling rule before and after the chaotic signal sequence Y is sorted to obtain a scrambled high-order binary sequenceSimultaneously, the chaotic signal sequence Z is sorted in a descending order, and the low-order combined binary sequence B2 is scrambled according to the position change scrambling rule before and after the chaotic signal sequence Z is sorted to obtain a low-order binary sequence after scrambling
Next, let LB be mod (6-mod (8L +8p +8,6),6), and scramble the higher binary sequenceLB binary bits '0' are added at the end of the sequence, the lower binary sequence after scrambling is carried outLB binary bits '1' are added at the end of the sequence to obtain a binary sequence And binary sequence Wherein
For binary sequencesAndgrouping the binary sequences separatelyThe middle elements are sequentially and positively grouped by taking 6 elements as a unit from the beginning to the end to obtain a grouped binary sequence which is expressed asSimultaneously converting binary sequencesThe middle elements are sequentially and positively grouped by taking 6 elements as a unit from the beginning to the end to obtain a grouped binary sequence which is expressed asWherein each binary block sequence comprises 6 binary bits, an
Finally, each binary packet sequence BF1{ i }, BF2{ i }, in turn, is subjected to the following diffusion operation:
s0: let i equal to 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),
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),
s1: the binary packet sequences BF1{ i }, BF2{ i } are calculated according to the following formula,
CP1i=bin2dec(BF1{i})+176+k1_switch,
CP2i=bin2dec(BF2{i})+161+k2_switch,
s2: numerical data CP1 calculated from binary packet sequence BF1{ i }iAnd numerical data CP2 calculated from a binary packet sequence BF2{ i }iAnd k1_ switch mod is calculated (CP 1)i+2×CP2i+3×k1_switch,8)、k2_switch=mod(CP2i+2×CP1i+3 × k2_ switch,25), and let i equal i +1, then judge the size of i if it isGo to step S1, otherwise go to stepS3,
S3: finishing the diffusion operation of the binary grouping sequence to obtain diffused numerical value sequences CP1 and CP2, namely the encrypted information of the identity hidden codes of a certain garbage bag batch, which is represented as
(3) Batch generation of garbage classification numbers of certain batch of garbage bags
According to the different batch identity codes (code making date of each garbage classification code, garbage classification and garbage classification serial number information) of the single garbage bags in the batch of garbage bags, respectively executing a single garbage classification number generation step to realize the batch generation of the garbage classification numbers of the batch of garbage bags, wherein the garbage classification number generation step of the single garbage bags is described as follows,
firstly, extracting the code making date (M) of the garbage classification code from the identity code of the garbage bagk+L+p+n-1Mk+L+p+n) Garbage category (M)k+L+p+n+1Mk+L+p+n+2) Garbage classification serial number information (M)k+L+p+n+3Mk+L+p+n+4) Converting the code date into numerical data by using bin2dec () function one by one to obtain numerical sequence R ═ { R }1,R2Converting the garbage classification serial number information into numerical data by using a bin2dec () function one by one to obtain a numerical sequence F ═ F { (F })1,F2},
Then, respectively calculating to obtain initial values of Logistic chaotic mapping according to the following formulasAnd parameters of
Initial value mapped by chaosAnd an external keyIterating the Logistic chaotic mapping shown in the following formula, wherein k represents iteration times (k is 1, 2.) (k is equal to 1, 2.),Represents the chaotic signal obtained by the k-th iteration,
obtaining a chaotic signal sequenceSlave sequenceThe m-th element is sequentially spaced by n1Each element is 1 element to form a length ofOf the chaotic signal sequenceSimultaneous slave sequenceThe m-th element is sequentially spaced by n2Each element is 1 element to form a length ofOf the chaotic signal sequence
Next, the garbage classification (M) is usedk+L+p+n+1Mk+L+p+n+2) For encrypting the identity hidden code encryption information of a certain batch of garbage bags, the numerical value sequences CP1 and CP2 take the following operations,
if M isk+L+p+n+1Mk+L+p+n+2If it is 01, the chaotic signal sequence is appliedIn ascending order, according to chaotic signal sequenceThe position change scrambling rule before and after the ordering is used for scrambling the numerical value sequence CP1 to obtain a scrambled numerical value sequence Simultaneously converting the chaotic signal sequenceIn ascending order, according to chaotic signal sequenceThe position change scrambling rule before and after the ordering is used for scrambling the low-order combined binary sequence CP2 to obtain a scrambled numerical sequence
If M isk+L+p+n+1Mk+L+p+n+2When the signal sequence is '02', the chaotic signal sequence is processedIn ascending order, according to chaotic signal sequenceThe position change scrambling rule before and after the ordering is used for scrambling the numerical value sequence CP1 to obtain a scrambled numerical value sequence Simultaneously converting the chaotic signal sequenceIn descending order, according to chaotic signal sequenceThe position change scrambling rule before and after the ordering is used for scrambling the low-order combined binary sequence CP2 to obtain a scrambled numerical sequence
If M isk+L+p+n+1Mk+L+p+n+2When the signal sequence is 03, the chaotic signal sequence is firstly generatedRecombining to obtain a recombined chaotic signal sequence Then, the chaotic signal sequence is processedIn descending order, according to chaotic signal sequenceThe position change scrambling rule before and after the ordering is used for scrambling the numerical value sequence CP1 to obtain a scrambled numerical value sequence Simultaneously converting the chaotic signal sequenceIn ascending order, according to chaotic signal sequenceThe position change scrambling rule before and after the ordering is used for scrambling the low-order combined binary sequence CP2 to obtain a scrambled numerical sequence
If M isk+L+p+n+1Mk+L+p+n+2When the signal sequence is 04', the chaotic signal sequence is firstly generatedRecombining to obtain a recombined chaotic signal sequence Then, the chaotic signal sequence is processedIn descending order, according to chaotic signal sequenceThe position change scrambling rule before and after the ordering is used for scrambling the numerical value sequence CP1 to obtain a scrambled numerical value sequence Simultaneously firstly chaotic signal sequenceRecombining to obtain a recombined chaotic signal sequence Then, the chaotic signal sequence is processedIn descending order, according to chaotic signal sequenceThe position change scrambling rule before and after the ordering is used for scrambling the low-order combined binary sequence CP2 to obtain a scrambled numerical sequence
finally, the numerical value sequence isElement-by-element combination [ CP1 ]i,CP2i]Then converted into kanji characters, i.e. Ci=native2unicode([CP1i,CP2i]) To obtain the Chinese character sequenceI.e. the garbage classification number, wherein the length of the Chinese character sequence C is
Sequentially generating the garbage classification numbers of the garbage bags according to the generation process of the single garbage classification number in the garbage bags;
(4) garbage classification code combination and garbage classification two-dimensional code generation of certain batch of garbage bags
Identify the identity code (M) of the garbage bag1M2...MkMk+L+p+1Mk+L+p+2...Mk+L+p+n-2) Code making date (M)k+L+p+n- 1Mk+L+p+n) Garbage classification numberGarbage category (M)k+L+p+n+1Mk+L+p+n+2) Garbage classification serial number information (M)k+L+p+n+3Mk+L+p+n+4) The combination mode of inserting connection is adopted to generate a single garbage classification code in the garbage bags of the batch, which is expressed asWherein M is1M2...Mk、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+2And Mk+L+p+n+3Mk+L+p+n+4The English blank spaces are mutually used for spacing, a single garbage classification Code in the garbage bags is generated, then a QR Code, namely a garbage classification two-dimensional Code, is generated, and the garbage classification two-dimensional codes of the garbage bags can be generated in batch combination according to the rule.
The invention is further illustrated by the following specific examples:
example 1
The method for generating the garbage classification two-dimensional codes in batches comprises the following steps:
(1) coding and transcoding
The identity information of a certain batch of garbage bags is encoded, the identity information comprises a uniform identity code of a certain batch of garbage bags and a batch identity code of a single garbage bag, and a unique Chinese and English character type garbage bag identity code of the certain batch of garbage bags is generated, wherein the unique Chinese and English character type garbage bag identity code is ' Jiangsu province-Nantong city-south century city-12 # Li Xiaoqiang 150057099992020-08-020103 ', the length is k + L + p + n +9 ═ 11+13+14+10+9 ═ 57 ', wherein ' Jiangsu province-Nantong city-Chuan area ' is a province region, ' Zhongnan century city-12 #1201 ' is a specific living address (such as a district-house brand), ' 2020 strong Li Xiao 15005709999 ' is a contact and a contact telephone, ' 2020-08-02 ' is a code making time, ' 01 ' is garbage classification color information (such as green recyclable garbage classification sequence number information), ' 03 ' is garbage classification sequence number information, correspondingly, the unified identity code of a certain batch of garbage bags is 'Jiangsu province-Nantong City-Haimen region in the south century City-12 #1201 Li Xiaoqiang 150057099992020-08-', the batch identity code of a single garbage bag is '020103',
then, respectively extracting an identity code (2020-08-) and an identity hiding code (12 #1201 Li Xiao Qiang 15005709999) from the uniform identity codes of a certain batch of garbage bags, converting the identity code character by character into numerical data by using a unicode2native () function to obtain a 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,48,45,48,56,45}, and simultaneously converting the identity hiding code character by character into numerical data to obtain a corresponding high-digit numerical valueSequence 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 bit number 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 }, where the length of the number sequence S is equal to {208,207,192, 199,0,0,0,0,0, 0}, and low bit number sequence P2 ═ 208, 23 }, where the length of the number sequence S is equal to the length of the sequence SThe length of the numerical sequences P1, P2 is L + P + 1-13 +14+ 1-28,
finally, sequentially combining the elements S in the numerical sequence SiOne by one, converting the numerical value sequence P1 into a binary sequence of 8bits, and converting the numerical value sequence P1 into an element P1iOne by one, converting the numerical value sequence P2 into a binary sequence of 8bits, and converting the numerical value sequence P2 into an element P2iAre converted into binary sequences of 8bits one by one,
and 29 binary sequences BSi1,BSi2,BSi3,BSi4,BSi5,BSi6,BSi7,BSi8Are combined, resulting in a combined binary matrix B,
simultaneously combining 28 binary sequences { BP1i1,BP1i2,BP1i3,BP1i4,BP1i5,BP1i6,BP1i7,BP1i8Are combined to obtain a high-order combined binary sequence 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},
28 binary sequences { BP2i1,BP2i2,BP2i3,BP2i4,BP2i5,BP2i6,BP2i7,BP2i8Are combined to obtain a low-order combined binary sequence 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};
(2) Identity hidden code unified encryption of certain batch of garbage bags
The identity hiding codes of a certain batch of garbage bags are uniformly encrypted, which means that identity identification codes (China, south China, City, Haimen region 2020-08-) are used for encrypting the identity hiding codes (China, south China, 12#1201 LiXiaoqiang 15005709999), a certain batch of garbage bags need to be subjected to identity hiding code uniform encryption operation only once,
first, using the value sequence S and the binary matrix B converted from the value sequence S, the binary sequences B1 and B2 converted from the value sequences P1 and P2, and the external keys α -0.12345 and β -3.75, the initial value x of the Logistic chaotic map is calculated according to the following formula1A sum parameter mu, an extraction start position m, and an extraction interval number n1、n2,
x1=0.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,
m=987+mod(13295951060,67)=1037,
n1=1+mod(13295951060,57)=18,
n2=1+mod(13295951060,47)=36,
Initial value x mapped by chaos1And an external key mu, and iterating the Logistic chaotic mapping shown in the following formula, wherein k represents iteration times (k is 1,2, and.) and xk+1Represents the chaotic signal obtained by the k-th iteration,
xk+1=μ×xk×(1-xk)
obtaining a chaotic signal sequence X ═ X1,x2,., taking 1 element at intervals of 18 elements in sequence from the 1037 th element in the sequence X to form a chaotic signal sequence Y with the length of 224 ═ Y }1,Y2,...,Y223,Y224And simultaneously taking 1 element from the 1037 th element in the sequence X at intervals of 36 elements to form a chaotic signal sequence Z with the length of 224 (Z-Z)1,Z2,...,Z223,Z224},
Then, the chaotic signal sequence Y is sorted in descending order, and the high-order combined binary sequence B1 is scrambled according to the position change scrambling rule before and after the chaotic signal sequence Y is sorted to obtain a scrambled high-order binary sequence0,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, 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 1,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,0,1,0,0,0,0, 1,0,0,0,0,0,0, and the chaotic signal sequence Z is sorted in descending order, the chaotic signal sequence Z is sorted according to the position change scrambling rule before and after the chaotic signal sequence Z is sorted, the low-bit combination binary sequence B2 is scrambled to obtain the low-bit binary sequence B2 after scrambling
Next, let LB be mod (6-mod (224,6),6 be 4, and scramble the high binary sequenceAdds 4 binary bits '0' at the end of the sequence, and carries out scrambling on the lower binary sequenceAdds 4 binary bits '1' at the end of the sequence to obtain a binary sequence And binary sequence In which binary sequenceHas a length of
Will binary sequenceThe middle elements go forward in sequence from head to tail by taking 6 elements as a unitThe lines are grouped to obtain a binary sequence after grouping, BF1{1} - {1,1,0,0, 0}, BF1{2} - {0,0,0,0, 0}, …, BF1{19} - {0,1,0,0,0,0}, …, BF1{37} - {0,0,0,1,0,0, 0}, BF1{38} - {0,0,0,0,0,0}, and the binary sequence is simultaneously grouped, and the binary sequence is further grouped into a binary sequence, wherein BF1{1} - {0,1,0,0, 0}, and BF1{38} - { 0}, 0The middle elements are sequentially grouped in the forward direction from beginning to end by 6 elements to obtain a binary sequence after grouping, wherein BF2{1} {0,0,1,0,1,1}, BF2{2} {1,0,1,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}, and BF2{38}, wherein {38}, 1,1,1,1,1}, and so on,
finally, sequentially performing diffusion operation on each binary grouping sequence BF1{ i }, BF2{ i }, so as to obtain a diffused numerical value sequence, namely encryption information of identity hiding codes of a certain batch of garbage bags, wherein CP1 is {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} and CP2 is {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) batch generation of garbage classification numbers of certain batch of garbage bags
According to the different batch identity codes (code making date of each garbage classification code, garbage classification and garbage classification serial number information) of the single garbage bags in the batch of garbage bags, respectively executing a single garbage classification number generation step to realize the batch generation of the garbage classification numbers of the batch of garbage bags, wherein the garbage classification number generation step of the single garbage bags is described as follows,
firstly, extracting garbage classification code making date '02', garbage category '01' and garbage classification serial number information '03' from the garbage bag identity code, converting the code making date into numerical data by utilizing bin2dec () function one by one to obtain numerical value sequence R ═ 48,50}, converting the garbage classification serial number information into numerical value data by utilizing bin2dec () function one by one to obtain numerical value sequence F ═ 48,51},
Initial values mapped by chaosAnd an external keyIterating the Logistic chaotic mapping, wherein k represents iteration times (k is 1, 2.) (k is equal to 1, 2.)Represents the chaotic signal obtained by the k-th iteration,
obtaining a chaotic signal sequenceSlave sequenceThe 1037 th element in the sequence is sequentially spaced by 18 elements and takes 1 element to form a chaotic signal sequence with the length of 38Simultaneous slave sequenceThe 1037 th element is sequentially spaced by 36 elements from the beginning to take 1 element as a shapeInto a chaotic signal sequence of length 38
Then, according to the garbage category '01', the identity hidden code of a certain batch of garbage bags is encrypted, and the numerical value sequences CP1 and CP2 take the following operation that the chaotic signal sequence is processedIn ascending order, according to chaotic signal sequenceThe position change scrambling rule before and after the ordering is used for scrambling the numerical value sequence CP1 to obtain a scrambled numerical value sequence Simultaneously converting the chaotic signal sequenceIn ascending order, according to chaotic signal sequenceThe position change scrambling rule before and after the ordering is used for scrambling the low-order combined binary sequence CP2 to obtain a scrambled numerical sequence
Finally, the numerical value sequence isFirstly, element combination is carried out one by one and then the element combination is converted into Chinese character characters, a Chinese character sequence is obtained, namely the garbage classification number is a code marking squatting station ginseng, such as' quiet neck cut step pattern lake night neck color ancient covered wagon arc Fuyang elevation night table,
sequentially generating the garbage classification numbers of the garbage bags according to the generation process of the single garbage classification number in the garbage bags;
(4) garbage classification code combination and garbage classification two-dimensional code generation of certain batch of garbage bags
The method comprises the steps of generating a single garbage classification Code in a garbage bag as a Code of a Thyssal province, a Nantong city, a Haimen district 2020-08- ", a Code making date (02), a garbage classification Code (a static leftover neck and Cui tailored step, a tall oil jacket, a neck color ancient covered wagon, an isolated furo, a boil, a tail poking, a dry pooh, a short Baphich and Thalasi book and other Code squatting stations), a garbage classification (01) and garbage classification serial number information (03) in an inserting and connecting combination mode, generating a single garbage classification Code in the garbage bag as a Code of a Jiangsu province, a Nantong city, a static leftover neck and Cui tailored step, a tall oil jacket, a short pooh and Hosta book and other Code squatting stations 2020-08-020103", generating a single garbage classification Code in the garbage bag, then generating a Code of a Quick Response (QR) in the garbage bag, the garbage classification two-dimensional codes can be combined in batches according to the rule to generate the garbage classification two-dimensional codes of the garbage bags.
Example 2
According to the method for generating the two-dimensional codes for garbage classification in batches, the steps for generating the two-dimensional codes for garbage classification of a certain batch of garbage bags and the information of the external secret key, the code making date, the garbage category and the serial number of the garbage classification are similar to those in embodiment 1, and as for the identification code of the garbage bag ("Jiangsu province-Nantong city-Haiman district 2020-08-", or "Engineer province-Nantong city-Haiman district 2020-08-", or "Jiangsu province-Nantong city-Haiman district 2020-09-"), only the identity hidden code in the original identity information of the garbage bag ("Zhongnan century city-12 # Lixiaoqiang 15005709999") is slightly changed: "southern century city-12 #1201 Li Xiaoqiang 15005709999"; or "the city of the century of the middle and south china-12 #1211 Lixiaoqiang 1500570999"; or "city of the middle and south century-12 #1201 li xiao qiang 15005709998", the two-dimensional code generation result of garbage classification of a certain garbage bag is shown in table 1. As can be seen from the following table, the identity hidden code of a certain batch of single garbage bags changes slightly, which causes a great change in the two-dimensional code for garbage classification, and thus it can be seen that the batch generation method for the two-dimensional code for garbage classification provided by the patent has sensitivity to the hidden part (i.e., the identity hidden code for garbage bags) in the identity information of the garbage bags.
TABLE 1 micro-variation of hidden ID codes of garbage bags in a certain batch
Example 3
According to the method for generating the two-dimensional codes for garbage classification in batches, the steps for generating the two-dimensional codes for garbage classification of a certain batch of single garbage bags and the information of the identity hidden codes, the code making dates, the garbage categories and the garbage classification serial numbers of the garbage bags are similar to those in embodiment 1, and as for the identification codes of the garbage bags ("2020-08-" of Jiangsu province-Nantong city-Haiman district, or "2020-08-" of Engineer province-Nantong city-Haiman district, or "2020-08-" of Jiangsu province-Nantong city-Haiman district), only the external keys (alpha-0.12345 and beta-3.75) are slightly changed singly: 0.123450000000001; or β 3.750000000000001, the two-dimensional code of garbage classification of a certain single garbage bag is generated as shown in table 2. As can be seen from the following table: once the external key changes slightly, namely, the external key is lost in millicentimetres, the generated two-dimensional code for garbage classification can be within kilometres of difference, and therefore it can be seen that the method for generating the two-dimensional code for garbage classification in batches has the key sensitivity.
TABLE 2 Generation results of garbage classification two-dimensional codes when the external key is slightly changed
Example 4
According to the batch generation method of the garbage classification two-dimensional codes, the generation step of the garbage classification two-dimensional codes of a certain batch of single garbage bags, the identity identification codes of the garbage bags, the identity hidden codes of the garbage bags and the external secret keys are similar to those in embodiment 1, and the garbage classification color information of a certain batch of garbage bags is respectively '01', '02', '03', '04'; or the code making dates of a certain batch of garbage bags are respectively '02', '06', '12', '16', '22' and '26'; or the garbage classification serial number information of a certain batch of garbage bags is respectively "01", "02", "03", "04", "05" and "06", and the corresponding three-batch garbage classification two-dimensional code generation results are shown in table 3. The following table shows that the garbage classification color information, the code making date and the garbage classification serial number information of a certain batch of garbage bags are sequentially changed, so that the garbage classification two-dimensional codes of the certain batch of garbage bags can be generated in batches, and the garbage classification two-dimensional code batch generation method provided by the patent has sensitivity on the garbage classification color information, the code making date and the garbage classification serial number information in the garbage bag identity information.
TABLE 3 batch Generation of two-dimensional codes for garbage Classification
As can be seen from the analysis of the above specific embodiments 1-4, the garbage classification codes generated in batch by the garbage classification code batch generation method provided by the present invention are not only closely related to the external secret key, but also depend on the identity information of the garbage bags (the uniform identity code of a certain batch of garbage bags, the batch identity code of a single garbage bag), so that the garbage classification code batch generation method provided by the present invention has strong security, so as to ensure that the garbage classification codes generated in batch have "uniqueness", security, and garbage classification guidance ".
Although the present invention has been described with reference to a preferred embodiment, it should be understood that various changes, substitutions and alterations can be made herein without departing from the spirit and scope of the invention as defined by the appended claims.
Claims (8)
1. A garbage classification two-dimensional code batch generation method is characterized by comprising the following steps:
(1) coding and transcoding
Firstly, identity information of a certain batch of garbage bags is coded, and the identity information comprises a uniform identity code of the certain batch of garbage bags and a batch identity code of a single garbage bag, so that a unique Chinese and English character type garbage bag identity code of the certain batch of single garbage bags is generated, and is expressed as 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+4Wherein M is1M2...MkIs a city region, Mk+1Mk+2...Mk+LTo a specific residential address, Mk+L+1Mk+L+ 2...Mk+L+pFor contacts and contact phones, Mk+L+p+1Mk+L+p+2...Mk+L+p+nFor coding time (in the form of year-month-day, wherein the last two bits Mk+L+p+n-1Mk+L+p+nAs date), Mk+L+p+n+1Mk+L+p+n+2Classifying color information for garbage (characterizing garbage classes), Mk+L+p+n+3Mk+L+p+n+4The garbage classification serial number information (serial number representing a certain class of garbage bags on a certain day) is mutually spaced by English blank spaces, and the unified identity code of a corresponding garbage bag batch is 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-2The batch identity code of the corresponding single garbage bag is Mk+L+p+n-1Mk+L+p+nMk+L+p+n+ 1Mk+L+p+n+2Mk+L+p+n+3Mk+L+p+n+4,
Then, extracting the identification code (M) from the uniform identification code of a certain batch of garbage bags1M2...MkMk+L+p+1Mk+L+p+ 2...Mk+L+p+n-2) And identity hiding code (M)k+1Mk+2...Mk+LMk+L+1Mk+L+2...Mk+L+p) And converting the ID code into numerical data one by one to obtain corresponding numerical sequenceSimultaneously converting the identity hiding code into numerical data P one by onei1,Pi2]Obtaining a high-order numerical value sequence P1 ═ { P1 ═ P11,P12,...,P1L+p,P1L+p+1}={P11,P21,...,P(L+p)1,P(L+p+1)1And low order value sequence P2 ═ P21,P22,...,P2L+p,P2L+p+1}={P12,P22,...,P(L+p)2,P(L+p+1)2},
Finally, sequentially combining the elements S in the numerical sequence SiOne by one conversion into a binary sequence of 8bits BSi1,BSi2,BSi3,BSi4,BSi5,BSi6,BSi7,BSi8The element P1 in the numerical sequence P1iOne by one into a binary sequence of 8bits BP1i1,BP1i2,BP1i3,BP1i4,BP1i5,BP1i6,BP1i7,BP1i8The element P2 in the numerical sequence P2iOne by one into a binary sequence of 8bits BP2i1,BP2i2,BP2i3,BP2i4,BP2i5,BP2i6,BP2i7,BP2i8},
And will beA binary sequence BSi1,BSi2,BSi3,BSi4,BSi5,BSi6,BSi7,BSi8In combination, where i is 1, 2.,resulting in a combined binary matrix B,
simultaneously combining L + p +1 binary sequences { BP1i1,BP1i2,BP1i3,BP1i4,BP1i5,BP1i6,BP1i7,BP1i8Combine, where i is 1, 2.., L + p +1, resulting in a high-order combined binary sequence B1 { 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+18And the L + p +1 binary sequences { BP 2}i1,BP2i2,BP2i3,BP2i4,BP2i5,BP2i6,BP2i7,BP2i8Combine, where i is 1, 2.., L + p +1, resulting in a low-bit combined binary sequence B2 { 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},
The garbage bag identity code comprises double-byte coded Chinese characters in a GB2312 character set and ASCLL code value E [32,126 ]]The length of the identity code of the garbage bag is k + L + p + n +6, and the length of the numerical sequence S is The length of the numerical sequences P1, P2 is L + P +1, and the size of the combined binary matrix B isThe length of the combined binary sequences B1, B2 is 8L +8p + 8;
(2) identity hidden code unified encryption of certain batch of garbage bags
The identity hiding codes of a certain batch of garbage bags are uniformly encrypted to show that the identity identification codes (M) are utilized1M2...MkMk+L+p+1Mk+L+p+ 2...Mk+L+p+n-2) To identity hidden code (M)k+1Mk+2...Mk+LMk+L+1Mk+L+2...Mk+L+p) The encryption is carried out, a certain batch of garbage bags need to be subjected to the identity hiding code unified encryption operation only once,
firstly, an initial value x of the Logistic chaotic map is respectively calculated and obtained according to the following formulas (1) - (5) by utilizing a numerical sequence S and a binary matrix B converted from the numerical sequence S, binary sequences B1 and B2 converted from the numerical sequences P1 and P2, and external keys alpha and beta1A sum parameter mu, an extraction start position m, and an extraction interval number n1、n2,
x1=α+mod(α+kp,1-α), (1)
μ=β+mod(β+1.5×kp,4-β), (2)
Wherein,<B1,i,B2,i,B3,i,B4,i,B5,i,B6,i,B7,i,B8,i>representing the ith column or binary sequence BS of the binary matrix Bi1,BSi2,BSi3,BSi4,BSi5,BSi6,BSi7,BSi8The number of binary bits '1',<B11,B12,...,B18L+8p+7,B18L+8p+8>representing a binary sequence B11,B12,...,B18L+8p+7,B18L+8p+8The number of binary bits '1',<B21,B22,...,B28L+8p+7,B28L+8p+8>representing a binary sequence B21,B22,...,B28L+8p+7,B28L+8p+8The number of binary bits '1' in the key, the external key satisfies a e (0,1), ss e (3.57,4),
initial value x mapped by chaos1And an external key mu, iterating the Logistic chaotic mapping shown in the following formula (6), wherein k represents iteration times (k is 1, 2), xk+1Represents the chaotic signal obtained by the k-th iteration,
xk+1=μ×xk×(1-xk) (6)
obtaining a chaotic signal sequence X ═ X1,x2,., spaced by n from the m-th element in the sequence X1Taking 1 element as one element to form a chaotic signal sequence with the length of 8L +8p +8At the same time, the m-th element in the sequence X is sequentially spaced by n2Taking 1 element from each element to form a length of 8L +8p+8 chaotic signal sequence Z ═ { Z ═ Z1,Z2,...,Z8L+8p+7,Z8L+8p+8},
Then, the chaotic signal sequence Y is sorted in descending order, and the high-order combined binary sequence B1 is scrambled according to the position change scrambling rule before and after the chaotic signal sequence Y is sorted to obtain a scrambled high-order binary sequenceSimultaneously, the chaotic signal sequence Z is sorted in a descending order, and the low-order combined binary sequence B2 is scrambled according to the position change scrambling rule before and after the chaotic signal sequence Z is sorted to obtain a low-order binary sequence after scrambling
Then, let LB be mod (6-mod (8L +8p +8,6),6), and scramble the higher binary sequenceLB binary bits '0' are added at the end of the sequence, the lower binary sequence after scrambling is carried outLB binary bits '1' are added at the end of the sequence to obtain a binary sequence And binary sequence Wherein
For binary sequencesAndgrouping the binary sequences separatelyThe middle elements are sequentially grouped by taking 6 elements as a unit in the forward direction from beginning to end to obtain a grouped binary sequence which is expressed as BF1{1}, BF1{2},.Simultaneously converting binary sequencesThe middle elements are sequentially grouped by taking 6 elements as a unit in the forward direction from beginning to end to obtain a grouped binary sequence which is expressed as BF2{1}, BF2{2},.Wherein each binary block sequence comprises 6 binary bits, an
Finally, each binary packet sequence BF1{ i }, BF2{ i }, in turn, is subjected to the following diffusion operation:
s0: let i equal to 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),
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),
s1: the binary packet sequences BF1{ i }, BF2{ i } are calculated according to the following formulas (7), (8),
CP1i=bin2dec(BF1{i})+176+k1_switch, (7)
CP2i=bin2dec(BF2{i})+161+k2_switch, (8)
s2: numerical data CP1 calculated from binary packet sequence BF1{ i }iAnd numerical data CP2 calculated from a binary packet sequence BF2{ i }iAnd k1_ switch mod is calculated (CP 1)i+2×CP2i+3×k1_switch,8)、k2_switch=mod(CP2i+2×CP1i+3 × k2_ switch,25), and let i equal i +1, then judge the size of i if it isThe process proceeds to step S1, otherwise, to step S3,
s3: finishing the diffusion operation of the binary grouping sequence to obtain diffused numerical value sequences CP1 and CP2, namely the encrypted information of the identity hidden codes of a certain garbage bag batch, which is represented as
(3) Batch generation of garbage classification numbers of certain batch of garbage bags
According to the different batch identity codes (code making date of each garbage classification code, garbage classification and garbage classification serial number information) of the single garbage bags in the batch of garbage bags, respectively executing a single garbage classification number generation step to realize the batch generation of the garbage classification numbers of the batch of garbage bags, wherein the garbage classification number generation step of the single garbage bags is described as follows,
firstly, extracting the code making date (M) of the garbage classification code from the identity code of the garbage bagk+L+p+n-1Mk+L+p+n) Garbage category (M)k+L+p+n+1Mk+L+p+n+2) Garbage classification serial number information (M)k+L+p+n+3Mk+L+p+n+4) Converting the coding date into numerical data by using bin2dec () function one by one to obtain numerical sequence R ═ { R }1,R2Converting the garbage classification serial number information into numerical data by using a bin2dec () function one by one to obtain a numerical sequence F ═ F { (F })1,F2},
Then, respectively calculating according to the following formulas (9) and (10) to obtain initial values of Logistic chaotic mappingAnd parameters
Initial values mapped by chaosAnd an external keyIterating a Logistic chaotic mapping shown in a formula (11), wherein k represents iteration times (k is 1, 2.),represents the chaotic signal obtained by the k-th iteration,
obtaining a chaotic signal sequenceSlave sequenceThe m-th element is sequentially spaced by n1Each element is 1 element to form a length ofOf the chaotic signal sequenceSimultaneous slave sequenceThe m-th element is sequentially spaced by n2Each element is 1 element to form a length ofOf the chaotic signal sequence
Next, the garbage classification (M) is usedk+L+p+n+1Mk+L+p+n+2) For encrypting the identity hidden code encryption information of a certain batch of garbage bags, the numerical value sequences CP1 and CP2 take the following operations,
if M isk+L+p+n+1Mk+L+p+n+2If it is 01, the chaotic signal sequence is appliedIn ascending order, according to chaotic signal sequenceThe position change scrambling rule before and after the ordering is used for scrambling the numerical value sequence CP1 to obtain a scrambled numerical value sequence Simultaneously converting the chaotic signal sequenceIn ascending order, according to chaotic signal sequenceThe position change scrambling rule before and after the ordering is used for scrambling the low-order combined binary sequence CP2 to obtain a scrambled numerical sequence
If M isk+L+p+n+1Mk+L+p+n+2When the signal sequence is '02', the chaotic signal sequence is processedIn ascending order, according to chaotic signal sequenceThe position change scrambling rule before and after the sequencing is used for scrambling the numerical value sequence CP1 to obtain a scrambled numerical value sequence Simultaneously converting the chaotic signal sequenceIn descending order, according to chaotic signal sequenceThe position change scrambling rule before and after the ordering is used for scrambling the low-order combined binary sequence CP2 to obtain a scrambled numerical sequence
If M isk+L+p+n+1Mk+L+p+n+2When the signal sequence is 03, the chaotic signal sequence is firstly generatedRecombining to obtain a recombined chaotic signal sequence Then, the chaotic signal sequence is processedIn descending order, according to chaotic signal sequenceThe position change scrambling rule before and after the ordering is used for scrambling the numerical value sequence CP1 to obtain a scrambled numerical value sequence Simultaneously converting the chaotic signal sequenceIn ascending order, according to chaotic signal sequenceThe position change scrambling rule before and after the ordering is used for scrambling the low-order combined binary sequence CP2 to obtain a scrambled numerical sequence
If M isk+L+p+n+1Mk+L+p+n+2When the signal sequence is 04', the chaotic signal sequence is firstly generatedRecombining to obtain a recombined chaotic signal sequence Then, the chaotic signal sequence is processedIn descending order, according to chaotic signal sequenceThe position change scrambling rule before and after the ordering is used for scrambling the numerical value sequence CP1 to obtain a scrambled numerical value sequence Simultaneously firstly chaotic signal sequenceRecombining to obtain a recombined chaotic signal sequence Then, the chaotic signal sequence is processedIn descending order, according to chaotic signal sequenceThe position change scrambling rule before and after the ordering is used for scrambling the low-order combined binary sequence CP2 to obtain a scrambled numerical sequence
finally, the numerical value sequence isElement-by-element combination and conversion into Chinese character to obtain Chinese character sequenceI.e. the garbage classification number, wherein the length of the Chinese character sequence C is
Sequentially generating the garbage classification numbers of the garbage bags according to the generation process of the single garbage classification number in the garbage bags;
(4) garbage classification code combination and garbage classification two-dimensional code generation of certain batch of garbage bags
Identify the identity code (M) of the garbage bag1M2...MkMk+L+p+1Mk+L+p+2...Mk+L+p+n-2) Code making date (M)k+L+p+n- 1Mk+L+p+n) Garbage classification numberGarbage category (M)k+L+p+n+1Mk+L+p+n+2) Garbage classification serial number information (M)k+L+p+n+3Mk+L+p+n+4) And combining to generate a single garbage classification Code in the garbage bags, then generating a QR Code, namely a garbage classification two-dimensional Code, and combining in batches to generate the garbage classification two-dimensional codes of the garbage bags according to the rule.
2. The garbage classification two-dimensional code batch generation method according to claim 1, characterized in that: the step (1) of converting the ID codes into numerical data one by one means that the ID codes belong to the ASCII code value [32,126 ] by adopting a unicode2native () function one by one]Converting the visible characters into single numerical data, or converting double-byte coded Chinese characters in GB2312 character set into two numerical data, thereby obtaining corresponding numerical sequence
3. The garbage classification two-dimensional code batch generation method according to claim 1, characterized in that: converting the identity hidden code into numerical data [ P ] one by one in the step (1)i1,Pi2]The method is to adopt unicode2native () function to belong the ASCII code value to [32,126 ]]Is converted into single numerical data and recombined, denoted as Pi1,Pi2]=[0,unicode2native(Mi)]Or converting double-byte coded Chinese characters in GB2312 character set into two numerical data, which are expressed as [ P ]i1,Pi2]=unicode2native(Mi) So as to obtain the high-order numerical value sequence P1 ═ { P1 ═ P11,P12,...,P1L+p,P1L+p+1}={P11,P21,...,P(L+p)1,P(L+p+1)1And low order value sequence P2 ═ P21,P22,...,P2L+p,P2L+p+1}={P12,P22,...,P(L+p)2,P(L+p+1)2}。
4. The garbage classification two-dimensional code batch generation method according to claim 1, characterized in that: the step (1) of converting the element S in the numerical sequence SiOne by one conversion into a binary sequence of 8bits BSi1,BSi2,BSi3,BSi4,BSi5,BSi6,BSi7,BSi8Means that dec2bin (S) is usedi8) the function yields a binary sequence BSi1,BSi2,BSi3,BSi4,BSi5,BSi6,BSi7,BSi8}。
5. The garbage classification two-dimensional code batch generation method according to claim 1, characterized in that: the element P1 in the numerical value sequence P1 described in the step (1)iOne by one into a binary sequence of 8bits BP1i1,BP1i2,BP1i3,BP1i4,BP1i5,BP1i6,BP1i7,BP1i8Means that dec2bin (P1) is usedi8) the function yields a binary sequence { BP1i1,BP1i2,BP1i3,BP1i4,BP1i5,BP1i6,BP1i7,BP1i8}。
6. The garbage classification two-dimensional code batch generation method according to claim 1, characterized in that: the element P2 in the numerical value sequence P2 described in the step (1)iOne by one into a binary sequence of 8bits BP2i1,BP2i2,BP2i3,BP2i4,BP2i5,BP2i6,BP2i7,BP2i8Means that dec2bin (P2) is usedi8) the function yields a binary sequence { BP2i1,BP2i2,BP2i3,BP2i4,BP2i5,BP2i6,BP2i7,BP2i8}。
7. The garbage classification two-dimensional code batch generation method according to claim 1, characterized in that: sequencing the values as described in step (3)Element-by-element combination and conversion to Chinese characters means that element-by-element combination is firstly carried out [ CP1 ]i,CP2i]Then converted into kanji characters, i.e. Ci=native2unicode([CP1i,CP2i])。
8. The garbage classification two-dimensional code batch generation method according to claim 1, characterized in that: the identification code (M) of the identity of the garbage bag in the step (4)1M2...MkMk+L+p+1Mk+L+p+2...Mk+L+p+n-2) Code making date (M)k+L+p+n- 1Mk+L+p+n) Garbage classification numberGarbage category (M)k+L+p+n+1Mk+L+p+n+2) Garbage classification serial number information (M)k+L+p+n+3Mk+L+p+n+4) Combining to generate a single garbage classification code in the garbage bag, namely generating the single garbage classification code in the garbage bag by inserting and connecting the information of the garbage bag identity identification code, the code making date, the garbage classification number, the garbage category and the garbage classification serial number, which is expressed as M1M2...Mk 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+4Wherein M is1M2...Mk、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+2And Mk+L+p+n+3Mk+L+p+n+4The English spaces are mutually spaced.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011038759.0A CN112183697B (en) | 2020-09-28 | 2020-09-28 | Garbage classification two-dimensional code batch generation method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011038759.0A CN112183697B (en) | 2020-09-28 | 2020-09-28 | Garbage classification two-dimensional code batch generation method |
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 | Garbage classification two-dimensional code batch generation method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112183697B (en) |
Citations (5)
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 kind of Mass production method of commodity anti-counterfeit two-dimensional bar 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)
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 |
-
2020
- 2020-09-28 CN CN202011038759.0A patent/CN112183697B/en active Active
Patent Citations (5)
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 kind of Mass production method of commodity anti-counterfeit two-dimensional bar 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)
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 | |
CN109472338B (en) | Batch generation method of commodity anti-counterfeiting two-dimensional codes | |
CN109284803B (en) | Commodity anti-counterfeiting two-dimensional code generation method | |
CN100369039C (en) | Method for protecting data base data copyright by digital watermark technology and application thereof | |
CN112001468B (en) | Character type commodity anti-counterfeiting code generation and identification method | |
CN112001467B (en) | Commodity anti-counterfeiting code generation and identification method based on picture encryption and decryption | |
CN109977371B (en) | Method for generating character type garbage classification code | |
CN106570355A (en) | Encrypted information stamp and encryption method of the same | |
CN111382820B (en) | Four-lattice pure-color commodity anti-counterfeiting code generation method | |
CN112183697B (en) | Garbage classification two-dimensional code batch generation method | |
CN113052286A (en) | Commodity anti-counterfeiting two-dimensional code generation method based on scrambling encryption | |
CN112183698B (en) | Chinese character garbage classification two-dimensional code generation method | |
CN105528345A (en) | Terminal, server and character complementing method | |
CN114465709A (en) | Character string decryption method based on hierarchical shift | |
CN104376307A (en) | Fingerprint image information coding method | |
CN115358362A (en) | Garbage classification two-dimensional code generation method based on chaotic encryption | |
CN113849783A (en) | Structured data label watermark tracing method based on state encryption | |
CN115358361A (en) | Garbage classification code generation method based on combined encryption | |
CN106485305A (en) | A kind of implementation method of color 2 D code | |
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 | |
CN112260822B (en) | Structured digital watermark encryption method and device | |
CN113935343B (en) | Commodity anti-counterfeiting code generation method based on character string-to-picture encryption |
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 |