CN111368575B - One-dimensional bar code encoding and decoding method and system - Google Patents

One-dimensional bar code encoding and decoding method and system Download PDF

Info

Publication number
CN111368575B
CN111368575B CN202010158144.5A CN202010158144A CN111368575B CN 111368575 B CN111368575 B CN 111368575B CN 202010158144 A CN202010158144 A CN 202010158144A CN 111368575 B CN111368575 B CN 111368575B
Authority
CN
China
Prior art keywords
bar code
dimensional bar
data
algorithm
characters
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010158144.5A
Other languages
Chinese (zh)
Other versions
CN111368575A (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.)
Inspur General Software Co Ltd
Original Assignee
Inspur General Software 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 Inspur General Software Co Ltd filed Critical Inspur General Software Co Ltd
Priority to CN202010158144.5A priority Critical patent/CN111368575B/en
Publication of CN111368575A publication Critical patent/CN111368575A/en
Application granted granted Critical
Publication of CN111368575B publication Critical patent/CN111368575B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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/14131D bar codes
    • 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
    • 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/1495Methods for optical code recognition the method including an image compression step

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (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)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

The invention discloses a one-dimensional bar code encoding and decoding method and a system, which convert original one-dimensional bar code data into decimal digital character strings; compressing the decimal number character string by adopting a compression algorithm; selecting an encryption algorithm to encrypt the decimal number character string; generating a one-dimensional bar code according to the current coding specification; resolving the generated one-dimensional bar code into compressed encrypted data according to the current coding specification; invoking a corresponding decryption algorithm and a key to decrypt; calling a corresponding decompression algorithm to decompress; outputting the decompressed decimal number character string; the invention converts the decimal number character string into the original one-dimensional bar code data. The method can compress the data of the current one-dimensional bar code, encrypt the current one-dimensional bar code, support reverse reading, reduce the length of the one-dimensional bar code, facilitate printing and ensure the safety of information.

Description

One-dimensional bar code encoding and decoding method and system
Technical Field
The invention relates to the technical field of computer information, in particular to a one-dimensional bar code coding and decoding method and a one-dimensional bar code coding and decoding system.
Background
The shape code is a symbol which combines lines and blanks according to a certain coding rule and is used for representing certain data such as letters, numbers and the like. When the identification is performed, a bar code reader is used for scanning to obtain a group of reflected light signals, the signals are converted into a group of electronic signals corresponding to lines and blanks after photoelectric conversion, and the electronic signals are decoded and restored into corresponding alphanumeric characters, so that the function of transmitting information can be realized.
The bar code is broadly used and comprises a one-dimensional bar code and a two-dimensional bar code, the one-dimensional bar code is firstly used, the one-dimensional bar code is printed on commodities purchased by people, the two-dimensional bar code is widely used at present, and compared with the one-dimensional bar code, the two-dimensional bar code can record more information, but the one-dimensional bar code is widely used in manufacturing industry and mainly applied to warehouse logistics, because each bar code of the one-dimensional bar code can record only one character information, the length of the one-dimensional bar code is increased along with the increase of information required to be recorded, the paper waste is serious when the one-dimensional bar code is printed, the longer one-dimensional bar code is inconvenient to recognize, the length of the one-dimensional bar code can be reduced by a method for reducing the gap of the one-dimensional bar code, but the bar code is adhered along with the low printing quality, and the one-dimensional bar code is affected and recognized.
The common one-dimensional bar code can be identified through various terminals, and the mobile phone app can identify the content of the one-dimensional bar code by taking a picture on the mobile phone, so that the security is poor, and the secret of an enterprise is easy to leak.
Disclosure of Invention
The invention aims to provide a one-dimensional bar code encoding and decoding method and system capable of generating a bar code with small length and high safety.
The technical scheme adopted by the invention is as follows:
the invention provides a one-dimensional bar code coding and decoding method, which comprises a coding process and a decoding process; wherein:
the encoding process comprises the following steps:
receiving original one-dimensional bar code data;
converting the original one-dimensional bar code data into decimal number character strings;
compressing the decimal number character string by adopting a compression algorithm;
outputting compressed data and generating a one-dimensional bar code according to the current coding specification;
the decoding process comprises the steps of:
resolving the generated one-dimensional bar code current coding specification into compressed data;
judging a compression algorithm used for compressing the data, and calling a corresponding decompression algorithm to decompress;
outputting the decompressed decimal number character string;
the decimal numeric string is converted into the original one-dimensional bar code data.
The invention provides another one-dimensional bar code coding and decoding method, which comprises a coding process and a decoding process; wherein:
the encoding process includes:
receiving original one-dimensional bar code data;
converting the original one-dimensional bar code data into decimal number character strings;
selecting an encryption algorithm to encrypt the decimal number character string;
outputting the encrypted data, and generating a one-dimensional bar code according to the current coding specification;
the decoding process includes:
resolving the generated one-dimensional bar code into encrypted data according to the current coding specification;
judging an encryption mode adopted by the encrypted data, and calling a corresponding decryption algorithm and a key to decrypt;
outputting the decrypted decimal number character string;
the decimal numeric string is converted into the original one-dimensional bar code data.
The invention provides another one-dimensional bar code coding and decoding method, which comprises a coding process and a decoding process; wherein:
the encoding process comprises the following steps:
receiving original one-dimensional bar code data;
converting the original one-dimensional bar code data into decimal number character strings;
compressing the decimal number character string by adopting a compression algorithm;
outputting compressed data, and selecting an encryption algorithm to encrypt the decimal number character string;
outputting compressed and encrypted data, and generating a one-dimensional bar code according to the current coding specification;
the decoding process comprises the steps of:
resolving the generated one-dimensional bar code into compressed encrypted data according to the current coding specification;
judging an encryption mode adopted by the encrypted data, and calling a corresponding decryption algorithm and a key to decrypt;
outputting decrypted compressed data, judging a compression algorithm used by the compressed data, and calling a corresponding decompression algorithm to decompress;
outputting the decompressed decimal number character string;
the decimal numeric string is converted into the original one-dimensional bar code data.
The invention provides another one-dimensional bar code coding and decoding method, which is characterized in that: comprises an encoding process and a decoding process; wherein:
the encoding process comprises the following steps:
receiving original one-dimensional bar code data;
converting the original one-dimensional bar code data into decimal number character strings;
selecting an encryption algorithm to encrypt the decimal number character string;
outputting the encrypted data, and selecting a compression algorithm for compression;
outputting compressed and encrypted data, and generating a one-dimensional bar code according to the current coding specification;
the decoding process comprises the steps of:
resolving the generated one-dimensional bar code into compressed encrypted data according to the current coding specification;
judging a compression algorithm used for compressing the data, and calling a corresponding decompression algorithm to decompress;
outputting the encrypted data, judging the encryption mode adopted by the encrypted data, and calling a corresponding decryption algorithm and a key to decrypt;
outputting the decrypted decimal number character string;
the decimal numeric string is converted into the original one-dimensional bar code data.
Specifically, the current one-dimensional bar code coding specification adopts code128 or code39 coding specification.
As a further optimization, the original one-dimensional bar code data of the invention comprises a number character of 0-9, a lower case english letter character of a-Z, an upper case english letter character of a-Z and a plurality of special symbol characters, wherein the special symbol characters comprise "-", "_", "x", "\"/", and" + ", and all the characters are respectively represented by a two-digit decimal number character and are stored in a comparison table.
As further optimization, the compression algorithm adopts one of a decimal-to-hexadecimal compression algorithm, a decimal-to-thirty-binary compression algorithm and a decimal-to-sixty-four compression algorithm.
As a further optimization, the encryption algorithm of the present invention adopts one of EAS encryption algorithm, AES encryption algorithm, DES encryption algorithm and 3DES encryption algorithm.
The invention also provides a one-dimensional bar code coding and decoding system, which comprises a client and a server, wherein the client is used for butting user demands and sending the user demands to the server, the server is used for processing the user demands and returning processed data to the client, and the server comprises a compression module, a decompression module, an encryption module, a decompression module, a compression encryption module and a decompression decryption module, wherein:
the compression module is used for compressing the data of the one-dimensional bar code by adopting a compression algorithm to form compressed data;
the decompression module is used for resolving the compressed data into original one-dimensional bar code data by adopting a corresponding decompression algorithm;
the encryption module is used for encrypting the original one-dimensional bar code data or the compressed data of one bar code by adopting an encryption algorithm to form encrypted data;
the decryption module is used for decrypting the encrypted data into data before encryption by adopting a corresponding decryption algorithm and a key;
the compression encryption module is used for compressing and encrypting the original one-dimensional bar code data by adopting a compression algorithm and an encryption algorithm, outputting compressed and encrypted data, and setting no sequence of compression and encryption;
the decompression decryption module is used for decompressing and decrypting the compressed and encrypted data by adopting a decryption algorithm and a decompression algorithm in reverse order, and outputting the original one-dimensional bar code data.
The invention has the following advantages:
1. the one-dimensional bar code encoding and decoding method provided by the invention can compress the current one-dimensional bar code data, support reverse reading, reduce the length of the one-dimensional bar code caused by excessive data, facilitate printing, waste printing paper and facilitate reading of a terminal;
2. the one-dimensional bar code encoding and decoding method provided by the invention can encrypt the existing one-dimensional bar code, supports reverse reading, can reduce the condition that the traditional one-dimensional bar code is easy to read, and improves the safety of the one-dimensional bar code;
3. the one-dimensional bar code encoding and decoding method provided by the invention can compress the current one-dimensional bar code data, encrypt the current one-dimensional bar code, support reverse reading, reduce the length of the one-dimensional bar code, facilitate printing and ensure the information security;
4. the coding method of the invention has wide character coverage and wider application range.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
The invention is further described below with reference to the accompanying drawings:
FIG. 1 is a schematic process diagram of one embodiment of the present invention;
FIG. 2 is a process schematic of another embodiment of the present invention;
FIG. 3 is a process schematic of another embodiment of the present invention.
Detailed Description
The invention will be further described with reference to the accompanying drawings and specific examples, so that those skilled in the art can better understand the invention and implement it, but the examples are not meant to limit the invention, and the technical features of the embodiments of the invention and the examples can be combined with each other without conflict.
It should be appreciated that in the description of embodiments of the invention, the words "first," "second," and the like are used merely for distinguishing between the descriptions and not for indicating or implying any relative importance or order. "plurality" in the embodiments of the present invention means two or more.
In the embodiment of the present invention, the "and/or" is merely an association relationship describing the association object, and the representation may have three relationships, for example, a and/or B may represent: a alone, B alone, and both A and B. In addition, the character "/" herein generally indicates that the front-rear associated object is an "or" relationship.
Example 1
As shown in fig. 1, the present embodiment provides a barcode generating method based on a one-dimensional barcode, which is used for solving the problem that the one-dimensional barcode is too long when the one-dimensional barcode contains too much content, and includes the following steps:
receiving original one-dimensional bar code data; in various one-dimensional bar code specifications, code128 codes support full asdi characters, code39 and code bar codes support numbers, letters and a small number of special characters, while other specifications refer to support numbers, in the embodiment, we select more common characters as original one-dimensional bar code data, including 0-9 digital characters, a-Z lower case English letter characters, A-Z upper case English letter characters and a plurality of special symbol characters, wherein the special symbol characters comprise "-", "_", "+", "/", and "+", and all the characters are respectively represented by two decimal digital characters and stored in a comparison table; the number characters of 0-9 are indicated as 00-09, the lower case letters of a-Z are indicated as 10-35, the upper case letters of a-Z are indicated as 36-61, and the remaining special characters are 62, 63, 64, 65, 66, 67, respectively;
converting the one-dimensional bar code data into decimal number character strings; converting each character in the bar code into a corresponding digital character string, wherein the character strings of all the characters are connected into decimal digital character strings corresponding to the original one-dimensional bar code;
compressing the decimal number character string compression algorithm; the compression algorithm adopts one of a decimal-to-hexadecimal compression algorithm, a decimal-to-thirty-binary compression algorithm and a decimal-to-sixty-four compression algorithm, a customer can select according to own requirements, the compression rate of the hexadecimal algorithm, the thirty-binary compression algorithm and the sixty-four compression algorithm is gradually increased, namely the compressed data is shorter, but the compression efficiency is quite opposite, namely the time spent is longer, and the customer can select according to own requirements.
The compressed data is output, the compressed data is generated into a one-dimensional bar code by adopting the current coding specification to generate a compressed one-dimensional bar code, the compressed one-dimensional bar code can be directly or indirectly printed on an article, the whole data of the one-dimensional bar code is reduced, the whole length is shortened, the occupied printing area is smaller, and the current one-dimensional bar code coding specification adopts the code128 or code39 coding specification.
As a reverse process, the generated compressed one-dimensional bar code should be able to be read, and the generated compressed one-dimensional bar code is input into a reading system by a code scanning gun or a manual input mode, and the reading system reads by the following method:
receiving compressed data; inputting the generated compressed one-dimensional bar code into a reading system by a code scanning gun or a manual input mode;
decompressing by a decompression algorithm corresponding to the compression algorithm; the compression algorithm adopts one of a decimal-to-hexadecimal compression algorithm, a decimal-to-thirty-binary compression algorithm and a decimal-to-sixty-four compression algorithm, and decompression is a reverse processing process, namely a hexadecimal-to-decimal decompression algorithm, a thirty-binary-to-decimal decompression algorithm and a sixty-four-to-decimal decompression algorithm, and the adopted compression algorithm adopts a corresponding reverse decompression algorithm.
The decompressed digital character string is translated into corresponding letters, letters and special symbols through a comparison table;
and outputting the decompressed original one-dimensional bar code data.
Example two
As shown in fig. 2, the present embodiment provides another barcode generating method based on a one-dimensional barcode, for solving the unsafe problem caused by that the one-dimensional barcode is easy to be read, and is characterized by comprising the following steps:
receiving original one-dimensional bar code data; in various one-dimensional bar code specifications, code128 codes support full asdi characters, code39 and code bar codes support numbers, letters and a small number of special characters, while other specifications refer to support numbers, in the embodiment, we select more common characters as original one-dimensional bar code data, including 0-9 digital characters, a-Z lower case English letter characters, A-Z upper case English letter characters and a plurality of special symbol characters, wherein the special symbol characters comprise "-", "_", "+", "/", and "+", and all the characters are respectively represented by two decimal digital characters and stored in a comparison table; the number characters of 0-9 are indicated as 00-09, the lower case letters of a-Z are indicated as 10-35, the upper case letters of a-Z are indicated as 36-61, and the remaining special characters are 62, 63, 64, 65, 66, 67, respectively;
selecting an encryption algorithm to encrypt the one-dimensional bar code data; the encryption algorithm adopts one of an EAS encryption algorithm, an AES encryption algorithm, a DES encryption algorithm and a 3DES encryption algorithm, and a client selects one encryption mode according to requirements;
and outputting the encrypted data, and generating a corresponding key by the encryption algorithm when outputting the encrypted data. The encrypted data is used for generating a one-dimensional bar code by adopting the current coding specification, and the current one-dimensional bar code coding specification adopts the code128 or the code39 coding specification. The encrypted one-dimensional bar code can be directly or indirectly printed on an article, only encrypted data is obtained after the encrypted one-dimensional bar code is scanned by a stranger, the stranger cannot obtain effective information from the encrypted one-dimensional bar code, and the safety is greatly enhanced.
As a reverse process, the generated compressed one-dimensional bar code should be able to be read, and the generated compressed one-dimensional bar code is input into a reading system by a code scanning gun or a manual input mode, and the reading system reads by the following method:
receiving the encrypted data;
judging the encrypted algorithm, and calling a corresponding decryption algorithm and a key to decrypt the data; in the above process, the encryption algorithm is one of EAS encryption algorithm, AES encryption algorithm, DES encryption algorithm and 3DES encryption algorithm, and the corresponding reverse decryption requires the corresponding decryption algorithm and key to decrypt;
outputting the decrypted original one-dimensional bar code data.
Example III
As shown in fig. 3, the present embodiment provides another barcode generating method based on a one-dimensional barcode, which is characterized in that the one-dimensional barcode is too long and is easy to be read to cause unsafe problems when the content of the one-dimensional barcode is too much, and the method includes the following steps:
receiving original one-dimensional bar code data; in various one-dimensional bar code specifications, code128 codes support full asdi characters, code39 and code bar codes support numbers, letters and a small number of special characters, while other specifications refer to support numbers, in the embodiment, we select more common characters as original one-dimensional bar code data, including 0-9 digital characters, a-Z lower case English letter characters, A-Z upper case English letter characters and a plurality of special symbol characters, wherein the special symbol characters comprise "-", "_", "+", "/", and "+", and all the characters are respectively represented by two decimal digital characters and stored in a comparison table; the number characters of 0-9 are indicated as 00-09, the lower case letters of a-Z are indicated as 10-35, the upper case letters of a-Z are indicated as 36-61, and the remaining special characters are 62, 63, 64, 65, 66, 67, respectively;
converting the one-dimensional bar code data into decimal number character strings; converting each character in the bar code into a corresponding digital character string, wherein the character strings of all the characters are connected into decimal digital character strings corresponding to the original one-dimensional bar code;
compressing the decimal number character string compression algorithm; the compression algorithm adopts one of a decimal-to-hexadecimal compression algorithm, a decimal-to-thirty-binary compression algorithm and a decimal-to-sixty-four compression algorithm, a customer can select according to own requirements, the compression rate of the hexadecimal algorithm, the thirty-binary compression algorithm and the sixty-four compression algorithm is gradually increased, namely the compressed data is shorter, but the compression efficiency is quite opposite, namely the time spent is longer, and the customer can select according to own requirements.
Encrypting the compressed data by adopting an encryption algorithm; the encryption algorithm adopts one of an EAS encryption algorithm, an AES encryption algorithm, a DES encryption algorithm and a 3DES encryption algorithm, and a client selects one encryption mode according to requirements;
the encrypted data is output, the current coding standard is adopted to generate one-dimensional bar codes, the current one-dimensional bar code coding standard is adopted to directly or indirectly print the code128 or the code39 coding standard on the article, the length of the bar codes is reduced by the compression process, the printing and the identification are convenient, the original one-dimensional bar code data is encrypted by the encryption process, and the safety is improved.
Of course, in the above-described process, the encryption step is performed first, and the compression step has the same effect as that of the above-described process, which belongs to the conventional expansion of the present embodiment.
As a reverse process, the generated compressed one-dimensional bar code should be able to be read, and the generated compressed one-dimensional bar code is input into a reading system by a code scanning gun or a manual input mode, and the reading system reads by the following method:
receiving the encrypted data;
judging the encrypted algorithm, and calling a corresponding decryption algorithm and a key to decrypt the data to generate compressed data; in the above process, the encryption algorithm is one of EAS encryption algorithm, AES encryption algorithm, DES encryption algorithm and 3DES encryption algorithm, and the corresponding reverse decryption requires the corresponding decryption algorithm and key to decrypt;
decompressing the compressed data by a decompression algorithm corresponding to the compression algorithm; the compression algorithm adopts one of a decimal-to-hexadecimal compression algorithm, a decimal-to-thirty-binary compression algorithm and a decimal-to-sixty-four compression algorithm, and decompression is a reverse processing process, namely a hexadecimal-to-decimal decompression algorithm, a thirty-binary-to-decimal decompression algorithm and a sixty-four-to-decimal decompression algorithm, and the adopted compression algorithm adopts a corresponding reverse decompression algorithm.
The decompressed digital character string is translated into corresponding letters, letters and special symbols through a comparison table;
and outputting the decompressed original one-dimensional bar code data.
Of course, how to perform encryption and then compression in the encoding process, and when the reading step is performed, the decryption step is performed after the decompression step.
The utility model provides a one-dimensional bar code coding and decoding system, includes customer end and service end, the customer end is used for docking user's demand to send user's demand to the service end, the service end is used for handling user's demand, and returns the data after handling to the customer end, and the customer end can be the sweep a yard rifle, and the service end can be the firmware of encapsulation in sweeping a yard rifle, also can set up to high in the clouds service, the service end includes compression module, decompression module, encryption module, decompression module, compression encryption module and decompression decryption module, wherein:
the compression module is used for compressing the data of the one-dimensional bar code by adopting a compression algorithm to form compressed data; the system is internally provided with a decimal-to-hexadecimal compression algorithm, a decimal-to-thirty-binary compression algorithm and a decimal-to-sixty-four compression algorithm;
the decompression module is used for resolving the compressed data into original one-dimensional bar code data by adopting a corresponding decompression algorithm; the system is internally provided with a hexadecimal-to-decimal decompression algorithm, a thirty-binary-to-decimal decompression algorithm and a sixty-four-to-decimal decompression algorithm;
the encryption module is used for encrypting the original one-dimensional bar code data or the compressed data of one bar code by adopting an encryption algorithm to form encrypted data; the system is internally provided with an EAS encryption algorithm, an AES encryption algorithm, a DES encryption algorithm and a 3DES encryption algorithm;
the decryption module is used for decrypting the encrypted data into data before encryption by adopting a corresponding decryption algorithm and a key; the system is internally provided with an EAS encryption algorithm, an AES encryption algorithm, a DES encryption algorithm and a corresponding decryption algorithm of a 3DES encryption algorithm;
the compression encryption module is used for compressing and encrypting the original one-dimensional bar code data by adopting a compression algorithm and an encryption algorithm, outputting compressed and encrypted data, and setting no sequence of compression and encryption;
the decompression decryption module is used for decompressing and decrypting the compressed and encrypted data by adopting a decryption algorithm and a decompression algorithm in reverse order, and outputting the original one-dimensional bar code data.
The one-dimensional barcode encoding and decoding system of the embodiment can return corresponding data according to the requirements of clients, and as shown in fig. 1, when clients choose to compress an original one-dimensional barcode, a service end compresses the original one-dimensional barcode and returns the compressed one-dimensional barcode data; when a customer selects to read the compressed one-dimensional bar code, the server decompresses the compressed one-dimensional bar code data and returns the compressed one-dimensional bar code data to the original one-dimensional bar code data;
as shown in fig. 2, when the client chooses to encrypt the original one-dimensional barcode, the server encrypts the original one-dimensional barcode and returns encrypted one-dimensional barcode data; when a client selects to read the encrypted one-dimensional bar code, the server decrypts the encrypted one-dimensional bar code data and returns the encrypted one-dimensional bar code data to the original one-dimensional bar code data;
as shown in fig. 3, when the client chooses to compress and encrypt the original one-dimensional bar code, the server compresses and encrypts the original one-dimensional bar code and returns the compressed and encrypted one-dimensional bar code data; when the customer selects to read the compressed and encrypted bar code, the service end decrypts and decompresses the compressed and encrypted one-dimensional bar code data and returns the original one-dimensional bar code data.
The above-described embodiments are merely preferred embodiments for fully explaining the present invention, and the scope of the present invention is not limited thereto. Equivalent substitutions and modifications will occur to those skilled in the art based on the present invention, and are intended to be within the scope of the present invention. The protection scope of the invention is subject to the claims.

Claims (8)

1. A one-dimensional bar code coding and decoding method is characterized in that: comprises an encoding process and a decoding process; wherein:
the encoding process comprises the following steps:
receiving original one-dimensional bar code data;
the original one-dimensional bar code data comprises 0-9 digital characters, a-Z lowercase English letter characters, a-Z uppercase English letter characters and a plurality of special symbol characters, wherein the special symbol characters comprise "-", "_", "+", "/", and "+", and all the characters are respectively represented by a two-bit decimal digital character and are stored in a comparison table;
converting the original one-dimensional bar code data into decimal number character strings;
compressing the decimal number character string by adopting a compression algorithm;
outputting compressed data and generating a one-dimensional bar code according to the current coding specification;
the decoding process comprises the steps of:
resolving the generated one-dimensional bar code current coding specification into compressed data;
judging a compression algorithm used for compressing the data, and calling a corresponding decompression algorithm to decompress;
outputting the decompressed decimal number character string;
the decimal numeric string is converted into the original one-dimensional bar code data.
2. A one-dimensional bar code coding and decoding method is characterized in that: comprises an encoding process and a decoding process; wherein:
the encoding process includes:
receiving original one-dimensional bar code data;
the original one-dimensional bar code data comprises 0-9 digital characters, a-Z lowercase English letter characters, a-Z uppercase English letter characters and a plurality of special symbol characters, wherein the special symbol characters comprise "-", "_", "+", "/", and "+", and all the characters are respectively represented by a two-bit decimal digital character and are stored in a comparison table;
converting the original one-dimensional bar code data into decimal number character strings;
selecting an encryption algorithm to encrypt the decimal number character string;
outputting the encrypted data, and generating a one-dimensional bar code according to the current coding specification;
the decoding process includes:
resolving the generated one-dimensional bar code into encrypted data according to the current coding specification;
judging an encryption mode adopted by the encrypted data, and calling a corresponding decryption algorithm and a key to decrypt;
outputting the decrypted decimal number character string;
the decimal numeric string is converted into the original one-dimensional bar code data.
3. A one-dimensional bar code coding and decoding method is characterized in that: comprises an encoding process and a decoding process; wherein:
the encoding process comprises the following steps:
receiving original one-dimensional bar code data;
the original one-dimensional bar code data comprises 0-9 digital characters, a-Z lowercase English letter characters, a-Z uppercase English letter characters and a plurality of special symbol characters, wherein the special symbol characters comprise "-", "_", "+", "/", and "+", and all the characters are respectively represented by a two-bit decimal digital character and are stored in a comparison table;
converting the original one-dimensional bar code data into decimal number character strings;
compressing the decimal number character string by adopting a compression algorithm;
outputting compressed data, and selecting an encryption algorithm to encrypt the decimal number character string;
outputting compressed and encrypted data, and generating a one-dimensional bar code according to the current coding specification;
the decoding process comprises the steps of:
resolving the generated one-dimensional bar code into compressed encrypted data according to the current coding specification;
judging an encryption mode adopted by the encrypted data, and calling a corresponding decryption algorithm and a key to decrypt;
outputting decrypted compressed data, judging a compression algorithm used by the compressed data, and calling a corresponding decompression algorithm to decompress;
outputting the decompressed decimal number character string;
the decimal numeric string is converted into the original one-dimensional bar code data.
4. A one-dimensional bar code coding and decoding method is characterized in that: comprises an encoding process and a decoding process; wherein:
the encoding process comprises the following steps:
receiving original one-dimensional bar code data;
the original one-dimensional bar code data comprises 0-9 digital characters, a-Z lowercase English letter characters, a-Z uppercase English letter characters and a plurality of special symbol characters, wherein the special symbol characters comprise "-", "_", "+", "/", and "+", and all the characters are respectively represented by a two-bit decimal digital character and are stored in a comparison table;
converting the original one-dimensional bar code data into decimal number character strings;
selecting an encryption algorithm to encrypt the decimal number character string;
outputting the encrypted data, and selecting a compression algorithm for compression;
outputting compressed and encrypted data, and generating a one-dimensional bar code according to the current coding specification;
the decoding process comprises the steps of:
resolving the generated one-dimensional bar code into compressed encrypted data according to the current coding specification;
judging a compression algorithm used for compressing the data, and calling a corresponding decompression algorithm to decompress;
outputting the encrypted data, judging the encryption mode adopted by the encrypted data, and calling a corresponding decryption algorithm and a key to decrypt;
outputting the decrypted decimal number character string;
the decimal numeric string is converted into the original one-dimensional bar code data.
5. The method according to any one of claims 1-4, wherein: the current one-dimensional bar code coding specification adopts code128 or code39 coding specification.
6. The method according to claim 1 or 3 or 4, characterized in that: the compression algorithm adopts one of a decimal-to-hexadecimal compression algorithm, a decimal-to-thirty-binary compression algorithm and a decimal-to-sixty-four compression algorithm.
7. A method according to claim 2 or 3 or 4, characterized in that: the encryption algorithm adopts one of an EAS encryption algorithm, an AES encryption algorithm, a DES encryption algorithm and a 3DES encryption algorithm.
8. A one-dimensional bar code encoding and decoding system is characterized in that: the system comprises a client and a server, wherein the client is used for butting user demands and sending the user demands to the server, the server is used for processing the user demands and returning processed data to the client, and the server comprises a compression module, a decompression module, an encryption module, a decompression module, a compression encryption module and a decompression decryption module, wherein:
the compression module is used for compressing the data of the one-dimensional bar code by adopting a compression algorithm to form compressed data;
the decompression module is used for resolving the compressed data into original one-dimensional bar code data by adopting a corresponding decompression algorithm;
the encryption module is used for encrypting the original one-dimensional bar code data or the compressed data of one bar code by adopting an encryption algorithm to form encrypted data;
the decryption module is used for decrypting the encrypted data into data before encryption by adopting a corresponding decryption algorithm and a key;
the compression encryption module is used for compressing and encrypting the original one-dimensional bar code data by adopting a compression algorithm and an encryption algorithm, outputting compressed and encrypted data, and setting no sequence of compression and encryption;
the decompression decryption module is used for decompressing and decrypting the compressed encrypted data by adopting a decryption algorithm and a decompression algorithm in reverse order, and outputting the original one-dimensional bar code data;
the original one-dimensional bar code data comprises 0-9 numeric characters, a-Z lower case English letter characters, A-Z upper case English letter characters and a plurality of special symbol characters, wherein the special symbol characters comprise "-", "_", "x", "/", and "+", and all the characters are respectively represented by a two-digit decimal numeric character and are stored in a comparison table.
CN202010158144.5A 2020-03-09 2020-03-09 One-dimensional bar code encoding and decoding method and system Active CN111368575B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010158144.5A CN111368575B (en) 2020-03-09 2020-03-09 One-dimensional bar code encoding and decoding method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010158144.5A CN111368575B (en) 2020-03-09 2020-03-09 One-dimensional bar code encoding and decoding method and system

Publications (2)

Publication Number Publication Date
CN111368575A CN111368575A (en) 2020-07-03
CN111368575B true CN111368575B (en) 2024-03-26

Family

ID=71206747

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010158144.5A Active CN111368575B (en) 2020-03-09 2020-03-09 One-dimensional bar code encoding and decoding method and system

Country Status (1)

Country Link
CN (1) CN111368575B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112149445A (en) * 2020-10-22 2020-12-29 北京京东振世信息技术有限公司 Bar code processing method, device, equipment and storage medium
CN112395877A (en) * 2020-11-04 2021-02-23 苏宁云计算有限公司 Character string detection method and device, computer equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6212504B1 (en) * 1998-01-12 2001-04-03 Unisys Corporation Self-authentication of value documents using encoded indices
CN1801188A (en) * 2006-01-18 2006-07-12 冯文伦 Matrix type two-dimensional bar code and its encoding and decoding method
CN110543778A (en) * 2019-09-03 2019-12-06 广州市金其利信息科技有限公司 linear random encryption and decryption algorithm for character data
CN110689100A (en) * 2019-09-25 2020-01-14 周羽 Data dot matrix coding and decoding method, system and medium based on prominent central pattern

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6212504B1 (en) * 1998-01-12 2001-04-03 Unisys Corporation Self-authentication of value documents using encoded indices
CN1801188A (en) * 2006-01-18 2006-07-12 冯文伦 Matrix type two-dimensional bar code and its encoding and decoding method
CN110543778A (en) * 2019-09-03 2019-12-06 广州市金其利信息科技有限公司 linear random encryption and decryption algorithm for character data
CN110689100A (en) * 2019-09-25 2020-01-14 周羽 Data dot matrix coding and decoding method, system and medium based on prominent central pattern

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
方媛 ; 傅华明 ; .二维条码加密算法的研究.电子技术.2009,(01),全文. *
邹建华 ; .二维条码技术应用研究.现代计量通讯.2005,(01),全文. *

Also Published As

Publication number Publication date
CN111368575A (en) 2020-07-03

Similar Documents

Publication Publication Date Title
US5388158A (en) Secure document and method and apparatus for producing and authenticating same
US5337362A (en) Method and apparatus for placing data onto plain paper
US5764774A (en) Source data compression and decompression in code symbol printing and decoding
CN101295343B (en) Two-dimensional code multi-enciphering anti-fake printing method
CN111368575B (en) One-dimensional bar code encoding and decoding method and system
US20150242642A1 (en) System and approach to convey data with a handheld device via a multi-dimensional code
CN103632179B (en) Code And Decode method and the device of Three-Dimensional Bar Code
CN110011993B (en) Two-dimensional code big data safety transmission device based on developments multistage encryption and decryption
US9946965B2 (en) Encoding method and decoding method for two-dimensional barcode and electronic device
CN101763397A (en) Device and method for processing expanding information in image file
CN110995391A (en) Data transmission method in isolated network, server and terminal
CN111242259B (en) Intelligent anti-counterfeiting code encoding and decoding method and system
Umaria et al. Enhancing the data storage capacity in QR code using compression algorithm and achieving security and further data storage capacity improvement using multiplexing
US10133884B2 (en) Electronic and paper combined data submission, printing, and retrieval method and its system
CN104301310A (en) Isolation network data exchange method and system based on bar code fax recognition technology
Cao et al. Separable Reversible Data Hiding in Encrypted VQ‐Encoded Images
CN106971213B (en) Encoding method and decoding method of two-dimensional bar code and electronic device
CN111047299B (en) Customs declaration method and customs declaration system based on two-dimensional code
Singh et al. A novel approach for encoding and decoding of high storage capacity color QR code
KR100789983B1 (en) System for transmitting an image code using a text and method therefor
Umaria et al. A novel approach for enhancing data storage capacity in quick response code using multiplexing and data compression technique
WO2019116396A1 (en) System and method to generate and read qr code thereof
Ilaiyaraja et al. Secured message transfer through qr code process for document authentication systems
JP2751354B2 (en) Facsimile image storage device
JPH07146646A (en) Cipher communication method

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20240226

Address after: No. 1036, Shandong high tech Zone wave road, Ji'nan, Shandong

Applicant after: Inspur Genersoft Co.,Ltd.

Country or region after: China

Address before: 250100 No. 2877 Kehang Road, Sun Village Town, Jinan High-tech District, Shandong Province

Applicant before: SHANDONG INSPUR GENESOFT INFORMATION TECHNOLOGY Co.,Ltd.

Country or region before: China

GR01 Patent grant
GR01 Patent grant