WO2018035677A1 - Method and device for scanning two-dimensional barcode - Google Patents
Method and device for scanning two-dimensional barcode Download PDFInfo
- Publication number
- WO2018035677A1 WO2018035677A1 PCT/CN2016/096240 CN2016096240W WO2018035677A1 WO 2018035677 A1 WO2018035677 A1 WO 2018035677A1 CN 2016096240 W CN2016096240 W CN 2016096240W WO 2018035677 A1 WO2018035677 A1 WO 2018035677A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- dimensional code
- scanning
- target
- flash
- illuminance value
- 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.)
- Ceased
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K7/00—Methods or arrangements for sensing record carriers, e.g. for reading patterns
- G06K7/10—Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
Definitions
- Invention name A method and device for scanning a two-dimensional code
- the present invention relates to the field of communications, and in particular, to a method and an apparatus for scanning a two-dimensional code.
- a 2D barcode is also called a 2D barcode, and is a specific geometric pattern of black and white, which is distributed in a plane (two-dimensional direction) according to a certain rule, for recording data symbol information.
- a user may scan a two-dimensional code through a terminal such as a mobile phone to obtain a payment account for payment, and the user obtains an electronic certificate by scanning a two-dimensional code.
- the present invention provides a method and apparatus for scanning a two-dimensional code, which can successfully scan a two-dimensional code in a dimly lit environment, thereby improving the efficiency of scanning a two-dimensional code in a dimly lit environment.
- the first aspect of the present invention provides a method for scanning a two-dimensional code, and the scanning the two-dimensional code includes the following steps:
- the flash is turned on and the target two-dimensional code to be identified is scanned.
- a second aspect of the present invention provides an apparatus for scanning a two-dimensional code, where the apparatus for scanning a two-dimensional code includes: [0012] a collecting module, configured to: when detecting a triggering operation of scanning a two-dimensional code, The illuminance value of the ambient light is collected; [0013] a determining module, configured to determine whether the illuminance value is less than a preset illuminance threshold; [0014] The control module is configured to: when the illuminance value is less than the preset illuminance threshold, turn on the flash and scan the target two-dimensional code to be identified.
- a third aspect of the present invention provides an apparatus for scanning a two-dimensional code, the apparatus for scanning a two-dimensional code comprising a processor, a memory, and a bus:
- the memory is configured to store a program
- the processor, the program for calling the memory storage performs the following operations:
- the processor is configured to: when detecting a trigger operation of scanning the two-dimensional code, collecting the illuminance value of the ambient light
- the illuminance value of the ambient light is collected; determining whether the illuminance value is less than a preset illuminance threshold; and when the illuminance value is less than the preset illuminance Threshold, turn on the flash and scan the target QR code; automatically turn on the flash according to the ambient light illuminance value, successfully scan the QR code in low light environment, and improve the scanning QR code in low light environment s efficiency.
- FIG. 1 is a flow chart of an embodiment of a method for scanning a two-dimensional code according to the present invention
- FIG. 2 is a flow chart of another embodiment of a method for scanning a two-dimensional code of the present invention.
- FIG. 3 is a schematic structural diagram of an apparatus for scanning a two-dimensional code according to an embodiment of the present invention.
- FIG. 4 is a schematic structural view of another embodiment of a device for scanning a two-dimensional code according to the present invention.
- FIG. 5 is a schematic structural view of still another embodiment of a device for scanning a two-dimensional code according to the present invention.
- FIG. 1 is a flow chart of an embodiment of a method for scanning a two-dimensional code according to the present invention.
- the present embodiment is described from the perspective of a terminal, and the execution subject may be a terminal having a function of scanning a two-dimensional code, and the terminal may be a terminal such as a mobile phone or a tablet computer, but is not limited thereto.
- the method for scanning a two-dimensional code as shown in FIG. 1 specifically includes the following steps:
- the function of scanning the two-dimensional code is started through the interactive interface, so that the two-dimensional code scanning area corresponding to the terminal is aligned with the display area of the two-dimensional code to be identified.
- the terminal collects the illuminance value of the ambient light in the current environment through the environmental sensor built in the terminal.
- the current environment is the environment in which the terminal is currently located.
- the environmental sensor can be a light sensor or other sensor capable of collecting ambient light, and is not limited herein.
- the environmental sensor can obtain the illuminance value of the light by directly measuring the ambient light, and the unit of the illuminance value passes through the lux.
- the terminal system development kit provides two callback interfaces for use by the developer to pass the sensor's accuracy information and sensor-sensed data. Since the terminal may have a variety of sensors built in, the accuracy of each sensor is different, so when the accuracy changes, the interface of the sensor's accuracy change is called.
- the data sensed by the sensor includes: the accuracy of the data, the data monitored by the sensor, and the timestamp generated by the data.
- S102 Determine whether the illuminance value is less than a preset illuminance threshold.
- the terminal When acquiring the illuminance value of the current ambient light, the terminal compares the obtained illuminance value with the preset illuminance threshold, and determines whether the obtained illuminance value is less than a preset illuminance threshold.
- the preset illuminance threshold may be 0.3 ⁇ llux, but is not limited thereto, and the preset illuminance threshold may be other values, which may be set according to actual conditions, and is not limited herein.
- the terminal determines that the acquired illuminance value is less than the preset illuminance threshold ⁇ , and recognizes that the current ambient light is dark or insufficient light, and needs to turn on the flash to scan the two-dimensional code, and step S103 is performed; the terminal determines the obtained illuminance value. If the preset illuminance threshold is greater than or equal to ⁇ , no processing is performed, and the two-dimensional code to be identified is directly scanned. [0036] S103: When the illuminance value is less than the preset illuminance threshold, turn on the flash and scan the target two-dimensional code to be recognized.
- the terminal After determining that the acquired illuminance value is less than the preset illuminance threshold ⁇ , the terminal turns on the flash to illuminate by the flash, and increases the illuminance value of the current environment, so that the target two-dimensional code to be identified is in a sufficient light environment. .
- the terminal scans the two-dimensional code of the target to be identified in the scanning range, and the terminal acquires the two-dimensional code of the target to be identified within the scanning range.
- the terminal when detecting the triggering operation of scanning the two-dimensional code, collects the illuminance value of the ambient light; determines whether the illuminance value is less than a preset illuminance threshold; and when the illuminance value is less than the preset illuminance Threshold, turn on the flash and scan the target QR code, which can automatically turn on the flash according to the ambient light illuminance value, saving the time for manually turning on the lighting device, and successfully scanning the QR code in the dark environment to improve the light.
- the efficiency of scanning the two-dimensional code in a darker situation since the target two-dimensional code is in a well-lit environment after the flash is turned on, the situation of repeatedly scanning the two-dimensional code can be avoided, and the success rate of scanning the two-dimensional code can be improved.
- FIG. 2 is a flow chart of another embodiment of a method for scanning a two-dimensional code according to the present invention.
- the present embodiment is described from the perspective of the terminal.
- the execution subject may be a terminal having a function of scanning a two-dimensional code, and the terminal may be a terminal such as a mobile phone or a tablet computer, but is not limited thereto.
- the method for scanning a two-dimensional code as shown in FIG. 2 specifically includes the following steps:
- S201 Set an operation authority for controlling the flash.
- the terminal can be configured in the configuration file to set the operation permission of the control flash through the IHardwareService class or the camera Camera class.
- the IHardwareService class has a method of turning on the flash, and the developer can control the flash by simply inputting a parameter that is turned on or off in the method.
- the operation permission of the flash is controlled by the IHardwareService class setting, and need to be added in the configuration file; mandroid.permission.HARDWARE_TEST permission.
- the terminal user installs the application with the scanned QR code, if the permission to turn on the flash is not allowed, the terminal will enable the scanning QR code function, and when the control is turned on, the terminal will ask the user whether to allow access to the flash through the prompt box.
- the flash can only be turned on if the user allows it.
- the Camera class comes with a rich interface and Parameters, which are mainly used for camera functions and are easy to expand.
- the operation of the flash is controlled by the Camera class in the terminal of the Android operating system, you need to add the android.permission.CAMERA permission to the configuration file.
- S202 When the triggering operation of scanning the two-dimensional code is detected, the illuminance value of the ambient light is collected.
- the function of scanning the two-dimensional code is started through the interactive interface, so that the two-dimensional code scanning area corresponding to the terminal is aligned with the display area of the two-dimensional code to be identified.
- the terminal when detecting, by the terminal, an instruction to enable the user to scan the two-dimensional code function, or monitoring an operation of scanning the two-dimensional code through the two-dimensional code scanning area, the terminal collects the illuminance value of the ambient light in the current environment through the environmental sensor built in the terminal.
- the current environment is the environment in which the terminal is currently located.
- the environmental sensor can be a light sensor or other sensor capable of collecting ambient light, and is not limited herein.
- the environmental sensor can obtain the illuminance value of the light by directly measuring the ambient light, and the unit of the illuminance value passes through the lux.
- the terminal system development kit provides two callback interfaces for use by the developer to pass the sensor's accuracy information and sensor-sensed data. Since the terminal may have a variety of sensors built in, the accuracy of each sensor is different, so when the accuracy changes, the interface of the sensor's accuracy change is called.
- the data sensed by the sensor includes: the accuracy of the data, the data monitored by the sensor, and the timestamp generated by the data.
- S203 Determine whether the illuminance value is less than a preset illuminance threshold.
- the terminal After acquiring the illuminance value of the current ambient light, the terminal compares the obtained illuminance value with the preset illuminance threshold, and determines whether the acquired illuminance value is less than a preset illuminance threshold.
- the preset illuminance threshold may be 0.3 ⁇ llu X , but is not limited thereto, and the preset illuminance threshold may be other values, which may be set according to actual conditions, and is not limited herein.
- the terminal determines that the acquired illuminance value is less than the preset illuminance threshold ⁇ , and recognizes that the current ambient light is dark or insufficient light, and needs to turn on the flash to assist in scanning the two-dimensional code, and step S103 is performed; the terminal determines the obtained illuminance value. When it is greater than or equal to the preset illuminance threshold, no processing is performed, and the two-dimensional code to be identified is directly scanned.
- S204 When the illuminance value is less than the preset illuminance threshold, turn on the flash and scan the target two-dimensional code to be recognized.
- the terminal After determining that the acquired illuminance value is less than the preset illuminance threshold ⁇ , the terminal activates the flash to illuminate by the flash, and increases the illuminance value of the current environment, so that the target two-dimensional code to be identified is in the light.
- the line is in a sufficient environment.
- the terminal scans the target two-dimensional code to be identified in the scanning range, and the terminal acquires the target two-dimensional code to be identified within the scanning range.
- S205 Parse the target two-dimensional code, and acquire information corresponding to the target two-dimensional code.
- the terminal uses the two-dimensional code decoding technology to parse the acquired target two-dimensional code to obtain information corresponding to the target two-dimensional code.
- the terminal When acquiring the information corresponding to the target two-dimensional code, the terminal turns off the flash to successfully acquire the information corresponding to the target two-dimensional code.
- the terminal when the terminal detects the triggering operation of scanning the two-dimensional code, the terminal collects the illuminance value of the ambient light; determines whether the illuminance value is less than the preset illuminance threshold; and when the illuminance value is less than the preset illuminance threshold
- the flash is turned on and the target QR code to be recognized is scanned, and the flash can be automatically turned on according to the ambient light illuminance value, saving the time for manually turning on the lighting device, and successfully scanning the two-dimensional code in a dim light environment to improve the light.
- the efficiency of scanning the two-dimensional code in a darker situation since the target two-dimensional code is in a well-lit environment after the flash is turned on, the situation of repeatedly scanning the two-dimensional code can be avoided, and the success rate of scanning the two-dimensional code can be improved.
- the terminal After acquiring the information corresponding to the target two-dimensional code, the terminal turns off the flash, and can ensure that the information corresponding to the target two-dimensional code is successfully obtained.
- the terminal can automatically turn on and off the flash, saving the user the time to control the lighting equipment, simplifying the operation of scanning the QR code in low light environment, and the human-computer interaction is more intelligent.
- FIG. 3 is a schematic structural diagram of an embodiment of an apparatus for scanning a two-dimensional code according to the present invention.
- the device for scanning the two-dimensional code may be a mobile terminal such as a mobile phone or a tablet computer, but is not limited thereto, and may be other terminals, which is not limited herein.
- the modules included in the terminal 300 of this embodiment are used to perform the steps in the embodiment corresponding to FIG. 1. For details, please refer to the related description in the embodiment corresponding to FIG. 1 and FIG. 1 , and details are not described herein.
- the device for scanning a two-dimensional code of the embodiment includes: an acquisition module 310, a determination unit 320, and a scanning module 3 30.
- the acquisition module 310 is configured to collect the illuminance value of the ambient light when the trigger operation of scanning the two-dimensional code is detected. For example, the acquisition module 310 collects the illuminance value of the ambient light when detecting the trigger operation of scanning the two-dimensional code. The acquisition module 310 transmits the illuminance value to the determination module 320.
- the determining module 320 is configured to receive the illuminance value sent by the collection module 310, and determine whether the illuminance value is less than a preset illuminance threshold. For example, the determining module 320 receives the illuminance value sent by the collection module 310, and determines whether the illuminance value is less than a preset illuminance threshold. The determining module 320 sends the determination result to the scanning module 330
- the scanning module 330 is configured to receive the determination result sent by the determining module 320.
- the determination result is that the illuminance value is less than the preset illuminance threshold, the flash is turned on and the target two-dimensional code to be identified is scanned.
- the scanning module 330 receives the determination result sent by the determining module 320.
- the determination result is that the illuminance value is less than the preset illuminance threshold
- the flash is turned on and the target two-dimensional code to be recognized is scanned.
- the terminal when detecting the triggering operation of scanning the two-dimensional code, collects the illuminance value of the ambient light; determines whether the illuminance value is less than a preset illuminance threshold; and when the illuminance value is less than the preset illuminance threshold
- the flash is turned on and the target QR code to be recognized is scanned, and the flash can be automatically turned on according to the ambient light illuminance value, saving the time for manually turning on the lighting device, thereby successfully scanning the two-dimensional code in a dimly lit environment, and improving the light in the light.
- the efficiency of scanning the two-dimensional code in a dark situation since the target two-dimensional code is in a well-lit environment after the flash is turned on, the situation of repeatedly scanning the two-dimensional code can be avoided, and the success rate of scanning the two-dimensional code can be improved.
- FIG. 4 is a schematic structural diagram of another embodiment of a device for scanning a two-dimensional code according to the present invention.
- the device for scanning the two-dimensional code may be a mobile terminal such as a mobile phone or a tablet computer, but is not limited thereto, and may be other terminals, which is not limited herein.
- the modules included in the terminal 400 of this embodiment are used to perform the steps in the embodiment corresponding to FIG. 2. For details, please refer to the related description in the embodiment corresponding to FIG. 2 and FIG. 2, which are not described herein.
- the apparatus for scanning a two-dimensional code of the embodiment includes: a setting module 410, an acquisition module 420, a determination unit 430, a scanning module 440, a parsing module 450, and a flash off module 460.
- the setting module 410 is configured to set an operation authority for controlling the flash. For example, the setting module 410 sets the operating authority for controlling the flash.
- the acquisition module 420 is configured to collect the illuminance value of the ambient light when the triggering operation of scanning the two-dimensional code is detected. For example, the clustering module 420 collects the illuminance value of the ambient light when detecting the triggering operation of scanning the two-dimensional code. The acquisition module 420 sends the illuminance value to the decision module 430.
- the determining module 430 is configured to receive the illuminance value sent by the collecting module 420, and determine whether the illuminance value is less than a preset illuminance threshold. For example, the determining module 430 receives the illuminance value sent by the collecting module 420, and determines the light. Whether the illuminance value is less than the preset illuminance threshold. The determining module 430 sends the determination result to the scanning module 440
- the scanning module 440 is configured to receive the determination result sent by the determining module 430.
- the determination result is that the illuminance value is less than the preset illuminance threshold, the flash is turned on and the target two-dimensional code to be identified is scanned.
- the scanning module 440 receives the determination result sent by the determining module 430.
- the determination result is that the illuminance value is less than the preset illuminance threshold
- the flash is activated and the target two-dimensional code to be identified is scanned.
- the scanning module 440 transmits the scanned target two-dimensional code to the parsing module 450.
- the parsing module 450 is configured to receive the target two-dimensional code sent by the scanning module 440, parse the target two-dimensional code, and obtain information corresponding to the target two-dimensional code. For example, the parsing module 450 receives the target two-dimensional code sent by the scanning module 440, parses the target two-dimensional code, and obtains information corresponding to the target two-dimensional code. The parsing module 450 transmits the notification information to the flash close module 460 after acquiring the information corresponding to the target two-dimensional code.
- the flash-off module 460 is configured to receive the notification information sent by the parsing module 450 when the information corresponding to the target two-dimensional code is acquired, and turn off the flash.
- the flash close module 460 receives the information corresponding to the target two-dimensional code, the notification information sent by the parsing module 450, and turns off the flash.
- the terminal when detecting the triggering operation of scanning the two-dimensional code, collects the illuminance value of the ambient light; determines whether the illuminance value is less than a preset illuminance threshold; and when the illuminance value is less than the preset illuminance Threshold, turn on the flash and scan the target QR code, which can automatically turn on the flash according to the ambient light illuminance value, saving the time for manually turning on the lighting device, and successfully scanning the QR code in the dark environment to improve the light.
- the efficiency of scanning the two-dimensional code in a darker situation since the target two-dimensional code is in a well-lit environment after the flash is turned on, the situation of repeatedly scanning the two-dimensional code can be avoided, and the success rate of scanning the two-dimensional code can be improved.
- the terminal After acquiring the information corresponding to the target two-dimensional code, the terminal turns off the flash, and can ensure that the information corresponding to the target two-dimensional code is successfully obtained.
- the terminal can automatically turn on and off the flash, saving the user time to control the lighting device, simplifying the operation of scanning the QR code in low light environment, and making human-computer interaction more intelligent.
- FIG. 5 is a schematic structural diagram of still another embodiment of a device for scanning a two-dimensional code according to the present invention.
- the apparatus 500 for scanning a two-dimensional code may be a terminal having a function of scanning a two-dimensional code, and the specific embodiment of the present invention does not limit the specific implementation of the apparatus for scanning a two-dimensional code.
- the apparatus 500 for scanning a two-dimensional code includes: [0080] a processor 510, a communication interface 520, a memory
- the processor 510, the communication interface 520, and the memory 530 complete communication with each other through the bus 540.
- the communication interface 520 is configured to communicate with an external device, such as a personal computer, a server, or the like.
- the processor 510 may be a central processing unit CPU, or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention.
- CPU central processing unit
- ASIC application specific integrated circuit
- the memory 530 is configured to store the program 532.
- Memory 530 may include high speed RAM memory and may also include non-volatile memory, such as at least one disk memory.
- Program 532 can include program code, the program code including computer operating instructions.
- the processor 510 is configured to perform the following operations according to the program 532 stored in the memory 530:
- the processor 510 is configured to: when detecting a triggering operation of scanning the two-dimensional code, collecting an illuminance value of the ambient light; and determining whether the illuminance value is less than a preset illuminance threshold; The illuminance value is less than the preset illuminance threshold, the flash is turned on and the target two-dimensional code to be recognized is scanned.
- the processor 510 is further configured to parse the target two-dimensional code to obtain the f-content corresponding to the target two-dimensional code.
- the processor 510 is further configured to: when the information corresponding to the target two-dimensional code is acquired, the flash is turned off.
- the processor 510 is further configured to set an operation authority for controlling the flash.
- the disclosed system, apparatus, and method may be implemented in other manners.
- the device embodiments described above are merely illustrative.
- the division of the unit is only a logical function division.
- there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not executed.
- the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some communication interface, device or unit, It can be electrical, mechanical or other form.
- the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple networks. On the unit. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
- each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
- the functions, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium.
- the technical solution of the present invention which is essential or contributes to the prior art, or a part of the technical solution, may be embodied in the form of a software product, which is stored in a storage medium, including
- the instructions are used to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
- the foregoing storage medium includes: a USB flash drive, a removable hard disk, a read only memory (ROM, Read-Only)
- RAM random access memory
- disk disk or optical disk, and other media that can store program code.
Landscapes
- Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Health & Medical Sciences (AREA)
- Electromagnetism (AREA)
- General Health & Medical Sciences (AREA)
- Toxicology (AREA)
- Artificial Intelligence (AREA)
- Computer Vision & Pattern Recognition (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Telephone Function (AREA)
Abstract
Description
发明名称:一种扫描二维码的方法及装置 技术领域 Invention name: A method and device for scanning a two-dimensional code
[0001] 本发明涉及通讯领域, 尤其涉及一种扫描二维码的方法及装置。 [0001] The present invention relates to the field of communications, and in particular, to a method and an apparatus for scanning a two-dimensional code.
背景技术 Background technique
[0002] 二维码 (2D barcode)也叫二维条码, 为按一定规律在平面 (二维方向上) 分布 的黑白相间的特定的几何图形, 用于记录数据符号信息。 [0002] A 2D barcode is also called a 2D barcode, and is a specific geometric pattern of black and white, which is distributed in a plane (two-dimensional direction) according to a certain rule, for recording data symbol information.
[0003] 随着科技的发展, 越来越多的信息以二维码的形式体现, 用户只需使用二维码 识别设备扫描二维码即可获取与二维码对应的信息。 [0003] With the development of technology, more and more information is embodied in the form of a two-dimensional code, and the user only needs to use the two-dimensional code recognition device to scan the two-dimensional code to obtain the information corresponding to the two-dimensional code.
[0004] 例如, 用户可通过手机等终端扫描二维码获取支付账户以进行付款、 用户通过 扫描二维码获取电子凭证等。 [0004] For example, a user may scan a two-dimensional code through a terminal such as a mobile phone to obtain a payment account for payment, and the user obtains an electronic certificate by scanning a two-dimensional code.
[0005] 然而, 手机当处于光线较暗的环境时, 无法成功扫描二维码, 从而无法获得二 维码包含的信息。 [0005] However, when the mobile phone is in a dimly lit environment, the two-dimensional code cannot be successfully scanned, so that the information contained in the two-dimensional code cannot be obtained.
技术问题 technical problem
[0006] 本发明提供一种扫描二维码的方法及装置, 能够在光线较暗的环境下成功扫描 二维码, 提高在光线较暗的环境下扫描二维码的效率。 The present invention provides a method and apparatus for scanning a two-dimensional code, which can successfully scan a two-dimensional code in a dimly lit environment, thereby improving the efficiency of scanning a two-dimensional code in a dimly lit environment.
问题的解决方案 Problem solution
技术解决方案 Technical solution
[0007] 本发明第一方面提供了一种扫描二维码的方法, 所述扫描二维码的包括如下步 骤: The first aspect of the present invention provides a method for scanning a two-dimensional code, and the scanning the two-dimensional code includes the following steps:
[0008] 当检测到扫描二维码的触发操作吋, 釆集环境光的光照度值; [0008] when the triggering operation of scanning the two-dimensional code is detected, the illuminance value of the ambient light is collected;
[0009] 判断所述光照度值是否小于预设光照度阈值; [0009] determining whether the illuminance value is less than a preset illuminance threshold;
[0010] 当所述光照度值小于所述预设光照度阈值, 开启闪光灯并扫描待识别的目标二 维码。 [0010] when the illuminance value is less than the preset illuminance threshold, the flash is turned on and the target two-dimensional code to be identified is scanned.
[0011] 本发明第二方面提供了一种扫描二维码的装置, 所述扫描二维码的装置包括: [0012] 釆集模块, 用于当检测到扫描二维码的触发操作时, 釆集环境光的光照度值; [0013] 判断模块, 用于判断所述光照度值是否小于预设光照度阈值; [0014] 控制模块, 用于当所述光照度值小于所述预设光照度阈值, 开启闪光灯并扫描 待识别的目标二维码。 [0011] A second aspect of the present invention provides an apparatus for scanning a two-dimensional code, where the apparatus for scanning a two-dimensional code includes: [0012] a collecting module, configured to: when detecting a triggering operation of scanning a two-dimensional code, The illuminance value of the ambient light is collected; [0013] a determining module, configured to determine whether the illuminance value is less than a preset illuminance threshold; [0014] The control module is configured to: when the illuminance value is less than the preset illuminance threshold, turn on the flash and scan the target two-dimensional code to be identified.
[0015] 本发明第三方面提供了一种扫描二维码功能的装置, 所述扫描二维码的装置包 括处理器、 存储器和总线: [0015] A third aspect of the present invention provides an apparatus for scanning a two-dimensional code, the apparatus for scanning a two-dimensional code comprising a processor, a memory, and a bus:
[0016] 其中, 所述处理器、 所述存储器通过所述总线完成相互间的通信; [0016] wherein the processor and the memory complete communication with each other through the bus;
[0017] 所述存储器, 用于存放程序; [0017] the memory is configured to store a program;
[0018] 所述处理器, 用于调用所述存储器存储的所述程序执行以下操作: [0018] the processor, the program for calling the memory storage performs the following operations:
[0019] 所述处理器用于, 当检测到扫描二维码的触发操作吋, 采集环境光的光照度值 [0019] the processor is configured to: when detecting a trigger operation of scanning the two-dimensional code, collecting the illuminance value of the ambient light
; 以及用于判断所述光照度值是否小于预设光照度阈值; 还用于当所述光照度 值小于所述预设光照度阈值, 开启闪光灯并扫描待识别的目标二维码。 And determining whether the illuminance value is less than a preset illuminance threshold; and when the illuminance value is less than the preset illuminance threshold, turning on the flash and scanning the target two-dimensional code to be recognized.
发明的有益效果 Advantageous effects of the invention
有益效果 Beneficial effect
[0020] 本发明实施例通过当检测到扫描二维码的触发操作吋, 采集环境光的光照度值 ; 判断所述光照度值是否小于预设光照度阈值; 当所述光照度值小于所述预设 光照度阈值, 开启闪光灯并扫描待识别的目标二维码; 能够根据环境光的光照 度值自动开启闪光灯, 在光线较暗的环境下成功扫描二维码, 提高在光线较暗 的环境下扫描二维码的效率。 [0020] In the embodiment of the present invention, when the triggering operation of scanning the two-dimensional code is detected, the illuminance value of the ambient light is collected; determining whether the illuminance value is less than a preset illuminance threshold; and when the illuminance value is less than the preset illuminance Threshold, turn on the flash and scan the target QR code; automatically turn on the flash according to the ambient light illuminance value, successfully scan the QR code in low light environment, and improve the scanning QR code in low light environment s efficiency.
对附图的简要说明 Brief description of the drawing
附图说明 DRAWINGS
[0021] 图 1是本发明扫描二维码的方法一实施例的流程图; 1 is a flow chart of an embodiment of a method for scanning a two-dimensional code according to the present invention;
[0022] 图 2是本发明扫描二维码的方法另一实施例的流程图; 2 is a flow chart of another embodiment of a method for scanning a two-dimensional code of the present invention;
[0023] 图 3是本发明扫描二维码的装置一实施例的结构示意图; 3 is a schematic structural diagram of an apparatus for scanning a two-dimensional code according to an embodiment of the present invention;
[0024] 图 4是本发明扫描二维码的装置另一实施例的结构示意图; 4 is a schematic structural view of another embodiment of a device for scanning a two-dimensional code according to the present invention;
[0025] 图 5是本发明扫描二维码的装置再一实施例的结构示意图。 5 is a schematic structural view of still another embodiment of a device for scanning a two-dimensional code according to the present invention.
发明实施例 Invention embodiment
本发明的实施方式 Embodiments of the invention
[0026] 为了使本发明的目的、 技术方案及优点更加清楚明白, 以下结合附图及实施例 , 对本发明进行进一步详细说明。 应当理解, 此处所描述的具体实施例仅用以 解释本发明, 并不用于限定本发明。 [0026] In order to make the objects, technical solutions, and advantages of the present invention more clear, the following drawings and embodiments The present invention will be further described in detail. It is understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0027] 参阅图 1, 图 1是本发明扫描二维码的方法一实施方式的流程图。 本实施方式从 终端的角度出发进行描述, 执行主体可以为具有扫描二维码功能的终端, 终端 可以为手机、 平板电脑等终端, 但并不限于此。 如图 1所示的扫描二维码的方法 具体包括如下步骤: [0027] Referring to FIG. 1, FIG. 1 is a flow chart of an embodiment of a method for scanning a two-dimensional code according to the present invention. The present embodiment is described from the perspective of a terminal, and the execution subject may be a terminal having a function of scanning a two-dimensional code, and the terminal may be a terminal such as a mobile phone or a tablet computer, but is not limited thereto. The method for scanning a two-dimensional code as shown in FIG. 1 specifically includes the following steps:
[0028] S101 : 当检测到扫描二维码的触发操作时, 釆集环境光的光照度值。 [0028] S101: When the triggering operation of scanning the two-dimensional code is detected, the illuminance value of the ambient light is collected.
[0029] 当终端用户需要扫描二维码时, 通过交互界面开启扫描二维码的功能, 以将终 端对应的二维码扫描区域对准待识别的二维码的显示区域。 [0029] When the terminal user needs to scan the two-dimensional code, the function of scanning the two-dimensional code is started through the interactive interface, so that the two-dimensional code scanning area corresponding to the terminal is aligned with the display area of the two-dimensional code to be identified.
[0030] 终端在检测到用户开启扫描二维码功能的指令, 或监测到试图通过二维码扫描 区域扫描二维码的操作时, 通过终端内置的环境传感器采集当前环境中环境光 的光照度值。 当前环境为终端当前所处的环境。 环境传感器可以为光线传感器 , 也可以为其他能够釆集环境光线的传感器, 此处不做限制。 [0030] When detecting, by the terminal, an instruction to enable the function of scanning the two-dimensional code, or monitoring an operation of scanning the two-dimensional code through the scanning area of the two-dimensional code, the terminal collects the illuminance value of the ambient light in the current environment through the environmental sensor built in the terminal. . The current environment is the environment in which the terminal is currently located. The environmental sensor can be a light sensor or other sensor capable of collecting ambient light, and is not limited herein.
[0031] 环境传感器可以通过直接测量环境光线来得到光线的光照度值, 光照度值的单 位通过勒克斯 (lux)。 在实际应用中, 终端系统开发包会提供两个回调接口供开 发者使用, 分别传递传感器的精度信息及传感器感应的数据。 由于终端可能内 置有多种传感器, 每种传感器的精度不同, 因此当精度变化时, 就会调用传感 器精度变化的接口。 传感器感应的数据包括: 数据的精度、 传感器监测到的数 据、 数据产生的时间戳。 [0031] The environmental sensor can obtain the illuminance value of the light by directly measuring the ambient light, and the unit of the illuminance value passes through the lux. In practical applications, the terminal system development kit provides two callback interfaces for use by the developer to pass the sensor's accuracy information and sensor-sensed data. Since the terminal may have a variety of sensors built in, the accuracy of each sensor is different, so when the accuracy changes, the interface of the sensor's accuracy change is called. The data sensed by the sensor includes: the accuracy of the data, the data monitored by the sensor, and the timestamp generated by the data.
[0032] S102: 判断所述光照度值是否小于预设光照度阈值。 [0032] S102: Determine whether the illuminance value is less than a preset illuminance threshold.
[0033] 终端在获取到当前环境光的光照度值时, 比较获取到的光照度值与预设光照度 阈值, 并判断获取到的光照度值是否小于预设光照度阈值。 [0033] When acquiring the illuminance value of the current ambient light, the terminal compares the obtained illuminance value with the preset illuminance threshold, and determines whether the obtained illuminance value is less than a preset illuminance threshold.
[0034] 其中, 预设光照度阈值可以为 0.3~llux, 但并不限于此, 预设光照度阈值还可 以为其他值, 具体可根据实际情况进行设置, 此处不做限制。 [0034] The preset illuminance threshold may be 0.3~llux, but is not limited thereto, and the preset illuminance threshold may be other values, which may be set according to actual conditions, and is not limited herein.
[0035] 终端在确定获取到的光照度值小于预设光照度阈值吋, 识别为当前环境光线较 暗或光线不足, 需要开启闪光灯辅助扫描二维码, 执行步骤 S103 ; 终端在确定 获取到的光照度值大于或等于预设光照度阈值吋, 不做任何处理, 直接扫描待 识别的二维码。 [0036] S103: 当所述光照度值小于所述预设光照度阈值, 开启闪光灯并扫描待识别的 目标二维码。 [0035] The terminal determines that the acquired illuminance value is less than the preset illuminance threshold 吋, and recognizes that the current ambient light is dark or insufficient light, and needs to turn on the flash to scan the two-dimensional code, and step S103 is performed; the terminal determines the obtained illuminance value. If the preset illuminance threshold is greater than or equal to 预设, no processing is performed, and the two-dimensional code to be identified is directly scanned. [0036] S103: When the illuminance value is less than the preset illuminance threshold, turn on the flash and scan the target two-dimensional code to be recognized.
[0037] 终端在确定获取到的光照度值小于预设光照度阈值吋, 开启闪光灯, 以通过闪 光灯进行照明, 增大当前环境的光照度值, 以使得待识别的目标二维码处于光 线足够的环境下。 终端在开启闪光灯的情况下, 扫描位于扫描范围内待识别的 目标二维码, 终端获取扫描范围内的待识别的目标二维码。 [0037] After determining that the acquired illuminance value is less than the preset illuminance threshold 吋, the terminal turns on the flash to illuminate by the flash, and increases the illuminance value of the current environment, so that the target two-dimensional code to be identified is in a sufficient light environment. . When the flash is turned on, the terminal scans the two-dimensional code of the target to be identified in the scanning range, and the terminal acquires the two-dimensional code of the target to be identified within the scanning range.
[0038] 上述方案, 终端当检测到扫描二维码的触发操作时, 釆集环境光的光照度值; 判断所述光照度值是否小于预设光照度阈值; 当所述光照度值小于所述预设光 照度阈值, 开启闪光灯并扫描待识别的目标二维码, 能够根据环境光的光照度 值自动开启闪光灯, 节省手动开启照明设备的时间, 实现在光线较暗的环境下 成功扫描二维码, 提高在光线较暗的情况下扫描二维码的效率, 由于开启闪光 灯后, 目标二维码处于光线充足的环境下, 能够避免重复扫描二维码的情况, 提高扫描二维码的成功率。 [0038] In the above solution, when detecting the triggering operation of scanning the two-dimensional code, the terminal collects the illuminance value of the ambient light; determines whether the illuminance value is less than a preset illuminance threshold; and when the illuminance value is less than the preset illuminance Threshold, turn on the flash and scan the target QR code, which can automatically turn on the flash according to the ambient light illuminance value, saving the time for manually turning on the lighting device, and successfully scanning the QR code in the dark environment to improve the light. The efficiency of scanning the two-dimensional code in a darker situation, since the target two-dimensional code is in a well-lit environment after the flash is turned on, the situation of repeatedly scanning the two-dimensional code can be avoided, and the success rate of scanning the two-dimensional code can be improved.
[0039] 参阅图 2, 图 2是本发明扫描二维码的方法另一实施方式的流程图。 本实施方式 从终端的角度出发进行描述, 执行主体可以为具有扫描二维码功能的终端, 终 端可以为手机、 平板电脑等终端, 但并不限于此。 如图 2所示的扫描二维码的方 法具体包括如下步骤: Referring to FIG. 2, FIG. 2 is a flow chart of another embodiment of a method for scanning a two-dimensional code according to the present invention. The present embodiment is described from the perspective of the terminal. The execution subject may be a terminal having a function of scanning a two-dimensional code, and the terminal may be a terminal such as a mobile phone or a tablet computer, but is not limited thereto. The method for scanning a two-dimensional code as shown in FIG. 2 specifically includes the following steps:
[0040] S201 : 设置控制闪光灯的操作权限。 [0040] S201: Set an operation authority for controlling the flash.
[0041] 终端可以在配置文件中配置通过 IHardwareService类或照相机 Camera类, 设置 控制闪光灯的操作权限。 [0041] The terminal can be configured in the configuration file to set the operation permission of the control flash through the IHardwareService class or the camera Camera class.
[0042] 其中, IHardwareService类自带开启闪光灯的方法, 开发者只需在方法中传入 幵启或关闭的参数便能控制闪光灯的幵关。 [0042] Among them, the IHardwareService class has a method of turning on the flash, and the developer can control the flash by simply inputting a parameter that is turned on or off in the method.
[0043] 在安卓操作系统的终端中通过 IHardwareService类设置控制闪光灯的操作权限 吋, 需要在配置文件中添;! mandroid.permission.HARDWARE_TEST权限。 终端用 户在安装具有扫描二维码的应用程序吋, 如果未允许开启闪光灯的权限, 则终 端在启用扫描二维码功能, 且控制开启闪光灯时, 终端会通过提示框询问用户 是否允许访问闪光灯, 只有用户允许的情况下才可幵启闪光灯。 [0043] In the terminal of the Android operating system, the operation permission of the flash is controlled by the IHardwareService class setting, and need to be added in the configuration file; mandroid.permission.HARDWARE_TEST permission. After the terminal user installs the application with the scanned QR code, if the permission to turn on the flash is not allowed, the terminal will enable the scanning QR code function, and when the control is turned on, the terminal will ask the user whether to allow access to the flash through the prompt box. The flash can only be turned on if the user allows it.
[0044] Camera类自带丰富的接口与 Parameters , 主要应用于拍照功能, 易于扩展。 在 安卓操作系统的终端中通过 Camera类设置控制闪光灯的操作权限时, 需要在配 置文件中添力口 android.permission.CAMERA权限。 [0044] The Camera class comes with a rich interface and Parameters, which are mainly used for camera functions and are easy to expand. In When the operation of the flash is controlled by the Camera class in the terminal of the Android operating system, you need to add the android.permission.CAMERA permission to the configuration file.
[0045] S202: 当检测到扫描二维码的触发操作时, 釆集环境光的光照度值。 [0045] S202: When the triggering operation of scanning the two-dimensional code is detected, the illuminance value of the ambient light is collected.
[0046] 当终端用户需要扫描二维码吋, 通过交互界面开启扫描二维码的功能, 以将终 端对应的二维码扫描区域对准待识别的二维码的显示区域。 [0046] When the terminal user needs to scan the two-dimensional code, the function of scanning the two-dimensional code is started through the interactive interface, so that the two-dimensional code scanning area corresponding to the terminal is aligned with the display area of the two-dimensional code to be identified.
[0047] 终端在检测到用户开启扫描二维码功能的指令, 或监测到试图通过二维码扫描 区域扫描二维码的操作时, 通过终端内置的环境传感器采集当前环境中环境光 的光照度值。 当前环境为终端当前所处的环境。 环境传感器可以为光线传感器 , 也可以为其他能够釆集环境光线的传感器, 此处不做限制。 [0047] when detecting, by the terminal, an instruction to enable the user to scan the two-dimensional code function, or monitoring an operation of scanning the two-dimensional code through the two-dimensional code scanning area, the terminal collects the illuminance value of the ambient light in the current environment through the environmental sensor built in the terminal. . The current environment is the environment in which the terminal is currently located. The environmental sensor can be a light sensor or other sensor capable of collecting ambient light, and is not limited herein.
[0048] 环境传感器可以通过直接测量环境光线来得到光线的光照度值, 光照度值的单 位通过勒克斯 (lux)。 在实际应用中, 终端系统开发包会提供两个回调接口供开 发者使用, 分别传递传感器的精度信息及传感器感应的数据。 由于终端可能内 置有多种传感器, 每种传感器的精度不同, 因此当精度变化时, 就会调用传感 器精度变化的接口。 传感器感应的数据包括: 数据的精度、 传感器监測到的数 据、 数据产生的时间戳。 [0048] The environmental sensor can obtain the illuminance value of the light by directly measuring the ambient light, and the unit of the illuminance value passes through the lux. In practical applications, the terminal system development kit provides two callback interfaces for use by the developer to pass the sensor's accuracy information and sensor-sensed data. Since the terminal may have a variety of sensors built in, the accuracy of each sensor is different, so when the accuracy changes, the interface of the sensor's accuracy change is called. The data sensed by the sensor includes: the accuracy of the data, the data monitored by the sensor, and the timestamp generated by the data.
[0049] S203: 判断所述光照度值是否小于预设光照度阈值。 [0049] S203: Determine whether the illuminance value is less than a preset illuminance threshold.
[0050] 终端在获取到当前环境光的光照度值吋, 比较获取到的光照度值与预设光照度 阈值, 并判断获取到的光照度值是否小于预设光照度阈值。 [0050] After acquiring the illuminance value of the current ambient light, the terminal compares the obtained illuminance value with the preset illuminance threshold, and determines whether the acquired illuminance value is less than a preset illuminance threshold.
[0051] 其中, 预设光照度阈值可以为 0.3~lluX, 但并不限于此, 预设光照度阈值还可 以为其他值, 具体可根据实际情况进行设置, 此处不做限制。 [0051] The preset illuminance threshold may be 0.3~llu X , but is not limited thereto, and the preset illuminance threshold may be other values, which may be set according to actual conditions, and is not limited herein.
[0052] 终端在确定获取到的光照度值小于预设光照度阈值吋, 识别为当前环境光线较 暗或光线不足, 需要开启闪光灯辅助扫描二维码, 执行步骤 S103 ; 终端在确定 获取到的光照度值大于或等于预设光照度阈值时, 不做任何处理, 直接扫描待 识别的二维码。 [0052] The terminal determines that the acquired illuminance value is less than the preset illuminance threshold 吋, and recognizes that the current ambient light is dark or insufficient light, and needs to turn on the flash to assist in scanning the two-dimensional code, and step S103 is performed; the terminal determines the obtained illuminance value. When it is greater than or equal to the preset illuminance threshold, no processing is performed, and the two-dimensional code to be identified is directly scanned.
[0053] S204: 当所述光照度值小于所述预设光照度阈值, 开启闪光灯并扫描待识别的 目标二维码。 [0053] S204: When the illuminance value is less than the preset illuminance threshold, turn on the flash and scan the target two-dimensional code to be recognized.
[0054] 终端在确定获取到的光照度值小于预设光照度阈值吋, 幵启闪光灯, 以通过闪 光灯进行照明, 增大当前环境的光照度值, 以使得待识别的目标二维码处于光 线足够的环境下。 终端在开启闪光灯的情况下, 扫描位于扫描范围内待识别的 目标二维码, 终端获取扫描范围内的待识别的目标二维码。 [0054] After determining that the acquired illuminance value is less than the preset illuminance threshold 吋, the terminal activates the flash to illuminate by the flash, and increases the illuminance value of the current environment, so that the target two-dimensional code to be identified is in the light. The line is in a sufficient environment. When the terminal is turned on, the terminal scans the target two-dimensional code to be identified in the scanning range, and the terminal acquires the target two-dimensional code to be identified within the scanning range.
[0055] S205: 解析所述目标二维码, 获取所述目标二维码对应的信息。 [0055] S205: Parse the target two-dimensional code, and acquire information corresponding to the target two-dimensional code.
[0056] 终端在获取到待识别的目标二维码时, 釆用二维码解码技术解析获取到的目标 二维码以获取目标二维码对应的信息。 [0056] When the terminal acquires the target two-dimensional code to be identified, the terminal uses the two-dimensional code decoding technology to parse the acquired target two-dimensional code to obtain information corresponding to the target two-dimensional code.
[0057] 其中, 二维码解码方法与现有技术相同, 此处不赘述。 [0057] The method for decoding the two-dimensional code is the same as the prior art, and is not described here.
[0058] S206: 当获取到所述目标二维码对应的信息时, 关闭所述闪光灯。 [0058] S206: When the information corresponding to the target two-dimensional code is acquired, the flash is turned off.
[0059] 终端在获取到目标二维码对应的信息时, 关闭闪光灯, 以成功获取目标二维码 对应的信息。 [0059] When acquiring the information corresponding to the target two-dimensional code, the terminal turns off the flash to successfully acquire the information corresponding to the target two-dimensional code.
[0060] 上述方案, 终端当检测到扫描二维码的触发操作吋, 采集环境光的光照度值; 判断所述光照度值是否小于预设光照度阈值; 当所述光照度值小于所述预设光 照度阈值, 开启闪光灯并扫描待识别的目标二维码, 能够根据环境光的光照度 值自动开启闪光灯, 节省手动幵启照明设备的时间, 实现在光线较暗的环境下 成功扫描二维码, 提高在光线较暗的情况下扫描二维码的效率, 由于开启闪光 灯后, 目标二维码处于光线充足的环境下, 能够避免重复扫描二维码的情况, 提高扫描二维码的成功率。 [0060] In the above solution, when the terminal detects the triggering operation of scanning the two-dimensional code, the terminal collects the illuminance value of the ambient light; determines whether the illuminance value is less than the preset illuminance threshold; and when the illuminance value is less than the preset illuminance threshold The flash is turned on and the target QR code to be recognized is scanned, and the flash can be automatically turned on according to the ambient light illuminance value, saving the time for manually turning on the lighting device, and successfully scanning the two-dimensional code in a dim light environment to improve the light. The efficiency of scanning the two-dimensional code in a darker situation, since the target two-dimensional code is in a well-lit environment after the flash is turned on, the situation of repeatedly scanning the two-dimensional code can be avoided, and the success rate of scanning the two-dimensional code can be improved.
[0061] 终端在获取到目标二维码对应的信息吋, 关闭闪光灯, 能够保证成功获取目标 二维码对应的信息。 终端能够自动开启、 关闭闪光灯, 为用户节省操控照明设 备的吋间, 简化在弱光环境下扫描二维码的操作过程, 人机交互更智能化。 [0061] After acquiring the information corresponding to the target two-dimensional code, the terminal turns off the flash, and can ensure that the information corresponding to the target two-dimensional code is successfully obtained. The terminal can automatically turn on and off the flash, saving the user the time to control the lighting equipment, simplifying the operation of scanning the QR code in low light environment, and the human-computer interaction is more intelligent.
[0062] 参见图 3, 图 3是本发明扫描二维码的装置一实施例的结构示意图。 扫描二维码 的装置可以为手机、 平板电脑等移动终端, 但并不限于此, 还可以为其他终端 , 此处不作限定。 本实施例的终端 300包括的各模块用于执行图 1对应的实施例 中的各步骤, 具体请参阅图 1以及图 1对应的实施例中的相关描述, 此处不赘述 。 本实施例的扫描二维码的装置包括: 采集模块 310、 判断单元 320、 扫描模块 3 30。 Referring to FIG. 3, FIG. 3 is a schematic structural diagram of an embodiment of an apparatus for scanning a two-dimensional code according to the present invention. The device for scanning the two-dimensional code may be a mobile terminal such as a mobile phone or a tablet computer, but is not limited thereto, and may be other terminals, which is not limited herein. The modules included in the terminal 300 of this embodiment are used to perform the steps in the embodiment corresponding to FIG. 1. For details, please refer to the related description in the embodiment corresponding to FIG. 1 and FIG. 1 , and details are not described herein. The device for scanning a two-dimensional code of the embodiment includes: an acquisition module 310, a determination unit 320, and a scanning module 3 30.
[0063] 采集模块 310用于当检测到扫描二维码的触发操作吋, 采集环境光的光照度值 。 比如, 采集模块 310当检测到扫描二维码的触发操作吋, 采集环境光的光照度 值。 采集模块 310将光照度值向判断模块 320发送。 [0064] 判断模块 320用于接收釆集模块 310发送的光照度值, 判断光照度值是否小于预 设光照度阚值。 比如, 判断模块 320接收釆集模块 310发送的光照度值, 判断光 照度值是否小于预设光照度阈值。 判断模块 320将判断结果向扫描模块 330发送 [0063] The acquisition module 310 is configured to collect the illuminance value of the ambient light when the trigger operation of scanning the two-dimensional code is detected. For example, the acquisition module 310 collects the illuminance value of the ambient light when detecting the trigger operation of scanning the two-dimensional code. The acquisition module 310 transmits the illuminance value to the determination module 320. The determining module 320 is configured to receive the illuminance value sent by the collection module 310, and determine whether the illuminance value is less than a preset illuminance threshold. For example, the determining module 320 receives the illuminance value sent by the collection module 310, and determines whether the illuminance value is less than a preset illuminance threshold. The determining module 320 sends the determination result to the scanning module 330
[0065] 扫描模块 330用于接收判断模块 320发送的判断结果 , 当判断结果为光照度值小 于预设光照度阈值, 开启闪光灯并扫描待识别的目标二维码。 The scanning module 330 is configured to receive the determination result sent by the determining module 320. When the determination result is that the illuminance value is less than the preset illuminance threshold, the flash is turned on and the target two-dimensional code to be identified is scanned.
[0066] 比如, 扫描模块 330接收判断模块 320发送的判断结果, 当判断结果为光照度值 小于预设光照度阈值, 开启闪光灯并扫描待识别的目标二维码。 For example, the scanning module 330 receives the determination result sent by the determining module 320. When the determination result is that the illuminance value is less than the preset illuminance threshold, the flash is turned on and the target two-dimensional code to be recognized is scanned.
[0067] 上述方案, 终端当检测到扫描二维码的触发操作时, 采集环境光的光照度值; 判断所述光照度值是否小于预设光照度阈值; 当所述光照度值小于所述预设光 照度阈值, 开启闪光灯并扫描待识别的目标二维码, 能够根据环境光的光照度 值自动开启闪光灯, 节省手动开启照明设备的时间, 实现在光线较暗的环境下 成功扫描二维码, 提高在光线较暗的情况下扫描二维码的效率, 由于开启闪光 灯后, 目标二维码处于光线充足的环境下, 能够避免重复扫描二维码的情况, 提高扫描二维码的成功率。 [0067] In the above solution, when detecting the triggering operation of scanning the two-dimensional code, the terminal collects the illuminance value of the ambient light; determines whether the illuminance value is less than a preset illuminance threshold; and when the illuminance value is less than the preset illuminance threshold The flash is turned on and the target QR code to be recognized is scanned, and the flash can be automatically turned on according to the ambient light illuminance value, saving the time for manually turning on the lighting device, thereby successfully scanning the two-dimensional code in a dimly lit environment, and improving the light in the light. The efficiency of scanning the two-dimensional code in a dark situation, since the target two-dimensional code is in a well-lit environment after the flash is turned on, the situation of repeatedly scanning the two-dimensional code can be avoided, and the success rate of scanning the two-dimensional code can be improved.
[0068] 参见图 4, 图 4是本发明扫描二维码的装置另一实施例的结构示意图。 扫描二维 码的装置可以为手机、 平板电脑等移动终端, 但并不限于此, 还可以为其他终 端, 此处不作限定。 本实施例的终端 400包括的各模块用于执行图 2对应的实施 例中的各步骤, 具体请参阅图 2以及图 2对应的实施例中的相关描述, 此处不赘 述。 本实施例的扫描二维码的装置包括: 设置模块 410、 采集模块 420、 判断单 元 430、 扫描模块 440、 解析模块 450以及闪光灯关闭模块 460。 Referring to FIG. 4, FIG. 4 is a schematic structural diagram of another embodiment of a device for scanning a two-dimensional code according to the present invention. The device for scanning the two-dimensional code may be a mobile terminal such as a mobile phone or a tablet computer, but is not limited thereto, and may be other terminals, which is not limited herein. The modules included in the terminal 400 of this embodiment are used to perform the steps in the embodiment corresponding to FIG. 2. For details, please refer to the related description in the embodiment corresponding to FIG. 2 and FIG. 2, which are not described herein. The apparatus for scanning a two-dimensional code of the embodiment includes: a setting module 410, an acquisition module 420, a determination unit 430, a scanning module 440, a parsing module 450, and a flash off module 460.
[0069] 设置模块 410用于设置控制闪光灯的操作权限。 比如, 设置模块 410设置控制闪 光灯的操作权限。 [0069] The setting module 410 is configured to set an operation authority for controlling the flash. For example, the setting module 410 sets the operating authority for controlling the flash.
[0070] 采集模块 420用于当检测到扫描二维码的触发操作吋, 釆集环境光的光照度值 。 比如, 釆集模块 420当检测到扫描二维码的触发操作吋, 釆集环境光的光照度 值。 采集模块 420将光照度值向判断模块 430发送。 [0070] The acquisition module 420 is configured to collect the illuminance value of the ambient light when the triggering operation of scanning the two-dimensional code is detected. For example, the clustering module 420 collects the illuminance value of the ambient light when detecting the triggering operation of scanning the two-dimensional code. The acquisition module 420 sends the illuminance value to the decision module 430.
[0071] 判断模块 430用于接收釆集模块 420发送的光照度值, 判断光照度值是否小于预 设光照度阈值。 比如, 判断模块 430接收采集模块 420发送的光照度值, 判断光 照度值是否小于预设光照度阈值。 判断模块 430将判断结果向扫描模块 440发送 The determining module 430 is configured to receive the illuminance value sent by the collecting module 420, and determine whether the illuminance value is less than a preset illuminance threshold. For example, the determining module 430 receives the illuminance value sent by the collecting module 420, and determines the light. Whether the illuminance value is less than the preset illuminance threshold. The determining module 430 sends the determination result to the scanning module 440
[0072] 扫描模块 440用于接收判断模块 430发送的判断结果, 当判断结果为光照度值小 于预设光照度阈值, 开启闪光灯并扫描待识别的目标二维码。 The scanning module 440 is configured to receive the determination result sent by the determining module 430. When the determination result is that the illuminance value is less than the preset illuminance threshold, the flash is turned on and the target two-dimensional code to be identified is scanned.
[0073] 比如, 扫描模块 440接收判断模块 430发送的判断结果, 当判断结果为光照度值 小于预设光照度阈值, 幵启闪光灯并扫描待识别的目标二维码。 扫描模块 440将 扫描到的目标二维码向解析模块 450发送。 For example, the scanning module 440 receives the determination result sent by the determining module 430. When the determination result is that the illuminance value is less than the preset illuminance threshold, the flash is activated and the target two-dimensional code to be identified is scanned. The scanning module 440 transmits the scanned target two-dimensional code to the parsing module 450.
[0074] 解析模块 450用于接收扫描模块 440发送的目标二维码, 解析目标二维码, 获取 目标二维码对应的信息。 比如, 解析模块 450接收扫描模块 440发送的目标二维 码, 解析目标二维码, 获取目标二维码对应的信息。 解析模块 450在获取到目标 二维码对应的信息吋, 向闪光灯关闭模块 460发送通知信息。 [0074] The parsing module 450 is configured to receive the target two-dimensional code sent by the scanning module 440, parse the target two-dimensional code, and obtain information corresponding to the target two-dimensional code. For example, the parsing module 450 receives the target two-dimensional code sent by the scanning module 440, parses the target two-dimensional code, and obtains information corresponding to the target two-dimensional code. The parsing module 450 transmits the notification information to the flash close module 460 after acquiring the information corresponding to the target two-dimensional code.
[0075] 闪光灯关闭模块 460用于接收解析模块 450在获取到目标二维码对应的信息时, 发送的通知信息, 关闭所述闪光灯。 [0075] The flash-off module 460 is configured to receive the notification information sent by the parsing module 450 when the information corresponding to the target two-dimensional code is acquired, and turn off the flash.
[0076] 比如 , 闪光灯关闭模块 460接收解析模块 450在获取到目标二维码对应的信息吋 , 发送的通知信息, 关闭所述闪光灯。 [0076] For example, the flash close module 460 receives the information corresponding to the target two-dimensional code, the notification information sent by the parsing module 450, and turns off the flash.
[0077] 上述方案, 终端当检测到扫描二维码的触发操作时, 釆集环境光的光照度值; 判断所述光照度值是否小于预设光照度阈值; 当所述光照度值小于所述预设光 照度阈值, 开启闪光灯并扫描待识别的目标二维码, 能够根据环境光的光照度 值自动开启闪光灯, 节省手动开启照明设备的时间, 实现在光线较暗的环境下 成功扫描二维码, 提高在光线较暗的情况下扫描二维码的效率, 由于开启闪光 灯后, 目标二维码处于光线充足的环境下, 能够避免重复扫描二维码的情况, 提高扫描二维码的成功率。 [0077] In the above solution, when detecting the triggering operation of scanning the two-dimensional code, the terminal collects the illuminance value of the ambient light; determines whether the illuminance value is less than a preset illuminance threshold; and when the illuminance value is less than the preset illuminance Threshold, turn on the flash and scan the target QR code, which can automatically turn on the flash according to the ambient light illuminance value, saving the time for manually turning on the lighting device, and successfully scanning the QR code in the dark environment to improve the light. The efficiency of scanning the two-dimensional code in a darker situation, since the target two-dimensional code is in a well-lit environment after the flash is turned on, the situation of repeatedly scanning the two-dimensional code can be avoided, and the success rate of scanning the two-dimensional code can be improved.
[0078] 终端在获取到目标二维码对应的信息吋, 关闭闪光灯, 能够保证成功获取目标 二维码对应的信息。 终端能够自动开启、 关闭闪光灯, 为用户节省操控照明设 备的时间, 简化在弱光环境下扫描二维码的操作过程, 人机交互更智能化。 [0078] After acquiring the information corresponding to the target two-dimensional code, the terminal turns off the flash, and can ensure that the information corresponding to the target two-dimensional code is successfully obtained. The terminal can automatically turn on and off the flash, saving the user time to control the lighting device, simplifying the operation of scanning the QR code in low light environment, and making human-computer interaction more intelligent.
[0079] 参阅图 5 , 图 5是本发明扫描二维码的装置再一实施例的结构示意图。 扫描二维 码的装置 500可以为具有扫描二维码功能的终端, 本发明具体实施例并不对扫描 二维码的装置的具体实现做限定。 扫描二维码的装置 500包括: [0080] 处理器 (processor) 510, 通信接口 (Communications Interface) 520, 存储器[0079] Referring to FIG. 5, FIG. 5 is a schematic structural diagram of still another embodiment of a device for scanning a two-dimensional code according to the present invention. The apparatus 500 for scanning a two-dimensional code may be a terminal having a function of scanning a two-dimensional code, and the specific embodiment of the present invention does not limit the specific implementation of the apparatus for scanning a two-dimensional code. The apparatus 500 for scanning a two-dimensional code includes: [0080] a processor 510, a communication interface 520, a memory
(memory) 530, 总线 540。 (memory) 530, bus 540.
[0081] 处理器 510, 通信接口 520, 存储器 530通过总线 540完成相互间的通信。 [0081] The processor 510, the communication interface 520, and the memory 530 complete communication with each other through the bus 540.
[0082] 通信接口 520, 用于与外界设备, 例如, 个人电脑、 服务器等通信。 [0082] The communication interface 520 is configured to communicate with an external device, such as a personal computer, a server, or the like.
[0083] 处理器 510可能是一个中央处理器 CPU , 或者是特定集成电路 ASIC (Applicatio n Specific Integrated Circuit) , 或者是被配置成实施本发明实施例的一个或多个 集成电路。 [0083] The processor 510 may be a central processing unit CPU, or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention.
[0084] 存储器 530, 用于存放程序 532。 存储器 530可能包含高速 RAM存储器, 也可能 还包括非易失性存储器 (non-volatile memory) , 例如至少一个磁盘存储器。 程 序 532可以包括程序代码, 所述程序代码包括计算机操作指令。 [0084] The memory 530 is configured to store the program 532. Memory 530 may include high speed RAM memory and may also include non-volatile memory, such as at least one disk memory. Program 532 can include program code, the program code including computer operating instructions.
[0085] 处理器 510用于根据存储器 530存储的程序 532执行以下操作: [0085] The processor 510 is configured to perform the following operations according to the program 532 stored in the memory 530:
[0086] 处理器 510用于, 当检测到扫描二维码的触发操作时, 釆集环境光的光照度值 ; 以及用于判断所述光照度值是否小于预设光照度阈值; 还用于当所述光照度 值小于所述预设光照度阈值, 开启闪光灯并扫描待识别的目标二维码。 [0086] The processor 510 is configured to: when detecting a triggering operation of scanning the two-dimensional code, collecting an illuminance value of the ambient light; and determining whether the illuminance value is less than a preset illuminance threshold; The illuminance value is less than the preset illuminance threshold, the flash is turned on and the target two-dimensional code to be recognized is scanned.
[0087] 可选地, 处理器 510还用于解析所述目标二维码, 获取所述目标二维码对应的 f 息。 [0087] Optionally, the processor 510 is further configured to parse the target two-dimensional code to obtain the f-content corresponding to the target two-dimensional code.
[0088] 可选地, 处理器 510还用于当获取到所述目标二维码对应的信息吋, 关闭所述 闪光灯。 [0088] Optionally, the processor 510 is further configured to: when the information corresponding to the target two-dimensional code is acquired, the flash is turned off.
[0089] 可选地, 处理器 510还用于设置控制闪光灯的操作权限。 [0089] Optionally, the processor 510 is further configured to set an operation authority for controlling the flash.
[0090] 所属领域的技术人员可以清楚地了解到, 为描述的方便和简洁, 上述描述的装 置和单元的具体工作过程, 可以参考前述方法实施例中的对应过程, 在此不再 赘述。 [0090] It will be apparent to those skilled in the art that, for the convenience and brevity of the description, the specific working process of the device and the unit described above may be referred to the corresponding process in the foregoing method embodiments, and details are not described herein again.
[0091] 在本申请所提供的几个实施例中, 应该理解到, 所揭露的系统、 装置和方法, 可以通过其它的方式实现。 例如, 以上所描述的装置实施例仅仅是示意性的, 例如, 所述单元的划分, 仅仅为一种逻辑功能划分, 实际实现时可以有另外的 划分方式, 例如多个单元或组件可以结合或者可以集成到另一个系统, 或一些 特征可以忽略, 或不执行。 另一点, 所显示或讨论的相互之间的耦合或直接耦 合或通信连接可以是通过一些通信接口, 装置或单元的间接耦合或通信连接, 可以是电性, 机械或其它的形式。 [0091] In the several embodiments provided by the present application, it should be understood that the disclosed system, apparatus, and method may be implemented in other manners. For example, the device embodiments described above are merely illustrative. For example, the division of the unit is only a logical function division. In actual implementation, there may be another division manner, for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some communication interface, device or unit, It can be electrical, mechanical or other form.
[0092] 所述作为分离部件说明的单元可以是或者也可以不是物理上分开的, 作为单元 显示的部件可以是或者也可以不是物理单元, 即可以位于一个地方, 或者也可 以分布到多个网络单元上。 可以根据实际的需要选择其中的部分或者全部单元 来实现本实施例方案的目的。 [0092] The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple networks. On the unit. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
[0093] 另外, 在本发明各个实施例中的各功能单元可以集成在一个处理单元中, 也可 以是各个单元单独物理存在, 也可以两个或两个以上单元集成在一个单元中。 In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0094] 所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时, 可 以存储在一个计算机可读取存储介质中。 基于这样的理解, 本发明的技术方案 本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产 品的形式体现出来, 该计算机软件产品存储在一个存储介质中, 包括若干指令 用以使得一台计算机设备 (可以是个人计算机, 服务器, 或者网络设备等) 执 行本发明各个实施例所述方法的全部或部分步骤。 而前述的存储介质包括: U盘 、 移动硬盘、 只读存储器 (ROM , Read-Only [0094] The functions, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention, which is essential or contributes to the prior art, or a part of the technical solution, may be embodied in the form of a software product, which is stored in a storage medium, including The instructions are used to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: a USB flash drive, a removable hard disk, a read only memory (ROM, Read-Only)
Memory) 、 随机存取存储器 (RAM, Random Access Memory) 、 磁碟或者光盘 等各种可以存储程序代码的介质。 Memory, random access memory (RAM), disk or optical disk, and other media that can store program code.
[0095] 以上仅为本发明的较佳实施例而已, 并不用以限制本发明, 凡在本发明的精神 和原则之内所作的任何修改、 等同替换和改进等, 均应包含在本发明的保护范 围之内。 The above are only the preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, equivalents, and improvements made within the spirit and scope of the present invention should be included in the present invention. Within the scope of protection.
Claims
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| PCT/CN2016/096240 WO2018035677A1 (en) | 2016-08-22 | 2016-08-22 | Method and device for scanning two-dimensional barcode |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| PCT/CN2016/096240 WO2018035677A1 (en) | 2016-08-22 | 2016-08-22 | Method and device for scanning two-dimensional barcode |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2018035677A1 true WO2018035677A1 (en) | 2018-03-01 |
Family
ID=61245998
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2016/096240 Ceased WO2018035677A1 (en) | 2016-08-22 | 2016-08-22 | Method and device for scanning two-dimensional barcode |
Country Status (1)
| Country | Link |
|---|---|
| WO (1) | WO2018035677A1 (en) |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112188110A (en) * | 2019-07-13 | 2021-01-05 | 迅镭智能(广州)科技有限公司 | Adaptive dimming high-speed shooting instrument, control method and device thereof and storage medium |
| US12061950B1 (en) | 2023-05-30 | 2024-08-13 | Walmart Apollo, Llc | Systems and methods of identifying products through portable scanning |
| US12412164B2 (en) | 2010-10-13 | 2025-09-09 | Walmart Apollo, Llc | Method for self-checkout with a mobile device |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20010055422A1 (en) * | 1994-10-26 | 2001-12-27 | Alexander R. Roustaei | System for reading two-dimensional images using ambient and/or projected light |
| CN204331742U (en) * | 2015-01-04 | 2015-05-13 | 江苏智联天地科技有限公司 | A kind of micro embedded scan code system for mobile intelligent terminal |
| CN105243350A (en) * | 2014-05-28 | 2016-01-13 | 腾讯科技(深圳)有限公司 | Code scanning method and code scanning device |
-
2016
- 2016-08-22 WO PCT/CN2016/096240 patent/WO2018035677A1/en not_active Ceased
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20010055422A1 (en) * | 1994-10-26 | 2001-12-27 | Alexander R. Roustaei | System for reading two-dimensional images using ambient and/or projected light |
| CN105243350A (en) * | 2014-05-28 | 2016-01-13 | 腾讯科技(深圳)有限公司 | Code scanning method and code scanning device |
| CN204331742U (en) * | 2015-01-04 | 2015-05-13 | 江苏智联天地科技有限公司 | A kind of micro embedded scan code system for mobile intelligent terminal |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US12412164B2 (en) | 2010-10-13 | 2025-09-09 | Walmart Apollo, Llc | Method for self-checkout with a mobile device |
| CN112188110A (en) * | 2019-07-13 | 2021-01-05 | 迅镭智能(广州)科技有限公司 | Adaptive dimming high-speed shooting instrument, control method and device thereof and storage medium |
| US12061950B1 (en) | 2023-05-30 | 2024-08-13 | Walmart Apollo, Llc | Systems and methods of identifying products through portable scanning |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN105825109B (en) | The method and terminal of a kind of terminal unlocking | |
| CN106225174B (en) | Air conditioner control method and system and air conditioner | |
| CN109583320A (en) | Fingerprint identification method and related device | |
| CN106662970B (en) | A method, device and terminal device for setting interrupt threshold of fingerprint reader | |
| CN105426658A (en) | A vehicle pre-start method and related device | |
| CN105046186A (en) | Two-dimensional code recognition method and device | |
| WO2019072133A1 (en) | Face recognition method and related product | |
| CN103513788B (en) | Based on the gesture identification method of gyro sensor, system and mobile terminal | |
| CN108288044A (en) | Electronic device, face identification method and Related product | |
| CN112241642B (en) | Two-dimensional code recognition method, device, equipment and storage medium | |
| CN104866406B (en) | A kind of reminding method and terminal based on fingerprint recognition | |
| CN110443224A (en) | Page turning detection method and device, electronic equipment and storage medium | |
| WO2016197389A1 (en) | Method and device for detecting living object, and mobile terminal | |
| EP3196738A1 (en) | Method for controlling blank screen gesture processing and terminal | |
| CN106055952A (en) | A fingerprint unlocking method, device and user terminal | |
| CN110688319A (en) | Application keep-alive capability test method and related device | |
| WO2018035677A1 (en) | Method and device for scanning two-dimensional barcode | |
| CN107451543A (en) | Event processing method and related products | |
| CN107291238B (en) | Data processing method and device | |
| CN108445475B (en) | Data processing method and device and related medium product | |
| CN107729833A (en) | Method for detecting human face and Related product | |
| CN108683845B (en) | Image processing method, device, storage medium and mobile terminal | |
| CN111291749A (en) | Gesture recognition method, device and robot | |
| CN107491743B (en) | Iris image acquisition method and related products | |
| WO2024098906A1 (en) | Image tracking method and apparatus for gigapixel photographic device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 16913701 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 16913701 Country of ref document: EP Kind code of ref document: A1 |