CN112183697A - Garbage classification two-dimensional code batch generation method - Google Patents
Garbage classification two-dimensional code batch generation method Download PDFInfo
- Publication number
- CN112183697A CN112183697A CN202011038759.0A CN202011038759A CN112183697A CN 112183697 A CN112183697 A CN 112183697A CN 202011038759 A CN202011038759 A CN 202011038759A CN 112183697 A CN112183697 A CN 112183697A
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 46
- 230000000739 chaotic effect Effects 0.000 claims abstract description 141
- 108010076504 Protein Sorting Signals Proteins 0.000 claims abstract description 77
- 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 13
- 102100020871 Forkhead box protein G1 Human genes 0.000 claims description 43
- 230000008859 change Effects 0.000 claims description 34
- 101710087964 Forkhead box protein G1 Proteins 0.000 claims description 21
- 230000001174 ascending effect Effects 0.000 claims description 14
- 230000008569 process Effects 0.000 claims description 10
- 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
- 229940060587 alpha e Drugs 0.000 claims description 3
- 238000012163 sequencing technique Methods 0.000 claims 1
- 230000035945 sensitivity Effects 0.000 description 3
- 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
- ALYNCZNDIQEVRV-UHFFFAOYSA-N 4-aminobenzoic acid Chemical compound NC1=CC=C(C(O)=O)C=C1 ALYNCZNDIQEVRV-UHFFFAOYSA-N 0.000 description 1
- 241000208340 Araliaceae Species 0.000 description 1
- 206010017577 Gait disturbance Diseases 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
- 238000010586 diagram Methods 0.000 description 1
- 230000007613 environmental effect Effects 0.000 description 1
- 235000008434 ginseng Nutrition 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+4Is garbage classification serial number information (serial number representing certain class of garbage bags on a certain day) mutually using English spaceThe uniform identity code of a certain batch of garbage bags at intervals of a grid 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 conversion 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, 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) 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 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 formulas (1) to (5)1A 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' in the key, the external key satisfies the alpha e(0,1)、β∈(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 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 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 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) Information and numerical value sequence are encrypted for identity hidden codes of a certain batch of garbage bagsThe columns CP1, CP2 take the following actions,
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 sorting is used for scrambling the numerical value sequence CP1 to obtainTo the scrambled numerical 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]Means to hide the identityBelonging the value of ASCII code to [32,126 ] by using unicode2native () function]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 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])。
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 view of the two-dimensional code for garbage classification of the present invention, which contains 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 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 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 is performedRecombination, represented by [ 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) binary sequence BS of function conversion to 8bitsi1,BSi2,BSi3,BSi4,BSi5,BSi6,BSi7,BSi8The element P1 in the numerical 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) 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 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 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 to obtain initial values of Logistic chaotic mapping according to the following formulasAnd parameters
Initial values 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 sequencePosition before and after sortingThe scrambling rule is changed, the low-order combination binary sequence CP2 is scrambled, and the scrambled numerical value sequence is obtained
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 identification code (2020-08-) and an identity hiding code (12 #1201 li dao qiang 15005709999 in south china, Jiangsu province) from the unified identity codes of a certain group of garbage bags, and converting the identity identification codes into numerical data character 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 codes into numerical data character by character to obtain a corresponding high-digit sequence P1 ═ 214,196,202,188,179,0,0,0,0,0,0,0,0, 199, 192,207,199,0,0,0,0,0, 254, 0,0,0,0, 53, 49,53, 49, 48,49, 48,49, 48,57,57,57,57}, wherein the sequence of values S has a length ofThe 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,00,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,1,0, 0,0,0,0,0,0,0,0,0,0,0,1,0,1,0, 1,0,0,0,0,0,0,0,0,0,0,0,0,0, and scrambling the low-order binary sequence B2 according to the position change scrambling rule before and after the chaos signal sequence Z is sequenced to obtain a scrambled low-order binary sequence.
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 are sequentially grouped by 6 elements in the forward direction from head to tail to obtain a binary sequence after grouping, wherein BF1{1} {1,1,0,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}, and BF1{38} {0,0,0, 0}, and the binary sequence is simultaneously grouped in the forward direction, and the binary sequence is also divided into {0,0,0,0,0,0}The 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, 1,1}, BF2{38} {1,1,1, 1}, and BF2{38}, wherein the binary sequence is obtained by grouping in the forward direction from beginning to end by 6 elements to obtain a binary sequence after grouping.
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 in the sequence is separated by 36 elements to take 1 element to form a chaotic signal sequence with the length of 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,
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 Furud, a papai, a pooh, a short pah and Toba 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 Haimen district static leftover neck and Cui tailored step, a tall oil jacket, a short paba 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 QR classification, 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 which 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 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 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 formulas (1) to (5)1A 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', 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 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 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}, BF1{ i },.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}, BF2{ i },.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 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 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 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. According toThe garbage classification two-dimensional code batch generation method of 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 true CN112183697A (en) | 2021-01-05 |
CN112183697B 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 (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050036479A1 (en) * | 2003-06-18 | 2005-02-17 | Samsung Electronics Co., Ltd. | Method and apparatus for generating preamble using chaotic sequence |
CN104680220A (en) * | 2015-03-24 | 2015-06-03 | 南通大学 | Commodity anti-counterfeiting code batch generation method |
US20160234009A1 (en) * | 2015-02-08 | 2016-08-11 | Wenhua Li | Chaotic Baseband Modulation Hopping Based Post-Quantum Physical-Layer Encryption |
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 |
-
2020
- 2020-09-28 CN CN202011038759.0A patent/CN112183697B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050036479A1 (en) * | 2003-06-18 | 2005-02-17 | Samsung Electronics Co., Ltd. | 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 |
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 |
---|
盛苏英等: "混沌数码防伪技术研究与应用", 《微电子学与计算机》 * |
Also Published As
Publication number | Publication date |
---|---|
CN112183697B (en) | 2022-05-03 |
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 | |
CN109472338B (en) | Batch generation method of commodity anti-counterfeiting two-dimensional codes | |
CN109284803B (en) | Commodity anti-counterfeiting two-dimensional code generation method | |
CN109933755B (en) | Method for generating garbage classification code | |
CN112884104B (en) | Commodity anti-counterfeiting two-dimensional code generation method based on chaotic encryption | |
CN100447812C (en) | Document data waterprint embedded method | |
CN112001468B (en) | Character type commodity anti-counterfeiting code generation and identification method | |
CN109977371B (en) | Method for generating character type garbage classification code | |
CN111382820B (en) | Four-lattice pure-color commodity anti-counterfeiting code generation method | |
CN101639828B (en) | Method for hiding and extracting watermark based on XML electronic document | |
CN113052286A (en) | Commodity anti-counterfeiting two-dimensional code generation method based on scrambling encryption | |
CN112183697B (en) | Garbage classification two-dimensional code batch generation method | |
CN105528345A (en) | Terminal, server and character complementing method | |
CN112183698B (en) | Chinese character garbage classification two-dimensional code generation method | |
CN104376307A (en) | Fingerprint image information coding method | |
CN114465709A (en) | Character string decryption method based on hierarchical shift | |
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 | |
CN109981246A (en) | A kind of encryption method and decryption method of character string | |
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 | |
CN115358361A (en) | Garbage classification code generation method based on combined encryption | |
CN114741712A (en) | Chinese character encryption method based on hierarchical scrambling | |
CN114881189A (en) | Garbage classification two-dimensional code generation method based on different combination modes |
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 |