CN115358361A - Garbage classification code generation method based on combined encryption - Google Patents
Garbage classification code generation method based on combined encryption Download PDFInfo
- Publication number
- CN115358361A CN115358361A CN202210505409.3A CN202210505409A CN115358361A CN 115358361 A CN115358361 A CN 115358361A CN 202210505409 A CN202210505409 A CN 202210505409A CN 115358361 A CN115358361 A CN 115358361A
- Authority
- CN
- China
- Prior art keywords
- binary
- sequence
- code
- switch
- identity
- 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.)
- Withdrawn
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K19/00—Record carriers for use with machines and with at least a part designed to carry digital markings
- G06K19/06—Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
- G06K19/06009—Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking
- G06K19/06037—Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking multi-dimensional coding
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/602—Providing cryptographic facilities or services
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/001—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using chaotic signals
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Physics & Mathematics (AREA)
- General Health & Medical Sciences (AREA)
- Computer Hardware Design (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Health & Medical Sciences (AREA)
- Bioethics (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention discloses a garbage classification two-dimensional code generation method based on combined encryption, which comprises the following steps: extracting an identity display code and a hidden code from the identity code of the garbage bag, and performing numerical data, binary conversion and integration operation to obtain an integrated binary sequence B; scrambling the binary sequence B by using a position change rule of the chaotic sequence Y obtained by chaotic mapping iteration before and after descending sorting; sequentially grouping the scrambled binary sequences in the forward direction by taking 4 elements as units, calculating a combination rule parameter k _ switch by using chaotic signals, and carrying out scrambling on the scrambled sequences according to the k _ switch adjusted in real timeSequentially performing combination operation to generate garbage classification number, and combining to generate garbageAnd forming a garbage classification two-dimensional code. The method for generating the garbage classification two-dimensional code based on the combined encryption is simple and feasible, has strong safety and is not easy to crack, and the generated garbage classification code has uniqueness, safety and garbage classification guiding performance.
Description
Technical Field
The invention belongs to the technical field of garbage classification, and particularly relates to a garbage classification code generation method based on combined encryption.
Background
With the rapid development of economy and the acceleration of urbanization process, the annual output of domestic garbage in cities and towns in China currently exceeds billions of tons, which accounts for about 20% of the total garbage output in the world, and the domestic garbage is increased at a speed of 8% -9% every year, and many cities face a severe situation of 'surrounding garbage'. Meanwhile, the landfill sites in many places are saturated in places where the periphery of cities is buried without garbage. In the situation of increasing garbage yield and environmental deterioration, how to realize garbage resource utilization to the maximum extent, reduce garbage disposal amount and improve living environment quality through garbage classification management is one of the urgent problems commonly concerned by countries in the world at present. Domestic research and technical applications on the classification of domestic waste began in the end of the 80's 20 th century, with an initial focus on the end disposal of waste. In the later 90 s, the classification management of the household garbage gradually extends from the tail end treatment to the whole process direction, and develops from a single treatment mode to a comprehensive treatment system. Although the trash can is printed with labels of recyclable trash and non-recyclable trash, the trash can still be seen even on the road side until now, but the trash can still be classified and thrown into the trash only rarely. The root can be summarized into the following reasons: firstly, the method is lack of related law constraints, and has corresponding laws as supports compared with the implementation of garbage classification in foreign developed countries; secondly, economic stimulation and reward are lacked, garbage classification knowledge is lacked, the environment protection consciousness is insufficient, and the activity participation enthusiasm is not high; thirdly, various problems that the infrastructure of the garbage recycling station is too crude, the garbage recycling and transporting process is too extensive, the worries of residents about the exposure of personal private information of garbage bags are negative or even unwilling to participate and the like are gradually revealed, and obviously, the implementation of urban garbage classification in China faces many difficulties and challenges. In order to solve 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 code generation method based on combined encryptionBinary sequenceSequentially and forwardly grouping by taking 4 elements as units, calculating a combination rule parameter k _ switch by using the chaotic signal, and carrying out sequence adjustment according to the k _ switch adjusted in real timeAnd sequentially carrying out combination operation to generate a garbage classification number, and further combining to generate a garbage classification two-dimensional code. The method for generating the garbage classification two-dimensional code based on the combined encryption is simple and feasible, has strong safety and is not easy to crack, and the generated garbage classification code has uniqueness, safety and garbage classification guiding performance.
The technical scheme is as follows: a garbage classification code generation method based on combined encryption comprises the following steps:
(1) Transcoding
Firstly, the identity information of a certain garbage bag is coded to generate a unique character type garbage bag identity code which is expressed as S 1 S 2 ...S k S k+1 S k+2 ...S k+L S k+L+1 S k+L+2 ...S k+L+p S k+L+p+1 S k+L+p+2 ...S k+L+p+n S k+L+p+n+1 S k+L+p+n+2 In which S is 1 S 2 ...S k Is a city area, S k+1 S k+2 ...S k+L To a specific residential address, S k+L+1 S k+L+2 ...S k+L+p For contacts and contact phones, S k+L+p+1 S k+L+p+2 ...S k+L+p+n To code date, S k+L+p+n+1 S k+L+p+n+2 The color information of garbage classification is separated by English space characters,
then, an identity display code S is extracted from the identity code of the garbage bag 1 S 2 ...S k S k+L+p+1 S k+L+p+2 ...S k+L+p+ n S k+L+p+n+1 S k+L+p+n+2 And identity hiding code S k+1 S k+2 ...S k+L S k+L+1 S k+L+2 ...S k+L+p And converting the ID display code into numerical data one by one to obtain corresponding numerical sequenceSimultaneously, the identity hidden codes are converted into numerical data one by one to obtain corresponding numerical sequences
Finally, the element P2 in the numerical sequence P2 i Converting the binary sequences PB { i } into 8-bit binary sequences PB { i } one by one, and integrating the binary sequences PB { i } to obtain an integrated binary sequence Wherein
The identity code of the garbage bag is a Chinese character coded by double bytes in a GB2312 character set and an 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 P1 isAnd isThe length of the numerical sequence P2 isAnd isThe length of the integrated binary sequence B is
(2) Scrambling of binary sequence B
Firstly, an initial value x of Logistic chaotic mapping is respectively calculated and obtained by utilizing a binary sequence B converted from a numerical sequence P1 and a numerical sequence P2, and external keys alpha and beta according to the following formulas (1) to (4) 1 A parameter mu, an extraction start position m, and an extraction interval number n,
x is then 1 =α+mod(α-SP,1-α), (1)
μ=β+mod(β+SP,4-β), (2)
n=13+mod(m,47), (4)
Wherein the content of the first and second substances,representing the number of binary bits '1' contained in the binary sequence B,representing the number of binary bits '0' in the binary sequence B, functionExpressed as not more than (-alpha + beta + SP). Times.10 15 The external key satisfies a ∈ (0,1), β ∈ (3.57,4),
then, the initial value x mapped by chaos 1 And a parameter mu, iterating the Logistic chaotic mapping shown in the following formula (5), wherein k represents iteration times and x k+1 Represents the chaotic signal obtained by the k-th iteration,
x k+1 =μ·x k ·(1-x k ) (5)
obtaining a chaotic signal sequenceTaking 1 element from the m-th element in the sequence X at intervals of n elements in sequence to form the length of the m-th elementOf the chaotic signal sequence
Finally, the chaotic signal sequence Y is sorted in a descending order, and the binary sequence B is scrambled according to the position change scrambling rule before and after the chaotic signal sequence Y is sorted to obtain a scrambled binary sequence
First, a binary sequence is divided intoThe middle elements are sequentially and positively grouped by taking 4 elements as a unit from head to tail to obtain a grouped binary sequence which is expressed asAnd is Wherein
Then, each binary packet sequence BF { j } is sequentially subjected to the following combination operations:
s0: let j =1 and, if the number of the segments is greater than the threshold,and combining the rule parameters
S1: the value of the parameter k _ switch is judged,
if k _ switch =0, a binary "1011" is added at the head end of the binary packet sequence BF { j }, denoted as
If k _ switch =1, a binary "1100" is appended to the head end of the binary packet sequence BF { j }, denoted as
If k _ switch =2, a binary '0' is added after the 2 nd bit of the binary packet sequence BF { j } and a binary '110' is added at the head end, denoted as
If k _ switch =3, a binary '0' is added after the 3 rd bit of the binary packet sequence BF { j } and a binary '110' is added at the head end, denoted as
If k _ switch =4, a binary '0' is added to the tail end and a binary '110' is added to the head end of the binary packet sequence BF { j }, denoted as
If k _ switch =5, the binary "00" is added after the 1 st bit and the binary "11" is added at the head end of the binary packet sequence BF { j }, denoted as
If k _ switch =6, the binary "00" is added after the 2 nd bit and the binary "11" is added at the head end of the binary packet sequence BF { j }, denoted as
If k _ switch =7, a binary "1110" is appended to the head end of the binary packet sequence BF { j }, denoted as
If k _ switch =8, the binary packet sequence BF { j } is flipped front and back and a binary "1011" is added at its head end, denoted as
If k _ switch =9, the binary packet sequence BF { j } is flipped front and back and a binary "1100" is appended to its head end, denoted as
If k _ switch =10, the binary packet sequence BF { j } is flipped front and back and added with a binary '0' after its 2 nd bit and a binary '110' at the head end, denoted as
If k _ switch =11, the binary packet sequence BF { j } is flipped front-to-back and is added with a binary '0' after its 3 rd bit and a binary '110' at the head end, denoted as
If k _ switch =12, the binary packet sequence BF { j } is flipped front and back and is appended with a binary '0' at its tail end and a binary '110' at the head end, denoted as
If k _ switch =13, the binary packet sequence BF { j } is flipped front and back and the 1 st bit thereof is followed by a binary "00" and the head end is followed by a binary "11", denoted as
If k _ switch =14, the binary packet sequence BF { j } is flipped front and back and added with the binary "00" after its 2 nd bit and the binary "11" at the head end, denoted as
If k _ switch =15, the binary packet sequence BF { j } is flipped front and back and a binary "1110" is added at its head end, denoted as
S2: combining the binary into a sequence using a bin2dec () functionConversion into numerical dataAnd updates the chaotic signalMeanwhile, carrying out single iteration according to Logistic chaotic mapping shown in formula (5) to obtain z j+1 Calculating the parametersLet j = j +1, then judge the size of j, ifThen step S1 is carried out, otherwise step S3 is carried out,
s3: ending the combining operation of the binary grouped sequence to obtain a binary combined sequence represented asAnd a sequence of values
(4) Transcoding
Sequence of valuesConverting the Chinese elements into Chinese characters to obtain a character sequenceI.e. the garbage classification number, wherein the length of the character sequence C isAnd displays the identity of the garbage bag with a code (S) 1 S 2 ...S k S k+L+p+1 S k+L+p+2 ...S k+L+p+n S k+L+p+n+1 S k+L+p+n+2 ) And combining the Code with the garbage classification number to generate a garbage classification Code, and then generating a QR Code, namely a garbage classification two-dimensional Code.
Further, the step (1) of converting the identity display code into numerical data one by one in the method for generating the garbage classification code based on the combined encryption means that the identity display code adopts a unicode2native () function to belong the ASCII code value to [32,126 [ ], one by one]Converts the visible characters into single numerical data, or double-byte codes in GB2312 character setConverting the Chinese characters into two numerical data to obtain corresponding numerical sequence
Further, the step (1) of converting the identity hiding code into numerical data one by one in the garbage classification code generation method based on the combined encryption means that the identity hiding code adopts a unicode2native () function to belong the ASCII code value to [32,126 ]]Converting the visible characters into single numerical data, or converting the double-byte coded Chinese characters in GB2312 character set into two numerical data, thereby obtaining corresponding numerical sequences
Furthermore, in the method for generating the garbage classification code based on the combined encryption, the element P2 in the numerical value sequence P2 is generated in the step (1) i The conversion into the binary sequence PB { i } of 8 bits one by one means that dec2bin (P2) is adopted i 8) function P2 i Elements > 128 are converted into an 8-bit binary sequence PB { i }; using dec2bin (P2) i 7) function of P2 i The element < 128 is converted to a 7-bit binary sequence PB { i } and the end of PB { i } is added with binary '1', i.e. PB { i } = [ PB { i }, '1']。
Further, the method for generating the garbage classification code based on the combination encryption comprises the step (4) of sequencing the numerical valuesConversion of Chinese elements into Chinese characters, meaning a sequence of numerical valuesTwo adjacent elements in the group of 1 adopt native2unicode (·) functions in sequence, namelyObtaining Chinese character sequence
Further, the garbage bag identity display code (S) in the step (4) of the garbage classification code generation method based on combined encryption 1 S 2 ...S k S k+L+p+1 S k+L+p+2 ...S k+L+p+n S k+L+p+n+1 S k+L+p+n+2 ) The garbage classification code is generated by combining the garbage classification number and a garbage bag identity display code, which is expressed as the combination mode of inserting and connecting the garbage bag identity display code and the garbage classification numberWherein S 1 S 2 ...S k 、S k+L+p+1 S k+L+p+2 ...S k+L+p+n 、And S k+L+p+n+1 S k+L+p+n+2 The English spaces are mutually spaced.
Has the advantages that: the method calculates the initial value and parameter, the extraction starting position and the extraction interval of the chaotic system by relying on the identity display code and the hidden code, generates a chaotic signal sequence by utilizing chaotic mapping, scrambles a binary sequence B formed by converting the hidden code of the identity of the garbage bag and binary integration, and scrambles the scrambled binary sequence BSequentially and forwardly grouping by taking 4 elements as units, calculating a combination rule parameter k _ switch by using the chaotic signal, and carrying out sequence adjustment according to the k _ switch adjusted in real timeAnd sequentially carrying out combination operation so as to generate a garbage classification number, and further combining to generate a garbage classification two-dimensional code. The method for generating the garbage classification two-dimensional code based on the combined encryption is simple and feasible, has strong safety and is not easy to crack, and the generated garbage classification code has uniqueness, safety and garbage classification guiding performance.
Drawings
FIG. 1 is a schematic diagram illustrating a garbage classification code generation process based on combinatorial encryption 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" blue background mark in the middle.
Detailed Description
As shown in fig. 1, a method for generating a garbage classification code based on combined encryption includes the following steps:
(1) Transcoding
Firstly, the identity information of a certain garbage bag is coded to generate a unique character type garbage bag identity code which is expressed as S 1 S 2 ...S k S k+1 S k+2 ...S k+L S k+L+1 S k+L+2 ...S k+L+p S k+L+p+1 S k+L+p+2 ...S k+L+p+n S k+L+p+n+1 S k+L+p+n+2 In which S is 1 S 2 ...S k Is a city area, S k+1 S k+2 ...S k+L To a specific residential address, S k+L+1 S k+L+2 ...S k+L+p For contacts and contact phones, S k+L+p+1 S k+L+p+2 ...S k+L+p+n To code date, S k+L+p+n+1 S k+L+p+n+2 The color information of garbage classification is separated by English space characters,
then, an identity display code S is extracted from the identity code of the garbage bag 1 S 2 ...S k S k+L+p+1 S k+L+p+2 ...S k+L+p+ n S k+L+p+n+1 S k+L+p+n+2 And identity hiding code S k+1 S k+2 ...S k+L S k+L+1 S k+L+2 ...S k+L+p And the identity display code is subjected to character-by-character adoption of unicode2native () function to belong the ASCII code value to 32,126]Converting the visible characters into single numerical data, or converting the double-byte coded Chinese characters in GB2312 character set into two numerical data to obtain corresponding numerical sequencesSimultaneously, the identity hiding code adopts unicode2native () function to lead the ASCII code value 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 to obtain corresponding numerical sequence
Finally, dec2bin (P2) is used i 8) function of P2 i Elements > 128 are converted into an 8-bit binary sequence PB { i }, or dec2bin (P2 bin) is used i 7) function of P2 i The element < 128 is converted to a 7-bit binary sequence PB { i } and the end of PB { i } is added with binary '1', i.e. PB { i } = [ PB { i }, '1']And integrating the binary sequence PB { i } to obtain an integrated binary sequenceWherein
The identity code of the garbage bag is a Chinese character coded by double bytes in a GB2312 character set and an 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 P1 isAnd isThe length of the numerical sequence P2 isAnd isThe length of the integrated binary sequence B is
(2) Scrambling of binary sequence B
Firstly, an initial value x of Logistic chaotic mapping is respectively calculated and obtained by utilizing a binary sequence B converted from a numerical sequence P1 and a numerical sequence P2, and external keys alpha and beta according to the following formula 1 A parameter mu, an extraction start position m, and an extraction interval number n, such that
X is then 1 =α+mod(α-SP,1-α),
μ=β+mod(β+SP,4-β),
n=13+mod(m,47),
Wherein the content of the first and second substances,represents the number of binary bits '1' contained in the binary sequence B,representing the number of binary bits '0' in the binary sequence B, functionExpressed as not more than (-alpha + beta + SP). Times.10 15 The external key satisfies a ∈ (0,1), β ∈ (3.57,4),
then, the initial value x mapped by chaos 1 And a parameter mu, iterating the Logistic chaotic mapping shown in the following formula, wherein k represents iteration times and x k+1 Represents the chaotic signal obtained by the k-th iteration,
x k+1 =μ×x k ×(1-x k )
obtaining a chaotic signal sequenceTaking 1 element from the m-th element in the sequence X at intervals of n elements in sequence to form the length of the m-th elementOf the chaotic signal sequence
Finally, the chaotic signal sequence Y is sorted in a descending order, and the binary sequence B is scrambled according to the position change scrambling rule before and after the chaotic signal sequence Y is sorted to obtain a scrambled binary sequence
First, a binary sequence is divided intoThe middle elements are sequentially grouped by taking 4 elements as a unit in the forward direction from the head to the tail to obtain a grouped binary sequence which is expressed asAnd is Wherein
Then, each binary packet sequence BF { j } is sequentially subjected to the following combination operations:
s0: let j =1 and, if the number of the segments is greater than the threshold,and combining the rule parameters
S1: the value of the parameter k _ switch is judged,
if k _ switch =0, a binary "1011" is added to the head end of the binary packet sequence BF { j }, denoted as
If k _ switch =1, a binary "1100" is appended to the head end of the binary packet sequence BF { j }, denoted as
If k _ switch =2, a binary '0' is added after the 2 nd bit of the binary packet sequence BF { j } and a binary '110' is added at the head end, denoted as
If k _ switch =3, a binary '0' is added after the 3 rd bit of the binary packet sequence BF { j } and a binary '110' is added at the head end, denoted as
If k _ switch =4, a binary '0' is added to the tail end and a binary '110' is added to the head end of the binary packet sequence BF { j }, denoted as
If k _ switch =5, the binary "00" is added after the 1 st bit and the binary "11" is added at the head end of the binary packet sequence BF { j }, denoted as
If k _ switch =6, the binary "00" is added after the 2 nd bit and the binary "11" is added at the head end of the binary packet sequence BF { j }, denoted as
If k _ switch =7, a binary "1110" is added at the head end of the binary packet sequence BF { j }, denoted as
If k _ switch =8, the binary packet sequence BF { j } is flipped front-to-back and a binary "1011" is added at its head end, denoted as
If k _ switch =9, the binary packet sequence BF { j } is flipped front and back and a binary "1100" is appended to its head end, denoted as
If k _ switch =10, the binary packet sequence BF { j } is flipped front and back and added with a binary '0' after its 2 nd bit and a binary '110' at the head end, denoted as
If k _ switch =11, the binary packet sequence BF { j } is flipped front and back and added with a binary '0' after its 3 rd bit and a binary '110' at the head end, denoted as
If k _ switch =12, the binary packet sequence BF { j } is flipped front and back and is appended with a binary '0' at its tail end and a binary '110' at the head end, denoted as
If k _ switch =13, the binary packet sequence BF { j } is flipped front-to-back and the 1 st bit thereof is appended with a binary "00" and the head end is appended with a binary "11", denoted as
If k _ switch =14, the binary packet sequence BF { j } is flipped front-to-back and is added with a binary "00" after its 2 nd bit and a binary "11" at the head end, denoted as
If k _ switch =15, the binary packet sequence BF { j } is flipped front-to-back and a binary "1110" is appended to its head end, denoted as k _ switch =15
S2: combining the binary into a sequence using a bin2dec () functionConversion into numerical dataAnd updates the chaotic signalMeanwhile, carrying out single iteration according to Logistic chaotic mapping shown in formula (5) to obtain z j+1 Calculating the parametersLet j = j +1, then judge the size of j, ifGo to step S1, otherwise go toIn a step S3, the step of the method is that,
s3: the combining operation of the binary grouped sequence is ended, thereby obtaining a binary combined sequence which is expressed asAnd a sequence of values
(4) Transcoding
Sequence of valuesTwo adjacent elements in the group of 1 adopt native2unicode (·) functions in sequence, namelyObtaining Chinese character sequenceI.e. the garbage classification number, wherein the length of the character sequence C isAnd displays the identity of the garbage bag with a code (S) 1 S 2 ...S k S k+L+p+1 S k+L+p+2 ...S k+L+p+n S k+L+p+n+1 S k+L+p+n+2 ) Combined with garbage classification number and expressed asWherein S 1 S 2 ...S k 、S k+L+p+1 S k+L+p+2 ...S k+L+p+n 、And S k+L+p+n+1 S k+L+p+n+2 Are mutually spaced by English blank space, thereby generating garbage classification code, and thenAnd generating QR Code, namely the two-dimensional Code of the garbage classification.
The invention is further illustrated by the following specific examples:
example 1
According to the method for generating the garbage classification code based on the combined encryption, the steps are as follows:
(1) Transcoding
Firstly, encoding the identity information of a certain garbage bag to generate a unique character type garbage bag identity code, namely 'south China city-12 #1 # 01 plum strong 123456789 # 2022-01-01' in Jiangsu province-Nantong city-Hamen region, wherein the length is k + L + p + n +6 + 11+13+14+10+6=54 ', wherein' Jiangsu province-Nantong city-Chongchuan city 'is a province region,' south China city-12 #1 '01' is a specific living address, 'plum strong 123456789' is a contact and a contact phone, '2022-01-01' is a code making month, and '01' is garbage classification color information (for example, blue recoverable garbage);
then, respectively extracting an identity display code (2022-01-01) and an identity hiding code (Zhongnan city-12 # -1 # -01 li: "strong 123456789 ″) from the garbage bag identity codes, converting the identity display code into numerical data one by adopting a unicode2native () function to obtain a corresponding numerical sequence P1= {189,173,203,213,202,161,45,196,207,205,168,202,208,45,186,163,195,197,199,248,32,50,48,50,50,45,48,49,45,48,49,32,48,49}, and simultaneously converting the identity hiding code into the numerical data one by adopting a unicode2native () function to obtain a corresponding numerical sequence P2= {214,208,196,207,202,192,42,179,199,45,49,50,35,49,42,48,49,32,192,238,42,199,191,49,50,51,52,53,54,55,56,57,42,42}, wherein the length of the numerical sequence P1 is 214,208,196,207,202,192,42,179,199,45,49,50,35,49,42,48,49,32,192,238,42,199,191,49,50,51,52,53,54,55,56,57,42,42}, and the length of the numerical sequence P1 isThe length of the numerical sequence P2 is
Finally, the element P2 in the numerical sequence P2 i One by one into an 8-bit binary sequence PB { i }, and taking the binary sequence PB { i } into the sequenceRow integration, resulting in an integrated binary sequence B = { B = { (B) } 1 ,B 2 ,...,B 271 ,B 272 }={1,1,0,1,0,1,1,0,1,1,0,1,0,0,0,0,1,1,0,0,0,1,0,0,1,1,0,0,1,1,1,1,1,1,0,0,1,0,1,0,1,1,0,0,0,0,0,0,0,1,0,1,0,1,0,1,1,0,1,1,0,0,1,1,1,1,0,0,0,1,1,1,0,1,0,1,1,0,1,1,0,1,1,0,0,0,1,1,0,1,1,0,0,1,0,1,0,1,0,0,0,1,1,1,0,1,1,0,0,0,1,1,0,1,0,1,0,1,0,1,0,1,1,0,0,0,0,1,0,1,1,0,0,0,1,1,0,1,0,0,0,0,0,1,1,1,0,0,0,0,0,0,1,1,1,0,1,1,1,0,0,1,0,1,0,1,0,1,1,1,0,0,0,1,1,1,1,0,1,1,1,1,1,1,0,1,1,0,0,0,1,1,0,1,1,0,0,1,0,1,0,1,1,0,0,1,1,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,1,1,0,1,1,0,1,1,0,1,0,1,1,0,1,1,1,1,0,1,1,1,0,0,0,1,0,1,1,1,0,0,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1};
(2) Scrambling of binary sequence B
Firstly, an initial value x of the Logistic chaotic map is calculated and obtained by using a binary sequence B converted from a numerical sequence P1 and a numerical sequence P2, and external keys alpha =0.12345 and beta =3.75 according to the following formulas 1 A parameter mu, an extraction start position m, and an extraction interval number n,
x 1 =0.12345+mod(0.12345-0.449272815743945,1-0.12345)=0.674177184256056,
μ=3.75+mod(3.75+0.449272815743945,0.25)=3.949272815743944,
n=13+mod(673,47)=28,
Then, the initial value x mapped by chaos 1 And a parameter mu, iterating the Logistic chaotic mapping shown in the following formula, wherein k represents iteration times and x k+1 Represents the chaotic signal obtained from the k iteration, k =1,2,. +, 452+15 × (249)
x k+1 =μ×x k ×(1-x k )
Obtaining a chaotic signal sequence X = { X = 1 ,x 2 ,...,x 8262 And 1 element is taken out of 28 elements in sequence from 673 th element in the sequence X to form a chaotic signal sequence Y with the length of 272 = { Y = 1 ,Y 2 ,...,Y 271 ,Y 272 },
Finally, the chaotic signal sequence Y is sorted in a descending order, and the binary sequence B is scrambled according to the position change scrambling rule before and after the chaotic signal sequence Y is sorted to obtain a scrambled binary sequence
First, the scrambled binary sequence is decodedThe middle elements are sequentially grouped by taking 4 elements as a unit in the forward direction from the head to the tail, so that a grouped binary sequence is obtained, and BF {1} = {1,0,0,0}, BF {2} = {0,0,0,0},. Rightwards, BF {33} = {1,1,1,1}, BF {34} = {0,1,1,0},. Rightwards, BF {67} = {1,0,1,0}, BF {68} = {1,1,1,1}, and BF {68}, wherein the number of the elements is equal to the number of the elements in the sequence, and the sequence is a binary sequence after being grouped, and BF {1} = {1,0,0,0},. 3242 },. 4},. 1,0,1,0, and BF {68},
then, each binary grouping sequence BF { i } is recombined in sequence, so as to obtain a recombined binary grouping sequence And a sequence of values
(4) Transcoding
Sequence of valuesConverted into Chinese character characters to obtain garbage classification Code 'Lin Rong Nang Ming Yi's huge payment concubine of an emperor ruing tear Mi carving treatment tra Ying an Teng extend protection, and adopts insertion connection combination mode for garbage bag identity display Code (Jiangsu province-Nantong city-Haimen district 2022-01-01) and garbage classification Code, the generation of the garbage classification Code is "Jiangsu province-Nantong city-Haimen area 2022-01-01 Lin Rong Nana can be as Yi Pan payment concubine of an emperor lucky tear Mi carving treatment tra Ying extend protection Bi Rong coma 01", then the generation of QR Code, namely the garbage classification two-dimensional Code, is shown in fig. 2.
Example 2
According to the method for generating the garbage classification code based on the combined encryption, the steps of generating the identity hidden code, the external secret key and the garbage classification two-dimensional code of a certain garbage bag are similar to those of the specific embodiment 1, and only the information of provincial and urban areas or code making year, month and day in the identity display code of a certain garbage bag is slightly changed: "Gong Su Sheng-Nantong city-Haimen region 2022-01-01"; or "Jiangsu province-Nantong city-Hai Di 2022-01-01"; or "jiangsu province-south city-haimen region 2022-01-11", the generation result of the garbage classification (two-dimensional) code is shown in table 1. As can be seen from the following table: the garbage classification number of the garbage bag can be greatly changed due to slight change of the identity display code (provincial and urban areas or code making year, month and day) in the garbage bag identity code, so that the garbage classification code generation method based on combined encryption disclosed by the patent has sensitivity to the information of the provincial and urban areas and the code making year, month and day in the garbage bag identity display code.
Table 1 generation result of two-dimensional code for garbage classification when information of provincial and urban areas or code-making year, month and day in display code of garbage bag identity is slightly changed
Example 3
According to the garbage classification code generation method based on the combined encryption, the steps of generating the identity hidden code, the external key and the garbage classification two-dimensional code of a certain garbage bag are similar to those of the specific embodiments 1 and 2, and only the color of the garbage bag is changed in the garbage bag identity code ("south Shih-12 Shih-01 Shih 123456789 × 2022-01-01" in the south world-Nantong city-Haima region of Jiangsu province), or "worker Su Sheng-south Tong city-Haimah region" south Shih-12 Shih 1 Shih-01 Shih 123456789 × 2022-01-01", or" south Shih-Nantong city-south China Hai region "south Shih 1 Shih 01 Shih 456789 &" Shih-20201 Shih-01 Shih garbage bag ": "02"; or "03"; or "04", and the generation result of the two-dimensional code for garbage classification is shown in table 2. The following table shows that the garbage classification two-dimensional code is changed greatly due to slight change of the garbage classification color information in the garbage bag identity code, and therefore, the garbage classification code generation method based on combined encryption has sensitivity to the garbage classification color information in the garbage bag identity information.
Table 2 generation result of two-dimensional code for garbage classification when garbage classification color information is changed slightly
Example 4
According to the garbage classification code generation method based on the combined encryption, the steps of generating the identity display code, the external key and the garbage classification two-dimensional code of a certain garbage bag are similar to those of the specific embodiments 1 and 2, and only the original garbage bag is hidden in the garbage bag identity code ("south world-12 #1 # 01 # plum 123456789 ″ -2022-01-01 ″), or" industrial Su Sheng-south china-haimen region "south world-12 #1 # plum 01 # 456789 ″ -2022-01-01 ″, or" south world-south city-south china-haimen region "south world-12 #1 # plum 01 # 456789 ″ -20201 # garbage bag identity information (" south world-12 # 456789 "# -01 # garbage bag": "Zhong Na shi cheng-12 #1 xi 01 li qiang 123456789"; or "central south city-12 #1 # 81 plum strong 123456789"; or "Zhongnan city-12 # -1 # 01 li qiang 123450789", the generation results of the two-dimensional code for garbage classification are shown in Table 3. As can be seen from the following table, a garbage classification two-dimensional code is greatly changed due to slight changes of an identity hidden code in a garbage bag identity code, and therefore, it can be seen that the garbage classification code generation method based on combined encryption provided by the patent has sensitivity to a hidden part (i.e., a garbage bag identity hidden code) in garbage bag identity information.
Table 3 generation result of two-dimensional code for garbage classification when garbage bag identity hidden code is changed slightly
Example 5
According to the method for generating garbage classification codes based on combined encryption, the identity codes (identity display codes and hidden codes) of certain garbage bags and the generation steps of the garbage classification two-dimensional codes thereof are similar to those of the specific embodiments 1 and 2, and only a single garbage bag identity code ("south Shi-12 Shi 01 Shi 1 Shi 01 Shi 123456789" in south China-Hai Men area of Jiangsu province, or "worker Su Sheng-south China-Hai Ming district south Shi-12 Shi 1 Shi 01 Shi 123456789" 2022-01-01 "or" south Shi-south China-Hai City-Hai district south China "Shi-12 Shi 1 Shi 01 Shi 456789" or "south Shi-south China Shi 1 Shi 01 Shi 456789" in south China: α =0.123450000000001; or β =3.750000000000001, and the result of generating the garbage classification code is shown in table 4. As can be seen from the following table: once the external key changes slightly, namely, the external key is lost in milli-centimetres, the generated two-dimensional code for garbage classification is 'bad in kilo-miles', and therefore it can be seen that the method for generating the garbage classification code based on the combined encryption provided by the patent has the key sensitivity.
TABLE 4 garbage classification two-dimensional code generation result when the external key is slightly changed
As can be seen from the analysis of the above specific embodiments 1-5, the garbage classification two-dimensional code generated by the garbage classification two-dimensional code generation method based on combined encryption provided by the present patent is not only closely related to an external secret key, but also depends on the identity information of the garbage bag (i.e. the garbage bag identity display code, the garbage bag identity hidden code), so that the garbage classification code generation method based on combined encryption provided by the present patent has strong security, so as to ensure that the generated garbage classification code has "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 (6)
1. A garbage classification code generation method based on combined encryption is characterized by comprising the following steps:
(1) Transcoding
Firstly, the identity information of a certain garbage bag is coded to generate a unique character type garbage bag identity code which is expressed as S 1 S 2 ...S k S k+1 S k+2 ...S k+L S k+L+1 S k+L+2 ...S k+L+p S k+L+p+1 S k+L+p+2 ...S k+L+p+n S k+L+p+n+1 S k+L+p+n+2 In which S is 1 S 2 ...S k Is a city area, S k+1 S k+2 ...S k+L To a specific residential address, S k+L+1 S k+L+2 ...S k+L+p For contacts and contact phones, S k+L+p+1 S k+L+p+2 ...S k+L+p+n To code date, S k+L+p+n+1 S k+L+p+n+2 The color information of garbage classification is separated by English space characters,
then, an identity display code S is extracted from the identity code of the garbage bag 1 S 2 ...S k S k+L+p+1 S k+L+p+2 ...S k+L+p+n S k+L+p+n+ 1 S k+L+p+n+2 And identity hiding code S k+1 S k+2 ...S k+L S k+L+1 S k+L+2 ...S k+L+p And converting the ID display code into numerical data one by one to obtain corresponding numerical sequenceSimultaneously, the identity hidden codes are converted into numerical data one by one to obtain corresponding numerical sequences
Finally, the element P2 in the numerical sequence P2 i Converting the binary sequences PB { i } into 8-bit binary sequences PB { i } one by one, and integrating the binary sequences PB { i } to obtain an integrated binary sequence Wherein
The identity code of the garbage bag is a Chinese character coded by double bytes in a GB2312 character set and an 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 P1 isAnd is provided withThe length of the numerical sequence P2 isAnd is provided withThe length of the integrated binary sequence B is
(2) Scrambling of binary sequence B
Firstly, the numerical sequence P2 is converted into a numerical sequence P1The binary sequence B and the external keys alpha and beta are respectively calculated according to the following formulas (1) to (4) to obtain an initial value x of the Logistic chaotic mapping 1 A parameter mu, an extraction start position m, and an extraction interval number n, such that
X is then 1 =α+mod(α-SP,1-α), (1)
μ=β+mod(β+SP,4-β), (2)
n=13+mod(m,47), (4)
Wherein the content of the first and second substances,representing the number of binary bits '1' contained in the binary sequence B,representing the number of binary bits '0' in the binary sequence B, functionExpressed as not more than (-alpha + beta + SP). Times.10 15 The external key satisfies a ∈ (0,1), β ∈ (3.57,4),
then, the initial value x mapped by chaos 1 And a parameter mu, iterating the Logistic chaotic mapping shown in the following formula (5), wherein k represents iteration times and x k+1 Represents the chaotic signal obtained by the k-th iteration,
x k+1 =μ·x k ·(1-x k ) (5)
obtaining a chaotic signal sequenceTaking 1 element from the m-th element in the sequence X at intervals of n elements in sequence to form the length of the m-th elementOf the chaotic signal sequence
Finally, the chaotic signal sequence Y is sorted in a descending order, and the binary sequence B is scrambled according to the position change scrambling rule before and after the chaotic signal sequence Y is sorted to obtain a scrambled binary sequence
First, a binary sequence is divided intoThe middle elements are sequentially and positively grouped by taking 4 elements as a unit from head to tail to obtain a grouped binary sequence which is expressed asAnd is Wherein
Then, each binary packet sequence BF { j } is sequentially subjected to the following combination operations:
S1: the value of the parameter k _ switch is determined,
if k _ switch =0, a binary "1011" is added to the head end of the binary packet sequence BF { j }, denoted as
If k _ switch =1, a binary "1100" is appended to the head end of the binary packet sequence BF { j }, denoted as
If k _ switch =2, a binary '0' is added after the 2 nd bit of the binary packet sequence BF { j } and a binary '110' is added at the head end, denoted as
If k _ switch =3, a binary '0' is added after the 3 rd bit of the binary packet sequence BF { j } and a binary '110' is added at the head end, denoted as
If k _ switch =4, a binary '0' is added to the tail end and a binary '110' is added to the head end of the binary packet sequence BF { j }, denoted as
If k _ switch =5, the binary "00" is added after the 1 st bit and the binary "11" is added at the head end of the binary packet sequence BF { j }, denoted as
If k _ switch =6, the binary "00" is added after the 2 nd bit and the binary "11" is added at the head end of the binary packet sequence BF { j }, denoted as
If k _ switch =7, a binary "1110" is appended to the head end of the binary packet sequence BF { j }, denoted as
If k _ switch =8, the binary packet sequence BF { j } is flipped front and back and a binary "1011" is added at its head end, denoted as
If k _ switch =9, the binary packet sequence BF { j } is flipped front and back and a binary "1100" is appended to its head end, denoted as
If k _ switch =10, the binary packet sequence BF { j } is flipped front and back and added with a binary '0' after its 2 nd bit and a binary '110' at the head end, denoted as
If k _ switch =11, the binary packet sequence BF { j } is flipped front-to-back and added with binary 'after its 3 rd bit'0' and the head end is added with binary ' 110 ', denoted as
If k _ switch =12, the binary packet sequence BF { j } is flipped front and back and a binary '0' is added at its tail end and a binary '110' is added at the head end, denoted as
If k _ switch =13, the binary packet sequence BF { j } is flipped front-to-back and the 1 st bit thereof is appended with a binary "00" and the head end is appended with a binary "11", denoted as
If k _ switch =14, the binary packet sequence BF { j } is flipped front and back and added with the binary "00" after its 2 nd bit and the binary "11" at the head end, denoted as
If k _ switch =15, the binary packet sequence BF { j } is flipped front-to-back and a binary "1110" is appended to its head end, denoted as k _ switch =15
S2: combining the binary sequences using a bin2dec () functionConversion into numerical dataAnd updates the chaotic signalMeanwhile, carrying out single iteration according to Logistic chaotic mapping shown in formula (5) to obtain z j+1 Calculating the parametersLet j = j +1, then judge the size of j, ifThen step S1 is carried out, otherwise step S3 is carried out,
s3: the combining operation of the binary grouped sequence is ended, thereby obtaining a binary combined sequence which is expressed asAnd a sequence of values
(4) Transcoding
Sequence of valuesConverting the medium elements into Chinese characters to obtain Chinese character sequenceI.e. the garbage classification number, wherein the length of the Chinese character sequence C isAnd displays the identity of the garbage bag with a code (S) 1 S 2 ...S k S k+L+p+1 S k+L+p+2 ...S k+L+p+n S k+L+p+n+1 S k+L+p+n+2 ) And combining the Code with the garbage classification number to generate a garbage classification Code, and then generating a QR Code, namely a garbage classification two-dimensional Code.
2. The method for generating spam classification codes based on combination encryption according to claim 1, wherein: the step (1) of converting the identity display code into numerical data one by one means that the identity display code adopts a unicode2native () function to enable the ASCII code value 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
3. The method for generating spam classification codes based on combination encryption according to claim 1, wherein: the step (1) of converting the identity hiding code into numerical data one by one means that the identity hiding code adopts unicode2native () function to enable the ASCII code value 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
4. The method for generating spam classification codes based on combination encryption according to claim 1, wherein: the step (1) is to combine the elements P2 in the numerical sequence P2 i The conversion into the binary sequence PB { i } of 8 bits one by one means that dec2bin (P2) is adopted i 8) function of P2 i Elements > 128 are converted to an 8-bit binary sequence PB { i }; using dec2bin (P2) i 7) function of P2 i The element < 128 is converted to a 7-bit binary sequence PB { i } and the end of PB { i } is added with binary '1', i.e. PB { i } = [ PB { i }, '1']。
5. The garbage classification code generator based on combined encryption of claim 1The method is characterized in that: the numerical sequence in step (4)Conversion of Chinese elements into Chinese characters, meaning a sequence of numerical valuesTwo adjacent elements in the group of 1 adopt native2unicode (·) functions in sequence, namelyObtaining Chinese character sequence
6. The method for generating spam classification codes based on combination encryption according to claim 1, wherein: the identity of the garbage bag is displayed in the step (4) (S) 1 S 2 ...S k S k+L+p+1 S k+L+p+2 ...S k+L+p+n S k+L+p+n+1 S k+L+p+n+2 ) The garbage classification code is generated by combining the garbage classification number and a garbage bag identity display code, which is expressed as the combination mode of inserting and connecting the garbage bag identity display code and the garbage classification numberWherein S 1 S 2 …S k 、S k+L+p+1 S k+L+p+2 …S k+L+p+n 、And S k+L+p+n+1 S k+L+p+n+2 The English spaces are mutually spaced.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210505409.3A CN115358361A (en) | 2022-05-10 | 2022-05-10 | Garbage classification code generation method based on combined encryption |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210505409.3A CN115358361A (en) | 2022-05-10 | 2022-05-10 | Garbage classification code generation method based on combined encryption |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115358361A true CN115358361A (en) | 2022-11-18 |
Family
ID=84030707
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210505409.3A Withdrawn CN115358361A (en) | 2022-05-10 | 2022-05-10 | Garbage classification code generation method based on combined encryption |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115358361A (en) |
-
2022
- 2022-05-10 CN CN202210505409.3A patent/CN115358361A/en not_active Withdrawn
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110033066B (en) | Method for generating color garbage classification two-dimensional code | |
CN112116046B (en) | Garbage classification two-dimensional code generation method based on layered encryption | |
CN109933755B (en) | Method for generating garbage classification code | |
CN100518064C (en) | Credit sign accidental streakline generating method | |
Lifset et al. | Where has all the copper gone: The stocks and flows project, part 1 | |
CN109977371B (en) | Method for generating character type garbage classification code | |
CN115358362A (en) | Garbage classification two-dimensional code generation method based on chaotic encryption | |
CN115358361A (en) | Garbage classification code generation method based on combined encryption | |
CN109981245A (en) | A kind of encryption and decryption method of character string | |
CN115455248A (en) | Urban carbon emission monitoring method based on data analysis | |
CN114997353A (en) | Garbage classification two-dimensional code generation method based on block encryption | |
CN112183698B (en) | Chinese character garbage classification two-dimensional code generation method | |
CN114881189A (en) | Garbage classification two-dimensional code generation method based on different combination modes | |
CN112183697B (en) | Garbage classification two-dimensional code batch generation method | |
CN102509058B (en) | Point type GIS vector data disguise and recovery method based on redundant bit replacement | |
CN101727677A (en) | Method for mutual conversion between two-dimensional view and three--dimensional view in mine model | |
CN114239918B (en) | Mobile compression equipment patrol optimizing method based on E2SFCA reachability analysis | |
CN101997954A (en) | Encryption and decryption accessory for communication terminal | |
CN101762265A (en) | Method of interconversion between two-dimensional drawing and three-dimensional model in mine model | |
CN114707165A (en) | Character string encryption method based on hierarchical scrambling | |
CN102254126A (en) | Robust-based natural language Hash domain spread spectrum watermarking coding algorithm for | |
CN112260822B (en) | Structured digital watermark encryption method and device | |
Wang | Study on sustainable utilization strategy of the mining wastelands | |
CN116562897B (en) | Anti-counterfeiting traceability system and method based on cloud computing | |
Abdurashidovich | Special Issue On Environmental Management In The Small-Scale Mining Industry |
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 | ||
WW01 | Invention patent application withdrawn after publication | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20221118 |