Screen unlocking method and device for electronic device, electronic device and storage medium

By monitoring touch events to identify Morse code sequences and matching them with preset passwords, it solves the problem of difficulty in unlocking mobile phones for visually impaired people, realizes a convenient and safe unlocking method, and improves the user experience and security.

CN118433303BActive Publication Date: 2024-10-15四川易景智能终端有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410889355.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-04
Publication Date
2024-10-15
Estimated Expiration
2044-07-04

AI Technical Summary

Technical Problem

The existing mobile phone unlocking methods are not friendly to the visually impaired and difficult to unlock quickly and accurately, affecting the user experience and safety.

Method used

By monitoring touch events, identifying Morse code sequences and matching them with preset unlock passwords, the screen can be unlocked and a simple and easy-to-understand touch input method can be provided.

Benefits of technology

It improves the convenience and safety of unlocking mobile phones for visually impaired people, avoids complex operations and high-precision touch requirements, enhances the use experience, and reduces implementation costs and technical difficulty.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118433303B_ABST
    Figure CN118433303B_ABST
Patent Text Reader

Abstract

The present application proposes a screen unlocking method, device, electronic device and storage medium of an electronic device, wherein the method includes: in a lock screen state based on a first lock screen interface, in response to detecting a touch input acting on a touch display screen, monitoring each touch event; for each touch event, obtaining the duration of the touch event; and according to the duration of the touch event, determining the touch type of the touch event and recording the touch type in an input sequence; after confirming that the touch input is completed, matching the input sequence as a Morse code sequence with a preset unlock password; if the match is successful, unlocking the screen. The unlocking by touching the input Morse code solves the difficulties of visually impaired people in unlocking terminal devices such as mobile phones in the related art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of touch unlocking technology, and in particular to a screen unlocking method and device for an electronic device, an electronic device, and a storage medium. Background Art

[0002] Currently, the unlocking methods of most mobile phones and other terminal devices on the market are not friendly to the visually impaired. Common unlocking methods include pattern unlocking, password unlocking, fingerprint unlocking and facial recognition, etc. These methods require users to have a certain level of visual or tactile accuracy, or the device supports special hardware modules. However, the visually impaired will encounter many difficulties when using these unlocking methods, especially in public places or in emergency situations. It is difficult to unlock the phone quickly and accurately, affecting their user experience and safety. Summary of the invention

[0003] The present application aims to solve one of the technical problems in the related art at least to some extent.

[0004] To this end, the first purpose of this application is to propose a screen unlocking method for an electronic device, so as to realize unlocking by touching and inputting Morse code, and solve the difficulties faced by visually impaired people in unlocking terminal devices such as mobile phones in related technologies.

[0005] The second objective of the present application is to provide a screen unlocking device for an electronic device.

[0006] The third objective of the present application is to provide an electronic device.

[0007] A fourth objective of the present application is to provide a computer-readable storage medium.

[0008] A fifth object of the present application is to provide a computer program product.

[0009] To achieve the above-mentioned purpose, the first embodiment of the present application proposes a screen unlocking method of an electronic device, comprising:

[0010] In a lock screen state based on the first lock screen interface, in response to detecting a touch input acting on the touch display screen, monitoring each touch event;

[0011] For each of the touch events, the duration of the touch event is acquired; and according to the duration of the touch event, the touch type of the touch event is determined and the touch type is recorded in the input sequence;

[0012] After confirming that the touch input is completed, the input sequence is used as a Morse code sequence to match the preset unlock password; if the match is successful, the screen is unlocked.

[0013] In some implementations, the method for creating the first lock screen interface includes:

[0014] Define a lock screen interface Activity, and set it to start the lock screen interface Activity when the electronic device enters the lock screen state.

[0015] In some implementations, determining the touch type of the touch event according to the duration of the touch event includes:

[0016] When the duration of the touch event is less than the duration threshold, acquiring the touch type of the touch event as the first touch type;

[0017] When the duration of the touch event is greater than or equal to the duration threshold, the touch type of the touch event is acquired as a second touch type.

[0018] In some implementations, the confirming that the touch input is completed includes:

[0019] When the duration of the touch input is greater than the first duration, confirming that the touch input is completed; or, when the first touch action is detected, confirming that the touch input is completed.

[0020] In some implementations, recording the touch type in an input sequence includes:

[0021] The character corresponding to the touch type of the touch event is stored in an input sequence.

[0022] In some implementations, matching the input sequence as a Morse code sequence with a preset unlocking password includes:

[0023] Taking all characters of the input sequence as a Morse code sequence;

[0024] The Morse code sequence is character matched with a preset unlocking password.

[0025] In some implementations, after determining the touch type of the touch event, the method further includes:

[0026] A vibration matching the touch type is performed, and / or a sound matching the touch type is played.

[0027] To achieve the above-mentioned purpose, the second embodiment of the present application proposes a screen unlocking device for an electronic device, comprising:

[0028] A touch monitoring module, configured to monitor each touch event in response to detecting a touch input acting on the touch display screen in a lock screen state based on the first lock screen interface;

[0029] A touch recognition module, for obtaining the duration of each touch event; and determining the touch type of the touch event according to the duration of the touch event and recording the touch type in an input sequence;

[0030] The matching unlocking module is used to match the input sequence as a Morse code sequence with a preset unlocking password after confirming that the touch input is completed; if the match is successful, the screen is unlocked.

[0031] In some implementations, the method for creating the first lock screen interface includes:

[0032] Define a lock screen interface Activity, and set it to start the lock screen interface Activity when the electronic device enters the lock screen state.

[0033] In some implementations, when the touch recognition module determines the touch type of the touch event according to the duration of the touch event, it is configured to:

[0034] When the duration of the touch event is less than the duration threshold, acquiring the touch type of the touch event as the first touch type;

[0035] When the duration of the touch event is greater than or equal to the duration threshold, the touch type of the touch event is acquired as a second touch type.

[0036] In some implementations, when confirming that the touch input is completed, the matching and unlocking module is used to:

[0037] When the duration of the touch input is greater than the first duration, confirming that the touch input is completed; or, when the first touch action is detected, confirming that the touch input is completed.

[0038] In some implementations, the touch recognition module records the touch type when inputting a sequence; for:

[0039] The character corresponding to the touch type of the touch event is stored in an input sequence.

[0040] In some implementations, the matching unlocking module, when matching the input sequence as a Morse code sequence with a preset unlocking password, is used to:

[0041] Taking all characters of the input sequence as a Morse code sequence;

[0042] The Morse code sequence is character matched with a preset unlocking password.

[0043] In some implementations, the touch recognition module is further configured to:

[0044] A vibration matching the touch type is performed, and / or a sound matching the touch type is played.

[0045] To achieve the above-mentioned purpose, the third aspect embodiment of the present application proposes an electronic device, comprising: a processor, and a memory communicatively connected to the processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to implement the method described in the first aspect.

[0046] To achieve the above-mentioned purpose, the fourth aspect of the present application proposes a computer-readable storage medium, in which computer-readable storage medium is stored computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method described in the first aspect.

[0047] To achieve the above-mentioned purpose, the fifth aspect of the present application proposes a computer program product, including a computer program, which implements the method described in the first aspect when executed by a processor.

[0048] The screen unlocking method, device, electronic device and storage medium of the electronic device provided in the present application obtain Morse code by monitoring touch events, and realize screen unlocking according to the Morse code. Through the simple and easy-to-understand Morse code input method, the visually impaired can unlock the mobile phone more conveniently and quickly, avoiding complicated operation steps and high-precision touch requirements, and improving the user experience of the visually impaired.

[0049] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0051] Figure 1 A schematic diagram of a flow chart of a method for unlocking a screen of an electronic device provided in an embodiment of the present application;

[0052] Figure 2 A schematic diagram of the structure of a screen unlocking device for an electronic device provided in an embodiment of the present application;

[0053] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0054] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.

[0055] In the related art, the existing Android phone unlocking methods mainly include the following:

[0056] Pattern unlocking, users unlock their phones by drawing a preset pattern on the screen. This method requires users to remember complex patterns and require certain visual aids when drawing. This is almost an impossible task for visually impaired people, especially on large-screen phones.

[0057] Password unlocking: users enter a string of numbers or letters as the password to unlock. This method requires users to have good tactile sense and memory ability, and to accurately click the corresponding position on the screen when entering the password. This is also a big challenge for the visually impaired because they cannot accurately touch the keys on the screen.

[0058] Fingerprint unlocking, through the fingerprint recognition module, users can unlock the phone with fingerprints. This method relies on the support of the phone hardware, and may not work properly when the fingerprint recognition module is damaged or the finger is stained, adding inconvenience and uncertainty.

[0059] Facial recognition unlocking uses the front camera to recognize the user's facial features to unlock the phone. This method requires the phone to have a good camera and algorithm support, and the recognition effect will be affected when the light is insufficient or the user wears a mask, and it is of limited help to the visually impaired.

[0060] Although the above unlocking method improves the security of the mobile phone to a certain extent, it is not convenient to operate for the visually impaired and there are great obstacles to use.

[0061] To address this problem, the embodiments of the present application provide a screen unlocking method and device for an electronic device to implement a Morse code input unlocking method that is convenient for visually impaired people to use, thereby solving the difficulties that visually impaired people encounter when unlocking terminal devices such as mobile phones in related technologies.

[0062] The following describes the screen unlocking method, device and equipment of the electronic device according to the embodiments of the present application with reference to the accompanying drawings.

[0063] Figure 1 A flowchart of a method for unlocking the screen of an electronic device provided in an embodiment of the present application.

[0064] It should be noted that the executor of the screen unlocking method of the electronic device in the embodiment of the present application is the screen unlocking device of the electronic device in the embodiment of the present application. The screen unlocking device of the electronic device can be configured in an electronic device such as a mobile phone so that the electronic device can perform the screen unlocking function.

[0065] like Figure 1 As shown, the screen unlocking method of the electronic device includes the following steps:

[0066] Step 101 : in a lock screen state based on a first lock screen interface, in response to detecting a touch input acting on a touch display screen, monitoring each touch event.

[0067] First of all, it should be noted that before implementing the screen unlocking method of the embodiment of the present application, it is necessary to create a first lock screen interface and implement the screen unlocking method under the first lock screen interface.

[0068] In some embodiments, a method for creating a first lock screen interface includes: defining a lock screen interface Activity, and setting the lock screen interface Activity to be started when the electronic device enters a lock screen state.

[0069] That is to say, a customized first lock screen interface, that is, a customized lock screen interface Activity, is created, and the lock screen interface Activity covers the system default lock screen interface in the electronic device, ensuring that the first lock screen interface is displayed when the device is locked.

[0070] As an implementation method, the implementation method of customizing the lock screen interface Activity includes:

[0071] 1) Set the lock screen interface Activity attributes: Configure a custom lock screen Activity in AndroidManifest.xml so that it can be started and displayed at the forefront when the screen is locked. Set the Activity attribute to singleInstance so that it is the only one in the lock screen state. Use WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED and WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD to ensure that the Activity is displayed when the screen is locked.

[0072] 2) Permissions and configuration: Request and process the permission to turn off the system default lock screen in the code. Use KeyguardManager to manage the lock screen. Request the DISABLE_KEYGUARD permission to control the lock screen state.

[0073] 3) Lock screen display logic: When the device enters the lock screen state, start the custom lock screen Activity. Register a broadcast receiver to listen to Intent.ACTION_SCREEN_OFF and Intent.ACTION_USER_PRESENT, and start or close the custom lock screen Activity according to the screen state.

[0074] Therefore, when the device enters the lock screen state, the first lock screen interface is displayed.

[0075] In the locked screen state, the touch input is detected, and after the touch input is detected, each touch event is monitored.

[0076] Step 102: for each touch event, obtain the duration of the touch event; and determine the touch type of the touch event according to the duration of the touch event and record the touch type in the input sequence.

[0077] In some embodiments, the touch type of the touch event is determined based on the duration of the touch event; including: when the duration of the touch event is less than a duration threshold, the touch type of the touch event is obtained as a first touch type; when the duration of the touch event is greater than or equal to the duration threshold, the touch type of the touch event is obtained as a second touch type.

[0078] Exemplarily, the duration threshold may be 300 milliseconds, a touch event below the duration threshold is a short press, and a touch event above or equal to the duration threshold is a long press.

[0079] In this embodiment, the first touch type is a short press, and the second touch type is a long press. That is, the embodiment of the present application distinguishes touch events into short presses and long presses according to the duration of the touch events, so that Morse code input is subsequently recognized based on the short presses and long presses.

[0080] That is to say, in the first lock screen interface, the user's touch events are monitored, and short presses and long presses are distinguished, so as to recognize Morse code input.

[0081] In some embodiments, the implementation method of recording the touch type in the input sequence includes: storing the character corresponding to the touch type of the touch event in the input sequence.

[0082] That is, the touch events acting on the touch display screen are monitored in real time, the touch types of the touch events are identified one by one according to the touch input sequence, and the characters corresponding to the touch types are stored in the input sequence. Thus, the characters corresponding to the multiple touch events of the touch input are stored in the input sequence in sequence.

[0083] In some embodiments, the implementation method of monitoring touch events includes: setting a touch event listener in the view of the first lock screen Activity, using the View.OnTouchListener interface to monitor touch events, and recording the start time and end time of the touch event.

[0084] In some embodiments, the implementation method of obtaining the duration of a touch event includes: in a touch event listener, recording the start and end time of the touch event, calculating the difference between the start and end time to obtain the touch duration, and further distinguishing between a short press and a long press. System.currentTimeMillis() can be used to obtain the current timestamp to calculate the duration of the touch event.

[0085] In some embodiments, the implementation method of storing the characters corresponding to the touch type of the touch event into the input sequence includes: storing the characters corresponding to the recognized short press and long press events in order as the input sequence. A StringBuilder or ArrayList can be used to record the input sequence. Thus, the system records each touch event of the user as a Morse code sequence for subsequent matching.

[0086] Thus, real-time input recording is achieved, and in the touch event listener, the user's touch events are recorded in real time to construct a Morse code sequence. At the end of each touch event, the touch type is appended to the input sequence.

[0087] In some embodiments, after determining the touch type of the touch event, the method further includes: performing a vibration matching the touch type, and / or playing a sound matching the touch type.

[0088] Thus, during the input process, the user is prompted with the input status through vibration or sound, that is, when the user performs touch input, the recognition results of short press and long press are prompted with vibration or sound.

[0089] In other words, you can help users confirm their input by providing touch feedback. In the touch event listener, provide tactile or auditory feedback in real time to help users confirm their input. You can use the Vibrator class to perform short or long vibrations to distinguish short presses from long presses. Use MediaPlayer to play different prompt sounds.

[0090] Step 103, after confirming that the touch input is completed, the input sequence is used as a Morse code sequence to match the preset unlock password; if the match is successful, the screen is unlocked.

[0091] As an implementation manner, after the touch type of each touch event is identified and recorded, it is detected whether the touch input is completed, and after it is detected that the touch input is completed, the matching operation is started.

[0092] In some embodiments, the implementation of confirming the completion of the touch input includes: confirming the completion of the touch input when the duration of the touch input is greater than a first duration; or confirming the completion of the touch input when a first touch action is detected.

[0093] Exemplarily, the user's input completion is determined by timing or a specific gesture (such as double-clicking). For example, a timer can be set, and when the user does not continue to input within a set time, the input is considered to be completed.

[0094] Thus, after the user completes the input, the subsequent steps can match the complete input sequence with the preset unlock password. That is, when the input is completed, the matching verification logic is triggered.

[0095] In the embodiment of the present application, the Morse code sequence input by the user is matched with the preset unlock password. If the match is successful, the unlock operation is performed to realize screen unlocking.

[0096] In some embodiments, the implementation of matching the input sequence as a Morse code sequence with a preset unlocking password includes: treating all characters of the input sequence as a Morse code sequence; and matching the Morse code sequence with the preset unlocking password.

[0097] In some embodiments, the input Morse code sequence is string matched with the preset unlock password to verify whether they are consistent. For example, the String.equals() method can be used to perform a simple string comparison. When the match is successful, the screen is unlocked through the KeyguardManager and the custom lock screen Activity is closed. The KeyguardManager.requestDismissKeyguard() method is called to release the lock screen.

[0098] In some embodiments, after a match fails, the user is prompted to re-enter.

[0099] In some embodiments, after matching, the method includes: performing a vibration corresponding to the matching result, and / or playing a sound corresponding to the matching result. Thus, after the matching succeeds or fails, the user is prompted to input the result through vibration or sound.

[0100] Exemplarily, after matching, clear feedback (such as vibration pattern or prompt tone) is provided to inform the user of successful or failed unlocking. For example, when the matching is successful, a prompt tone of successful unlocking is played, and a long vibration is performed. When the matching fails, an error prompt tone is played, and a short vibration is performed. In other words, matching feedback can be provided to help the user confirm the unlocking result.

[0101] The screen unlocking method of the electronic device of the embodiment of the present application obtains Morse code by monitoring touch events, and realizes screen unlocking according to Morse code, so that the visually impaired can unlock the mobile phone more conveniently and quickly through a simple and easy-to-understand Morse code input method, avoiding complicated operation steps and high-precision touch requirements, and improving the user experience of the visually impaired. Secondly, Morse code is more difficult to be spied on and cracked by others, which enhances the security of the mobile phone. The device does not need to rely on additional hardware support, is suitable for all electronic devices with touch screens, is not restricted by external conditions such as light and environment, and has strong applicability and universality. The implementation method mainly relies on software algorithms, does not require special hardware module support, and reduces the implementation cost and technical difficulty. Through touch feedback prompts and matching feedback prompts, a friendly interaction method is provided for the visually impaired, so that they can understand the input status and results more intuitively, and improve the overall user experience.

[0102] In order to implement the above embodiments, the present application also proposes a screen unlocking device for an electronic device. Figure 2 A schematic diagram of the structure of a screen unlocking device for an electronic device provided in an embodiment of the present application. Figure 2 As shown, the screen unlocking device of the electronic device may include: a touch monitoring module 201, a touch recognition module 202 and a matching unlocking module 203.

[0103] The touch monitoring module 201 is used to monitor various touch events in response to detecting a touch input acting on the touch display screen in a lock screen state based on the first lock screen interface;

[0104] The touch recognition module 202 is used to obtain the duration of each touch event; determine the touch type of the touch event according to the duration of the touch event and record the touch type in the input sequence;

[0105] The matching unlocking module 203 is used to match the input sequence as a Morse code sequence with a preset unlocking password after confirming that the touch input is completed; if the match is successful, the screen is unlocked.

[0106] In some implementations, the method for creating the first lock screen interface includes:

[0107] Define the lock screen interface Activity and set it to start when the electronic device enters the lock screen state.

[0108] In some implementations, when the touch recognition module 202 determines the touch type of the touch event according to the duration of the touch event, it is configured to:

[0109] When the duration of the touch event is less than the duration threshold, acquiring the touch type of the touch event as the first touch type;

[0110] When the duration of the touch event is greater than or equal to the duration threshold, the touch type of the touch event is acquired as the second touch type.

[0111] In some implementations, upon confirming that the touch input is completed, the matching and unlocking module 203 is configured to:

[0112] When the duration of the touch input is greater than the first duration, it is confirmed that the touch input is completed; or, when the first touch action is detected, it is confirmed that the touch input is completed.

[0113] In some implementations, the touch recognition module 202 records the touch type when inputting the sequence; for:

[0114] The character corresponding to the touch type of the touch event is stored in the input sequence.

[0115] In some implementations, the matching unlocking module 203 is used to:

[0116] Treat all characters of the input sequence as a Morse code sequence;

[0117] Match the Morse code sequence character by character with the preset unlock code.

[0118] In some implementations, the touch recognition module 202 is further configured to:

[0119] A vibration matching the touch type is performed, and / or a sound matching the touch type is played.

[0120] It should be noted that the aforementioned explanation of the embodiment of the screen unlocking method of the electronic device is also applicable to the screen unlocking device of the electronic device of this embodiment, and will not be repeated here.

[0121] The screen unlocking device of the electronic device of the embodiment of the present application obtains Morse code by monitoring touch events, and realizes screen unlocking according to Morse code, so that the visually impaired can unlock the mobile phone more conveniently and quickly through a simple and easy-to-understand Morse code input method, avoiding complicated operation steps and high-precision touch requirements, and improving the user experience of the visually impaired. Secondly, Morse code is more difficult to be spied on and cracked by others, which enhances the security of the mobile phone. The device does not need to rely on additional hardware support, is suitable for all electronic devices with touch screens, is not restricted by external conditions such as light and environment, and has strong applicability and universality. The implementation method mainly relies on software algorithms, does not require special hardware module support, and reduces the implementation cost and technical difficulty. Through touch feedback prompts and matching feedback prompts, a friendly interaction method is provided for the visually impaired, so that they can understand the input status and results more intuitively, and improve the overall user experience.

[0122] In order to implement the above embodiment, the present application also proposes an electronic device. Figure 3 , Figure 3 Schematic diagram of the structure of the electronic device provided in the embodiment of the present application. Figure 3 As shown, the electronic device 300 includes: a processor 301, and a memory 302 communicatively connected to the processor 301; the memory 302 stores computer-executable instructions; the processor 301 executes the computer-executable instructions stored in the memory to implement the method provided in the aforementioned embodiment.

[0123] In order to implement the above embodiments, the present application also proposes a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the methods provided by the above embodiments.

[0124] In order to implement the above embodiments, the present application also proposes a computer program product, including a computer program, which implements the methods provided by the above embodiments when executed by a processor.

[0125] The collection, storage, use, processing, transmission, provision and disclosure of user personal information involved in this application are in compliance with relevant laws and regulations and do not violate public order and good morals.

[0126] It should be noted that personal information from users should be collected for legitimate and reasonable purposes and should not be shared or sold outside of these legitimate uses. In addition, such collection / sharing should be carried out after receiving the user's informed consent, including but not limited to notifying the user to read the user agreement / user notice and sign the agreement / authorization including authorization of relevant user information before the user uses the function. In addition, any necessary steps should be taken to protect and safeguard access to such personal information data and ensure that others who have access to personal information data comply with its privacy policy and procedures.

[0127] The present application is expected to provide an implementation scheme for users to selectively block the use or access of personal information data. That is, the present disclosure is expected to provide hardware and / or software to prevent or block access to such personal information data. Once the personal information data is no longer needed, the risk can be minimized by limiting data collection and deleting the data. In addition, when applicable, such personal information is de-identified to protect the privacy of the user.

[0128] In the description of the aforementioned embodiments, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, unless they contradict each other.

[0129] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0130] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.

[0131] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples (non-exhaustive list) of computer-readable media include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.

[0132] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0133] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0134] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0135] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.

Claims

1. A method for unlocking a screen of an electronic device, characterized in that: The following steps are involved: In a lock screen state based on a first lock screen interface, in response to detecting a touch input acting on a touch display screen, each touch event is monitored; wherein, the method for creating the first lock screen interface comprises: defining a lock screen interface Activity, and setting to start the lock screen interface Activity when the electronic device enters the lock screen state; a touch event listener is set in the view of the first lock screen interface, and the touch event listener uses the View.OnTouchListener interface to monitor touch events and record the start time and end time of the touch event; the definition of the lock screen interface Activity comprises: configuring a custom lock screen Activity in AndroidManifest.xml so that it starts when the lock screen interface enters the lock screen state; The lock screen can be started and displayed at the forefront when the screen is locked; set the lock screen activity attribute to singleInstance so that it is the only one in the lock screen state; use WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED and WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD to ensure that the lock screen activity is displayed when the screen is locked; use KeyguardManager to manage the lock screen and request DISABLE_KEYGUARD permission to control the lock screen state; start or close the lock screen activity according to the screen state; For each of the touch events, the duration of the touch event is obtained; and according to the duration of the touch event, the touch type of the touch event is determined and the character corresponding to the touch type is stored in an input sequence, and the input sequence is recorded using a StringBuilder or an ArrayList; When the duration of the touch input is greater than the first duration, confirm that the touch input is completed; after confirming that the touch input is completed, match the input sequence as a Morse code sequence with a preset unlock password; if the match is successful, unlock the screen; after the match fails, prompt the user to re-enter.

2. The method according to claim 1, characterized in that The step of determining the touch type of the touch event according to the duration of the touch event comprises: When the duration of the touch event is less than the duration threshold, acquiring the touch type of the touch event as the first touch type; When the duration of the touch event is greater than or equal to the duration threshold, the touch type of the touch event is acquired as a second touch type.

3. The method according to claim 1, characterized in that The step of confirming that the touch input is completed includes: When the first touch action is detected, it is confirmed that the touch input is completed.

4. The method according to claim 1, characterized in that: The step of matching the input sequence as a Morse code sequence with a preset unlocking password comprises: Taking all characters of the input sequence as a Morse code sequence; The Morse code sequence is character matched with a preset unlocking password.

5. The method according to claim 1, characterized in that After the touch type of the touch event is determined, the method further includes: A vibration matching the touch type is performed, and / or a sound matching the touch type is played.

6. A screen unlocking device for an electronic device, characterized in that: include: A touch monitoring module is used to monitor various touch events in response to detecting touch input acting on a touch display screen in a lock screen state based on a first lock screen interface; wherein, a method for creating the first lock screen interface includes: defining a lock screen interface Activity, and setting the lock screen interface Activity to be started when the electronic device enters a lock screen state; a touch event listener is set in the view of the first lock screen interface, and the touch event listener uses the View.OnTouchListener interface to monitor touch events and record the start time and end time of the touch event; the definition of the lock screen interface Activity includes: configuring a custom lock screen Activity in AndroidManifest.xml , so that it can be started and displayed at the forefront when the screen is locked; set the lock screen interface Activity attribute to singleInstance, so that it is the only one in the lock screen state; use WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED and WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD to ensure that the lock screen interface Activity is displayed when the screen is locked; use KeyguardManager to manage the lock screen, and request DISABLE_KEYGUARD permission to control the lock screen state; start or close the lock screen interface Activity according to the screen state; A touch recognition module, for obtaining the duration of each touch event; and determining the touch type of the touch event according to the duration of the touch event and storing the character corresponding to the touch type into an input sequence, and using StringBuilder or ArrayList to record the input sequence; The matching unlocking module is used to confirm that the touch input is completed when the duration of the touch input is greater than the first duration; after confirming that the touch input is completed, the input sequence is matched with a preset unlocking password as a Morse code sequence; if the match is successful, the screen is unlocked; after the match fails, the user is prompted to re-enter.

7. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 5 when executed by a processor.