CN112183697B - Garbage classification two-dimensional code batch generation method - Google Patents

Garbage classification two-dimensional code batch generation method Download PDF

Info

Publication number
CN112183697B
CN112183697B CN202011038759.0A CN202011038759A CN112183697B CN 112183697 B CN112183697 B CN 112183697B CN 202011038759 A CN202011038759 A CN 202011038759A CN 112183697 B CN112183697 B CN 112183697B
Authority
CN
China
Prior art keywords
sequence
garbage
code
binary
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
Application number
CN202011038759.0A
Other languages
Chinese (zh)
Other versions
CN112183697A (en
Inventor
盛苏英
张小美
陆国平
张振娟
高岩波
周磊
任洁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nantong University
Original Assignee
Nantong University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nantong University filed Critical Nantong University
Priority to CN202011038759.0A priority Critical patent/CN112183697B/en
Publication of CN112183697A publication Critical patent/CN112183697A/en
Application granted granted Critical
Publication of CN112183697B publication Critical patent/CN112183697B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K19/00Record carriers for use with machines and with at least a part designed to carry digital markings
    • G06K19/06Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
    • G06K19/06009Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking
    • G06K19/06037Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking multi-dimensional coding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/001Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using chaotic signals

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • 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

Garbage classification two-dimensional code batch generation method
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 sequence
Figure BDA0002705937450000021
Simultaneously 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 be
Figure BDA0002705937450000022
A binary sequence BSi1,BSi2,BSi3,BSi4,BSi5,BSi6,BSi7,BSi8Are combined, wherein
Figure BDA0002705937450000023
Resulting in a combined binary matrix B,
Figure BDA0002705937450000024
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 is
Figure BDA0002705937450000031
The length of the numerical sequences P1, P2 is L + P +1, the binary moments are combinedThe size of matrix B is
Figure BDA0002705937450000032
The 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
Order to
Figure BDA0002705937450000033
Figure BDA0002705937450000034
Figure BDA0002705937450000035
Then
x1=α+mod(α+kp, 1-α), (1)
μ=β+mod(β+1.5×kp, 4-β), (2)
Figure BDA0002705937450000036
Figure BDA0002705937450000037
Figure BDA0002705937450000038
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 +8
Figure BDA0002705937450000041
At 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 sequence
Figure BDA0002705937450000042
Simultaneously, 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
Figure BDA0002705937450000043
Next, let LB be mod (6-mod (8L +8p +8,6),6), and scramble the higher binary sequence
Figure BDA0002705937450000044
LB binary bits '0' are added at the end of the sequence, the lower binary sequence after scrambling is carried out
Figure BDA0002705937450000045
LB binary bits '1' are added at the end of the sequence to obtain a binary sequence
Figure BDA0002705937450000046
Figure BDA0002705937450000047
And binary sequence
Figure BDA0002705937450000048
Figure BDA0002705937450000049
Wherein
Figure BDA00027059374500000410
For binary sequences
Figure BDA00027059374500000411
And
Figure BDA00027059374500000412
grouping the binary sequences separately
Figure BDA00027059374500000413
The 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 as
Figure BDA00027059374500000414
Simultaneously converting binary sequences
Figure BDA00027059374500000415
The 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 as
Figure BDA00027059374500000416
Wherein each binary block sequence comprises 6 binary bits, an
Figure BDA00027059374500000417
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 is
Figure BDA0002705937450000051
The 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
Figure BDA0002705937450000052
(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 mapping
Figure BDA0002705937450000053
And parameters
Figure BDA0002705937450000054
Order to
Figure BDA0002705937450000055
Then
Figure BDA0002705937450000056
Figure BDA0002705937450000057
Initial values mapped by chaos
Figure BDA0002705937450000058
And an external key
Figure BDA0002705937450000059
Iterating a Logistic chaotic mapping shown in a formula (11), wherein k represents iteration times (k is 1, 2.),
Figure BDA00027059374500000510
represents the chaotic signal obtained by the k-th iteration,
Figure BDA00027059374500000511
obtaining a chaotic signal sequence
Figure BDA00027059374500000512
Slave sequence
Figure BDA00027059374500000513
The m-th element is sequentially spaced by n1Each element is 1 element to form a length of
Figure BDA00027059374500000514
Chaotic signal sequence of (1)
Figure BDA00027059374500000515
Simultaneous slave sequence
Figure BDA00027059374500000516
The m-th element is sequentially spaced by n2Each element is 1 element to form a length of
Figure BDA00027059374500000517
Of the chaotic signal sequence
Figure BDA00027059374500000518
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 applied
Figure BDA00027059374500000519
In ascending order, according to chaotic signal sequence
Figure BDA00027059374500000520
The 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
Figure BDA0002705937450000061
Figure BDA0002705937450000062
Simultaneously converting the chaotic signal sequence
Figure BDA0002705937450000063
In ascending order, according to chaotic signal sequence
Figure BDA0002705937450000064
The 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
Figure BDA0002705937450000065
Figure BDA0002705937450000066
If M isk+L+p+n+1Mk+L+p+n+2When the signal sequence is '02', the chaotic signal sequence is processed
Figure BDA0002705937450000067
In ascending order, according to chaotic signal sequence
Figure BDA0002705937450000068
The 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
Figure BDA0002705937450000069
Figure BDA00027059374500000610
Simultaneously converting the chaotic signal sequence
Figure BDA00027059374500000611
In descending order, according to chaotic signal sequence
Figure BDA00027059374500000612
The 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
Figure BDA00027059374500000613
Figure BDA00027059374500000614
If M isk+L+p+n+1Mk+L+p+n+2When the signal sequence is 03, the chaotic signal sequence is firstly generated
Figure BDA00027059374500000615
Recombining to obtain a recombined chaotic signal sequence
Figure BDA00027059374500000616
Figure BDA00027059374500000617
Then, the chaotic signal sequence is processed
Figure BDA00027059374500000618
In descending order, according to chaotic signal sequence
Figure BDA00027059374500000619
The 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
Figure BDA00027059374500000620
Figure BDA00027059374500000621
Simultaneously converting the chaotic signal sequence
Figure BDA00027059374500000622
In ascending order, according to chaotic signal sequence
Figure BDA00027059374500000623
The 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
Figure BDA00027059374500000624
Figure BDA00027059374500000625
If it is not
Figure BDA00027059374500000626
The chaotic signal sequence is first generated
Figure BDA00027059374500000627
Recombining to obtain a recombined chaotic signal sequence
Figure BDA00027059374500000628
Figure BDA00027059374500000629
Then, the chaotic signal sequence is processed
Figure BDA00027059374500000630
In descending order, according to chaotic signal sequence
Figure BDA00027059374500000631
The 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
Figure BDA00027059374500000632
Figure BDA00027059374500000633
Simultaneously firstly chaotic signal sequence
Figure BDA00027059374500000634
Recombining to obtain a recombined chaotic signal sequence
Figure BDA00027059374500000635
Figure BDA00027059374500000636
Then, the chaotic signal sequence is processed
Figure BDA00027059374500000637
In descending order, according to chaotic signal sequence
Figure BDA00027059374500000638
The 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
Figure BDA00027059374500000639
Figure BDA00027059374500000640
Wherein,
Figure BDA00027059374500000641
the operation means obtaining a value not greater than
Figure BDA00027059374500000642
The number of the integer (c) of (d),
finally, the numerical value sequence is
Figure BDA00027059374500000643
Element-by-element combination and conversion into Chinese character to obtain Chinese character sequence
Figure BDA00027059374500000644
I.e. the garbage classification number, wherein the length of the Chinese character sequence C is
Figure BDA00027059374500000645
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 number
Figure BDA0002705937450000071
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) 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
Figure BDA0002705937450000072
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
Figure BDA0002705937450000073
Figure BDA0002705937450000074
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 number
Figure BDA0002705937450000081
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) 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 as
Figure BDA0002705937450000082
Wherein M is1M2...Mk
Figure BDA0002705937450000083
Mk+L+p+1Mk+L+p+2...Mk+L+p+n-2Mk+L+p+n-1Mk+L+p+n、Mk+L+p+n+1Mk+L+p+n+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 sequence
Figure BDA0002705937450000091
Simultaneously, 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 be
Figure BDA0002705937450000092
A binary sequence BSi1,BSi2,BSi3,BSi4,BSi5,BSi6,BSi7,BSi8Are combined, wherein
Figure BDA0002705937450000093
Resulting in a combined binary matrix B,
Figure BDA0002705937450000094
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 is
Figure BDA0002705937450000101
The length of the numerical sequences P1, P2 is L + P +1, and the size of the combined binary matrix B is
Figure BDA0002705937450000102
The 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
Order to
Figure BDA0002705937450000103
Figure BDA0002705937450000104
Figure BDA0002705937450000105
Then
x1=α+mod(α+kp,1-α),
μ=β+mod(β+1.5×kp,4-β),
Figure BDA0002705937450000106
Figure BDA0002705937450000107
Figure BDA0002705937450000108
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 +8
Figure BDA0002705937450000111
At 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 sequence
Figure BDA0002705937450000112
Simultaneously, 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
Figure BDA0002705937450000113
Next, let LB be mod (6-mod (8L +8p +8,6),6), and scramble the higher binary sequence
Figure BDA0002705937450000114
LB binary bits '0' are added at the end of the sequence, the lower binary sequence after scrambling is carried out
Figure BDA0002705937450000115
LB binary bits '1' are added at the end of the sequence to obtain a binary sequence
Figure BDA0002705937450000116
Figure BDA0002705937450000117
And binary sequence
Figure BDA0002705937450000118
Figure BDA0002705937450000119
Wherein
Figure BDA00027059374500001110
For binary sequences
Figure BDA00027059374500001111
And
Figure BDA00027059374500001112
grouping the binary sequences separately
Figure BDA00027059374500001113
The 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 as
Figure BDA00027059374500001114
Simultaneously converting binary sequences
Figure BDA00027059374500001115
The 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 as
Figure BDA00027059374500001116
Wherein each binary block sequence comprises 6 binary bits, an
Figure BDA00027059374500001117
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 is
Figure BDA0002705937450000121
Go 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
Figure BDA0002705937450000122
(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 formulas
Figure BDA0002705937450000123
And parameters of
Figure BDA0002705937450000124
Order to
Figure BDA0002705937450000125
Then
Figure BDA0002705937450000126
Figure BDA0002705937450000127
Initial value mapped by chaos
Figure BDA0002705937450000128
And an external key
Figure BDA0002705937450000129
Iterating the Logistic chaotic mapping shown in the following formula, wherein k represents iteration times (k is 1, 2.) (k is equal to 1, 2.),
Figure BDA00027059374500001210
Represents the chaotic signal obtained by the k-th iteration,
Figure BDA00027059374500001211
obtaining a chaotic signal sequence
Figure BDA00027059374500001212
Slave sequence
Figure BDA00027059374500001213
The m-th element is sequentially spaced by n1Each element is 1 element to form a length of
Figure BDA00027059374500001214
Of the chaotic signal sequence
Figure BDA00027059374500001215
Simultaneous slave sequence
Figure BDA00027059374500001216
The m-th element is sequentially spaced by n2Each element is 1 element to form a length of
Figure BDA00027059374500001217
Of the chaotic signal sequence
Figure BDA00027059374500001218
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 applied
Figure BDA00027059374500001219
In ascending order, according to chaotic signal sequence
Figure BDA00027059374500001220
The 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
Figure BDA00027059374500001221
Figure BDA0002705937450000131
Simultaneously converting the chaotic signal sequence
Figure BDA0002705937450000132
In ascending order, according to chaotic signal sequence
Figure BDA0002705937450000133
The 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
Figure BDA0002705937450000134
Figure BDA0002705937450000135
If M isk+L+p+n+1Mk+L+p+n+2When the signal sequence is '02', the chaotic signal sequence is processed
Figure BDA0002705937450000136
In ascending order, according to chaotic signal sequence
Figure BDA0002705937450000137
The 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
Figure BDA0002705937450000138
Figure BDA0002705937450000139
Simultaneously converting the chaotic signal sequence
Figure BDA00027059374500001310
In descending order, according to chaotic signal sequence
Figure BDA00027059374500001311
The 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
Figure BDA00027059374500001312
Figure BDA00027059374500001313
If M isk+L+p+n+1Mk+L+p+n+2When the signal sequence is 03, the chaotic signal sequence is firstly generated
Figure BDA00027059374500001314
Recombining to obtain a recombined chaotic signal sequence
Figure BDA00027059374500001315
Figure BDA00027059374500001316
Then, the chaotic signal sequence is processed
Figure BDA00027059374500001317
In descending order, according to chaotic signal sequence
Figure BDA00027059374500001318
The 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
Figure BDA00027059374500001319
Figure BDA00027059374500001320
Simultaneously converting the chaotic signal sequence
Figure BDA00027059374500001321
In ascending order, according to chaotic signal sequence
Figure BDA00027059374500001322
The 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
Figure BDA00027059374500001323
Figure BDA00027059374500001324
If M isk+L+p+n+1Mk+L+p+n+2When the signal sequence is 04', the chaotic signal sequence is firstly generated
Figure BDA00027059374500001325
Recombining to obtain a recombined chaotic signal sequence
Figure BDA00027059374500001326
Figure BDA00027059374500001327
Then, the chaotic signal sequence is processed
Figure BDA00027059374500001328
In descending order, according to chaotic signal sequence
Figure BDA00027059374500001329
The 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
Figure BDA00027059374500001330
Figure BDA00027059374500001331
Simultaneously firstly chaotic signal sequence
Figure BDA00027059374500001332
Recombining to obtain a recombined chaotic signal sequence
Figure BDA00027059374500001333
Figure BDA00027059374500001334
Then, the chaotic signal sequence is processed
Figure BDA00027059374500001335
In descending order, according to chaotic signal sequence
Figure BDA00027059374500001336
The 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
Figure BDA00027059374500001337
Figure BDA00027059374500001338
Wherein,
Figure BDA00027059374500001339
the operation means obtaining a value not greater than
Figure BDA00027059374500001340
The number of the integer (c) of (d),
finally, the numerical value sequence is
Figure BDA00027059374500001341
Element-by-element combination [ CP1 ]i,CP2i]Then converted into kanji characters, i.e. Ci=native2unicode([CP1i,CP2i]) To obtain the Chinese character sequence
Figure BDA00027059374500001342
I.e. the garbage classification number, wherein the length of the Chinese character sequence C is
Figure BDA00027059374500001343
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 number
Figure BDA0002705937450000141
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) 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 as
Figure BDA0002705937450000142
Wherein M is1M2...Mk
Figure BDA0002705937450000143
Mk+L+p+1Mk+L+p+2...Mk+L+p+n-2Mk+L+p+n-1Mk+L+p+n、Mk+L+p+n+1Mk+L+p+n+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 S
Figure BDA0002705937450000144
The 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,
Figure BDA0002705937450000151
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
Order to
Figure BDA0002705937450000152
Then
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 sequence
Figure BDA0002705937450000161
0,0,1,1,0,0,0,1,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,0,0,0,0,0,0,0,1,0,0,1,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0, 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
Figure BDA0002705937450000163
Figure BDA0002705937450000164
Next, let LB be mod (6-mod (224,6),6 be 4, and scramble the high binary sequence
Figure BDA0002705937450000165
Adds 4 binary bits '0' at the end of the sequence, and carries out scrambling on the lower binary sequence
Figure BDA0002705937450000166
Adds 4 binary bits '1' at the end of the sequence to obtain a binary sequence
Figure BDA0002705937450000167
Figure BDA0002705937450000168
Figure BDA0002705937450000169
And binary sequence
Figure BDA00027059374500001610
Figure BDA00027059374500001611
Figure BDA0002705937450000171
Figure BDA0002705937450000172
In which binary sequence
Figure BDA0002705937450000173
Has a length of
Figure BDA0002705937450000174
Will binary sequence
Figure BDA0002705937450000175
The 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}, 0
Figure BDA0002705937450000176
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,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},
then, order
Figure BDA0002705937450000177
Then
Figure BDA0002705937450000178
Figure BDA0002705937450000179
Initial values mapped by chaos
Figure BDA00027059374500001710
And an external key
Figure BDA00027059374500001711
Iterating the Logistic chaotic mapping, wherein k represents iteration times (k is 1, 2.) (k is equal to 1, 2.)
Figure BDA00027059374500001712
Represents the chaotic signal obtained by the k-th iteration,
Figure BDA00027059374500001713
obtaining a chaotic signal sequence
Figure BDA00027059374500001714
Slave sequence
Figure BDA00027059374500001715
The 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 38
Figure BDA00027059374500001716
Simultaneous slave sequence
Figure BDA00027059374500001717
The 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
Figure BDA0002705937450000181
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 processed
Figure BDA0002705937450000182
In ascending order, according to chaotic signal sequence
Figure BDA0002705937450000183
The 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
Figure BDA0002705937450000184
Figure BDA0002705937450000185
Figure BDA0002705937450000186
Simultaneously converting the chaotic signal sequence
Figure BDA0002705937450000187
In ascending order, according to chaotic signal sequence
Figure BDA0002705937450000188
The 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
Figure BDA0002705937450000189
Figure BDA00027059374500001810
Finally, the numerical value sequence is
Figure BDA00027059374500001812
Firstly, 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
Figure BDA0002705937450000191
Figure BDA0002705937450000201
Figure BDA0002705937450000211
Figure BDA0002705937450000221
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
Figure BDA0002705937450000222
Figure BDA0002705937450000231
Figure BDA0002705937450000241
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
Figure BDA0002705937450000242
Figure BDA0002705937450000251
Figure BDA0002705937450000261
Figure BDA0002705937450000271
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 sequence
Figure FDA0002705937440000011
Simultaneously 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 be
Figure FDA0002705937440000012
A binary sequence BSi1,BSi2,BSi3,BSi4,BSi5,BSi6,BSi7,BSi8In combination, where i is 1, 2.,
Figure FDA0002705937440000013
resulting in a combined binary matrix B,
Figure FDA0002705937440000014
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
Figure FDA0002705937440000021
Figure FDA0002705937440000022
The length of the numerical sequences P1, P2 is L + P +1, and the size of the combined binary matrix B is
Figure FDA0002705937440000023
The 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
Order to
Figure FDA0002705937440000024
Then
x1=α+mod(α+kp,1-α), (1)
μ=β+mod(β+1.5×kp,4-β), (2)
Figure FDA0002705937440000031
Figure FDA0002705937440000032
Figure FDA0002705937440000033
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 +8
Figure FDA0002705937440000034
At 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 sequence
Figure FDA0002705937440000035
Simultaneously, 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
Figure FDA0002705937440000036
Then, let LB be mod (6-mod (8L +8p +8,6),6), and scramble the higher binary sequence
Figure FDA0002705937440000037
LB binary bits '0' are added at the end of the sequence, the lower binary sequence after scrambling is carried out
Figure FDA0002705937440000038
LB binary bits '1' are added at the end of the sequence to obtain a binary sequence
Figure FDA0002705937440000039
Figure FDA00027059374400000310
And binary sequence
Figure FDA00027059374400000311
Figure FDA00027059374400000312
Wherein
Figure FDA00027059374400000313
For binary sequences
Figure FDA00027059374400000314
And
Figure FDA00027059374400000315
grouping the binary sequences separately
Figure FDA00027059374400000316
The 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},.
Figure FDA00027059374400000317
Simultaneously converting binary sequences
Figure FDA00027059374400000318
The 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},.
Figure FDA00027059374400000319
Wherein each binary block sequence comprises 6 binary bits, an
Figure FDA00027059374400000320
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 is
Figure FDA0002705937440000041
The 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
Figure FDA0002705937440000042
(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 mapping
Figure FDA0002705937440000043
And parameters
Figure FDA0002705937440000044
Order to
Figure FDA0002705937440000045
Then
Figure FDA0002705937440000046
Figure FDA0002705937440000047
Initial values mapped by chaos
Figure FDA0002705937440000048
And an external key
Figure FDA0002705937440000049
Iterating a Logistic chaotic mapping shown in a formula (11), wherein k represents iteration times (k is 1, 2.),
Figure FDA00027059374400000410
represents the chaotic signal obtained by the k-th iteration,
Figure FDA00027059374400000411
obtaining a chaotic signal sequence
Figure FDA0002705937440000051
Slave sequence
Figure FDA0002705937440000052
The m-th element is sequentially spaced by n1Each element is 1 element to form a length of
Figure FDA0002705937440000053
Of the chaotic signal sequence
Figure FDA0002705937440000054
Simultaneous slave sequence
Figure FDA0002705937440000055
The m-th element is sequentially spaced by n2Each element is 1 element to form a length of
Figure FDA0002705937440000056
Of the chaotic signal sequence
Figure FDA0002705937440000057
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 applied
Figure FDA0002705937440000058
In ascending order, according to chaotic signal sequence
Figure FDA0002705937440000059
The 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
Figure FDA00027059374400000510
Figure FDA00027059374400000511
Simultaneously converting the chaotic signal sequence
Figure FDA00027059374400000512
In ascending order, according to chaotic signal sequence
Figure FDA00027059374400000513
The 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
Figure FDA00027059374400000514
Figure FDA00027059374400000515
If M isk+L+p+n+1Mk+L+p+n+2When the signal sequence is '02', the chaotic signal sequence is processed
Figure FDA00027059374400000516
In ascending order, according to chaotic signal sequence
Figure FDA00027059374400000517
The 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
Figure FDA00027059374400000518
Figure FDA00027059374400000519
Simultaneously converting the chaotic signal sequence
Figure FDA00027059374400000520
In descending order, according to chaotic signal sequence
Figure FDA00027059374400000521
The 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
Figure FDA00027059374400000522
Figure FDA00027059374400000523
If M isk+L+p+n+1Mk+L+p+n+2When the signal sequence is 03, the chaotic signal sequence is firstly generated
Figure FDA00027059374400000524
Recombining to obtain a recombined chaotic signal sequence
Figure FDA00027059374400000525
Figure FDA00027059374400000526
Then, the chaotic signal sequence is processed
Figure FDA00027059374400000527
In descending order, according to chaotic signal sequence
Figure FDA00027059374400000528
The 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
Figure FDA00027059374400000529
Figure FDA00027059374400000530
Simultaneously converting the chaotic signal sequence
Figure FDA00027059374400000531
In ascending order, according to chaotic signal sequence
Figure FDA00027059374400000532
The 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
Figure FDA00027059374400000533
Figure FDA00027059374400000534
If M isk+L+p+n+1Mk+L+p+n+2When the signal sequence is 04', the chaotic signal sequence is firstly generated
Figure FDA00027059374400000535
Recombining to obtain a recombined chaotic signal sequence
Figure FDA00027059374400000536
Figure FDA00027059374400000537
Then, the chaotic signal sequence is processed
Figure FDA00027059374400000538
In descending order, according to chaotic signal sequence
Figure FDA00027059374400000539
The 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
Figure FDA00027059374400000540
Figure FDA00027059374400000541
Simultaneously firstly chaotic signal sequence
Figure FDA00027059374400000542
Recombining to obtain a recombined chaotic signal sequence
Figure FDA00027059374400000543
Figure FDA00027059374400000544
Then, the chaotic signal sequence is processed
Figure FDA00027059374400000545
In descending order, according to chaotic signal sequence
Figure FDA00027059374400000546
The 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
Figure FDA00027059374400000547
Figure FDA0002705937440000061
Wherein,
Figure FDA0002705937440000062
the operation means obtaining a value not greater than
Figure FDA0002705937440000063
The number of the integer (c) of (d),
finally, the numerical value sequence is
Figure FDA0002705937440000064
Element-by-element combination and conversion into Chinese character to obtain Chinese character sequence
Figure FDA0002705937440000065
I.e. the garbage classification number, wherein the length of the Chinese character sequence C is
Figure FDA0002705937440000066
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 number
Figure FDA0002705937440000067
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) 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
Figure FDA0002705937440000068
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)
Figure FDA0002705937440000071
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 number
Figure FDA0002705937440000072
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) 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
Figure FDA0002705937440000073
Mk+L+p+1Mk+L+p+2...Mk+L+p+n- 2Mk+L+p+n-1Mk+L+p+nMk+L+p+n+1Mk+L+p+n+2Mk+L+p+n+3Mk+L+p+n+4Wherein M is1M2...Mk
Figure FDA0002705937440000074
Mk+L+p+ 1Mk+L+p+2...Mk+L+p+n-2Mk+L+p+n-1Mk+L+p+n、Mk+L+p+n+1Mk+L+p+n+2And Mk+L+p+n+3Mk+L+p+n+4The English spaces are mutually spaced.
CN202011038759.0A 2020-09-28 2020-09-28 Garbage classification two-dimensional code batch generation method Active CN112183697B (en)

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)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104680220A (en) * 2015-03-24 2015-06-03 南通大学 Commodity anti-counterfeiting code batch generation method
CN109472338A (en) * 2018-11-19 2019-03-15 南通大学 A 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)

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

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104680220A (en) * 2015-03-24 2015-06-03 南通大学 Commodity anti-counterfeiting code batch generation method
CN109472338A (en) * 2018-11-19 2019-03-15 南通大学 A 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)

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

Also Published As

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

Similar Documents

Publication Publication Date Title
CN112116046B (en) Garbage classification two-dimensional code generation method based on layered encryption
CN110033066B (en) Method for generating color garbage classification two-dimensional code
CN109933755B (en) Method for generating garbage classification code
CN109472338B (en) Batch generation method of commodity anti-counterfeiting two-dimensional codes
CN109284803B (en) Commodity anti-counterfeiting two-dimensional code generation method
CN112884104B (en) Commodity anti-counterfeiting two-dimensional code generation method based on chaotic encryption
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
CN112183697B (en) Garbage classification two-dimensional code batch generation method
CN113052286A (en) Commodity anti-counterfeiting two-dimensional code generation method based on scrambling encryption
CN106570355A (en) Encrypted information stamp and encryption method of the same
CN113255860A (en) Commodity anti-counterfeiting two-dimensional code generation method based on layered 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
CN109981246A (en) A kind of encryption method and decryption method of character string
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
CN114741712A (en) Chinese character encryption method based on hierarchical scrambling

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