CN111144161A - Barcode identification method and device, commodity information determination method and payment method - Google Patents

Barcode identification method and device, commodity information determination method and payment method Download PDF

Info

Publication number
CN111144161A
CN111144161A CN202010258076.XA CN202010258076A CN111144161A CN 111144161 A CN111144161 A CN 111144161A CN 202010258076 A CN202010258076 A CN 202010258076A CN 111144161 A CN111144161 A CN 111144161A
Authority
CN
China
Prior art keywords
code
verification
bar code
character string
barcode
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.)
Pending
Application number
CN202010258076.XA
Other languages
Chinese (zh)
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.)
Alipay Hangzhou Information Technology Co Ltd
Original Assignee
Alipay Hangzhou 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 Alipay Hangzhou Information Technology Co Ltd filed Critical Alipay Hangzhou Information Technology Co Ltd
Priority to CN202010258076.XA priority Critical patent/CN111144161A/en
Publication of CN111144161A publication Critical patent/CN111144161A/en
Pending legal-status Critical Current

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/146Methods for optical code recognition the method including quality enhancement steps
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K17/00Methods or arrangements for effecting co-operative working between equipments covered by two or more of main groups G06K1/00 - G06K15/00, e.g. automatic card files incorporating conveying and reading operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/08Payment architectures
    • G06Q20/20Point-of-sale [POS] network systems
    • G06Q20/208Input by product or record sensing, e.g. weighing or scanner processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/30Payment architectures, schemes or protocols characterised by the use of specific devices or networks
    • G06Q20/32Payment architectures, schemes or protocols characterised by the use of specific devices or networks using wireless devices
    • G06Q20/327Short range or proximity payments by means of M-devices
    • G06Q20/3274Short range or proximity payments by means of M-devices using a pictured code, e.g. barcode or QR-code, being displayed on the M-device
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/60Type of objects
    • G06V20/62Text, e.g. of license plates, overlay texts or captions on TV images
    • G06V20/63Scene text, e.g. street names
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Multimedia (AREA)
  • Quality & Reliability (AREA)
  • Health & Medical Sciences (AREA)
  • Electromagnetism (AREA)
  • General Health & Medical Sciences (AREA)
  • Toxicology (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Finance (AREA)
  • Cash Registers Or Receiving Machines (AREA)

Abstract

The embodiment of the specification discloses a bar code identification method and device, a commodity information determination method and a payment method. The bar code identification method comprises the following steps: acquiring a bar code image; decoding a bar code pattern in the bar code image to obtain a first code element sequence, wherein the first code element sequence at least comprises an end code and a verification code; performing a first verification on the first symbol sequence using a verification code; in the case that the first verification result is that the verification fails, performing character recognition on a character detection area in the barcode image to obtain a character string and performing second verification on the character string by using the verification code; and outputting the character string as the barcode content if the result of the second verification is verification pass. The embodiment of the specification can overcome the problem that the verification code is not contained in the character string and cannot be verified, so that the error recognition rate of character recognition is reduced.

Description

Barcode identification method and device, commodity information determination method and payment method
Technical Field
The present disclosure relates to barcode identification technologies, and in particular, to a barcode identification method, a barcode identification apparatus, a computer storage medium, a method for determining commodity information, and a payment method.
Background
A barcode (barcode) is a graphic identifier in which a plurality of color bars having a large contrast and a plurality of widths are arranged according to a certain encoding rule to express a set of information. Common bar codes are a pattern of parallel lines of black bars (referred to in the industry as "bars") and white bars (referred to in the industry as "spaces"). The periphery of the barcode is also typically provided with characters corresponding to the barcode (referred to as "barcode characters"), which are typically numbers or letters, for expressing the same information as the barcode.
Bar codes are generally acquired by using a bar code scanning device such as a bar code scanning gun, and bar code contents are obtained by decoding according to the colors of the stripes in the bar codes and the corresponding widths and the arrangement sequence. The disadvantages of this approach are: if the barcode is damaged, contaminated, and shielded, failure in reading the barcode content or failure in reading the verification code may be caused, and it is impossible to verify whether the read barcode content is correct.
In addition, the barcode content may also be determined by performing Character Recognition (OCR) on the barcode characters. The scheme has the defect that the barcode characters mostly contain no check information, so that the read barcode content cannot be verified to be correct, and the recognition error rate is high.
Therefore, there is a need to provide a barcode identification scheme that reduces the error recognition rate of barcodes.
Disclosure of Invention
The present specification aims to provide a barcode identification method, a barcode identification device, a computer storage medium, a commodity information determination method, and a payment method, so as to improve the success rate and accuracy of barcode content reading.
According to a first aspect disclosed in an embodiment of the present specification, there is provided a method for identifying a barcode, including:
acquiring a bar code image;
decoding a bar code pattern in the bar code image to obtain a first code element sequence, wherein the first code element sequence at least comprises an end code and a verification code;
performing a first verification on the first symbol sequence using a verification code;
in the case that the first verification result is that the verification fails, performing character recognition on a character detection area in the barcode image to acquire a character string, and performing second verification on the character string by using a verification code; and the number of the first and second groups,
and in the case that the second verification result is that the verification is passed, outputting the character string as the bar code content.
Optionally, in a case where the result of the second verification is that the verification fails, a result of the barcode recognition failure is output.
Optionally, when the result of the first verification is that the verification is passed, the character string corresponding to the service data symbol in the first symbol sequence is output as the barcode content.
Alternatively, in the case where the acquisition of the first symbol sequence fails, a result of the barcode recognition failure is output.
Optionally, the performing a second verification on the character string by using the verification code includes:
according to a preset code system, a second code element sequence is obtained by using character string coding;
and verifying the second code element sequence according to the verification code.
Optionally, the second verifying the character string by using the verification code includes:
identifying a code system according to the first code element sequence;
according to the identified code system, a second code element sequence is obtained by using character string coding;
and verifying the second code element sequence according to the verification code.
According to a second aspect disclosed in an embodiment of the present specification, there is provided a method of determining commodity information, including:
acquiring a commodity image, wherein the commodity image comprises a bar code image;
decoding a bar code pattern in the bar code image to obtain a first code element sequence, wherein the first code element sequence at least comprises an end code and a verification code;
performing a first verification on the first symbol sequence using a verification code;
in the case that the first verification result is that the verification fails, performing character recognition on a character detection area in the barcode image to acquire a character string, and performing second verification on the character string by using a verification code; and the number of the first and second groups,
and determining commodity information according to the character string to present the commodity information to the user under the condition that the second verification result is verification passing.
Optionally, the commodity information includes commodity name information, price information, and manufacturer information.
According to a third aspect disclosed in an embodiment of the present specification, there is provided a payment method including:
acquiring a bar code image, wherein the bar code image is a bar code image for payment provided by a user;
decoding a bar code pattern in the bar code image to obtain a first code element sequence, wherein the first code element sequence at least comprises an end code and a verification code;
performing a first verification on the first symbol sequence using a verification code;
in the case that the first verification result is that the verification fails, performing character recognition on a character detection area in the barcode image to acquire a character string, and performing second verification on the character string by using a verification code; and the number of the first and second groups,
and under the condition that the second verification result is that the verification is passed, determining account information according to the character string so as to deduct fees according to the account information.
According to a fourth aspect disclosed in an embodiment of the present specification, there is provided a barcode recognition apparatus including:
the acquisition module is used for acquiring a bar code image;
the decoding module is used for decoding the bar code pattern in the bar code image to obtain a first code element sequence, and the first code element sequence at least comprises an end code and a verification code;
a first verification module, configured to perform a first verification on the first symbol sequence by using a verification code;
the character string verification module is used for carrying out character recognition on the character detection area in the bar code image to acquire a character string under the condition that the first verification result is that the verification fails;
the second verification module is used for performing second verification on the character string by using the verification code;
and the output module is used for outputting the character string as the bar code content under the condition that the second verification result is that the verification is passed.
According to a fifth aspect of the disclosure, there is provided a barcode identification apparatus, including a processor and a memory, where the memory stores computer instructions, and the computer instructions are executed by the processor to execute the barcode identification method according to any one of the first aspect of the disclosure.
According to a sixth aspect of the disclosure, there is provided a computer readable storage medium, having stored thereon computer instructions, which when executed by a processor, perform the method for identifying a barcode according to any one of the preceding claims.
Other features of the present description and advantages thereof will become apparent from the following detailed description of exemplary embodiments thereof, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the specification and together with the description, serve to explain the principles of the embodiments of the specification.
FIG. 1 is a schematic diagram of a bar code identification device that can be used to implement embodiments of the present disclosure;
FIG. 2 is a flow chart illustrating a method for identifying a barcode according to an embodiment of the present disclosure;
FIG. 3 is a flow chart illustrating a method for identifying a barcode according to an embodiment of the present disclosure;
fig. 4 is a flowchart illustrating a method for determining merchandise information according to an embodiment of the present disclosure;
FIG. 5 is a schematic flow chart diagram of a payment method in one embodiment of the present description;
FIG. 6 is a block diagram of a bar code identification device according to an embodiment of the present disclosure;
fig. 7 is a block diagram illustrating a structure of a barcode recognition apparatus according to an embodiment of the present disclosure.
Detailed Description
Various exemplary embodiments of the present specification will now be described in detail with reference to the accompanying drawings.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the disclosure, its application, or uses.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
The bar code is a graphic identifier in which a plurality of color bars having a large color contrast and a plurality of widths are arranged according to a certain coding rule to express a set of information. Common bar codes are a parallel line pattern of "bars" and "spaces". The periphery of the barcode is also typically provided with characters corresponding to the barcode (referred to as "barcode characters"), which are typically numbers or letters, for expressing the same information as the barcode. In daily life, many items have bar codes. The bar code may represent information about the article, such as the country of manufacture, manufacturer, name of the article, date of manufacture, book classification number, origination and termination point of the mail, category, date, etc. of the article.
Barcodes include one-dimensional barcodes and two-dimensional barcodes. The information density of the one-dimensional bar code is low, and the bar code content represented by the graphic identifier of the one-dimensional bar code is usually noted around the bar code in the form of bar code characters. The one-dimensional bar code can be obtained by scanning the code through the code scanning gun, and the one-dimensional bar code is decoded to obtain the bar code content. For a one-dimensional barcode about an item, information about the item can be determined from the barcode content, and with this information, other relevant information about the item can be found in the database. If the bar code pattern of the one-dimensional bar code is damaged, polluted or shielded, character strings can be obtained by carrying out character recognition on bar code characters, and then the content of the bar code is determined. However, the character string of the one-dimensional barcode may not have a verification mechanism, and the character string cannot be verified, which may result in a high misrecognition rate.
The two-dimensional bar code has a high information density because the information density of the bar code is increased by the size in the vertical direction. Generally, the barcode content represented by the graphical identifier of a two-dimensional barcode is not noted around the graphical identifier in the form of barcode characters. The text surrounding the two-dimensional barcode is typically a brief description of the owner of the two-dimensional barcode, and may be set by the owner of the two-dimensional barcode, e.g., the text of the two-dimensional barcode used for payment at the XX restaurant is "XX restaurant".
The embodiment of the present disclosure is mainly used for identifying a one-dimensional barcode, and the following describes the one-dimensional barcode in detail:
one-dimensional bar codes include a variety of symbologies, commonly used symbologies include: EAN Code, Code128 Code, Code39 Code, UPC-a Code, etc. The EAN code is an international universal commodity code, is a bar code with fixed length and no specific meaning, expresses all numbers of information, and is mainly applied to commodity identification. EAN codes are classified into two types, EAN-13 codes and EAN-8 codes. The EAN-13 code is a standard version and generally consists of a prefix code, a manufacturer code, a commodity code and a check code, wherein the prefix code consists of the first three digits and is used for identifying a country or a region, for example, the code of continental china is 690-692. The manufacturer code is composed of the 4 th digit to the 7 th digit, the commodity code is composed of the 8 th digit to the 12 th digit and is used for identifying the commodity variety, and the check code is the last digit. The EAN-8 code is a shortened version, typically consisting of a commodity item code represented by a 7-digit number and a check symbol represented by a one-digit number.
The Code128 Code is a format with variable length, high density and mixed use of letters and numbers, and is widely applied to the aspects of enterprise internal management, production flow and logistics control systems. Code128 Code may represent 128 characters from ASCII (American standard Code for Information exchange) 0 to ASCII 127, and is therefore called Code 128. The Code128 Code includes a start Code and an end Code, and may also include a verification Code. The Code128 Code bar Code is adjustable in length, and must include a start Code and an end Code.
The Code128 Code includes A, B, C three different coding types. The Code128A has a coding range including numbers, capital letters, control symbols and special characters, such as ABC and ABC 123. The Code128B Code system has a coding range including numbers, capital letters, lowercase letters, and special characters, such as Abc, Abc 123. The Code system of Code128C includes a number pair set of [00] - [99], i.e. Code128C can only represent numbers of even bit length, such as 123456, 00123354. For the same article, different coding rules of three Code systems, namely Code128A Code system, Code128B Code system and Code128C Code system, can be combined for combined coding, and the coding mode with the shortest barcode length is selected as the optimal coding mode. When the coding rules are switched, conversion codes are required to be written, wherein the conversion codes comprise CODEA, CODEB and CODEC. For example, for 952700780, to obtain the barcode with the shortest barcode length, the first 8 bits are selected as the encoding rule of Code128C, and the last bit is selected as the encoding rule of Code128A, and the "CODEA" conversion Code is written before the last bit is "0".
The Code39 Code has simple coding rule and low error rate, and is widely applied to the manufacturing industry, military and medical care industry.
The UPC-a code is used in retail in the united states and canada. The format of the UPC-a code is 12 bits. The symbol consists of 11 data bits and one check bit. The 1 st digit generally represents the type of product being identified. The 2 nd digit to the 6 th digit represent a manufacturer code, the 7 th digit to the 11 th digit are used to identify a specific product, and the 12 th digit is a check bit.
In the embodiments of the present specification, the Code128 Code system is mainly used as an example for description.
< hardware configuration >
The barcode recognition device in the embodiment of the present specification may be a barcode scanning gun, and has a scanning camera, a processor, a memory, and other devices. The camera is used for acquiring a barcode image, and the memory is used for storing instructions used for controlling the processor to operate so as to execute any one of the barcode identification methods provided by the embodiments of the present specification.
The barcode recognition device in the embodiment of the present specification may be a mobile phone having a barcode scanning function, where the mobile phone has a camera, a processor, a memory, and other devices. The camera is used for acquiring a barcode image, and the memory is used for storing instructions used for controlling the processor to operate so as to execute any one of the barcode identification methods provided by the embodiments of the present specification.
Fig. 1 is a block diagram showing a hardware configuration of a barcode recognition apparatus 1000 that can implement another embodiment of the present specification.
The bar code identification device 1000 may be an integral server or a distributed server across multiple computers or computer data centers. The server may be of various types, such as, but not limited to, a storage server, a cloud database server, a cloud computing server, a cloud management server, a web server, a news server, a mail server, a message server, an advertisement server, a file server, an application server, an interaction server, a storage server, a database server, a proxy server, or the like of a distributed system. In some embodiments, each server may include hardware, software, or embedded logic components or a combination of two or more such components for performing the appropriate functions supported or implemented by the server. For example, a server, such as a blade server, a cloud server, etc., or may be a server group consisting of a plurality of servers, which may include one or more of the above types of servers, etc.
The barcode recognition apparatus 1000 may also be a terminal device such as a laptop computer, a desktop computer, or a tablet computer.
As shown in fig. 1, the configuration of the barcode recognition device 1000 may include, but is not limited to: a processor 1100, a memory 1200, an interface device 1300, a communication device 1400, a display device 1500, an input device 1600, and the like. The processor 1100 may be a central processing unit CPU, a microprocessor MCU, or the like. The memory 1200 includes, for example, a ROM (read only memory), a RAM (random access memory), a nonvolatile memory such as a hard disk, and the like. The interface device 1300 includes, for example, a USB interface, a headphone interface, and the like. The communication device 1400 is capable of wired or wireless communication, for example, and may specifically include WiFi communication, bluetooth communication, 2G/3G/4G/5G communication, and the like. The display device 1500 is, for example, a liquid crystal display panel, a touch panel, or the like. The input device 1600 may include, for example, a touch screen, a keyboard, a somatosensory input, and the like.
The bar code identification device shown in fig. 1 is merely illustrative and is in no way meant to be any limitation on the embodiments of the present description, their application, or uses.
In the embodiments of the present disclosure, the barcode recognition apparatus may obtain a barcode image from a barcode scanning gun or other barcode scanning apparatus with barcode scanning function, and the memory 1200 of the barcode recognition apparatus 1000 is configured to store instructions for controlling the processor 1100 to process the barcode image to execute any one of the barcode recognition methods provided in the embodiments of the present disclosure. It should be understood by those skilled in the art that although a plurality of devices are shown for the barcode recognition device 1000 in fig. 1, the barcode recognition device 1000 of the present specification may refer to only some of the devices therein, for example, the barcode recognition device 1000 may refer to only the processor 1100 and the storage device 1200. The skilled person can design the instructions according to the disclosed solutions in the embodiments of the present specification. How the instructions control the operation of the processor is well known in the art and will not be described in detail herein.
< method for identifying Bar code >
Fig. 2 is a schematic diagram of a barcode recognition method according to an embodiment of the present disclosure. The barcode identification method provided in this embodiment is implemented by computer technology, and may be implemented by the barcode identification apparatus described in fig. 1.
The method for identifying a barcode provided in this embodiment includes steps S2100 to S2500.
In step S2100, a barcode image is acquired.
The bar code image comprises bar code patterns and bar code characters of the bar code. The bar code pattern is composed of a set of regularly arranged "bars" and "spaces". The barcode characters include at least one of numbers, capital letters, lowercase letters, or special characters. The embodiment can acquire the barcode image by a barcode scanning device such as a scanning gun.
In one embodiment, the bar code pattern is comprised of a set of regularly arranged "bars" and "spaces". The "bars" and "spaces" of the barcode pattern may be drawn in different widths. Determining width specifications of the bar and the space according to a ratio of actual widths of the bar and the space drawn in the bar code pattern to a preset standard width, wherein the width specifications of the bar and the space of a general bar code pattern comprise four grades of 1-4, wherein the width specification of 1 means that the ratio of the actual widths of the bar and the space to the preset standard width is 1, the width specification of 2 means that the ratio of the actual widths of the bar and the space to the preset standard width is 2, the width specification of 3 means that the ratio of the actual widths of the bar and the space to the preset standard width is 3, and the width specification of 4 means that the ratio of the actual widths of the bar and the space to the preset standard width is 4.
Step S2200 is to decode the bar code pattern in the bar code image to obtain a first code element sequence, wherein the first code element sequence at least comprises an end code and a verification code.
In one embodiment, decoding the barcode pattern in the barcode image may result in a sequence of symbols. Normally, the symbol sequence is a symbol arranged in accordance with a code rule, and represents the same information as the barcode pattern. The code pattern can be represented in a numerical form through the code element sequence, and decoding of the code pattern is facilitated. The value selection rules for the symbols in the sequence of symbols are different for different bar code symbologies. Taking the Code128 Code system as an example, the values of the symbols in the sequence of symbols are determined according to the width specification of a "bar" or "space" in the barcode pattern. For example, the barcode pattern is "bar with width specification 2, space with width specification 3, bar with width specification 1, space with width specification 2, bar with width specification 1, and space with width specification 2", and the decoded symbol sequence is "231212".
The symbol sequence may include a plurality of sub-symbol sequences that may represent any one of the specific bar code content, e.g., numbers, uppercase letters, lowercase letters, special characters, control symbols, etc.
If the barcode pattern has no problems of shielding, breakage and the like, that is, under the condition that the barcode pattern is complete and clear, the code element sequence analyzed by using the barcode pattern should include a service code element and a control code element. The service code element is the information that the bar code pattern really wants to express. The control symbols include a start code, an end code, and a verification code.
The end code is typically the last set of sub-symbol sequences in the symbol sequence. And decoding the bar code pattern to obtain a code element sequence, determining an end code from the code element sequence, and decoding the end code to obtain a character corresponding to the end code. Under different bar code systems, the sequence of the sub-code elements forming the end code is different. For example, in the Code128 system, a character corresponding to an end Code is "Stop", a symbol sequence obtained by encoding the character (Stop) is "2331112", that is, a sub-symbol sequence corresponding to the end Code is "2331112".
The verification code is typically a set of sub-symbol sequences adjacent to the end code. The verification code can be used for verifying the bar code content obtained by decoding to judge whether the decoding is correct or not, so that the bar code misrecognition rate is reduced. The verification code is decoded to obtain verification data, and the verification data is obtained by calculation according to the bar code content of the bar code before the bar code is coded. Under different bar code systems, the sub-code element sequences forming the verification code are also different, and the calculation rules of the verification data corresponding to the verification code are different.
In one embodiment, the control symbols further comprise a start code and a conversion code.
The start code may represent the code system to which the bar code corresponds. The sequence of sub-symbols that make up the start code is different under different bar code schemes. Under different coding rules of the same bar code system, the sub-symbol sequences forming the start code are also different. Taking the Code128 Code system as an example, for different encoding rules, in the Code128A Code system, the sequence of sub-symbols constituting the start Code is "211412"; in Code128B, the sequence of sub-symbols that make up the start Code is "211214"; in Code128C, the sequence of sub-symbols that make up the start Code is "211232".
The conversion code may represent a conversion of the coding rule. For example, "CODEA" indicates a coding rule converted from a previous coding rule into Code128A Code system, "CODEC" indicates a coding rule converted from a previous coding rule into Code128B Code system, and "CODEC" indicates a coding rule converted from a previous coding rule into Code128CA Code system. The setting of the conversion code can prompt the change of the coding rule, so that the content of the bar code can be determined according to different coding rules in the decoding process of the bar code, and the accuracy of bar code identification is improved.
In one embodiment, the sequence of symbols further includes traffic data symbols.
The symbol sequence may include a plurality of service data symbols, i.e. the actual content that the barcode is intended to represent, which may represent each specific barcode content for encoding and decoding of the barcode. The service data itself may be a number, capital letter, lowercase letter, etc. For the same service data, the sequence of symbols constituting the service data symbols is different under different barcode schemes.
In one embodiment, decoding the barcode pattern in the barcode image, the barcode content, the content number (ID value), and the encoding value of the barcode may also be obtained.
The code value is that each bar or space in the bar code pattern is sequentially represented by letters according to the arrangement sequence, wherein the bars and spaces in the bar code pattern are represented by different letters, and the number of letters representing the same bar or space is determined according to the width specification of the bars and spaces in the bar code pattern. The code value can visually represent the bar code pattern of the bar code. For different bar code symbologies, the code values have a unique mapping relationship with the symbol sequence.
The coded values may be represented generally as "bars" by the abbreviation "b" for black and "spaces" by the abbreviation "space". For example, the barcode pattern is "bar of width 2, space of width 3, bar of width 1, space of width 2, bar of degree 1, and space of width 2", and the code value is "bbssbsssbss".
The barcode content represents the actual information of the article corresponding to the barcode, and the barcode content may be represented by a plurality of characters, which may be numbers, capital letters, lowercase letters, or special characters. The symbol sequence includes a plurality of sub-symbol sequences, which may be control symbols and traffic data symbols. The service data code element is used for expressing one character which forms the bar code content, and a plurality of service data code elements can form the bar code content of the bar code. Under different bar code systems, each character in the bar code content can correspond to a unique sub-code element sequence and a unique sub-code value. Taking the Code128 Code system as an example, the unique sub-Code element sequence corresponding to the numeric character "0" in the barcode content is "212222", and the corresponding sub-Code value is "bbsbssbbss".
The content number (ID value) may represent identity information for different characters in the barcode content. According to different bar code systems, characters corresponding to the sub-code element sequences or the sub-code values under the code system can be inquired through the content numbers, and therefore the bar code content can be obtained through decoding. The content number may also be used to calculate verification data corresponding to the verification code of the barcode. Taking the Code128 Code system as an example, the content number "33" corresponds to "a" in the Code128A Code system, "a" in the Code128B Code system, and "33" in the Code128C Code system, respectively.
In this embodiment, the content number, the symbol sequence, and the encoding value of the barcode pattern in the barcode image may be represented by using an encoding table. Taking the Code128 Code scheme as an example, the Code table is shown in table 1 below.
Figure DEST_PATH_IMAGE001
Watch (A)
Figure 485546DEST_PATH_IMAGE002
In this code table, contents not referred to in the embodiments of the present specification are indicated by "blank".
In one embodiment, the step of decoding the barcode pattern in the barcode image to obtain the first symbol sequence may further comprise: step S3100.
In step S3100, in the case where acquisition of the first symbol sequence fails, a result of barcode recognition failure is output.
If the barcode pattern has no problems of shielding, breakage and the like, that is, under the condition that the barcode pattern is complete and clear, the code element sequence analyzed by using the barcode pattern should include a service code element and a control code element. The service code element is the information that the bar code pattern really wants to express. The control symbols include a start code, an end code, and a verification code.
If the sequence of symbols decoded from the barcode pattern comprises an end code and a verification code, the sequence of symbols can be considered as the first sequence of symbols, i.e. the acquisition of the first sequence of symbols is successful. Otherwise, the first code element sequence is failed to be obtained, the subsequent steps are finished, and the result of bar code identification failure is output.
If the first symbol sequence is successfully acquired, entering:
step S2300, performing a first verification on the first symbol sequence using the verification code.
After the first verification is performed on the first code element sequence by using the verification code, whether the result of the first verification passes the verification is judged.
And when the first verification result is that the verification is passed, outputting the character string corresponding to the service data code element in the first code element sequence as the bar code content.
In this embodiment, the way in which the first symbol sequence is verified based on the verification code is different for different code schemes of the barcode. In one example, the check requires using other symbols (e.g., control symbols) in the first symbol sequence except for the traffic data symbol, calculating a reference value from the traffic data symbol and the other symbols, and comparing the reference value with the check data corresponding to the verification code. If the reference value is consistent with the verification data corresponding to the verification code, the first verification result is considered to be verification passing, namely the service data code element obtained by the first code element sequence is correct, and the barcode content can be output according to the service data code element. If the reference value is inconsistent with the verification data corresponding to the verification code, the first verification result is considered as verification failure, that is, the service data code element obtained by the first code element sequence is wrong or the obtained service data code element is incomplete, and the barcode content needs to be further obtained through the barcode character.
In step S2400, in a case where the result of the first verification is that the verification fails, character recognition is performed on the character detection area in the barcode image to acquire a character string, and a second verification is performed on the character string using the verification code.
In this embodiment, if the barcode pattern in the barcode image is damaged, contaminated, or blocked, the result of the first verification is that the verification fails.
In this embodiment, the character detection area is used to indicate the content of the barcode in the form of barcode characters, and the character detection area includes a preset area around the barcode pattern. And character recognition is carried out on the character detection area to obtain the character string, so that the bar code content of the bar code is obtained.
In one embodiment, according to the code system used by the bar code, the verification only needs to use the service data code element, when the verification code is used for verification, the verification code can be decoded to obtain verification data, and the character string is directly verified according to the verification data.
In one embodiment, the step of performing the second verification on the character string by using the verification code, regardless of whether the other symbols except the service data symbol are needed to be used for verification, may further include: steps S2410a to S2420 a.
Step S2410a, obtaining a second symbol sequence by using string coding according to a preset code system.
In this embodiment, the preset code system is set according to the user requirement, specifically, the code system of the barcode may be selected according to the country or region of the production of the article, or the code system of the barcode may be selected according to the service type. For example, for convenience store retail goods, the EAN-13 code is typically selected as the preset code system; for mobile phones manufactured in factories, the Code128 Code system is generally selected as the preset Code system.
In step S2420a, the second symbol sequence is verified according to the verification code.
The sub-symbol sequence of each character in the character string may be determined from the second symbol sequence according to a predetermined code scheme. The second sequence of symbols is thus verified according to the sub-sequence of symbols for each character.
And determining a verification rule according to a preset code system, and verifying the second code element sequence by adopting a verification code according to the determined verification rule. The validation rules may be different for different code systems.
< example 1>
Taking Code128B Code system as an example, the verification rule corresponding to Code128B Code system is: and calculating a reference value according to formula 1, and comparing the reference value with the verification data corresponding to the verification code to verify the second code element sequence.
Reference value = (content number (ID value) + per bit character position in the entire data x content number (ID value) per bit character) 103 (1).
In formula 1, "%" indicates the remainder.
The process of verifying the second sequence of symbols according to the verification code comprises:
performing character recognition on a character detection area in the bar code image to obtain a character string 'Abc 7';
according to the Code system of Code128B (table 1), it can be determined that the characters corresponding to the start Code are "StartB", the sub-symbol sequence constituting the start Code is "211214", and it can be determined that the sub-symbol sequence of "a" is "111323", the sub-symbol sequence of "b" is "121421", the sub-symbol sequence of "c" is "141122", and the sub-symbol sequence of "7" is "122312"; resulting in a second symbol sequence of "211214111323121421141122122312";
based on the coding rule of Code128B Code system, according to the second Code element sequence, the following are determined: the content number (ID value) of the character "StartB" corresponding to the start code is "104", "the content number corresponding to" a "is" 33 "," the content number corresponding to "b" is "66", "the content number corresponding to" c "is" 67 ", and the content number corresponding to" 7 "is" 7 ". The content number (ID value) corresponding to the character may be directly obtained from the character, or a sub-symbol sequence corresponding to each character may be determined from a "second symbol sequence" corresponding to the character string, and the content number (ID value) corresponding to each character may be determined from the sub-symbol sequence.
The reference value is solved according to equation 1,
reference value = (104 + 1 × 33 + 2 × 66 + 3 × 67 + 4 × 7)% 103 = 86
And comparing the calculated reference value with the verification data corresponding to the verification code, if the reference value is consistent with the verification data corresponding to the verification code, determining that the result of the second verification is verification pass, and otherwise, determining that the result of the second verification is verification fail.
< example 2>
Taking the Code system of Code128C converted Code128A as an example, the verification rule corresponding to the Code system of Code128 is: and calculating a reference value according to formula 1, and comparing the reference value with the verification data corresponding to the verification code to verify the second code element sequence.
The process of verifying the second sequence of symbols according to the verification code comprises:
carrying out character recognition on a character detection area in the bar code image to obtain a character string '952700A';
according to the Code128 system (table 1), it can be determined that the character corresponding to the start Code is "StartC", the sub-symbol sequence constituting the start Code is "211232", and it can be determined that the sub-symbol sequence of "95" is "114113", the sub-symbol sequence of "27" is "312212", the sub-symbol sequence of "00" is "212222", the sub-symbol sequence of the conversion Code "CODEA" is "311141", and the sub-symbol sequence of "a" is "111323"; resulting in a second symbol sequence of "211232114113312212212222311141111323".
Based on the coding rules of Code128C Code system and Code128A Code system, according to the second symbol sequence, the following are determined: the content number (ID value) corresponding to the character "StartC" corresponding to the start code is "105", "95" corresponding to the content number is "95", and "27" corresponding to the content number is "27"; the conversion code "CODEA" corresponds to a content number "101", "00" corresponds to a content number "0", and "a" corresponds to a content number "33". The content number (ID value) corresponding to the character may be directly obtained from the character, or a sub-symbol sequence corresponding to each character may be determined from a "second symbol sequence" corresponding to the character string, and the content number (ID value) corresponding to each character may be determined from the sub-symbol sequence.
The reference value is solved according to equation 1,
reference value = (105 + 1 × 95 + 2 × 27 + 3 × 0 + 4 × 101 + 4 × 33)% 103 = 71
And comparing the calculated reference value with the verification data corresponding to the verification code, if the reference value is consistent with the verification data corresponding to the verification code, determining that the result of the second verification is verification pass, and otherwise, determining that the result of the second verification is verification fail.
According to the embodiment provided by the specification, according to the preset code system, the verification code is used for carrying out second verification on the character string identified from the character detection area, the problem that the character string does not contain the verification code and cannot be verified can be solved, and therefore the error identification rate of character identification is greatly reduced. In addition, the embodiment only needs to acquire the verification code through the bar code pattern of the bar code, so that the identification and verification of the bar code can be realized based on the character identification method, the identification of the bar code can be completed under the condition that the bar code is damaged, polluted and shielded, and the identification rate of the bar code can be improved.
In another embodiment, the step of performing the second verification on the character string by using the verification code may further include: steps S2410b to S2430 b.
In step S2410b, a code system is identified from the first symbol sequence.
In step S2420b, a second symbol sequence is obtained by using string coding according to the identified code system.
And step S2430b, verifying the second symbol sequence according to the verification code.
In one embodiment, a start code, an end code, and a conversion code in the first symbol sequence may be obtained from the first symbol sequence, and a code system may be identified from the start code, the end code, and the conversion code.
< example 1>
Taking Code128 Code system as an example, the process of identifying the Code system according to the start Code, the end Code and the conversion Code and verifying the second symbol sequence will be described.
Assume that the first symbol sequence is acquired as "211232314 x 1141311211243311212331112" where "x" represents the missing portion of the first symbol sequence, based on the barcode pattern in the barcode image.
The first symbol sequence obtained was sequentially decomposed into "211232", "314 ×", "114131", "121124", "331121", and "2331112". After analysis, the "211232" corresponds to the start Code of Code128C, and the "114131" corresponds to the converted Code ", so that the coding rule of the barcode corresponding to the first symbol sequence is the coding rule of Code128C combined with Code 128B.
According to the identified code system, the verification rule can be determined as follows: and calculating a reference value according to formula 1, and comparing the reference value with the verification data corresponding to the verification code to verify the second code element sequence.
Character recognition is performed on the character detection area in the barcode image, and a character string "6021 a" is acquired.
The second symbol sequence "2112323141112132121141311211242331112" is determined from the character string based on the encoding rules of Code128C Code system and Code128B Code system.
Based on the coding rules of Code128C Code system and Code128B Code system, according to the second symbol sequence, the following are determined: the start code corresponds to a content number (ID value) of "105", "60" corresponds to a content number of "60", "21" corresponds to a content number of "21", the conversion code "CODEB" corresponds to a content number of "100", and "a" corresponds to a content number of "65".
The reference value is solved according to equation 1,
reference value = (105 + 1 × 60 + 2 × 21 + 3 × 100 + 4 × 65)% 103 = 56
From the "331121" of the verification code in the first sequence of symbols, the check data can be determined to be 56.
And if the calculated reference value is consistent with the verification data corresponding to the verification code, the result of the second verification is considered to be passed.
In one embodiment, a traffic data symbol may be determined from the first sequence of symbols, and a code scheme may be identified based on the type of traffic data symbol.
< example 2>
A description will be given of a procedure in which a code scheme can be identified and a second symbol sequence can be verified according to the type of a service data symbol.
Assume that the first sequence of symbols is acquired as "× 12132121211241133212331112" based on the barcode pattern in the barcode image, where "×" represents a missing portion of the first sequence of symbols.
The first symbol sequence obtained was sequentially decomposed into "× 1", "213212", "121124", "141221" and "2331112". After analysis, "2331112" is the end Code, and "141221" immediately adjacent to the end Code is the verification Code, it can be known that "213212" and "121124" are the traffic data symbols, and "213212" corresponds to "21" in Code128C Code system, "5" in Code128B Code system, and "5" and "121124" in Code128A Code system, "a" in Code128B Code system. Since the symbol sequence corresponding to the converted Code does not exist in the first symbol sequence, the Code system for recognizing the barcode is Code 128B.
According to the identified code system, the verification rule can be determined as follows: a reference value is calculated according to equation 1 and compared to the verification code to verify the second sequence of symbols.
Character recognition is performed on the character detection area in the barcode image, and a character string "N5 a" is acquired.
Based on the encoding rule of Code128B Code system, a second symbol sequence "2112141133212132121211242331112" is determined from the character string.
Based on the coding rule of Code128B Code system, according to the second Code element sequence, the following are determined: the content number (ID value) of the character corresponding to the start code is "104", "the content number corresponding to N" is "46", "the content number corresponding to 5" is "21", and the content number corresponding to a "is" 65 ".
The reference value is solved according to equation 1,
reference value = (104 + 1 × 46 + 2 × 21 + 3 × 65)% 103 = 78
From the "141221" of the verification code in the first sequence of symbols, the check data can be determined to be 68.
And if the calculated reference value is inconsistent with the check data corresponding to the verification code, the result of the second verification is regarded as verification failure.
In one embodiment, the code system is identified based on a character string. Specifically, the code system may be identified according to the type of characters and the number of characters in the character string.
< example 3>
And identifying a code system according to the type of the characters in the character string and the number of the characters, and explaining an identification process and a process of verifying the second code element sequence.
Assume that the first symbol sequence is acquired as "2 x 23121222311 x 3232131312331112" based on the barcode pattern in the barcode image, where "x" represents the missing portion of the first symbol sequence.
Character recognition is performed on the character detection area in the barcode image, and a character string "112233" is acquired.
From the character string "112233", it can be seen that the character string includes only numeric characters and the number of characters is an even number, based on which the Code system is identified as Code128C Code system.
According to the encoding rule of Code128C, it can be determined that the character corresponding to the start Code is "StartC", the sub-symbol sequence constituting the start Code is "211232", and it can be determined that the sub-symbol sequence of "11" is "231212", the sub-symbol sequence of "22" is "223112", and the sub-symbol sequence of "33" is "111323";
resulting in a second symbol sequence of "2112322312122231121113232331112";
based on the coding rule of Code128C Code system, according to the second Code element sequence, the following are determined: the content number (ID value) of the character "StartC" corresponding to the start code is "105", the content number corresponding to "11" is "11", the content number corresponding to "22" is "22", and the content number corresponding to "33" is "33".
The reference value is solved according to equation 1,
reference value = (105 + 1 × 11 + 2 × 22 + 3 × 33)% 103 = 53
Based on the encoding rule of Code128C Code system, the check data can be determined to be 53 according to "213131" of the verification Code in the first symbol sequence.
And if the calculated reference value is consistent with the verification data corresponding to the verification code, the result of the second verification is considered to be passed.
In an embodiment provided by the present specification, a code system of a barcode is identified according to a first code element sequence, so that a character string is encoded according to the identified code system to obtain a second code element sequence, and a verification code is used to perform a second verification on the second code element sequence, and after the verification is passed, the word number string is output as the content of the barcode corresponding to the barcode. In the embodiment of the disclosure, the code system of the bar code can be identified according to the first code element sequence, and the problem that the character string does not contain the verification code and cannot be verified can be solved, so that the error identification rate of character identification is greatly reduced.
In step S2500, if the result of the second verification is that the verification is passed, the character string is output as the barcode content.
And outputting the result of bar code identification failure in the case that the second verification result is that the verification fails.
< example >
As shown in FIG. 3, the method for identifying a barcode may include the following steps S301 to S310.
Step S301, acquiring a bar code image;
step S302, decoding a bar code pattern in the bar code image to obtain a first code element sequence, wherein the first code element sequence at least comprises an end code and a verification code;
step S303, judging whether the first code element sequence is successfully obtained, and entering step S304 under the condition that the first code element sequence is successfully obtained; if the first symbol sequence acquisition fails, the process proceeds to step S310;
step S304, carrying out first verification on the first code element sequence by using a verification code;
step S305, judging whether the result of the first verification is verification passing, if the result of the first verification is verification failing, entering step S306, and if the result of the first verification is verification passing, entering step S310;
step S306, carrying out character recognition on the character detection area in the bar code image to obtain a character string, and carrying out second verification on the character string by using the verification code;
step S307, judging whether the result of the second verification is verification passing, if the result of the second verification is verification passing, entering step S308, and if the result of the second verification is verification failing, entering step S309;
step S308, outputting the character string as the bar code content;
step S309, outputting the result of bar code identification failure;
step S310 outputs a character string corresponding to the service data symbol in the first symbol sequence as barcode content.
The embodiment provided by the specification can obtain the verification code by decoding the barcode pattern in the barcode image, and perform the second verification on the character string obtained from the character detection area in the barcode image by using the verification code under the condition that the result of the first verification performed on the first code element sequence by using the verification code is failed, can complete the identification of the barcode under the condition that the barcode is damaged, contaminated and shielded, and perform the second verification on the character string identified from the character detection area by using the verification code, and can overcome the problem that the character string cannot be verified without the verification code, thereby reducing the misrecognition rate of character identification.
< method for determining merchandise information >
Fig. 4 is a schematic diagram of a method for determining commodity information according to an embodiment of the present specification. The method for determining the commodity information provided in this embodiment is implemented by a computer technology, and may be implemented by the barcode recognition apparatus described in fig. 1.
The method for determining information about a commodity provided in this embodiment includes steps S410 to S450.
Step S410, a commodity image is acquired, and the commodity image includes a barcode image.
Step S420, decoding the barcode pattern in the barcode image to obtain a first code element sequence, where the first code element sequence at least includes an end code and a verification code.
Step S430, performing a first verification on the first symbol sequence using the verification code.
In step S440, in a case where the result of the first verification is that the verification fails, character recognition is performed on the character detection area in the barcode image to obtain a character string, and a second verification is performed on the character string using the verification code.
In step S450, in case that the result of the second verification is verification pass,
and determining commodity information according to the character string so as to present the commodity information to a user, wherein the commodity information comprises commodity name information, price information and manufacturer information.
The embodiment of the specification can be applied to convenience stores or supermarkets, and consumers can use the equipment with the bar code identification device of the embodiment to identify the commodity image, acquire commodity information, select commodities according to the commodity information and realize self-service shopping.
According to the embodiment provided by the specification, the barcode pattern in the barcode image is decoded, the verification code can be obtained, the character string obtained from the character detection area in the barcode image is verified by using the verification code, the bar code misrecognition rate can be reduced, and the accuracy of determining the commodity information is improved.
< Payment method >
Fig. 5 is a schematic diagram of a payment method provided by an embodiment of the present description. The payment method provided by this embodiment, which is implemented by computer technology, may be implemented by the barcode identification apparatus described in fig. 1.
The payment method provided by the embodiment comprises the steps S510-S550.
Step S510, acquiring a barcode image, where the barcode image is a barcode image for payment provided by a user.
Step S520, decoding the barcode pattern in the barcode image to obtain a first code element sequence, where the first code element sequence at least includes an end code and a verification code.
In step S530, a first verification is performed on the first symbol sequence by using the verification code.
In step S540, in the case that the result of the first verification is that the verification fails, character recognition is performed on the character detection area in the barcode image to obtain a character string, and a second verification is performed on the character string using the verification code.
In step S550, in case that the result of the second verification is verification pass,
and determining account information according to the character string so as to deduct fees according to the account information.
According to the embodiment provided by the specification, the verification code can be acquired by decoding the bar code pattern in the bar code image, the character string acquired from the character detection area in the bar code image is verified by using the verification code, the error recognition rate of the bar code can be reduced, the accuracy of acquiring account information is ensured, and the fee deduction error caused by the decoding error of the bar code is avoided.
< Bar code recognition device >
Fig. 6 is a schematic diagram of a barcode identification device provided in an embodiment of the present description.
The barcode identification apparatus 60 provided in this embodiment includes an obtaining module 61, a decoding module 62, a first verification module 63, a character string verification module 64, a second verification module 65, and an output module 66.
The acquisition module 61 may be used to acquire a barcode image;
the decoding module 62 may be configured to decode a barcode pattern in the barcode image to obtain a first sequence of symbols.
In one embodiment, the first sequence of symbols includes at least an end code and a verification code.
The first verification module 63 may be configured to perform a first verification of the first sequence of symbols using a verification code.
The character string verification module 64 may be configured to perform character recognition on the character detection area in the barcode image to obtain the character string if the result of the first verification is that the verification is not passed.
The second verification module 65 may be configured to perform a second verification of the character string using the verification code.
In an embodiment, the second verification module 65 may be further configured to obtain a second symbol sequence by using string coding according to a preset code system; and the number of the first and second groups,
for verifying the second sequence of symbols according to the verification code.
In one embodiment, the second verification module 65 may be further configured to identify the code system based on the first symbol sequence;
according to the identified code system, a second code element sequence is obtained by using character string coding; and the number of the first and second groups,
for validating the second sequence of symbols according to the validation code,
the output module 66 may be configured to output the character string as the barcode content if the result of the second verification is verification pass.
In one embodiment, the output module 66 may be further configured to output, as the barcode content, the character string corresponding to the service data symbol in the first symbol sequence if the result of the first verification is verification pass.
In one embodiment, the output module 66 may be further configured to output a result of the barcode identification failure if the result of the second verification is that the verification fails.
In one embodiment, the output module 66 may be further configured to output a result of the barcode recognition failure in case of failure to acquire the first symbol sequence.
< Bar code recognition device >
Fig. 7 is a schematic diagram of a barcode identification device provided in an embodiment of the present description.
The barcode identification apparatus 70 provided in this embodiment includes a processor 72 and a memory 71, where the memory 71 stores therein computer instructions, and the computer instructions are executed by the processor 72 to perform the barcode identification method according to any one of the foregoing embodiments.
The embodiment provided by the specification can obtain the verification code by decoding the bar code pattern in the bar code image, and under the condition that the first verification performed on the first code element sequence by using the verification code does not pass, the character string obtained from the character detection area in the bar code image is subjected to second verification by using the verification code, the identification of the bar code can be completed under the conditions that the bar code is damaged, polluted and shielded, and meanwhile, the character string identified from the character detection area is subjected to second verification by using the verification code, the problem that the verification code cannot be checked when the character string does not contain the verification code can be overcome, so that the error recognition rate of character identification is greatly reduced.
< computer-readable storage Medium >
The present specification further provides a computer readable storage medium, on which computer instructions are stored, and when the computer instructions are executed by a processor, the method for identifying a barcode according to any one of the foregoing embodiments is executed.
The present invention may be a system, method and/or computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions embodied therewith for causing a processor to implement various aspects of the present invention.
The computer readable storage medium may be a tangible device that can hold and store the instructions for use by the instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic memory device, a magnetic memory device, an optical memory device, an electromagnetic memory device, a semiconductor memory device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a Static Random Access Memory (SRAM), a portable compact disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, a mechanical coding device, such as punch cards or in-groove projection structures having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media as used herein is not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., optical pulses through a fiber optic cable), or electrical signals transmitted through electrical wires.
The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or to an external computer or external storage device via a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. The network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in the respective computing/processing device.
The computer program instructions for carrying out operations of the present invention may be assembler instructions, Instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, aspects of the present invention are implemented by personalizing an electronic circuit, such as a programmable logic circuit, a Field Programmable Gate Array (FPGA), or a Programmable Logic Array (PLA), with state information of computer-readable program instructions, which can execute the computer-readable program instructions.
Aspects of the present invention are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer-readable program instructions may also be stored in a computer-readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer-readable medium storing the instructions comprises an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions. It is well known to those skilled in the art that implementation by hardware, implementation by software, and implementation by a combination of software and hardware are equivalent.
Having described embodiments of the present invention, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen in order to best explain the principles of the embodiments, the practical application, or improvements made to the technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein. The scope of the invention is defined by the appended claims.

Claims (11)

1. A method of identifying a bar code, comprising:
acquiring a bar code image;
decoding a bar code pattern in the bar code image to obtain a first code element sequence, wherein the first code element sequence at least comprises an end code and a verification code;
performing a first verification on the first sequence of symbols using a verification code;
in the case that the first verification result is that the verification fails, performing character recognition on a character detection area in the barcode image to acquire a character string, and performing second verification on the character string by using a verification code; and the number of the first and second groups,
and in the case that the second verification result is that the verification is passed, outputting the character string as the bar code content.
2. The method of claim 1, further comprising: and outputting the result of bar code identification failure in the case that the second verification result is that the verification fails.
3. The method of claim 1, further comprising: and when the first verification result is that the verification is passed, outputting the character string corresponding to the service data code element in the first code element sequence as the bar code content.
4. The method of claim 1, further comprising: and outputting a bar code identification failure result under the condition that the first code element sequence is failed to be acquired.
5. The method of claim 1, the second validating the string using the validation code, comprising:
according to a preset code system, a second code element sequence is obtained by using character string coding;
and verifying the second code element sequence according to the verification code.
6. The method of claim 1, the second validating the string using the validation code, comprising:
identifying a code system according to the first code element sequence;
according to the identified code system, a second code element sequence is obtained by using character string coding;
and verifying the second code element sequence according to the verification code.
7. A method of determining merchandise information, comprising:
acquiring a commodity image, wherein the commodity image comprises a bar code image;
decoding a bar code pattern in the bar code image to obtain a first code element sequence, wherein the first code element sequence at least comprises an end code and a verification code;
performing a first verification on the first symbol sequence using a verification code;
in the case that the first verification result is that the verification fails, performing character recognition on a character detection area in the barcode image to acquire a character string, and performing second verification on the character string by using a verification code; and the number of the first and second groups,
and determining commodity information according to the character string to present the commodity information to the user under the condition that the second verification result is verification passing.
8. A payment method, comprising:
acquiring a bar code image, wherein the bar code image is a bar code image for payment provided by a user;
decoding a bar code pattern in the bar code image to obtain a first code element sequence, wherein the first code element sequence at least comprises an end code and a verification code;
performing a first verification on the first symbol sequence using a verification code;
in the case that the first verification result is that the verification fails, performing character recognition on a character detection area in the barcode image to acquire a character string, and performing second verification on the character string by using a verification code; and the number of the first and second groups,
and under the condition that the second verification result is that the verification is passed, determining account information according to the character string so as to deduct fees according to the account information.
9. A bar code identification device comprising:
the acquisition module is used for acquiring a bar code image;
the decoding module is used for decoding the bar code pattern in the bar code image to obtain a first code element sequence, and the first code element sequence at least comprises an end code and a verification code;
a first verification module, configured to perform a first verification on the first symbol sequence by using a verification code;
the character string verification module is used for carrying out character recognition on the character detection area in the bar code image to acquire a character string under the condition that the first verification result is that the verification fails;
the second verification module is used for performing second verification on the character string by using the verification code;
and the output module is used for outputting the character string as the bar code content under the condition that the second verification result is that the verification is passed.
10. A bar code identification device comprising: the memory has stored therein computer instructions which, when executed by the processor, perform the method of any of claims 1-6.
11. A computer storage medium having stored thereon computer instructions which, when executed by a processor, perform the method of any of claims 1-6.
CN202010258076.XA 2020-04-03 2020-04-03 Barcode identification method and device, commodity information determination method and payment method Pending CN111144161A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010258076.XA CN111144161A (en) 2020-04-03 2020-04-03 Barcode identification method and device, commodity information determination method and payment method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010258076.XA CN111144161A (en) 2020-04-03 2020-04-03 Barcode identification method and device, commodity information determination method and payment method

Publications (1)

Publication Number Publication Date
CN111144161A true CN111144161A (en) 2020-05-12

Family

ID=70528779

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010258076.XA Pending CN111144161A (en) 2020-04-03 2020-04-03 Barcode identification method and device, commodity information determination method and payment method

Country Status (1)

Country Link
CN (1) CN111144161A (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111738031A (en) * 2020-08-06 2020-10-02 江苏东大集成电路系统工程技术有限公司 One-dimensional bar code identification method
CN111797647A (en) * 2020-07-08 2020-10-20 北京京东振世信息技术有限公司 Bar code decoding method and device
CN111797952A (en) * 2020-06-09 2020-10-20 南岳生物制药有限公司 Intelligent plasma quality interpretation instrument and quality detection method thereof
CN112733568A (en) * 2021-01-21 2021-04-30 北京京东振世信息技术有限公司 One-dimensional bar code identification method, device, equipment and storage medium
CN112989862A (en) * 2021-02-08 2021-06-18 北京声智科技有限公司 Bar code checking method and device, storage medium and electronic equipment
CN113159727A (en) * 2021-05-07 2021-07-23 多点(深圳)数字科技有限公司 Commodity detection method and device, electronic equipment and storage medium
CN113312937A (en) * 2021-06-25 2021-08-27 展讯通信(上海)有限公司 Bar code identification method and device, storage medium and computer equipment
CN114004245A (en) * 2021-10-25 2022-02-01 北京小米移动软件有限公司 Bar code information identification method, device, equipment and storage medium
CN114692663A (en) * 2022-03-30 2022-07-01 上海中商网络股份有限公司 Photographing identification fault-tolerant method for code reading failure
WO2023011155A1 (en) * 2021-08-02 2023-02-09 深圳思谋信息科技有限公司 Barcode identification method and apparatus, computer device and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1848136A (en) * 2005-04-13 2006-10-18 摩托罗拉公司 Method and system for decoding bar code image
WO2010037429A1 (en) * 2008-09-30 2010-04-08 Novelty Group Limited Method for generating a verification code, verification code, method and device for verifying the authenticity of objects
CN106446732A (en) * 2015-08-13 2017-02-22 株式会社理光 Barcode identification method, device and equipment
CN107016316A (en) * 2016-10-24 2017-08-04 阿里巴巴集团控股有限公司 A kind of recognition methods of bar code and device
CN109754044A (en) * 2019-01-14 2019-05-14 上海证大喜马拉雅网络科技有限公司 Bar code, bar code generation method and recognition methods

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1848136A (en) * 2005-04-13 2006-10-18 摩托罗拉公司 Method and system for decoding bar code image
WO2010037429A1 (en) * 2008-09-30 2010-04-08 Novelty Group Limited Method for generating a verification code, verification code, method and device for verifying the authenticity of objects
CN106446732A (en) * 2015-08-13 2017-02-22 株式会社理光 Barcode identification method, device and equipment
CN107016316A (en) * 2016-10-24 2017-08-04 阿里巴巴集团控股有限公司 A kind of recognition methods of bar code and device
CN109754044A (en) * 2019-01-14 2019-05-14 上海证大喜马拉雅网络科技有限公司 Bar code, bar code generation method and recognition methods

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
农小晓等: "《条码技术及应用》", 30 April 2014, 北京交通大学出版社 *

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111797952A (en) * 2020-06-09 2020-10-20 南岳生物制药有限公司 Intelligent plasma quality interpretation instrument and quality detection method thereof
CN111797952B (en) * 2020-06-09 2024-03-12 南岳生物制药有限公司 Intelligent plasma quality judging and reading instrument and quality detection method thereof
CN111797647B (en) * 2020-07-08 2023-11-03 北京京东振世信息技术有限公司 Bar code decoding method and device
CN111797647A (en) * 2020-07-08 2020-10-20 北京京东振世信息技术有限公司 Bar code decoding method and device
CN111738031B (en) * 2020-08-06 2021-03-02 江苏东大集成电路系统工程技术有限公司 One-dimensional bar code identification method
CN111738031A (en) * 2020-08-06 2020-10-02 江苏东大集成电路系统工程技术有限公司 One-dimensional bar code identification method
CN112733568A (en) * 2021-01-21 2021-04-30 北京京东振世信息技术有限公司 One-dimensional bar code identification method, device, equipment and storage medium
CN112733568B (en) * 2021-01-21 2024-04-19 北京京东振世信息技术有限公司 One-dimensional bar code recognition method, device, equipment and storage medium
CN112989862A (en) * 2021-02-08 2021-06-18 北京声智科技有限公司 Bar code checking method and device, storage medium and electronic equipment
CN113159727A (en) * 2021-05-07 2021-07-23 多点(深圳)数字科技有限公司 Commodity detection method and device, electronic equipment and storage medium
CN113312937A (en) * 2021-06-25 2021-08-27 展讯通信(上海)有限公司 Bar code identification method and device, storage medium and computer equipment
WO2023011155A1 (en) * 2021-08-02 2023-02-09 深圳思谋信息科技有限公司 Barcode identification method and apparatus, computer device and storage medium
CN114004245A (en) * 2021-10-25 2022-02-01 北京小米移动软件有限公司 Bar code information identification method, device, equipment and storage medium
CN114692663B (en) * 2022-03-30 2023-09-29 上海中商网络股份有限公司 Photographing identification fault tolerance method for code reading failure
CN114692663A (en) * 2022-03-30 2022-07-01 上海中商网络股份有限公司 Photographing identification fault-tolerant method for code reading failure

Similar Documents

Publication Publication Date Title
CN111144161A (en) Barcode identification method and device, commodity information determination method and payment method
CN107016420B (en) Service processing method and device
US20160350568A1 (en) Two-dimensional (2-d) code generating method, detecting method, detecting apparatus, and anti-counterfeit label
US8736615B2 (en) Customizing barcode images for particular displays
CN108665041B (en) Two-dimensional code generation and identification method and device, computer equipment and storage medium
US9027833B2 (en) Commodity information display apparatus and method for displaying commodity information in different forms
US9740901B2 (en) Graphical menu builder for encoding applications in an image
CN108351956B (en) Method and system for printing forensic-encoded 2D barcodes
EP3425554A1 (en) Information code and information code reading method
Tarjan et al. Automatic identification based on 2D barcodes
US9317503B2 (en) System and method for naming an image file
CN112884101A (en) Graphic code, graphic code encoding method and graphic code decoding method
JP6199641B2 (en) Form reader and program
CN101611419B (en) Method and apparatus for creating and sending a code grid to a portable communication device
EP3531335B1 (en) Barcode identification method and apparatus
CN107016317B (en) Bar code decoding method and device
WO2018190411A1 (en) Code reading device, method, and program
US11227302B2 (en) Code reading device, method, and program
US20160217487A1 (en) Redeeming coupons using instructions stored at a remote storage location
JP2003281483A (en) Bar code, bar code system using the same, bar code generation apparatus, and bar code reader
CN109325380A (en) By configuring the method and system for realizing that label bar code automatically parses
CN110929539B (en) Decoding method and decoding system with website type two-dimensional bar code filtering function
US8915433B2 (en) Indentifier eligibility
CN111598975A (en) Electronic tag image rendering method and related device
CN110287753B (en) Method, device and server for updating article information

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
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40029916

Country of ref document: HK

RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200512