WO2023236801A1 - 识别图形码的方法及电子设备 - Google Patents

识别图形码的方法及电子设备 Download PDF

Info

Publication number
WO2023236801A1
WO2023236801A1 PCT/CN2023/096848 CN2023096848W WO2023236801A1 WO 2023236801 A1 WO2023236801 A1 WO 2023236801A1 CN 2023096848 W CN2023096848 W CN 2023096848W WO 2023236801 A1 WO2023236801 A1 WO 2023236801A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
code
application
electronic device
graphic code
Prior art date
Application number
PCT/CN2023/096848
Other languages
English (en)
French (fr)
Inventor
章平
王小梅
崔晓颖
罗俊卿
刘理
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from CN202211080988.8A external-priority patent/CN117422082A/zh
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2023236801A1 publication Critical patent/WO2023236801A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light

Definitions

  • the present application relates to the field of terminal technology, and in particular, to a method and electronic device for identifying graphic codes.
  • identifying graphic codes that is, "scanning codes”
  • merchants can publish payment codes, including posting the payment code printed on paper anywhere in the real world or displaying the payment code image on any electronic display, and customers can scan the code through another electronic device. Payments can be made to merchants and transactions across time and space can be realized.
  • electronic devices include a variety of different applications, and each application can recognize a kind of graphic code.
  • the user first manually opens the application corresponding to the graphic code on the electronic device according to the graphic code to be recognized, and uses the application to identify the graphic code, and the user experience is limited.
  • the present application provides a method and electronic device for identifying graphic codes, which can improve the efficiency of identifying graphic codes and reduce the cost of identifying graphic codes with low power consumption.
  • embodiments of the present application provide a method for identifying graphic codes, which is applied to electronic devices.
  • the method includes:
  • the first image includes a first graphic code
  • a second image is acquired, and the second image includes a second graphic code
  • the power consumption generated by acquiring the first image is less than that of acquiring the second image.
  • the resulting power consumption the image quality of the first image is lower than the image quality of the second image, and the image quality of the first graphic code is lower than the image quality of the second graphic code;
  • a display interface corresponding to the first code information is displayed through the first application.
  • the first image with lower image quality can be obtained through the first camera with lower power consumption, and the first image includes the first graphic code.
  • the power consumption is high
  • a second image with higher image quality is obtained through the second camera
  • the first code information carried by the second graphic code and the first application are identified from the second image, and then the user is informed
  • the first prompt message is issued so that the user perceives that the second graphic code is recognized.
  • a display interface corresponding to the first code information may be displayed based on the first application.
  • the function of searching for graphic code recognition in the application greatly improves the efficiency of identifying graphic codes.
  • the developers of the first application do not need to conduct software layout and user guidance specifically for the function of identifying graphic codes, which reduces the cost of identifying graphic codes.
  • the first image with lower image quality is first obtained through the first camera when the power consumption is low, and when it is initially determined that the first image includes the first graphic code, the first image is obtained again when the power consumption is high. Acquiring a second image with higher image quality through the second camera can also reduce the power consumption of the electronic device for recognizing the graphic code.
  • the electronic device acquires the second image through the second camera when determining that the first image acquired through the first camera includes the first graphic code
  • the time interval between acquiring the second image and the first image is very small, such as It can be millisecond level or even microsecond level. Therefore, the image content included in the second image and the image content included in the first image can be the same or similar, and the image quality of the first image can be higher than the image quality of the second image.
  • a graphic code and a second graphic code may be the same or similar, and the image quality of the second graphic code is higher than the image quality of the first graphic code.
  • the resolution of the second image may be higher than the resolution of the first image, and the resolution of the second graphic code may be higher than the resolution of the first graphic code.
  • the specific status may be set in advance by the user or relevant technical personnel.
  • the electronic device may be learned by the user's behavior of actively identifying the graphic code multiple times.
  • the electronic device can simultaneously determine the first code information carried by the second graphic code and the first application corresponding to the second graphic code, or it can determine one of them first and then determine the other. In some embodiments, if the electronic device first determines the first application corresponding to the second graphic code, it can determine the first code information carried by the second graphic code through the first application, thereby improving the accuracy of determining the first code information. . In some embodiments, if the electronic device first determines the first code information carried by the second graphic code, it can determine the first application through the first code information, thereby improving the accuracy of the first application.
  • the confirmation operation may include a tapping operation on a certain surface of the electronic device (such as the back or display screen).
  • the confirmation operation may include a key operation on a specific key (including a physical key or a virtual key).
  • obtaining the first image includes:
  • the obtaining the second image includes:
  • the first shooting mode is a low resolution mode
  • the second shooting mode is a high resolution mode
  • the electronic device can switch the low-resolution mode and the high-resolution mode of the same camera to obtain the first image under low power consumption and the second image under high power consumption, reducing the impact on the electronic device. Includes the number of cameras required.
  • obtaining the first image includes:
  • the obtaining the second image includes:
  • the first camera is a low-power camera
  • the second camera is a high-power camera
  • the electronic device can obtain the first image under low power consumption and the second image under high power consumption by switching between low-power camera and high-power camera, reducing the impact on the performance of a single camera. need.
  • the first camera when the first image is acquired through the first camera, the first camera may be in the on state, and other cameras such as the second camera may be in the off state; in some embodiments, when the second image is acquired through the second camera When capturing images, the second camera can be turned on, and other cameras such as the first camera can be turned off.
  • the method includes:
  • the second image includes scene features corresponding to the second graphic code, it is determined that the first image includes the second graphic code; or,
  • the second image includes encoding features corresponding to the second graphic code, it is determined that the first image includes the second graphic code; or,
  • the second image includes encoding features corresponding to the second graphic code and encoding features corresponding to the second graphic code, it is determined that the first image includes the second graphic code.
  • the scene feature can be a feature in the second image other than the second graphic code that can be used to identify the second graphic code.
  • the scene feature can be used to indicate the place where the second graphic code is located and the second graphic code corresponding to the second graphic code. At least one of the features such as the function and the application corresponding to the second graphic code.
  • the electronic device may obtain and store the encoding features and/or scene features corresponding to the second graphic code in advance.
  • the electronic device may acquire multiple images including the second image code, and acquire encoding features and/or scene features corresponding to the second image code from the multiple images.
  • the electronic device can input the acquired second image into the first machine learning model to obtain a recognition result output by the first machine learning model.
  • the recognition result can be used to indicate that the second image includes the second graphic. code or does not include the second graphic code.
  • determining the first application corresponding to the second graphic code includes:
  • the first application corresponding to the second graphic code is determined.
  • determining the first application corresponding to the second graphic code based on the first code information includes:
  • the first application corresponding to the second graphic code is determined.
  • determining the first application corresponding to the second graphic code includes:
  • the first application corresponding to the second graphic code is determined based on the scene characteristics included in the first image or the second image.
  • determining the first code information carried by the second graphic code includes:
  • the first code information carried by the second graphic code is determined through the first application.
  • the method before the confirmation operation is received, the method further includes:
  • First prompt information is issued, and the first prompt information is used to indicate that the second graphic code is detected.
  • the electronic device recognizes the graphic code in advance without disturbing the user.
  • the user can be prompted by sending a first prompt message that the second graphic code has been detected, and then the user can judge whether the electronic device has executed it in advance. Identifying whether the behavior is valid ensures the safety of electronic devices.
  • the second graphic code corresponds to multiple applications. After the confirmation operation is received, the method further includes:
  • the first application selected among the plurality of applications is received.
  • the electronic device may issue third prompt information, and the third prompt information is used to prompt the user to determine the first application among multiple applications.
  • the second graphic code corresponds to multiple applications, and the electronic device can determine the first application among the multiple applications through other methods without requiring the user to select the first application among the multiple applications.
  • the electronic device may also determine the first application among multiple applications according to a preset strategy.
  • the electronic device may determine the application that is most frequently used by the user among the multiple applications as the first application.
  • the electronic device may determine the application last used by the user among the plurality of applications as the first application.
  • the electronic device may determine the application with the highest security among the multiple applications as the first application.
  • the accuracy of determining the first application can be improved; and having the electronic device determine the first application among multiple applications can reduce the interaction with the user and improve the accuracy of determining the first application.
  • Efficiency in identifying graphic codes by receiving the first application selected by the user among multiple applications, the accuracy of determining the first application can be improved; and having the electronic device determine the first application among multiple applications can reduce the interaction with the user and improve the accuracy of determining the first application.
  • the second image includes a plurality of graphic codes
  • the method further includes:
  • the second graphic code selected from the plurality of graphic codes is received.
  • the electronic device may issue second prompt information, and the second prompt information may be used to prompt the user to determine the second graphic code among multiple graphic codes.
  • the second prompt information may include multiple graphic codes.
  • the second prompt information may include a second image (or a first image) and a mark corresponding to each graphic code.
  • the second prompt information may include a second image (or first image), a mark corresponding to each graphic code, and an application icon corresponding to each graphic code.
  • the second image includes a plurality of graphic codes
  • the electronic device can determine the second graphic code among the plurality of graphic codes in other ways without requiring the user to select the second graphic code among the plurality of graphic codes. graphics code.
  • the accuracy of determining the second graphic code can be improved; and having the electronic device determine the second graphic code among the multiple graphic codes can reduce the interaction with the user. The interaction between them improves the efficiency of identifying graphic codes.
  • the information type of the first code information is a uniform resource locator URL.
  • the method further includes:
  • Displaying a display interface corresponding to the first code information through the first application includes:
  • Data corresponding to the first code information is loaded through the first application to display a display interface corresponding to the first code information.
  • the method before the confirmation operation is received, the method further includes:
  • the virtual interface corresponding to the first code information is loaded through the first application to display a display interface corresponding to the first code information.
  • the first prompt information includes:
  • a first line identifier is a graphic corresponding to the second graphic code
  • the identity information of the first application and/or,
  • the method further includes:
  • the specific state includes the electronic device displaying a home interface, a negative one-screen interface, or a sliding notification interface; and/or the electronic device is in a horizontal state, a vertical state, or a raised state.
  • embodiments of the present application provide a device for identifying graphic codes.
  • the device has the function of realizing the behaviors of electronic devices in the above aspects and possible implementations of the above aspects.
  • Functions can be implemented by hardware, or by hardware executing corresponding software.
  • Hardware or software includes one or more modules or units corresponding to the above functions. For example, a transceiver module or unit, a processing module or unit, an acquisition module or unit, etc.
  • embodiments of the present application provide an electronic device, including: a memory and a processor.
  • the memory is used to store a computer program; and the processor is used to execute any of the methods described in the first aspect when calling the computer program.
  • inventions of the present application provide a chip system.
  • the chip system includes a processor, the processor is coupled to a memory, and the processor executes a computer program stored in the memory to implement any of the above-mentioned aspects of the first aspect. The method described in one item.
  • the chip system may be a single chip or a chip module composed of multiple chips.
  • embodiments of the present application provide a computer-readable storage medium on which a computer program is stored.
  • the computer program is executed by a processor, the method described in any one of the above-mentioned first aspects is implemented.
  • embodiments of the present application provide a computer program product, which when the computer program product is run on an electronic device, causes the electronic device to execute any of the methods described in the first aspect.
  • Figure 1 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • Figure 2 is a software structure block diagram of an electronic device provided by an embodiment of the present application.
  • Figure 3 is a schematic flowchart of a method for identifying graphic codes provided by an embodiment of the present application
  • Figure 4 is a schematic diagram of a second image provided by an embodiment of the present application.
  • Figure 5 is a schematic diagram of a display interface provided by an embodiment of the present application.
  • Figure 6 is a schematic diagram of another display interface provided by an embodiment of the present application.
  • Figure 7 is a schematic diagram of another display interface provided by an embodiment of the present application.
  • Figure 8 is a schematic diagram of another display interface provided by an embodiment of the present application.
  • Figure 9 is a schematic diagram of another display interface provided by an embodiment of the present application.
  • Figure 10 is a schematic flow chart of another method for identifying graphic codes provided by an embodiment of the present application.
  • Figure 11 is a schematic flowchart of another method for identifying graphic codes provided by an embodiment of the present application.
  • Figure 13 is a schematic flowchart of another method for identifying graphic codes provided by an embodiment of the present application.
  • Figure 14 is a schematic flow chart of another method for identifying graphic codes provided by an embodiment of the present application.
  • Figure 15 is a schematic diagram of another display interface provided by an embodiment of the present application.
  • Figure 16 is a schematic diagram of another display interface provided by an embodiment of the present application.
  • Figure 18 is a schematic flowchart of a method for identifying graphic codes provided by an embodiment of the present application.
  • Figure 19 is a schematic diagram of a second image provided by an embodiment of the present application.
  • Figure 20 is a schematic diagram of another display interface provided by an embodiment of the present application.
  • Figure 21 is a schematic diagram of another display interface provided by an embodiment of the present application.
  • Figure 24 is a schematic diagram of another display interface provided by an embodiment of the present application.
  • Figure 26 is a schematic diagram of another display interface provided by an embodiment of the present application.
  • Figure 27 is a schematic flowchart of another method for identifying graphic codes provided by an embodiment of the present application.
  • the method for identifying graphic codes provided by the embodiments of this application can be applied to mobile phones, tablet computers, wearable devices, vehicle-mounted devices, augmented reality (AR)/virtual reality (VR) devices, notebook computers, and super mobile devices.
  • AR augmented reality
  • VR virtual reality
  • PDA personal digital assistants
  • FIG. 1 is a schematic structural diagram of an electronic device 100 provided by this application.
  • the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a camera 130, a display screen 140, a communication module 150, a speaker 160, a microphone 170, a sensor module 180, a button 190, a motor 191, an indicator 192, and Subscriber identification module (SIM) card interface 195, etc.
  • the sensor module 180 may include a pressure sensor, a gyroscope sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a touch sensor, an ambient light sensor, etc.
  • the controller may be the nerve center and command center of the electronic device 100 .
  • the controller can generate operation control signals based on the instruction operation code and timing signals to complete the control of fetching and executing instructions.
  • the communication module 150 may be used to implement communication within the electronic device 100 and/or to implement communication between the electronic device 100 and other devices.
  • the communication module 150 can provide solutions for mobile communications including 2G/3G/4G/5G, etc., applied on the electronic device 100, and/or provide solutions including wireless LAN (wireless LAN) applied on the electronic device 100.
  • local area networks, WLAN) such as wireless fidelity (Wi-Fi) network
  • Bluetooth blue, BT
  • global navigation satellite system global navigation satellite system
  • GNSS global navigation satellite system
  • frequency modulation frequency modulation, FM
  • Near field communication technology near field communication, NFC
  • infrared technology infrared, IR
  • the electronic device 100 implements display functions through a GPU, a display screen 140, an application processor, and the like.
  • the GPU is an image processing microprocessor and is connected to the display screen 140 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering.
  • Processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
  • the ISP is used to process the data fed back by the camera 130 .
  • the shutter is opened, the light is transmitted to the camera sensor through the lens, the optical signal is converted into an electrical signal, and the camera sensor passes the electrical signal to the ISP for processing, and converts it into an image visible to the naked eye.
  • ISP can also perform algorithm optimization on image noise, brightness, and skin color. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene.
  • the ISP may be provided in the camera 130.
  • Camera 130 is used to capture still images or video.
  • the object passes through the lens to produce an optical image that is projected onto the photosensitive element.
  • the photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor.
  • CMOS complementary metal-oxide-semiconductor
  • the photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to convert it into a digital image signal.
  • ISP outputs digital image signals to DSP for processing.
  • DSP converts digital image signals into standard RGB, YUV and other format image signals.
  • camera 130 can switch between multiple shooting modes.
  • the plurality of shooting modes include shooting mode A and shooting mode B.
  • the electronic device 100 may include 1 or N cameras 130, where N is a positive integer greater than 1.
  • the N cameras 130 may include camera A and camera B.
  • the image quality of the image captured by camera A may be lower than the image quality of the image captured by camera B; and/or the power consumption of camera A may be lower than the power consumption of camera B.
  • camera A may be called a low-power camera or a low-resolution camera
  • camera B may be called a high-power camera or a high-resolution camera.
  • the current consumed by a low-power camera or a low-resolution camera during operation may be less than 100 mA, and the current consumed by a high-power camera or a high-resolution camera during operation may be greater than 100 mA.
  • the current consumed by a low-power camera or a low-resolution camera is less than the current consumed by a high-power camera or a high-resolution camera
  • the power generated by a low-power camera or a low-resolution camera during operation is The power consumption is less than the power consumption generated by high-power cameras or high-resolution cameras when running. Therefore, low-power cameras or low-resolution cameras can be running for a longer time or all the time without causing any harm to electronic devices. Bringing greater power consumption burden.
  • the total power of the electronic device is 6000mA
  • the current consumed by camera A is 86mA
  • the current consumed by camera B is 650mA.
  • the running time of camera A 6000/86, about 70 hours
  • the running time of camera B 6000/650, about 9 hours. That is, the length of time that camera A can run is approximately 8 times the length of time that camera B can run.
  • Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
  • Video codecs are used to compress or decompress digital video.
  • Electronic device 100 may support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple encoding formats, such as moving picture experts group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
  • MPEG moving picture experts group
  • MPEG2 MPEG2, MPEG3, MPEG4, etc.
  • NPU is a neural network (NN) computing processor.
  • NN neural network
  • Intelligent cognitive applications of the electronic device 100 can be implemented through the NPU, such as image recognition, face recognition, speech recognition, text understanding, etc.
  • the external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100.
  • the external memory card communicates with the processor 110 through the external memory interface 120 to implement the data storage function. Such as saving music, videos, etc. files in external memory card.
  • Internal memory 121 may be used to store computer executable program code, which includes instructions.
  • the processor 110 executes instructions stored in the internal memory 121 to execute various functional applications and data processing of the electronic device 100 .
  • the internal memory 121 may include a program storage area and a data storage area. Among them, the stored program area can store an operating system, at least one application program required for a function (such as a sound playback function, an image playback function, etc.).
  • the storage data area may store data created during use of the electronic device 100 (such as audio data, phone book, etc.).
  • the internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (UFS), etc.
  • the electronic device 100 may implement audio functions through the speaker 160 and the microphone 170, as well as an application processor and the like. Such as music playback, recording, etc.
  • Speaker 160 also called a “speaker” is used to convert audio electrical signals into sound signals.
  • Electronic device 100 can listen to music through speaker 160, or listen to hands-free calls.
  • Microphone 170 also called “microphone” or “microphone” is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak close to the microphone 170 through the human mouth and input the sound signal to the microphone 170 .
  • the electronic device 100 may be provided with at least one microphone 170. In other embodiments, the electronic device 100 may be provided with two microphones 170, which in addition to collecting sound signals, may also implement a noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170 to collect sound signals, reduce noise, identify sound sources, and implement directional recording functions, etc.
  • Pressure sensors are used to sense pressure signals and convert pressure signals into electrical signals.
  • the pressure sensor may be disposed on the display screen 140 .
  • pressure sensors such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc.
  • a capacitive pressure sensor may include at least two parallel plates of conductive material. When a force acts on a pressure sensor, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure based on the change in capacitance. When a touch operation is performed on the display screen 140, the electronic device 100 detects the strength of the touch operation according to the pressure sensor. The electronic device 100 may also calculate the touched position based on the detection signal of the pressure sensor.
  • touch operations acting on the same touch location but with different touch operation intensities may correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold is applied to the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold is applied to the short message application icon, an instruction to create a new short message is executed.
  • the pressure sensor may be disposed on the casing of the electronic device 100 or on a side of the electronic device 100 close to the casing, so that the user's tapping operation or touch operation on the casing of the electronic device 100 can be sensed.
  • the gyro sensor can be used to determine the motion posture of the electronic device 100 .
  • the angular velocity of electronic device 100 about three axes may be determined by a gyroscope sensor.
  • the gyro sensor can be used for image stabilization. For example, when the shutter is pressed, the gyro sensor detects the angle at which the electronic device 100 shakes, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shake of the electronic device 100 through reverse movement to achieve anti-shake.
  • Gyroscope sensors can also be used for navigation and somatosensory gaming scenarios.
  • Magnetic sensors include Hall sensors.
  • the electronic device 100 may utilize a magnetic sensor to detect opening and closing of the flip holster.
  • the electronic device 100 may detect opening and closing of the flip based on a magnetic sensor. Then, based on the detected opening and closing status of the leather case or the opening and closing status of the flip cover, features such as automatic unlocking of the flip cover are set.
  • the acceleration sensor can detect the acceleration of the electronic device 100 in various directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device 100 and be used in horizontal and vertical screen switching, pedometer and other applications.
  • Distance sensor for measuring distance.
  • Electronic device 100 can measure distance via infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 may use a distance sensor to measure distance to achieve fast focusing.
  • Proximity light sensors may include, for example, light emitting diodes (LEDs) and light detectors, such as photodiodes.
  • the light emitting diode may be an infrared light emitting diode.
  • the electronic device 100 emits infrared light outwardly through the light emitting diode.
  • Electronic device 100 uses photodiodes to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100 . When insufficient reflected light is detected, the electronic device 100 may determine that there is no object near the electronic device 100 .
  • the electronic device 100 can use a proximity light sensor to detect when the user holds the electronic device 100 close to the ear for talking, so as to automatically turn off the screen to save power.
  • the proximity light sensor can also be used in holster mode, and pocket mode automatically unlocks and locks the screen.
  • the ambient light sensor is used to sense ambient light brightness.
  • the electronic device 100 can adaptively adjust the brightness of the display screen 140 according to the perceived ambient light brightness.
  • the ambient light sensor can also be used to automatically adjust white balance when taking photos.
  • the ambient light sensor can also cooperate with the proximity light sensor to detect whether the electronic device 100 is in the pocket to prevent accidental touching.
  • the fingerprint sensor is used to collect fingerprints.
  • the electronic device 100 can use the collected fingerprint characteristics to achieve fingerprint unlocking, access to application locks, fingerprint photography, fingerprint answering of incoming calls, etc.
  • Touch sensor also called “touch panel”.
  • the touch sensor can be disposed on the display screen 140, and the touch sensor and the display screen 140 form a touch screen, which is also called a "touch screen”. Touch sensors are used to detect touches on or near them.
  • the touch sensor can pass the detected touch operation to the application processor to determine the touch event type. Visual output related to the touch operation may be provided through the display screen 140 .
  • the touch sensor may also be disposed on the surface of the electronic device 100 at a location different from that of the display screen 140 .
  • the buttons 190 include a power button, a volume button, etc.
  • Key 190 may be a mechanical key. It can also be a touch button.
  • the electronic device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100 .
  • the motor 191 can generate vibration prompts.
  • the motor 191 can be used for vibration prompts for incoming calls and can also be used for touch vibration feedback.
  • touch operations for different applications can correspond to different vibration feedback effects.
  • the motor 191 can also respond to different vibration feedback effects for touch operations in different areas of the display screen 140 .
  • Different application scenarios such as time reminders, receiving information, alarm clocks, games, etc.
  • the touch vibration feedback effect can also be customized.
  • the indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, or may be used to indicate messages, missed calls, notifications, etc.
  • the SIM card interface 195 is used to connect a SIM card.
  • the SIM card can be connected to or separated from the electronic device 100 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195 .
  • the electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1.
  • SIM card interface 195 can support Nano SIM card, Micro SIM card, SIM card, etc. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the plurality of cards may be the same or different.
  • the SIM card interface 195 is also compatible with different types of SIM cards.
  • the SIM card interface 195 is also compatible with external memory cards.
  • the electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications.
  • the electronic device 100 uses an eSIM, that is, an embedded SIM card.
  • the eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100 .
  • the software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture.
  • the embodiment of this application takes the Android system with a layered architecture as an example to illustrate the software structure of the electronic device 100 .
  • FIG. 2 is a software structure block diagram of the electronic device 100 according to the embodiment of the present application.
  • the layered architecture divides the software into several layers, and each layer has clear roles and division of labor.
  • the layers communicate through software interfaces.
  • the Android system is divided into four layers, with applications from top to bottom. layer, application framework layer, Android runtime and system libraries, and kernel layer.
  • the application layer can include a series of application packages.
  • the application package can include camera, gallery, calendar, calling, map, navigation, WLAN, Bluetooth, music, payment, electronic code and other applications.
  • the application framework layer provides an application programming interface (API) and programming framework for applications in the application layer.
  • API application programming interface
  • the application framework layer includes some predefined functions.
  • the application framework layer can include a window manager, content provider, view system, phone manager, resource manager, notification manager, etc.
  • a window manager is used to manage window programs.
  • the window manager can obtain the display size, determine whether there is a status bar, lock the screen, capture the screen, etc.
  • Content providers are used to store and retrieve data and make this data accessible to applications.
  • Said data can include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
  • the view system includes visual controls, such as controls that display text, controls that display pictures, etc.
  • a view system can be used to build applications.
  • the display interface can be composed of one or more views.
  • a display interface including a text message notification icon may include a view for displaying text and a view for displaying pictures.
  • the phone manager is used to provide communication functions of the electronic device 100 .
  • call status management including connected, hung up, etc.
  • the resource manager provides various resources to applications, such as localized strings, icons, pictures, layout files, video files, etc.
  • the notification manager allows applications to display notification information in the status bar, which can be used to convey notification-type messages and can automatically disappear after a short stay without user interaction.
  • the notification manager is used to notify download completion, message reminders, etc.
  • the notification manager can also be notifications that appear in the status bar at the top of the system in the form of charts or scroll bar text, such as notifications for applications running in the background, or notifications that appear on the screen in the form of conversation windows. For example, text information is prompted in the status bar, a beep sounds, the electronic device vibrates, the indicator light flashes, etc.
  • Android runtime includes core libraries and virtual machines.
  • the android runtime is responsible for the scheduling and management of the Android system.
  • the core library contains two parts: one is the functional functions that need to be called by the Java language, and the other is the core library of Android.
  • the application layer and application framework layer run in virtual machines.
  • the virtual machine executes the java files of the application layer and application framework layer into binary files.
  • the virtual machine is used to perform object life cycle management, stack management, thread management, security and exception management, and garbage collection and other functions.
  • System libraries can include multiple functional modules. For example: surface manager (surface manager), media libraries (Media Libraries), 3D graphics processing libraries (for example: openGL ES), 2D graphics engines (for example: SGL), etc.
  • the surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications.
  • the media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc.
  • the media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
  • the kernel layer is the layer between hardware and software.
  • the kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
  • the following exemplifies the workflow of the software and hardware of the electronic device 100 in conjunction with capturing the photographing scene.
  • the corresponding hardware interrupt is sent to the kernel layer.
  • the kernel layer processes touch operations into raw input events (including touch coordinates, timestamps of touch operations, and other information). Raw input events are stored at the kernel level.
  • the application framework layer obtains the original input event from the kernel layer and identifies the control corresponding to the input event. Taking the touch operation as a touch click operation and the control corresponding to the click operation as a camera application icon control as an example, the camera application calls the interface of the application framework layer to start the camera application, and then starts the camera driver by calling the kernel layer. Camera 130 captures still images or video.
  • the method for identifying graphic codes provided in this application can be implemented by an application program in the application program (including a third-party application program or a system application program), or can be implemented by an application program in the application framework layer or system library. System service implementation.
  • the developer of the application needs to set up a "scan” function in the application, and explain to the user the application, the "scan” function, and the role of the "scan” function in the application.
  • the specific location allows the user to know which graphic codes are recognized through the application.
  • the user can find the "scan” function from which location in the application, and then use the "scan” function.
  • Function identifies the graphic code.
  • the user can add a shortcut of the "Scan” function of the application to the desktop of the electronic device, thereby eliminating the need for the user to open the application and find the "Scan” function in the application.
  • the user still needs to confirm that the graphic code to be recognized is the graphic code corresponding to the application, and then use the shortcut to turn on the "scan" function to identify the graphic code.
  • the user needs to manually select the corresponding application according to the graphic code to be recognized, and then select the corresponding recognition function from the application to recognize the graphic code.
  • the operation is cumbersome and the efficiency of identifying graphic codes is low; on the other hand, users need to be familiar with graphic codes and related applications, and the developers of the application also need to specifically lay out and guide the function of identifying graphic codes, which improves Identify the cost of graphic codes.
  • the graphic code may include at least one of a barcode (or one-dimensional code) and a two-dimensional code.
  • Barcodes include black and white bars of varying widths arranged according to certain coding rules to express a set of information.
  • a QR code expresses a set of information by arranging specific geometric figures in a two-dimensional direction according to specific rules.
  • the specific display state may include the electronic device displaying a specific interface.
  • the specific interface may include at least one of a main interface, a negative one-screen interface, and a slide-down notification interface.
  • the specific interface may be an interface that includes an icon, shortcut, or widget for a graphical code scanning function.
  • the specific display state may include a bright screen state.
  • a specific state may include a specific device gesture.
  • the electronic device may obtain the second image through the second camera when it is determined that the electronic device is in a specific device posture.
  • the specific status may include a specific display status and/or a specific device gesture.
  • the electronic device may acquire the second image through the second camera when it is determined that the electronic device is in a specific display state and in a specific device posture.
  • the electronic device may obtain the second image through the second camera when the electronic device is in an upright state and displays the main interface, the negative one-screen interface, or the slide-down notification interface.
  • the specific status can be set by the user or related technology developers. And it can be understood that in practical applications, a specific state may also include more states. In some embodiments, the specific state may be learned by the electronic device by learning the user's behavior of actively recognizing the graphic code multiple times.
  • the second camera includes a second shooting mode, then the electronic device can acquire the second image through the second camera in the second shooting mode.
  • the second shooting mode may be the aforementioned shooting mode B, that is, the high power consumption mode or the high resolution mode.
  • the second camera can also be other cameras, and the electronic device can also obtain the second image in other shooting modes through the second camera.
  • the electronic device determines that it is not in a specific state, it can detect whether it is in the specific state again after a second period of time.
  • the second duration can be obtained by setting in advance.
  • the embodiments of the present application do not limit the manner of setting the second duration and the size of the second duration.
  • the second camera when the second image is acquired through the second camera, the second camera may be in the on state, and other cameras such as the first camera may be in the off state.
  • the second graphic code may be a graphic code supported by a system of the electronic device.
  • the electronic device can initially determine whether the acquired second image includes the second graphic code, ensuring that the second image can be further processed later, and can reduce or avoid subsequent processing operations on other images that do not include the second graphic code, thereby Reduce the power consumption of electronic equipment.
  • the barcode includes quiet zones on both sides, start characters, data characters, check characters (optional) and stop characters.
  • the start character can be used to indicate the beginning of the bar code, and the stop character can be used to indicate the end of the bar code.
  • the start character The character and terminator characters are structured asymmetrically to determine the orientation of the barcode.
  • the QR code includes a locator and code information, where the locator can be used to indicate the direction of the QR code. Therefore, the electronic device can identify the second graphic code included in the second image based on the coding features in the second image. Specifically, if the second image includes coding features corresponding to the second graphic code, the electronic device can determine The second image includes a second graphic code.
  • the electronic device can identify the second graphic code included in the second image based on the scene features included in the second image. Specifically, if the second image includes scene features corresponding to the second graphic code, then The electronic device may determine that the second graphic code is included in the second image.
  • the scene feature can be a feature in the second image other than the second graphic code that can be used to identify the second graphic code.
  • the scene feature can be used to indicate the place where the second graphic code is located and the second graphic code corresponding to the second graphic code. At least one of the features such as the function and the application corresponding to the second graphic code. For example, if the second image includes "Please scan the QR code to make payment", then the electronic device can determine that the second image includes the QR code.
  • the second image includes "Please scan the payment code to pay", then the electronic device can determine that the second image includes a barcode or QR code.
  • the second image includes equipment and facilities related to the second graphic code, then the electronic device can determine that the second image includes the second graphic code.
  • the electronic device can identify the second graphic code included in the second image based on the encoding features and scene features included in the second image. Specifically, if the second image includes an encoding corresponding to the second graphic code, code characteristics and scene characteristics, the electronic device can determine that the second image includes the second graphic code.
  • the electronic device may obtain and store the encoding features and/or scene features corresponding to the second graphic code in advance.
  • the electronic device may acquire multiple images including the second image code, and acquire encoding features and/or scene features corresponding to the second image code from the multiple images.
  • the second image obtained by the electronic device may be image A 400 as shown in Figure 4, and the second graphic code is a two-dimensional code.
  • the second image includes the locator 401 of the QR code, and the center position of the QR code also includes the icon 402 of the quick payment application.
  • the introduction information 403 of "Please use [Quick Payment] application to pay” is also included below the QR code, where "[Quick Payment]" is the name of the application corresponding to the QR code.
  • the second image also includes a checkout counter 404 . Based on the locator 401, the electronic device can determine that the second image includes the second graphic code 405, and the second graphic code 405 is a two-dimensional code.
  • the electronic device determines that the second image includes the second graphic code 405 for payment based on the icon 402 of the quick payment application, the QR code introduction information 403 and the cashier 404.
  • the electronic device determines that the second image includes the second graphic code 405 for payment based on the locator 401, the icon 402 of the quick payment application, the QR code introduction information 403, and the cashier 404.
  • the electronic device can input the acquired second image into the first machine learning model to obtain a recognition result output by the first machine learning model.
  • the recognition result can be used to indicate that the second image includes the second graphic. code or does not include the second graphic code.
  • the first machine learning model may be used to identify whether the second graphic code is included in the image.
  • the first machine learning model can be trained in advance through a first sample set.
  • the first sample set includes a plurality of samples, and each sample includes an image and an annotation.
  • the annotation can be used to indicate whether the image actually includes the second graphic code.
  • the first sample set can be obtained in advance by the electronic device and the first machine learning model can be obtained by training based on the first sample set, or the first sample set can be obtained in advance by other devices and the first machine learning model can be obtained based on the first sample set.
  • the first machine learning model is obtained through collective training, and the electronic device can directly obtain the trained first machine learning model.
  • the electronic device can also determine whether the acquired second image includes the second graphic code through other methods.
  • the electronic device when the electronic device detects other images that do not include the second graphic code, it can detect again whether the electronic device is in a specific state, so as to obtain a new second image when it is in the specific state again.
  • the electronic device determines the first code information carried by the second graphic code and the first application corresponding to the second graphic code.
  • the first code information carried by the second graphic code and the corresponding first application can be further determined.
  • the first application may be an application capable of processing the first code information carried by the second graphic code.
  • the electronic device can parse the second graphic code, obtain the first code information carried by the second graphic code, and determine the first application corresponding to the second graphic code based on the first code information.
  • the information type of the first code information carried by the second graphic code may include a uniform resource locator (URL).
  • the first code information may include the identity information of the first application.
  • the first code information is "http://www.kzhifu.com/XX/X", where "kzhifu" can indicate that the first application is a quick payment application.
  • the information type of the first code information may also include other types such as text and business cards.
  • the electronic device can obtain the information from the first code information.
  • the identity information of the first application is obtained from the information, thereby determining the first application.
  • the electronic device can determine the first application from the correspondence between the code information and the application.
  • the correspondence between code information and applications may include multiple URL types of code information and applications corresponding to each code information.
  • the electronic device can obtain code information of multiple URL types and applications corresponding to each code information in advance, and store the code information of multiple URL types and applications corresponding to each code information into code information and applications. correspondence between them.
  • the electronic device may determine the first application based on the information type of the first code information and from the correspondence between the information type and the application.
  • the correspondence between information types and applications may include multiple information types and applications corresponding to each information type.
  • the first code information is "http://ABC.com/XX/10" and the information type is URL.
  • the electronic device cannot determine the first application based on the first code information. Therefore, the electronic device can determine the first application based on the information type URL. From the above In the correspondence between information types and applications shown in Table 1, the first application is determined to be a browser.
  • the information type of the first code information is a business card
  • the electronic device can determine the first application as the contact person based on the business card and from the correspondence between the information type and the application shown in Table 1 above.
  • the electronic device can obtain multiple information types and applications corresponding to the information types in advance, and store the multiple information types and applications corresponding to each information type, and store the correspondence between the information types and the applications.
  • the electronic device may determine the first application corresponding to the second graphic code based on the scene characteristics corresponding to the second graphic code in the second image.
  • the second image acquired by the electronic device may be image A 400 as shown in Figure 4.
  • the electronic device may determine the first application as the quick payment application based on the icon 402 of the quick payment application, the QR code introduction information 403 and the cashier 404.
  • the electronic device may obtain the first application corresponding to the second graphic code from the corresponding relationship between the scene characteristics and the application based on the scene feature corresponding to the second graphic code.
  • the correspondence between scene features and applications may include multiple scene features and applications corresponding to each scene feature.
  • the multiple scene features include scene features corresponding to the second graphic code, and the multiple applications include the first application.
  • the electronic device can acquire multiple images in advance, each image including the graphic code corresponding to the application and the corresponding scene features. For each image, the electronic device acquires the scene features included in the image, and adds the scene features to the image. Scene characteristics and the correspondence between the scene characteristics and the application stored in the application.
  • the electronic device sends the first prompt information, and the first prompt information is used to prompt that the second graphic code is detected.
  • the electronic device recognizes the graphic code in advance without disturbing the user.
  • the user can be prompted by sending a first prompt message that the second graphic code has been detected, and then the user can judge whether the electronic device has executed it in advance. Identifying whether the behavior is valid ensures the safety of electronic devices.
  • the electronic device can send out the first prompt information through at least one method such as vibration, sound, graphics and text.
  • the first prompt information may include at least one of a first behavior identifier, a second graphic code, an identifier of the first application, a second image, and first text information.
  • the first behavior identifier may be a preset graphic or a graphic similar in appearance to or corresponding to the second graphic code.
  • the electronic device when the electronic device displays the main interface 500, it obtains the image A 400 and recognizes the second graphic code 405 from the image A 400.
  • the electronic device can display the first prompt information as shown in Figures 5 to 9.
  • the first prompt information includes a first behavior identifier 501 , which is a graphic similar in appearance to the second graphic code 405 , thereby more intuitively reminding the user to recognize the second graphic code 405 .
  • the first prompt information includes a second graphic code 405 .
  • the first prompt information includes image A 400.
  • the first prompt information includes first text information 800, and the first text information 800 includes: "QR code has been detected.”
  • the first prompt information includes the identity information 900 of the first application, and the identity information 900 of the first application includes the icon and name of the first application.
  • the electronic device displays a display interface corresponding to the first code information through the first application.
  • the confirmation operation may be a user-triggered operation, and the confirmation operation may be used to confirm that the behavior of identifying the second graphic code is valid.
  • the confirmation operation may include a tapping operation on a certain surface of the electronic device (such as the back or display screen).
  • the confirmation operation may include a key operation on a specific key (including a physical key or a virtual key).
  • the confirmation operation can also be other types of operations.
  • the operation type of the confirmation operation can be set in advance by the user or relevant technical personnel. The method of setting the confirmation operation and the type of the confirmation operation are not limited in the embodiments of this application.
  • the electronic device can load the URL through the quick payment application, thereby opening the payment interface.
  • the first application may be a contact application. If the contact indicated by the business card has been stored in the contact application, the electronic device can open the contact details interface corresponding to the business card. If the contact indicated by the business card is not stored in the contact application, the electronic device can open a new contact interface and add the contact indicated by the business card to the new contact interface.
  • the electronic device can display the first code information through the browser.
  • the electronic device if it receives the confirmation operation within the preset first period of time, it can The first application displays a display interface corresponding to the first code information; if no confirmation operation is received within the first period of time, the display interface corresponding to the first code information may not be displayed through the first application, and the electronic device may be detected again. Is it in a specific state.
  • the first duration may be set by the user or relevant technical personnel. The embodiments of the present application do not limit the manner in which the electronic device determines the first duration and the specific size of the first duration.
  • the electronic device can provide the first code information to the first application before S305, and the first application generates a corresponding virtual interface based on the first code information in advance. Then in S305, when the electronic device receives During the user's confirmation operation, the electronic device can directly load and display the cached virtual interface through the first application, thereby reducing the delay in responding to the user's confirmation operation.
  • the second graphic code or the second image may also be provided to the first application, and the first code information may be obtained from the second graphic code or the second image through the first application. A corresponding display interface is generated based on the first code information.
  • the electronic device can detect whether the electronic device is still in the specific state. If so, it can perform the acquisition of a new second image again and identify the graphic codes that may be included in it. If the electronic device has exited the In certain states, such as the screen is locked or the screen is off, you can turn off the camera.
  • the electronic device can obtain the second image through the second camera when it is in a specific state, identify the first code information carried by the second graphic code and the first application from the second image, and then provide the user with The first prompt message is issued so that the user perceives that the second graphic code is recognized.
  • a display interface corresponding to the first code information may be displayed based on the first application. Since the user does not need to search for the first application or search for the graphic code recognition function from the first application, the efficiency of identifying graphic codes is greatly improved. At the same time, developers of the first application do not need to specifically focus on identifying graphic codes. The function performs software layout and user guidance, reducing the cost of identifying graphic codes.
  • FIG. 10 is a flow chart of a method for identifying graphic codes provided by an embodiment of the present application.
  • the electronic device first determines that the second image includes the graphic code and the application corresponding to the graphic code.
  • the application is then used to determine the code information carried by the graphic code. It should be noted that this method is not limited to the specific sequence shown in Figure 10 and below. It should be understood that in other embodiments, the order of some steps of the method can be exchanged with each other according to actual needs, or some of the steps can be It can also be omitted or deleted.
  • the method includes the following steps:
  • the second camera when the second image is acquired through the second camera, the second camera may be in the on state, and other cameras such as the first camera may be in the off state.
  • the electronic device determines that the second image includes a second graphic code and a first application corresponding to the second graphic code.
  • the electronic device determines that the second image includes the second graphic code supported by the system, it also determines that the second graphic code corresponds to the first application.
  • the electronic device may determine that the second image includes the second graphic code when determining that the second image includes encoding features corresponding to the second graphic code and scene features corresponding to the second graphic code.
  • the electronic device may also determine the first application corresponding to the second graphic code based on the scene characteristics corresponding to the second graphic code in the second image.
  • the electronic device may input the acquired second image into the first machine learning model, from The recognition result output by the first machine learning model is obtained.
  • the recognition result can be used to indicate that the second image includes the second graphic code and the corresponding first application does not include the second graphic code, and when the second image includes the second graphic code code, the recognition result can also be used to indicate the first application corresponding to the second graphic code.
  • the electronic device determines the first code information carried by the second graphic code based on the second image.
  • the electronic device determines the second graphic code and the first application corresponding to the second graphic code, it can further determine the first code information carried by the second graphic code.
  • the electronic device may input the second graphic code or the second image to the first application, and obtain the first value carried by the second graphic code from the second graphic code or the second image through the first application. code information.
  • the electronic device sends first prompt information, and the first prompt information is used to prompt that the second graphic code is detected.
  • the electronic device displays a display interface corresponding to the first code information through the first application.
  • FIG. 11 is a flow chart of a method for identifying graphic codes provided by an embodiment of the present application.
  • the embodiment of the present application is a specific description of the method shown in Figure 3.
  • the electronic device recognizes the graphic code in the image obtained through the low-resolution camera, it then obtains an image with higher image quality through the high-resolution camera. Perform analysis. It should be noted that this method is not limited to the specific order described in Figure 11 and below. It should be understood that in other embodiments, the order of some steps of the method can be exchanged with each other according to actual needs, or some of the steps can be It can also be omitted or deleted.
  • the method includes the following steps:
  • the first camera may be the aforementioned camera A, that is, a low-power camera or a low-resolution camera.
  • the first camera when the first image is acquired through the first camera, the first camera may be in an on state, and other cameras such as the second camera may be in a off state.
  • the electronic device determines that the first image includes the first graphic code
  • the electronic device acquires the second image through the second camera.
  • the first camera may be the aforementioned camera B, that is, a high-power camera or a high-resolution camera.
  • the electronic device acquires the second image through the second camera when determining that the first image acquired through the first camera includes the first graphic code
  • the time interval between acquiring the second image and the first image is very small, for example, it can be Millisecond level or even microsecond level. Therefore, the image content included in the second image and the image content included in the first image may be the same or similar, and the image quality of the first image may be higher than the image quality of the second image.
  • the first graphic The code and the second graphic code may be the same or similar, and the image quality of the second graphic code is higher than the image quality of the first graphic code.
  • the resolution of the second image may be higher than the resolution of the first image, and the resolution of the second graphic code may be higher than the resolution of the first graphic code.
  • the way in which the electronic device performs S1102 to acquire the second image through the second camera can refer to the relevant description in S301.
  • the way in which the electronic device determines that the first image includes the first graphic code can be the same as the way in which the electronic device determines that the first image includes the first graphic code in S302.
  • the second graphic code is included in the same manner.
  • the second camera when the second image is acquired through the second camera, the second camera may be turned on status, the first camera and other cameras can be turned off.
  • the electronic device determines the first code information carried by the second graphic code and the first application corresponding to the second graphic code.
  • the electronic device sends the first prompt information, and the first prompt information is used to prompt that the second graphic code is detected.
  • the first prompt information may include at least one of a first behavior identifier, a second graphic code, an identifier of a first application, a second image, first text information, a first image, and a first graphic code.
  • the electronic device displays a display interface corresponding to the first code information through the first application.
  • the electronic device when the electronic device is in a specific state, it can first acquire the first image through the low-resolution camera, and then acquire the second image through the high-resolution camera when the first image includes the second graphic code. , further identifying the second graphic code through the second image, thereby reducing the power consumption of the electronic device.
  • Electronic devices can switch between low-power cameras and high-power cameras to obtain the first image under low power consumption and the second image under high power consumption, reducing the need for single camera performance.
  • the electronic device may perform S1101. In S1102, when the electronic device determines that the first image includes a second graphic code and a first application corresponding to the second graphic code When the electronic device acquires the second image through the second camera, in S1103, the first code information carried by the second graphic code is determined based on the second image, and then S1104 and S1105 are executed.
  • FIG. 12 is a flow chart of a method for identifying graphic codes provided by an embodiment of the present application.
  • the embodiment of the present application is a specific description of the method shown in Figure 3.
  • the electronic device recognizes the graphic code in the image obtained through the low-resolution mode, it then obtains an image with higher image quality through the high-resolution mode for analysis. .
  • this method is not limited to the specific order described in Figure 12 and below. It should be understood that in other embodiments, the order of some steps of the method can be exchanged with each other according to actual needs, or some of the steps can be It can also be omitted or deleted.
  • the method includes the following steps:
  • the first shooting mode may be the aforementioned shooting mode A, that is, a low resolution mode or a low power consumption mode.
  • the second camera when the first image is acquired through the second camera, the second camera may be in the on state, and other cameras such as the first camera may be in the off state.
  • the electronic device determines that the first image includes the first graphic code
  • the electronic device acquires the second image through the second camera in the second shooting mode.
  • the way in which the electronic device determines that the first image includes the first graphic code in S1202 may be the same as the way in which the second image includes the second graphic code in S302.
  • the second shooting mode may be the aforementioned shooting mode B, that is, high resolution mode or high power mode.
  • the image quality of the first image may be higher than the image quality of the second image, and the image content included in the second image may be the same or similar to the image content included in the first image.
  • the second camera when the second image is acquired through the second camera, the second camera may be in the on state, and other cameras such as the first camera may be in the off state.
  • the electronic device determines the first code information carried by the second graphic code and the first application corresponding to the second graphic code based on the second image.
  • the electronic device sends first prompt information, and the first prompt information is used to prompt that the second graphic code is detected.
  • the first prompt information may include at least one of a first behavior identifier, a second graphic code, an identifier of a first application, a second image, first text information, a first image, and a first graphic code.
  • the electronic device displays a display interface corresponding to the first code information through the first application.
  • the electronic device when the electronic device is in a specific state, it can first acquire the first image in the low-resolution mode through the second camera, and then acquire the first image in the high-resolution mode when the first image includes the second graphic code.
  • the second image is acquired, and the second graphic code is further identified through the second image, thereby further reducing the power consumption of the electronic device.
  • the electronic device can obtain the first image under low power consumption and the second image under high power consumption by switching the low-resolution mode and the high-resolution mode of the same camera, reducing the need for cameras included in the electronic device. quantity requirements.
  • the electronic device may perform S1101. In S1102, when the electronic device determines that the first image includes a second graphic code and a first application corresponding to the second graphic code When the electronic device acquires the second image through the second camera, in S1103, the first code information carried by the second graphic code is determined based on the second image, and then S1104 and S1105 are executed.
  • FIG. 13 is a flow chart of a method for identifying graphic codes provided by an embodiment of the present application.
  • this embodiment is another implementation of the method shown in Figure 10.
  • the graphic code and the application corresponding to the graphic code are recognized in the image acquired by the electronic device, and the user confirms that the behavior of identifying the graphic code is valid, pull up This application, through which the graphics code is further parsed.
  • this method is not limited to the specific order described in Figure 13 and below. It should be understood that in other embodiments, the order of some steps of the method can be exchanged with each other according to actual needs, or some of the steps can be It can also be omitted or deleted.
  • the method includes the following steps:
  • the second camera in order to reduce power consumption, can be a low-power camera or a low-resolution camera; or the second camera can be any camera, and the electronic device can obtain the second camera in the first shooting mode through the second camera. Two images.
  • the second camera when the second image is acquired through the second camera, the second camera may be in the on state, and other cameras such as the first camera may be in the off state.
  • the electronic device determines that the second image includes a second graphic code and a first application corresponding to the second graphic code.
  • the electronic device sends the first prompt information, and the first prompt information is used to prompt that the second graphic code is detected.
  • the electronic device can launch the first application and scan the second graphic code through a graphic code recognition function such as "scan" in the first application, thereby obtaining the first code information carried by the second graphic code.
  • a graphic code recognition function such as "scan" in the first application
  • the electronic device when the electronic device scans the second graphic code through the first application, the electronic device can call the first camera to scan the second graphic code through the first application, or call the second camera to scan the second graphic code in the first shooting mode. Scan the second graphic code.
  • the electronic device displays a display interface corresponding to the first code information through the first application.
  • the electronic device when the electronic device performs preliminary recognition on the second image, if the second image includes the second graphic code, it can also determine the first application, and then directly scan the second graphic code through the first application, thereby improving The efficiency of launching the first application and the accuracy of identifying the second graphic code are improved.
  • FIG. 14 is a flow chart of a method for identifying graphic codes provided by an embodiment of the present application.
  • this embodiment is another implementation of the method shown in Figure 10.
  • the electronic device recognizes the graphic code and multiple applications corresponding to the graphic code from the acquired image, and the user confirms that the behavior of identifying the graphic code is valid. , receives the application selected by the user, and then further parses the graphic code through the application selected by the user.
  • this method is not limited to the specific order described in Figure 14 and below. It should be understood that in other embodiments, the order of some steps of the method can be exchanged with each other according to actual needs, or some of the steps can be It can also be omitted or deleted.
  • the method includes the following steps:
  • the second camera in order to reduce power consumption, can be a low-power camera or a low-resolution camera; or the second camera can be any camera, and the electronic device can obtain the second camera in the first shooting mode through the second camera. Two images.
  • the second camera when the second image is acquired through the second camera, the second camera may be in the on state, and other cameras such as the first camera may be in the off state.
  • S1402 The electronic device determines that the second image includes a second graphic code and multiple applications corresponding to the second graphic code.
  • the electronic device sends the first prompt information, and the first prompt information is used to prompt that the second graphic code is detected.
  • the electronic device determines the first application among multiple applications.
  • the electronic device may also determine the first application among multiple applications according to a preset strategy. In some embodiments, the electronic device may determine the application that is most frequently used by the user among the multiple applications as the first application. In some embodiments, the electronic device may determine the application last used by the user among the plurality of applications as the first application. In some embodiments, the electronic device may determine the application with the highest security among the multiple applications as the first application.
  • the electronic device may display third prompt information, and the third prompt information is used to prompt the user to determine the first application among multiple applications.
  • the electronic device may determine the application selected by the user among the plurality of applications as the first application.
  • the third prompt information may include application identifiers of multiple applications. In some embodiments, The third prompt information may also include more information for prompting the user to select the first application, such as the second image, the second graphic code, the developer of each application, the source from which the electronic device obtains each application, and so on.
  • image A 400 shown in Figure 4 includes a second graphic code 405.
  • the electronic device determines that the application corresponding to the second graphic code 405 includes a quick payment application and a credit card application, so the third image shown in Figure 15 or 16 can be displayed. Prompt information.
  • the third prompt information includes the application identification 1501 corresponding to the quick payment application and the payment identification 1502 corresponding to application B.
  • the third prompt information also includes a second graphic code 405 .
  • the third prompt information also includes image A 400. The user can click on the application identifier 1501 corresponding to the quick payment application to determine the quick payment application as the first application, or the user can click on the application identifier 1502 corresponding to the credit card application to determine the credit card application as the first application.
  • the electronic device obtains the first code information carried by the second graphic code through the first application.
  • the electronic device can run the first application, thereby performing subsequent steps through the first application.
  • the electronic device obtains the first code information carried by the second graphic code from the second image through the first application.
  • the electronic device can obtain the first image through a high-resolution camera or high-resolution mode, and obtain the first code information carried by the second graphic code from the first image through the first application.
  • the electronic device can scan the second graphic code through a graphic code recognition function such as "scan" in the first application, thereby obtaining the first code information carried by the second graphic code.
  • a graphic code recognition function such as "scan" in the first application
  • the electronic device displays a display interface corresponding to the first code information through the first application.
  • the electronic device can determine the first application among the multiple applications, which improves the accuracy of determining the first application and further improves the accuracy of determining the first application through the first application.
  • the accuracy of identification of two graphic codes can be received from the electronic device.
  • FIG. 18 is a flow chart of a method for identifying graphic codes provided by an embodiment of the present application.
  • the method for identifying graphic codes provided by the embodiments of the present application will be described below by taking the second image that may include multiple graphic codes as an example. It should be noted that this method is not limited to the specific order described in Figure 18 and below. It should be understood that in other embodiments, the order of some steps of the method can be exchanged with each other according to actual needs, or some of the steps can be It can also be omitted or deleted.
  • the method includes the following steps:
  • the second camera when the second image is acquired through the second camera, the second camera may be in the on state, and other cameras such as the first camera may be in the off state.
  • the electronic device identifies the code information carried by each graphic code included in the second image and the application corresponding to each graphic code.
  • the second image may be image B 1900 as shown in FIG. 19 .
  • Image B 1900 includes QR code A 1901 and QR code B 1902.
  • the electronic device sends the first prompt information, and the first prompt information is used to prompt that multiple graphic codes are detected.
  • the electronic device may determine a graphic code located at a specific position in the second image among the plurality of graphic codes as the second graphic code.
  • the specific position may be the center position of the second image.
  • QR code A 1901 is in the center, then the electronic device can determine QR code A 1901 as the second graphic code.
  • the electronic device may display second prompt information, and the second prompt information may be used to prompt the user to determine the second graphic code among multiple graphic codes.
  • the electronic device receives a user's selection operation based on any one of the plurality of graphic codes, the graphic code selected by the user may be determined as the second graphic code.
  • the code information carried by the second graphic code is the first code information
  • the application corresponding to the second graphic code is the first application.
  • the second prompt information may include multiple graphic codes.
  • the second prompt information includes QR code A 1901 and QR code B 1902. The user can click QR code A 1901 to determine QR code A 1901 as the second graphic code, or click QR code B 1902 to determine QR code B 1902 as the second graphic code.
  • the second prompt information may include multiple graphic codes and application identifiers corresponding to each graphic code.
  • the second prompt information includes QR code A 1901 and QR code B 1902, and also includes an application identifier 1501 corresponding to QR code A 1901 and an application identifier 1904 corresponding to QR code B 1902.
  • the application corresponding to QR code A 1901 is a quick payment application
  • the application identification 1501 of the quick payment application includes the icon and name of the quick payment application
  • the application corresponding to QR code B 1902 is an electronic code application
  • the electronic code application Application identification 1904 includes the icon and name of the electronic code application.
  • the user can determine the QR code A 1901 as the second graphic code by clicking on the QR code A 1901 or the application identifier 1501 corresponding to the QR code A 1901. Or the user can click the QR code B 1902 or the application identifier 1904 corresponding to the QR code B 1902 to determine the QR code B 1902 as the second graphic code.
  • the second prompt information includes QR code A 1901 and QR code B 1902, and also includes the application identification 1501 of the quick payment application and the application identification 1502 of the credit card application corresponding to the QR code A 1901.
  • QR code B 1902 corresponds to the application identifier 1904, that is, QR code A 1901 corresponds to two applications.
  • the user can click the application identification 1501 of the quick payment application to determine the quick payment application as the first application and the QR code A 1901 as the second graphic code.
  • the user can click the application identification 1502 of the credit card application to determine the credit card application as the first application and the QR code A 1901 as the second graphic code.
  • the user can click the QR code B 1902 or the application identifier 1904 corresponding to the QR code B 1902 to determine the QR code B 1902 as the second graphic code.
  • the second prompt information may include a second image and a mark corresponding to each graphic code.
  • the second prompt information includes image B 1900, a mark 1905 corresponding to the QR code A 1901, and a mark 1906 corresponding to the QR code B 1902.
  • the user can click the mark 1905 corresponding to the QR code A 1901 to determine the QR code A 1901 as the second graphic code.
  • the user can click the mark 1906 corresponding to the QR code B 1902 to determine the QR code B 1902 as the second graphic code.
  • the second prompt information may include a second image, a mark corresponding to each graphic code, and The application icon corresponding to each graphic code.
  • the second prompt information includes image B 1900, a mark 1905 corresponding to QR code A 1901, a mark 1906 corresponding to QR code B 1902, and an application identification 1501 corresponding to QR code A 1901. and the application identifier 1904 corresponding to the QR code B 1902.
  • the user can determine the QR code A 1901 as the second graphic code by clicking the mark 1905 corresponding to the QR code A 1901 or the application identification 1501 corresponding to the QR code A 1901.
  • the user can click the mark 1906 corresponding to the QR code B 1902 or the application identification 1904 corresponding to the QR code B 1902 to determine the QR code B 1902 as the second graphic code.
  • the electronic device can also send the second prompt information in other ways, and the second prompt information can also include more or less information.
  • the electronic device displays a display interface corresponding to the first code information through the first application.
  • the electronic device can identify multiple graphic codes included in the second image and the applications corresponding to each graphic code, and determine the second graphic code and the first application therein, further improving the efficiency of identifying graphic codes. .
  • the electronic device can receive the user's determination of the second graphic code and the first application among multiple graphic codes and applications by displaying the second prompt information, thereby further improving the accuracy of the second graphic code and the first application.
  • FIG. 25 is a flow chart of a method for identifying graphic codes provided by an embodiment of the present application.
  • this application is a specific description of the method shown in Figure 3.
  • the electronic device can obtain the corresponding first code information based on the first code information in advance.
  • the data It should be noted that this method is not limited to the specific order described in Figure 25 and below. It should be understood that in other embodiments, the order of some steps of the method can be exchanged with each other according to actual needs, or some of the steps can be It can also be omitted or deleted.
  • the method includes the following steps:
  • the second camera when the second image is acquired through the second camera, the second camera may be in the on state, and other cameras such as the first camera may be in the off state.
  • S302 The electronic device determines that the second image includes the second graphic code.
  • the electronic device determines the first code information carried by the second graphic code and the first application corresponding to the second graphic code.
  • the information type of the first code information includes URL.
  • S306 The electronic device obtains data corresponding to the first code information from the server.
  • the electronic device can obtain data corresponding to the first code information from the server based on the first code information, so as to obtain the timing of data corresponding to the first code information in advance.
  • the electronic device may obtain data corresponding to the first code information from a server corresponding to the first application based on the first code information.
  • the electronic device sends the first prompt information, and the first prompt information is used to prompt that the second graphic code is detected.
  • the electronic device displays a display interface corresponding to the first code information through the first application.
  • the electronic device can load data corresponding to the first code information through the first application, thereby displaying a display interface corresponding to the first code information.
  • the electronic device has already obtained the data corresponding to the first code information before prompting the user. Therefore, when the electronic device receives the confirmation operation, it does not need to obtain the data again, but can quickly obtain the data based on The data has been obtained and the display interface is displayed, thereby improving the efficiency of displaying the display interface.
  • the electronic device can also obtain the data corresponding to the first code information from the server in advance at other opportunities after determining the first code information and before displaying the display interface corresponding to the first code information.
  • the electronic device can perform S1001-S1003 to determine the first code information carried by the second graphic code, and the information type of the first code information includes a URL.
  • the data corresponding to the first code information is obtained from the server in advance, and then S1004 and S1005 are executed, and the data is loaded through the first application in S1005 to display the display interface corresponding to the first code information.
  • FIG. 26 is a schematic diagram of a configuration interface for identifying graphic codes provided by an embodiment of the present application. The following will describe the method of configuring the identification pattern code provided by the embodiment of the present application in conjunction with the configuration interface, taking the realization of the identification pattern code through the system application as an example.
  • the user can find the smart code scanning option from the system settings of the electronic device.
  • the configuration interface includes a scenario diagram 2601 of smart code scanning and scenario description information 2602. Users can learn how to use the smart code scanning function and usage scenarios through the scenario diagram 2601 and scenario description information 2602.
  • the configuration interface includes a smart code scanning switch 2603.
  • the user can choose to enable or disable the smart code scanning function by clicking the smart code scanning switch 2603. For example, if the smart code scanning switch 2603 is currently on, it means that the smart code scanning function is turned on.
  • the configuration interface includes payment options 2604, which can be used to configure applications that are prioritized for payment.
  • the configuration interface also includes payment introduction information 2605 corresponding to the payment option 2604.
  • the payment introduction information 2605 includes "when the payment code is recognized, the default payment method will be used first for payment.” The user can determine through the payment introduction information 2605, and can set the priority application for payment through the payment option 2604. When the electronic device recognizes the payment code, it will give priority to the application (such as the currently displayed wallet application). Pay.
  • the electronic device may give priority to the application configured in payment option 2604 for payment.
  • graphic code A is a graphic code used for payment.
  • the electronic device recognizes that the applications corresponding to graphic code A include three applications: a quick payment application, a credit card application, and a wallet application.
  • the application configured in payment option 2604 is a wallet application. Therefore, the electronic device can load the code information carried by the graphic code A through the wallet application to enter the payment interface.
  • each graphic code corresponding to an application for payment may give priority to the application configured through payment option 2604 and the graphic code corresponding to the application. Make payment.
  • the electronic device recognizes graphic code B and graphic code C. Both graphic code B and graphic code C are graphic codes used for payment.
  • the application corresponding to graphic code B is a quick payment application
  • the application corresponding to graphic code C is Wallet application
  • the application configured in payment option 2604 is a wallet application. Therefore, the electronic device can load the code information carried by the graphic code C through the wallet application to enter the payment interface.
  • the configuration interface may also include more or fewer configuration options.
  • the configuration interface can also include trigger mode configuration items. User You can use this trigger mode configuration item to configure the specific status that triggers smart code scanning.
  • the configuration interface may also include options for configuring at least one correspondence, such as the correspondence between code information and applications, the correspondence between information types and applications, and the correspondence between scene features and applications.
  • FIG. 27 is a flow chart of a method for identifying graphic codes provided by an embodiment of the present application. It should be noted that this method is not limited to the specific order described in Figure 27 and below. It should be understood that in other embodiments, the order of some steps of the method can be exchanged with each other according to actual needs, or some of the steps can be It can also be omitted or deleted.
  • the method includes the following steps:
  • the first image with lower image quality can be obtained through the first camera with lower power consumption, and the first image includes the first graphic code.
  • the power consumption is high
  • a second image with higher image quality is obtained through the second camera
  • the first code information carried by the second graphic code and the first application are identified from the second image, and then the user is informed
  • the first prompt message is issued so that the user perceives that the second graphic code is recognized.
  • a display interface corresponding to the first code information may be displayed based on the first application. Since the user does not need to search for the first application or search for the graphic code recognition function from the first application, the efficiency of identifying graphic codes is greatly improved.
  • the function performs software layout and user guidance, reducing the cost of identifying graphic codes.
  • the first image with lower image quality is first obtained through the first camera when the power consumption is low, and when it is initially determined that the first image includes the first graphic code, the first image is obtained again when the power consumption is high. Acquiring a second image with higher image quality through the second camera can also reduce the power consumption of the electronic device for recognizing the graphic code.
  • embodiments of the present application also provide an electronic device, including: a memory and a processor.
  • the memory is used to store a computer program; the processor is used to execute the method described in the above method embodiment when the computer program is called.
  • the electronic device provided in this embodiment can execute the above method embodiments, and its implementation principles and technical effects are similar, and will not be described again here.
  • embodiments of the present application also provide a chip system.
  • the chip system includes a processor, the processor is coupled to a memory, and the processor executes a computer program stored in the memory to implement the method described in the above method embodiment.
  • the chip system may be a single chip or a chip module composed of multiple chips.
  • Embodiments of the present application also provide a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the method described in the above method embodiment is implemented.
  • An embodiment of the present application also provides a computer program product.
  • the computer program product When the computer program product is run on an electronic device, the electronic device implements the method described in the above method embodiment when executed.
  • the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium.
  • this application implements the above embodiments All or part of the process in the method can be completed by instructing relevant hardware through a computer program.
  • the computer program can be stored in a computer-readable storage medium. When executed by the processor, the computer program can realize the above-mentioned tasks. Steps of method embodiments.
  • the computer program includes computer program code, which may be in the form of source code, object code, executable file or some intermediate form.
  • the computer-readable storage medium may at least include: any entity or device capable of carrying computer program code to the camera device/terminal device, recording media, computer memory, read-only memory (ROM), random access Memory (random access memory, RAM), electrical carrier signals, telecommunications signals, and software distribution media.
  • ROM read-only memory
  • RAM random access Memory
  • electrical carrier signals telecommunications signals
  • software distribution media For example, U disk, mobile hard disk, magnetic disk or CD, etc.
  • the disclosed devices/devices and methods can be implemented in other ways.
  • the apparatus/equipment embodiments described above are only illustrative.
  • the division of modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or units. Components may be combined or may be integrated into another system, or some features may be ignored, or not implemented.
  • the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, indirect coupling or communication connection of devices or units, which may be in electrical, mechanical or other forms.
  • the term “if” may be interpreted as “when” or “once” or “in response to determining” or “in response to detecting” depending on the context. ". Similarly, the phrase “if determined” or “if [the described condition or event] is detected” may be interpreted, depending on the context, to mean “once determined” or “in response to a determination” or “once the [described condition or event] is detected ]” or “in response to detection of [the described condition or event]”.

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)
  • User Interface Of Digital Computer (AREA)

Abstract

本申请提供一种识别图形码的方法及电子设备,涉及终端技术领域,其中,该方法包括应用于电子设备,方法包括:当电子设备处于特定状态时,获取第一图像,当第一图像包括第一图形码时,获取第二图像,第二图像包括第二图形码,其中,获取第一图像所产生的功耗,小于获取第二图像所产生的功耗,第一图像的图像质量低于第二图像的图像质量,第一图形码的图像质量低于第二图形码的图像质量,确定第二图形码所承载的第一码信息以及第二图形码对应的第一应用,当接收到确认操作时,通过第一应用显示与第一码信息对应的显示界面。本申请提供的技术方案能够在较低功耗的情况下,提高识别图形码的效率,并降低识别图形码的成本。

Description

识别图形码的方法及电子设备
本申请要求于2022年06月07日提交国家知识产权局、申请号为202210639518.4、申请名称为“一种拍摄方法及终端”的中国专利申请和2022年09月05日提交国家知识产权局、申请号为202211080988.8、申请名称为“识别图形码的方法及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及终端技术领域,尤其涉及一种识别图形码的方法及电子设备。
背景技术
目前,识别图形码,即“扫码”,已经成为生活中一种常见的场景,极大地提高了信息的传播和互换的效率,具有非常重要的社会功能。例如,商户可以发布收款码,包括将印有收款码的纸张张贴在现实世界的任意位置或将收款码图像在任意电子的显示屏上进行显示,顾客通过另一电子设备扫码就可以向商户进行支付,实现跨时空交易。
现有技术中,电子设备包括多种不同的应用,每个应用可以识别一种图形码。用户先根据待识别的图形码,在电子设备上手动打开与该图形码对应的应用,通过该应用识别该图形码,使用起来体验感有限。
发明内容
有鉴于此,本申请提供一种识别图形码的方法及电子设备,能够在较低功耗的情况下,提高识别图形码的效率,并降低识别图形码的成本。
为了实现上述目的,第一方面,本申请实施例提供一种识别图形码的方法,应用于电子设备,所述方法包括:
当所述电子设备处于特定状态时,获取第一图像;
当所述第一图像包括第一图形码时,获取第二图像,所述第二图像包括第二图形码,其中,获取所述第一图像所产生的功耗,小于获取所述第二图像所产生的功耗,所述第一图像的图像质量低于所述第二图像的图像质量,所述第一图形码的图像质量低于所述第二图形码的图像质量;
确定所述第二图形码所承载的第一码信息以及所述第二图形码对应的第一应用;
当接收到确认操作时,通过所述第一应用显示与所述第一码信息对应的显示界面。
在本申请实施例中,电子设备可以在处于特定状态时,先在功耗较低的情况下通过第一摄像头获取图像质量较低的第一图像,并在第一图像包括第一图形码的情况下,在功耗较高的情况下通过第二摄像头获取图像质量较高的第二图像,从第二图像中识别第二图形码所承载的第一码信息以及第一应用,再向用户发出第一提示信息,使得用户感知到识别到第二图形码。在接收到用户的确认操作时,可以基于第一应用显示与第一码信息对应的显示界面。由于不需要用户查找第一应用,也不需要从第一应用 中查找图形码识别功能,因此极大地提高了识别图形码的效率,同时第一应用的开发人员也不要专门针对识别图形码这一功能进行软件布局和用户引导,降低了识别图形码的成本。且由于是先在功耗较低的情况下通过第一摄像头获取图像质量较低的第一图像,并在初步判断第一图像包括第一图形码的情况下,再次在功耗较高的情况下通过第二摄像头获取图像质量较高的第二图像,也能够减少电子设备识别图形码的功耗。
其中,由于电子设备是在确定通过第一摄像头获取的第一图像包括第一图形码时,通过第二摄像头获取第二图像,获取第二图像和第一图像之间的时间间隔很小,比如可以为毫秒级甚至是微秒级,因此,第二图像包括的图像内容和第一图像包括的图像内容可以相同或相似,且第一图像的图像质量可以高于第二图像的图像质量,第一图形码和第二图形码可以相同或相似,且第二图形码的图像质量高于第一图形码的图像质量。在一些实施例中,第二图像的分辨率可以高于第一图像的分辨率,第二图形码的分辨率可以高于第一图形码的分辨率。
在一些实施例中,特定状态可以是由用户或者相关技术人员事先设置的。在一些实施例中,可以是由电子设备通过对用户多次主动识别图形码的行为进行学习得到的。
可以理解是,电子设备可以同时确定第二图形码所承载的第一码信息以及第二图形码对应的第一应用,也可以先确定其中一个,再确定另一个。在一些实施例中,若电子设备先确定第二图形码对应的第一应用,则可以通过第一应用确定第二图形码所承载的第一码信息,从而提高确定第一码信息的准确性。在一些实施例中,若电子设备先确定第二图形码承载的第一码信息,则可以通过第一码信息确定第一应用,从而提高第一应用的准确性。
在一些实施例中,确认操作可以包括对电子设备某一表面(比如背面或显示屏)的敲击操作。在一些实施例中,确认操作可以包括对特定按键(包括实体按键或虚拟按键)的按键操作。
在一些实施例中,所述获取第一图像,包括:
通过第一摄像头,在第一拍摄模式下获取所述第一图像;
所述获取第二图像,包括:
通过所述第一摄像头,在第二拍摄模式下获取所述第一图像;
其中,所述第一拍摄模式为低分辨率模式,所述第二拍摄模式为高分辨率模式。
也即是,电子设备可以通过切换同一摄像头的低分辨率模式和高分辨模式,从而实现在低功耗情况下获取第一图像,在高功耗情况下获取第二图像,减少了对电子设备包括的摄像头数目的需求。
在一些实施例中,所述获取第一图像,包括:
通过第一摄像头获取所述第一图像;
所述获取第二图像,包括:
通过第二摄像头获取所述第一图像;
其中,所述第一摄像头为低功耗摄像头,所述第二摄像头为高功耗摄像头。
也即是,电子设备可以通过切换低功耗摄像头和高功耗摄像头,从而实现在低功耗情况下获取第一图像,在高功耗情况下获取第二图像,减少了对单一摄像头性能的需求。
在一些实施例中,当通过第一摄像头获取第一图像时,第一摄像头可以处于开启状态,第二摄像头等其他摄像头可以处于关闭状态;在一些实施例中,当通过第二摄像头获取第二图像时,第二摄像头可以处于开启状态,第一摄像头等其他摄像头可以处于关闭状态。
在一些实施例中,所述方法包括:
若所述第二图像中包括与所述第二图形码对应的场景特征,则确定所述第一图像中包括所述第二图形码;或,
若所述第二图像中包括与所述第二图形码对应的编码特征,则确定所述第一图像中包括所述第二图形码;或,
若所述第二图像中包括与所述第二图形码对应的编码特征以及与所述第二图形码对应的编码特征,则确定所述第一图像中包括所述第二图形码。
其中,该场景特征可以为第二图像中除第二图形码之外的能够用于识别第二图形码的特征,该场景特征可以用于指示第二图形码所在的场所、第二图形码对应的功能和第二图形码对应的应用等特征中的至少一个。
需要说明的是,电子设备可以预先获取并存储第二图形码对应的编码特征和/或场景特征。在一些实施例中,电子设备可以获取包括第二图像码的多个图像,从该多个图像中获取第二图形码对应的编码特征和/或场景特征。
在一些实施例中,电子设备可以将获取到的第二图像输入第一机器学习模型,从而得到第一机器学习模型输出的识别结果,该识别结果可以用于指示该第二图像包括第二图形码或不包括第二图形码。
在一些实施例中,所述确定所述第二图形码对应的第一应用,包括:
对所述第二图形码进行解析,得到所述第一码信息;
基于所述第一码信息,确定与所述第二图形码对应的所述第一应用。
在一些实施例中,所述基于所述第一码信息,确定与所述第二图形码对应的所述第一应用,包括:
从所述第一码信息中获取所述第一应用的身份信息;或,
基于所述第一码信息的信息类型,确定与所述第二图形码对应的所述第一应用。
在一些实施例中,所述确定所述第二图形码对应的第一应用,包括:
基于第一图像或所述第二图像中包括的场景特征,确定所述第二图形码对应的第一应用。
在一些实施例中,所述确定所述第二图形码所承载的第一码信息,包括:
拉起所述第一应用;
通过所述第一应用扫描所述第二图形码;
通过所述第一应用确定所述第二图形码所承载的第一码信息。
在一些实施例中,在所述接收到确认操作之前,所述方法还包括:
发出第一提示信息,所述第一提示信息用于指示检测到所述第二图形码。
电子设备在不干扰用户的情况下,提前进行了图形码识别,在这种情况下,可以通过发出第一提示信息,提示用户已经检测到第二图形码,进而由用户判断电子设备提前执行的识别行为是否有效,确保了电子设备的安全性。
在一些实施例中,所述第二图形码对应多个应用,在所述接收到确认操作之后,所述方法还包括:
接收在所述多个应用选择的所述第一应用。
在一些实施例中,电子设备可以发出第三提示信息,第三提示信息用于提示用户在多个应用中确定第一应用。
在一些实施例中,所述第二图形码对应多个应用,电子设备可以通过其他方式在该多个应用中确定第一应用,而不需要用户在该多个应用中选择第一应用。在一些实施例中,电子设备也可以按照预设的策略,在多个应用中确定第一应用。在一些实施例中,电子设备可以将该多个应用中用户使用频率最高的应用确定为第一应用。在一些实施例中,电子设备可以将该多个应用中用户上一次使用的应用确定为第一应用。在一些实施例中,电子设备可以将该多个应用中安全性最高的应用确定为第一应用。
其中,通过接收用户在多个应用中选择的第一应用,可以提高确定第一应用的准确性;而由电子设备在多个应用中确定第一应用,可以减少与用户之间的交互,提高识别图形码的效率。
在一些实施例中,所述第二图像包括多个图形码,在所述接收到确认操作之后,所述方法还包括:
接收在所述多个图形码中选择的所述第二图形码。
在一些实施例中,电子设备可以发出第二提示信息,第二提示信息可以用于提示用户在多个图形码中确定第二图形码。
在一些实施例中,第二提示信息可以包括多个图形码。
在一些实施例中,第二提示信息可以包括第二图像(或第一图像)以及对应每个图形码的标记。
在一些实施例中,第二提示信息可以包括第二图像(或第一图像)、每个图形码对应的标记以及每个图形码对应的应用图标。
在一些实施例中,所述第二图像包括多个图形码,电子设备可以通过其他方式在该多个图形码中确定第二图形码,而不需要用户在该多个图形码中选择第二图形码。
其中,通过接收用户在多个图形码中选择的第二图形码,可以提高确定第二图形码的准确性;而由电子设备在多个图形码中确定第二图形码,可以减少与用户之间的交互,提高识别图形码的效率。
在一些实施例中,所述第一码信息的信息类型为统一资源定位符URL,在所述接收到确认操作之前,所述方法还包括:
从服务器获取所述第一码信息对应的数据;
所述通过所述第一应用显示与所述第一码信息对应的显示界面,包括:
通过所述第一应用加载所述第一码信息对应的数据,以显示与所述第一码信息对应的显示界面。
在一些实施例中,在所述接收到确认操作之前,所述方法还包括:
通过所述第一应用,生成与所述第一码信息对应的虚拟界面;
通过所述第一应用加载与所述第一码信息对应的虚拟界面,以显示与所述第一码信息对应的显示界面。
在一些实施例中,所述第一提示信息包括:
第一行为标识,所述第一行为标识为与所述第二图形码对应的图形;和/或,
所述第一图形码或所述第二图形码;和/或,
所述第一应用的身份信息;和/或,
所述第一图像或所述第二图像。
在一些实施例中,所述方法还包括:
若未在第一时长内接收到所述确认操作,则停止发出所述第一提示信息。
在一些实施例中,所述特定状态包括所述电子设备显示主界面、负一屏界面或下滑通知界面;和/或,所述电子设备处于水平状态、竖直状态或抬起状态。
第二方面,本申请实施例提供了一种识别图形码的装置,该装置具有实现上述各方面及上述各方面的可能实现方式中电子设备行为的功能。功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。硬件或软件包括一个或多个与上述功能相对应的模块或单元。例如,收发模块或单元、处理模块或单元、获取模块或单元等。
第三方面,本申请实施例提供一种电子设备,包括:存储器和处理器,存储器用于存储计算机程序;处理器用于在调用计算机程序时执行上述第一方面中任一项所述的方法。
第四方面,本申请实施例提供一种芯片系统,所述芯片系统包括处理器,所述处理器与存储器耦合,所述处理器执行存储器中存储的计算机程序,以实现上述第一方面中任一项所述的方法。
其中,所述芯片系统可以为单个芯片,或者多个芯片组成的芯片模组。
第五方面,本申请实施例提供一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现上述第一方面中任一项所述的方法。
第六方面,本申请实施例提供一种计算机程序产品,当计算机程序产品在电子设备上运行时,使得电子设备执行上述第一方面中任一项所述的方法。
可以理解的是,上述第二方面至第六方面的有益效果可以参见上述第一方面中的相关描述,在此不再赘述。
附图说明
图1为本申请实施例所提供的一种电子设备的结构示意图;
图2为本申请实施例所提供的一种电子设备的软件结构框图;
图3为本申请实施例所提供的一种识别图形码的方法的流程示意图;
图4为本申请实施例所提供的一种第二图像的示意图;
图5为本申请实施例所提供的一种显示界面的示意图;
图6为本申请实施例所提供的另一种显示界面的示意图;
图7为本申请实施例所提供的另一种显示界面的示意图;
图8为本申请实施例所提供的另一种显示界面的示意图;
图9为本申请实施例所提供的另一种显示界面的示意图;
图10为本申请实施例提供的另一种识别图形码的方法的流程示意图;
图11为本申请实施例提供的另一种识别图形码的方法的流程示意图;
图12为本申请实施例提供的另一种识别图形码的方法的流程示意图;
图13为本申请实施例提供的另一种识别图形码的方法的流程示意图;
图14为本申请实施例提供的另一种识别图形码的方法的流程示意图;
图15为本申请实施例所提供的另一种显示界面的示意图;
图16为本申请实施例所提供的另一种显示界面的示意图;
图17为本申请实施例所提供的另一种显示界面的示意图;
图18为本申请实施例提供的一种识别图形码的方法的流程示意图;
图19为本申请实施例所提供的一种第二图像的示意图;
图20为本申请实施例所提供的另一种显示界面的示意图;
图21为本申请实施例所提供的另一种显示界面的示意图;
图22为本申请实施例所提供的另一种显示界面的示意图;
图23为本申请实施例所提供的另一种显示界面的示意图;
图24为本申请实施例所提供的另一种显示界面的示意图;
图25为本申请实施例提供的另一种识别图形码的方法的流程示意图;
图26为本申请实施例所提供的另一种显示界面的示意图;
图27为本申请实施例提供的另一种识别图形码的方法的流程示意图。
具体实施方式
本申请实施例提供的识别图形码的方法可以应用于手机、平板电脑、可穿戴设备、车载设备、增强现实(augmented reality,AR)/虚拟现实(virtual reality,VR)设备、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本、个人数字助理(personal digital assistant,PDA)等电子设备上,本申请实施例对电子设备的具体类型不作任何限制。
请参照图1,为本申请所提供的一种电子设备100的结构示意图。电子设备100可以包括处理器110,外部存储器接口120,内部存储器121,摄像头130,显示屏140,通信模块150,扬声器160,麦克风170,传感器模块180,按键190,马达191,指示器192,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器,陀螺仪传感器,磁传感器,加速度传感器,距离传感器,接近光传感器,指纹传感器,触摸传感器,环境光传感器等。
可以理解的是,本申请实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
其中,控制器可以是电子设备100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。减少了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。
通信模块150,可以用于实现电子设备100内部的通信,和/或,实现电子设备100与其他设备之间的通信。在一些实施例中,通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G等移动通信的解决方案,和/或,提供应用在电子设备100上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。
电子设备100通过GPU,显示屏140,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏140和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏140用于显示图像,视频等。显示屏140包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或N个显示屏140,N为大于1的正整数。
电子设备100可以通过ISP,摄像头130,视频编解码器,GPU,显示屏140以及应用处理器等实现拍摄功能。
ISP用于处理摄像头130反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头130中。
摄像头130用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,摄像头130可以在多个拍摄模式之间切换。该多个拍摄模式包括拍摄模式A和拍摄模式B。摄像头130处于拍摄模式A时所捕获的图像的图像质量,可以低于摄像头130处于拍摄模式B时所捕获的图像的图像质量;和/或摄像头130处于拍摄模式A时的功耗,可以低于摄像头130处于拍摄模式B时的功耗。在一些实施例中,拍摄模式A可以称为低功耗模式或者低分辨率模式,拍摄模式B可 以称为高功耗模式或者高分辨率模式。
在一些实施例中,电子设备100可以包括1个或N个摄像头130,N为大于1的正整数。在一些实施例中,N个摄像头130可以包括摄像头A和摄像头B。摄像头A所捕获的图像的图像质量,可以低于摄像头B所捕获的图像的图像质量;和/或,摄像头A的功耗,可以低于摄像头B的功耗。在一些实施例中,摄像头A可以称为低功耗摄像头或者低分辨率摄像头,摄像头B可以称为高功耗摄像头或者高分辨率摄像头。在一些实施例中,比如,低功耗摄像头或者低分辨率摄像头在运行所耗费的电流可以小于100mA,小于高功耗摄像头或者高分辨率摄像头在运行时所耗费的电流可以大于100mA,如数百毫安甚至上千毫安。即由于低功耗摄像头或者低分辨率摄像头在运行所耗费的电流,小于高功耗摄像头或者高分辨率摄像头在运行时所耗费的电流,所以低功耗摄像头或者低分辨率摄像头在运行所产生的功耗,小于高功耗摄像头或者高分辨率摄像头在运行时所产生的功耗,因此,低功耗摄像头或者低分辨率摄像头可以更长时间或者一直处于运行状态,而不会给电子设备带来较大的功耗负担。
例如,电子设备的总电量为6000mA,摄像头A运行时所耗费的电流为86mA,摄像头B运行时所耗费的电流为650毫安。在不考虑其他功耗的情况下,摄像头A可以运行的时长=6000/86,约为70小时,而摄像头B可以运行的时长=6000/650,约为9小时。即摄像头A可以运行的时长,约为摄像头B可以运行的时长的8倍。
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当电子设备100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。
视频编解码器用于对数字视频压缩或解压缩。电子设备100可以支持一种或多种视频编解码器。这样,电子设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备100的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行电子设备100的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。
电子设备100可以通过扬声器160和麦克风170以及应用处理器等实现音频功能。例如音乐播放,录音等。
扬声器160,也称“喇叭”,用于将音频电信号转换为声音信号。电子设备100可以通过扬声器160收听音乐,或收听免提通话。
麦克风170,也称“话筒”,“传声器”,用于将声音信号转换为电信号。当拨打电话或发送语音信息时,用户可以通过人嘴靠近麦克风170发声,将声音信号输入到麦克风170。电子设备100可以设置至少一个麦克风170。在另一些实施例中,电子设备100可以设置两个麦克风170,除了采集声音信号,还可以实现降噪功能。在另一些实施例中,电子设备100还可以设置三个,四个或更多麦克风170,实现采集声音信号,降噪,还可以识别声音来源,实现定向录音功能等。
压力传感器用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器可以设置于显示屏140。压力传感器的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器,电极之间的电容改变。电子设备100根据电容的变化确定压力的强度。当有触摸操作作用于显示屏140,电子设备100根据压力传感器检测所述触摸操作强度。电子设备100也可以根据压力传感器的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。例如:当有触摸操作强度小于第一压力阈值的触摸操作作用于短消息应用图标时,执行查看短消息的指令。当有触摸操作强度大于或等于第一压力阈值的触摸操作作用于短消息应用图标时,执行新建短消息的指令。在一些实施例中,压力传感器可以设置于电子设备100的壳体上或者电子设备100内部靠近该壳体的一侧,从而可以感知用户对电子设备100壳体的敲击操作或者触摸操作。
陀螺仪传感器可以用于确定电子设备100的运动姿态。在一些实施例中,可以通过陀螺仪传感器确定电子设备100围绕三个轴(即,x,y和z轴)的角速度。陀螺仪传感器可以用于拍摄防抖。示例性的,当按下快门,陀螺仪传感器检测电子设备100抖动的角度,根据角度计算出镜头模组需要补偿的距离,让镜头通过反向运动抵消电子设备100的抖动,实现防抖。陀螺仪传感器还可以用于导航,体感游戏场景。
磁传感器包括霍尔传感器。电子设备100可以利用磁传感器检测翻盖皮套的开合。在一些实施例中,当电子设备100是翻盖机时,电子设备100可以根据磁传感器检测翻盖的开合。进而根据检测到的皮套的开合状态或翻盖的开合状态,设置翻盖自动解锁等特性。
加速度传感器可检测电子设备100在各个方向上(一般为三轴)加速度的大小。当电子设备100静止时可检测出重力的大小及方向。还可以用于识别电子设备100姿态,应用于横竖屏切换,计步器等应用。
距离传感器,用于测量距离。电子设备100可以通过红外或激光测量距离。在一些实施例中,拍摄场景,电子设备100可以利用距离传感器测距以实现快速对焦。
接近光传感器可以包括例如发光二极管(LED)和光检测器,例如光电二极管。发光二极管可以是红外发光二极管。电子设备100通过发光二极管向外发射红外光。 电子设备100使用光电二极管检测来自附近物体的红外反射光。当检测到充分的反射光时,可以确定电子设备100附近有物体。当检测到不充分的反射光时,电子设备100可以确定电子设备100附近没有物体。电子设备100可以利用接近光传感器检测用户手持电子设备100贴近耳朵通话,以便自动熄灭屏幕达到省电的目的。接近光传感器也可用于皮套模式,口袋模式自动解锁与锁屏。
环境光传感器用于感知环境光亮度。电子设备100可以根据感知的环境光亮度自适应调节显示屏140亮度。环境光传感器也可用于拍照时自动调节白平衡。环境光传感器还可以与接近光传感器配合,检测电子设备100是否在口袋里,以防误触。
指纹传感器用于采集指纹。电子设备100可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。
触摸传感器,也称“触控面板”。触摸传感器可以设置于显示屏140,由触摸传感器与显示屏140组成触摸屏,也称“触控屏”。触摸传感器用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏140提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器也可以设置于电子设备100的表面,与显示屏140所处的位置不同。
按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。电子设备100可以接收按键输入,产生与电子设备100的用户设置以及功能控制有关的键信号输入。
马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振动反馈。例如,作用于不同应用(例如拍照,音频播放等)的触摸操作,可以对应不同的振动反馈效果。作用于显示屏140不同区域的触摸操作,马达191也可对应不同的振动反馈效果。不同的应用场景(例如:时间提醒,接收信息,闹钟,游戏等)也可以对应不同的振动反馈效果。触摸振动反馈效果还可以支持自定义。
指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。
SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和电子设备100的接触和分离。电子设备100可以支持1个或N个SIM卡接口,N为大于1的正整数。SIM卡接口195可以支持Nano SIM卡,Micro SIM卡,SIM卡等。同一个SIM卡接口195可以同时插入多张卡。所述多张卡的类型可以相同,也可以不同。SIM卡接口195也可以兼容不同类型的SIM卡。SIM卡接口195也可以兼容外部存储卡。电子设备100通过SIM卡和网络交互,实现通话以及数据通信等功能。在一些实施例中,电子设备100采用eSIM,即:嵌入式SIM卡。eSIM卡可以嵌在电子设备100中,不能和电子设备100分离。
电子设备100的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本申请实施例以分层架构的Android系统为例,示例性说明电子设备100的软件结构。
图2是本申请实施例的电子设备100的软件结构框图。
分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将android系统分为四层,从上至下分别为应用程序 层,应用程序框架层,安卓运行时(android runtime)和系统库,以及内核层。
应用程序层可以包括一系列应用程序包。
如图2所示,应用程序包可以包括相机,图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,支付,电子码等应用程序。
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。
如图2所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器等。
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。
视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。
电话管理器用于提供电子设备100的通信功能。例如通话状态的管理(包括接通,挂断等)。
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。
android runtime包括核心库和虚拟机。android runtime负责安卓系统的调度和管理。
核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。
应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。
系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(Media Libraries),三维图形处理库(例如:openGL ES),2D图形引擎(例如:SGL)等。
表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。
媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。
三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。
2D图形引擎是2D绘图的绘图引擎。
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。
下面结合捕获拍照场景,示例性说明电子设备100软件以及硬件的工作流程。
当触摸传感器接收到触摸操作,相应的硬件中断被发给内核层。内核层将触摸操作加工成原始输入事件(包括触摸坐标,触摸操作的时间戳等信息)。原始输入事件被存储在内核层。应用程序框架层从内核层获取原始输入事件,识别该输入事件所对应的控件。以该触摸操作是触摸单击操作,该单击操作所对应的控件为相机应用图标的控件为例,相机应用调用应用框架层的接口,启动相机应用,进而通过调用内核层启动摄像头驱动,通过摄像头130捕获静态图像或视频。
在一些实施例中,本申请所提供的识别图形码的方法,可以由应用程序中的应用程序(包括第三方应用程序或者系统应用程序)实现,或者可以由应用程序框架层或系统库中的系统服务实现。
为了便于理解本申请实施例中的技术方案,下面首先对本申请实施例的应用场景予以介绍。
应用程序层包括的某些应用可以识别与该应用对应的图形码。其中,图形码可以包括条形码、二维码等。比如,钱包等用于支付的应用可以识别收款码,从而向收款码所指示的收款方收款;电子码应用可以识别设置在各场所的场所码,从而记录用户到达该场所的场所名称以及到达时间等信息。
在一些实施例中,应用的开发人员需要在该应用中设置“扫一扫”功能,向用户说明该应用以及该“扫一扫”的功能、该“扫一扫”功能在该应用中的具体位置,使得用户知道通过该应用识别哪些图形码,在遇到这些图形码并打开该应用时,从该应用的哪个位置查找到该“扫一扫”功能,进而通过该“扫一扫”功能识别该图形码。在一些实施例中,用户可以将该应用的“扫一扫”功能的快捷方式添加到电子设备的桌面上,从而省去用户打开该应用并在该应用中查找“扫一扫”功能的操作,但用户仍然需要在确定待识别的图形码是与该应用对应的图形码,再通过该快捷方式,打开该“扫一扫”功能对该图形码进行识别。可以看出,在上述方式中,需要用户根据待识别的图形码,手动选择对应的应用,再从应用中选择相应的识别功能,才能够识别图形码。一方面,操作比较繁琐,识别图形码的效率低下;另一方面,用户需要熟悉图形码以及相关的应用,该应用的开发人员也需要专门对识别图形码这一功能进行布局和引导,提高了识别图形码的成本。
为解决上述至少部分技术问题,本申请实施例提供了一种识别图形码的方法。在本申请实施例中,电子设备可以在处于特定状态时,就可以通过第二摄像头获取第二图像,从第二图像中识别第二图形码所承载的第一码信息以及第一应用,再向用户发出第一提示信息,使得用户感知到识别到第二图形码。在接收到用户的确认操作时,可以基于第一应用显示与第一码信息对应的显示界面。由于不需要用户查找第一应用,也不需要从第一应用中查找图形码识别功能,因此极大地提高了识别图形码的效率,同时第一应用的开发人员也不要专门针对识别图形码这一功能进行软件布局和用户引导,降低了识别图形码的成本。由于不需要用户查找第一应用,也不需要从第一应用 中查找图形码识别功能,因此极大地提高了识别图形码的效率,同时第一应用的开发人员也不要专门针对识别图形码这一功能进行软件布局和用户引导,降低了识别图形码的成本。
下面以具体地实施例对本申请的技术方案进行详细说明。下面这几个具体的实施例可以相互结合,对于相同或相似的概念或过程可能在某些实施例不再赘述。
请参照图3,为本申请实施例所提供的一种识别图形码的方法的流程图。其中,以下将以第二图像最多包括一个图形码为例,对本申请实施例所提供的识别图形码的方法进行说明,电子设备先确定第二图像中包括图形码,再确定该图形码承载的码信息以及对应的应用。需要说明的是,该方法并不以图3以及以下所述的具体顺序为限制,应当理解,在其它实施例中,该方法其中部分步骤的顺序可以根据实际需要相互交换,或者其中的部分步骤也可以省略或删除。该方法包括如下步骤:
S301,当电子设备处于特定状态时,通过第二摄像头获取第二图像。
其中,在一些实施例中,特定状态可以为用户在打开任一应用的扫一扫功能之前电子设备所处的状态,当该电子设备检测到该电子设备处于该特定状态时,用户可能即将要扫描图形码,因此可以提前通过第二摄像头获取第二图像。
在一些实施例中,图形码可以包括条形码(或称一维码)和二维码中的至少一个。条形码包括宽度不等的黑条和白条按照一定编码规则排列,从而表达一组信息。二维码是将特定的几何图形按特定的规律排列在二维方向上,从而表达一组信息。
在一些实施例中,特定状态可以包括特定显示状态。电子设备可以在确定该电子设备处于特定显示状态时,通过第二摄像头获取第二图像。
在一些实施例中,特定显示状态可以包括电子设备显示特定界面。在一些实施例中,特定界面可以包括主界面、负一屏界面和下滑通知界面中的至少一个。在一些实施例中,特定界面可以为包括图形码扫描功能的图标、快捷方式或小组件的界面。在一些实施例中,特定显示状态可以包括亮屏状态。
在一些实施例中,特定状态可以包括特定设备姿态。电子设备可以在确定该电子设备处于特定设备姿态时,通过第二摄像头获取第二图像。
在一些实施例中,特定设备姿态可以包括电子设备被抬起。在一些实施例中,特定设备姿态可以包括电子设备处于水平状态或竖直状态。其中,电子设备可以基于电子设备中的重力传感器和加速度传感器等一个或多个传感器,来判断电子设备当前是否处于特定设备姿态。
在一些实施例中,特定状态可以包括特定显示状态和/或特定设备姿态。电子设备可以在确定该电子设备处于特定显示状态且处于特定设备姿态时,通过第二摄像头获取第二图像。
示例性的,电子设备可以在电子设备处于竖直状态、且显示主界面、负一屏界面或下滑通知界面时,通过第二摄像头获取第二图像。
需要说明的是,特定状态可以由用户或者相关技术开发人员设置。且可以理解的是,在实际应用中,特定状态也可以包括更多的状态。在一些实施例中,特定状态可以是由电子设备通过对用户多次主动识别图形码的行为进行学习得到的。
在一些实施例中,第二摄像头可以为前述中的摄像头B,即高功率摄像头或高分 辨率摄像头。
在一些实施例中,第二摄像头包括第二拍摄模式,那么电子设备可以通过第二摄像头在第二拍摄模式下获取第二图像。其中,第二拍摄模式可以为前述中的拍摄模式B,即高功耗模式或者高分辨率模式。
当然,在实际应用中,第二摄像头也可以为其他摄像头,电子设备也可以通过第二摄像头在其他拍摄模式下获取第二图像。
需要说明的是,电子设备可以调用相机应用,通过相机应用与摄像头驱动进行通信,进而通过摄像头驱动开启第二摄像头,也可以直接通过摄像头驱动开启第二摄像头,本申请实施例对电子设备开启第二摄像头的方式不进行限定。
还需要说明是,当电子设备确定不处于特定状态时,可以间隔第二时长再次检测是否处于该特定状态。其中,第二时长可以通过事先设置得到。本申请实施例不对设置第二时长的方式以及第二时长的大小进行限定。
在一些实施例中,当通过第二摄像头获取第二图像时,第二摄像头可以处于开启状态,第一摄像头等其他摄像头可以处于关闭状态。
S302,电子设备确定第二图像中包括第二图形码。
在一些实施例中,第二图形码可以为电子设备的系统支持的图形码。电子设备可以初步判断所获取的第二图像中是否包括第二图形码,确保后续能够对第二图像进行进一步处理,可以减少或避免后续对不包括第二图形码的其他图像的处理操作,从而降低电子设备的功耗。
在一些实施例中,不同类型的图形码具有不同的编码特征。条形码包括两侧静区、起始字符、数据字符、校验字符(可选的)和终止字符,起始字符可以用于指示条形码的开始,终止字符可以用于指示条形码的结束,且起始字符和终止字符的结构不对称,从而能够确定条形码的方向。二维码包括定位符和码信息,其中,定位符可以用于指示二维码的方向。因此,电子设备可以基于第二图像中的编码特征,识别第二图像中包括的第二图形码,具体的,若第二图像中包括与第二图形码对应的编码特征,则电子设备可以确定第二图像中包括第二图形码。例如,电子设备可以第二图像中包括二维码的定位符时,确定第二图像中包括二维码;和/或,可以在第二图像中包括两侧静区、起始字符和终止字符时,确定第二图像中包括条形码。
在一些实施例中,电子设备可以基于第二图像中包括的场景特征,识别第二图像包括的第二图形码,具体的,若第二图像中包括与第二图形码对应的场景特征,则电子设备可以确定第二图像中包括第二图形码。其中,该场景特征可以为第二图像中除第二图形码之外的能够用于识别第二图形码的特征,该场景特征可以用于指示第二图形码所在的场所、第二图形码对应的功能和第二图形码对应的应用等特征中的至少一个。例如,第二图像中包括“请扫描二维码进行付款”,那么电子设备可以确定第二图像中包括二维码。或者,第二图像中包括“请扫描付款码进行付款”,那么电子设备可以确定第二图像中包括条形码或二维码。或者,第二图像中包括与第二图形码相关的设备设施,那么电子可以确定第二图像中包括第二图形码。
在一些实施例中,电子设备可以基于第二图像包括的编码特征以及场景特征,识别第二图像中包括的第二图形码,具体的,若第二图像中包括与第二图形码对应的编 码特征和场景特征,则电子设备可以确定第二图像中包括第二图形码。
需要说明的是,电子设备可以预先获取并存储第二图形码对应的编码特征和/或场景特征。在一些实施例中,电子设备可以获取包括第二图像码的多个图像,从该多个图像中获取第二图形码对应的编码特征和/或场景特征。
例如,电子设备获取到的第二图像可以为如图4所示的图像A 400,第二图形码为二维码。该第二图像中包括二维码的定位符401,该二维码中心位置还包括快支付应用的图标402。在该二维码下方还包括“请用[快支付]应用支付”这一介绍信息403,其中,“[快支付]”为该二维码对应的应用名称。该第二图像还包括收银台404。电子设备基于定位符401即可以确定该第二图像中包括第二图形码405,且第二图形码405为二维码。或者,电子设备基于快支付应用的图标402、二维码介绍信息403以及收银台404,确定该第二图像包括用于支付的第二图形码405。或者,电子设备基于定位符401、快支付应用的图标402、二维码介绍信息403以及收银台404,确定该第二图像包括用于支付的第二图形码405。
在一些实施例中,电子设备可以将获取到的第二图像输入第一机器学习模型,从而得到第一机器学习模型输出的识别结果,该识别结果可以用于指示该第二图像包括第二图形码或不包括第二图形码。
其中,第一机器学习模型可以用于识别图像中是否包括第二图形码。第一机器学习模型可以事先通过第一样本集合训练得到,第一样本集合包括多个样本,每个样本包括图像以及标注,该标注可以用于指示该图像实际是否包括第二图形码。需要说明是,可以由电子设备事先获取第一样本集合,并基于第一样本集合训练得到第一机器学习模型,也可以由其他设备事先获取第一样本集合,并基于第一样本集合训练得到第一机器学习模型,该电子设备可以直接获取训练完成的第一机器学习模型。
可以理解的是,在实际应用中,电子设备也可以通过其他方式来判断所获取的第二图像中是否包括第二图形码。
需要说明的是,当电子设备检测到不包括第二图形码的其他图像时,可以再次检测电子设备是否处于特定状态,从而在再次处于特定状态时,获取新的第二图像。
S303,电子设备基于第二图像,确定第二图形码所承载的第一码信息以及第二图形码对应的第一应用。
当电子确定第二图像中包括系统支持的第二图形码时,可以进一步确定第二图形码所承载的第一码信息以及相应的第一应用。
其中,第一应用可以为能够对第二图形码所承载的第一码信息进行处理的应用。
在一些实施例中,电子设备可以对第二图形码进行解析,得到第二图形码所承载的第一码信息,基于第一码信息确定与第二图形码对应的第一应用。
其中,第二图形码承载的第一码信息的信息类型可以包括统一资源定位系统(uniform resource locator,URL)。在一些实施例中,当第一码信息的信息类型URL时,第一码信息中可以包括第一应用的身份信息。例如,第一码信息为“http://www.kzhifu.com/XX/X”,其中,“kzhifu”即可以说明第一应用为快支付应用。当然,在实际应用中的,第一码信息的信息类型也可以包括文本和名片等其他类型。
在一些实施例中,当第一码信息的信息类型为URL时,电子设备可以从第一码信 息中获取第一应用的身份信息,从而确定第一应用。
在一些实施例中,当第一码信息的信息类型为URL时,电子设备可以从码信息与应用之间的对应关系中,确定第一应用。其中,码信息与应用之间的对应关系中可以包括多个URL类型的码信息以及各码信息对应的应用。
需要说明的是,电子设备可以事先获取多个URL类型的码信息,以及各码信息对应的应用,并将该多个URL类型的码信息以及各码信息对应的应用,存储至码信息与应用之间的对应关系。
在一些实施例中,当第一码信息的信息类型为URL,但第一码信息中不包括第一应用的身份信息时,或者,当第一码信息的信息类型为文本和名片等其他类型时,电子设备可以基于第一码信息的信息类型,从信息类型与应用之间的对应关系中,确定第一应用。其中,信息类型与应用之间的对应关系可以包括多个信息类型以及各信息类型对应的应用。
例如,信息类型与应用之间的对应关系可以如下表1所示。
表1
需要说明的是,本申请实施例仅以上述表1对信息类型与应用之间的对应关系进行说明,上述表1并不对信息类型与应用之间的对应关系构成限定。
第一码信息为“http://ABC.com/XX/10”,信息类型为URL,电子设备未能基于第一码信息确定第一应用,因此电子设备可以基于该信息类型URL,从上述表1所示的信息类型与应用之间的对应关系中,确定第一应用为浏览器。
或者,第一码信息的信息类型为名片,电子设备可以基于名片,从上述表1所示的信息类型与应用之间的对应关系中,确定第一应用为联系人。
还需要说明的是,电子设备可以事先获取多个信息类型,以及信息类型对应的应用,并将该多个信息类型及各信息类型对应的应用,存储信息类型与应用之间的对应关系。
在一些实施例中,电子设备可以基于第二图像中与第二图形码对应的场景特征,确定第二图形码对应的第一应用。
例如,电子设备获取到的第二图像可以为如图4所示图像A 400。电子设备可以基于快支付应用的图标402、二维码介绍信息403和收银台404,确定第一应用为快支付应用。
在一些实施例中,电子设备可以基于第二图形码对应的场景特征,从场景特征与应用之间的对应关系中,获取与第二图形码对应的第一应用。
其中,场景特征与应用之间的对应关系,可以包括多个场景特征以及各场景特征对应的应用,该多个场景特征包括第二图形码对应的场景特征,多个应用中包括第一 应用。在一些实施例中,电子设备可以事先获取多个图像,每个图像中包括应用对应的图形码以及相应的场景特征,对于每个图像,电子设备获取该图像中包括的场景特征,并将该场景特征以及该应用存储至场景特征与应用之间的对应关系。
需要说明的是,当电子设备未能确定第二图形码所承载的第一码信息时,可以再次检测电子设备是否处于特定状态。
S304,电子设备发出第一提示信息,第一提示信息用于提示检测到第二图形码。
电子设备在不干扰用户的情况下,提前进行了图形码识别,在这种情况下,可以通过发出第一提示信息,提示用户已经检测到第二图形码,进而由用户判断电子设备提前执行的识别行为是否有效,确保了电子设备的安全性。
其中,电子设备可以通过振动、声音和图文等至少一种方式发出第一提示信息。
在一些实施例中,第一提示信息可以包括第一行为标识、第二图形码、第一应用的标识、第二图像和第一文本信息中的至少一个。在一些实施例中,第一行为标识可以为预设的图形或者可以为与第二图形码的外观相似或对应的图形。
例如,电子设备在显示主界面500时,获取图像A 400并从图像A 400中识别到第二图形码405,电子设备可以显示第一提示信息如图5-图9所示。在图5中,第一提示信息包括第一行为标识501,第一行为标识501为与第二图形码405的外观相似的图形,从而更加直观地提醒用户识别到第二图形码405。在图6中,第一提示信息包括第二图形码405。在图7中,第一提示信息包括图像A 400。在图8中,第一提示信息包括第一文本信息800,第一文本信息800包括:“已检测到二维码”。在图9中,第一提示信息包括第一应用的身份信息900,且第一应用的身份信息900包括第一应用的图标和名称。
S305,当电子设备接收到确认操作时,电子设备通过第一应用显示与第一码信息对应的显示界面。
其中,确认操作可以为用户触发的操作,该确认操作可以用于确认识别第二图形码的行为有效。
在一些实施例中,确认操作可以包括对电子设备某一表面(比如背面或显示屏)的敲击操作。在一些实施例中,确认操作可以包括对特定按键(包括实体按键或虚拟按键)的按键操作。当然,在实际应用中,确认操作也可以为其他类型的操作,确认操作的操作类型可以由用户或者相关技术人员事先设置,本申请实施例设置确认操作的方式以及确认操作的类型不进行限定。
例如,第一码信息为用于打开快支付应用的支付界面的URL,则该电子设备可以通过该快支付应用加载该URL,从而该支付界面。
又例如,第一码信息的信息类型为名片,则第一应用可以为联系人应用。如果该联系人应用中已经存储了该名片所指示的联系人,电子设备可以打开与名片对应的联系人情详情界面。如果该联系人应用中未存储该名片所指示的联系人,电子设备可以打开联系人新增界面,并将该名片所指示的联系人添加至该联系人新增界面。
又例如,第一码信息的信息类型为文本,那么电子设备可以通过浏览器显示该第一码信息。
在一些实施例中,电子设备若在预设的第一时长内接收到确认操作,则可以通过 第一应用显示与第一码信息对应的显示界面;若在第一时长内未接收到确认操作,则可以不通过第一应用显示与第一码信息对应的显示界面,还可以再次检测电子设备是否处于特定状态。其中,第一时长可以由用户或者相关技术人员设置,本申请实施例不对电子设备确定第一时长的方式以及第一时长的具体大小进行限定。
在一些实施例中,电子设备可以在S305之前,将第一码信息提供给第一应用,通过第一应用预先基于第一码信息生成对应的虚拟界面,那么在S305中,当电子设备接收到用户的确认操作时,电子设备可以通过第一应用直接加载显示已经缓存好的虚拟界面,减少了响应用户的确认操作的时延。在一些实施例中,也可以在S305之前,也可以将第二图形码或第二图像提供给第一应用,通过第一应用从第二图形码或第二图像中获取第一码信息,在基于第一码信息生成对应的显示界面。
在一些实施例中,电子设备在执行S305之后,可以检测电子是否还处于该特定状态,如果是则可以再次执行获取新的第二图像并识别其中可能包括的图形码,如果电子设备已经退出该特定状态,比如已经处于锁屏状态或灭屏状态,则可以关闭摄像头。
在本申请实施例中,电子设备可以在处于特定状态时,通过第二摄像头获取第二图像,从第二图像中识别第二图形码所承载的第一码信息以及第一应用,再向用户发出第一提示信息,使得用户感知到识别到第二图形码。在接收到用户的确认操作时,可以基于第一应用显示与第一码信息对应的显示界面。由于不需要用户查找第一应用,也不需要从第一应用中查找图形码识别功能,因此极大地提高了识别图形码的效率,同时第一应用的开发人员也不要专门针对识别图形码这一功能进行软件布局和用户引导,降低了识别图形码的成本。
请参照图10,为本申请实施例所提供的一种识别图形码的方法的流程图。其中,以下将以第二图像最多包括一个图形码为例,对本申请实施例所提供的识别图形码的方法进行说明,电子设备先确定第二图像中包括图形码以及该图形码对应的应用,再通过该应用确定该图形码承载的码信息。需要说明的是,该方法并不以图10以及以下所述的具体顺序为限制,应当理解,在其它实施例中,该方法其中部分步骤的顺序可以根据实际需要相互交换,或者其中的部分步骤也可以省略或删除。该方法包括如下步骤:
S1001,当电子设备处于特定状态时,通过第二摄像头获取第二图像。
其中,电子设备执行S1001的方式,可以参见前述S301中的相关描述。
在一些实施例中,当通过第二摄像头获取第二图像时,第二摄像头可以处于开启状态,第一摄像头等其他摄像头可以处于关闭状态。
S1002,电子设备确定第二图像中包括第二图形码以及第二图形码对应的第一应用。
电子设备在确定第二图像包括系统支持的第二图形码时,也确定了第二图形码对应第一应用。
在一些实施例中,电子设备可以在确定第二图像包括第二图形码对应的编码特征以及第二图形码对应的场景特征时,确定第二图像包括第二图形码。当电子设备确定第二图像中包括第二图形码时,还可以基于第二图像中与第二图形码对应的场景特征,确定第二图形码对应的第一应用。
在一些实施例中,电子设备可以将获取到的第二图像输入第一机器学习模型,从 而得到第一机器学习模型输出的识别结果,该识别结果可以用于指示该第二图像包括第二图形码以及对应的第一应用不包括第二图形码,且当第二图像包括第二图形码时,该识别结果还可以用于指示第二图形码对应的第一应用。
S1003,电子设备基于第二图像,确定第二图形码所承载的第一码信息。
当电子设备确定了第二图形码以及第二图形码对应的第一应用,可以进一步确定第二图形码所承载的第一码信息。
在一些实施例中,电子设备可以将第二图形码或第二图像,输入至第一应用,通过第一应用,从第二图形码或第二图像中获取第二图形码所承载的第一码信息。
电子设备执行S1003的方式,也可以参见前述S303中的相关描述。
S1004,电子设备发出第一提示信息,第一提示信息用于提示检测到第二图形码。
其中,电子设备执行S1004的方式,可以参见前述S304中的相关描述。
S1005,当电子设备接收到确认操作时,电子设备通过第一应用显示与第一码信息对应的显示界面。
其中,电子设备执行S1005的方式,可以参见前述S305中的相关描述。
请参照图11,为本申请实施例所提供的一种识别图形码的方法的流程图。其中,本申请实施例是对图3所示的方法的具体描述,电子设备在通过低分辨率摄像头获取的图像中识别到图形码时,再通过高分分辨率摄像头获取图像质量更高的图像进行解析。需要说明的是,该方法并不以图11以及以下所述的具体顺序为限制,应当理解,在其它实施例中,该方法其中部分步骤的顺序可以根据实际需要相互交换,或者其中的部分步骤也可以省略或删除。该方法包括如下步骤:
S1101,当电子设备处于特定状态时,通过第一摄像头获取第一图像。
其中,第一摄像头可以为前述中的摄像头A,即低功率摄像头或低分辨率摄像头。
需要说明的是,电子设备执行S1101的方式,可以与执行前述S301的方式相似。
在一些实施例中,当通过第一摄像头获取第一图像时,第一摄像头可以处于开启状态,第二摄像头等其他摄像头可以处于关闭状态。
S1102,当电子设备确定第一图像中包括第一图形码时,电子设备通过第二摄像头获取第二图像。
其中,第一摄像头可以为前述的摄像头B,即高功率摄像头或高分辨率摄像头。
由于电子设备是在确定通过第一摄像头获取的第一图像包括第一图形码时,通过第二摄像头获取第二图像,获取第二图像和第一图像之间的时间间隔很小,比如可以为毫秒级甚至是微秒级,因此,第二图像包括的图像内容和第一图像包括的图像内容可以相同或相似,且第一图像的图像质量可以高于第二图像的图像质量,第一图形码和第二图形码可以相同或相似,且第二图形码的图像质量高于第一图形码的图像质量。
在一些实施例中,第二图像的分辨率可以高于第一图像的分辨率,第二图形码的分辨率可以高于第一图形码的分辨率。
其中,电子设备执行S1102通过第二摄像头获取第二图像的方式,可以参见前述S301中的相关描述,电子设备确定第一图像中包括第一图形码的方式,可以与S302中确定第二图像中包括第二图形码的方式相同。
在一些实施例中,当通过第二摄像头获取第二图像时,第二摄像头可以处于开启 状态,第一摄像头等其他摄像头可以处于关闭状态。
S1103,电子设备基于第二图像,确定第二图形码所承载的第一码信息以及第二图形码对应的第一应用。
其中,电子设备执行S1103的方式,可以参见前述S303中的相关描述。
S1104,电子设备发出第一提示信息,第一提示信息用于提示检测到第二图形码。
在一些实施例中,第一提示信息可以包括第一行为标识、第二图形码、第一应用的标识、第二图像第一文本信息、第一图像和第一图形码中的至少一个。
其中,电子设备执行S1104的方式,可以参见前述S304中的相关描述。
S1105,当电子设备接收到确认操作时,电子设备通过第一应用显示与第一码信息对应的显示界面。
其中,电子设备执行S1105的方式,可以参见前述S305中的相关描述。
在本申请实施例中,电子设备可以在处于特定状态时,可以先通过低分辨率摄像头获取第一图像,并在第一图像中包括第二图形码时再通过高分辨率摄像头获取第二图像,通过第二图像来进一步识别第二图形码,降低了电子设备的功耗。电子设备可以通过切换低功耗摄像头和高功耗摄像头,从而实现在低功耗情况下获取第一图像,在高功耗情况下获取第二图像,减少了对单一摄像头性能的需求。
在一些实施例中,作为对图10所示的方法的具体描述,电子设备可以执行S1101,在S1102,当电子设备确定第一图像中包括第二图形码以及第二图形码对应的第一应用时,电子设备通过第二摄像头获取第二图像,在S1103,基于第二图像确定第二图形码所承载的第一码信息,再执行S1104和S1105。
请参照图12,为本申请实施例所提供的一种识别图形码的方法的流程图。其中,本申请实施例是对图3所示的方法的具体描述,电子设备通过低分辨率模式获取的图像中识别到图形码时,再通过高分辨率模式获取图像质量更高的图像进行解析。需要说明的是,该方法并不以图12以及以下所述的具体顺序为限制,应当理解,在其它实施例中,该方法其中部分步骤的顺序可以根据实际需要相互交换,或者其中的部分步骤也可以省略或删除。该方法包括如下步骤:
S1201,当电子设备处于特定状态时,通过第二摄像头在第一拍摄模式下获取第一图像。
其中,第一拍摄模式可以为前述中的拍摄模式A,即低分辨率模式或低功耗模式。
需要说明的是,电子设备执行S1201的方式,可以与执行前述S301的方式相似。
在一些实施例中,当通过第二摄像头获取第一图像时,第二摄像头可以处于开启状态,第一摄像头等其他摄像头可以处于关闭状态。
S1202,当电子设备确定第一图像中包括第一图形码时,电子设备通过第二摄像头在第二拍摄模式下获取第二图像。
其中,电子设备执行S1202确定第一图像中包括第一图形码的方式,可以与S302中确定第二图像中包括第二图形码的方式相同。
在一些实施例中,第二拍摄模式可以为前述中的拍摄模式B,即高分辨率模式或高功率模式。第一图像的图像质量,可以高于第二图像的图像质量,且第二图像包括的图像内容和第一图像包括的图像内容可以相同或相似。
在一些实施例中,当通过第二摄像头获取第二图像时,第二摄像头可以处于开启状态,第一摄像头等其他摄像头可以处于关闭状态。
S1203,电子设备基于第二图像,确定第二图形码所承载的第一码信息以及第二图形码对应的第一应用。
其中,电子设备执行S1203的方式,可以参见前述S303中的相关描述。
S1204,电子设备发出第一提示信息,第一提示信息用于提示检测到第二图形码。
在一些实施例中,第一提示信息可以包括第一行为标识、第二图形码、第一应用的标识、第二图像第一文本信息、第一图像和第一图形码中的至少一个。
其中,电子设备执行S1204的方式,可以参见前述S304中的相关描述。
S1205,当电子设备接收到确认操作时,电子设备通过第一应用显示与第一码信息对应的显示界面。
其中,电子设备执行S1205的方式,可以参见前述S305中的相关描述。
在本申请实施例中,电子设备可以在处于特定状态时,可以先通过第二摄像头在低分辨率模式获取第一图像,并在第一图像中包括第二图形码时再通过高分辨率模式获取第二图像,通过第二图像来进一步识别第二图形码,进一步降低了电子设备的功耗。且电子设备可以通过切换同一摄像头的低分辨率模式和高分辨模式,从而实现在低功耗情况下获取第一图像,在高功耗情况下获取第二图像,减少了对电子设备包括的摄像头数目的需求。
在一些实施例中,作为对图10所示的方法的具体描述,电子设备可以执行S1101,在S1102,当电子设备确定第一图像中包括第二图形码以及第二图形码对应的第一应用时,电子设备通过第二摄像头获取第二图像,在S1103,基于第二图像确定第二图形码所承载的第一码信息,再执行S1104和S1105。
请参照图13,为本申请实施例所提供的一种识别图形码的方法的流程图。其中,本实施例是图10所示的方法的另一种实现方式,电子设备获取的图像中识别到图形码以及该图形码对应的应用,且用户确认识别图形码的行为有效时,拉起该应用,通过该应用对图形码进行进一步解析。需要说明的是,该方法并不以图13以及以下所述的具体顺序为限制,应当理解,在其它实施例中,该方法其中部分步骤的顺序可以根据实际需要相互交换,或者其中的部分步骤也可以省略或删除。该方法包括如下步骤:
S1301,当电子设备处于特定状态时,通过第二摄像头获取第二图像。
在一些实施例中,为了降低功耗,第二摄像头可以为低功耗摄像头或者低分辨率摄像头;或者,第二摄像头为任意摄像头,电子设备可以通过第二摄像头在第一拍摄模式下获取第二图像。
在一些实施例中,当通过第二摄像头获取第二图像时,第二摄像头可以处于开启状态,第一摄像头等其他摄像头可以处于关闭状态。
其中,电子设备执行S1301的方式,还可以参见前述S301中的相关描述。
S1302,电子设备确定第二图像中包括第二图形码以及第二图形码对应的第一应用。
其中,电子设备执行S1302的方式,可以参见S1002中的相关描述。
S1303,电子设备发出第一提示信息,第一提示信息用于提示检测到第二图形码。
其中,电子设备执行S1303的方式,可以参见前述S304中的相关描述。
S1304,当电子设备接收到确认操作时,电子设备通过第一应用扫描第二图形码。
电子设备可以拉起第一应用,通过第一应用中的“扫一扫”等图形码识别功能,扫描第二图形码,从而得到第二图形码所承载的第一码信息。
在一些实施例中,当电子设备通过第一应用扫描第二图形码时,电子设备可以通过第一应用调用第一摄像头扫描第二图形码,或者,调用第二摄像头,在第一拍摄模式下扫描第二图形码。
S1305,电子设备通过第一应用显示与第一码信息对应的显示界面。
其中,电子设备执行S1305的方式,可以参见前述S305中的相关描述。
在本申请实施例中,电子设备在对第二图像进行初步识别时,如果第二图像包括第二图形码,还可以确定第一应用,进而可以直接通过第一应用扫描第二图形码,提高了拉起第一应用的效率以及识别第二图形码的准确性。
请参照图14,为本申请实施例所提供的一种识别图形码的方法的流程图。其中,本实施例是图10所示的方法的另一种实现方式,电子设备从获取的图像中识别到图形码以及该图形码对应的多个应用,且用户确认识别图形码的行为有效时,接收用户选择的应用,进而通过用户选择的应用对图形码进行进一步解析。需要说明的是,该方法并不以图14以及以下所述的具体顺序为限制,应当理解,在其它实施例中,该方法其中部分步骤的顺序可以根据实际需要相互交换,或者其中的部分步骤也可以省略或删除。该方法包括如下步骤:
S1401,当电子设备处于特定状态时,通过第二摄像头获取第二图像。
在一些实施例中,为了降低功耗,第二摄像头可以为低功耗摄像头或者低分辨率摄像头;或者,第二摄像头为任意摄像头,电子设备可以通过第二摄像头在第一拍摄模式下获取第二图像。
在一些实施例中,当通过第二摄像头获取第二图像时,第二摄像头可以处于开启状态,第一摄像头等其他摄像头可以处于关闭状态。
其中,电子设备执行S1401的方式,还可以参见前述S301中的相关描述。
S1402,电子设备确定第二图像中包括第二图形码以及第二图形码对应的多个应用。
其中,电子设备执行S1402的方式,可以参见S1002中的相关描述。
S1403,电子设备发出第一提示信息,第一提示信息用于提示检测到第二图形码。
其中,电子设备执行S1403的方式,可以参见前述S304中的相关描述。
S1404,当电子设备接收到确认操作时,电子设备在多个应用中确定第一应用。
在一些实施例中,电子设备也可以按照预设的策略,在多个应用中确定第一应用。在一些实施例中,电子设备可以将该多个应用中用户使用频率最高的应用确定为第一应用。在一些实施例中,电子设备可以将该多个应用中用户上一次使用的应用确定为第一应用。在一些实施例中,电子设备可以将该多个应用中安全性最高的应用确定为第一应用。
在一些实施例中,电子设备可以显示第三提示信息,第三提示信息用于提示用户在多个应用中确定第一应用。电子设备可以将用户在多个应用中选择的应用确定为第一应用。
在一些实施例中,第三提示信息可以包括多个应用的应用标识。在一些实施例中, 点第三提示信息还可以包括更多用于提示用户选择第一应用的信息,比如第二图像、第二图形码、各应用的开发商、电子设备获取各应用的来源等等。
例如,图4所示的图像A 400包括第二图形码405,电子设备确定与第二图形码405对应的应用包括快支付应用和信用卡应用,因此可以显示如图15或16所示的第三提示信息。
在图15中,第三提示信息包括快支付应用对应的应用标识1501和应用B对应的支付标识1502。在图16中,第三提示信息还包括第二图形码405。在图17中,第三提示信息还包括图像A 400。用户可以点击快支付应用对应的应用标识1501从而将快支付应用确定为第一应用,或者,用户可以点击信用卡应用对应的应用标识1502从而将信用卡应用确定为第一应用。
S1405,电子设备通过第一应用获取第二图形码承载的第一码信息。
由于已经确定了第一应用,因此电子设备可以运行第一应用,从而通过第一应用执行后续步骤。
在一些实施例中,电子设备通过第一应用从第二图像中,获取第二图形码承载的第一码信息。
在一些实施例中,电子设备可以通过高分辨率摄像头或者高分辨率模式,获取第一图像,通过第一应用从第一图像中,获取第二图形码承载的第一码信息。
在一些实施例中,电子设备可以通过第一应用中的“扫一扫”等图形码识别功能,扫描第二图形码,从而得到第二图形码所承载的第一码信息。
S1406,电子设备通过第一应用显示与第一码信息对应的显示界面。
其中,电子设备执行S1406的方式,可以参见前述S305中的相关描述。
在本申请实施例中,若第二图形码对应多个应用,电子设备可以在多个应用中确定第一应用,提高了确定第一应用的准确性,进而也提高了通过第一应用对第二图形码进行识别的准确性。另外,电子设备可以通过显示第三提示信息,接收用户在多个应用中确定第一应用,进一步提高了第一应用的准确性。
请参照图18,为本申请实施例所提供的一种识别图形码的方法的流程图。其中,以下将以第二图像可以包括多个图形码为例,对本申请实施例所提供的识别图形码的方法进行说明。需要说明的是,该方法并不以图18以及以下所述的具体顺序为限制,应当理解,在其它实施例中,该方法其中部分步骤的顺序可以根据实际需要相互交换,或者其中的部分步骤也可以省略或删除。该方法包括如下步骤:
S1801,当电子设备处于特定状态时,通过第二摄像头获取第二图像。
在一些实施例中,当通过第二摄像头获取第二图像时,第二摄像头可以处于开启状态,第一摄像头等其他摄像头可以处于关闭状态。
S1802,电子设备识别第二图像中包括的各图形码承载的码信息以及各图形码对应的应用。
其中,电子设备执行S1802的方式,可以参见S303-S302以及S1002-S1003中的相关描述。
例如,第二图像可以为如图19所示的图像B 1900。图像B 1900中包括二维码A 1901和二维码B 1902。
S1803,电子设备发出第一提示信息,第一提示信息用于提示检测到多个图形码。
其中,电子设备执行S1803的方式,可以参见前述S304中的相关描述。
S1804,当电子设备接收到确认操作时,电子设备在多个图形码中确定第二图形码。
在一些实施例中,电子设备可以将多个图形码中处于第二图像中特定位置的图形码确定为第二图形码。在一些实施例中,特定位置可以为第二图像的中心位置。
例如,在图像B 1900中,二维码A 1901处于中心位置,那么电子设备可以将二维码A 1901确定为第二图形码。
在一些实施例中,电子设备可以显示第二提示信息,第二提示信息可以用于提示用户在多个图形码中确定第二图形码。当电子设备基于该多个图形码中的任一图形码接收到用户的选择操作时,可以将用户选择的图形码确定为第二图形码。
当电子设备确定第二图形码时,第二图形码所承载的码信息即为第一码信息,第二图形码对应的应用即为第一应用。
在一些实施例中,第二提示信息可以包括多个图形码。例如,如图20所示,第二提示信息包括二维码A 1901和二维码B 1902。用户可以通过点击二维码A 1901从而将二维码A 1901确定为第二图形码,或者点击二维码B 1902将二维码B 1902确定为第二图形码。
在一些实施例中,第二提示信息可以包括多个图形码以及各图形码对应的应用标识。例如,如图21所示,第二提示信息包括二维码A 1901和二维码B 1902,还包括二维码A 1901对应的应用标识1501、二维码B 1902对应的应用标识1904。其中,二维码A 1901对应的应用为快支付应用,该快支付应用的应用标识1501包括快支付应用的图标和名称;二维码B 1902对应的应用为电子码应用,该电子码应用的应用标识1904包括电子码应用的图标和名称。用户可以通过点击二维码A 1901或者二维码A 1901对应的应用标识1501,从而将二维码A 1901确定为第二图形码。或者用户可以点击二维码B 1902或者二维码B 1902对应的应用标识1904,将二维码B 1902确定为第二图形码。
又例如,如图22所示,第二提示信息包括二维码A 1901和二维码B 1902,还包括二维码A 1901对应的快支付应用的应用标识1501和信用卡应用的应用标识1502、二维码B 1902对应的应用标识1904,即二维码A 1901对应两个应用。用户可以通过点击快支付应用的应用标识1501,从而将快支付应用确定为第一应用,将二维码A 1901确定为第二图形码。用户可以通过点击信用卡应用的应用标识1502,从而将信用卡应用确定为第一应用,将二维码A 1901确定为第二图形码。或者用户可以点击二维码B 1902或者二维码B 1902对应的应用标识1904,将二维码B 1902确定为第二图形码。
在一些实施例中,第二提示信息可以包括第二图像以及对应每个图形码的标记。例如,如图23所示,第二提示信息包括图像B 1900、与二维码A 1901对应的标记1905以及与二维码B 1902对应的标记1906。用户可以通过点击与二维码A 1901对应的标记1905,从而将二维码A 1901确定为第二图形码。或者用户可以点击与二维码B 1902对应的标记1906,将二维码B 1902确定为第二图形码。
在一些实施例中,第二提示信息可以包括第二图像、每个图形码对应的标记以及 每个图形码对应的应用图标。例如,如图24所示,第二提示信息包括图像B 1900、与二维码A 1901对应的标记1905、与二维码B 1902对应的标记1906、与二维码A 1901对应的应用标识1501以及与二维码B 1902对应的应用标识1904。用户可以通过点击与二维码A 1901对应的标记1905或者与二维码A 1901对应的应用标识1501,从而将二维码A 1901确定为第二图形码。或者用户可以点击与二维码B 1902对应的标记1906或者与二维码B 1902对应的应用标识1904,将二维码B 1902确定为第二图形码。
当然,在实际应用中,电子设备也可以通过其他方式来发出第二提示信息,第二提示信息也可以包括更多或更少的信息。
S1805,电子设备通过第一应用显示与第一码信息对应的显示界面。
其中,电子设备执行S1805的方式,可以参见前述S305中的相关描述。
在本申请实施例中,电子设备可以识别第二图像中包括的多个图形码以及各图形码对应的应用,并在其中确定第二图形码和第一应用,进一步提高了识别图形码的效率。另外,电子设备可以通过显示第二提示信息,接收用户在多个图形码以及应用中确定第二图形码和第一应用,进一步提高了第二图形码和第一应用的准确性。
请参照图25,为本申请实施例所提供的一种识别图形码的方法的流程图。其中,本申请是对图3所示的方法的具体描述,在第二图形码承载的第一码信息的信息类型包括URL时,电子设备可以提前基于第一码信息获取与第一码信息对应的数据。需要说明的是,该方法并不以图25以及以下所述的具体顺序为限制,应当理解,在其它实施例中,该方法其中部分步骤的顺序可以根据实际需要相互交换,或者其中的部分步骤也可以省略或删除。该方法包括如下步骤:
S301,当电子设备处于特定状态时,通过第二摄像头获取第二图像。
在一些实施例中,当通过第二摄像头获取第二图像时,第二摄像头可以处于开启状态,第一摄像头等其他摄像头可以处于关闭状态。
S302,电子设备确定第二图像中包括第二图形码。
S303,电子设备基于第二图像,确定第二图形码所承载的第一码信息以及第二图形码对应的第一应用。
其中,第一码信息的信息类型包括URL。
S306,电子设备从服务器获取第一码信息对应的数据。
当第一码信息的信息类型包括URL时,电子设备可以基于第一码信息从服务器获取与第一码信息对应的数据,以提前获取第一码信息对应的数据的时机。
在一些实施例中,电子设备可以基于第一码信息,从与第一应用对应的服务器,获取与第一码信息对应的数据。
S304,电子设备发出第一提示信息,第一提示信息用于提示检测到第二图形码。
S305,当电子设备接收到确认操作时,电子设备通过第一应用显示与第一码信息对应的显示界面。
电子设备可以通过第一应用加载第一码信息对应的数据,从而显示与第一码信息对应的显示界面。
需要说明的是,电子设备执行上述S301-S305的方式,也可以参照前述图3中的相关描述。
在本申请实施例中,电子设备在对用户进行提示之前,已经获取到了第一码信息对应的数据,因此当电子设备接收到确认操作时,可以不必再次获取该数据,而是可以快速地基于已经获取到数据,显示该显示界面,从而提高显示该显示界面的效率。
需要说明的是,电子设备也可以在确定第一码信息之后、显示与第一码信息对应的显示界面之前的其他时机,提前从服务器获取第一码信息对应的数据。
在一些实施例中,作为对图10所示的方法的具体描述,电子设备可以执行S1001-S1003来确定第二图形码所承载的第一码信息,并在第一码信息的信息类型包括URL时,提前从服务器获取第一码信息对应的数据,再执行S1004和S1005,并在S1005中通过第一应用加载该数据,以显示第一码信息对应的显示界面。
请参照图26,为本申请实施例所提供的一种对识别图形码的配置界面的示意图。以下将结合该配置界面,以通过系统应用实现识别图形码为例,对本申请实施例提供的配置识别图形码的方式进行说明。
用户可以从电子设备的系统设置中查找到智能扫码选项,用户点击该智能扫码选项,电子设备显示如图26所示的配置界面。
该配置界面包括智能扫码的场景示意图2601以及场景说明信息2602,用户可以通过场景示意图2601以及场景说明信息2602,了解智能扫码功能的使用方式和使用场景。
该配置界面包括智能扫码开关2603,用户可以通过点击智能扫码开关2603,选择启用或关闭智能扫码功能。比如当前该智能扫码开关2603为开状态,即表示打开了智能扫码功能。
该配置界面包括支付选项2604,该支付选项2604可以用于配置优先用于支付款项的应用。该配置界面还包括与支付选项2604对应的支付介绍信息2605,该支付介绍信息2605包括“当识别到收款码时,将优先使用默认支付方式进行支付”。用户通过该支付介绍信息2605即可确定,可以通过支付选项2604设置优先用于支付款项的应用,电子设备在识别到收款码时,将优先通过该应用(比如当前显示的钱包应用),进行支付。
在一些实施例中,电子设备可以在确定一个用于支付的图形码对应多个用于快支付应用时,优先通过支付选项2604所配置的应用进行支付。例如,图形码A为用于支付的图形码,电子设备识别到与图形码A对应的应用包括快支付应用、信用卡应用和钱包应用等三个应用,支付选项2604所配置的应用为钱包应用,因此,电子设备可以通过钱包应用加载图形码A所承载的码信息来进入支付界面。
在一些实施例中,电子设备可以在识别到多个用于支付的图形码,每个图形码对应一个用于支付的应用时,优先通过支付选项2604所配置的应用以及该应用对应的图形码进行支付。例如,电子设备识别到图形码B和图形码C,图形码B和图形码C均为用于支付的图形码,与图形码B对应的应用为快支付应用,与图形码C对应的应用为钱包应用,且支付选项2604所配置的应用为钱包应用,因此,电子设备可以通过钱包应用加载图形码C所承载的码信息来进入支付界面。
需要说明的是,图26并不对配置界面构成限定,在实际应用中,该配置界面也可以包括更多或更少的配置选项。比如,该配制界面还可以包括触发方式配置项,用户 可以通过该触发方式配置项,对触发智能扫码的特定状态进行配置。又比如,该配置界面还可以包括针对码信息与应用之间的对应关系、信息类型与应用之间的对应关系、场景特征与应用之间的对应关系等至少一种对应关系进行配置的选项。
请参照图27,为本申请实施例所提供的一种识别图形码的方法的流程图。需要说明的是,该方法并不以图27以及以下所述的具体顺序为限制,应当理解,在其它实施例中,该方法其中部分步骤的顺序可以根据实际需要相互交换,或者其中的部分步骤也可以省略或删除。该方法包括如下步骤:
S2701,当电子设备处于特定状态时,获取第一图像。
S2702,当第一图像包括第一图形码时,获取第二图像,第二图像包括第二图形码,其中,获取第一图像所产生的功耗,小于获取第二图像所产生的功耗,第一图像的图像质量低于第二图像的图像质量,第一图形码的图像质量低于第二图形码的图像质量。
S2703,确定第二图形码所承载的第一码信息以及第二图形码对应的第一应用。
S2704,当接收到确认操作时,通过第一应用显示与第一码信息对应的显示界面。
在本申请实施例中,电子设备可以在处于特定状态时,先在功耗较低的情况下通过第一摄像头获取图像质量较低的第一图像,并在第一图像包括第一图形码的情况下,在功耗较高的情况下通过第二摄像头获取图像质量较高的第二图像,从第二图像中识别第二图形码所承载的第一码信息以及第一应用,再向用户发出第一提示信息,使得用户感知到识别到第二图形码。在接收到用户的确认操作时,可以基于第一应用显示与第一码信息对应的显示界面。由于不需要用户查找第一应用,也不需要从第一应用中查找图形码识别功能,因此极大地提高了识别图形码的效率,同时第一应用的开发人员也不要专门针对识别图形码这一功能进行软件布局和用户引导,降低了识别图形码的成本。且由于是先在功耗较低的情况下通过第一摄像头获取图像质量较低的第一图像,并在初步判断第一图像包括第一图形码的情况下,再次在功耗较高的情况下通过第二摄像头获取图像质量较高的第二图像,也能够减少电子设备识别图形码的功耗。
基于同一发明构思,本申请实施例还提供了一种电子设备,包括:存储器和处理器,存储器用于存储计算机程序;处理器用于在调用计算机程序时执行上述方法实施例所述的方法。
本实施例提供的电子设备可以执行上述方法实施例,其实现原理与技术效果类似,此处不再赘述。
基于同一发明构思,本申请实施例还提供了一种芯片系统。该所述芯片系统包括处理器,所述处理器与存储器耦合,所述处理器执行存储器中存储的计算机程序,以实现上述方法实施例所述的方法。
其中,该芯片系统可以为单个芯片,或者多个芯片组成的芯片模组。
本申请实施例还提供一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现上述方法实施例所述的方法。
本申请实施例还提供一种计算机程序产品,当计算机程序产品在电子设备上运行时,使得电子设备执行时实现上述方法实施例所述的方法。
上述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例 方法中的全部或部分流程,可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读存储介质至少可以包括:能够将计算机程序代码携带到拍照装置/终端设备的任何实体或装置、记录介质、计算机存储器、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、电载波信号、电信信号以及软件分发介质。例如U盘、移动硬盘、磁碟或者光盘等。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
在本申请所提供的实施例中,应该理解到,所揭露的装置/设备和方法,可以通过其它的方式实现。例如,以上所描述的装置/设备实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。
应当理解,当在本申请说明书和所附权利要求书中使用时,术语“包括”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。
还应当理解,在本申请说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。
如在本申请说明书和所附权利要求书中所使用的那样,术语“如果”可以依据上下文被解释为“当...时”或“一旦”或“响应于确定”或“响应于检测到”。类似地,短语“如果确定”或“如果检测到[所描述条件或事件]”可以依据上下文被解释为意指“一旦确定”或“响应于确定”或“一旦检测到[所描述条件或事件]”或“响应于检测到[所描述条件或事件]”。
另外,在本申请说明书和所附权利要求书的描述中,术语“第一”、“第二”、“第三”等仅用于区分描述,而不能理解为指示或暗示相对重要性。
在本申请说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。
最后应说明的是:以上各实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述各实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。

Claims (19)

  1. 一种识别图形码的方法,其特征在于,应用于电子设备,所述方法包括:
    当所述电子设备处于特定状态时,获取第一图像;
    当所述第一图像包括第一图形码时,获取第二图像,所述第二图像包括第二图形码,其中,获取所述第一图像所产生的功耗,小于获取所述第二图像所产生的功耗,所述第一图像的图像质量低于所述第二图像的图像质量,所述第一图形码的图像质量低于所述第二图形码的图像质量;
    确定所述第二图形码所承载的第一码信息以及所述第二图形码对应的第一应用;
    当接收到确认操作时,通过所述第一应用显示与所述第一码信息对应的显示界面。
  2. 根据权利要求1所述的方法,其特征在于,所述获取第一图像,包括:
    通过第一摄像头,在第一拍摄模式下获取所述第一图像;
    所述获取第二图像,包括:
    通过所述第一摄像头,在第二拍摄模式下获取所述第一图像;
    其中,所述第一拍摄模式为低分辨率模式,所述第二拍摄模式为高分辨率模式。
  3. 根据权利要求1所述的方法,其特征在于,所述获取第一图像,包括:
    通过第一摄像头获取所述第一图像;
    所述获取第二图像,包括:
    通过第二摄像头获取所述第一图像;
    其中,所述第一摄像头为低功耗摄像头,所述第二摄像头为高功耗摄像头。
  4. 根据权利要求2或3所述的方法,其特征在于,所述方法包括:
    若所述第二图像中包括与所述第二图形码对应的场景特征,则确定所述第一图像中包括所述第二图形码;或,
    若所述第二图像中包括与所述第二图形码对应的编码特征,则确定所述第一图像中包括所述第二图形码;或,
    若所述第二图像中包括与所述第二图形码对应的编码特征以及与所述第二图形码对应的编码特征,则确定所述第一图像中包括所述第二图形码。
  5. 根据权利要求1-4任一所述的方法,其特征在于,所述确定所述第二图形码对应的第一应用,包括:
    对所述第二图形码进行解析,得到所述第一码信息;
    基于所述第一码信息,确定与所述第二图形码对应的所述第一应用。
  6. 根据权利要求5所述的方法,其特征在于,所述基于所述第一码信息,确定与所述第二图形码对应的所述第一应用,包括:
    从所述第一码信息中获取所述第一应用的身份信息;或,
    基于所述第一码信息的信息类型,确定与所述第二图形码对应的所述第一应用。
  7. 根据权利要求1-6任一所述的方法,其特征在于,所述确定所述第二图形码对应的第一应用,包括:
    基于第一图像或所述第二图像中包括的场景特征,确定所述第二图形码对应的第一应用。
  8. 根据权利要求7所述的方法,其特征在于,所述确定所述第二图形码所承载的 第一码信息,包括:
    拉起所述第一应用;
    通过所述第一应用扫描所述第二图形码;
    通过所述第一应用确定所述第二图形码所承载的第一码信息。
  9. 根据权利要求1-8任一所述的方法,其特征在于,在所述接收到确认操作之前,所述方法还包括:
    发出第一提示信息,所述第一提示信息用于指示检测到所述第二图形码。
  10. 根据权利要求9所述的方法,其特征在于,所述第二图形码对应多个应用,在所述接收到确认操作之后,所述方法还包括:
    接收在所述多个应用选择的所述第一应用。
  11. 根据权利要求9或10所述的方法,其特征在于,所述第二图像包括多个图形码,在所述接收到确认操作之后,所述方法还包括:
    接收在所述多个图形码中选择的所述第二图形码。
  12. 根据权利要求9-11任一所述的方法,其特征在于,所述第一码信息的信息类型为统一资源定位符URL,在所述接收到确认操作之前,所述方法还包括:
    从服务器获取所述第一码信息对应的数据;
    所述通过所述第一应用显示与所述第一码信息对应的显示界面,包括:
    通过所述第一应用加载所述第一码信息对应的数据,以显示与所述第一码信息对应的显示界面。
  13. 根据权利要求9所述的方法,其特征在于,在所述接收到确认操作之前,所述方法还包括:
    通过所述第一应用,生成与所述第一码信息对应的虚拟界面;
    通过所述第一应用加载与所述第一码信息对应的虚拟界面,以显示与所述第一码信息对应的显示界面。
  14. 根据权利要求9-13任一所述的方法,其特征在于,所述第一提示信息包括:
    第一行为标识,所述第一行为标识为与所述第二图形码对应的图形;和/或,
    所述第一图形码或所述第二图形码;和/或,
    所述第一应用的身份信息;和/或,
    所述第一图像或所述第二图像。
  15. 根据权利要求9-14任一所述的方法,其特征在于,所述方法还包括:
    若未在第一时长内接收到所述确认操作,则停止发出所述第一提示信息。
  16. 根据权利要求1-15任一所述的方法,其特征在于,所述特定状态包括所述电子设备显示主界面、负一屏界面或下滑通知界面;和/或,所述电子设备处于水平状态、竖直状态或抬起状态。
  17. 一种电子设备,其特征在于,包括:存储器和处理器,所述存储器用于存储计算机程序;所述处理器用于在调用所述计算机程序时执行如权利要求1-16任一项所述的方法。
  18. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1-16任一项所述的方法。
  19. 一种计算机程序产品,其特征在于,当所述计算机程序产品在电子设备上运行时,使得所述电子设备执行如权利要求1-16中任一项所述的方法。
PCT/CN2023/096848 2022-06-07 2023-05-29 识别图形码的方法及电子设备 WO2023236801A1 (zh)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN202210639518 2022-06-07
CN202210639518.4 2022-06-07
CN202211080988.8 2022-09-05
CN202211080988.8A CN117422082A (zh) 2022-06-07 2022-09-05 识别图形码的方法及电子设备

Publications (1)

Publication Number Publication Date
WO2023236801A1 true WO2023236801A1 (zh) 2023-12-14

Family

ID=89117633

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/096848 WO2023236801A1 (zh) 2022-06-07 2023-05-29 识别图形码的方法及电子设备

Country Status (1)

Country Link
WO (1) WO2023236801A1 (zh)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110570185A (zh) * 2019-09-03 2019-12-13 腾讯科技(深圳)有限公司 资源转移方法、装置、存储介质及电子设备
CN112699363A (zh) * 2020-12-29 2021-04-23 维沃移动通信(杭州)有限公司 图形码识别方法、装置及电子设备
CN114127686A (zh) * 2020-04-27 2022-03-01 华为技术有限公司 一种开启应用程序的方法、装置及终端

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110570185A (zh) * 2019-09-03 2019-12-13 腾讯科技(深圳)有限公司 资源转移方法、装置、存储介质及电子设备
CN114127686A (zh) * 2020-04-27 2022-03-01 华为技术有限公司 一种开启应用程序的方法、装置及终端
CN112699363A (zh) * 2020-12-29 2021-04-23 维沃移动通信(杭州)有限公司 图形码识别方法、装置及电子设备

Similar Documents

Publication Publication Date Title
US20220269405A1 (en) Floating Window Management Method and Related Apparatus
WO2021103981A1 (zh) 分屏显示的处理方法、装置及电子设备
CN109635542B (zh) 一种生物识别交互方法、图形交互界面及相关装置
KR20210092795A (ko) 음성 제어 방법 및 전자 장치
CN113254120B (zh) 数据处理方法和相关装置
WO2021082835A1 (zh) 启动功能的方法及电子设备
CN114710574A (zh) 显示方法及相关装置
WO2021063098A1 (zh) 一种触摸屏的响应方法及电子设备
CN112148400A (zh) 锁定状态下的显示方法及装置
US20220343648A1 (en) Image selection method and electronic device
WO2020088633A1 (zh) 支付方法、装置和用户设备
CN113887264B (zh) 扫码方法、系统及相关装置
WO2022057852A1 (zh) 一种多应用程序之间的交互方法
CN113986070B (zh) 一种应用卡片的快速查看方法及电子设备
US12010257B2 (en) Image classification method and electronic device
WO2022012418A1 (zh) 拍照方法及电子设备
CN115079886B (zh) 二维码识别方法、电子设备以及存储介质
CN114363462A (zh) 一种界面显示方法及相关装置
CN112068907A (zh) 一种界面显示方法和电子设备
CN113688019B (zh) 响应时长检测方法及装置
WO2022057384A1 (zh) 拍摄方法和装置
WO2020103091A9 (zh) 锁定触控操作的方法及电子设备
US20230236714A1 (en) Cross-Device Desktop Management Method, First Electronic Device, and Second Electronic Device
EP4284009A1 (en) Method for acquiring image, and electronic device
WO2023116012A9 (zh) 屏幕显示方法和电子设备

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: 23818966

Country of ref document: EP

Kind code of ref document: A1