Fingerprint recognition method and electronic device

By combining attitude sensors and fingerprint sensors, the user's intentions are judged, and the misunderstanding problem of side fingerprint recognition devices in specific scenarios is solved, and power consumption is reduced in the device without proximity sensors, improving the safety of the device and battery efficiency.

WO2025138884A9PCT designated stage expired Publication Date: 2025-08-14HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/112041
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-12-26
Filing Date
2024-08-14
Publication Date
2025-08-14

AI Technical Summary

Technical Problem

In electronic devices with side fingerprint recognition, the problem of misunderstanding caused by user accidentally touching the fingerprint sensor while holding the device is more common, especially in pocket scenes and running scenes, and devices without close-light sensors consume more power.

Method used

Using a combination of attitude sensor and fingerprint sensor, the user's intention is judged by detecting the attitude information of the device, unlocking is only performed when a specific attitude is satisfied, avoiding misunderstandings, and reducing power consumption in devices without a close-light sensor.

Benefits of technology

It effectively prevents misunderstanding caused by unintentional touch in pocket scenes and running scenes, reduces the power consumption of the device, improves safety and battery efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024112041_14082025_PF_FP_ABST
    Figure CN2024112041_14082025_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to the field of terminals. Disclosed are a fingerprint recognition method and an electronic device. The electronic device comprises a fingerprint sensor, which is arranged on a side of the electronic device, and a pose sensor, which is used for detecting pose information of the electronic device. The method comprises: where an electronic device is in a screen-locked state and is placed in a pocket of a user, or the user holds the electronic device in a hand and moves, when the electronic device detects that a finger of the user has touched a fingerprint sensor, the electronic device acquiring pose information of the electronic device, and collecting fingerprint feature information by means of a fingerprint sensor; the electronic device matching the fingerprint feature information with a preset fingerprint template, and succeeding in the matching; if the pose of the electronic device is a first preset pose, the electronic device executing a device unlocking operation; and if the pose of the electronic device is a second preset pose rather than the first preset pose, the electronic device executing the device unlocking operation.
Need to check novelty before this filing date? Find Prior Art

Description

Fingerprint recognition method and electronic device

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on December 26, 2023, with application number 202311828157.9 and application name “Fingerprint Recognition Method and Electronic Device”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of terminals, and in particular to a fingerprint recognition method and electronic device. Background Art

[0003] With the continuous development of terminal technology, people are increasingly accustomed to using electronic devices to handle various daily tasks. At the same time, in order to protect user privacy and the security of electronic devices, fingerprint recognition technology has also emerged. Some electronic devices can use side fingerprint recognition. In other words, the fingerprint sensor used to collect the user's fingerprint can be located on the side of the electronic device. When the user's finger touches the fingerprint sensor, the electronic device can obtain the user's fingerprint feature information and match it with a pre-stored fingerprint template. If the match is successful, the electronic device can change from the locked screen state to the unlocked state. If the match is unsuccessful, the electronic device can remain in the locked screen state.

[0004] However, in electronic devices that use side fingerprint recognition, since the fingerprint sensor is located on the side of the device, users often accidentally touch the fingerprint sensor when holding the device. This can cause the device to perform a fingerprint matching process even when the user does not intend to perform fingerprint recognition, resulting in the device being mistakenly locked due to multiple unsuccessful matches.

[0005] Summary of the Invention

[0006] The present application provides a fingerprint recognition method and electronic device, which are applied to electronic devices including a fingerprint sensor and a posture sensor, thereby preventing the electronic device from being mistakenly locked in a variety of application scenarios (such as pocket scenarios and running scenarios). It can also be applied to electronic devices that are not equipped with a proximity light sensor, thereby reducing the power consumption of the electronic device.

[0007] In the first aspect, the present application provides a fingerprint recognition method, which is applied to an electronic device, wherein the electronic device includes a fingerprint sensor arranged on the side of the electronic device, and a posture sensor for detecting the posture information of the electronic device. The method includes: when the electronic device is in a locked state and is placed in a user's pocket or the user is holding the electronic device and moving, when the electronic device detects that the user's finger touches the fingerprint sensor, the electronic device obtains the posture information of the electronic device and collects fingerprint feature information through the fingerprint sensor. The electronic device matches the fingerprint feature information with a preset fingerprint template and the match is successful. If the posture of the electronic device is a first preset posture, the electronic device performs a device unlocking operation. If the posture of the electronic device is not the first preset posture but is a second preset posture, the electronic device performs a device unlocking operation. In this way, it is possible to prevent the electronic device from being mistakenly locked in a variety of application scenarios (such as pocket scenarios and running scenarios), and it can also be applied to electronic devices that are not provided with proximity light sensors, reducing the power consumption of the electronic device.

[0008] In one possible implementation, if the electronic device's posture is neither the first preset posture nor the second preset posture, the electronic device maintains the locked screen state. This can prevent accidental locking of the electronic device in various application scenarios (such as pocket scenarios and running scenarios). It can also be applied to electronic devices without a proximity light sensor, reducing the power consumption of the electronic device.

[0009] In one possible implementation, if the posture of the electronic device is a first preset posture, the electronic device performs a device unlocking operation, specifically including: if the pitch angle of the electronic device is within a first preset range, the electronic device determines that the posture of the electronic device is the first preset posture. The electronic device performs the device unlocking operation. In this way, by judging the posture of the electronic device by the value of the pitch angle, it is possible to more conveniently determine whether the user intends to use the electronic device, thereby preventing the electronic device from being accidentally locked in a variety of application scenarios (such as pocket scenarios and running scenarios).

[0010] In a possible implementation, the first preset range is -165 degrees to 15 degrees.

[0011] In one possible implementation, the electronic device further includes a proximity light sensor. When the electronic device detects that the user's finger touches the fingerprint sensor, the electronic device obtains the posture information of the electronic device and collects fingerprint feature information through the fingerprint sensor, specifically including: when the electronic device detects that the user's finger touches the fingerprint sensor, the electronic device obtains the posture information of the electronic device, obtains the proximity light state of the electronic device through the proximity light sensor, and collects fingerprint feature information through the fingerprint sensor. If the posture of the electronic device is not the first preset posture but the second preset posture, the electronic device performs a device unlocking operation, specifically including: if the posture of the electronic device is not the first preset posture but the second preset posture, and the proximity light state is a distance state, the electronic device performs a device unlocking operation. In this way, it is possible to prevent misunderstandings of locking electronic devices in a variety of application scenarios (such as pocket scenarios and running scenarios), more accurately match the user's intentions, and reduce the power consumption of electronic devices.

[0012] In one possible implementation, the method further includes: if the posture of the electronic device is neither the first preset posture nor the second preset posture, the electronic device maintains the screen locked. If the posture of the electronic device is not the first preset posture but the second preset posture, and the proximity-to-light state is the proximity state, the electronic device maintains the screen locked. In this way, it is possible to prevent misunderstandings about locking the electronic device in various application scenarios (such as pocket scenarios and running scenarios), more accurately match the user's intention, and reduce the power consumption of the electronic device.

[0013] In one possible implementation, if the posture of the electronic device is a first preset posture, the electronic device performs a device unlocking operation, specifically including: if the pitch angle of the electronic device is within a first preset range, the electronic device determines that the posture of the electronic device is the first preset posture. The electronic device performs the device unlocking operation. In this way, by judging the posture of the electronic device by the value of the pitch angle, it is possible to more conveniently determine whether the user intends to use the electronic device, thereby preventing the electronic device from being accidentally locked in a variety of application scenarios (such as pocket scenarios and running scenarios).

[0014] In a possible implementation, the first preset range is -90 degrees to 15 degrees.

[0015] In one possible implementation, if the posture of the electronic device is not the first preset posture but the second preset posture, the electronic device performs a device unlocking operation, specifically including: if the pitch angle of the electronic device is not within the first preset range, the roll angle of the electronic device changes by more than the first preset angle within a specified time period, and remains stationary within the second preset range for more than a first specified time length, the electronic device determines that the posture of the electronic device is not the first preset posture but the second preset posture. The electronic device performs a device unlocking operation. In this way, by judging the posture of the electronic device through the value of the roll angle, it is possible to more accurately judge whether the user intends to use the electronic device, thereby preventing the electronic device from being mistakenly locked in a variety of application scenarios (such as pocket scenarios and running scenarios).

[0016] In one possible implementation, when the electronic device detects that the user's finger touches the fingerprint sensor, the electronic device obtains the posture information of the electronic device and collects fingerprint feature information through the fingerprint sensor. Specifically, when the electronic device receives a finger touch event reported by the fingerprint sensor through a fingerprint service, the electronic device determines that the user's finger has been detected touching the fingerprint sensor. The electronic device obtains the posture information of the electronic device reported by the posture sensor through the fingerprint service, and collects fingerprint feature information through the fingerprint sensor.

[0017] In a possible implementation, the electronic device matches the fingerprint feature information with a preset fingerprint template and the matching is successful, specifically including: the electronic device matches the fingerprint feature information with a preset fingerprint template through a fingerprint hardware abstraction layer and the matching is successful.

[0018] In a second aspect, the present application provides an electronic device, comprising: a posture sensor, one or more processors, one or more memories, and a display screen. The one or more memories are coupled to the posture sensor and the one or more processors, and the one or more memories are used to store computer program code, and the computer program code includes computer instructions. When the one or more processors and the posture sensor execute the computer instructions, the electronic device executes the method in any possible implementation of the first aspect described above. In this way, it is possible to prevent the electronic device from being mistakenly locked in a variety of application scenarios (such as pocket scenarios and running scenarios), and it can also be applied to electronic devices that are not equipped with proximity light sensors, thereby reducing the power consumption of the electronic device.

[0019] In a third aspect, the present application provides a computer-readable storage medium comprising computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the method described in any possible implementation of the first aspect. This prevents accidental locking of the electronic device in various application scenarios (e.g., pocket scenarios and running scenarios). It can also be applied to electronic devices without proximity light sensors, thereby reducing the power consumption of the electronic device.

[0020] In a fourth aspect, the present application provides a chip system comprising a processing circuit and an interface circuit, wherein the interface circuit is configured to receive code instructions and transmit them to the processing circuit, and the processing circuit is configured to execute the code instructions to perform the method described in any possible implementation of the first aspect. This can prevent misidentification of electronic devices in various application scenarios (e.g., pocket scenarios and running scenarios), and can also be applied to electronic devices without proximity light sensors, thereby reducing the power consumption of the electronic devices. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] FIG1A is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;

[0022] FIG1B is a schematic diagram of a software structure of an electronic device 100 provided in an embodiment of the present application;

[0023] FIG2A is a schematic diagram of the appearance of an electronic device 100 provided in an embodiment of the present application;

[0024] FIG2B is a schematic diagram of the appearance of another electronic device 100 provided in an embodiment of the present application;

[0025] 3A-3B are schematic diagrams of a set of fingerprint misinterpretation lock scenarios provided by an embodiment of the present application;

[0026] FIG4 is a schematic diagram of a fingerprint recognition process according to an embodiment of the present application;

[0027] 5A-5C are a set of user interface schematic diagrams provided in an embodiment of the present application;

[0028] FIG5D is a schematic diagram of a fingerprint collection device provided in an embodiment of the present application;

[0029] FIG5E is a schematic diagram of a coordinate system provided in an embodiment of the present application;

[0030] FIG5F is a schematic diagram of a posture of an electronic device provided in an embodiment of the present application;

[0031] Figures 5G-5H are a set of schematic diagrams of user interface changes provided in an embodiment of the present application;

[0032] FIG6A is a schematic diagram of a specific flow chart of a fingerprint recognition method provided in an embodiment of the present application;

[0033] FIG6B is a schematic diagram of the posture of another electronic device provided in an embodiment of the present application;

[0034] FIG6C is a schematic diagram of a posture of another electronic device provided in an embodiment of the present application;

[0035] FIG7 is a flowchart of a module interaction provided in an embodiment of the present application;

[0036] FIG8 is a schematic diagram of a specific flow chart of another fingerprint recognition method provided in an embodiment of the present application;

[0037] FIG9A is another module interaction flow chart provided in an embodiment of the present application;

[0038] FIG9B is another module interaction flowchart provided in an embodiment of the present application. DETAILED DESCRIPTION

[0039] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in the specification and appended claims of this application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to also include plural expressions, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in this application refers to any or all possible combinations including one or more of the listed features. In the embodiments of the present application, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as implying relative importance or implicitly indicating the number of technical features indicated. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, unless otherwise stated, the meaning of "multiple" is two or more.

[0040] First, the hardware structure and software structure of the electronic device in the embodiment of the present application are described in detail.

[0041] FIG1A shows the hardware structure of an electronic device provided in an embodiment of the present application.

[0042] In the embodiments of the present application, the electronic device (which may be referred to as the electronic device 100 in subsequent embodiments) may be a mobile phone, a tablet computer, a PC, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), or other electronic devices. The present application does not impose any restrictions on the specific type of the electronic device.

[0043] As shown in FIG1A , the electronic device 100 may include a processor 101 , a memory 102 , a sensor module 103 , a display screen 104 , a wireless communication module 105 (optional), an audio module 106 (optional), and a microphone 107 (optional).

[0044] It is understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than those shown in FIG1A, or may combine or separate certain components, or arrange the components differently. The components shown in FIG1A may be implemented in hardware, software, or a combination of software and hardware.

[0045] The processor 101 may include one or more processor units. For example, the processor 101 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors. The controller may generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution.

[0046] Processor 101 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 101 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 101. If processor 101 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 101's latency, and thus improves system efficiency.

[0047] In some embodiments, the processor 101 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a USB interface.

[0048] The memory 102 is coupled to the processor 101 and is used to store various software programs and / or multiple sets of instructions. In a specific implementation, the memory 102 may include a volatile memory (volatile memory), such as a random access memory (RAM); it may also include a non-volatile memory (non-volatile memory), such as a ROM, a flash memory (flash memory), a hard disk drive (HDD) or a solid state drive (SSD); the memory 102 may also include a combination of the above types of memories. The memory 102 may also store some program codes so that the processor 101 calls the program code stored in the memory 102 to implement the implementation method of the embodiment of the present application in the electronic device 100. The memory 102 can store an operating system, such as an embedded operating system such as uCOS, VxWorks, RTLinux, etc.

[0049] The sensor module 103 may include multiple sensor components, such as a fingerprint sensor 103A and a posture sensor 103B. The fingerprint sensor 103A can be used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc. The posture sensor 103B can be used to determine the posture of the electronic device 100. For example, the posture sensor 103B can determine that the electronic device 100 is in a rolling posture, or can determine that the electronic device 100 is in a hovering posture, etc. The posture sensor 103B may include a gyroscope sensor and / or an accelerometer. The gyroscope sensor can detect the angular velocity of the electronic device 100 around three axes (i.e., the x, y, and z axes) to determine the posture of the electronic device 100. The accelerometer can detect the magnitude of the acceleration of the electronic device 100 in various directions (generally the x, y, and z axes) to determine the posture of the electronic device 100. The accelerometer can also be used to detect the magnitude and direction of gravity when the electronic device 100 is stationary.

[0050] In some examples, the sensor module 103 may also include a proximity light sensor (not shown in FIG1A ). The proximity light sensor may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light outward through the light emitting diode. The electronic device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, the proximity light sensor can determine that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 can use the proximity light sensor to detect when the user holds the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power. The proximity light sensor can also be used for automatic unlocking and locking of the screen in holster mode and pocket mode.

[0051] In some examples, the sensor module 103 may also include a touch sensor (not shown in FIG1A ), which may also be referred to as a "touch control device." The touch sensor may be disposed on the display screen 104 , and the touch sensor and the display screen 104 form a touch screen, also referred to as a "touch screen." The touch sensor may be used to detect touch operations applied to or near the touch sensor.

[0052] The display screen 104 can be used to display images, videos, etc. The display screen 104 may include a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include one or N display screens 104, where N is a positive integer greater than one.

[0053] The wireless communication module 105 can provide wireless communication solutions for the electronic device 100, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc. The wireless communication module 105 can be one or more devices that integrate at least one communication processing module. The wireless communication module 105 receives electromagnetic waves via an antenna, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 101. The wireless communication module 105 can also receive signals to be transmitted from the processor 101, frequency modulate and amplify them, and convert them into electromagnetic waves for radiation through the antenna. In some embodiments, the electronic device 100 can also detect or scan devices near the electronic device 100 through the Bluetooth module (not shown in Figure 1A) and the WLAN module (not shown in Figure 1A) in the wireless communication module 105, and establish a wireless communication connection with the nearby devices to transmit data. Among them, the Bluetooth module can provide solutions including one or more Bluetooth communications of classic Bluetooth (basic rate / enhanced data rate, BR / EDR) or Bluetooth low energy (bluetooth low energy, BLE), and the WLAN module can provide solutions including one or more WLAN communications of Wi-Fi direct, Wi-Fi LAN or Wi-Fi softAP.

[0054] The audio module 106 can be used to convert digital audio information into an analog audio signal output, and can also be used to convert analog audio input into a digital audio signal. The audio module 106 can also be used to encode and decode audio signals. In some embodiments, the audio module 106 can also be provided in the processor 101, or some functional modules of the audio module 106 can be provided in the processor 101.

[0055] The microphone 107, which can also be called a "microphone" or a "microphone", can be used to collect sound signals in the environment surrounding the electronic device, and then convert the sound signals into electrical signals, and then subject the electrical signals to a series of processing, such as analog-to-digital conversion, to obtain a digital audio signal that can be processed by the processor 101 of the electronic device. When making a call or sending a voice message, the user can speak by putting their mouth close to the microphone 107 to input the sound signal into the microphone 107. The electronic device 100 can be provided with at least one microphone 107. In other embodiments, the electronic device 100 can be provided with two microphones 107, which, in addition to collecting sound signals, can also achieve noise reduction functions. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 107 to collect sound signals, reduce noise, identify the source of sound, and achieve directional recording functions.

[0056] It should be noted that the electronic device 100 shown in FIG1A is merely used to exemplify the hardware structure of the electronic device provided in the present application, and does not constitute a specific limitation to the present application.

[0057] FIG1B shows a software structure of an electronic device 100 provided in an embodiment of the present application.

[0058] Please refer to FIG. 1B , which exemplarily shows a software structure block diagram provided in an embodiment of the present application.

[0059] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a microservice architecture, or a cloud architecture. The embodiment of the present application takes the Android system with a layered architecture as an example to illustrate the software structure of the electronic device 100. The layered architecture divides the software into several layers. Each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, namely, the application layer, the application framework layer, the hardware abstraction layer, and the kernel layer from top to bottom.

[0060] As shown in FIG. 1B , the application layer may include a series of application packages, such as camera, calendar, memo, weather, and browser.

[0061] In an embodiment of the present application, the application layer may include a lock screen application 201. The lock screen application 201 may be used to interact with the fingerprint service 202 in the application framework layer. For example, the lock screen application 201 may receive the fingerprint matching result reported by the fingerprint service 202, and then determine whether to perform a device unlocking operation based on the fingerprint matching result. The device unlocking operation refers to changing the electronic device 100 from a lock screen state to an unlocked state. In the unlocked state, the electronic device 100 can provide all functions that the electronic device 100 can perform.

[0062] As shown in FIG1B , the application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions. For example, the application framework layer may include a window manager, a content provider, a telephony manager, a resource manager, a notification manager, etc., wherein:

[0063] The 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, take screenshots, etc.

[0064] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0065] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including answering, hanging up, etc.).

[0066] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0067] The Notification Manager allows applications to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically without user interaction. For example, the Notification Manager is used to notify users of completed downloads and message reminders. The Notification Manager can also display notifications in the top status bar of the system as icons or scrolling text, such as notifications from background applications, or as dialog windows on the screen. Examples include text messages in the status bar, beeps, vibrations on electronic devices, and flashing indicator lights.

[0068] In an embodiment of the present application, the application framework layer may further include a fingerprint service (FP Service, also referred to as FP framework) 202. The fingerprint service 202 may be used to interact with the lock screen application 201 and the fingerprint hardware abstract layer (FP HAL) 203A for data exchange. For example, the fingerprint service 202 may receive a fingerprint matching result reported by the fingerprint hardware abstract layer 203A, and then report the fingerprint matching result to the lock screen application 201. The fingerprint service 202 may also be used to receive data information reported by the sensor. For example, the fingerprint service 202 may receive data information such as the angle information of the electronic device 100 reported by the acceleration sensor and the proximity light state reported by the proximity light sensor.

[0069] As shown in Figure 1B, the hardware abstraction layer is located between the kernel layer and the application framework layer, playing a connecting role. Specifically, the hardware abstraction layer defines a set of standard interfaces, including the fingerprint hardware abstraction layer 203A, the gesture sensor hardware abstraction layer (which can be simply referred to as the gesture HAL) 203B, the proximity light hardware abstraction layer (optionally, can be simply referred to as the proximity light HAL) 203C, and the camera hardware abstraction layer (Camera HAL) (not shown), etc. Among them, the set of interfaces defined by the fingerprint hardware abstraction layer 203A can be used for fingerprint service 202 to call and coordinate the fingerprint sensor driver in the sensor driver 204 to control the normal operation of the fingerprint sensor. The fingerprint hardware abstraction layer 203A can also match the fingerprint feature information reported by the fingerprint sensor with the fingerprint feature information in the fingerprint template to determine the fingerprint matching result, etc. The set of interfaces defined by the gesture HAL 203B can be used for fingerprint service 202 to call and coordinate the gesture sensor driver in the sensor driver 204 to control the normal operation of the gesture sensor. A set of interfaces defined by the proximity light HAL 203C can be used for calling by the fingerprint service 202 and coordinating the proximity light sensor driver in the sensor driver 204 to control the normal operation of the proximity light sensor.

[0070] The kernel layer is the layer between hardware and software. It includes at least a display driver, a camera driver, an audio driver, and a sensor driver 204. The sensor driver 204 can include sensor drivers corresponding to multiple sensors, such as a fingerprint sensor driver, a proximity sensor driver, and a gesture sensor driver. Each sensor driver in the sensor driver 204 can be used to control the corresponding sensor to collect data information. For example, the fingerprint sensor driver can control the fingerprint sensor to collect fingerprint feature information, the gesture sensor driver can control the gesture sensor to collect angular velocity information or acceleration information, and the proximity sensor driver can control the proximity light value collected by the proximity sensor.

[0071] The software structure shown in FIG1B is only used to exemplify the present application and does not constitute any limitation to the present application.

[0072] Based on the above introduction to the software and hardware structure, the appearance of the electronic device 100 provided in this application will be described below.

[0073] 2A-2B exemplarily show the appearance of an electronic device 100 provided in an embodiment of the present application.

[0074] As shown in FIG2A , the electronic device 100 may include a display screen 104, an on / off button 108, a front-facing camera 109, and a fingerprint collection area 110. The fingerprint collection area 110 may be located anywhere on the side frame of the electronic device 100, such as, for example, below the on / off button 108 as shown in FIG2A . The fingerprint collection area 110 may be integrated with a fingerprint sensor. When the electronic device 100 detects that a user's finger touches / presses the fingerprint collection area 110, the fingerprint sensor may capture fingerprint feature information of the finger.

[0075] 2B , the electronic device 100 may further include a proximity light sensor 111. The proximity light sensor 111 may be disposed in an area near the front camera 109, for example, on the left side of the front camera 109 as shown in FIG2B .

[0076] 2A and 2B are merely used to exemplify the present application and do not constitute any limitation to the present application. In a specific implementation, the appearance of the electronic device 100 may also be different from the examples shown in FIG. 2A and FIG. 2B .

[0077] In conjunction with the above description of the appearance of the electronic device 100, some exemplary scenarios that may easily cause misinterpretation of fingerprint locks are introduced below.

[0078] As shown in Figure 3A, when a user is holding the electronic device 100 and placing it in their pocket, and the electronic device 100 is in the locked screen state, the user's finger may accidentally touch or press the fingerprint collection area 110 on the side of the electronic device 100. At this time, the fingerprint sensor can collect the fingerprint feature information of the user's finger, and the electronic device 100 can match the fingerprint feature information with the preset fingerprint template. If the match is successful, the electronic device 100 will execute the device unlocking operation, changing the electronic device 100 from the locked screen state to the unlocked state. However, in this scenario, the user has no intention of using the electronic device 100, which may lead to the problem of misunderstanding and locking the electronic device 100.

[0079] As shown in Figure 3B, when a user is running while holding the electronic device 100 and the electronic device 100 is in the locked state, as the user's body posture changes, the user's finger may inadvertently touch / press the fingerprint collection area 110 on the side of the electronic device 100. At this time, the fingerprint sensor can collect the fingerprint feature information of the user's finger, and the electronic device 100 can match the fingerprint feature information with the preset fingerprint template. If the match is successful, the electronic device 100 will execute the device unlocking operation, changing the electronic device 100 from the locked state to the unlocked state. However, in this scenario, the user has no intention of using the electronic device 100, which may also lead to the problem of misunderstanding and locking the electronic device 100.

[0080] FIG3A-FIG3B are only used to illustrate the present application and do not constitute any limitation to the present application. In a specific implementation, there may be other scenarios different from FIG3A-FIG3B that are likely to cause fingerprint misinterpretation.

[0081] Next, a fingerprint recognition process provided by an embodiment of the present application is introduced.

[0082] As shown in FIG4 , the process may specifically include:

[0083] S401: When the electronic device 100 is in the lock screen state, the electronic device 100 triggers the FP Service through the lock screen application to monitor the gesture sensor and the proximity light sensor.

[0084] In an embodiment of the present application, the FP Service can register a posture sensor monitoring interface and a proximity light sensor monitoring interface. When the electronic device 100 is in the lock screen state, the lock screen application can trigger the FP Service to receive the angle information reported by the posture sensor via the posture HAL through the posture sensor monitoring interface, and receive the proximity light state reported by the proximity light sensor via the proximity light HAL through the proximity light sensor monitoring interface. Among them, the proximity light state can be divided into a proximity state and a distance state. The proximity state is used to indicate that there is an object blocking the electronic device 100, and the distance state is used to indicate that there is no object blocking the electronic device 100.

[0085] Specifically, in an embodiment of the present application, the electronic device 100 may have two states: a locked screen state and an unlocked state. The locked screen state may refer to a state in which some functions in the electronic device 100 are locked, that is, the electronic device 100 does not provide some functions. The functions provided by the electronic device 100 in the locked screen state have relatively low requirements for data security, such as: answering calls, hanging up calls, adjusting the volume of music, starting the camera application, turning on / off airplane mode, etc. In the unlocked state, the electronic device 100 can not only provide the above-mentioned functions with low data security requirements, but also provide functions with high data security requirements, such as: starting some applications (such as WeChat applications), and the functions provided by the application (for example, displaying the WeChat payment interface). In other words, in the unlocked state, the electronic device 100 can provide all the functions that the electronic device 100 can perform.

[0086] When the electronic device 100 is in the lock screen state, the screen (also referred to as a display screen or touch screen) interface of the electronic device 100 may have the following types: a screen-off interface, an always on display (AOD) interface, and a lock screen interface. Among them, the screen-off interface may refer to: when the electronic device 100 is in the lock screen state, the display of the electronic device 100 is dormant and becomes a black screen, and the screen does not display interface elements, but other devices and programs are working normally. The AOD interface may refer to: when the electronic device 100 is in the lock screen state, a part of the screen on the electronic device 100 remains always on for displaying information such as time and notifications. The lock screen interface may refer to: when the electronic device 100 is in the lock screen state, all pixels on the screen of the electronic device 100 are lit.

[0087] As shown in Figure 5A, the electronic device 100 can display the AOD interface 20 when the screen is locked. The AOD interface 20 may include: a calendar indicator, a battery status indicator, an image specified by the user for display, etc. Among them, the calendar indicator can be used to indicate the current time, such as the date, day of the week, and hour and minute information, etc. In the AOD interface 20, the calendar indicator can be the text information "08:08", "June 13", "Monday", and "May 15th, Renyin Year". The battery status indicator can be used to indicate the current battery power. Not limited to the above-mentioned interface elements, the AOD interface can also display notification information, other icons, etc., which are not limited in this application.

[0088] As shown in FIG5B , the electronic device 100 may display a lock screen interface 21 when in the lock screen state. The lock screen interface 21 may include: a status bar and a calendar indicator, etc. The status bar may include one or more signal strength indicators of mobile communication signals (also known as cellular signals), one or more signal strength indicators of wireless high-fidelity (Wi-Fi) signals, a battery status indicator, etc. The description of the calendar indicator can refer to the description of the embodiment shown in FIG5A and will not be repeated here.

[0089] As shown in Figure 5C, the electronic device 100 can display a screen-off interface 22 when in a locked screen state. The screen-off interface 22 is a black screen, and no interface elements are displayed on the screen.

[0090] FIG. 5A to FIG. 5C are merely used to exemplify the present application and do not constitute any limitation to the present application.

[0091] S402: The electronic device 100 triggers the fingerprint sensor to monitor finger touch events through the lock screen application.

[0092] In the embodiment of the present application, a finger touch event is when a user's finger touches / presses the fingerprint collection area. The fingerprint sensor can use capacitive fingerprint recognition technology, and the specific implementation method of monitoring the finger touch event can be as follows:

[0093] As shown in FIG5D , the fingerprint collection area on electronic device 100 can be integrated with a fingerprint sensor. This fingerprint sensor can include a silicon crystal sensor or other device. The silicon crystal sensor can include multiple monitoring points for collecting hand information, each with the same area S. When a user's finger touches or presses the fingerprint collection area, the finger skin surface can align with the monitoring points one by one to form capacitors. The raised areas on the finger skin surface can be called "ridges," and the depressed areas on the finger skin surface can be called "grooves." The distance between a ridge and a monitoring point, forming a ridge capacitor, is shorter than the distance between a groove and a monitoring point, forming a groove capacitor. Therefore, the capacitance of a ridge capacitor is greater than that of a groove capacitor. Electronic device 100 can charge each monitoring point to a preset voltage. Then, when a user's finger touches or presses the fingerprint collection area, each monitoring point can discharge. Because the capacitance of the ridge capacitor is higher, the ridge detection point discharges more slowly. Because the capacitance of the groove capacitor is lower, the groove detection point discharges more quickly. When the fingerprint sensor detects discharge changes at one or more detection points, the electronic device 100 can determine that the user's finger touches / presses the fingerprint collection area.

[0094] Not limited to capacitive fingerprint recognition technology, in a specific implementation, the fingerprint sensor may also adopt other technical solutions to monitor finger touch events, and this application does not impose any restrictions on this.

[0095] S403A: In response to the user's touch operation on the fingerprint collection area, the electronic device 100 can receive the finger touch event reported by the fingerprint sensor through the FP HAL.

[0096] Specifically, the user's touch operation on the fingerprint collection area may include a touch operation in which the user's finger touches or presses the fingerprint collection area. In response to the user's touch operation on the fingerprint collection area, the fingerprint sensor may determine a finger touch event based on detecting a discharge change at one or more detection points, and then report the finger touch event to the FP HAL.

[0097] S403B: The electronic device 100 triggers the fingerprint sensor through the FP HAL to collect and report fingerprint feature information.

[0098] In this embodiment of the present application, when the FP HAL receives a finger touch event, the FP HAL can send fingerprint collection instruction information to the fingerprint sensor, triggering the fingerprint sensor to collect fingerprint feature information of the user's finger touching / pressing the fingerprint collection area. The fingerprint sensor can then determine the fingerprint feature information based on the discharge changes at each detection point and report the fingerprint feature information to the FP HAL.

[0099] S403C: The electronic device 100 matches the collected fingerprint feature information with the fingerprint template through the FP HAL to obtain a matching result.

[0100] In an embodiment of the present application, the electronic device 100 may pre-store a fingerprint template, which may include fingerprint feature information used by the electronic device 100 to perform a device unlocking operation. When the FP HAL receives the fingerprint feature information collected by the fingerprint sensor, the FP HAL may match the collected fingerprint feature information with the fingerprint template, that is, the FP HAL may calculate the similarity between the collected fingerprint feature information and the fingerprint feature information in the fingerprint template according to a specified algorithm. When the similarity is greater than or equal to a preset threshold value A1 (for example, 0.7, 0.8, etc.), the FP HAL may determine that the match is successful; when the similarity is less than the preset threshold value A1, the FP HAL may determine that the match fails. The specified algorithm may be a matching algorithm based on Hough transform, a matching algorithm based on string distance, etc., which is not limited in the embodiment of the present application.

[0101] S404: The electronic device 100 receives the finger touch event reported by the FP HAL through the FP Service.

[0102] That is to say, the fingerprint sensor can report the finger touch event to the FP HAL, and then the FP HAL reports the finger touch event to the FP Service.

[0103] S405: When the FP Service receives the finger touch event, the electronic device 100 determines whether the posture of the electronic device 100 is the preset posture 1 through the FP Service.

[0104] Specifically, in order to illustrate the posture of the electronic device 100 , a coordinate system established based on the electronic device 100 is first introduced.

[0105] As shown in Figure 5E, the side of the electronic device 100 with the power button is the right side, the side without the power button is the left side, the side with the front camera is the top, and the side with the charging port is the tail. The center of the electronic device 100 is the origin O of the coordinate system, the direction of the charging port pointing to the front camera is the positive direction of the Y axis, the direction pointing to the display screen of the electronic device 100 facing outward is the positive direction of the Z axis, and the direction from the left side to the right side is the positive direction of the X axis. The direction from the charging port to the front camera can also be regarded as the reference direction. Based on this coordinate system, the pitch angle (pitch) and roll angle (roll, also called tumble angle, flip angle) of the electronic device 100 are defined as follows:

[0106] The pitch angle indicates the angle at which the top or tail of the electronic device 100 is tilted. When the electronic device 100 is placed horizontally with the display screen facing upward, the pitch angle is 0 degrees. When the top of the electronic device 100 is lifted upward, the electronic device 100 is rotated 180 degrees along the X-axis until it is placed horizontally with the display screen facing downward. During this process, the pitch angle changes from 0 degrees to -180 degrees. When the tail of the electronic device 100 is lifted upward, the electronic device 100 is rotated 180 degrees along the X-axis until it is placed horizontally with the display screen facing downward. During this process, the pitch angle changes from 0 degrees to 180 degrees.

[0107] The roll angle indicates the tilt angle of the left or right side of the electronic device. When the electronic device 100 is placed horizontally with the display facing upward, the roll angle is 0 degrees. When the left side of the electronic device 100 is lifted upward, the electronic device 100 rotates along the Y axis until the display is perpendicular to the ground. During this process, the roll angle changes from 0 degrees to -90 degrees. When the right side of the electronic device 100 is lifted upward, the electronic device 100 rotates along the Y axis until the display is perpendicular to the ground. During this process, the roll angle changes from 0 degrees to 90 degrees.

[0108] In an embodiment of the present application, the FP Service may receive the pitch angle value reported by a posture sensor (e.g., an accelerometer or a gyroscope sensor, etc.). When the pitch angle value is within the range of a preset threshold value A2 (e.g., [-90 degrees, 15 degrees]), the FP Service may determine that the posture of the electronic device 100 is the preset posture 1; otherwise, the FP Service may determine that the posture of the electronic device 100 is not the preset posture 1. The preset threshold value A2 is not limited to [-90 degrees, 15 degrees], and may also be other values ​​in actual implementation, which is not limited by the present application.

[0109] According to the coordinate system shown in FIG5E , the preset posture 1 in this step can be as follows:

[0110] As shown in FIG5F , taking the preset threshold value A2 [−90 degrees, 15 degrees] as an example, the preset posture 1 of the electronic device 100 may include three angles of 15 degrees, −45 degrees, and −90 degrees as exemplarily shown in FIG5F .

[0111] S406: When the posture of the electronic device 100 is not the preset posture 1, the electronic device 100 determines through the FP Service whether the proximity light state reported by the proximity light sensor is the proximity state.

[0112] In an embodiment of the present application, the FP Service can receive the proximity light state reported by the proximity light sensor. When the proximity light sensor detects a value of the proximity light between [0.0f, 5.0f), the proximity light sensor can output 0cm to indicate that the proximity light state is a close state, which means that there is an object blocking the electronic device 100; when the proximity light sensor detects a value of the proximity light greater than or equal to 5.0f, the proximity light sensor can output 5cm to indicate that the proximity light state is a far state, which means that there is no object blocking the electronic device 100. Wherein, f refers to the value type as a floating point type (float).

[0113] S407: When the proximity light state is the proximity state, the electronic device 100 indicates to the FP HAL through the FP Service that the proximity light state is the proximity state.

[0114] Specifically, when the FP Service determines that the proximity light state reported by the proximity light sensor is the proximity state, the FP Service may send proximity state indication information to the FP HAL to indicate to the FP HAL that the proximity light state is the proximity state.

[0115] S408: The electronic device 100 does not report the matching result through the FP HAL.

[0116] In this embodiment of the present application, the FP HAL can match the collected fingerprint feature information with the fingerprint feature information in the fingerprint template in the manner described in the aforementioned step S403C to obtain a matching result. When the FP HAL receives the proximity indication information, the FP HAL does not report the matching result to the FP Service.

[0117] S409: In some examples, the electronic device 100 clears the matching results reported by the FP HAL through the FP Service.

[0118] In one possible implementation, if the FP Service's determination of the electronic device 100's posture and / or detection of the proximity light state is blocked by other processes, resulting in a slow computation, while the FP HAL's matching of fingerprint feature information is faster, to ensure the user's unlocking experience, the FP HAL will report the matching result to the FP Service even if the proximity light state is not received. In other words, when the FP Service sends the proximity state indication information to the FP HAL, the FP HAL has already reported the matching result to the FP Service, at which point the FP Service can clear the matching result.

[0119] S410: When the posture of the electronic device 100 is the preset posture 1, or the electronic device 100 is not the preset posture 1 and it is determined that the proximity light state is the far state, the electronic device 100 indicates to the FP HAL through the FP Service that the proximity light state is the far state.

[0120] Among them, when the posture of the electronic device 100 is the preset posture 1, it can represent that the user has the intention to use the electronic device 100. Therefore, the electronic device 100 can no longer detect the proximity light state. Regardless of whether the proximity light state reported by the proximity light sensor is the proximity state or the distance state, the FP Service indicates to the FP HAL that the proximity light state is the distance state, so that the FP HAL reports the matching result.

[0121] Specifically, the FP Service may send the away state indication information to the FP HAL, so as to indicate to the FP HAL that the approaching light state is the away state.

[0122] S411: The electronic device 100 receives the matching result reported by the FP HAL through the FP Service.

[0123] That is, when the FP HAL receives the away state indication information, the FP HAL may report the result of matching the collected fingerprint feature information with the fingerprint feature information in the fingerprint template to the FP Service.

[0124] S412: The electronic device 100 receives the matching result reported by the FP Service through the lock screen application.

[0125] S413: The electronic device 100 performs corresponding operations according to the matching results through the lock screen application.

[0126] In the embodiment of the present application, when the matching result is a successful match, the lock screen application can perform a device unlocking operation, changing the electronic device 100 from a locked screen state to an unlocked state; when the matching result is a failed match, the lock screen application does not perform the device unlocking operation, and maintains the current locked screen state of the electronic device 100. In some implementations, when the matching result is a failed match, the lock screen application can also trigger the electronic device 100 to output a matching failure prompt message on the lock screen interface to inform the user that the fingerprint unlocking operation of the electronic device 100 was unsuccessful.

[0127] As shown in Figure 5G, if the electronic device 100 displays a screen-off interface in the lock screen state, when the match is successful, the lock screen application can perform the device unlocking operation, changing the electronic device 100 from the lock screen state to the unlocked state, and the screen-off interface of the electronic device 100 can be changed to the desktop 24. The desktop 24 can display one or more application icons (including a weather application icon, a stock application icon, a calculator application icon, an email application icon, a theme application icon, and a calendar application icon, etc.). Optionally, the desktop 24 can also display a status bar, a page indicator, and a tray icon area. Among them, the status bar may include one or more signal strength indicators of a mobile communication signal (also known as a cellular signal), a signal strength indicator of a wireless fidelity (Wi-Fi) signal, a battery status indicator, a time indicator, etc. The page indicator can be used to indicate the positional relationship between the currently displayed page and other pages. The tray icon area includes multiple tray icons (such as a dial application icon, a message application icon, and a contact application icon, etc.), and the tray icon remains displayed when the page is switched. The above page may also include multiple application icons and page indicators. The page indicator may not be part of the page but may exist independently. The above tray icon is also optional, and the embodiment of the present application does not limit this.

[0128] As shown in Figure 5H, if the electronic device 100 displays a screen-off interface in the lock screen state, when the matching fails, the lock screen application does not perform the device unlocking operation, and maintains the current lock screen state of the electronic device 100. The electronic device 100 can display the lock screen interface and output a matching failure prompt message, which can be a text message such as "Fingerprint unlocking failed, please unlock again."

[0129] As can be seen from the process shown in Figure 4, the fingerprint recognition process can be applied in limited scenarios. For example, it can be applied to the pocket scenario shown in Figure 3A to prevent the problem of mistaking the electronic device 100 for locking in this scenario. However, in the scenario shown in Figure 3B, since the electronic device 100 is exposed and not blocked, when the posture of the electronic device 100 is not the preset posture 1, the proximity light state reported by the proximity light sensor is the distance state, and the electronic device 100 performs the device unlocking operation based on steps S410 to S413. This process cannot prevent the problem of mistaking the lock in the scenario of Figure 3B. In addition, if the electronic device 100 is not provided with a proximity light sensor, the process shown in Figure 4 cannot be applied.

[0130] Therefore, the present application provides a fingerprint recognition method, which may include: when the electronic device is in a locked state and placed in the user's pocket or the user is holding the electronic device and moving it, when the electronic device detects that the user's finger touches the fingerprint sensor, the electronic device obtains the posture information of the electronic device and collects fingerprint feature information through the fingerprint sensor. The electronic device matches the fingerprint feature information with a preset fingerprint template and the match is successful. If the posture of the electronic device is a first preset posture, the electronic device performs a device unlocking operation. If the posture of the electronic device is not the first preset posture but is a second preset posture, the electronic device performs a device unlocking operation.

[0131] The fingerprint recognition method provided in this application can prevent the electronic device 100 from being mistakenly locked in a variety of application scenarios (for example, the pocket scenario in Figure 3A and the running scenario in Figure 3B). It can also be applied to electronic devices that are not equipped with proximity light sensors, thereby reducing the power consumption of the electronic device.

[0132] FIG6A is a specific flow chart of a fingerprint recognition method provided in an embodiment of the present application.

[0133] As shown in FIG6A , the method may specifically include:

[0134] S601: When the electronic device 100 is in the screen lock state, the electronic device 100 monitors finger touch events through the fingerprint sensor.

[0135] Specifically, for the description of the lock screen state and the fingerprint sensor monitoring finger touch events, please refer to the description in the embodiment shown in Figure 4 above, which will not be repeated here.

[0136] In the embodiment of the present application, when the electronic device 100 is in the locked screen state and placed in the user's pocket or the user is holding the electronic device 100 and moving around (for example, running, walking, etc.), the electronic device 100 may execute S601 and subsequent steps. Without limitation, the electronic device 100 may also execute S601 and subsequent steps when in the locked screen state in other scenarios. In other words, this application does not limit the scenario in which the electronic device 100 is in the locked screen state.

[0137] S602: When the electronic device 100 detects a finger touch event in response to a user's touch operation on the fingerprint collection area, the electronic device 100 detects the posture of the electronic device 100 through the posture sensor.

[0138] In an embodiment of the present application, the posture sensor may include an accelerometer and / or a gyroscope. The accelerometer may detect the magnitude of the acceleration of the electronic device 100 in various directions (generally the x, y, and z axes), and calculate the pitch angle value / roll angle value of the electronic device 100 based on the magnitude of the acceleration in various directions; the gyroscope may detect the angular velocity of the electronic device 100 around three axes (i.e., the x, y, and z axes), and calculate the pitch angle value / roll angle value of the electronic device 100 based on the angular velocity of the three axes. Without being limited to this, in a specific implementation, the posture sensor may also detect the posture of the electronic device 100 in other ways.

[0139] In some implementations, because the roll angle value output by the attitude sensor is different from the actual roll angle value corresponding to the actual attitude of the electronic device 100, when the roll angle value output by the attitude sensor is incorrect, the electronic device 100 can correct the output roll angle value to the actual roll angle value according to a specified smart attitude algorithm. The smart attitude algorithm can be an algorithm based on a neural network, such as a convolutional neural network (CNN) algorithm, a recurrent neural network (RNN) algorithm, etc., and this application does not limit this.

[0140] S603: The electronic device 100 collects fingerprint feature information through the fingerprint sensor.

[0141] Specifically, regarding the implementation method of the fingerprint sensor collecting fingerprint feature information, reference may be made to the description in the embodiment shown in FIG4 , which will not be repeated here.

[0142] S604: When the electronic device 100 matches the collected fingerprint feature information with the preset fingerprint template, a matching result is obtained.

[0143] Specifically, regarding the implementation manner of the electronic device 100 matching the collected fingerprint feature information with the fingerprint template, reference may be made to the description in the embodiment shown in FIG. 4 , which will not be repeated here.

[0144] S605: The electronic device 100 determines whether the posture of the electronic device 100 is the preset posture 2.

[0145] In the embodiment of the present application, when the pitch angle value of the electronic device 100 is within the range of a preset threshold value A3 (e.g., [-165 degrees, 15 degrees]), the electronic device 100 may determine that the posture of the electronic device 100 is preset posture 2; otherwise, the electronic device 100 may determine that the posture of the electronic device 100 is not preset posture 2. The preset threshold value A3 is not limited to [-165 degrees, 15 degrees], and in actual implementation, it may also take other values, which is not limited by the present application.

[0146] Specifically, according to the coordinate system shown in FIG5E , the preset posture 2 of this step can be as follows:

[0147] As shown in FIG6B , taking the preset threshold value A3 as [−165 degrees, 15 degrees] as an example, the preset posture 1 of the electronic device 100 may include the three angles of −165 degrees, −45 degrees, and 15 degrees exemplarily shown in FIG6B .

[0148] S606: When the posture of the electronic device 100 is not the preset posture 2, the electronic device 100 determines whether the posture of the electronic device 100 is the preset posture 3.

[0149] In an embodiment of the present application, when the roll angle value of the electronic device 100 changes by more than a preset angle B1 (e.g., 30 degrees, etc.) within a specified time period T1 (e.g., 200 milliseconds, etc.) from the time point when the electronic device determines that the posture is not the preset posture 2 or the time point when a finger touch event is detected, and remains stationary within a preset threshold value A4 (e.g., -60 degrees to 60 degrees, etc.) for more than a specified time period T2 (e.g., 100 milliseconds, etc.), the electronic device 100 may determine that the posture of the electronic device 100 is the preset posture 3; otherwise, the electronic device 100 determines that the posture of the electronic device 100 is not the preset posture 3. Without being limited to the above example, the specific values ​​of the specified time period T1, the specified time period T2, the preset angle B1, and the preset threshold value A4 may be other values.

[0150] Specifically, the preset posture 3 of this step can be as follows:

[0151] As shown in FIG6C , for example, the preset posture 3 of the electronic device 100 may be a posture in which the electronic device 100 rolls left or right. The roll angle corresponding to the preset posture 3 changes by more than 30 degrees within 200 milliseconds, and the roll angle remains stationary between -60 degrees and 60 degrees for more than 1 second.

[0152] S607: When the posture of the electronic device 100 is neither the preset posture 2 nor the preset posture 3, the electronic device 100 maintains the locked screen state.

[0153] Specifically, when the posture of the electronic device 100 is neither the preset posture 2 nor the preset posture 3, regardless of whether the collected fingerprint feature information and the fingerprint template are matched successfully, the electronic device 100 does not perform the device unlocking operation, but maintains the lock screen state.

[0154] It should be noted that the preset threshold value A2 range corresponding to the preset posture 1 in the process shown in Figure 4 (for example, [-90 degrees, 15 degrees] in the aforementioned example) is smaller than the preset threshold value A3 range corresponding to the preset posture 2 in the process shown in Figure 6A (for example, [-165 degrees, 15 degrees] in the aforementioned example). In this way, the process of the electronic device 100 shown in Figure 6A not using proximity light can be applied to the application scenarios covered when using proximity light as shown in Figure 4 (for example, the user uses the electronic device 100 while lying on a bed or sofa). Therefore, the process shown in Figure 6A can be applied to a wider range of electronic device 100 usage scenarios than the process shown in Figure 4, and can also reduce the power consumption of the electronic device 100.

[0155] S608: When the posture of the electronic device 100 is the preset posture 2, or the posture of the electronic device 100 is not the preset posture 2 but the preset posture 3, the electronic device 100 performs a corresponding operation according to the matching result.

[0156] Specifically, when the posture of the electronic device 100 is the preset posture 2, or, not the preset posture 2 but the preset posture 3, if the collected fingerprint feature information matches the fingerprint template successfully, the electronic device 100 performs the device unlocking operation, and the interface changes can refer to the aforementioned Figure 5G; if the collected fingerprint feature information fails to match the fingerprint template, the electronic device 100 does not perform the device unlocking operation and maintains the lock screen state. The interface on the electronic device 100 can refer to the aforementioned Figure 5H.

[0157] In combination with the embodiment of FIG6A , FIG7 is a module interaction flow of a fingerprint recognition method provided in an embodiment of the present application.

[0158] As shown in FIG7 , the module interaction process may specifically include:

[0159] S701: The lock screen application 201 determines that the electronic device 100 is in the lock screen state.

[0160] Specifically, when the display screen 104 of the electronic device 100 displays the lock screen interface, the AOD interface, or turns off the screen without displaying any information, the lock screen application 201 can determine that the electronic device 100 is in the lock screen state. For a description of the lock screen interface, the AOD interface, or the screen turning off the screen without displaying any information displayed on the corresponding display screen 104 when the electronic device 100 is in the lock screen state, reference can be made to the description in the aforementioned embodiment, which will not be repeated here.

[0161] S702: When the electronic device 100 is in the screen lock state, the screen lock application 201 sends an instruction message M1 for monitoring finger touch events to the FP Service 202.

[0162] S703: FP Service 202 sends instruction information M1 to FP HAL 203A.

[0163] S704: FP Service 202 sends instruction information M1 to the fingerprint sensor.

[0164] S705: When the fingerprint sensor receives the indication information M1, in response to the user's touch operation on the fingerprint collection area, the fingerprint sensor sends the finger touch event to the FP Service 202 through the FP HAL 203A.

[0165] S706: FP Service 202 sends instruction information M2 for monitoring the posture of the electronic device 100 to the posture HAL 203B.

[0166] Specifically, FP Service 202 may register a posture sensor monitoring interface, and then send the indication information M2 to the posture HAL 203B through the posture sensor monitoring interface.

[0167] S707: The attitude HAL 203B sends an instruction message M2 to the attitude sensor.

[0168] S708: FP HAL 203A sends instruction information M3 for collecting fingerprint feature information to the fingerprint sensor.

[0169] S709: When the fingerprint sensor receives the indication information M3, it collects fingerprint feature information.

[0170] S710: The fingerprint sensor sends the collected fingerprint feature information to FP HAL203A.

[0171] S711: FP HAL203A matches the collected fingerprint feature information with the preset fingerprint template to obtain a matching result.

[0172] S712: When the attitude sensor receives the indication information M2, the attitude sensor sends the angle data 1 and the angle data 2 to the FP Service 202 through the attitude HAL.

[0173] The angle data 1 may include the value of the pitch angle, and the angle data 2 may include the value of the roll angle.

[0174] S713: FP Service 202 determines whether the posture of the electronic device 100 is the preset posture 2 based on the angle data 1.

[0175] Specifically, the implementation method of determining whether the posture of the electronic device 100 is the preset posture 2 can refer to the description in the above embodiment, which will not be repeated here.

[0176] S714: When the posture of the electronic device 100 is not the preset posture 2, the FP Service 202 determines whether the posture of the electronic device 100 is the preset posture 3 based on the angle data 2.

[0177] Specifically, the implementation method of determining whether the posture of the electronic device 100 is the preset posture 3 can refer to the description in the above embodiment, which will not be repeated here.

[0178] S715: When the posture of the electronic device 100 is not the preset posture 2 but the preset posture 3, or when the posture of the electronic device 100 is the preset posture 2, the FP Service 202 sends an indication message M4 to the FP HAL 203A for instructing to report the matching result.

[0179] S716: When FP HAL 203A receives the indication information M4, FP HAL 203A reports the matching result to FP Service 202.

[0180] S717: FP Service 202 reports the matching result to the lock screen application 201.

[0181] S718: The lock screen application 201 performs corresponding operations based on the matching results.

[0182] Specifically, the lock screen application 201 performs corresponding operations according to the matching results. Please refer to the corresponding description in the aforementioned embodiment, which will not be repeated here.

[0183] S719: When the posture of the electronic device 100 is neither the preset posture 2 nor the preset posture 3, the FP Service 202 sends an indication message M5 to the FP HAL 203A for indicating not to report the matching result.

[0184] In some embodiments, when FP Service 202's determination of the electronic device 100's posture and / or detection of the proximity light state is blocked by other processes, resulting in a slow computation, while FP HAL 203A's matching of fingerprint feature information is faster, to ensure the user's unlocking experience, FP HAL 203A may report the matching result to FP Service 202 even if it has not received the proximity light state. In other words, FP HAL 203A may report the matching result to FP Service 202 even if it has not received indication message M4 / indication message M5. Therefore, when FP HAL 203A receives indication message M5, FP HAL 203A has already reported the matching result to FP Service 202, and FP Service 202 may clear the matching result.

[0185] FIG8 is a flow chart of another fingerprint recognition method provided in an embodiment of the present application.

[0186] As shown in FIG8 , the fingerprint recognition method may specifically include the following steps:

[0187] S801: When the electronic device 100 is in the screen lock state, the electronic device 100 monitors finger touch events through the fingerprint sensor.

[0188] Specifically, the description of this step can refer to the description of S601 in Figure 6A above, which will not be repeated here.

[0189] S802: When the electronic device 100 detects a finger touch event in response to a user's touch operation on the fingerprint collection area, the electronic device 100 detects the posture of the electronic device 100 through the posture sensor and detects the proximity light state of the electronic device 100 through the proximity light sensor.

[0190] Specifically, the description of this step can refer to the description of S602 in Figure 6A above, which will not be repeated here.

[0191] S803: The electronic device 100 collects fingerprint feature information through the fingerprint sensor.

[0192] Specifically, the description of this step can refer to the description of S603 in Figure 6A above, which will not be repeated here.

[0193] S804: The electronic device 100 matches the collected fingerprint feature information with a preset fingerprint target to obtain a matching result.

[0194] Specifically, the description of this step can refer to the description of S604 in Figure 6A above, which will not be repeated here.

[0195] S805: The electronic device 100 determines whether the posture of the electronic device 100 is the preset posture 1.

[0196] Specifically, the electronic device 100 can receive the value of the pitch angle reported by a posture sensor (for example, an acceleration sensor or a gyroscope sensor, etc.). When the value of the pitch angle is within the range of a preset threshold value A2 (for example, [-90 degrees, 15 degrees]), the electronic device 100 can determine that the posture of the electronic device 100 is the preset posture 1; otherwise, the electronic device 100 can determine that the posture of the electronic device 100 is not the preset posture 1. Not limited to [-90 degrees, 15 degrees], in actual implementation, the preset threshold value A2 can also be other values, and this application does not impose any restrictions on this. For other descriptions of the preset posture 1, please refer to the description of the aforementioned embodiment and will not be repeated here.

[0197] S806: When the posture of the electronic device 100 is not the preset posture 1, the electronic device 100 determines whether the proximity state of the electronic device 100 is the distance state, and whether the posture is the preset posture 3.

[0198] Specifically, when the roll angle value of the electronic device 100 changes by more than a preset angle B1 (for example, 30 degrees, etc.) within a specified time period T1 (for example, 200 milliseconds, etc.) from the time point when the electronic device determines that the posture is not the preset posture 1 or the time point when the finger touch event is detected, and remains stationary at a preset threshold value A4 (for example, -60 degrees to 60 degrees, etc.) for more than a specified time period T2 (for example, 100 milliseconds, etc.), the electronic device 100 can determine that the posture of the electronic device 100 is the preset posture 3; otherwise, the electronic device 100 determines that the posture of the electronic device 100 is not the preset posture 3. For other explanations about the preset posture 1 and the preset posture 3, please refer to the description of the embodiments shown in Figures 4 and 6A above, which will not be repeated here.

[0199] S807: When the posture of the electronic device 100 is not the preset posture 1, the proximity light state is the proximity state, or the posture is not the preset posture 3, the electronic device 100 maintains the locked screen state.

[0200] That is, in case one: when the posture of the electronic device 100 is neither the preset posture 1 nor the preset posture 3, or, in case two: when the posture of the electronic device 100 is not the preset posture 1 but the preset posture 3, and the proximity to light state is the proximity state, the electronic device 100 maintains the locked screen state.

[0201] Specifically, for the description of the proximity-to-light state and the preset posture 3, reference may be made to the description in the aforementioned embodiment.

[0202] S808: When the posture of the electronic device 100 is the preset posture 1, or the posture of the electronic device 100 is not the preset posture 1 but is the preset posture 3 and the approaching light state is the far state, the electronic device 100 performs a corresponding operation according to the matching result.

[0203] Specifically, regarding the electronic device 100 performing corresponding operations according to the matching results, reference may be made to the description of step S413 in FIG. 4 and step S608 in FIG. 6A .

[0204] In combination with the embodiment of FIG8 , FIG9A is a module interaction flow of a fingerprint recognition method provided in an embodiment of the present application.

[0205] As shown in FIG9A , the module interaction process may include:

[0206] S901: The lock screen application 201 determines that the electronic device 100 is in the lock screen state.

[0207] For the description of this step, please refer to the description of step S701 in FIG. 7 .

[0208] S902: When the electronic device 100 is in the screen lock state, the screen lock application 201 sends an indication message M1 for monitoring finger touch events to the fingerprint sensor through the FP Service 202 and the FP HAL 203A.

[0209] S903: When the fingerprint sensor receives the indication information M1, in response to the user's touch operation on the fingerprint collection area, the fingerprint sensor sends a finger touch event to the FP Service 202 through the FP HAL 203A.

[0210] S904: FP Service 202 sends instruction information M2 for monitoring the posture of the electronic device 100 to the posture sensor through the posture HAL 203B.

[0211] S905: FP Service 202 sends indication information M6 for monitoring the proximity light state of the electronic device 100 to the proximity light sensor via the proximity light HAL 203C.

[0212] S906: FP HAL 203A sends instruction information M3 for collecting fingerprint feature information to the fingerprint sensor.

[0213] S907: The fingerprint sensor collects fingerprint feature information.

[0214] S908: The fingerprint sensor sends the collected fingerprint feature information to the FP HAL 203A.

[0215] S909: FP HAL203A matches the collected fingerprint feature information with the preset fingerprint template to obtain a matching result.

[0216] S910: When the attitude sensor receives the indication information M2, the attitude sensor sends angle data 1 and angle data 2 to FP Service 202 through attitude HAL 203B.

[0217] The angle data 1 may include the value of the pitch angle, and the angle data 2 may include the value of the roll angle.

[0218] S911: When the proximity light sensor receives the indication information M6, the proximity light sensor sends the proximity light status to the FP Service 202 via the proximity light HAL 203C.

[0219] S912: FP Service 202 determines whether the posture of the electronic device 100 is the preset posture 1 based on the angle data 1.

[0220] Specifically, the implementation method of determining whether the posture of the electronic device 100 is the preset posture 1 can refer to the description in the above embodiment, which will not be repeated here.

[0221] S913: When the posture of the electronic device 100 is the preset posture 1, the FP Service 202 sends an instruction message M4 to the FP HAL 203A for instructing to report the matching result.

[0222] S914: When the posture of the electronic device 100 is not the preset posture 1, the FP Service 202 determines whether the approaching light state is the far state, and determines whether the posture of the electronic device 100 is the preset posture 3 according to the angle data 2.

[0223] S915: When the posture of the electronic device 100 is not the preset posture 1 but the preset posture 3 and the proximity-to-light state is the distance state, the FP Service 202 sends an indication message M4 to the FP HAL 203A for instructing to report the matching result.

[0224] S916: When the posture of the electronic device 100 is not the preset posture 1, the posture of the electronic device 100 is not the preset posture 3, or the proximity light state is the proximity state, the FP Service 202 sends an indication message M5 to the FP HAL 203A for indicating not to report the matching result.

[0225] S917: When FP HAL 203A receives the indication information M4, FP HAL 203A reports the matching result to FP Service 202.

[0226] S918: FP Service 202 reports the matching result to the lock screen application 201.

[0227] S919: The lock screen application 201 performs corresponding operations based on the matching results.

[0228] Specifically, the lock screen application 201 performs corresponding operations according to the matching results. Please refer to the corresponding description in the aforementioned embodiment, which will not be repeated here.

[0229] In some embodiments, when FP Service 202's determination of the electronic device 100's posture and / or detection of the proximity light state is blocked by other processes, resulting in a slow computation, while FP HAL 203A's matching of fingerprint feature information is faster, to ensure the user's unlocking experience, FP HAL 203A may report the matching result to FP Service 202 even if it has not received the proximity light state. In other words, FP HAL 203A may report the matching result to FP Service 202 even if it has not received indication message M4 / indication message M5. Therefore, when FP HAL 203A receives indication message M5, FP HAL 203A has already reported the matching result to FP Service 202, and FP Service 202 may clear the matching result.

[0230] In combination with the embodiment of FIG8 , FIG9B is a module interaction flow of a fingerprint recognition method provided in an embodiment of the present application.

[0231] As shown in FIG9B , the module interaction process may include:

[0232] S9001: The lock screen application 201 determines that the electronic device 100 is in the lock screen state.

[0233] For the description of this step, please refer to the description of step S701 in FIG. 7 .

[0234] S9002: When the electronic device 100 is in the screen lock state, the screen lock application 201 sends an indication message M1 for monitoring finger touch events to the fingerprint sensor through the FP Service 202 and the FP HAL 203A.

[0235] S9003: When the fingerprint sensor receives the indication information M1, in response to the user's touch operation on the fingerprint collection area, the fingerprint sensor sends a finger touch event to the FP Service 202 through the FP HAL 203A.

[0236] S9004: FP Service 202 sends instruction information M2 for monitoring the posture of the electronic device 100 to the posture sensor through the posture HAL 203B.

[0237] S9005: FP Service 202 sends indication information M6 for monitoring the proximity light state of the electronic device 100 to the proximity light sensor via the proximity light HAL 203C.

[0238] S9006: FP HAL203A sends instruction information M3 for collecting fingerprint feature information to the fingerprint sensor.

[0239] S9007: The fingerprint sensor collects fingerprint feature information.

[0240] S9008: The fingerprint sensor sends the collected fingerprint feature information to FP HAL203A.

[0241] S9009: FP HAL203A matches the collected fingerprint feature information with the preset fingerprint template to obtain a matching result.

[0242] S9010: When the attitude sensor receives the indication information M2, the attitude sensor sends angle data 1 and angle data 2 to the FP HAL 203A through the attitude HAL 203B.

[0243] The angle data 1 may include the value of the pitch angle, and the angle data 2 may include the value of the roll angle.

[0244] S9011: When the proximity light sensor receives the indication information M6, the proximity light sensor sends the proximity light state to the FP HAL 203A via the proximity light HAL 203C.

[0245] S9012: FP HAL203A determines whether the posture of the electronic device 100 is the preset posture 1 based on the angle data 1.

[0246] Specifically, the implementation method of determining whether the posture of the electronic device 100 is the preset posture 1 can refer to the description in the above embodiment, which will not be repeated here.

[0247] S9013: When the posture of the electronic device 100 is the preset posture 1, the FP HAL 203A reports the matching result to the FP Service 202.

[0248] S9014: When the posture of the electronic device 100 is not the preset posture 1, the FP HAL 203A determines whether the approaching light state is the distant state, and determines whether the posture of the electronic device 100 is the preset posture 3 according to the angle data 2.

[0249] S9015: When the posture of the electronic device 100 is not the preset posture 1 but the preset posture 3 and the proximity-to-light state is the distance state, the FP HAL 203A reports the matching result to the FP Service 202.

[0250] S9016: When the posture of the electronic device 100 is the preset posture 1, the posture of the electronic device 100 is not the preset posture 3, or the proximity light state is the proximity state, the FP HAL 203A ends the process.

[0251] S9017: When FP Service 202 receives the matching result, FP Service 202 reports the matching result to the lock screen application 201.

[0252] S9018: The lock screen application 201 performs corresponding operations based on the matching results.

[0253] Specifically, the lock screen application 201 performs corresponding operations according to the matching results. Please refer to the corresponding description in the aforementioned embodiment, which will not be repeated here.

[0254] In one possible implementation, in the process shown in FIG6A , whether the electronic device 100 collects fingerprint feature information through the fingerprint sensor and matches it with the fingerprint template can be triggered by the posture of the electronic device 100. That is, the electronic device 100 can execute S605 after executing S602, instead of executing S603 and S604. When it is determined that the posture of the electronic device 100 is the preset posture 2, or the posture of the electronic device 100 is not the preset posture 2 but the preset posture 3, the electronic device 100 collects fingerprint feature information through the fingerprint sensor again, and matches the collected fingerprint feature information with the preset fingerprint template to obtain a matching result. Then, the electronic device 100 specifies the corresponding operation based on the matching result.

[0255] In one possible implementation, in the process shown in FIG8 , whether the electronic device 100 collects fingerprint feature information through the fingerprint sensor and matches it with the fingerprint template can be triggered by the posture and proximity to light state of the electronic device 100. That is, the electronic device 100 can execute S805 after executing S802, instead of executing S803 and S804. When it is determined that the posture of the electronic device 100 is the preset posture 1, or the posture of the electronic device 100 is not the preset posture 1 but the preset posture 3 and the proximity to light state is the far state, the electronic device 100 collects fingerprint feature information through the fingerprint sensor again, and matches the collected fingerprint feature information with the preset fingerprint template to obtain a matching result. Then, the electronic device 100 specifies the corresponding operation according to the matching result.

[0256] In an embodiment of the present application, in the implementation method of Figure 6A, the preset posture 2 can be called the first preset posture, and the preset threshold A3 range can be called the first preset range; in the implementation method of Figure 8, the preset posture 1 can be called the first preset posture, and the preset threshold A2 range can be called the first preset range.

[0257] In the embodiment of the present application, the preset posture 3 can be called the second preset posture, the preset angle B1 can be called the first preset angle, the preset threshold A4 range can be called the second preset range, and the specified time length T2 can be called the first specified time length.

[0258] As used in the above embodiments, the term “when…” may be interpreted to mean “if…” or “after…” or “in response to determining…” or “in response to detecting…”, depending on the context. Similarly, the phrases “upon determining…” or “if (stated condition or event) is detected” may be interpreted to mean “if determining…” or “in response to determining…” or “upon detecting (stated condition or event)” or “in response to detecting (stated condition or event)”, depending on the context.

[0259] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk).

[0260] Those skilled in the art will appreciate that all or part of the process steps in the above-described method embodiments can be implemented by a computer program instructing the relevant hardware. The program can be stored in a computer-readable storage medium, and when executed, the program can include the process steps in the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.

Claims

1. A fingerprint recognition method, characterized in that: Applied to an electronic device, the electronic device includes a fingerprint sensor disposed on a side of the electronic device and a posture sensor for detecting posture information of the electronic device, the method comprising: When the electronic device is in a locked state and placed in a user's pocket or the user is holding the electronic device and moving it, when the electronic device detects that the user's finger touches the fingerprint sensor, the electronic device obtains the posture information of the electronic device and collects fingerprint feature information through the fingerprint sensor; The electronic device matches the fingerprint feature information with a preset fingerprint template and the match is successful; If the posture of the electronic device is the first preset posture, the electronic device performs a device unlocking operation; If the posture of the electronic device is not the first preset posture but is the second preset posture, the electronic device performs a device unlocking operation.

2. The method according to claim 1, characterized in that The method further comprises: If the posture of the electronic device is neither the first preset posture nor the second preset posture, the electronic device maintains a locked screen state.

3. The method according to claim 1 or 2, characterized in that If the posture of the electronic device is the first preset posture, the electronic device performs a device unlocking operation, specifically including: If the pitch angle of the electronic device is within a first preset range, the electronic device determines that the posture of the electronic device is the first preset posture; The electronic device performs a device unlocking operation.

4. The method according to claim 3, characterized in that The first preset range is from -165 degrees to 15 degrees.

5. The method according to claim 1, wherein The electronic device further includes a proximity light sensor; When the electronic device detects that the user's finger touches the fingerprint sensor, the electronic device obtains the posture information of the electronic device and collects fingerprint feature information through the fingerprint sensor, specifically including: When the electronic device detects that the user's finger touches the fingerprint sensor, the electronic device obtains the posture information of the electronic device, obtains the proximity light state of the electronic device through the proximity light sensor, and collects fingerprint feature information through the fingerprint sensor; If the posture of the electronic device is not the first preset posture but the second preset posture, the electronic device performs a device unlocking operation, specifically including: If the posture of the electronic device is not the first preset posture but is the second preset posture, and the proximity-to-light state is the distance state, the electronic device performs a device unlocking operation.

6. The method according to claim 5, characterized in that The method further comprises: If the posture of the electronic device is neither the first preset posture nor the second preset posture, the electronic device maintains the screen lock state; If the posture of the electronic device is not the first preset posture but the second preset posture, and the proximity-to-light state is the proximity state, the electronic device maintains the screen-locked state.

7. The method according to claim 5 or 6, characterized in that If the posture of the electronic device is the first preset posture, the electronic device performs a device unlocking operation, specifically including: If the pitch angle of the electronic device is within a first preset range, the electronic device determines that the posture of the electronic device is the first preset posture; The electronic device performs a device unlocking operation.

8. The method according to claim 7, characterized in that The first preset range is from -90 degrees to 15 degrees.

9. The method according to claim 1, characterized in that If the posture of the electronic device is not the first preset posture but the second preset posture, the electronic device performs a device unlocking operation, specifically including: If the pitch angle of the electronic device is not within a first preset range, the roll angle of the electronic device changes by more than a first preset angle within a specified time period, and the electronic device remains stationary within a second preset range for more than a first specified time period, the electronic device determines that the posture of the electronic device is not the first preset posture but is a second preset posture; The electronic device performs a device unlocking operation.

10. The method according to claim 9, characterized in that The second preset angle is 30 degrees, and the second preset range is -60 degrees to 60 degrees.

11. The method according to claim 1, wherein When the electronic device detects that the user's finger touches the fingerprint sensor, the electronic device obtains the posture information of the electronic device and collects fingerprint feature information through the fingerprint sensor, specifically including: When the electronic device receives a finger touch event reported by the fingerprint sensor through the fingerprint service, the electronic device determines that the user's finger is detected touching the fingerprint sensor; The electronic device obtains the posture information of the electronic device reported by the posture sensor through the fingerprint service, and collects fingerprint feature information through the fingerprint sensor.

12. The method according to claim 1, characterized in that The electronic device matches the fingerprint feature information with a preset fingerprint template and the matching is successful, specifically including: The electronic device matches the fingerprint feature information with a preset fingerprint template through a fingerprint hardware abstraction layer and the match is successful.

13. An electronic device, characterized in that: include: A posture sensor, one or more processors, one or more memories, and a display screen; the one or more memories are coupled to the posture sensor and the one or more processors, the one or more memories are used to store computer program code, the computer program code including computer instructions, when the one or more processors and the posture sensor execute the computer instructions, causing the electronic device to execute the method according to any one of claims 1 to 12.

14. A computer-readable storage medium, characterized in that The method comprises computer instructions, which, when executed on an electronic device, cause the electronic device to execute the method according to any one of claims 1 to 12.

15. A chip system, characterized in that: The method comprises a processing circuit and an interface circuit, wherein the interface circuit is used to receive code instructions and transmit the code instructions to the processing circuit, and the processing circuit is used to run the code instructions to execute the method according to any one of claims 1 to 12.