CN110059519B - Bar code reading method and device with security level processing function - Google Patents

Bar code reading method and device with security level processing function Download PDF

Info

Publication number
CN110059519B
CN110059519B CN201910328254.9A CN201910328254A CN110059519B CN 110059519 B CN110059519 B CN 110059519B CN 201910328254 A CN201910328254 A CN 201910328254A CN 110059519 B CN110059519 B CN 110059519B
Authority
CN
China
Prior art keywords
bar code
data
level
decoded
character set
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
CN201910328254.9A
Other languages
Chinese (zh)
Other versions
CN110059519A (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.)
Fuzhou Symbol Information Technology Co ltd
Original Assignee
Fuzhou Symbol Information 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 Fuzhou Symbol Information Technology Co ltd filed Critical Fuzhou Symbol Information Technology Co ltd
Priority to CN201910328254.9A priority Critical patent/CN110059519B/en
Publication of CN110059519A publication Critical patent/CN110059519A/en
Application granted granted Critical
Publication of CN110059519B publication Critical patent/CN110059519B/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
    • 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
    • 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

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Electromagnetism (AREA)
  • General Health & Medical Sciences (AREA)
  • Toxicology (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Cash Registers Or Receiving Machines (AREA)
  • Character Discrimination (AREA)

Abstract

The invention relates to a bar code reading method with security level processing, which comprises the following steps: triggering a command of reading the bar code, and starting the bar code reading; setting the maximum time for single bar code reading, and terminating the reading when the set time is exceeded; collecting the bar code image to obtain a frame of bar code image; sending the collected bar code image to a decoding library for decoding to obtain decoding data; performing security level processing on the decoded data; and judging whether the bar code is decoded successfully, if so, finishing reading and outputting the bar code data, and if not, acquiring a frame of bar code image again and decoding.

Description

Bar code reading method and device with security level processing function
Technical Field
The invention relates to a barcode reading method and device with security level processing, and belongs to the technical field of barcode reading.
Background
The bar code technology belongs to the field of automatic reading technology, and is one practical data acquisition and automatic input technology developed based on computer technology and information technology. Because the barcode technology has the advantages of low cost, quick and accurate reading, simple operation, low error rate and the like, the barcode technology plays an important supporting role in the formation and transmission process of modern logistics information, becomes a necessary precondition for realizing modern management of logistics, and is widely adopted in modern logistics systems.
The existing bar code reading method has the following defects:
1. a large error rate can occur in the reading process of the bar code with the cross 25 code being less than 5 bytes and the matrix25 code being less than five bytes;
2. when aiming at different Chinese character sets, the bar code reading method can not be compatible with the different Chinese character sets, thereby influencing the Chinese display;
3. the user typically does not know the type of barcode.
Disclosure of Invention
In order to solve the problems in the prior art, the invention provides a barcode reading method with security level processing, which is used for performing security level processing on decoded data, pre-dividing security levels of different barcode types according to the security of barcodes, setting different decoding logics for the barcodes with different security level levels, and reducing the error rate.
The technical scheme of the invention is as follows:
technical scheme one
A barcode reading method with security level processing comprises the following steps:
triggering a command of reading the bar code, and starting the bar code reading;
setting the maximum time of single bar code reading, and stopping reading when the set time is exceeded;
collecting a bar code image to obtain a frame of bar code image;
sending the collected bar code image to a decoding library for decoding to obtain decoding data;
performing security level processing on the decoded data;
and judging whether the bar code is decoded successfully, if so, finishing reading and outputting the bar code data, and if not, acquiring a frame of bar code image again and decoding.
Further, the method for processing the security level specifically includes:
acquiring the bar code type in the bar code image, wherein the bar code type comprises a one-dimensional bar code or a two-dimensional bar code;
pre-dividing the security levels of different types of bar codes, and setting the security levels of the different types of bar codes according to the security requirements of the different types of bar codes; the security level is divided into at least two levels;
presetting decoding processing logic of bar codes with different levels of security levels;
recognizing the bar code type of the bar code in the bar code image, judging which level the bar code type of the current bar code belongs to, and processing the current bar code according to the decoding processing logic corresponding to the security level;
judging whether the decoded data is a set code or not according to the type of the bar code, and if so, correspondingly setting hardware for reading the bar code; if not, outputting the bar code data processed by the decoding processing logic.
Further, the barcode security level includes four levels: the method comprises a first-level safety level, a second-level safety level, a third-level safety level and a fourth-level safety level;
the decoding processing logic of the first-level security level is that the bar code is directly output after being read and decoded once;
the decoding processing logic of the secondary security level compares whether the two decoded data are the same after the bar code is read and decoded twice, if the two decoded data are the same, the data is output, otherwise, the two decoded data are read and decoded again until the two decoded data are the same, and the same data are output;
the decoding processing logic of the three-level security level compares whether the three decoded data are the same after the bar code is read and decoded for three times, if the three decoded data are the same, the data is output, otherwise, the bar code is read and decoded again until the three decoded data are the same, and the same data is output;
the decoding processing logic of the four-level security level compares whether the four decoded data are the same after the bar code is read and decoded for four times, if the four decoded data are the same, the data are output, otherwise, the bar code is read and decoded again until the four decoded data are the same, and the same data are output.
Further, before outputting the barcode data processed by the decoding processing logic, the method further comprises a step of converting a barcode chinese character set, specifically as follows:
selecting Chinese character set encoding formats to be converted, wherein the Chinese character set encoding formats comprise a GBK encoding format and a UTF-8 encoding format;
judging whether the current character set belongs to a GBK coding format or a UTF-8 coding format according to the coding rule of the character set;
if the current character set encoding format is the same as the character set encoding format of the target conversion, the conversion is not needed;
if the encoding format of the current character set is different from that of the target conversion character set, firstly looking up a table from the current character set to an encoding library of the encoding format of the current character set to obtain a corresponding Chinese character; looking up a table in a coding library of a target conversion character coding format according to the acquired Chinese character to obtain a corresponding character set;
and looking up a table in the coding library of the target conversion character coding format to obtain a corresponding character set to replace the original character set.
Further, before outputting the barcode data processed by the decoding processing logic, adding AIM ID and/or CODE ID to the barcode data.
Technical scheme two
A barcode reading device with security level processing, comprising a memory and a processor, the memory storing instructions adapted to be loaded by the processor and to perform the steps of:
triggering a command of reading the bar code, and starting the bar code reading;
setting the maximum time for single bar code reading, and terminating the reading when the set time is exceeded;
collecting the bar code image to obtain a frame of bar code image;
sending the collected bar code image to a decoding library for decoding to obtain decoding data;
performing security level processing on the decoded data;
and judging whether the bar code is successfully decoded, if so, finishing reading and outputting the bar code data, and otherwise, acquiring a frame of bar code image again and decoding.
Further, the method for processing the security level specifically includes:
acquiring the bar code type in the bar code image, wherein the bar code type comprises a one-dimensional bar code or a two-dimensional bar code;
pre-dividing the security levels of the different types of bar codes, and setting the security levels of the different types of bar codes according to the security requirements of the different types of bar codes; the security level is divided into at least two levels;
presetting decoding processing logic of bar codes with different levels of security levels;
recognizing the bar code type of the bar code in the bar code image, judging which level the bar code type of the current bar code belongs to, and processing the current bar code according to the decoding processing logic corresponding to the security level;
judging whether the decoded data is a set code or not according to the type of the bar code, and if so, correspondingly setting a bar code reading device; if not, outputting the bar code data processed by the decoding processing logic.
Further, the barcode security level includes four levels: the method comprises a first-level safety level, a second-level safety level, a third-level safety level and a fourth-level safety level;
the decoding processing logic of the first-level security level is that the bar code is directly output after being read and decoded once;
the decoding processing logic of the secondary security level compares whether the two decoded data are the same after the bar code is read and decoded twice, if the two decoded data are the same, the data is output, otherwise, the two decoded data are read and decoded again until the two decoded data are the same, and the same data are output;
the decoding processing logic of the three-level security level is that the bar code reads and decodes three times, compares whether the three decoded data are the same, outputs the data if the three decoded data are the same, and otherwise reads and decodes again until the three decoded data are the same, and outputs the same data;
the decoding processing logic of the four-level security level compares whether the four decoded data are the same after the bar code is read and decoded for four times, if the four decoded data are the same, the data are output, otherwise, the bar code is read and decoded again until the four decoded data are the same, and the same data are output.
Further, before outputting the barcode data processed by the decoding processing logic, the method further comprises a step of converting a barcode chinese character set, specifically as follows:
selecting Chinese character set encoding formats to be converted, wherein the Chinese character set encoding formats comprise a GBK encoding format and a UTF-8 encoding format;
judging whether the current character set belongs to a GBK coding format or a UTF-8 coding format according to the coding rule of the character set;
if the current character set coding format is the same as the character set coding format of the target conversion, the conversion is not needed;
if the encoding format of the current character set is different from that of the target conversion character set, firstly looking up a table from the current character set to an encoding library of the encoding format of the current character set to obtain a corresponding Chinese character; looking up a table in a coding library of a target conversion character coding format according to the acquired Chinese characters to obtain a corresponding character set;
and looking up a table in the coding library of the target conversion character coding format to obtain a corresponding character set to replace the original character set.
Further, before outputting the barcode data processed by the decoding processing logic, adding AIM ID and/or CODE ID to the barcode data.
The invention has the following beneficial effects:
1. the invention relates to a bar code reading method with security level processing, which is used for performing security level processing on decoded data, pre-dividing security levels of different bar code types according to the security of bar codes, and setting different decoding logics for the bar codes of different security level levels so as to reduce the error rate.
2. The bar code reading method with the security level processing can select to convert the bar code Chinese character set, is compatible with the Chinese character sets of GBK and UTF-8, and can realize the normal display of Chinese.
3. The barcode reading method with security level processing can add different AIM IDs and CODE IDs to different barcode types, and realizes barcode distinguishing.
Drawings
FIG. 1 is a flow chart of the present invention;
FIG. 2 is a flow chart of data processing according to the present invention.
Detailed Description
The invention is described in detail below with reference to the figures and the specific embodiments.
Example one
Referring to fig. 1, a barcode reading method with security level processing includes the following steps:
triggering a command of reading the bar code, and starting the bar code reading;
setting the maximum time for single bar code reading, and terminating the reading when the set time is exceeded;
collecting the bar code image to obtain a frame of bar code image;
sending the collected bar code image to a decoding library for decoding to obtain decoding data;
performing security level processing on the decoded data;
and judging whether the bar code is decoded successfully, if so, finishing reading and outputting the bar code data, and if not, acquiring a frame of bar code image again and decoding.
In the embodiment, the longest time for single barcode reading is set, so that the barcode reading equipment is prevented from being in a reading state all the time; and carrying out security level processing on the decoded data to reduce the error rate.
Example two
Further, referring to fig. 2, the method further includes a data processing step, which is specifically as follows:
acquiring the type of the bar Code in the bar Code image, wherein the type of the bar Code comprises se:Sub>A Code39 Code (se:Sub>A standard 39 Code), se:Sub>A Codabar Code (se:Sub>A Codabar Code), se:Sub>A Code25 Code (se:Sub>A standard 25 Code), an ITF25 Code (se:Sub>A cross 25 Code), se:Sub>A Matrix25 Code (se:Sub>A Matrix25 Code), se:Sub>A UPC-A Code, se:Sub>A UPC-E Code, an EAN-13 Code (an EAN-13 international commodity bar Code), an EAN-8 Code (an EAN-8 international commodity bar Code), se:Sub>A Chinese postal Code (se:Sub>A variant of the Matrix25 Code), se:Sub>A Code-B Code, an MSI Code, se:Sub>A Code11 Code, se:Sub>A Code93 Code, an ISBN Code, an ISSN Code, se:Sub>A Code128 Code (se:Sub>A Code128 Code including an EAN128 Code), se:Sub>A Code39EMS (se:Sub>A special 39 Code for EMS) and other one-dimensional bar codes and two-dimensional bar codes such as PDF417 and the like;
the method comprises the steps of dividing security levels of different types of barcodes in advance, setting the security levels of the different types of barcodes according to the security requirements of the different types of barcodes, wherein for example, ITF25 codes (cross 25 codes) and Matrix25 codes (Matrix 25 codes) belong to unsafe barcodes and are easy to generate error codes, and the security levels of the ITF25 codes and the Matrix25 codes are at least one level higher than those of Code25 codes (standard 25 codes); the security level is divided into at least two levels;
presetting decoding processing logic of bar codes with different levels of security levels;
recognizing the bar code type of the bar code in the bar code image, judging which level the bar code type of the current bar code belongs to, and processing the current bar code according to the decoding processing logic corresponding to the security level;
judge through the bar code type whether the decoding data is the setting code, if be the setting code, then carry out corresponding setting to the hardware that carries out the bar code recognition, if: setting exposure time, setting a serial port baud rate, setting buzzer volume and setting a light supplement lamp switch; if not, outputting the bar code data processed by the decoding processing logic.
Further, the security level of the bar code comprises four levels, including a first level security level, a second level security level, a third level security level and a fourth level security level; the decoding processing logic of the first-level security level is that the bar code is directly output after being read and decoded once; the decoding processing logic of the secondary security level compares whether the two decoded data are the same after the bar code is read and decoded twice, if the two decoded data are the same, the data is output, otherwise, the two decoded data are read and decoded again until the two decoded data are the same, and then the same data are output; the decoding processing logic of the three-level security level compares whether the three decoded data are the same after the bar code is read and decoded for three times, if the three decoded data are the same, the data is output, otherwise, the bar code is read and decoded again until the three decoded data are the same, and the same data is output; the decoding processing logic of the four-level security level compares whether the four decoded data are the same after the bar code is read and decoded for four times, if the four decoded data are the same, the data are output, otherwise, the bar code is read and decoded again until the four decoded data are the same, and the same data are output; for example, in the present embodiment, the security level of the Code25 Code is divided into a first security level, and the security level of the ITF25 Code is divided into a second security level; if the barcode type in the barcode image is the Code25 Code, decoding the decoded data in the current barcode image for one time and then directly outputting the barcode data; if the type of the bar code read from the bar code image is ITF25 code, the decoding data in the current bar code image is read twice, if the data obtained by reading the decoding twice are the same, the bar code data after reading are output, and if the data obtained by reading the decoding twice are different, the decoding data are continuously read until the same bar code data appear twice, and then the bar code data are output.
Further, before outputting the barcode data processed by the decoding processing logic, the method further comprises a step of converting a barcode chinese character set, specifically as follows:
selecting Chinese character set encoding formats to be converted, wherein the Chinese character set encoding formats comprise a GBK encoding format and a UTF-8 encoding format;
judging whether the current character set belongs to a GBK coding format or a UTF-8 coding format according to the coding rule of the character set;
if the current character set coding format is the same as the character set coding format of the target conversion, the conversion is not needed;
if the encoding format of the current character set is different from that of the target conversion character set, firstly looking up a table from the current character set to an encoding library of the encoding format of the current character set to obtain a corresponding Chinese character; looking up a table in a coding library of a target conversion character coding format according to the acquired Chinese characters to obtain a corresponding character set;
and looking up a table in the coding library of the target conversion character coding format to obtain a corresponding character set to replace the original character set.
For example, if the encoding format of the Chinese character set which needs to be output currently needs to be GBK, GBK conversion is selected; judging the encoding format of the Chinese character set in the bar code data to obtain that the current encoding format is UTF-8 and the character set is '0X 8 BAF', and looking up '0X 8 BAF' in an encoding library of UTF-8 to obtain Chinese 'news' words; then searching character set of 'news' character in GBK coding library, which is '0 XD1B 6'; then "0XD1B6" is substituted for "0X8BAF".
Further, before outputting the barcode data processed by the decoding processing logic, adding AIM ID and/or CODE ID to the barcode data; by adding AIM ID and/or CODE ID, an identifier can be added for different barcode types, and the current barcode can be directly judged according to the identifier.
The embodiment has the advantages of the first embodiment, and further, the barcode data with higher accuracy is obtained by multiple decoding, so that the error rate is reduced; the bar code Chinese character set can be selectively converted, and the Chinese character set compatible with GBK and UTF-8 is used for preventing the problem that Chinese cannot be displayed; AIM ID and CODE ID are added to the bar CODE data, identifiers can be added to different bar CODE types, and the bar CODEs are distinguished.
EXAMPLE III
A barcode reading device with security level processing, comprising a memory and a processor, the memory storing instructions adapted to be loaded by the processor and to perform the steps of:
triggering a command of reading the bar code, and starting the bar code reading;
setting the maximum time for single bar code reading, and terminating the reading when the set time is exceeded;
collecting the bar code image to obtain a frame of bar code image;
sending the collected bar code image to a decoding library for decoding to obtain decoding data;
performing security level processing on the decoded data;
and judging whether the bar code is decoded successfully, if so, finishing reading and outputting the bar code data, and if not, acquiring a frame of bar code image again and decoding.
In the embodiment, the longest time for single barcode reading is set, so that the barcode reading equipment is prevented from being in a reading state all the time; and the decoded data is processed by the security level, so that the error rate is reduced.
Example four
Further, referring to fig. 2, the method further includes a data processing step, which is specifically as follows:
acquiring the type of the bar Code in the bar Code image, wherein the type of the bar Code comprises se:Sub>A Code39 Code (se:Sub>A standard 39 Code), se:Sub>A Codabar Code (se:Sub>A Codabar Code), se:Sub>A Code25 Code (se:Sub>A standard 25 Code), an ITF25 Code (se:Sub>A cross 25 Code), se:Sub>A Matrix25 Code (se:Sub>A Matrix25 Code), se:Sub>A UPC-A Code, se:Sub>A UPC-E Code, an EAN-13 Code (an EAN-13 international commodity bar Code), an EAN-8 Code (an EAN-8 international commodity bar Code), se:Sub>A Chinese postal Code (se:Sub>A variant of the Matrix25 Code), se:Sub>A Code-B Code, an MSI Code, se:Sub>A Code11 Code, se:Sub>A Code93 Code, an ISBN Code, an ISSN Code, se:Sub>A Code128 Code (se:Sub>A Code128 Code including an EAN128 Code), se:Sub>A Code39EMS (se:Sub>A special 39 Code for EMS) and other one-dimensional bar codes and two-dimensional bar codes such as PDF417 and the like;
the method comprises the steps of dividing security levels of different types of barcodes in advance, setting the security levels of the different types of barcodes according to the security requirements of the different types of barcodes, wherein for example, ITF25 codes (cross 25 codes) and Matrix25 codes (Matrix 25 codes) belong to unsafe barcodes and are easy to generate error codes, and the security levels of the ITF25 codes and the Matrix25 codes are at least one level higher than those of Code25 codes (standard 25 codes); the security level is divided into at least two levels;
presetting decoding processing logic of bar codes with different levels of security levels;
recognizing the bar code type of the bar code in the bar code image, judging which level the bar code type of the current bar code belongs to, and processing the current bar code according to the decoding processing logic corresponding to the security level;
judge through the bar code type whether the decoding data is the setting code, if the setting code, then to carrying out the bar code recognition device and carry out corresponding setting, if: setting exposure time, setting a serial port baud rate, setting buzzer volume and setting a light supplement lamp switch; if not, outputting the bar code data processed by the decoding processing logic.
Further, the security level of the bar code comprises four levels, including a first level security level, a second level security level, a third level security level and a fourth level security level; the decoding processing logic of the first-level security level is that the bar code is directly output after being read and decoded once; the decoding processing logic of the secondary security level compares whether the two decoded data are the same after the bar code is read and decoded twice, if the two decoded data are the same, the data is output, otherwise, the two decoded data are read and decoded again until the two decoded data are the same, and the same data are output; the decoding processing logic of the three-level security level is that the bar code reads and decodes three times, compares whether the three decoded data are the same, outputs the data if the three decoded data are the same, and otherwise reads and decodes again until the three decoded data are the same, and outputs the same data; the decoding processing logic of the four-level security level compares whether the four decoded data are the same after the bar code is read and decoded for four times, if the four decoded data are the same, the data are output, otherwise, the bar code is read and decoded again until the four decoded data are the same, and the same data are output; for example, in the present embodiment, the security level of the Code25 Code is divided into a first security level, and the security level of the ITF25 Code is divided into a second security level; if the barcode type in the barcode image is the Code25 Code, decoding the decoded data in the current barcode image for one time and then directly outputting the barcode data; if the type of the bar code read from the bar code image is ITF25 code, reading the decoded data in the current bar code image twice, outputting the read bar code data if the data obtained by reading the decoded data twice are the same, and if the data obtained by reading the decoded data are different, continuing reading the decoded data until the same bar code data appears twice and then outputting the bar code data.
Further, before outputting the barcode data processed by the decoding processing logic, the method further includes a step of converting a barcode chinese character set, which specifically includes:
selecting Chinese character set encoding formats to be converted, wherein the Chinese character set encoding formats comprise a GBK encoding format and a UTF-8 encoding format;
judging whether the current character set belongs to a GBK coding format or a UTF-8 coding format according to the coding rule of the character set;
if the current character set coding format is the same as the character set coding format of the target conversion, the conversion is not needed;
if the encoding format of the current character set is different from that of the target conversion character set, firstly looking up a table from the current character set to an encoding library of the encoding format of the current character set to obtain a corresponding Chinese character; looking up a table in a coding library of a target conversion character coding format according to the acquired Chinese character to obtain a corresponding character set;
and looking up a table in the coding library of the target conversion character coding format to obtain a corresponding character set to replace the original character set.
For example, if the encoding format of the Chinese character set which needs to be output currently needs to be GBK, GBK conversion is selected; judging the encoding format of the Chinese character set in the bar code data to obtain that the current encoding format is UTF-8 and the character set is '0X 8 BAF', and looking up '0X 8 BAF' in an encoding library of UTF-8 to obtain Chinese 'news' words; then searching character set of 'news' character in GBK coding library, which is '0 XD1B 6'; then "0XD1B6" is substituted for "0X8BAF".
Further, before outputting the bar CODE data processed by the decoding processing logic, adding AIM ID and/or CODE ID to the bar CODE data; by adding AIM ID and/or CODE ID, an identifier can be added for different barcode types, and the current barcode can be directly judged according to the identifier.
The embodiment has the advantages of the third embodiment, and further, the barcode data with higher accuracy is obtained by multiple decoding, so that the error rate is reduced; the bar code Chinese character set can be converted selectively, the Chinese character sets of GBK and UTF-8 are compatible, and the problem that Chinese cannot be displayed is prevented; AIM ID and CODE ID are added to the bar CODE data, identifiers can be added to different bar CODE types, and the bar CODEs are distinguished.
The above description is only an embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes performed by the present specification and drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (8)

1. A barcode reading method with security level processing is characterized by comprising the following steps:
triggering a command of reading the bar code, and starting the bar code reading;
setting the maximum time for single bar code reading, and terminating the reading when the set time is exceeded;
collecting the bar code image to obtain a frame of bar code image;
sending the collected bar code image to a decoding library for decoding to obtain decoding data;
performing security level processing on the decoded data;
judging whether the bar code is decoded successfully, if so, finishing reading and outputting the bar code data, and if not, acquiring a frame of bar code image again and decoding;
acquiring the bar code type in the bar code image, wherein the bar code type comprises a one-dimensional bar code or a two-dimensional bar code;
pre-dividing the security levels of different types of bar codes, and setting the security levels of the different types of bar codes according to the security requirements of the different types of bar codes; the security level is divided into at least two levels;
presetting decoding processing logic of bar codes with different levels of security levels;
recognizing the bar code type of the bar code in the bar code image, judging which level the bar code type of the current bar code belongs to, and processing the current bar code according to the decoding processing logic corresponding to the security level;
judging whether the decoded data is a set code or not according to the type of the bar code, and if so, correspondingly setting hardware for reading the bar code; if not, outputting the bar code data processed by the decoding processing logic.
2. The barcode reading method with security level processing according to claim 1, wherein the security level of the barcode comprises four levels: the method comprises a first-level safety level, a second-level safety level, a third-level safety level and a fourth-level safety level;
the decoding processing logic of the first-level security level is that the bar code is directly output after being read and decoded once;
the decoding processing logic of the secondary security level compares whether the two decoded data are the same after the bar code is read and decoded twice, if the two decoded data are the same, the data is output, otherwise, the two decoded data are read and decoded again until the two decoded data are the same, and the same data are output;
the decoding processing logic of the three-level security level is that the bar code reads and decodes three times, compares whether the three decoded data are the same, outputs the data if the three decoded data are the same, and otherwise reads and decodes again until the three decoded data are the same, and outputs the same data;
the decoding processing logic of the four-level security level compares whether the four decoded data are the same after the bar code is read and decoded for four times, if the four decoded data are the same, the data are output, otherwise, the bar code is read and decoded again until the four decoded data are the same, and the same data are output.
3. The method of claim 1, further comprising a step of converting a chinese character set of the barcode before outputting the barcode data processed by the decoding processing logic, wherein the method comprises the steps of:
selecting Chinese character set encoding formats to be converted, wherein the Chinese character set encoding formats comprise a GBK encoding format and a UTF-8 encoding format;
judging whether the current character set belongs to a GBK coding format or a UTF-8 coding format according to the coding rule of the character set;
if the current character set coding format is the same as the character set coding format of the target conversion, the conversion is not needed;
if the encoding format of the current character set is different from that of the target conversion character set, firstly looking up a table from the current character set to an encoding library of the encoding format of the current character set to obtain a corresponding Chinese character; looking up a table in a coding library of a target conversion character coding format according to the acquired Chinese character to obtain a corresponding character set;
and looking up a table in the coding library of the target conversion character coding format to obtain a corresponding character set to replace the original character set.
4. The barcode reading method with security level processing according to claim 1, wherein: adding AIM ID and/or CODE ID to the bar CODE data before outputting the bar CODE data processed by the decoding processing logic.
5. A barcode reading device with security level processing, comprising a memory and a processor, the memory storing instructions adapted to be loaded by the processor and to perform the steps of:
triggering a command of reading the bar code, and starting the bar code reading;
setting the maximum time for single bar code reading, and terminating the reading when the set time is exceeded;
collecting the bar code image to obtain a frame of bar code image;
sending the collected bar code image to a decoding library for decoding to obtain decoding data;
performing security level processing on the decoded data;
judging whether the bar code is successfully decoded, if so, finishing reading and outputting the bar code data, and if not, acquiring a frame of bar code image again and decoding;
acquiring the bar code type in the bar code image, wherein the bar code type comprises a one-dimensional bar code or a two-dimensional bar code;
pre-dividing the security levels of different types of bar codes, and setting the security levels of the different types of bar codes according to the security requirements of the different types of bar codes; the security level is divided into at least two levels;
presetting decoding processing logic of bar codes with different levels of security levels;
recognizing the bar code type of the bar code in the bar code image, judging which level the bar code type of the current bar code belongs to, and processing the current bar code according to the decoding processing logic corresponding to the security level;
judging whether the decoded data is a set code or not according to the type of the bar code, and if so, correspondingly setting a bar code reading device; if not, outputting the bar code data processed by the decoding processing logic.
6. A barcode reading device with security level processing according to claim 5, wherein the security level of the barcode comprises four levels: the method comprises a first-level safety level, a second-level safety level, a third-level safety level and a fourth-level safety level;
the decoding processing logic of the first-level security level is that the bar code is directly output after being read and decoded once;
the decoding processing logic of the secondary security level compares whether the two decoded data are the same after the bar code is read and decoded twice, if the two decoded data are the same, the data is output, otherwise, the two decoded data are read and decoded again until the two decoded data are the same, and the same data are output;
the decoding processing logic of the three-level security level compares whether the three decoded data are the same after the bar code is read and decoded for three times, if the three decoded data are the same, the data is output, otherwise, the bar code is read and decoded again until the three decoded data are the same, and the same data is output;
the decoding processing logic of the four-level security level compares whether the four decoded data are the same after the bar code is read and decoded for four times, if the four decoded data are the same, the data are output, otherwise, the bar code is read and decoded again until the four decoded data are the same, and the same data are output.
7. The barcode reader with security level processing of claim 5, further comprising a step of converting a barcode chinese character set before outputting the barcode data processed by the decoding processing logic, specifically as follows:
selecting Chinese character set encoding formats to be converted, wherein the Chinese character set encoding formats comprise a GBK encoding format and a UTF-8 encoding format;
judging whether the current character set belongs to a GBK coding format or a UTF-8 coding format according to the coding rule of the character set;
if the current character set coding format is the same as the character set coding format of the target conversion, the conversion is not needed;
if the encoding format of the current character set is different from that of the target conversion character set, firstly looking up a table from the current character set to an encoding library of the encoding format of the current character set to obtain a corresponding Chinese character; looking up a table in a coding library of a target conversion character coding format according to the acquired Chinese character to obtain a corresponding character set;
and looking up a table in the coding library of the target conversion character coding format to obtain a corresponding character set to replace the original character set.
8. The barcode reader with security level processing of claim 5, wherein: adding AIM ID and/or CODE ID to the bar CODE data before outputting the bar CODE data processed by the decoding processing logic.
CN201910328254.9A 2019-04-23 2019-04-23 Bar code reading method and device with security level processing function Active CN110059519B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910328254.9A CN110059519B (en) 2019-04-23 2019-04-23 Bar code reading method and device with security level processing function

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910328254.9A CN110059519B (en) 2019-04-23 2019-04-23 Bar code reading method and device with security level processing function

Publications (2)

Publication Number Publication Date
CN110059519A CN110059519A (en) 2019-07-26
CN110059519B true CN110059519B (en) 2022-10-11

Family

ID=67320195

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910328254.9A Active CN110059519B (en) 2019-04-23 2019-04-23 Bar code reading method and device with security level processing function

Country Status (1)

Country Link
CN (1) CN110059519B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113408314A (en) * 2020-03-16 2021-09-17 华为技术有限公司 Bar code identification method and related equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013023892A1 (en) * 2011-08-12 2013-02-21 Fresenius Kabi Deutschland Gmbh Bar code reader for a medical device
JP2014219775A (en) * 2013-05-07 2014-11-20 株式会社ウェルキャット Bar-code symbol reader and bar-code symbol reading method
WO2015125484A1 (en) * 2014-02-19 2015-08-27 株式会社サイレント技術企画 Two-dimensional code, two-dimensional code system, two-dimensional code capture terminal, and information processing method using two-dimensional code
CN107423655A (en) * 2017-09-07 2017-12-01 福州图腾易讯信息技术有限公司 One kind sets code encryption method and terminal

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4728784A (en) * 1987-01-30 1988-03-01 Federal Express Corporation Apparatus and method of encoding and decoding barcodes
JP2937527B2 (en) * 1991-04-16 1999-08-23 東芝テック株式会社 Barcode reader
JPH10134130A (en) * 1996-10-28 1998-05-22 Fujitsu Ltd Method and device for reading bar code
JP2004234553A (en) * 2003-01-31 2004-08-19 Pentel Corp Bar code reader
US20050289132A1 (en) * 2004-06-24 2005-12-29 Brian Lee Method and system for converting encoding character set
CN101063999B (en) * 2006-04-29 2010-09-15 银河联动信息技术(北京)有限公司 Synthesis system and method of two-dimension code and sign
WO2015067725A1 (en) * 2013-11-07 2015-05-14 Scantrust Sa Two dimensional barcode and method of authentication of such barcode
US9235724B2 (en) * 2014-03-17 2016-01-12 Saudi Arabian Oil Company Systems, methods, and computer medium to securely transfer backup data between physically isolated networks having different levels of network protection
CN105678206A (en) * 2015-12-29 2016-06-15 东软集团股份有限公司 Bar code identification method and apparatus
CN105631383A (en) * 2015-12-30 2016-06-01 福建联迪商用设备有限公司 Intelligent gating bar code decoding method and system
CN105844200B (en) * 2016-03-17 2018-07-06 杭州晟元数据安全技术股份有限公司 A kind of method for judging barcode types
CN108280500A (en) * 2017-01-06 2018-07-13 百度在线网络技术(北京)有限公司 Coding method, coding/decoding method, relevant apparatus and the equipment of Quick Response Code

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013023892A1 (en) * 2011-08-12 2013-02-21 Fresenius Kabi Deutschland Gmbh Bar code reader for a medical device
JP2014219775A (en) * 2013-05-07 2014-11-20 株式会社ウェルキャット Bar-code symbol reader and bar-code symbol reading method
WO2015125484A1 (en) * 2014-02-19 2015-08-27 株式会社サイレント技術企画 Two-dimensional code, two-dimensional code system, two-dimensional code capture terminal, and information processing method using two-dimensional code
CN107423655A (en) * 2017-09-07 2017-12-01 福州图腾易讯信息技术有限公司 One kind sets code encryption method and terminal

Also Published As

Publication number Publication date
CN110059519A (en) 2019-07-26

Similar Documents

Publication Publication Date Title
CN106934536B (en) Construction industry engineering quantity price inventory data automatic coding and identifying method and system
US8670976B2 (en) System and methods for encoding and decoding multi-lingual text in a matrix code symbol
US7690581B2 (en) Method and apparatus for generating a barcode with a human readable interpretation, a printing apparatus, and a program
CN110059519B (en) Bar code reading method and device with security level processing function
CN105631383A (en) Intelligent gating bar code decoding method and system
CN105045676B (en) A kind of restoration methods of the loss data based on SQLite databases
EP2482231A1 (en) Method for encoding and decoding data on a matrix code symbol
CN114020272A (en) Serialized encoding and decoding methods and devices and electronic equipment
CN103036641A (en) Method and system of data exchange and deserialization method
EP2442256B1 (en) Method of encoding and decoding text on a matrix code symbol
CN104866794A (en) Image feature information statistics-based bar code decoding method
CN114021596A (en) Bar code identification method and device based on deep learning
CN106354746A (en) Searching method, and searching device
CN109902242B (en) Picture storage method in two-dimensional code
CN114154020B (en) High-capacity data processing method and device based on dynamic label mapping
CN107943923B (en) Telegram code database construction method, telegram code identification method and device
CN111597802B (en) Service processing method and device and electronic equipment
CN100440778C (en) Device and method for recognizing quick response codes run on mobile terminals
CN100479331C (en) Bar-code decoding method
CN106874811B (en) Magnetic stripe card data reading method and device
CN117313761B (en) Bar code reading method and device, electronic equipment and computer readable storage medium
CN111400348B (en) Heterogeneous data processing method of multiple identification coding rules
CN116028481B (en) Data quality detection method, device, equipment and storage medium
CN116992902A (en) Service code material statistics method, device and equipment
Khorshhed et al. Bilingual 2D Barcode Encoding with High Capacity

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