SCREEN UNLOCKING METHOD AND APPARATUS, AND ELECTRONIC DEVICE

This application discloses a screen unlocking method and apparatus, and an electronic device, and pertains to the technical field of terminal devices. The screen unlocking method includes: obtaining a first position of a first hand in a case that a target interface is displayed on a screen of an electronic device, where the target interface includes the first hand; determining a first preset unlocking condition corresponding to the first position; receiving an unlocking input performed by a user; and unlocking the electronic device in response to the unlocking input in a case that the unlocking input matches the first preset unlocking condition.

TECHNICAL FIELD

This application relates to the technical field of terminal devices, and specifically relates to a screen unlocking method and apparatus, and an electronic device.

BACKGROUND

With the popularity of wearable devices, smart watches have entered people's lives and are favored by users due to information processing capabilities and compliance with basic watch technology requirements.

Currently, smart watches usually allow users to enter interfaces through sliding or double tapping. With the development of wearable devices, the amount of data stored inside is increasing, including some private data. Therefore, it is necessary to lock the device. The existing sliding unlocking method is relatively simple, affecting user experience.

SUMMARY

Embodiments of this application provide a screen unlocking method and apparatus, and an electronic device.

According to a first aspect, a screen unlocking method is provided, including:obtaining a first position of a first hand in a case that a target interface is displayed on a screen of an electronic device, where the target interface includes the first hand;determining a first preset unlocking condition corresponding to the first position;receiving an unlocking input performed by a user; andunlocking the electronic device in response to the unlocking input in a case that the unlocking input matches the first preset unlocking condition.

According to a second aspect, a screen unlocking apparatus is provided, including:a first obtaining module, configured to obtain a first position of a first hand in a case that a target interface is displayed on a screen of an electronic device, where the target interface includes the first hand;a first determining module, configured to determine a first preset unlocking condition corresponding to the first position;a receiving module, configured to receive an unlocking input performed by a user; anda first execution module, configured to unlock the electronic device in response to the unlocking input in a case that the unlocking input matches the first preset unlocking condition.

According to a third aspect, an electronic device is provided. The electronic device includes a processor, a memory, and a program or an instruction that is stored in the memory and that can be run on the processor, and the program or the instruction is executed by the processor to implement the steps of the method according to the first aspect.

According to a fourth aspect, a readable storage medium is provided. The readable storage medium stores a program or an instruction, and the program or the instruction is executed by a processor to implement the steps of the method according to the first aspect.

According to a fifth aspect, an embodiment of this application provides a chip. The chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to run a program or an instruction to implement the method according to the first aspect.

According to a sixth aspect, an embodiment of this application provides a computer program product. The computer program product is executed by at least one processor to implement the method according to the first aspect.

DETAILED DESCRIPTION

With reference toFIG.1toFIG.16, the following describes in detail a screen unlocking method and apparatus, and an electronic device provided in the embodiments of this application by using embodiments and application scenarios thereof.

As shown inFIG.1, an embodiment of this application provides a screen unlocking method. The screen unlocking method may include content shown in S101to S104.

In S101, a first position of a first hand is obtained in a case that a target interface is displayed on a screen of an electronic device.

The target interface includes the first hand.

It should be noted that the electronic device may be a smart watch, or may be a mobile phone. In a case that the electronic device is a mobile phone, the first hand may be a hand in a watch face on a display interface of the mobile phone. In a case that the electronic device is a smart watch, the hand may be a hand in a watch face of the smart watch. The watch face may have two hands such as an hour hand and a minute hand, or may have three hands such as an hour hand, a minute hand, and a second hand. The first hand in this application may be one of the hands, or may be two of the hands. This needs to be determined according to an actual situation.

In S102, a first preset unlocking condition corresponding to the first position is determined.

An unlocking condition is related to a position of the first hand, and a current unlocking condition may be determined according to the obtained position of the hand.

In S103, an unlocking input performed by a user is received.

It should be noted that in this embodiment, there is no time sequence between S103and S101to S102. In this embodiment, in S101, obtaining may be performed at intervals, or may be performed immediately when the unlocking input performed by the user is received. This is not specifically limited in this embodiment of this application.

The receiving an unlocking input performed by a user includes starting from a moment at which the user is in contact with the screen of the electronic device, that is, a first time point, and ending until a moment at which the user leaves the screen.

In S104, the electronic device is unlocked in response to the unlocking input in a case that the unlocking input matches the first preset unlocking condition.

It can be understood that, that the unlocking input matches the first preset unlocking condition may mean that an unlocking track input by the user on the target interface matches a track corresponding to the first preset unlocking condition, or a graph formed by the unlocking track matches a graph corresponding to the first preset unlocking condition. The unlocking track may be a track moved by the user on the screen from a moment at which the user touches screen to a moment at which the user leaves the screen. The track may form a graph, and the graph is compared with a preset graph. If two graphs are the same or have a relatively high degree of similarity, it indicates that the unlocking input matches the first preset unlocking condition.

In this embodiment of this application, first, a first position of a first hand is obtained in a case that a target interface is displayed on a screen of an electronic device, where the target interface includes a first hand; then a first preset unlocking condition corresponding to the first position is determined; an unlocking input performed by a user is received; and the electronic device is unlocked in response to the unlocking input in a case that the unlocking input matches the first preset unlocking condition. In this embodiment of this application, the unlocking condition is combined with the hand on the target interface of the electronic device, and unlocking condition is associated with the hand, so that unlocking is diversified and an unlocking process is more interesting, thereby improving user experience.

In a possible implementation of this application, the target interface includes a watch face, and the first position is a position of the first hand in the watch face. Correspondingly, after the first position of the first hand is obtained, the screen unlocking method may further include: determining an interval in which the first position is located. The watch face may include a plurality of intervals, the intervals correspond to different preset unlocking conditions, and the preset unlocking condition includes the first preset unlocking condition.

In this embodiment of this application, the watch face is displayed on the target interface. The first position may be a position of the first hand on the watch face. The interval in which the first position is located may be determined. Because each interval corresponds to one preset unlocking condition, the first preset unlocking condition corresponding to the first position may be further determined. It can be understood that the first preset unlocking condition is a preset unlocking condition corresponding to the interval in which the first position is located, and the unlocking condition is combined with the interval in which the hand is located, so that unlocking is more diversified, thereby improving enjoyment of unlocking.

It can be understood that there are related identifiers in positions of a number 0, a number 3, a number 6, and a number 9 on the watch face. Starting from the position of the number 0 on the watch face, the watch face may be divided into four intervals, that is, an interval from the number 0 to the number 3, an interval from the number 3 to the number 6, an interval from the number 6 to the number 9, and an interval from the number 9 to the number 12. The four intervals may be separately named as a first interval (a range from the number 0 to the number 3), a second interval (a range from the number 3 to the number 6), a third interval (a range from the number 6 to the number 9), and a fourth interval (a range from the number 9 to the number 12), where the number 0 is generally overlapped with the number 12, and the number 12 is usually identified. It can be understood that different intervals at which the point is located correspond to different preset unlocking conditions. For example, in a case that the point is in the first interval, the preset unlocking condition is a condition A, and in a case that the hand is in the second interval, the preset unlocking condition is a condition B.

For example, as shown inFIG.2, a target interface is displayed inFIG.2, and the target interface includes an hour hand21and a minute hand22, where the first hand is the minute hand22.FIG.2is a schematic diagram in which the first hand (the minute hand22) is in the second interval. It can be understood that a preset unlocking condition corresponding to the interval is preset as follows: The user draws, on the screen, an unlocking track31shown inFIG.3. In a case that the first hand (the minute hand22) is in the second interval, the first preset unlocking condition is that the unlocking track of the user matches the unlocking track31.

FIG.4is a schematic diagram in which the user performs unlocking by using an unlocking track in a case that the first hand is in the second interval. As shown inFIG.4, the user draws an unlocking track41. Because the unlocking track41is the same as the unlocking track31preset inFIG.3, that is, the unlocking input performed by the user matches the first preset unlocking condition, the electronic device is unlocked. If the unlocking track drawn by the user is another track and is different from the unlocking track31preset inFIG.3, that is, the unlocking input performed by the user does not match the first preset unlocking condition, the electronic device keeps in a locked state.

For example, as shown inFIG.5, a target interface is displayed inFIG.5, and the target interface includes an hour hand51and a minute hand52, where the first hand is the minute hand52.FIG.5is a schematic diagram in which the first hand (the minute hand52) is in the fourth interval. It can be understood that a preset unlocking condition of the interval is preset as follows: The user draws an unlocking track61shown inFIG.6on the screen. In a case that the first hand (the minute hand52) is in the fourth interval, the first preset unlocking condition is that the unlocking track of the user matches the unlocking track61.

Further, because intervals are adjacent, it is relatively difficult to determine a position of the hand in an adjacent area between two intervals. In this case, when the first position of the first hand is near a critical position, unlocking may be performed by using any one of preset unlocking conditions corresponding to the two adjacent intervals. For example, as shown inFIG.7, a target interface is displayed inFIG.7, and the target interface includes an hour hand71and a minute hand72, where the first hand is the minute hand72. InFIG.7, the third interval and the fourth interval are two adjacent intervals. In this case, an adjacent area of the two adjacent intervals is an adjacent area70, and the first hand is the minute hand72inFIG.7. It can be learned that the minute hand72is located in the adjacent area70. Both a preset unlocking condition corresponding to the third interval and a preset unlocking condition corresponding to the fourth interval may be determined as the first preset unlocking condition, and matching between the unlocking input performed by the user and a preset unlocking condition corresponding to any one area can unlock the electronic device.

That is, when the first position is a position in which the minute hand72is located (a position in which the identifier of the number 9 is located) inFIG.7, the corresponding first preset unlocking condition may be the preset unlocking condition corresponding to the third interval (an area between the number 6 and the number 9), or may be the unlocking condition corresponding to the fourth interval (an area between the number 9 and the number 12).

Further, in a case that the user touches the screen, an unlocking auxiliary line may be displayed on the screen, for example, an unlocking auxiliary line42inFIG.4, so that the user better draws an unlocking track corresponding to the first preset unlocking condition, thereby facilitating use by the user. The auxiliary line may be of a style shown inFIG.4, or may be of another style. This may be determined according to an unlocking track.

In a possible implementation of this application, the first hand includes a first sub-hand and a second sub-hand, and the first position is a relative position between the first sub-hand and the second sub-hand.

Correspondingly, the determining a first preset unlocking condition corresponding to the first position may include the following steps:determining an included angle between the first sub-hand and the second sub-hand according to the relative position between the first sub-hand and the second sub-hand; and determining the first preset unlocking condition corresponding to the first position according to the included angle.

For example, in a case that the target interface includes an hour hand, a minute hand, and a second hand, the first sub-hand may be the minute hand, the second sub-hand may be the second hand, and the first position is a relative position between the minute hand and the second hand.

In other words, an included angle formed by two sub-hands may be determined according to a relative position between the two sub-hands, to determine the first preset unlocking condition corresponding to the first position. It can be understood that different included angles correspond to different preset unlocking conditions, so that unlocking is diversified and an unlocking process is more interesting, thereby improving user experience.

It can be understood that several included angle ranges may be preset, and each included angle range corresponds to one preset unlocking condition.

For example,FIG.8is a schematic diagram of two sub-hands according to an embodiment of this application. As shown inFIG.8, a target interface includes an hour hand81, a minute hand82, and a second hand83, where the minute hand82and the second hand83are first hands. Further, the minute hand82is the first sub-hand in the first hand, and the second hand83is the second sub-hand in the first hand. As shown inFIG.8, an included angle between the minute hand82and the second hand83is 45°, and in a preset included angle range, if the included angle is in a range of (30°, 60° ], a preset unlocking condition corresponding to the included angle range is that the user draws an unlocking track91shown inFIG.9.

For example,FIG.10is a schematic diagram of two sub-hands according to an embodiment of this application. A target interface is displayed inFIG.10, and the target interface includes an hour hand101, a minute hand102, and a second hand103. The minute hand102and the second hand103are the first hand. Further, the minute hand102is the first sub-hand in the first hand, and the second hand103is the second sub-hand. As shown inFIG.10, an included angle between the minute hand102and the second hand103is 120°, and in a preset included angle range, if the included angle is in a range of (90°, 180° ]), a preset unlocking condition corresponding to the included angle range is that the user draws an unlocked track111shown inFIG.11. If the unlocking track drawn by the user does not match the unlocking track111, the electronic device continues to be in a locked state.

In a possible implementation of this application, the included angle may include a first included angle and a second included angle, and a sum of the first included angle and the second included angle is 360°.

It should be noted that the first included angle and the second included angle are formed by the first sub-hand and the second sub-hand at a same moment instead of different moments, that is, are not formed after a position change. In other words, at a moment, when the first sub-hand and the second sub-hand are respectively in a position, the first sub-hand and the second sub-hand may form two angles, and a sum of the two included angles is 360°.

For example, as shown inFIG.12, a target interface is displayed inFIG.12, and the target interface includes an hour hand121, a minute hand122, and a second hand123, where the minute hand122and the second hand123are the first hand. Further, the minute hand122is the first sub-hand in the first hand, and the second hand123is the second sub-hand in the first hand. As shown inFIG.12, the first sub-hand and the second sub-hand form two included angles: a first included angle a (135°) and a second included angle b) (225°.

Correspondingly, after the electronic device is unlocked, the screen unlocking method may further include the following step:displaying a first interface in a case that the included angle is the first included angle; or displaying a second interface in a case that the included angle is the second included angle.

The first preset unlocking condition includes a first unlocking condition and a second unlocking condition, the first included angle corresponds to the first unlocking condition, and the second included angle corresponds to the second unlocking condition.

In other words, at a moment, when the two sub-hands are respectively located at a position, two included angles may be formed, and the two included angles correspond to two different unlocking conditions. After the electronic device is unlocked through different unlocking inputs, different interfaces can be displayed. It can be understood that the first interface is different from the second interface. For example, the first interface may be a desktop interface including all icons, and the second interface may be a desktop interface including common icons. In addition, the first interface may be any page of an application A, and the second interface may be any page of an application B.

In this embodiment, because an included angle formed by hands at a same moment may correspond to two different unlocking conditions, different unlocking inputs may be used to display different interfaces after the user enters the electronic device, so that processing in the electronic device after the user performs unlocking is faster, thereby improving user experience.

For example, as shown inFIG.12, the first included angle a formed by the two sub-hands is 135°, and the second included angle b is 225°. The first unlocking condition corresponding to the first included angle a is that the user draws the unlocking track91shown inFIG.9on the screen. After unlocking, the user may enter an interface shown inFIG.13, and privacy data such as personal body data and bank card information are displayed on the interface. The second unlocking condition corresponding to the second included angle b is that the user draws the unlocking track111shown inFIG.11on the screen. After unlocking, the user may enter an interface shown inFIG.14, and data such as Phone, Calendar, Today's activity, and Sports status is displayed on the interface.

In this embodiment of this application, two formed included angles correspond to different preset unlocking conditions, so that content that can be viewed after unlocking is restricted, and privacy of the user can be protected, or unlocking can be more interesting. In some embodiments, the content that can be viewed after unlocking may be separately restricted according to values of the two included angles. For example, a smaller included angle corresponds to the first unlocking condition, and a larger included angle corresponds to the second unlocking condition. After the first unlocking condition is used for unlocking, privacy-related content such as body data, bank card information, and payment information may be displayed on the screen. After the second unlocking condition is used for unlocking, non-privacy-related content such as Calendar, Steps, and a phone book may be displayed on the screen.

In a possible implementation of this application, before the electronic device is unlocked in response to the unlocking input in a case that the unlocking input matches the first preset unlocking condition, the screen unlocking method may further include the following content:obtaining input duration of the unlocking input; and keeping the electronic device in a locked state in a case that the input duration is greater than preset duration; or detecting matching between the unlocking input and the first preset unlocking condition in a case that the input duration is less than or equal to the preset duration.

In this embodiment, the unlocking input needs to take a certain time, and time does not stop in this time period, that is, the hand moves. Therefore, the user needs to draw the unlocking track within a time period before the unlocking condition changes or within a preset time period. Otherwise, the unlocking fails, and the electronic device continues to be in a locked state. The preset duration is preset, and the user needs to complete the unlocking track within the preset duration, thereby increasing unlocking security.

If the input duration in which the user draws the unlocking track is less than or equal to the preset duration, matching between the unlocking input and the first preset unlocking condition is further detected. In other words, whether the unlocking track is an unlocking track corresponding to the first preset unlocking condition needs to be further determined. If yes, the electronic device is unlocked, or if no, the electronic device keeps in a locked state.

It should be noted that the screen unlocking method provided in the embodiments of this application may be performed by a screen unlocking apparatus or a control module that performs the screen unlocking method in the screen unlocking apparatus. In the embodiments of this application, that the screen unlocking apparatus performs the screen unlocking method is used as an example to describe the screen unlocking apparatus provided in the embodiments of this application.

An embodiment of this application further provides a screen unlocking apparatus, and the apparatus may include a first obtaining module, a first determining module, a receiving module, and a first execution module.

In some embodiments, the first obtaining module is configured to obtain a first position of a first hand in a case that a target interface is displayed on a screen of an electronic device, where the target interface includes the first hand; the first determining module is configured to determine a first preset unlocking condition corresponding to the first position; the receiving module is configured to receive an unlocking input performed by a user; and the first execution module is configured to unlock the electronic device in response to the unlocking input in a case that the unlocking input matches the first preset unlocking condition.

In this embodiment of this application, first, a first obtaining module obtains a first position of a first hand in a case that a target interface is displayed on a screen of an electronic device, where the target interface includes the first hand; and then, a first determining module determines a first preset unlocking condition corresponding to the first position, a receiving module receives an unlocking input performed by a user, and a first execution module unlocks the electronic device in response to the unlocking input in a case that the unlocking input matches the first preset unlocking condition. In this embodiment of this application, the unlocking condition is combined with the hand on the target interface of the electronic device, so that unlocking is diversified and an unlocking process is more interesting, thereby improving user experience.

In a possible implementation of this application, the target interface includes a watch face, and the first position is a position of the first hand in the watch face on the target interface; and the screen unlocking apparatus may further include a second determining module.

The second determining module is configured to determine an interval in which the first position is located, where the watch face includes a plurality of intervals, the intervals correspond to different preset unlocking conditions, and the preset unlocking conditions include the first preset unlocking condition.

In a possible implementation of this application, the first hand includes a first sub-hand and a second sub-hand, and the first position is a relative position between the first sub-hand and the second sub-hand; and the first determining module is configured to: determine an included angle between the first sub-hand and the second sub-hand according to the relative position between the first sub-hand and the second sub-hand; and determine the first preset unlocking condition corresponding to the first position according to the included angle.

In a possible implementation of this application, the included angle includes a first included angle and a second included angle, and a sum of the first included angle and the second included angle is 360°; and the screen unlocking apparatus may further include a first display module and a second display module.

The first display module is configured to display a first interface in a case that the included angle is the first included angle; or the second display module is configured to display a second interface in a case that the included angle is the second included angle, where the first preset unlocking condition includes a first unlocking condition and a second unlocking condition, the first included angle corresponds to the first unlocking condition, and the second included angle corresponds to the second unlocking condition.

In a possible implementation of this application, the screen unlocking apparatus may further include a second obtaining module, a second execution module, and a detection module.

The second obtaining module is configured to obtain input duration of the unlocking input; the second execution module is configured to keep the electronic device in a locked state in a case that the input duration is greater than preset duration; and the detection module is configured to detect matching between the unlocking input and the first preset unlocking condition in a case that the input duration is less than or equal to the preset duration.

The screen unlocking apparatus in this embodiment of this application may be an apparatus, or may be a component, an integrated circuit, or a chip in a terminal.

The screen unlocking apparatus in this embodiment of this application may be an apparatus with an operating system. The operating system may be an Android operating system, an iOS operating system, or another possible operating system. This is not specifically limited in this embodiment of this application.

The screen unlocking apparatus provided in this embodiment of this application can implement the processes implemented in the method embodiment inFIG.1toFIG.12. To avoid repetition, details are not described herein again.

As shown inFIG.15, an embodiment of this application further provides an electronic device1500, including a processor1501, a memory1502, and a program or an instruction that is stored in the memory1502and can be run on the processor1501. The program or the instruction is executed by the processor1501to implement the processes of the foregoing screen unlocking method embodiment of the electronic device and a same technical effect can be achieved. To avoid repetition, details are not described herein again.

FIG.16is a schematic diagram of a hardware structure of an electronic device according to an embodiment of this application.

An electronic device1600includes but is not limited to components such as a radio frequency unit1601, a network module1602, an audio output unit1603, an input unit1604, a sensor1605, a display unit1606, a user input unit1607, an interface unit1608, a memory1609, and a processor1610.

A person skilled in the art can understand that the electronic device1600may further include a power supply (such as a battery) that supplies power to each component. The power supply may be logically connected to the processor1610by using a power supply management system, to implement functions such as charging and discharging management, and power consumption management by using the power supply management system. The structure of the electronic device shown inFIG.16does not constitute a limitation on the electronic device. The electronic device may include components more or fewer than those shown in the diagram, a combination of some components, or different component arrangements. Details are not described herein.

The processor1610is configured to: obtain a first position of a first hand in an electronic device in a case that a target interface is displayed on a screen of the electronic device, where the target interface includes the first hand; determine a first preset unlocking condition corresponding to the first position; receive an unlocking input performed by a user; and unlock the electronic device in response to the unlocking input in a case that the unlocking input matches the first preset unlocking condition.

In this embodiment of this application, a first position of a first hand in an electronic device is obtained in a case that a target interface is first displayed on a screen of the electronic device, where the target interface includes the first hand, a first preset unlocking condition corresponding to the first position is determined, an unlocking input performed a user is received, and the electronic device is unlocked in response to the unlocking input in a case that the unlocking input matches the first preset unlocking condition. In this embodiment of this application, the unlocking condition is combined with the hand on the target interface of the electronic device, so that unlocking is diversified and an unlocking process is more interesting, thereby improving user experience.

It should be understood that, in this embodiment of this application, the input unit1604may include a Graphics Processing Unit (GPU)16041and a microphone16042, and the graphics processing unit16041processes image data of a still picture or a video obtained by an image capture apparatus (such as a camera) in a video capture mode or an image capture mode. The display unit1606may include a display panel16061. In some embodiments, the display panel16061may be configured in a form such as a liquid crystal display or an organic light-emitting diode. The user input unit1607includes a touch panel16071and another input device16072. The touch panel16071is also referred to as a touchscreen. The touch panel16071may include two parts: a touch detection apparatus and a touch controller. The another input device16072may include but is not limited to a physical keyboard, a functional button (such as a volume control button or a power on/off button), a trackball, a mouse, and a joystick. Details are not described herein. The memory1609may be configured to store a software program and various data, including but not limited to an application and an operating system. An application processor and a modem processor may be integrated into the processor1610, the application processor mainly processes an operating system, a user interface, an application, and the like, and the modem processor mainly processes wireless communication. It can be understood that the modem processor may not be integrated into the processor1610.

An embodiment of this application further provides a readable storage medium. The readable storage medium stores a program or an instruction, and the program or the instruction is executed by a processor to implement the processes of the screen unlocking method embodiment provided in any one of the foregoing embodiments and a same technical effect can be achieved. To avoid repetition, details are not described herein again.

An embodiment of this application further provides a chip. The chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to run a program or an instruction to implement the processes of the foregoing screen unlocking method embodiment and a same technical effect can be achieved. To avoid repetition, details are not described herein again.