Code scanning method and device, and storage medium

CN117391102BActive Publication Date: 2026-08-11XIAMEN PINNACLE ELECTRICAL CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-28
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

[0003]然而,由于电子屏幕存在玻璃反光以及自发光的特性,常规的扫码方法会导致电子屏幕示出二维码存在反光或发光过亮等问题,导致二维码识读困难

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117391102B_ABST
    Figure CN117391102B_ABST
Patent Text Reader

Abstract

This application provides a scanning method, device, and storage medium, relating to the field of barcode scanning technology. The method includes: acquiring a moving image of a scene, and determining whether a screen with high brightness characteristics (like an electronic screen) exists in the current scene based on the area of ​​the light spot in the moving image. If so, a recognition method for electronic screen codes is used for reading; otherwise, a recognition method for non-electronic screen codes is used. Not illuminating the electronic screen avoids interference caused by reflections, while illuminating non-electronic screen items such as product barcodes facilitates rapid recognition. Based on this, the solution of this application can achieve efficient scanning in scenarios where product barcodes and electronic screen QR codes coexist. It avoids electronic screen reflections or excessive brightness while effectively supplementing the illumination of product barcodes, achieving efficient dual-code recognition and significantly improving scanning speed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of barcode scanning technology, and in particular to a barcode scanning method, device and storage medium. Background Technology

[0002] With the development of network technology, scanning has become an effective way to identify and input information. In typical product purchase scenarios, scannable information codes include barcodes and QR codes. Barcodes are generally printed on the outer packaging of products, while QR codes are usually displayed to users through electronic screens. Currently, barcode scanning devices on the market typically activate their lights to illuminate the information code to be identified after sensing changes in ambient brightness, and then perform recognition on the collected information code.

[0003] However, due to the reflective properties of glass and the self-illuminating nature of electronic screens, conventional scanning methods can cause problems such as glare or excessive brightness when displaying QR codes, making them difficult to read. Some technologies use repeated aperture adjustments to eliminate screen glare and excessive brightness caused by lighting, but this method wastes time switching between different apertures, resulting in significant scanning delays and impacting scanning speed.

[0004] Therefore, there is an urgent need for a technical solution that can efficiently scan barcodes and QR codes on electronic screens in scenarios where they appear together. This solution should avoid glare or excessive brightness on the electronic screen and provide effective illumination for the barcodes, achieving efficient dual-code recognition and greatly improving scanning speed. Summary of the Invention

[0005] This application provides a scanning method, device, and storage medium that can achieve efficient scanning in scenarios where product barcodes and electronic screen QR codes appear together. It can avoid electronic screen glare or excessive brightness, and can effectively supplement the light for product barcodes, achieving efficient dual-code identification and greatly improving scanning speed.

[0006] To achieve the above objectives, firstly, this application provides a QR code scanning method, which includes:

[0007] S1. In response to detecting a change in the scene, acquire a shaking image in the scene, the shaking image including an information code to be identified;

[0008] S2. When the area of ​​the light spot in the shaking image accounts for more than a preset percentage in the total area of ​​the shaking image, it is determined that an electronic screen code appears in the shaking image, and S3 is executed. The light spot refers to the area in the shaking image whose brightness is higher than a preset brightness threshold.

[0009] S3. Without turning on the scanning light, perform electronic screen code recognition on the information code to be identified in the scene.

[0010] S4. When the area of ​​the light spot accounts for no more than the preset percentage in the total area of ​​the shaking image, it is determined that a non-electronic screen code appears in the shaking image, and step S5 is executed.

[0011] S5. With the scanning light turned on, perform non-electronic screen code recognition on the information code to be identified in the scene.

[0012] In one possible implementation, S3 includes:

[0013] After controlling the scanning light to flash for a preset time, the scanning light is turned off, and the electronic screen code recognition is performed on the information code to be identified in the scene.

[0014] In one possible implementation, the method further includes:

[0015] If screen code recognition fails in step S3, or if non-screen code recognition fails in step S5, the duration of code recognition is read.

[0016] If the code recognition duration does not exceed the preset duration, then code recognition continues;

[0017] If the duration of the code recognition exceeds the preset duration, then step S1 is executed.

[0018] In one possible implementation, the method further includes:

[0019] If the electronic screen code is successfully recognized in step S3, a scanning prompt voice message corresponding to the electronic screen code will be issued to end the electronic screen code recognition process.

[0020] If the non-electronic screen code is successfully recognized in step S5, the scanning light is turned off, a scanning prompt voice corresponding to the non-electronic screen code is emitted, and the non-electronic screen code recognition process ends.

[0021] In one possible implementation, S1 includes:

[0022] In response to detecting a change in ambient brightness in the scene exceeding a preset shaking threshold, the shaking image is acquired.

[0023] In one possible implementation, the electronic screen code includes a QR code or a one-dimensional code displayed on an electronic screen; the non-electronic screen code includes a barcode displayed on a non-electronic screen.

[0024] Secondly, a barcode scanning device is provided, comprising a barcode scanning illumination lamp and a barcode recognition module, wherein the barcode recognition module is used to perform:

[0025] S1. In response to detecting a change in the scene, acquire a shaking image in the scene, the shaking image including an information code to be identified;

[0026] S2. When the area of ​​the light spot in the shaking image accounts for more than a preset percentage in the total area of ​​the shaking image, it is determined that an electronic screen code appears in the shaking image, and S3 is executed. The light spot refers to the area in the shaking image whose brightness is higher than a preset brightness threshold.

[0027] S3. Without turning on the scanning light, perform electronic screen code recognition on the information code to be identified in the scene.

[0028] S4. When the area of ​​the light spot accounts for no more than the preset percentage in the total area of ​​the shaking image, it is determined that a non-electronic screen code appears in the shaking image, and step S5 is executed.

[0029] S5. With the scanning light turned on, perform non-electronic screen code recognition on the information code to be identified in the scene.

[0030] Thirdly, a computer-readable storage medium is provided, wherein at least one program is stored therein, the at least one program being executed by a processor to implement the barcode scanning method as provided in the first aspect.

[0031] The technical solution provided in this application includes at least the following technical effects:

[0032] The solution proposed in this application avoids interference caused by reflections when the electronic screen is not illuminated, while illuminating the product barcode facilitates quick and easy barcode recognition. It enables efficient scanning in scenarios where product barcodes and electronic screen QR codes appear together. This solution avoids reflections or excessive brightness on the electronic screen and effectively supplements the lighting of the product barcode, achieving efficient dual-code recognition and greatly improving scanning speed. Attached Figure Description

[0033] Figure 1 This is a flowchart illustrating a scanning method provided in this application according to an exemplary embodiment;

[0034] Figure 2 This is a flowchart illustrating another scanning method provided by this application according to an exemplary embodiment;

[0035] Figure 3 This is a schematic diagram of the structure of a barcode scanning device provided in this application according to an exemplary embodiment. Detailed Implementation

[0036] To further illustrate the various embodiments, this application provides accompanying drawings. These drawings are part of the disclosure of this application and are mainly used to illustrate the embodiments, and can be used in conjunction with the relevant descriptions in the specification to explain the operating principles of the embodiments. With reference to these drawings, those skilled in the art should be able to understand other possible implementations and the advantages of this application. Components in the drawings are not drawn to scale, and similar component symbols are generally used to represent similar components. In this application, the term "at least one" means one or more, and the term "multiple" means two or more.

[0037] This application will now be further described in conjunction with the accompanying drawings and specific embodiments.

[0038] The scanning method provided in this application can be applied to any scanning device to improve scanning speed and code recognition efficiency. The scanning device can be, for example, a barcode scanner, a barcode box, or a scanning module. The scanning device can be handheld, fixed, or embedded (embedded in the entire device); this application does not limit its application in this regard.

[0039] Figure 1 This is a schematic flowchart illustrating a barcode scanning method provided in this application according to an exemplary embodiment. (Reference) Figure 1 The scanning method provided in this application includes steps S1 to S5.

[0040] S1. In response to detecting a change in the scene, acquire a shaking image in the scene, the shaking image including the information code to be identified.

[0041] In this embodiment, the presence of a barcode scanner or product waiting to be scanned is determined by detecting whether the ambient brightness in the scene changes sufficiently. Step S1 specifically includes: in response to detecting a change in ambient brightness exceeding a preset shaking threshold, acquiring the shaking image.

[0042] In one possible implementation, the shaking image includes multiple images captured at consecutive time intervals, which can be used to detect the presence of a moving object, which may be a barcode scanner or a product.

[0043] The preset shaking threshold is used to determine whether changes in ambient brightness are caused by obstruction from the barcode display device or the product.

[0044] Among them, "shaking image" refers to the image (also called a photograph) captured when the barcode display device or product moves within the image acquisition area of ​​the barcode scanner. Understandably, capturing the shaking image after detecting a change in the scene allows for more accurate identification of the barcode information on the display device or product.

[0045] In one possible implementation, after the scanning device is powered on, it enters image sensing mode and executes step S1. Optionally, after the scanning device is powered on, it indicates that it has entered the image sensing mode by, for example, a prompt sound (e.g., a "beep"). Image sensing mode can also be called automatic sensing mode. In image sensing mode, the scanning device is in a state of monitoring scene changes. After detecting a scene change, it captures an image and reads the information code. If the reading is successful, it outputs valid information; if the reading fails and a timeout occurs, it re-enters the state of monitoring scene changes.

[0046] In this embodiment of the application, the information code to be identified includes barcodes and QR codes. For example, a barcode generally refers to a barcode printed on the outer packaging of a product, and a QR code refers to a QR code displayed by the user on the electronic screen of a code display device.

[0047] Of course, in some embodiments, the code displayed by the user on the electronic screen of the code display device may also be a barcode. The core of this application is how to distinguish between electronic screen codes and non-electronic screen codes. This application uses electronic screen codes as QR codes or one-dimensional codes and non-electronic screen codes as barcodes as examples for illustrative purposes, but is not limited to this.

[0048] S2. When the area of ​​the light spot in the shaking image accounts for more than the preset percentage in the total area of ​​the shaking image, it is determined that an electronic screen code appears in the shaking image, and S3 is executed.

[0049] The preset percentage is, for example, 40%. A light spot refers to an area in a shaky image whose brightness is higher than a preset brightness threshold. The preset brightness threshold can be adjusted according to the ambient brightness, or it can be directly fixed at 60% of the default brightness value. This application is not limited to this.

[0050] For example, the scanning device determines whether there is a planar light spot (i.e., a high-brightness light spot) in the shaky image with a brightness value exceeding 60% of the default brightness value and an overall area exceeding 40%. If so, the current shaky image can be considered to meet the brightness of an electronic screen, and an electronic screen code is determined to appear in the shaky image. That is, the information code to be identified in the current shaky image is an electronic screen code.

[0051] In one possible implementation, the shaky image comprises multiple images captured at consecutive moments. Based on the above principle, the multiple images included in the shaky image are judged. When two consecutive images are determined to contain an electronic screen code, it can be determined that an electronic screen code appears in the shaky image, that is, a code display device exists in the current scene.

[0052] In this embodiment of the application, electronic screen codes include: QR codes or one-dimensional codes displayed on an electronic screen, such as mobile payment codes; non-electronic screen codes include: barcodes displayed on a non-electronic screen, such as barcodes printed on the outer packaging of goods.

[0053] S3. Without turning on the scanning light, perform electronic screen code recognition on the information code to be identified in the scene.

[0054] In this embodiment, after determining that an electronic screen code appears in the shaky image, the scanning device controls the scanning light to flash for a preset time, then turns off the scanning light, and performs electronic screen code recognition on the information code to be identified in the scene. The preset time is, for example, 0.1 seconds.

[0055] Through the above process, the scanning device uses a flashing light to indicate that it is reading the code on the electronic screen and to remind the user that the device has started scanning the code.

[0056] In one possible implementation, upon successful recognition of the electronic screen code, the scanning device emits a corresponding scanning prompt voice message, ending the electronic screen code recognition process. For example, the prompt voice message might say, "Welcome to mobile payment." Furthermore, the different payment channels corresponding to the electronic screen code can be displayed in the prompt voice message.

[0057] In one possible implementation, if the electronic screen code recognition fails, the scanning device reads the code recognition duration. This duration is the duration of the current code recognition operation and can be calculated from the moment the flashing light is turned off. If the recognition duration does not exceed a preset duration, the code recognition continues; if it exceeds the preset duration, step S1 is executed. For example, the preset duration is 2 seconds. In this example, if the recognition duration does not exceed 2 seconds, the scanning continues, judging the QR code content, until successful recognition within 2 seconds; if the recognition duration exceeds 2 seconds, the device re-enters the image sensing mode (step S1).

[0058] S4. When the area of ​​the light spot does not exceed the preset proportion in the total area of ​​the shaking image, it is determined that a non-electronic screen code appears in the shaking image, and step S5 is executed.

[0059] This step is similar to step S2 and will not be repeated here.

[0060] S5. With the scanning light on, perform non-electronic screen code recognition on the information codes to be identified in the scene.

[0061] In this embodiment, after determining that a non-electronic screen code appears in the shaky image, the scanning device turns on the scanning light and enters the product barcode recognition process to begin judging the barcode content. For example, the product barcode recognition process can be a European Article Number (EAN) code, which is a product barcode standard developed by the International Article Numbering Association.

[0062] In one possible implementation, if the non-electronic screen code is successfully recognized, the scanning device turns off its scanning light, emits a scanning prompt voice corresponding to the non-electronic screen code, and ends the non-electronic screen code recognition process. The scanning prompt voice for the non-electronic screen code might be, for example, "Scan successful."

[0063] In one possible implementation, if non-electronic screen code recognition fails, the scanning device reads the code recognition duration. This duration is the current recognition duration and can be calculated from when the lighting is turned on. If the recognition duration does not exceed a preset duration, the recognition continues; if it exceeds the preset duration, step S1 is executed. For example, the preset duration is 2 seconds. In this example, if the recognition duration does not exceed 2 seconds, the scanning continues, judging the barcode content until successful recognition within 2 seconds; if the recognition duration exceeds 2 seconds, the device re-enters the image sensing mode (step S1).

[0064] To facilitate understanding of the technical solutions provided in the above embodiments, this application provides a flowchart of another barcode scanning method based on an exemplary embodiment. See also Figure 2 The scanning method includes the following steps a to f.

[0065] Step a: After the scanning device is powered on, it enters the image sensing mode (refer to step S1).

[0066] Step b: Detect whether there is a shaky image in the scene. If there is, proceed to step c; otherwise, return to step a.

[0067] Step c: Determine the type of information code to be identified based on the area of ​​the light spot in the shaking image. If the proportion of the light spot area exceeds the preset proportion, proceed to step d; otherwise, proceed to step e.

[0068] Step d: The light flashes for 0.1 seconds and then turns off, proceeding to the electronic screen code recognition process; if the recognition is successful, the corresponding scanning prompt tone is emitted (for example, prompting the payment method corresponding to the mobile payment code), and then proceed to step g; if the recognition is unsuccessful, proceed to step f.

[0069] Step e: Turn on the light and proceed to the non-electronic screen code (product barcode) recognition process; if the recognition is successful, a corresponding scanning prompt sound will be emitted (e.g., scan successful), and then proceed to step g; if the recognition is unsuccessful, proceed to step f.

[0070] Step f: Determine whether the code recognition duration exceeds the preset duration. If it does not exceed the preset duration, continue reading; if it does exceed the preset duration, return to step a.

[0071] Step h: For non-electronic screen codes, determine whether the shaking image has stopped (the obstructing object has left). If it has left, return to step a. For electronic screen codes, determine whether the light spot feature has disappeared. If it has disappeared, return to step a.

[0072] The solution proposed in this application avoids interference caused by reflections when the electronic screen is not illuminated, while illuminating the product barcode facilitates quick and easy barcode recognition. It enables efficient scanning in scenarios where product barcodes and electronic screen QR codes appear together. This solution avoids reflections or excessive brightness on the electronic screen and effectively supplements the lighting of the product barcode, achieving efficient dual-code recognition and greatly improving scanning speed.

[0073] Furthermore, by determining whether it is an electronic screen code or a product barcode, the subsequent reading process can be precisely controlled, which can greatly improve the code recognition efficiency. The scanning speed can be 45% faster than that of scanning devices in related technologies.

[0074] This application also provides a barcode scanning device for implementing the above-described barcode scanning method. Figure 3 This is a schematic diagram of a barcode scanning device provided in this application according to an exemplary embodiment. (Reference) Figure 3 The barcode scanning device includes: a barcode scanning light 31 and a barcode scanning module 32. The barcode recognition module 32 is used to perform:

[0075] S1. In response to detecting a change in the scene, acquire a shaking image in the scene, the shaking image including an information code to be identified;

[0076] S2. When the area of ​​the light spot in the shaking image accounts for more than a preset percentage in the total area of ​​the shaking image, it is determined that an electronic screen code appears in the shaking image, and S3 is executed. The light spot refers to the area in the shaking image whose brightness is higher than a preset brightness threshold.

[0077] S3. Without turning on the scanning light, perform electronic screen code recognition on the information code to be identified in the scene.

[0078] S4. When the area of ​​the light spot accounts for no more than the preset percentage in the total area of ​​the shaking image, it is determined that a non-electronic screen code appears in the shaking image, and step S5 is executed.

[0079] S5. With the scanning light turned on, perform non-electronic screen code recognition on the information code to be identified in the scene.

[0080] It should be noted that the scanning device provided in the above embodiments is only illustrated by the division of the above functional modules when implementing the corresponding steps. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the scanning device provided in the above embodiments and the scanning method described above belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.

[0081] For example, the code recognition module is a computer unit capable of decoding barcodes and QR codes. The computer unit may include, but is not limited to, a processor and memory. Those skilled in the art will understand that the above-described structure of the computer unit is merely an example and does not constitute a limitation on the computer unit. It may include more or fewer components, or combine certain components, or use different components. For example, the computer unit may also include input / output devices, network access devices, buses, etc., which are not limited in this embodiment.

[0082] Furthermore, as an executable solution, the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc. The processor is the control center of the computer unit, connecting various parts of the entire computer unit via various interfaces and lines.

[0083] The memory can be used to store the computer programs and / or modules. The processor implements various functions of the computer unit by running or executing the computer programs and / or modules stored in the memory and by calling data stored in the memory. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a function; the data storage area may store data created based on the use of the mobile phone, etc. In addition, the memory may include high-speed random access memory and may also include non-volatile memory, such as hard disk, RAM, plug-in hard disk, smart media card (SMC), secure digital card (SD), flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0084] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the barcode scanning method provided in the embodiments of this application.

[0085] If the modules / units integrated in the computer unit are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the scanning methods provided in the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), and a software distribution medium, etc. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction.

[0086] Although this application has been specifically shown and described in conjunction with preferred embodiments, those skilled in the art should understand that various changes in form and detail may be made to this application without departing from the spirit and scope of this application as defined by the appended claims, and all such changes shall be within the scope of protection of this application.

Claims

1. A barcode scanning method, characterized in that, The method includes: S1. In response to detecting a change in the scene, acquire a shaking image in the scene, the shaking image including an information code to be identified; S2. When the area of ​​the light spot in the shaking image accounts for more than a preset percentage in the total area of ​​the shaking image, it is determined that an electronic screen code appears in the shaking image, and S3 is executed. The light spot refers to the area in the shaking image whose brightness is higher than a preset brightness threshold. S3. Without turning on the scanning light, perform electronic screen code recognition on the information code to be identified in the scene. S4. When the area of ​​the light spot accounts for no more than the preset percentage in the total area of ​​the shaking image, it is determined that a non-electronic screen code appears in the shaking image, and step S5 is executed. S5. With the scanning light turned on, perform non-electronic screen code recognition on the information code to be identified in the scene.

2. The scanning method according to claim 1, characterized in that, S3 includes: After controlling the scanning light to flash for a preset time, the scanning light is turned off, and the electronic screen code recognition is performed on the information code to be identified in the scene.

3. The scanning method according to claim 1, characterized in that, The method further includes: If screen code recognition fails in step S3, or if non-screen code recognition fails in step S5, the duration of code recognition is read. If the code recognition duration does not exceed the preset duration, then code recognition continues; If the duration of the code recognition exceeds the preset duration, then step S1 is executed.

4. The scanning method according to claim 1, characterized in that, The method further includes: If the electronic screen code is successfully recognized in step S3, a scanning prompt voice message corresponding to the electronic screen code will be issued to end the electronic screen code recognition process. If the non-electronic screen code is successfully recognized in step S5, the scanning light is turned off, a scanning prompt voice corresponding to the non-electronic screen code is emitted, and the non-electronic screen code recognition process ends.

5. The scanning method according to claim 1, characterized in that, S1 includes: In response to detecting a change in ambient brightness in the scene exceeding a preset shaking threshold, the shaking image is acquired.

6. The scanning method according to claim 1, characterized in that, The electronic screen code includes: a QR code or a one-dimensional code displayed on an electronic screen; the non-electronic screen code includes: a barcode displayed on a non-electronic screen.

7. A barcode scanning device, characterized in that, The device includes a barcode scanning light and a barcode recognition module, the barcode recognition module being used to perform: S1. In response to detecting a change in the scene, acquire a shaking image in the scene, the shaking image including an information code to be identified; S2. When the area of ​​the light spot in the shaking image accounts for more than a preset percentage in the total area of ​​the shaking image, it is determined that an electronic screen code appears in the shaking image, and S3 is executed. The light spot refers to the area in the shaking image whose brightness is higher than a preset brightness threshold. S3. Without turning on the scanning light, perform electronic screen code recognition on the information code to be identified in the scene. S4. When the area of ​​the light spot accounts for no more than the preset percentage in the total area of ​​the shaking image, it is determined that a non-electronic screen code appears in the shaking image, and step S5 is executed. S5. With the scanning light turned on, perform non-electronic screen code recognition on the information code to be identified in the scene.

8. The barcode scanning device according to claim 7, characterized in that, The code recognition module is used for: After controlling the scanning light to flash for a preset time, the scanning light is turned off, and the electronic screen code recognition is performed on the information code to be identified in the scene.

9. The barcode scanning device according to claim 7, characterized in that, The code recognition module is also used for: If the screen code recognition is successful in step S3, a scanning prompt voice message corresponding to the electronic screen code will be issued to end the electronic screen code recognition process. If the non-screen code recognition is successful in step S5, the scanning light is turned off, a scanning prompt voice corresponding to the non-electronic screen code is emitted, and the non-electronic screen code recognition process ends.

10. A computer-readable storage medium, characterized in that, The storage medium stores at least one program segment, which is executed by a processor to implement the barcode scanning method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Two-dimension code and forming method and system thereof

    CN103854045A

  • Multifunctional interaction way of mobile terminal under off state

    CN107422961A