CN112561015A - Bar code encoding and decoding method, device, system, equipment and medium - Google Patents

Bar code encoding and decoding method, device, system, equipment and medium Download PDF

Info

Publication number
CN112561015A
CN112561015A CN202011524983.0A CN202011524983A CN112561015A CN 112561015 A CN112561015 A CN 112561015A CN 202011524983 A CN202011524983 A CN 202011524983A CN 112561015 A CN112561015 A CN 112561015A
Authority
CN
China
Prior art keywords
information
target
piece
encryption
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011524983.0A
Other languages
Chinese (zh)
Other versions
CN112561015B (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.)
Gree Electric Appliances Inc of Zhuhai
Zhuhai Lianyun Technology Co Ltd
Original Assignee
Gree Electric Appliances Inc of Zhuhai
Zhuhai Lianyun Technology Co Ltd
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 Gree Electric Appliances Inc of Zhuhai, Zhuhai Lianyun Technology Co Ltd filed Critical Gree Electric Appliances Inc of Zhuhai
Priority to CN202011524983.0A priority Critical patent/CN112561015B/en
Publication of CN112561015A publication Critical patent/CN112561015A/en
Application granted granted Critical
Publication of CN112561015B publication Critical patent/CN112561015B/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • 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/06046Constructional details
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/1408Methods for optical code recognition the method being specifically adapted for the type of code
    • G06K7/14172D bar codes

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Toxicology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Artificial Intelligence (AREA)
  • Electromagnetism (AREA)
  • Bioethics (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Storage Device Security (AREA)

Abstract

The invention discloses a method, a device, a system, equipment and a medium for coding and decoding bar codes, wherein the method acquires information in all the bar codes, determines the number of the bar codes carrying the information aiming at each piece of information, encrypts the information based on the number of the bar codes carrying the information, concentrates the encrypted information in a target two-dimensional code, and determines an encryption key based on the encryption grade of the information when encrypting the information, thereby improving the safety of the information.

Description

Bar code encoding and decoding method, device, system, equipment and medium
Technical Field
The invention relates to the technical field of bar codes, in particular to a bar code encoding and decoding method, device, system, equipment and medium.
Background
In the final assembly process of the commodity, the commodity uses a plurality of accessories, and in order to trace the source of the commodity, the bar code of each accessory is adhered to the commodity. In addition, for the purposes of code scanning payment, tracking of the production process and the like, other barcodes that implement different functions, such as Manufacturing enterprise production System (MES) codes and manufacturer codes, need to be used in the goods, thereby causing misuse of the barcodes. The barcode comprises a one-dimensional barcode and a two-dimensional barcode, and when the one-dimensional barcode in the existing barcode is damaged, information in the one-dimensional barcode cannot be read, so that the robustness of the information in the barcode in the prior art is poor;
the information in the bar code in the prior art can be public information which is not encrypted, but a manufacturer aims to protect the process, so the information in the bar code can also be encrypted, if the information in the bar code is the public information which is not encrypted, the safety of the public information is low, even if the information is encrypted, because the information does not distinguish the crowd with the reading authority during encryption, all the crowd can see the encrypted information, and the safety of the information in the bar code in the prior art is also low.
Disclosure of Invention
The embodiment of the invention provides a method, a device, a system, equipment and a medium for encoding and decoding a bar code, which are used for solving the problems of poor robustness and low safety in the prior art.
The embodiment of the invention provides a bar code encoding method, which comprises the following steps:
acquiring each piece of information carried by at least two bar codes to be processed;
determining a first number of target bar codes carrying the information according to the acquired information, and determining a target encryption level of the information according to the first number and a second number of bar codes to be processed;
and encrypting each piece of corresponding information by adopting the corresponding target encryption key according to the target encryption level of each piece of information and the corresponding relation between the pre-stored encryption level and the encryption key to generate a target two-dimensional code.
Further, the determining the target encryption level of the bar code according to the first number and the second number of the bar codes to be processed includes:
and determining the target encryption level of the piece of information according to the difference value between the second quantity and the first quantity, wherein the smaller the difference value is, the lower the target encryption level is, and if the difference value is 0, the target encryption level is a non-encryption level.
Further, before encrypting each piece of corresponding information with the corresponding target encryption key according to the target encryption level of each piece of information and the corresponding relationship between the pre-stored encryption level and the encryption key, the method further includes:
aiming at each piece of information, determining a target identification information combination corresponding to the piece of information according to the identification information of each target bar code carrying the piece of information;
the encrypting each corresponding piece of information by using the corresponding target encryption key according to the target encryption level of each piece of information and the corresponding relationship between the pre-stored encryption level and the encryption key comprises:
and aiming at each piece of information, determining a target encryption key corresponding to the target identification information combination according to the target identification information combination corresponding to the piece of information and the corresponding relationship between each identification information combination and the encryption key which are stored in advance, and encrypting the piece of information by adopting the target encryption key.
The embodiment of the invention also provides a bar code decoding method, which comprises the following steps:
decoding the target two-dimensional code and reading each piece of encrypted information;
receiving an input target decryption key, and decrypting each piece of encrypted information by adopting the target decryption key;
and acquiring the content corresponding to the target encryption information which is decrypted successfully.
Further, the method further comprises:
judging whether a preset messy code exists in the content;
and if the preset messy codes exist in the content, determining that the content verification fails, and outputting and displaying prompt information of the damage of the target encryption information.
Correspondingly, the embodiment of the invention provides a bar code coding device, which comprises:
the acquisition module is used for acquiring each piece of information carried by at least two bar codes to be processed;
the determining module is used for determining a first number of target bar codes carrying the information aiming at the acquired information, and determining a target encryption level of the information according to the first number and a second number of the bar codes to be processed;
and the encryption module is used for encrypting each piece of corresponding information by adopting the corresponding target encryption key according to the target encryption level of each piece of information and the corresponding relation between the pre-stored encryption level and the encryption key so as to generate the target two-dimensional code.
Further, the determining module is specifically configured to determine a target encryption level of the piece of information according to a difference between the second quantity and the first quantity, where the smaller the difference is, the lower the target encryption level is, and if the difference is 0, the target encryption level is a non-encryption level.
Further, the determining module is further configured to determine, for each piece of information, a target identification information combination corresponding to the piece of information according to identification information of each target barcode carrying the piece of information;
the encryption module is specifically configured to determine, for each piece of information, a target encryption key corresponding to the target identification information combination according to the target identification information combination corresponding to the piece of information and a pre-stored correspondence relationship between each identification information combination and an encryption key, and encrypt the piece of information by using the target encryption key.
Accordingly, an embodiment of the present invention provides a barcode decoding apparatus, including:
the reading module is used for decoding the target two-dimensional code and reading each piece of encrypted information;
the decryption module is used for receiving an input target decryption key and decrypting each piece of encrypted information by adopting the target decryption key;
and the acquisition module is used for acquiring the content corresponding to the successfully decrypted target encryption information.
Further, the apparatus further comprises:
the judging module is used for judging whether preset messy codes exist in the content;
and the output module is used for determining that the content verification does not pass if the preset messy codes exist in the content, and outputting and displaying prompt information of the damage of the target encryption information.
Correspondingly, the embodiment of the invention provides a bar code coding and decoding system, which comprises any one of the devices in the bar code coding device and any one of the devices in the bar code decoding device.
Accordingly, an embodiment of the present invention provides an electronic device, which includes a processor and a memory, where the memory is used to store program instructions, and the processor is used to implement, when executing a computer program stored in the memory, the steps of any one of the above barcode encoding methods, or the steps of any one of the above barcode decoding methods.
Accordingly, embodiments of the present invention provide a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the computer program implements the steps of any of the above-mentioned barcode encoding methods and the steps of any of the above-mentioned barcode decoding methods.
The embodiment of the invention provides a method, a device, a system, equipment and a medium for coding and decoding bar codes, wherein the method is used for acquiring information in all the bar codes, determining the number of the bar codes carrying the information aiming at each piece of information, encrypting the information based on the number of the bar codes carrying the information, concentrating the encrypted information in a target two-dimensional code, and determining an encryption key based on the encryption level of the information when encrypting the information, so that the safety of the information is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic process diagram of a barcode encoding method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a barcode to be processed according to an embodiment of the present invention;
fig. 3 is a schematic diagram of a target two-dimensional code according to an embodiment of the present invention;
FIG. 4 is a schematic process diagram of a barcode decoding method according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a barcode encoding apparatus according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a barcode decoding apparatus according to an embodiment of the present invention;
FIG. 7 is a schematic structural diagram of a barcode encoding and decoding system according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In order to improve the security and robustness of information in a barcode, embodiments of the present invention provide a barcode encoding method, a barcode decoding method, a barcode encoding device, a barcode decoding device, a barcode encoding system, a barcode decoding system, a barcode encoding apparatus, a barcode decoding apparatus, and a barcode encoding medium.
Example 1:
fig. 1 is a schematic process diagram of a barcode encoding method provided in an embodiment of the present invention, where the process includes the following steps:
s101: and acquiring each piece of information carried by at least two bar codes to be processed.
The bar code coding method provided by the embodiment of the invention is applied to electronic equipment capable of realizing information encryption and coding, wherein the electronic equipment can be a two-dimensional code encoder comprising a symmetric encryptor and also can be intelligent terminal equipment capable of realizing information encryption and coding.
In order to reduce the number of bar codes and improve the security of information in the bar codes, in the embodiment of the invention, the electronic device can encrypt the information in the bar codes to generate a two-dimensional code, and in order to encrypt the information in the bar codes, the electronic device firstly acquires each piece of information carried in the bar codes.
In the embodiment of the invention, the bar code is a bar code to be processed, namely the bar code which is encrypted in the bar code, the number of the bar codes to be processed is at least two, and the bar code to be processed comprises a one-dimensional bar code and a two-dimensional bar code.
The electronic device obtains each piece of information carried by the barcode to be processed, and specifically, the electronic device scans the barcode to be processed, decodes the barcode, and obtains each piece of information carried by the barcode. Because the same information may exist in each piece of information carried in the bar code, the electronic device can also remove redundant information repeated in the information after acquiring each piece of information.
S102: and determining a first number of target bar codes carrying the information according to the acquired information, and determining a target encryption level of the information according to the first number and a second number of the bar codes to be processed.
In order to encrypt information, in the embodiment of the invention, because the information is disclosed to different degrees, the encryption level required by the information is different. In the embodiment of the invention, if the number of times of a certain piece of information appearing in a bar code is more, the higher the disclosure degree of the piece of information is, the lower the encryption level required by the piece of information is; if the number of times of the bar information appearing in the bar code is lower, the lower the disclosure degree of the bar information is, and the higher the encryption level required by the bar information is.
In order to determine the specific encryption level of each piece of information, the electronic device may further determine, for each piece of acquired information, a first number of target barcodes carrying the piece of information, and specifically, after the electronic device acquires each piece of information carried by each barcode, may determine, for each piece of information, a target barcode carrying the piece of information, so as to determine the first number of target barcodes.
After the electronic equipment determines the first number of the target bar codes carrying the bar information, in order to determine the specific encryption level of the bar information based on the disclosure degree of the bar information, the electronic equipment also stores the second number of the bar codes to be processed in advance, and according to the first number and the second number, the electronic equipment determines the target encryption level of the bar information.
S103: and encrypting each piece of corresponding information by adopting the target encryption key according to the target encryption level of each piece of information and the corresponding relation between the pre-stored encryption level and the encryption key to generate the target two-dimensional code.
In order to encrypt information, the electronic device prestores a corresponding relation between an encryption level and an encryption key, and according to a target encryption level of each piece of information, the electronic device determines a target encryption key corresponding to the target encryption level in the corresponding relation.
And according to the target encryption key, the electronic equipment encrypts each piece of corresponding information by adopting the target encryption key. Specifically, the electronic device encrypts the target encryption key based on the existing encryption algorithm to obtain encrypted information. The encryption algorithm for encrypting each piece of information may be the same or different, preferably, the encryption algorithm for encrypting each piece of information is the same, and the electronic device may employ a symmetric encryption method for encrypting each piece of information. Encrypting information in a symmetric encryption manner is the prior art, and the embodiment of the present invention is not described herein in detail.
According to the embodiment of the invention, the information in all the bar codes is acquired, the number of the bar codes carrying the information is determined for each piece of information, the information is encrypted based on the number of the bar codes carrying the information, the encrypted information is concentrated in one target two-dimensional code, and the encryption key is determined based on the encryption level of the information when the information is encrypted, so that the safety of the information is improved.
Example 2:
to determine the encryption level of the information, on the basis of the above embodiment, in an embodiment of the present invention, the determining the target encryption level of the piece of information according to the first number and the second number of barcodes to be processed includes:
and determining the target encryption level of the piece of information according to the difference value between the second quantity and the first quantity, wherein the smaller the difference value is, the lower the target encryption level is, and if the difference value is 0, the target encryption level is a non-encryption level.
In order to determine the encryption level of the information, after the electronic equipment determines a first number of target barcodes carrying the piece of information and a second number of barcodes to be processed, the electronic equipment determines a difference value between the second number and the first number, and the difference value is determined as the target encryption level of the piece of information.
If the difference is 0, the disclosure degree of the bar information is completely disclosed, that is, each bar code to be processed carries the bar information, so that the target encryption level of the bar information is a non-encryption level. If the difference value is 1, the target encryption level of the piece of information is a first encryption level; if the difference value is 2, the target encryption level of the piece of information is a second encryption level, and the second encryption level is higher than the first encryption level; if the first number of the target bar codes carrying the piece of information is 1, only one target bar code carries the piece of information, and when the difference value is the difference value between the second number and 1, the encryption level of the piece of information is the highest encryption level.
Example 3:
in order to improve the accuracy of information encryption, on the basis of the foregoing embodiments, in an embodiment of the present invention, before encrypting each piece of corresponding information with a corresponding target encryption key according to the target encryption level of each piece of information and a corresponding relationship between a pre-stored encryption level and an encryption key, the method further includes:
aiming at each piece of information, determining a target identification information combination corresponding to the piece of information according to the identification information of each target bar code carrying the piece of information;
the encrypting each corresponding piece of information by using the corresponding target encryption key according to the target encryption level of each piece of information and the corresponding relationship between the pre-stored encryption level and the encryption key comprises:
and aiming at each piece of information, determining a target encryption key corresponding to the target identification information combination according to the target identification information combination corresponding to the piece of information and the corresponding relationship between each pre-stored identification information combination and the encryption key, and encrypting the piece of information by adopting the target encryption key.
In order to improve the accuracy of information encryption, in the embodiment of the present invention, the information corresponding to the same encryption level is different, so that after the electronic device determines the target encryption level of the piece of information, the electronic device may further determine the identification information of the piece of information in order to distinguish the information.
Because each bar code to be processed has corresponding identification information, the electronic equipment determines a target identification information combination corresponding to each piece of information according to the identification information of each target bar code carrying the piece of information, and the target identification information combination is the identification information of the piece of information.
The identification information of the bar code can be numbers, letters or other information for uniquely identifying the bar code. For example, the identification information of the barcode is 1, 2, 3, 4, or the identification information of the barcode is the letter A, B, C, D. When the identification information of the barcode is a letter A, B, C, D, if the identification information of the target barcode carrying the bar information is A, B, C, determining that the target identification information combination corresponding to the bar information is ABC, wherein the target identification information combination does not distinguish the sequence of each piece of identification information, and the target identification information combination BCA and ABC belong to the corresponding target identification information combination, i.e., the identification information of the bar information.
After the electronic device determines the target identification information combination corresponding to the piece of information, in order to determine the target encryption key of the piece of information, the electronic device also prestores the corresponding relationship between each identification information combination and the encryption key, determines the target encryption key corresponding to the target identification information combination in the corresponding relationship, and encrypts the piece of information by using the target encryption key.
Example 4:
fig. 2 is a schematic diagram of a barcode to be processed according to an embodiment of the present invention, and fig. 2 shows that the barcode to be processed in fig. 2 includes three barcodes to be processed, where the length and the width of each barcode are different, information carried in the barcode may be public unencrypted information or information encrypted based on an existing asymmetric encryption method, and the electronic device is an adapted two-dimensional code encoder in which a symmetric encryptor is added to a front end of a general encoder.
Fig. 3 is a schematic view of a target two-dimensional code according to an embodiment of the present invention, as shown in fig. 3, the target two-dimensional code is included in fig. 3, and information carried by the target two-dimensional code is information obtained by symmetrically encrypting information carried by three barcodes to be processed.
The recomposed two-dimensional code encoder acquires information carried by three bar codes, wherein the identification information of the three bar codes is A, B, C respectively, and for each piece of information, a target identification information combination corresponding to the piece of information is determined according to the identification information of each target bar code carrying the piece of information; the target identification information combination of the encrypted information determined in the embodiment of the invention comprises complete public (ABC), semi-private (AB) and full private (A), which respectively correspond to three groups of people, namely all people A, people B with the authority of reading the information corresponding to the identification information combination AB, and people C with the authority of reading the information corresponding to the identification information combination A.
And determining a target encryption key corresponding to the target identification information combination according to the target identification information combination corresponding to each piece of information and the corresponding relationship between each identification information combination and the encryption key which are stored in advance. The target encryption key corresponding to the identification information combination AB is the encryption key for the authority authentication of the group B, and the target encryption key corresponding to the identification information combination A is the encryption key for the authority authentication of the group C.
And encrypting each piece of information by adopting a corresponding target encryption key, wherein the encryption algorithms when each piece of information is encrypted are the same and are the existing encryption algorithms, adopting a two-dimensional code encoding method in the prior art, and masking the encoded result to generate a target two-dimensional code.
Example 5:
fig. 4 is a schematic process diagram of a barcode decoding method according to an embodiment of the present invention, where the process includes the following steps:
s401: and decoding the target two-dimensional code and reading each piece of encrypted information.
In the embodiment of the invention, the bar code decoding method is applied to electronic equipment, wherein the electronic equipment can be a two-dimensional code selective reader or intelligent terminal equipment for realizing information decoding and decryption.
The electronic equipment decodes the target two-dimensional code and reads each piece of encrypted information carried by the target two-dimensional code.
The electronic equipment directly reads the content corresponding to the encryption information of the non-encryption grade if the encryption grade is the non-encryption grade; and if the encryption level is other levels except the non-encryption level, the electronic equipment reads the encryption information.
S402: and receiving an input target decryption key, and decrypting each piece of encrypted information by adopting the target decryption key.
The electronic device receives an input target decryption key, where the target decryption key is a key for decrypting encrypted information, and the target decryption key may determine the input target decryption key according to a received click operation on a keyboard or may determine the input target decryption key according to a received click operation on a screen, which is not limited in this specific embodiment of the present invention.
After receiving the input target decryption key, the electronic device decrypts each piece of encrypted information by using the target decryption key, if the target decryption key is the same as the encryption key used when the encrypted information is encrypted, the encrypted information can be successfully decrypted, and if the target decryption key is different from the encryption key used when the encrypted information is encrypted, the encrypted information cannot be successfully decrypted.
S403: and acquiring the content corresponding to the target encryption information which is decrypted successfully.
And after the electronic equipment successfully decrypts the encrypted information, acquiring the content corresponding to the successfully decrypted target encrypted information, and displaying the content on a screen of the electronic equipment.
In addition, because the information carried by the target two-dimensional code is encrypted information, the content corresponding to the encrypted information can be obtained only after the encrypted information is successfully decrypted, and the information security is improved.
Example 6:
on the basis of the above embodiment, in an embodiment of the present invention, to verify content in the encrypted information, the method further includes:
judging whether a preset messy code exists in the content;
and if the preset messy codes exist in the content, determining that the content verification fails, and outputting and displaying prompt information of the damage of the target encryption information.
In the embodiment of the present invention, after the electronic device obtains the content corresponding to the successfully decrypted target encrypted information, since the information may be damaged in the encryption process, the electronic device may also verify the content in the encrypted information.
After the content corresponding to the successfully decrypted target encryption information is obtained, the electronic equipment judges whether a preset messy code exists in the content corresponding to the successfully decrypted target encryption information or not in order to verify the content, wherein the preset messy code is preset.
If the content corresponding to the successfully decrypted target encryption information has the preset messy codes, it is determined that the content is not verified, so as to facilitate the user to know the reason why the user cannot read the content, and a prompt message for displaying the damage of the target encryption information is output, where the prompt message may be a message in a text form or a message in a voice form, and the embodiment of the present invention is not limited thereto.
Example 7:
the bar code decoding method is applied to a two-dimensional code selective reader, the two-dimensional code selective reader comprises a decoding display rear end, an automatic importer and a symmetric encryptor, and each piece of encrypted information is decoded and read after a target two-dimensional code image is scanned.
Taking the target two-dimensional code as the target two-dimensional code shown in fig. 3 as an example, the identification information of the barcode to be processed included in fig. 3 is A, B, C, so the target identification information combination of the encrypted information carried by the target two-dimensional code includes ABC, AB, and a.
Therefore, the two-dimensional code selective reader reads each piece of encryption information, including the encryption information of the unencrypted level corresponding to ABC, the encryption information of the first encryption level corresponding to AB, and the encryption information of the second encryption level corresponding to A, the encryption information is arranged into three parts according to the encryption levels at this time, the encryption information corresponding to AB and A enters the symmetric encryptor for decryption through the automatic importer, in the decryption process of the symmetric encryptor, the symmetric encryptor of the two-dimensional code selective reader decrypts the encryption information corresponding to AB and A according to the target decryption key, and the content corresponding to the target encryption information which is decrypted successfully is obtained.
Example 8:
fig. 5 is a schematic structural diagram of a barcode encoding apparatus provided in an embodiment of the present invention, where the apparatus includes:
an obtaining module 501, configured to obtain each piece of information carried by at least two barcodes to be processed;
a determining module 502, configured to determine, for each piece of acquired information, a first number of target barcodes carrying the piece of information, and determine, according to the first number and a second number of barcodes to be processed, a target encryption level of the piece of information;
the encryption module 503 is configured to encrypt each piece of corresponding information by using a corresponding target encryption key according to the target encryption level of each piece of information and a correspondence between a pre-stored encryption level and an encryption key, so as to generate a target two-dimensional code.
Further, the determining module is specifically configured to determine a target encryption level of the piece of information according to a difference between the second quantity and the first quantity, where the smaller the difference is, the lower the target encryption level is, and if the difference is 0, the target encryption level is a non-encryption level.
Further, the determining module is further configured to determine, for each piece of information, a target identification information combination corresponding to the piece of information according to identification information of each target barcode carrying the piece of information;
the encryption module is specifically configured to determine, for each piece of information, a target encryption key corresponding to the target identification information combination according to the target identification information combination corresponding to the piece of information and a pre-stored correspondence relationship between each identification information combination and an encryption key, and encrypt the piece of information by using the target encryption key.
Example 9:
fig. 6 is a schematic structural diagram of a barcode decoding apparatus according to an embodiment of the present invention, where the apparatus includes:
the reading module 601 is configured to decode the target two-dimensional code and read each piece of encrypted information;
a decryption module 602, configured to receive an input target decryption key, and decrypt each piece of encrypted information by using the target decryption key;
the obtaining module 603 is configured to obtain content corresponding to the target encrypted information that is decrypted successfully.
Further, the apparatus further comprises:
the judging module is used for judging whether preset messy codes exist in the content;
and the output module is used for determining that the content verification does not pass if the preset messy codes exist in the content, and outputting and displaying prompt information of the damage of the target encryption information.
Example 10:
fig. 7 is a schematic structural diagram of a barcode encoding and decoding system provided in an embodiment of the present invention, and on the basis of the foregoing embodiments, the embodiment of the present invention further provides a barcode encoding and decoding system, which includes a barcode encoding device 701 for executing any one of the barcode encoding methods and a barcode decoding device 702 for executing any one of the barcode decoding methods.
The barcode encoding apparatus 701 includes the module included in embodiment 8, and is configured to execute any one of the barcode encoding methods in embodiments 1 to 4.
The barcode decoding apparatus 702 includes the modules included in the foregoing embodiment 9, and is configured to execute any one of the barcode decoding methods in the foregoing embodiments 5 to 7.
Example 11:
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, and on the basis of the foregoing embodiments, an electronic device according to an embodiment of the present invention is further provided, where the electronic device includes a processor 801, a communication interface 802, a memory 803, and a communication bus 804, where the processor 801, the communication interface 802, and the memory 803 complete communication with each other through the communication bus 804;
the memory 803 has stored therein a computer program which, when executed by the processor 801, causes the processor 801 to perform the steps of:
acquiring each piece of information carried by at least two bar codes to be processed;
determining a first number of target bar codes carrying the information according to the acquired information, and determining a target encryption level of the information according to the first number and a second number of bar codes to be processed;
and encrypting each piece of corresponding information by adopting the corresponding target encryption key according to the target encryption level of each piece of information and the corresponding relation between the pre-stored encryption level and the encryption key to generate a target two-dimensional code.
Further, the processor 801 is specifically configured to determine, according to the first number and the second number of barcodes to be processed, a target encryption level of the piece of information includes:
and determining the target encryption level of the piece of information according to the difference value between the second quantity and the first quantity, wherein the smaller the difference value is, the lower the target encryption level is, and if the difference value is 0, the target encryption level is a non-encryption level.
Further, the processor 801 is further configured to, before encrypting each corresponding piece of information with the corresponding target encryption key according to the target encryption level of each piece of information and a corresponding relationship between a pre-stored encryption level and an encryption key, the method further includes:
aiming at each piece of information, determining a target identification information combination corresponding to the piece of information according to the identification information of each target bar code carrying the piece of information;
the encrypting each corresponding piece of information by using the corresponding target encryption key according to the target encryption level of each piece of information and the corresponding relationship between the pre-stored encryption level and the encryption key comprises:
and aiming at each piece of information, determining a target encryption key corresponding to the target identification information combination according to the target identification information combination corresponding to the piece of information and the corresponding relationship between each identification information combination and the encryption key which are stored in advance, and encrypting the piece of information by adopting the target encryption key.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface 802 is used for communication between the above-described electronic apparatus and other apparatuses.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Alternatively, the memory may be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a central processing unit, a Network Processor (NP), and the like; but may also be a Digital instruction processor (DSP), an application specific integrated circuit, a field programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or the like.
Example 12:
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, and on the basis of the foregoing embodiments, an electronic device according to an embodiment of the present invention is further provided, and includes a processor 901, a communication interface 902, a memory 903, and a communication bus 904, where the processor 901, the communication interface 902, and the memory 903 complete communication with each other through the communication bus 904;
the memory 903 has stored therein a computer program which, when executed by the processor 901, causes the processor 901 to perform the steps of:
decoding the target two-dimensional code and reading each piece of encrypted information;
receiving an input target decryption key, and decrypting each piece of encrypted information by adopting the target decryption key;
and acquiring the content corresponding to the target encryption information which is decrypted successfully.
Further, the processor 901 is further configured to determine whether a preset messy code exists in the content;
and if the preset messy codes exist in the content, determining that the content verification fails, and outputting and displaying prompt information of the damage of the target encryption information.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface 902 is used for communication between the electronic apparatus and other apparatuses.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Alternatively, the memory may be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a central processing unit, a Network Processor (NP), and the like; but may also be a Digital instruction processor (DSP), an application specific integrated circuit, a field programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or the like.
Example 13:
on the basis of the foregoing embodiments, an embodiment of the present invention further provides a computer-readable storage medium, which stores a computer program, where the computer program is executed by a processor to perform the following steps:
acquiring each piece of information carried by at least two bar codes to be processed;
determining a first number of target bar codes carrying the information according to the acquired information, and determining a target encryption level of the information according to the first number and a second number of bar codes to be processed;
and encrypting each piece of corresponding information by adopting the corresponding target encryption key according to the target encryption level of each piece of information and the corresponding relation between the pre-stored encryption level and the encryption key to generate a target two-dimensional code.
Further, the determining the target encryption level of the bar code according to the first number and the second number of the bar codes to be processed includes:
and determining the target encryption level of the piece of information according to the difference value between the second quantity and the first quantity, wherein the smaller the difference value is, the lower the target encryption level is, and if the difference value is 0, the target encryption level is a non-encryption level.
Further, before encrypting each piece of corresponding information with the corresponding target encryption key according to the target encryption level of each piece of information and the corresponding relationship between the pre-stored encryption level and the encryption key, the method further includes:
aiming at each piece of information, determining a target identification information combination corresponding to the piece of information according to the identification information of each target bar code carrying the piece of information;
the encrypting each corresponding piece of information by using the corresponding target encryption key according to the target encryption level of each piece of information and the corresponding relationship between the pre-stored encryption level and the encryption key comprises:
and aiming at each piece of information, determining a target encryption key corresponding to the target identification information combination according to the target identification information combination corresponding to the piece of information and the corresponding relationship between each identification information combination and the encryption key which are stored in advance, and encrypting the piece of information by adopting the target encryption key.
Example 14:
on the basis of the foregoing embodiments, an embodiment of the present invention further provides a computer-readable storage medium, which stores a computer program, where the computer program is executed by a processor to perform the following steps:
decoding the target two-dimensional code and reading each piece of encrypted information;
receiving an input target decryption key, and decrypting each piece of encrypted information by adopting the target decryption key;
and acquiring the content corresponding to the target encryption information which is decrypted successfully.
Further, the method further comprises:
judging whether a preset messy code exists in the content;
and if the preset messy codes exist in the content, determining that the content verification fails, and outputting and displaying prompt information of the damage of the target encryption information.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (13)

1. A method of barcode encoding, the method comprising:
acquiring each piece of information carried by at least two bar codes to be processed;
determining a first number of target bar codes carrying the information according to the acquired information, and determining a target encryption level of the information according to the first number and a second number of bar codes to be processed;
and encrypting each piece of corresponding information by adopting the corresponding target encryption key according to the target encryption level of each piece of information and the corresponding relation between the pre-stored encryption level and the encryption key to generate a target two-dimensional code.
2. The method of claim 1, wherein determining the target encryption level for the piece of information based on the first number and the second number of barcodes to be processed comprises:
and determining the target encryption level of the piece of information according to the difference value between the second quantity and the first quantity, wherein the smaller the difference value is, the lower the target encryption level is, and if the difference value is 0, the target encryption level is a non-encryption level.
3. The method according to claim 1, wherein before encrypting the corresponding piece of information with the corresponding target encryption key according to the target encryption level of the piece of information and the corresponding relationship between the pre-stored encryption level and the encryption key, the method further comprises:
aiming at each piece of information, determining a target identification information combination corresponding to the piece of information according to the identification information of each target bar code carrying the piece of information;
the encrypting each corresponding piece of information by using the corresponding target encryption key according to the target encryption level of each piece of information and the corresponding relationship between the pre-stored encryption level and the encryption key comprises:
and aiming at each piece of information, determining a target encryption key corresponding to the target identification information combination according to the target identification information combination corresponding to the piece of information and the corresponding relationship between each identification information combination and the encryption key which are stored in advance, and encrypting the piece of information by adopting the target encryption key.
4. A method of decoding a barcode, the method comprising:
decoding the target two-dimensional code and reading each piece of encrypted information;
receiving an input target decryption key, and decrypting each piece of encrypted information by adopting the target decryption key;
and acquiring the content corresponding to the target encryption information which is decrypted successfully.
5. The method of claim 4, further comprising:
judging whether a preset messy code exists in the content;
and if the preset messy codes exist in the content, determining that the content verification fails, and outputting and displaying prompt information of the damage of the target encryption information.
6. A bar code encoding device, the device comprising:
the acquisition module is used for acquiring each piece of information carried by at least two bar codes to be processed;
the determining module is used for determining a first number of target bar codes carrying the information aiming at the acquired information, and determining a target encryption level of the information according to the first number and a second number of the bar codes to be processed;
and the encryption module is used for encrypting each piece of corresponding information by adopting the corresponding target encryption key according to the target encryption level of each piece of information and the corresponding relation between the pre-stored encryption level and the encryption key so as to generate the target two-dimensional code.
7. The apparatus according to claim 6, wherein the determining module is specifically configured to determine a target encryption level of the piece of information according to a difference between the second number and the first number, where the smaller the difference is, the lower the target encryption level is, and if the difference is 0, the target encryption level is a non-encryption level.
8. The device of claim 6, wherein the determining module is further configured to determine, for each piece of information, a target identification information combination corresponding to the piece of information according to the identification information of each target barcode carrying the piece of information;
the encryption module is specifically configured to determine, for each piece of information, a target encryption key corresponding to the target identification information combination according to the target identification information combination corresponding to the piece of information and a pre-stored correspondence relationship between each identification information combination and an encryption key, and encrypt the piece of information by using the target encryption key.
9. A barcode decoding apparatus, the apparatus comprising:
the reading module is used for decoding the target two-dimensional code and reading each piece of encrypted information;
the decryption module is used for receiving an input target decryption key and decrypting each piece of encrypted information by adopting the target decryption key;
and the acquisition module is used for acquiring the content corresponding to the successfully decrypted target encryption information.
10. The apparatus of claim 9, further comprising:
the judging module is used for judging whether preset messy codes exist in the content;
and the output module is used for determining that the content verification does not pass if the preset messy codes exist in the content, and outputting and displaying prompt information of the damage of the target encryption information.
11. A barcode encoding and decoding system, the system comprising: the barcode encoding device of any one of claims 6 to 8 and the barcode decoding device of any one of claims 9 to 10.
12. An electronic device, characterized in that the electronic device comprises a processor and a memory, the memory being adapted to store program instructions, the processor being adapted to carry out the steps of the barcode encoding method according to any one of claims 1 to 3 or the steps of the barcode decoding method according to any one of claims 4 to 5 when executing a computer program stored in the memory.
13. A computer-readable storage medium, characterized in that it stores a computer program which, when being executed by a processor, carries out the steps of the barcode encoding method according to any one of claims 1 to 3 and the steps of the barcode decoding method according to any one of claims 4 to 5.
CN202011524983.0A 2020-12-22 2020-12-22 Bar code encoding and decoding method, device, system, equipment and medium Active CN112561015B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011524983.0A CN112561015B (en) 2020-12-22 2020-12-22 Bar code encoding and decoding method, device, system, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011524983.0A CN112561015B (en) 2020-12-22 2020-12-22 Bar code encoding and decoding method, device, system, equipment and medium

Publications (2)

Publication Number Publication Date
CN112561015A true CN112561015A (en) 2021-03-26
CN112561015B CN112561015B (en) 2022-04-05

Family

ID=75031344

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011524983.0A Active CN112561015B (en) 2020-12-22 2020-12-22 Bar code encoding and decoding method, device, system, equipment and medium

Country Status (1)

Country Link
CN (1) CN112561015B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113704814A (en) * 2021-07-26 2021-11-26 维沃移动通信(杭州)有限公司 Information management method and device
CN114330404A (en) * 2021-12-28 2022-04-12 易唯思智能自动化装备无锡有限公司 Two-dimensional code engraving effect verification method, system and storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006158846A (en) * 2004-12-10 2006-06-22 Samii Kk Game machine system and method, game machine, portable terminal and program
CN101668065A (en) * 2008-09-02 2010-03-10 银河联动信息技术(北京)有限公司 Method and system for transmitting, storing and displaying two-dimensional codes
CN102034127A (en) * 2009-09-28 2011-04-27 上海易悠通信息科技有限公司 Novel high-capacity two-dimensional barcode and system, encoding and decoding methods and applications thereof
CN102270294A (en) * 2011-08-12 2011-12-07 华南农业大学 Bar code and two-dimension code hybrid coding and decoding methods and devices
CN103632179A (en) * 2012-08-22 2014-03-12 上海育郡信息科技有限公司 Three-dimensional bar code encoding and decoding method and device
EP2940961A1 (en) * 2014-04-30 2015-11-04 Fujitsu Limited Device configuration for secure communication
CN105825257A (en) * 2016-03-09 2016-08-03 东北大学 Information hiding and hidden information extraction method based on two-dimensional barcode and information hiding and hidden information extraction system thereof
CN205486154U (en) * 2016-03-22 2016-08-17 洪灵坪 Convert bar code into in bar code scan rifle of two -dimensional code
CN106971213A (en) * 2016-01-13 2017-07-21 王硕腾 Coding method, coding/decoding method and the electronic installation of two-dimensional bar code

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006158846A (en) * 2004-12-10 2006-06-22 Samii Kk Game machine system and method, game machine, portable terminal and program
CN101668065A (en) * 2008-09-02 2010-03-10 银河联动信息技术(北京)有限公司 Method and system for transmitting, storing and displaying two-dimensional codes
CN102034127A (en) * 2009-09-28 2011-04-27 上海易悠通信息科技有限公司 Novel high-capacity two-dimensional barcode and system, encoding and decoding methods and applications thereof
CN102270294A (en) * 2011-08-12 2011-12-07 华南农业大学 Bar code and two-dimension code hybrid coding and decoding methods and devices
CN103632179A (en) * 2012-08-22 2014-03-12 上海育郡信息科技有限公司 Three-dimensional bar code encoding and decoding method and device
EP2940961A1 (en) * 2014-04-30 2015-11-04 Fujitsu Limited Device configuration for secure communication
CN106971213A (en) * 2016-01-13 2017-07-21 王硕腾 Coding method, coding/decoding method and the electronic installation of two-dimensional bar code
CN105825257A (en) * 2016-03-09 2016-08-03 东北大学 Information hiding and hidden information extraction method based on two-dimensional barcode and information hiding and hidden information extraction system thereof
CN205486154U (en) * 2016-03-22 2016-08-17 洪灵坪 Convert bar code into in bar code scan rifle of two -dimensional code

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
ABBAS M. AL-GHAILI; FIZA ABDUL RAHIM等: ""Efficient Implementation of 2D Barcode Verification Algorithm for IoT Applications"", 《2019 IEEE 5TH INTL CONFERENCE ON BIG DATA SECURITY ON CLOUD (BIGDATASECURITY), IEEE INTL CONFERENCE ON HIGH PERFORMANCE AND SMART COMPUTING, (HPSC) AND IEEE INTL CONFERENCE ON INTELLIGENT DATA AND SECURITY (IDS)》 *
施文杰: ""基于PKI技术的二维码安全性研究"", 《中国优秀博硕士论文全文数据库(硕士)信息科技辑》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113704814A (en) * 2021-07-26 2021-11-26 维沃移动通信(杭州)有限公司 Information management method and device
CN114330404A (en) * 2021-12-28 2022-04-12 易唯思智能自动化装备无锡有限公司 Two-dimensional code engraving effect verification method, system and storage medium

Also Published As

Publication number Publication date
CN112561015B (en) 2022-04-05

Similar Documents

Publication Publication Date Title
EP2765531B1 (en) Two-dimensional code authentication device, two-dimensional code authentication method and program
CN112561015B (en) Bar code encoding and decoding method, device, system, equipment and medium
CN106599964A (en) Two-dimensional code generation and verification method and device
JP2018513650A (en) Data forgery recognition method for two-dimensional code security check
CN111107066A (en) Sensitive data transmission method and system, electronic equipment and storage medium
CN105976005A (en) Two-dimensional code encrypting method, two-dimensional code generating device and two-dimensional code scanning device
TWI529641B (en) System for verifying data displayed dynamically by mobile and method thereof
CN105096143A (en) Anti-counterfeiting method, anti-counterfeiting system, server and intelligent terminal
CN104854597B (en) Certificate server, Verification System and authentication method
WO2020233047A1 (en) Page test method and apparatus
CN110113329B (en) Verification method and device for verification code
CN108667784B (en) System and method for protecting internet identity card verification information
CN113128999A (en) Block chain privacy protection method and device
CN111628863B (en) Data signature method and device, electronic equipment and storage medium
CN105139205A (en) Payment verification method, terminal and server
CN110942301B (en) Data processing method and device based on block chain, computer and storage medium
Mohan et al. Secure visual cryptography scheme with meaningful shares
CN109299944B (en) Data encryption method, system and terminal in transaction process
CN110598421B (en) Two-dimensional code encryption method and device and two-dimensional code decryption method and device
US7926050B2 (en) Secure method to update software in a security module
CN117251839A (en) Electronic fidelity method, system, computer and readable storage medium
CN113542187A (en) File uploading and downloading method and device, computer device and medium
CN112347458A (en) Password resetting method and device, terminal equipment and server
CN108038383A (en) File encrypting method, file decryption method and device
CN116451257B (en) Encryption method and system for database data and electronic equipment

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