Pattern unlock method and related device

By transforming and calculating coordinate distances in a relative coordinate system, the problem of inconvenience for blind and visually impaired users in existing unlocking methods is solved, achieving higher unlocking accuracy and convenience.

WO2026138148A1PCT designated stage Publication Date: 2026-07-02TENCENT TECHNOLOGY (SHENZHEN) CO LTD

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
TENCENT TECHNOLOGY (SHENZHEN) CO LTD
Filing Date
2025-10-29
Publication Date
2026-07-02

AI Technical Summary

Technical Problem

Existing digital passwords, gesture passwords, and fingerprint passwords are inconvenient for blind or visually impaired users, resulting in low unlocking accuracy.

Method used

Collect the trajectory coordinates of the unlock pattern in the preset coordinate system, construct a relative coordinate system, convert it to coordinates in the relative coordinate system, calculate the distance between the coordinates and the preset pattern, and unlock according to the distance threshold.

Benefits of technology

It improves the accuracy of pattern unlocking, is suitable for special user groups, and enhances the convenience and security of unlocking.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025130928_02072026_PF_FP_ABST
    Figure CN2025130928_02072026_PF_FP_ABST
Patent Text Reader

Abstract

A pattern unlock method, executed by an electronic device, and comprising: acquiring track coordinates of an unlock pattern for an object to be unlocked in a preset coordinate system to obtain an original coordinate set of the unlock pattern (101); screening for, from the original coordinate set, start point coordinates of a pattern start point and end point coordinates of a pattern end point of the unlock pattern (102); constructing a relative coordinate system on the basis of the start point coordinates and the end point coordinates, the relative coordinate system being a coordinate system relative to the pattern start point and the pattern end point (103); on the basis of the start point coordinates, transforming original coordinates in the original coordinate set into coordinates in the relative coordinate system to obtain a transformed coordinate set (104); and calculating a coordinate distance between the transformed coordinate set and a coordinate set of at least one preset pattern, and unlocking said object on the basis of the coordinate distance and a preset first distance threshold (105).
Need to check novelty before this filing date? Find Prior Art

Description

A pattern unlocking method and related equipment

[0001] Related applications

[0002] This application claims priority to Chinese patent application filed on December 23, 2024, with application number 202411926516.9 and entitled “A Pattern Unlocking Method and Related Device”, the entire contents of which are incorporated herein by reference. Technical Field

[0003] This invention relates to the field of image processing, and more specifically to a pattern unlocking method and related equipment, which may include pattern unlocking devices, electronic devices, computer program products, and computer-readable storage media. Background Technology

[0004] In recent years, with the rapid development of internet technology, information security has become increasingly important. To ensure the security of information within a device or application, it can be locked when not in use and unlocked when needed. Current unlocking methods often involve numeric passwords, gesture passwords, fingerprint passwords, or other biometric passwords.

[0005] In the process of researching and practicing existing technologies, the inventors of this application have found that whether it is a digital password, gesture password, fingerprint password or other biometric password, there are often some limitations in the use of it (for example, it is necessary to determine the keyboard position, fingerprint collection position or other collection position). For some special users (for example, blind or visually impaired people), they often cannot accurately enter the corresponding unlock password, thus resulting in low accuracy of pattern unlocking. Summary of the Invention

[0006] This application provides a pattern unlocking method and related equipment, which may include a pattern unlocking device, an electronic device, a computer program product, and a computer-readable storage medium.

[0007] A pattern unlocking method, performed by an electronic device, includes:

[0008] Collect the trajectory coordinates of the unlocking pattern for the object to be unlocked in a preset coordinate system to obtain the original coordinate set of the unlocking pattern;

[0009] The starting coordinates of the pattern's starting point and the ending coordinates of the pattern's ending point are filtered out from the original set of coordinates.

[0010] Based on the starting point coordinates and the ending point coordinates, a relative coordinate system is constructed, which is a coordinate system relative to the starting point and the ending point of the pattern;

[0011] Based on the starting point coordinates, the original coordinates in the original coordinate set are converted to coordinates in the relative coordinate system to obtain the converted coordinate set; and

[0012] Calculate the coordinate distance between the transformed coordinate set and the coordinate set of at least one preset pattern, and unlock the object to be unlocked based on the coordinate distance and a preset first distance threshold.

[0013] Accordingly, embodiments of this application provide a pattern unlocking device, including:

[0014] The acquisition unit is used to acquire the trajectory coordinates of the unlocking pattern for the object to be unlocked in a preset coordinate system, and obtain the original coordinate set of the unlocking pattern;

[0015] A filtering unit is used to filter out the starting coordinates of the pattern's starting point and the ending coordinates of the pattern's ending point from the original coordinate set;

[0016] A construction unit is used to construct a relative coordinate system based on the starting point coordinates and the ending point coordinates, wherein the relative coordinate system is a coordinate system relative to the starting point and the ending point of the pattern;

[0017] The transformation unit is used to convert the original coordinates in the original coordinate set into coordinates in the relative coordinate system according to the starting point coordinates, so as to obtain the transformed coordinate set.

[0018] The unlocking unit is used to calculate the coordinate distance between the transformed coordinate set and the coordinate set of at least one preset pattern, and to unlock the object to be unlocked according to the coordinate distance and a preset first distance threshold.

[0019] Furthermore, this application also provides an electronic device, including a processor and a memory, wherein the memory stores an application program, and the processor is used to run the application program in the memory to execute the pattern unlocking method provided in this application.

[0020] Furthermore, embodiments of this application also provide a computer-readable storage medium storing a plurality of instructions adapted for loading by a processor to execute steps in any of the pattern unlocking methods provided in embodiments of this application.

[0021] Furthermore, this application also provides a computer program product, including a computer program or instructions, which, when executed by a processor, implement the steps in the pattern unlocking method provided in this application.

[0022] Details of one or more embodiments of this application are set forth in the following drawings and description. Other features, objects, and advantages of this application will become apparent from the specification, drawings, and claims. Attached Figure Description

[0023] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the published drawings without creative effort.

[0024] Figure 1 is a schematic diagram of a scenario for the pattern unlocking method provided in an embodiment of this application;

[0025] Figure 2 is a flowchart illustrating the pattern unlocking method provided in an embodiment of this application;

[0026] Figure 3 is a schematic diagram of the relative coordinate system provided in an embodiment of this application;

[0027] Figure 4 is a schematic diagram of normalizing the transformed coordinate set according to an embodiment of this application;

[0028] Figure 5 is a schematic diagram of the unlock configuration page provided in an embodiment of this application;

[0029] Figure 6 is a schematic diagram of a preset pattern drawn according to an embodiment of this application;

[0030] Figure 7 is a schematic diagram of the unlock pattern for successful unlocking provided in an embodiment of this application;

[0031] Figure 8 is a schematic diagram of the unlocking pattern for a failed unlocking attempt provided in an embodiment of this application;

[0032] Figure 9 is another schematic flowchart of the pattern unlocking method provided in an embodiment of this application;

[0033] Figure 10 is a schematic diagram of the pattern unlocking device provided in an embodiment of this application;

[0034] Figure 11 is another structural schematic diagram of the pattern unlocking device provided in an embodiment of this application;

[0035] Figure 12 is a schematic diagram of the structure of the electronic device provided in an embodiment of this application. Detailed Implementation

[0036] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0037] This application provides a pattern unlocking method and related equipment, which may include a pattern unlocking device, an electronic device, a computer program product, and a computer-readable storage medium. The pattern unlocking device may be integrated into an electronic device, which may be a server or a terminal, etc.

[0038] The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery network (CDN), and big data and artificial intelligence platforms. The terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, etc., but is not limited to these. The terminal and server can be directly or indirectly connected via wired or wireless communication, which is not limited herein.

[0039] For example, referring to Figure 1, taking the pattern unlocking device integrated into an electronic device as an example, the electronic device can collect the trajectory coordinates of the unlocking pattern for the object to be unlocked in a preset coordinate system to obtain the original coordinate set of the unlocking pattern. Then, it can filter out the starting coordinates of the pattern's starting point and the ending coordinates of the pattern's ending point from the original coordinate set. Based on the starting coordinates and the ending coordinates, it can construct a relative coordinate system relative to the pattern's starting point and ending point. According to the starting coordinates, it can convert the original coordinates in the original coordinate set into coordinates in the relative coordinate system to obtain the converted coordinate set. Then, it can calculate the coordinate distance between the converted coordinate set and the coordinate set of at least one preset pattern. Based on the coordinate distance and a preset first distance threshold, it can unlock the object to be unlocked, thereby improving the accuracy of pattern unlocking.

[0040] It is understood that, in the specific embodiments of this application, data such as the unlocking pattern and object information of the object are involved. When the following embodiments of this application are applied to specific products or technologies, permission or consent is required, and the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0041] The following sections provide detailed descriptions of each example. It should be noted that the order in which the embodiments are described is not intended to limit the preferred order of the embodiments.

[0042] This embodiment will be described from the perspective of a pattern unlocking device, which can be integrated into an electronic device, such as a server or a terminal. The terminal can include tablet computers, laptops, personal computers (PCs), wearable devices, virtual reality devices, or other smart devices capable of pattern unlocking.

[0043] A pattern unlocking method includes:

[0044] The trajectory coordinates of the unlocking pattern for the object to be unlocked in a preset coordinate system are collected to obtain the original coordinate set of the unlocking pattern. The starting coordinates of the pattern's starting point and the ending coordinates of the pattern's ending point are selected from the original coordinate set. Based on the starting coordinates and the ending coordinates, a relative coordinate system is constructed. This relative coordinate system is a coordinate system relative to the starting point and the ending point of the pattern. According to the starting coordinates, the original coordinates in the original coordinate set are converted into coordinates in the relative coordinate system to obtain the converted coordinate set. The coordinate distance between the converted coordinate set and the coordinate set of at least one preset pattern is calculated. The object to be unlocked is unlocked according to the coordinate distance and a preset first distance threshold.

[0045] As shown in Figure 2, the specific process of this pattern unlocking method is as follows:

[0046] 101. Collect the trajectory coordinates of the unlocking pattern for the object to be unlocked in the preset coordinate system to obtain the original coordinate set of the unlocking pattern.

[0047] The object to be unlocked can be understood as the object that needs to be unlocked, such as a terminal, client, or applications within the terminal / client, etc. The object to be unlocked can also include permissions or functions within these applications, such as payment permissions / functions, transaction permissions / functions, or various application permissions / functions, etc.

[0048] The unlock pattern can be understood as a pattern used to unlock the object to be unlocked; this pattern can be viewed as a continuous trajectory pattern.

[0049] The trajectory coordinates can be understood as the coordinates of each pixel in the trajectory of the unlock pattern during its formation.

[0050] There are several ways to collect the trajectory coordinates of the unlock pattern for the object to be unlocked in a preset coordinate system, as follows:

[0051] For example, when a single-point swipe operation to unlock an object is detected, the swipe trajectory of the single-point swipe operation is displayed, the pixel coordinates of each pixel in the swipe trajectory in a preset coordinate system are collected, and the swipe trajectory is faded. When the single-point swipe operation is detected to be over, the swipe trajectory is used as the unlock pattern, and the pixel coordinates are used as the trajectory coordinates to obtain the original coordinate set of the unlock pattern.

[0052] Single-point swipe operation can be understood as swiping using a single finger or a single point of contact. A preset coordinate system can be understood as a pre-defined coordinate system. This preset coordinate system can be understood as a coordinate system constructed with a certain endpoint of the screen where the swipe operation area is located as the origin. For example, the top left corner of the screen can be the origin of a Cartesian coordinate system, with the horizontal axis from left to right as the positive x-axis and the vertical axis from top to bottom as the positive y-axis; or the bottom left corner of the screen can be the origin of a Cartesian coordinate system, with the horizontal axis from left to right as the positive x-axis and the vertical axis from bottom to top as the positive y-axis, and so on. There are several ways to collect the pixel coordinates of each pixel in the swipe trajectory within the preset coordinate system. For example, when a swipe trajectory is detected, the position of each pixel in the swipe trajectory relative to the origin of the preset coordinate system can be detected to obtain the pixel coordinates of that pixel. When a swipe trajectory is detected, the position of each pixel in the swipe trajectory can be recorded by the device's touch sensor. The touch sensor can sense the coordinate information of the touch position and convert the coordinate information recorded by the touch sensor into pixel coordinates in the preset coordinate system. Assume the coordinates recorded by the touch sensor are (x sensor ,y sensor Based on the mapping relationship between the preset coordinate system and the touch sensor coordinate system, the coordinates are converted into pixel coordinates (x, y) in the preset coordinate system, thus obtaining the pixel coordinates of the pixel.

[0053] There are several ways to fade out the sliding trajectory. For example, when pixel coordinate acquisition is completed, the acquisition time of the pixel coordinates is determined. Based on the acquisition time and a preset fade-out time, the elimination time of the pixel is determined. According to the elimination time, the pixel is eliminated from the sliding trajectory to fade out the sliding trajectory. The preset fade-out time can be set according to device performance and user needs, and the value range can be between 1 and 10 seconds.

[0054] The preset fade-out time can be understood as a pre-set time to delay the disappearance of pixels. There are several ways to determine the pixel elimination time based on the acquisition time and the preset fade-out time. For example, the preset fade-out time can be added to the acquisition time to obtain the pixel elimination time, as shown in formula T. e =T c +T d As shown, where T eT represents the pixel elimination time. c T represents the acquisition time of a pixel. d This indicates the preset fade-out time. For example, if the pixel acquisition time is 12:10:10 and the preset fade-out time is 5 seconds, then the elimination time for that pixel would be 12:10:15, and so on, thus obtaining the elimination time for each pixel. It should be noted that the preset fade-out time can also be 0, meaning that the pixel can be eliminated immediately after its pixel coordinates are acquired.

[0055] After determining the pixel elimination time based on the acquisition time and preset fade-out time, the pixels can be eliminated from the sliding trajectory according to the elimination time to fade the sliding trajectory. There are several ways to eliminate pixels from the sliding trajectory based on the elimination time. For example, after the elimination time is reached, the pixel can be removed from the sliding trajectory (deleted). This means the unlock pattern is in a process of fading (disappearing) while being entered, thus maximizing the privacy and security of the unlock pattern.

[0056] After collecting the pixel coordinates of each pixel in the sliding trajectory in the preset coordinate system and fading the sliding trajectory, the sliding trajectory can be used as the unlock pattern when the single-point sliding operation ends, and the pixel coordinates can be used as the trajectory coordinates to obtain the original coordinate set of the unlock pattern.

[0057] 102. Filter out the starting coordinates of the pattern's starting point and the ending coordinates of the pattern's ending point from the original coordinate set.

[0058] Here, the pattern start point can be understood as the starting point of the complete trajectory corresponding to the unlock pattern, and the pattern end point can be understood as the end point of the complete trajectory corresponding to the unlock pattern.

[0059] There are several ways to filter out the starting coordinates of the pattern's starting point and the ending coordinates of the pattern's ending point from the original coordinate set. These methods can be as follows:

[0060] For example, the starting point and ending point of the pattern can be identified in the sliding trajectory corresponding to the unlock pattern, and the starting point coordinates and ending point coordinates of the pattern can be filtered out from the original coordinate set.

[0061] There are several ways to identify the starting point and ending point of the pattern in the sliding trajectory corresponding to the unlocking pattern. For example, the starting pixel can be obtained by filtering the starting position of the single-point sliding operation in the sliding trajectory corresponding to the unlocking pattern, and the starting pixel can be used as the starting point of the pattern. The ending pixel can be obtained by filtering the ending position of the single-point sliding operation in the sliding trajectory corresponding to the unlocking pattern, and the ending pixel can be used as the ending point of the pattern.

[0062] 103. Construct a relative coordinate system based on the starting point coordinates and the ending point coordinates.

[0063] The relative coordinate system is a coordinate system relative to the starting and ending points of the pattern. There are several ways to construct a relative coordinate system based on the starting and ending coordinates, as follows:

[0064] For example, based on the starting point coordinates and the ending point coordinates, the starting point and the ending point of the pattern can be connected to obtain the pattern connecting line. The starting point of the pattern can be taken as the origin of the relative coordinate system, and the straight line containing the pattern connecting line can be taken as the horizontal axis of the relative coordinate system. Based on the origin and the horizontal axis, the vertical axis corresponding to the horizontal axis can be constructed to obtain the relative coordinate system.

[0065] There are several ways to construct the ordinate axis corresponding to the horizontal coordinate axis based on the origin and the horizontal coordinate axis to obtain the relative coordinate system. For example, the direction from the starting point to the ending point of the pattern on the horizontal coordinate axis can be taken as the positive direction of the horizontal coordinate axis, a straight line perpendicular to the horizontal coordinate axis can be constructed as the ordinate axis of the relative coordinate system, and the counterclockwise direction of the positive direction of the horizontal coordinate axis can be taken as the positive direction of the ordinate axis. The relative coordinate system can be constructed based on the origin, the positive direction of the horizontal coordinate axis, and the positive direction of the ordinate axis.

[0066] In this example, taking the top left corner (endpoint) of the screen as the origin of the preset coordinate system (0 / x1 / y1), with the horizontal direction from left to right as the positive x-axis and the vertical direction from top to bottom as the positive y-axis, the relative coordinate system (0 / x2 / y2) can be as shown in Figure 3. The origin is taken from the starting point of the discrete coordinate points in the original coordinate set, the line connecting the starting point and the ending point is taken as the positive x-axis, the line perpendicular to the x-axis is taken as the y-axis, and the direction pointed to by rotating the positive x-axis counterclockwise by 90 degrees is taken as the positive y-axis, thus obtaining the relative coordinate system.

[0067] 104. Based on the starting coordinates, convert the original coordinates in the original coordinate set into coordinates in the relative coordinate system to obtain the converted coordinate set.

[0068] For example, the angle between the relative coordinate system and the preset coordinate system can be calculated to obtain the coordinate system angle. Based on the coordinate system angle and the starting coordinate, the original coordinates in the original coordinate set can be transformed to obtain the transformed coordinate set.

[0069] The coordinate system angle can be understood as the angle between a relative coordinate system and a preset coordinate system, indicating their relative positional relationship. There are several ways to calculate the angle between the relative and preset coordinate systems. For example, one can calculate the angle between the horizontal axis of the relative coordinate system and the vertical axis of the preset coordinate system; or, one can calculate the angle between the vertical axis of the relative coordinate system and the horizontal axis of the preset coordinate system; or, one can calculate the angle between the horizontal axis of the relative coordinate system and the horizontal axis of the preset coordinate system; or, one can calculate the angle between the vertical axis of the relative coordinate system and the vertical axis of the preset coordinate system, and so on. Taking the coordinate system angle as the angle between the horizontal and vertical axes of two coordinate systems as an example, in Figure 3, angle θ can be considered this coordinate system angle.

[0070] For example, suppose the abscissa vector of the relative coordinate system is The x-axis vector of the preset coordinate system is It can be done through the vector dot product formula Calculate the angle θ between the horizontal axis of the relative coordinate system and the horizontal axis of the preset coordinate system, where... Represents the vector dot product. and These represent the magnitudes of the vectors.

[0071] After calculating the angle between the relative coordinate system and the preset coordinate system, the coordinates can be transformed based on the calculated angle and the starting coordinates. There are several ways to transform the original coordinates in the original coordinate set. For example, the difference between the original coordinates and the starting coordinates can be calculated to obtain the coordinate difference for each original coordinate. This coordinate difference can include both the x-coordinate difference and the y-coordinate difference. Based on the coordinate system angle, the x-coordinate difference and y-coordinate difference are fused at least once to obtain the transformed x-coordinate and transformed y-coordinate. These transformed x-coordinates and transformed y-coordinates are then used as the transformed coordinates corresponding to the original coordinates, resulting in the transformed coordinate set.

[0072] There are several ways to calculate the difference between the original coordinates and the starting coordinates in the original coordinate set. For example, you can calculate the difference between the x-coordinate of the original coordinates and the x-coordinate of the starting coordinates to get the x-coordinate difference of the original coordinates, and calculate the difference between the y-coordinate of the original coordinates and the y-coordinate of the starting coordinates to get the y-coordinate difference of the original coordinates. Then, you can use the x-coordinate difference and the y-coordinate difference as the coordinate difference.

[0073] After calculating the coordinate difference between the original coordinates and the starting point coordinates in the original coordinate set, the difference between the x-coordinates and y-coordinates can be fused at least once based on the coordinate system angle to obtain the transformed x-coordinates and y-coordinates. There are several ways to fuse the x-coordinate and y-coordinate differences at least once based on the coordinate system angle. For example, the x-coordinate transformation parameters and y-coordinate transformation parameters can be determined based on the coordinate system angle. The x-coordinate difference and y-coordinate difference can be added together according to the x-coordinate transformation parameters to obtain the transformed x-coordinates corresponding to the original coordinates. Then, the difference between the x-coordinate difference and y-coordinate difference can be calculated based on the y-coordinate transformation parameters to obtain the transformed y-coordinates corresponding to the original coordinates.

[0074] The horizontal coordinate transformation parameters can include a first horizontal coordinate weight corresponding to the horizontal coordinate difference and a first vertical coordinate weight corresponding to the vertical coordinate difference. There are several ways to obtain the transformed horizontal coordinate corresponding to the original coordinates by adding the horizontal coordinate difference and the vertical coordinate difference based on the horizontal coordinate transformation parameters. For example, the horizontal coordinate difference can be weighted based on the first horizontal coordinate weight to obtain a first weighted horizontal coordinate difference; similarly, the vertical coordinate difference can be weighted based on the first vertical coordinate weight to obtain a first weighted vertical coordinate difference. Adding the first weighted horizontal coordinate difference to the first weighted vertical coordinate difference yields the transformed horizontal coordinate corresponding to the original coordinates. Specifically, the first weighted horizontal coordinate difference is the value obtained by weighting the horizontal coordinate difference between the original coordinates and the starting coordinates based on the first horizontal coordinate weight, and is used to calculate the transformed horizontal coordinate corresponding to the original coordinates. Similarly, the first weighted vertical coordinate difference is the value obtained by weighting the vertical coordinate difference between the original coordinates and the starting coordinates based on the first vertical coordinate weight, and is also used to calculate the transformed horizontal coordinate corresponding to the original coordinates. As shown in formula (1), specifically: x2=(x1-x)cosθ+(y1-y)sinθ……(1)

[0075] Where x2 is the transformed x-coordinate, x1 is the original x-coordinate, x is the x-coordinate of the starting point coordinate, θ is the angle between the coordinate systems, cosθ is the first x-coordinate weight, y1 is the original y-coordinate, y is the starting point y-coordinate, and sinθ is the first y-coordinate weight.

[0076] The ordinate transformation parameter can include a second abscissa weight corresponding to the abscissa difference and a second ordinate weight corresponding to the ordinate difference. Based on the ordinate transformation parameter, there are several ways to calculate the difference between the abscissa difference and the ordinate difference. For example, the ordinate difference can be weighted based on the second ordinate weight to obtain a second weighted ordinate difference. Similarly, the abscissa difference can be weighted based on the second abscissa weight to obtain a second weighted abscissa difference. The difference between the second weighted ordinate difference and the second weighted abscissa difference is then calculated to obtain the transformed ordinate corresponding to the original coordinates. Specifically, the second weighted abscissa difference is the value obtained by weighting the abscissa difference between the original coordinates and the starting coordinates based on the second abscissa weight, and is used to calculate the transformed ordinate corresponding to the original coordinates. As shown in formula (2), specifically: y2=(y1-y)cosθ-(x1-x)sinθ……(2)

[0077] Where y2 is the transformed ordinate corresponding to the original coordinates, y1 is the ordinate of the original coordinates, y is the ordinate of the starting coordinates, θ is the angle between the coordinate systems, cosθ is the weight of the second ordinate, x1 is the abscissa of the original coordinates, x is the abscissa of the starting coordinates, and sinθ is the weight of the second abscissa.

[0078] By fusing the difference between the horizontal and vertical coordinates at least once based on the angle between the coordinate systems, and obtaining the transformed horizontal and vertical coordinates, the transformed horizontal and vertical coordinates can be used as the transformed coordinates corresponding to the original coordinates, thus obtaining the set of transformed coordinates.

[0079] 105. Calculate the coordinate distance between the transformed coordinate set and the coordinate set of at least one preset pattern, and unlock the object to be unlocked according to the coordinate distance and the preset first distance threshold.

[0080] The preset pattern can be understood as a pattern that is pre-set or configured to unlock the object to be unlocked.

[0081] The coordinate distance can be understood as the distance between the transformed coordinate set and the preset pattern, or as the similarity between the unlocked pattern and the preset pattern. There are several ways to calculate the coordinate distance between the transformed coordinate set and the coordinate set of at least one preset pattern, as follows:

[0082] For example, a set of coordinates for a reference pattern is selected from the set of coordinates for a preset pattern to obtain a set of reference coordinates. Based on the set of reference coordinates, the converted set of coordinates is normalized to obtain a set of normalized coordinates. The coordinate distance between the set of normalized coordinates and the set of coordinates for the preset pattern is calculated. The object to be unlocked is then unlocked based on the coordinate distance and a preset first distance threshold.

[0083] The reference pattern can be understood as the pattern used for the first capture when unlocking the object. There are several ways to filter the coordinate set of the reference pattern from the set of preset pattern coordinates. For example, one could obtain the capture time of each preset pattern, sort the preset patterns based on the capture time to obtain the capture order, and then select the earliest captured preset pattern as the reference pattern according to the capture order. Finally, one could filter the coordinate set of the reference pattern from the set of preset pattern coordinates to obtain the reference coordinate set. Alternatively, when storing the coordinate set of preset patterns, one could also record the capture timestamp of each preset pattern, and then directly read the capture timestamp corresponding to each preset pattern from the stored data during retrieval.

[0084] After selecting the coordinate set of reference patterns from the preset set of pattern coordinates, the transformed coordinate set can be normalized based on the selected reference coordinate set to obtain the normalized coordinate set. There are several ways to normalize the transformed coordinate set based on the reference coordinate set. For example, one can select the reference starting point coordinates and the reference ending point coordinates of the reference pattern from the reference coordinate set, calculate the distance between the reference starting point coordinates and the reference ending point coordinates to obtain the reference distance, calculate the distance between the starting point coordinates and the ending point coordinates in the transformed coordinate set to obtain the target distance, calculate the ratio between the reference distance and the target distance to obtain the normalization parameter, and then fuse the normalization parameter with the coordinates in the transformed coordinate set to obtain the normalized coordinate set.

[0085] There are several ways to calculate the distance between the reference starting point and the reference ending point. For example, one can calculate the Euclidean distance between the two points to obtain the reference distance. Let the reference starting point coordinates be (x1, y1) and the reference ending point coordinates be (x2, y2). According to the Euclidean distance formula... The reference distance d is calculated. Alternatively, the difference between the reference starting point coordinates and the reference ending point coordinates can be calculated. The difference in the horizontal coordinate Δx = x2 - x1 and the difference in the vertical coordinate Δy = y2 - y1 are calculated separately. The sum of the absolute values ​​of the differences, |Δx| + |Δy|, can be used as the reference distance, and so on.

[0086] After calculating the reference distance and the target distance, the ratio between them can be calculated, thus obtaining the normalization parameter. Then, the normalization parameter is fused with the coordinates in the transformed coordinate set to obtain the normalized coordinate set. There are several ways to fuse the normalization parameter with the coordinates in the transformed coordinate set; for example, the normalization parameter can be multiplied by the x-coordinate and y-coordinate of each coordinate in the transformed coordinate set.

[0087] Specifically, the reference starting point coordinates and the reference ending point coordinates of the reference pattern are selected from the reference coordinate set. The distance between the reference starting point coordinates and the reference ending point coordinates is calculated to obtain the reference distance. Then, the distance between the starting point coordinates and the ending point coordinates in the transformed coordinate set is calculated to obtain the target distance. The ratio between the reference distance and the target distance is calculated to obtain the normalization parameter. Finally, the normalization parameter is multiplied by the x-coordinate and y-coordinate of each coordinate in the transformed coordinate set to obtain the normalized coordinate set. Let the reference starting point coordinates be (x...). r1 ,y r1 The reference endpoint coordinates are (x r2 ,y r2 (Reference distance) Let the starting coordinates in the transformed coordinate set be (x t1 ,y t1 The endpoint coordinates are (x t2 ,y t2 ), target distance Normalized parameters For the coordinates (x, y) in the transformed coordinate set, the normalized coordinates are (k×x, k×y).

[0088] In this case, taking the reference coordinate set as the L1 sequence, the transformed coordinate set as the L2 sequence, and the distance as the Euclidean distance as an example, the process of normalizing the transformed coordinate set can be shown in Figure 4. The Euclidean distance between the start and end points of L1 can be taken as O1, and the Euclidean distance between the start and end points of L2 can be taken as O2. The coordinates in the transformed coordinate set are multiplied by (O1 / O2) to obtain the normalized coordinate set.

[0089] After normalizing the transformed coordinate set based on the reference coordinate set, the coordinate distance between the normalized coordinate set and the coordinate set of the preset pattern can be calculated. The object to be unlocked is then unlocked based on this coordinate distance and a preset first distance threshold. There are several ways to calculate the coordinate distance between the normalized coordinate set and the preset pattern's coordinate set. For example, based on the acquisition order of the preset patterns, candidate coordinate sets of candidate patterns can be selected from the preset pattern's coordinate set. The coordinate distance between the coordinates in the normalized coordinate set and the coordinates in the candidate coordinate set can then be calculated to obtain the target coordinate distance. When the target coordinate distance is less than the preset first distance threshold, the object to be unlocked is unlocked.

[0090] There are several ways to filter out the candidate coordinate set of candidate patterns from the coordinate set of the preset patterns based on the acquisition order of the preset patterns. For example, the first pattern acquired can be selected from the preset patterns based on the acquisition order of the preset patterns to obtain candidate patterns, and the coordinate set of candidate patterns can be selected from the coordinate set of the preset patterns to obtain the candidate coordinate set.

[0091] After selecting candidate coordinate sets from the preset set of pattern coordinates, the coordinate distances between the coordinates in the normalized coordinate set and the coordinates in the candidate coordinate set can be calculated to obtain the target coordinate distance. The target coordinate distance indicates the similarity or distance between the normalized coordinate set and the candidate coordinate set. There are several ways to calculate the distance between the coordinates in the normalized coordinate set and the coordinates in the candidate coordinate set. For example, the DTW algorithm can be used to calculate the distance between each coordinate in the normalized coordinate set and the coordinates in the candidate coordinate set, and the calculated distances can be merged to obtain the minimum sum of distances between the normalized coordinate set and the candidate coordinate set. This minimum sum of distances can then be used as the target coordinate distance. Alternatively, the coordinate distance between each coordinate in the normalized coordinate set and each coordinate in the candidate coordinate set can be calculated separately, the coordinate distances can be merged, and the minimum distance can be selected from the merged distances to obtain the target coordinate distance, and so on.

[0092] In practical applications, the DTW (Dynamic Time Warping) algorithm can be used to calculate the coordinate distance between the normalized coordinate set and the coordinate set of the preset pattern. Let the normalized coordinate set be the sequence X = (x1, x2, ..., x...). m The set of coordinates for the preset pattern is a sequence Y = (y1, y2, ..., y...). n The distance matrix D is filled using dynamic programming, where D(i,j) represents x. i to y jThe cumulative distance. Find the optimal path from the starting point (1,1) to the ending point (m,n) from the distance matrix, add the distance values ​​on the optimal path, and obtain the minimum distance between the normalized coordinate set and the coordinate set of the preset pattern. Use this minimum distance as the coordinate distance.

[0093] After calculating the target coordinate distance between the normalized coordinate set and the candidate coordinate set, the object to be unlocked can be unlocked when the target coordinate distance is less than a preset first distance threshold. There are several ways to unlock the object. For example, when the target coordinate distance is less than the preset first distance threshold, the object can be unlocked directly; or, when the target coordinate distance is less than the preset first distance threshold, the unlocking result of the object to be unlocked is determined and sent to the unlocking server corresponding to the object, so that the unlocking server can unlock the object, and so on.

[0094] Optionally, in some embodiments, when the target coordinate distance is greater than or equal to a preset first distance threshold, the step of selecting the candidate coordinate set of candidate patterns from the coordinate set of the preset patterns based on the acquisition sequence can be returned until all preset patterns are candidate patterns, so as to obtain at least one target coordinate distance. When there is no target coordinate distance less than the preset first distance threshold, a prompt message indicating that the unlocking of the object to be unlocked has failed is returned.

[0095] When the target coordinate distance is greater than or equal to a preset first distance threshold, it can be determined that the unlock pattern has a low similarity to the first captured preset pattern (candidate pattern) and cannot be unlocked. At this point, the process returns to the capture order, selecting the next captured preset pattern from the candidate patterns as a candidate pattern, and selecting the candidate coordinate set of that candidate pattern. The target coordinate distance between the candidate coordinate set and the transformed coordinate set of that candidate pattern is then calculated. When the target coordinate distance is less than the preset first distance threshold, the object to be unlocked can be unlocked. After unlocking, the process stops. When the target coordinate distance is greater than or equal to the preset first distance threshold, it indicates that the object to be unlocked has not been successfully unlocked. The process continues by selecting the next preset pattern as a candidate pattern and calculating the target coordinate distance between the coordinate sets of the two patterns, and so on, until all preset patterns are candidate patterns, thus obtaining at least one target coordinate distance. When no target coordinate distance is less than the preset first distance threshold, it can be determined that the object to be unlocked has failed to unlock, and a failure message is returned. For example, taking a preset number of patterns as three (i.e., the first pattern, the second pattern, and the third pattern), and the collection time ordered from earliest to latest as the first pattern - the second pattern - the third pattern, the unlocking process can first calculate the target coordinate distance between the converted coordinate set and the coordinate set of the first pattern. When the target coordinate distance is less than a preset first distance threshold, the object to be unlocked can be unlocked. When the target coordinate distance is greater than or equal to the preset first distance threshold, the target coordinate distance between the converted coordinate set and the coordinate set of the second pattern is calculated. When the target coordinate distance is less than the preset first distance threshold, the object to be unlocked can be unlocked. When the target coordinate distance is greater than or equal to the preset first distance threshold, the target coordinate distance between the converted coordinate set and the coordinate set of the third pattern is calculated. When the target coordinate distance is less than the preset first distance threshold, the object to be unlocked can be unlocked. When the target coordinate distance is greater than or equal to the preset first distance threshold, an unlocking failure message can be returned.

[0096] Optionally, in some embodiments, image recognition can also be used to calculate the similarity between the unlocking pattern and a preset pattern, thereby unlocking the object to be unlocked. There are several ways to use image recognition to unlock a pattern on an object. For example, an image recognition model can be used to extract features from the unlock pattern to obtain the current pattern features. Then, the same model can be used to extract the target pattern features from a preset pattern. The feature similarity between the current and target patterns is calculated to obtain a first feature similarity. If the first feature similarity is greater than a preset threshold, the object is unlocked. If no first feature similarity is greater than the threshold, a message indicating unlocking failure is returned. Alternatively, an image recognition model can be used to extract features from the normalized coordinate set of the unlock pattern to obtain the current coordinate features. Then, the same model can be used to extract features from the coordinate set of the preset pattern to obtain the target coordinate features. The similarity between the current and target coordinate features is calculated to obtain a second feature similarity. If the second feature similarity is greater than the threshold, the object is unlocked. If no second feature similarity is greater than the threshold, a message indicating unlocking failure is returned, and so on.

[0097] Image recognition models are used to extract features from unlock patterns and preset patterns. These models obtain pattern features and calculate feature similarity between patterns to help determine if unlocking was successful. The current pattern feature, obtained through feature extraction from the unlock pattern using the image recognition model, is used to calculate similarity with the target pattern feature of the preset pattern. The target pattern feature, obtained through feature extraction from the preset pattern using the image recognition model, is also used to calculate similarity with the current pattern feature of the unlock pattern. The first feature similarity is the similarity between the current pattern feature and the target pattern feature. Calculating this similarity helps determine if the unlock pattern matches the preset pattern, thus deciding whether to unlock the object. The current coordinate feature, obtained through feature extraction from the normalized coordinate set of the unlock pattern using the image recognition model, is used to calculate similarity with the target coordinate feature of the preset pattern. The target coordinate feature, obtained through feature extraction from the coordinate set of the preset pattern using the image recognition model, is also used to calculate similarity with the current coordinate feature of the unlock pattern. The second feature similarity is the similarity between the current coordinate feature and the target coordinate feature. By calculating this similarity, it can help determine whether the unlock pattern matches the preset pattern, and thus decide whether to unlock the object to be unlocked.

[0098] For example, a Convolutional Neural Network (CNN) can be used as an image recognition model. The unlock pattern and a preset pattern are input into a trained CNN model. Through convolutional layers, pooling layers, and fully connected layers, the current pattern features of the unlock pattern and the target pattern features of the preset pattern are extracted. The feature similarity between the current pattern features and the target pattern features is calculated to obtain the first feature similarity. The cosine similarity formula can be used. Calculate feature similarity, where and These represent the current pattern feature and the target pattern feature vector, respectively.

[0099] Optionally, in some embodiments, before calculating the coordinate distance between the transformed coordinate set and the coordinate set of at least one preset pattern, the coordinate set of at least one preset pattern can also be acquired. There are various ways to acquire the coordinate set of at least one preset pattern. For example, based on a preset coordinate system, the trajectory coordinates of a first pattern used to unlock the object to be unlocked in a first reference coordinate system are acquired to obtain a first coordinate set; the trajectory coordinates of a second pattern used to unlock the object to be unlocked in a second reference coordinate system are acquired to obtain a second coordinate set; and based on the first coordinate set, the second coordinate set is normalized, and the coordinate distance between the normalized second coordinate set and the first coordinate set is calculated to obtain the coordinate set of at least one preset pattern.

[0100] There are several ways to collect the trajectory coordinates of the first pattern used to unlock the object under the first reference coordinate system based on the preset coordinate system. For example, the trajectory coordinates of the first pattern used to unlock the object under the preset coordinate system can be collected to obtain an initial coordinate set. The starting point coordinates and ending point coordinates of the first pattern can be selected from the initial coordinate set. Based on the starting point coordinates and ending point coordinates of the first pattern, a first reference coordinate system can be constructed. Based on the starting point coordinates of the first pattern, the coordinates in the initial coordinate set can be converted into coordinates under the first reference coordinate system to obtain the first coordinate set.

[0101] The first pattern can be understood as a pattern set for unlocking the object to be unlocked. This pattern can be any pattern. In addition, the first pattern can be a continuous trajectory triggered by a single point operation. The method of collecting the trajectory coordinates of the first pattern used to unlock the object in the preset coordinate system can be similar to the method of collecting the trajectory coordinates of the unlocking pattern for the object in the preset coordinate system, as described above, and will not be repeated here.

[0102] After acquiring the trajectory of the first pattern used to unlock the object in the preset coordinate system, the starting and ending coordinates of the first pattern can be filtered from the initial coordinate set. Based on the starting and ending coordinates of the first pattern, a first reference coordinate system is constructed. The method for constructing the first reference coordinate system is similar to that for constructing a relative coordinate system, as detailed above, and will not be repeated here.

[0103] After constructing the first reference coordinate system, the coordinates in the initial coordinate set can be converted to coordinates in the first reference coordinate system based on the starting coordinates of the first pattern, thus obtaining the first coordinate set. The method of converting the coordinates in the initial coordinate set to coordinates in the first reference coordinate system is similar to the method of converting the original coordinates in the original coordinate set to coordinates in the relative coordinate system, as described above, and will not be repeated here.

[0104] After acquiring the trajectory coordinates of the first pattern used to unlock the object in the first reference coordinate system based on a preset coordinate system, the trajectory coordinates of the second pattern used to unlock the object in the first reference coordinate system can be acquired, thus obtaining a second coordinate set. The second pattern used to unlock the object can be understood as a pattern similar to or identical to the first pattern. When the similarity between the second pattern and the first pattern exceeds a preset threshold, the second pattern, like the first pattern, can unlock the object. The method for acquiring the trajectory coordinates of the second pattern used to unlock the object in the first reference coordinate system is similar to the method for acquiring the trajectory coordinates of the first pattern used to unlock the object in the first reference coordinate system, as detailed above, and will not be repeated here.

[0105] After acquiring the trajectory coordinates of the second pattern used to unlock the object in the second reference coordinate system, the acquired second coordinate set of the second pattern can be normalized based on the first coordinate set. The method for normalizing the second coordinate set is similar to the method for normalizing the transformed coordinate set, as described above, and will not be repeated here.

[0106] After normalizing the second coordinate set based on the first coordinate set, the coordinate distance between the normalized second coordinate set and the first coordinate set can be calculated to obtain the coordinate set of at least one preset pattern. There are several ways to calculate the coordinate distance between the normalized second coordinate set and the first coordinate set to obtain the coordinate set of at least one preset pattern. For example, the coordinate distance between the normalized second coordinate set and the first coordinate set can be calculated to obtain the current coordinate distance. When the current coordinate distance is less than a preset second distance threshold, the second pattern is determined to have been successfully acquired. The process then returns to the step of acquiring the trajectory coordinates of the second pattern used to unlock the object to be unlocked in the second reference coordinate system, until the number of successful acquisitions reaches a preset number. This process yields at least one second pattern and the corresponding normalized second coordinate set. The first pattern and the second pattern are then used as preset patterns, and the first coordinate set and the second coordinate set are used as the coordinate set of the preset patterns.

[0107] Optionally, in some embodiments, when the current coordinate distance is greater than or equal to a preset second distance threshold, it can be determined that the second pattern acquisition has failed, and a prompt message for re-acquisition is generated. Based on the prompt message for re-acquisition, the step of acquiring the trajectory coordinates of the second pattern used to unlock the object to be unlocked in the second reference coordinate system is returned until the second pattern acquisition is successful, so as to update the second pattern.

[0108] The failure to capture the second pattern can be understood as either the second pattern being too different from the first pattern, or the similarity between the two patterns being below a preset threshold. In this case, using the first pattern as a reference, the currently captured second pattern cannot unlock the object, and a re-capture of the second pattern is necessary. Therefore, upon determining that the second pattern capture has failed, a re-capture prompt can be generated to indicate the need to re-capture the second pattern.

[0109] After confirming the second pattern acquisition failed and generating a re-acquisition prompt, the process can return to the step of acquiring the trajectory coordinates of the second pattern used to unlock the object in the second reference coordinate system, based on the re-acquisition prompt, until the second pattern is successfully acquired. The successfully acquired second pattern is then updated to the successfully acquired second pattern. After obtaining the successfully acquired second pattern, the process can continue to return to the step of acquiring the trajectory coordinates of the second pattern used to unlock the object in the second reference coordinate system, until the number of successful acquisitions reaches a preset number. This yields at least one second pattern and its corresponding normalized second coordinate set. The first and second patterns are used as preset patterns, and the first coordinate set and the normalized second coordinate set are used as the coordinate set of the preset patterns.

[0110] It should be noted that when collecting the first and second patterns, the collected patterns can also be faded during the collection process. The fading process can be found above and will not be repeated here.

[0111] Optionally, in some embodiments, an unlock configuration page can be displayed before acquiring the first and second patterns. This unlock configuration page includes a pattern unlock control and at least one unlock control corresponding to other unlock types. Taking payment permissions as an example, the unlock configuration page can be as shown in Figure 5, and it can include the unlock control corresponding to payment unlock. When the user is blind or other visually impaired, these controls in the unlock configuration page can also have corresponding voice readings, allowing the blind or other visually impaired to guide and trigger the pattern unlock control through voice readings. In response to the triggering operation of the pattern unlock control, a pattern acquisition page can be displayed, which can include a pattern acquisition area. The user can perform a single-finger operation in the pattern acquisition area to acquire the first coordinate set of the first pattern and the normalized second coordinate set of at least one second pattern. The first and second patterns are used as preset patterns, and the first coordinate set and the normalized second coordinate set are used as the coordinate set of the preset patterns. Taking three successful acquisitions as an example, three acquisitions are required to ensure the consistency of the entered patterns and the diversity of the saved pattern data. During pattern acquisition, except for the first acquisition, if the acquired (entered) pattern (second pattern) is the same as the previous one (i.e., the current coordinate distance is less than the preset second distance threshold), the next acquisition can continue. If the current acquisition is different from the previous one (i.e., the coordinate distance is greater than or equal to the preset second distance threshold), a prompt will appear indicating that the pattern needs to be acquired again. This continues until three patterns are identical, at which point a successful acquisition message will be displayed, and three preset patterns and their corresponding coordinate sets will be obtained. Simultaneously, to maximize security during use, the drawn patterns gradually disappear during the drawing process; that is, the acquired patterns will gradually fade away (i.e., faded processing).

[0112] Wherein, "responding to" is used to indicate the conditions or states on which the operation performed depends. When the conditions or states on which it depends are met, one or more operations performed can be performed in real time or with a set delay. Unless otherwise specified, there is no restriction on the order in which the multiple operations are performed.

[0113] After obtaining the preset pattern and its corresponding coordinate set, the system can unlock the object based on the acquired unlock pattern. When the unlock function is needed, such as for payment transactions, the user can directly draw a pre-recorded unlock pattern for the payment transaction on the screen. An internal algorithm compares the drawn pattern with the preset pattern; if the pattern matches, the unlock is successful; otherwise, it fails. For example, using the preset pattern shown in Figure 6, if the drawn unlock pattern is as shown in Figure 7, the unlock has been successful; if the drawn pattern is as shown in Figure 8, the unlock has failed. It should be noted that the drawn unlock pattern gradually disappears during the unlocking process, thus enhancing security.

[0114] This solution involves inputting a preset pattern before use. Users simply draw the pattern freely on the acquisition area (screen), regardless of direction or size. When unlocking is required, an internal algorithm compares the input unlock pattern's image sequence (normalized and transformed coordinate set) with the preset pattern's image sequence (coordinate set), calculating the similarity (target coordinate distance) as the criterion for successful unlocking. Furthermore, the pattern disappears as it is drawn, maximizing security. Unlocking with this solution requires no specific paradigm or fixed requirements; it can be performed from any starting point, at any size, or under any pressure, ensuring convenient unlocking. Additionally, it is simple to use for blind, visually impaired, or other special users, eliminating the need to determine if they are in a suitable mode (e.g., a specific location, direction, or other special requirements). Unlocking is as simple as touching and swiping on the capture area (screen). This is especially beneficial for blind users, eliminating concerns about holding the device upside down or being unable to locate the unlocking position. Simply swipe the pattern on the capture area to unlock. Furthermore, the entered or captured unlocking pattern disappears as you swipe, maximizing user safety. In certain situations, there's no need to remove the unlocking device, or unlocking can be achieved even when the device is obscured, significantly improving both convenience and security.

[0115] As can be seen from the above, in this embodiment, after collecting the trajectory coordinates of the unlocking pattern for the object to be unlocked in a preset coordinate system to obtain the original coordinate set of the unlocking pattern, the starting coordinates of the pattern's starting point and the ending coordinates of the pattern's ending point are selected from the original coordinate set. Then, based on the starting coordinates and the ending coordinates, a relative coordinate system is constructed relative to the pattern's starting point and ending point. According to the starting coordinates, the original coordinates in the original coordinate set are converted into coordinates in the relative coordinate system to obtain the converted coordinate set. Then, the coordinate distance between the converted coordinate set and the coordinate set of at least one preset pattern is calculated. The object to be unlocked is unlocked according to the coordinate distance and a preset first distance threshold. Since this scheme only requires swiping the pattern on the screen during the unlocking process to collect the trajectory coordinates of the unlocking pattern and converting the collected trajectory coordinates into the converted coordinate set relative to the starting point and ending point, it can ensure that the unlocking pattern input during the unlocking process can be of any size and direction. By calculating the distance between the converted coordinate set and the preset coordinate set of the preset pattern, the unlocking process does not require a specific paradigm or fixed requirements. Unlocking can be achieved with any starting point, any size, and any pressure. Therefore, it can improve the accuracy of pattern unlocking for special users.

[0116] Based on the method described in the above embodiments, the following examples will provide further detailed explanations.

[0117] In this embodiment, the pattern unlocking device will be specifically integrated into an electronic device, with the electronic device being the terminal, as an example for explanation.

[0118] (i) Collect at least one preset pattern and the set of coordinates corresponding to the preset pattern.

[0119] (1) The terminal collects the trajectory coordinates of the first pattern used to unlock the object to be unlocked in the first reference coordinate system based on the preset coordinate system, and obtains the first coordinate set.

[0120] For example, the terminal can have an unlock configuration page, which includes pattern unlock controls. These controls on the unlock configuration page can also have corresponding voice prompts. In response to a trigger operation on the pattern unlock controls, a pattern capture page can be displayed. This pattern capture page can include a pattern capture area. Users can then perform single-finger operations within the pattern capture area.

[0121] The terminal collects the trajectory coordinates of the first pattern used to unlock the object to be unlocked in a preset coordinate system to obtain an initial coordinate set. The starting coordinates and ending coordinates of the first pattern are selected from the initial coordinate set. Based on the starting coordinates and ending coordinates of the first pattern, a first reference coordinate system is constructed. Based on the starting coordinates of the first pattern, the coordinates in the initial coordinate set are converted into coordinates in the first reference coordinate system to obtain the first coordinate set.

[0122] (2) The terminal collects the trajectory coordinates of the second pattern used to unlock the object to be unlocked in the second reference coordinate system, obtains the second coordinate set, and normalizes the second coordinate set based on the first coordinate set.

[0123] (3) The terminal calculates the coordinate distance between the normalized second coordinate set and the first coordinate set to obtain the coordinate set of at least one preset pattern.

[0124] For example, the terminal can calculate the coordinate distance between the normalized second coordinate set and the first coordinate set to obtain the current coordinate distance. When the current coordinate distance is less than a preset second distance threshold, it is determined that the second pattern acquisition is successful. The terminal then returns to the step of acquiring the trajectory coordinates of the second pattern used to unlock the object to be unlocked in the second reference coordinate system until the number of successful acquisitions reaches a preset number. At least one second pattern and the normalized second coordinate set corresponding to the second pattern are obtained. The first pattern and the second pattern are used as preset patterns, and the first coordinate set and the second coordinate set are used as the coordinate set of the preset pattern.

[0125] Optionally, in some embodiments, when the current coordinate distance is greater than or equal to a preset second distance threshold, the terminal can determine that the second pattern acquisition has failed and generate a prompt message for re-acquisition. Based on the re-acquisition prompt message, the terminal returns to the step of acquiring the trajectory coordinates of the second pattern used to unlock the object to be unlocked in the second reference coordinate system until the second pattern is successfully acquired. The successfully acquired second pattern is then obtained, and the failed second pattern is updated to the successfully acquired second pattern. After obtaining the successfully acquired second pattern, the terminal can continue to return to the step of acquiring the trajectory coordinates of the second pattern used to unlock the object to be unlocked in the second reference coordinate system until the number of successful acquisitions reaches a preset number. This yields at least one second pattern and its corresponding normalized second coordinate set. The first pattern and the second pattern are used as preset patterns, and the first coordinate set and the normalized second coordinate set are used as the coordinate set of the preset patterns.

[0126] During the process of acquiring the first and second patterns, the terminal can fade the acquired patterns (the first and second patterns).

[0127] (ii) Based on the coordinate set of the preset pattern, collect the unlocking pattern for the object to be unlocked, so as to unlock the object.

[0128] As shown in Figure 9, a pattern unlocking method is described below:

[0129] 201. The terminal collects the trajectory coordinates of the unlocking pattern of the object to be unlocked in the preset coordinate system to obtain the original coordinate set of the unlocking pattern.

[0130] For example, when the terminal detects a single-point swipe operation to unlock an object, it displays the swipe trajectory of the single-point swipe operation. When a swipe trajectory is detected, the position of each pixel in the trajectory relative to the origin of a preset coordinate system is detected, thereby obtaining the pixel coordinates of that pixel. This preset coordinate system has the upper left corner of the screen as the origin of the Cartesian coordinate system, with the horizontal direction from left to right as the positive x-axis and the vertical direction from top to bottom as the positive y-axis.

[0131] When the terminal detects that pixel coordinate acquisition is complete, it determines the acquisition time of the pixel coordinates. A preset fade-out time is added to the acquisition time to obtain the pixel's elimination time. After the elimination time is reached, the pixel can be removed from the sliding trajectory (deleted from the display point). In other words, the unlock pattern is in a process of simultaneous input and fade-out (disappearance).

[0132] When the terminal detects the end of a single-point swipe operation, it uses the swipe trajectory as the unlock pattern and the pixel coordinates as the trajectory coordinates to obtain the original coordinate set of the unlock pattern.

[0133] 202. The terminal filters out the starting coordinates of the pattern's starting point and the ending coordinates of the pattern's ending point from the original coordinate set.

[0134] For example, the terminal can filter out the pixel corresponding to the starting position of the single-point sliding operation in the sliding trajectory corresponding to the unlock pattern to obtain the starting pixel, and use the starting pixel as the starting point of the pattern. It can also filter out the pixel corresponding to the ending position of the single-point sliding operation in the sliding trajectory corresponding to the unlock pattern to obtain the ending pixel, and use the ending pixel as the ending point of the pattern.

[0135] The terminal can filter out the starting coordinates of the pattern's starting point and the ending coordinates of the pattern's ending point from the original coordinate set.

[0136] 203. The terminal constructs a relative coordinate system based on the starting point coordinates and the ending point coordinates.

[0137] For example, the terminal can connect the starting point and the ending point of the pattern based on the starting point coordinates and the ending point coordinates to obtain the pattern connecting line, take the starting point of the pattern as the origin of the relative coordinate system, and take the straight line where the pattern connecting line is located as the horizontal axis of the relative coordinate system.

[0138] The terminal can take the direction from the starting point of the pattern to the ending point of the pattern on the horizontal axis as the positive direction of the horizontal axis, construct a straight line perpendicular to the horizontal axis as the vertical axis of the relative coordinate system, and take the counterclockwise direction of the positive direction of the horizontal axis as the positive direction of the vertical axis. Based on the origin of the coordinate system, the positive direction of the horizontal axis and the positive direction of the vertical axis, a relative coordinate system is constructed.

[0139] 204. The terminal calculates the angle between the relative coordinate system and the preset coordinate system to obtain the coordinate system angle.

[0140] For example, the terminal can calculate the angle between the horizontal axis of the relative coordinate system and the vertical axis of the preset coordinate system to obtain the coordinate system angle; or, it can calculate the angle between the vertical axis of the relative coordinate system and the horizontal axis of the preset coordinate system to obtain the coordinate system angle; or, it can calculate the angle between the horizontal axis of the relative coordinate system and the horizontal axis of the preset coordinate system to obtain the coordinate system angle; or, it can also calculate the angle between the vertical axis of the relative coordinate system and the vertical axis of the preset coordinate system to obtain the coordinate system angle, and so on.

[0141] 205. The terminal performs coordinate transformation on the original coordinates in the original coordinate set based on the coordinate system angle and the starting coordinate, to obtain the transformed coordinate set.

[0142] For example, the terminal can calculate the difference between the x-coordinate of the original coordinate and the x-coordinate of the starting point coordinate to obtain the x-coordinate difference of the original coordinate; calculate the difference between the y-coordinate of the original coordinate and the y-coordinate of the starting point coordinate to obtain the y-coordinate difference of the original coordinate; and use the x-coordinate difference and the y-coordinate difference as the coordinate difference.

[0143] The terminal can determine the horizontal coordinate transformation parameters and the vertical coordinate transformation parameters based on the coordinate system angle. The horizontal coordinate transformation parameters may include the first horizontal coordinate weight corresponding to the horizontal coordinate difference and the first vertical coordinate weight corresponding to the vertical coordinate difference. The vertical coordinate transformation parameters may include the second horizontal coordinate weight corresponding to the horizontal coordinate difference and the second vertical coordinate weight corresponding to the vertical coordinate difference.

[0144] The terminal can weight the difference of the horizontal coordinate based on the first horizontal coordinate weight to obtain the first weighted horizontal coordinate difference. It can also weight the difference of the vertical coordinate based on the first vertical coordinate weight to obtain the first weighted vertical coordinate difference. The first weighted horizontal coordinate difference and the first weighted vertical coordinate difference are added together to obtain the transformed horizontal coordinate corresponding to the original coordinate, as shown in formula (1).

[0145] The terminal can weight the difference of the vertical coordinate based on the second vertical coordinate weight to obtain the second weighted vertical coordinate difference. It can also weight the difference of the horizontal coordinate based on the second horizontal coordinate weight to obtain the second weighted horizontal coordinate difference. The difference between the second weighted vertical coordinate difference and the second weighted horizontal coordinate difference can be calculated to obtain the transformed vertical coordinate corresponding to the original coordinate, as shown in formula (2).

[0146] The terminal can use the transformed x-coordinate and transformed y-coordinate as the transformed coordinates corresponding to the original coordinates, thus obtaining the set of transformed coordinates.

[0147] 206. The terminal selects the coordinate set of the reference pattern from the preset coordinate set to obtain the reference coordinate set.

[0148] For example, the terminal can obtain the acquisition time of each preset pattern, sort the preset patterns based on the acquisition time to obtain the acquisition order of the preset patterns, select the preset pattern acquired first as the reference pattern according to the acquisition order, and select the coordinate set of the reference pattern from the coordinate set of the preset patterns to obtain the reference coordinate set.

[0149] 207. The terminal normalizes the transformed coordinate set based on the reference coordinate set to obtain the normalized coordinate set.

[0150] For example, the terminal can filter the reference starting point coordinates and the reference ending point coordinates of the reference pattern from the set of reference coordinates.

[0151] The terminal can calculate the Euclidean distance between the reference start point coordinates and the reference end point coordinates to obtain the reference distance, or it can calculate the difference between the reference start point coordinates and the reference end point coordinates to obtain the reference distance, and so on.

[0152] The terminal can calculate the distance between the starting point and the ending point coordinates in the transformed coordinate set to obtain the target distance. It then calculates the ratio between the reference distance and the target distance to obtain the normalization parameter. Finally, it multiplies the normalization parameter by the x-coordinate and y-coordinate of each coordinate in the transformed coordinate set to obtain the normalized coordinate set.

[0153] 208. The terminal calculates the coordinate distance between the normalized coordinate set and the coordinate set of the preset pattern, and unlocks the object to be unlocked based on the coordinate distance and the preset first distance threshold.

[0154] For example, the terminal can filter out the first pattern to be collected from the preset patterns based on the preset pattern collection order to obtain candidate patterns, and then filter out the coordinate set of the candidate patterns from the coordinate set of the preset patterns to obtain candidate coordinate set.

[0155] The terminal can use the DTW algorithm to calculate the distance between each coordinate in the normalized coordinate set and the coordinates in the candidate coordinate set, and then fuse the calculated distances to obtain the minimum sum of distances between the normalized coordinate set and the candidate coordinate set. This minimum sum of distances can be used as the target coordinate distance. Alternatively, the terminal can calculate the coordinate distance between each coordinate in the normalized coordinate set and each coordinate in the candidate coordinate set separately, fuse the coordinate distances, and then filter out the minimum distance from the fused distances to obtain the target coordinate distance, and so on.

[0156] When the target coordinate distance is less than a preset first distance threshold, the terminal can directly unlock the object to be unlocked. Alternatively, when the target coordinate distance is less than the preset first distance threshold, the terminal can determine the unlocking result of the object to be unlocked and send the unlocking result to the unlocking server corresponding to the object to be unlocked, so that the unlocking server can unlock the object to be unlocked, and so on.

[0157] Optionally, in some embodiments, when the target coordinate distance is greater than or equal to a preset first distance threshold, the terminal can return to the step of performing the collection order based on the preset pattern and filtering the candidate coordinate set of candidate patterns in the coordinate set of the preset pattern until all preset patterns are candidate patterns, so as to obtain at least one target coordinate distance. When there is no target coordinate distance less than the preset first distance threshold, a prompt message indicating that the unlocking of the object to be unlocked has failed is returned.

[0158] Optionally, in some embodiments, the terminal may use an image recognition model to extract features from the unlock pattern to obtain the current pattern features of the unlock pattern, use the image recognition model to extract features from a preset pattern to obtain the target pattern features of the preset pattern, calculate the feature similarity between the current pattern features and the target pattern features to obtain a first feature similarity, and unlock the object to be unlocked when the first feature similarity is greater than a preset feature similarity threshold, and return a prompt message indicating that unlocking the object to be unlocked has failed when there is no first feature similarity greater than the preset feature similarity threshold. Alternatively, the terminal may use an image recognition model to extract features from the normalized coordinate set of the unlock pattern to obtain the current coordinate features, and use the image recognition model to extract features from the coordinate set of the preset pattern to obtain the target coordinate features, calculate the similarity between the current coordinate features and the target coordinate features to obtain a second feature similarity, and unlock the object to be unlocked when there is a second feature similarity greater than the preset feature similarity threshold, and return a prompt message indicating that unlocking the object to be unlocked has failed when there is no second feature similarity greater than the preset feature similarity threshold, and so on. The preset feature similarity threshold is a critical value used to determine whether the unlock pattern matches the preset pattern. When the first feature similarity or the second feature similarity is greater than the threshold, the pattern is considered to match and the object to be unlocked can be unlocked.

[0159] As can be seen from the above, in this embodiment, after the terminal collects the trajectory coordinates of the unlocking pattern for the object to be unlocked in a preset coordinate system and obtains the original coordinate set of the unlocking pattern, it filters out the starting coordinates of the pattern's starting point and the ending coordinates of the pattern's ending point from the original coordinate set. Then, based on the starting coordinates and the ending coordinates, it constructs a relative coordinate system relative to the pattern's starting point and ending point. According to the starting coordinates, the original coordinates in the original coordinate set are converted into coordinates in the relative coordinate system to obtain a converted coordinate set. Then, the coordinate distance between the converted coordinate set and the coordinate set of at least one preset pattern is calculated. The object to be unlocked is unlocked according to the coordinate distance and a preset first distance threshold. Since this scheme only requires swiping the pattern on the screen during the unlocking process, collecting the trajectory coordinates of this unlocking pattern, and converting the collected trajectory coordinates into a converted coordinate set relative to the starting point and ending point, it can ensure that the unlocking pattern input during the unlocking process can be of any size and direction. By calculating the distance between the converted coordinate set and the preset coordinate set of the preset pattern, the unlocking process does not require a specific paradigm or fixed requirements. It can achieve unlocking with any starting point, any size, and any pressure. Therefore, it can improve the accuracy of pattern unlocking for special users.

[0160] To better implement the above methods, this application also provides a pattern unlocking device, which can be integrated into an electronic device, such as a server or terminal. The terminal may include a tablet computer, a laptop computer, and / or a personal computer.

[0161] For example, as shown in Figure 10, the pattern unlocking device may include a collection unit 301, a filtering unit 302, a construction unit 303, a conversion unit 304, and an unlocking unit 305, as follows:

[0162] (1) Acquisition unit 301;

[0163] The acquisition unit 301 is used to acquire the trajectory coordinates of the unlocking pattern of the object to be unlocked in a preset coordinate system, and obtain the original coordinate set of the unlocking pattern.

[0164] For example, the acquisition unit 301 can be used to display the sliding trajectory of the single-point sliding operation when a single-point sliding operation for unlocking the object to be unlocked is detected, acquire the pixel coordinates of each pixel in the sliding trajectory in a preset coordinate system, and fade the sliding trajectory. When the single-point sliding operation is detected to be over, the sliding trajectory is used as the unlocking pattern, and the pixel coordinates are used as the trajectory coordinates to obtain the original coordinate set of the unlocking pattern.

[0165] (2) Filtering unit 302;

[0166] The filtering unit 302 is used to filter out the starting coordinates of the pattern's starting point and the ending coordinates of the pattern's ending point from the original coordinate set.

[0167] For example, the filtering unit 302 can be used to identify the starting point and ending point of the pattern in the sliding trajectory corresponding to the unlocking pattern, and to filter out the starting point coordinates of the starting point and the ending point coordinates of the pattern in the original coordinate set.

[0168] (3) Constructing unit 303;

[0169] The construction unit 303 is used to construct a relative coordinate system based on the starting point coordinates and the ending point coordinates. This relative coordinate system is a coordinate system relative to the starting point and the ending point of the pattern.

[0170] For example, the construction unit 303 can be used to connect the starting point and the ending point of the pattern based on the starting point coordinates and the ending point coordinates to obtain the pattern connecting line. The starting point of the pattern is taken as the origin of the relative coordinate system, and the straight line where the pattern connecting line is located is taken as the horizontal axis of the relative coordinate system. Based on the origin and the horizontal axis, the vertical axis corresponding to the horizontal axis is constructed to obtain the relative coordinate system.

[0171] (4) Conversion unit 304;

[0172] The transformation unit 304 is used to convert the original coordinates in the original coordinate set into coordinates in the relative coordinate system based on the starting coordinates, so as to obtain the transformed coordinate set.

[0173] For example, the transformation unit 304 can specifically be used to calculate the angle between the relative coordinate system and the preset coordinate system, obtain the coordinate system angle, calculate the difference between the original coordinates in the original coordinate set and the starting point coordinates, obtain the coordinate difference corresponding to each original coordinate, which may include the difference in the horizontal coordinate and the difference in the vertical coordinate. Based on the coordinate system angle, the horizontal coordinate transformation parameters and the vertical coordinate transformation parameters are determined. According to the horizontal coordinate transformation parameters, the difference in the horizontal coordinate and the difference in the vertical coordinate are added to obtain the transformed horizontal coordinate corresponding to the original coordinates. Based on the vertical coordinate transformation parameters, the difference between the difference in the horizontal coordinate and the difference in the vertical coordinate are calculated to obtain the transformed vertical coordinate corresponding to the original coordinates. The transformed horizontal coordinate and the transformed vertical coordinate are used as the transformed coordinates corresponding to the original coordinates to obtain the transformed coordinate set.

[0174] (5) Unlocking unit 305;

[0175] The unlocking unit 305 is used to calculate the coordinate distance between the converted coordinate set and the coordinate set of at least one preset pattern, and to unlock the object to be unlocked according to the coordinate distance and the preset first distance threshold.

[0176] For example, the unlocking unit 305 can be used to filter out the coordinate set of a reference pattern from the coordinate set of a preset pattern to obtain a reference coordinate set. Based on the reference coordinate set, the transformed coordinate set is normalized to obtain a normalized coordinate set. Based on the acquisition order of the preset pattern, a candidate coordinate set of candidate patterns is filtered out from the coordinate set of the preset pattern. The coordinate distance between the coordinates in the normalized coordinate set and the coordinates in the candidate coordinate set is calculated to obtain the target coordinate distance. When the target coordinate distance is less than a preset first distance threshold, the object to be unlocked is unlocked. When the target coordinate distance is greater than or equal to the preset first distance threshold, the step of filtering out the candidate coordinate set of candidate patterns from the coordinate set of the preset pattern based on the acquisition order of the preset pattern is returned until all preset patterns are candidate patterns, so as to obtain at least one target coordinate distance. When there is no target coordinate distance less than the preset first distance threshold, an unlocking failure prompt message is returned for the object to be unlocked.

[0177] Optionally, in some embodiments, the pattern unlocking device may further include a pattern input unit 306, as shown in FIG11, which may be as follows:

[0178] The pattern input unit 306 is used to input at least one preset pattern and collect the coordinate set of the preset pattern.

[0179] For example, the pattern input unit 306 can be used to collect the trajectory coordinates of a first pattern used to unlock an object under a first reference coordinate system based on a preset coordinate system, to obtain a first coordinate set; collect the trajectory coordinates of a second pattern used to unlock an object under a second reference coordinate system, to obtain a second coordinate set; and, based on the first coordinate set, normalize the second coordinate set and calculate the coordinate distance between the normalized second coordinate set and the first coordinate set to obtain a coordinate set of at least one preset pattern.

[0180] In practice, each of the above units can be implemented as an independent entity or can be arbitrarily combined to be implemented as the same or several entities. For the specific implementation of each of the above units, please refer to the previous method embodiments, which will not be repeated here.

[0181] As can be seen from the above, in this embodiment of the application, after the acquisition unit 301 acquires the trajectory coordinates of the unlocking pattern of the object to be unlocked in a preset coordinate system and obtains the original coordinate set of the unlocking pattern, the filtering unit 302 filters out the starting coordinates of the pattern's starting point and the ending coordinates of the pattern's ending point from the original coordinate set. Then, the construction unit 303 constructs a relative coordinate system relative to the pattern's starting point and ending point based on the starting and ending coordinates. The transformation unit 304 converts the original coordinates in the original coordinate set into coordinates in the relative coordinate system according to the starting coordinates, obtaining a transformed coordinate set. Finally, the unlocking unit 305 calculates the coordinates of the transformed coordinate set and at least one preset pattern. The coordinate distance between sets is used to unlock the object to be unlocked based on the coordinate distance and a preset first distance threshold. Since this scheme only requires swiping a pattern on the screen during the unlocking process to collect the trajectory coordinates of the unlocking pattern, and converting the collected trajectory coordinates into a transformed coordinate set relative to the start and end points, it can ensure that the input unlocking pattern can be of any size and direction. By calculating the distance between the transformed coordinate set and the preset pattern coordinate set, the unlocking process does not require a specific paradigm or fixed requirements. It can be achieved with any start point, any size, and any pressure. Therefore, it can improve the accuracy of pattern unlocking for special users.

[0182] This application also provides an electronic device, as shown in FIG12, which illustrates a schematic diagram of the structure of the electronic device involved in this application embodiment. Specifically:

[0183] The electronic device may include components such as a processor 401 with one or more processing cores, a memory 402 with one or more computer-readable storage media, a power supply 403, and an input unit 404. Those skilled in the art will understand that the electronic device structure shown in FIG12 does not constitute a limitation on the electronic device, and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:

[0184] The processor 401 is the control center of the electronic device, connecting various parts of the device via various interfaces and lines. It executes software programs and / or modules stored in the memory 402, and calls data stored in the memory 402, to perform various functions and process data. Optionally, the processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 401.

[0185] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and data processing by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 402 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.

[0186] The electronic device also includes a power supply 403 that supplies power to the various components. Preferably, the power supply 403 can be logically connected to the processor 401 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 403 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0187] The electronic device may also include an input unit 404, which can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.

[0188] Although not shown, the electronic device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 401 in the electronic device loads the executable files corresponding to the processes of one or more applications into the memory 402 according to the following instructions, and the processor 401 runs the applications stored in the memory 402 to realize various functions, as follows:

[0189] The trajectory coordinates of the unlocking pattern for the object to be unlocked in a preset coordinate system are collected to obtain the original coordinate set of the unlocking pattern. The starting coordinates of the pattern's starting point and the ending coordinates of the pattern's ending point are selected from the original coordinate set. Based on the starting coordinates and the ending coordinates, a relative coordinate system is constructed. This relative coordinate system is a coordinate system relative to the starting point and the ending point of the pattern. According to the starting coordinates, the original coordinates in the original coordinate set are converted into coordinates in the relative coordinate system to obtain the converted coordinate set. The coordinate distance between the converted coordinate set and the coordinate set of at least one preset pattern is calculated. The object to be unlocked is unlocked according to the coordinate distance and a preset first distance threshold.

[0190] For example, when an electronic device detects a single-point swipe operation to unlock an object, it displays the swipe trajectory of the single-point swipe operation, collects the pixel coordinates of each pixel in the swipe trajectory in a preset coordinate system, and fades the swipe trajectory. When the single-point swipe operation ends, the swipe trajectory is used as the unlock pattern, and the pixel coordinates are used as the trajectory coordinates to obtain the original coordinate set of the unlock pattern. The starting point and ending point of the pattern are identified in the swipe trajectory corresponding to the unlock pattern. The starting point coordinates and the ending point coordinates of the pattern are filtered from the original coordinate set. Based on the starting point coordinates and the ending point coordinates, the starting point and the ending point are connected to obtain the pattern connecting line. The starting point of the pattern is used as the origin of the relative coordinate system, and the straight line containing the pattern connecting line is used as the horizontal axis of the relative coordinate system. Based on the origin and the horizontal axis, the vertical axis corresponding to the horizontal axis is constructed to obtain the relative coordinate system. The angle between the relative coordinate system and the preset coordinate system is calculated to obtain the coordinate system angle. The difference between the original coordinates in the original coordinate set and the starting point coordinates is calculated to obtain the coordinate difference value corresponding to each original coordinate. This coordinate difference value can include the horizontal coordinate difference value and the vertical coordinate difference value. Based on the coordinate system angle, determine the transformation parameters for the x-coordinate and y-coordinate. According to the x-coordinate transformation parameters, add the difference between the x-coordinates and y-coordinates to obtain the transformed x-coordinates corresponding to the original coordinates. Based on the y-coordinate transformation parameters, calculate the difference between the x-coordinate difference and the y-coordinate difference to obtain the transformed y-coordinates corresponding to the original coordinates. Use the transformed x-coordinates and transformed y-coordinates as the transformed coordinates corresponding to the original coordinates to obtain the set of transformed coordinates. The process involves selecting a set of reference pattern coordinates from a set of preset pattern coordinates, obtaining a reference coordinate set, normalizing the transformed coordinate set based on the reference coordinate set, obtaining a normalized coordinate set, selecting a set of candidate pattern coordinates from the set of preset pattern coordinates based on the acquisition order of the preset patterns, calculating the coordinate distance between the coordinates in the normalized coordinate set and the coordinates in the candidate coordinate set to obtain the target coordinate distance, unlocking the object to be unlocked when the target coordinate distance is less than a preset first distance threshold, returning to the step of selecting a set of candidate pattern coordinates from the set of preset pattern coordinates based on the acquisition order of the preset patterns, until all preset patterns are candidate patterns, to obtain at least one target coordinate distance, and returning a prompt message indicating unlocking failure for the object to be unlocked when no target coordinate distance is less than the preset first distance threshold.

[0191] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0192] As can be seen from the above, in this embodiment, after collecting the trajectory coordinates of the unlocking pattern for the object to be unlocked in a preset coordinate system to obtain the original coordinate set of the unlocking pattern, the starting coordinates of the pattern's starting point and the ending coordinates of the pattern's ending point are selected from the original coordinate set. Then, based on the starting coordinates and the ending coordinates, a relative coordinate system is constructed relative to the pattern's starting point and ending point. According to the starting coordinates, the original coordinates in the original coordinate set are converted into coordinates in the relative coordinate system to obtain the converted coordinate set. Then, the coordinate distance between the converted coordinate set and the coordinate set of at least one preset pattern is calculated. The object to be unlocked is unlocked according to the coordinate distance and a preset first distance threshold. Since this scheme only requires swiping the pattern on the screen during the unlocking process to collect the trajectory coordinates of the unlocking pattern and converting the collected trajectory coordinates into the converted coordinate set relative to the starting point and ending point, it can ensure that the unlocking pattern input during the unlocking process can be of any size and direction. By calculating the distance between the converted coordinate set and the preset coordinate set of the preset pattern, the unlocking process does not require a specific paradigm or fixed requirements. Unlocking can be achieved with any starting point, any size, and any pressure. Therefore, it can improve the accuracy of pattern unlocking for special users.

[0193] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0194] Therefore, embodiments of this application provide a computer-readable storage medium storing a plurality of instructions that can be loaded by a processor to execute steps in any of the pattern unlocking methods provided in embodiments of this application. For example, the instructions can execute the following steps:

[0195] The trajectory coordinates of the unlocking pattern for the object to be unlocked in a preset coordinate system are collected to obtain the original coordinate set of the unlocking pattern. The starting coordinates of the pattern's starting point and the ending coordinates of the pattern's ending point are selected from the original coordinate set. Based on the starting coordinates and the ending coordinates, a relative coordinate system is constructed. This relative coordinate system is a coordinate system relative to the starting point and the ending point of the pattern. According to the starting coordinates, the original coordinates in the original coordinate set are converted into coordinates in the relative coordinate system to obtain the converted coordinate set. The coordinate distance between the converted coordinate set and the coordinate set of at least one preset pattern is calculated. The object to be unlocked is unlocked according to the coordinate distance and a preset first distance threshold.

[0196] For example, when a single-point swipe operation to unlock an object is detected, the swipe trajectory is displayed. The pixel coordinates of each pixel in the trajectory are collected in a preset coordinate system, and the trajectory is faded. When the single-point swipe operation ends, the trajectory is used as the unlock pattern, and the pixel coordinates are used as the trajectory coordinates, resulting in the original coordinate set of the unlock pattern. Specifically, the position of each pixel in the trajectory can be recorded by the device's touch sensor and converted into pixel coordinates in a preset coordinate system, while the trajectory is faded. The starting and ending points of the pattern are identified in the swipe trajectory corresponding to the unlock pattern. The starting coordinates of the pattern's starting point and the ending coordinates of the pattern's ending point are filtered from the original coordinate set. Based on the starting and ending coordinates, the starting and ending points are connected to obtain a pattern connecting line. The starting point is used as the origin of the relative coordinate system, and the straight line containing the pattern connecting line is used as the horizontal axis of the relative coordinate system. Based on the origin and the horizontal axis, the vertical axis corresponding to the horizontal axis is constructed to obtain the relative coordinate system. Calculate the angle between the relative coordinate system and the preset coordinate system to obtain the coordinate system angle. Calculate the difference between the original coordinates in the original coordinate set and the starting point coordinates to obtain the coordinate difference corresponding to each original coordinate. This coordinate difference may include the difference in the horizontal coordinate and the difference in the vertical coordinate. Based on the coordinate system angle, determine the horizontal coordinate transformation parameter and the vertical coordinate transformation parameter. According to the horizontal coordinate transformation parameter, add the horizontal coordinate difference and the vertical coordinate difference to obtain the transformed horizontal coordinate corresponding to the original coordinate. Based on the vertical coordinate transformation parameter, calculate the difference between the horizontal coordinate difference and the vertical coordinate difference to obtain the transformed vertical coordinate corresponding to the original coordinate. Use the transformed horizontal coordinate and the transformed vertical coordinate as the transformed coordinates corresponding to the original coordinates to obtain the transformed coordinate set. The process involves selecting a set of reference pattern coordinates from a set of preset pattern coordinates, obtaining a reference coordinate set, normalizing the transformed coordinate set based on the reference coordinate set, obtaining a normalized coordinate set, selecting a set of candidate pattern coordinates from the set of preset pattern coordinates based on the acquisition order of the preset patterns, calculating the coordinate distance between the coordinates in the normalized coordinate set and the coordinates in the candidate coordinate set to obtain the target coordinate distance, unlocking the object to be unlocked when the target coordinate distance is less than a preset first distance threshold, returning to the step of selecting a set of candidate pattern coordinates from the set of preset pattern coordinates based on the acquisition order of the preset patterns, until all preset patterns are candidate patterns, to obtain at least one target coordinate distance, and returning a prompt message indicating unlocking failure for the object to be unlocked when no target coordinate distance is less than the preset first distance threshold.

[0197] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0198] The computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0199] Since the instructions stored in the computer-readable storage medium can execute the steps of any pattern unlocking method provided in the embodiments of this application, the beneficial effects that any pattern unlocking method provided in the embodiments of this application can achieve can be realized, as detailed in the preceding embodiments, and will not be repeated here.

[0200] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the electronic device to perform the methods provided in the various alternative implementations of the pattern unlocking aspect or terminal / application / permission unlocking aspect described above.

[0201] The foregoing has provided a detailed description of a pattern unlocking method and related equipment provided in the embodiments of this application. The related equipment may include a pattern unlocking device, an electronic device, a computer program product, and a computer-readable storage medium. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

[0202] In summary, this application provides a pattern unlocking method, apparatus, device, computer-readable storage medium, and computer program product. The electronic device acquires the trajectory coordinates of the unlocking pattern for the object to be unlocked in a preset coordinate system, obtaining an original coordinate set. From this set, the coordinates of the pattern's start and end points are selected. A relative coordinate system is constructed based on these two coordinates. The original coordinates are then converted to coordinates in the relative coordinate system based on the start coordinates, resulting in a transformed coordinate set. Finally, the coordinate distance between the transformed coordinate set and the coordinate set of at least one preset pattern is calculated. The object to be unlocked is then unlocked based on this distance and a preset first distance threshold. This method, by constructing a relative coordinate system and performing coordinate transformation, eliminates the influence of differences in the size and direction of the unlocking pattern, making unlocking unrestricted by specific paradigms and fixed requirements. This improves the accuracy of coordinate calculation and pattern matching, thereby enhancing the accuracy of pattern unlocking. Simultaneously, by minimizing the sliding trajectory, the privacy and security of the unlocking process are enhanced, reducing the risk of information leakage.

[0203] Furthermore, based on the start and end coordinates, the electronic device connects the start and end points of the pattern to obtain a pattern connecting line. Using the start point of the pattern as the origin of the relative coordinate system and the straight line containing the pattern connecting line as the horizontal axis, a vertical axis is then constructed to obtain the relative coordinate system. This construction method, based on the start and end points of the unlocking pattern itself, closely links the relative coordinate system to the unlocking pattern, more accurately reflecting the relative positional relationship of the unlocking pattern. This provides a stable and precise reference for subsequent coordinate transformations, reduces coordinate errors caused by improper coordinate system selection, improves the accuracy of coordinate transformations, and thus enhances the accuracy of unlocking judgment. This method of constructing the relative coordinate system also has good adaptability, capable of handling unlocking patterns of different shapes and orientations, enhancing the system's versatility.

[0204] When constructing the relative coordinate system, the electronic device defines the direction from the starting point to the ending point of the pattern on the horizontal axis as the positive direction. A straight line perpendicular to the horizontal axis is constructed as the vertical axis, and the counter-clockwise direction of the positive horizontal axis is defined as the positive vertical axis direction. Thus, the relative coordinate system is constructed based on the origin, the positive horizontal axis direction, and the positive vertical axis direction. Clearly defining the positive directions of the coordinate axes provides a unified directional standard for the relative coordinate system, avoiding calculation confusion caused by ambiguous directions. This facilitates standardized operations for subsequent coordinate transformations and distance calculations, improving the accuracy and efficiency of calculations, reducing errors in the calculation process, and thereby enhancing the reliability of unlocking judgments. This standardized coordinate system construction method also facilitates algorithm optimization and expansion, reducing the difficulty of development and maintenance.

[0205] When converting the original coordinates to coordinates in a relative coordinate system, the electronic device calculates the angle between the relative coordinate system and the preset coordinate system to obtain the coordinate system angle. Then, based on this angle and the starting coordinates, the original coordinates are transformed to obtain the transformed coordinate set. Considering that the coordinate system angle accurately reflects the relative positional relationship between two coordinate systems, the original coordinates are more accurately mapped to the relative coordinate system during the transformation process. This reduces coordinate deviations caused by coordinate system differences, improves the accuracy of the coordinate transformation, and provides a reliable data foundation for subsequent accurate calculation of coordinate distances and unlocking decisions. This transformation method can also effectively handle coordinate system rotation, enhancing the system's compatibility with different coordinate system settings.

[0206] Furthermore, the electronic device calculates the difference between the original coordinates and the starting point coordinates in the original coordinate set to obtain a coordinate difference value. This difference value includes the difference in the horizontal coordinate and the difference in the vertical coordinate. Then, based on the coordinate system angle, the difference in the horizontal coordinate and the difference in the vertical coordinate are fused at least once to obtain the transformed horizontal coordinate and the transformed vertical coordinate, thus obtaining the transformed coordinate set. By calculating the difference and performing the fusion operation, the coordinates can be adjusted specifically according to the coordinate system angle, making the transformed coordinates more consistent with the requirements of the relative coordinate system, further improving the accuracy of coordinate transformation and reducing the impact of coordinate errors on unlocking judgment. This coordinate transformation method based on difference and fusion has high flexibility and can adapt to different coordinate system transformation requirements.

[0207] When fusing the differences in horizontal and vertical coordinates, the electronic device determines the horizontal and vertical coordinate transformation parameters based on the coordinate system angle. The horizontal and vertical coordinate differences are added together using the horizontal transformation parameters to obtain the transformed horizontal coordinate corresponding to the original coordinates. The difference between the horizontal and vertical coordinate differences is calculated using the vertical transformation parameters to obtain the transformed vertical coordinate corresponding to the original coordinates. This parameter-based calculation method allows for flexible adjustment of the coordinate transformation calculation based on the coordinate system angle, ensuring that the transformed coordinates more accurately reflect the position of the unlocking pattern in the relative coordinate system. This improves the accuracy and adaptability of the coordinate transformation, providing more reliable coordinate data for subsequent accurate calculation of coordinate distances. This parameterized calculation method can also optimize the coordinate transformation effect by adjusting the parameters, thereby improving system performance.

[0208] When calculating the coordinate distance between the transformed coordinate set and the coordinate set of at least one preset pattern and performing unlocking, the electronic device selects a reference pattern coordinate set from the preset pattern coordinate set to obtain a reference coordinate set. Based on the reference coordinate set, the transformed coordinate set is normalized to obtain a normalized coordinate set. Then, the coordinate distance between the normalized coordinate set and the preset pattern coordinate set is calculated. The device is then unlocked based on this distance and a preset first distance threshold. Normalization eliminates differences in size and proportion between different patterns, allowing for comparison under the same standard, improving the accuracy of coordinate distance calculation, and avoiding misjudgments caused by differences in pattern size and proportion, thereby enhancing the accuracy of unlocking judgment. Normalization also reduces data variance, improving the stability and convergence speed of the algorithm.

[0209] Furthermore, the electronic device filters the reference starting point coordinates and the reference ending point coordinates of the reference pattern from the reference coordinate set. It calculates the distance between these two coordinates to obtain the reference distance. Simultaneously, it calculates the distance between the starting point and ending point coordinates in the transformed coordinate set to obtain the target distance. The ratio between the reference distance and the target distance is calculated to obtain a normalization parameter. This normalization parameter is then fused with the coordinates in the transformed coordinate set to obtain the normalized coordinate set. By accurately calculating the normalization parameter and performing the fusion operation, the transformed coordinate set can be accurately adjusted to the same scale as the reference pattern, making the coordinates of different patterns comparable and improving the accuracy of the normalization process. This provides more reliable normalized coordinate data for subsequent accurate calculation of coordinate distances and unlocking decisions. This normalization method can also effectively handle patterns of different scales, enhancing the system's robustness.

[0210] When calculating the coordinate distance between the normalized coordinate set and the coordinate set of the preset pattern and performing unlocking, the electronic device, based on the acquisition order of the preset patterns, filters candidate coordinate sets of candidate patterns from the coordinate set of the preset patterns. It then calculates the coordinate distance between the coordinates in the normalized coordinate set and the coordinates in the candidate coordinate set to obtain the target coordinate distance. When the target coordinate distance is less than a preset first distance threshold, the device is unlocked. Filtering candidate patterns and calculating distances according to the acquisition order allows for a systematic comparison of each preset pattern, avoiding omissions and confusion, improving the efficiency and accuracy of unlocking judgment, and ensuring that a matching pattern is accurately found among many preset patterns for unlocking. This orderly filtering and comparison method also reduces unnecessary calculations and improves the system's operating efficiency.

[0211] When the target coordinate distance is greater than or equal to a preset first distance threshold, the electronic device returns to the step of executing the acquisition sequence based on the preset pattern, filtering the candidate coordinate set of candidate patterns from the coordinate set of the preset patterns, until all preset patterns are candidate patterns, in order to obtain at least one target coordinate distance. When no target coordinate distance is less than the preset first distance threshold, a prompt message indicating unlocking failure for the object to be unlocked is returned. This mechanism of multiple comparisons and cyclical filtering fully utilizes all preset patterns for unlocking judgment, avoiding unlocking failure due to inaccurate comparison in a single instance, improving the success rate and reliability of unlocking, and ensuring that unlocking failure is only determined when all preset patterns do not match. This mechanism can also balance the accuracy and efficiency of unlocking by setting reasonable number of cycles and thresholds.

[0212] Before calculating the coordinate distance between the transformed coordinate set and the coordinate set of at least one preset pattern and performing unlocking, the electronic device, based on a preset coordinate system, acquires the trajectory coordinates of a first pattern used to unlock the object under a first reference coordinate system to obtain a first coordinate set, and acquires the trajectory coordinates of a second pattern used to unlock the object under a second reference coordinate system to obtain a second coordinate set. The second coordinate set is then normalized based on the first coordinate set, and the coordinate distance between the normalized second coordinate set and the first coordinate set is calculated to obtain the coordinate set of at least one preset pattern. By acquiring multiple patterns and performing normalization and distance calculation, the diversity and accuracy of the preset patterns are increased, enabling the preset patterns to cover more possible unlocking situations and improving the success rate and adaptability of unlocking. This acquisition and processing method can further improve the accuracy of unlocking by increasing the number of preset patterns.

[0213] Furthermore, the electronic device acquires the trajectory coordinates of the first pattern used to unlock the object in a preset coordinate system to obtain an initial coordinate set. The start and end coordinates of the first pattern are then selected from this initial coordinate set. A first reference coordinate system is constructed based on these coordinates. Finally, the coordinates in the initial coordinate set are converted to those in the first reference coordinate system, resulting in the first coordinate set. This method of constructing the first reference coordinate system and converting coordinates is similar to the operation in the unlocking process, ensuring the accuracy and consistency of the first pattern coordinates. This provides a reliable foundation for subsequently determining the coordinate set of the preset pattern, ensuring that the coordinates of the preset pattern accurately reflect the characteristics of the pattern. This construction and conversion method also improves data consistency and repeatability, facilitating subsequent analysis and processing.

[0214] When calculating the coordinate distance between the normalized second coordinate set and the first coordinate set to obtain the coordinate set of at least one preset pattern, the electronic device calculates the current coordinate distance between the normalized second coordinate set and the first coordinate set. When the current coordinate distance is less than a preset second distance threshold, it is determined that the second pattern acquisition is successful, and the process returns to the step of acquiring the trajectory coordinates of the second pattern used to unlock the object to be unlocked in the second reference coordinate system. This process continues until the number of successful acquisitions reaches a preset number, resulting in at least one second pattern and the normalized second coordinate set corresponding to the second pattern. The first pattern and the second pattern are used as preset patterns, and the first coordinate set and the normalized second coordinate set are used as the coordinate set of the preset pattern. Through multiple acquisitions and distance judgments, the acquired preset patterns are ensured to have high accuracy and consistency, avoiding unlocking misjudgments caused by inaccurate individual patterns, improving the quality of the preset patterns, and thus enhancing the accuracy and reliability of unlocking. This multiple acquisition and judgment method can also optimize the quality of the preset patterns by adjusting the preset number of acquisitions and the threshold.

[0215] When the current coordinate distance is greater than or equal to a preset second distance threshold, the electronic device determines that the second pattern acquisition has failed and generates a prompt message for re-acquisition. Based on the re-acquisition prompt message, it returns to the step of acquiring the trajectory coordinates of the second pattern used to unlock the object in the second reference coordinate system, until the second pattern is successfully acquired, thus updating the second pattern. This re-acquisition mechanism ensures that the acquired second pattern has sufficient similarity to the first pattern, improving the quality and accuracy of the preset pattern and enabling it to more accurately represent the characteristics of the unlocking pattern, thereby increasing the success rate and reliability of unlocking. This re-acquisition mechanism can also improve the user experience by setting reasonable prompt messages and the number of acquisitions.

[0216] When collecting the trajectory coordinates of the unlock pattern for an object to be unlocked within a preset coordinate system, the electronic device displays the sliding trajectory of the single-point swipe operation when it detects the single-point swipe operation. It then collects the pixel coordinates of each pixel in the sliding trajectory within the preset coordinate system and applies a fading effect to the trajectory. When the single-point swipe operation ends, the sliding trajectory is used as the unlock pattern, and the pixel coordinates are used as the trajectory coordinates, resulting in the original coordinate set of the unlock pattern. Displaying the sliding trajectory allows users to accurately draw the unlock pattern, improving the accuracy of the collected trajectory coordinates. The fading effect, without affecting user operation, reduces the visibility of the sliding trajectory, enhancing the privacy and security of the unlocking process and preventing others from obtaining unlock information by observing the sliding trajectory. This fading effect also reduces screen resource usage and improves system performance.

[0217] Furthermore, when the electronic device detects that pixel coordinate acquisition is complete, it determines the acquisition time of the pixel coordinates. Based on the acquisition time and a preset fade-out time, it determines the pixel elimination time. According to the elimination time, the pixel is eliminated in the sliding trajectory to fade the sliding trajectory. Precisely controlling the pixel elimination time allows the sliding trajectory to fade according to preset rules, enhancing the controllability and accuracy of the fade-out process, further improving the privacy and security of the unlocking process, and ensuring that the user's unlocking information is not leaked. This precise control method can also adjust the fade-out time according to different application scenarios and user needs, improving the system's flexibility.

[0218] Furthermore, an image recognition model can be used to extract features from the unlock pattern and calculate the feature similarity between the unlock pattern and a preset pattern to unlock the device. The image recognition model can extract deeper features of the pattern, and compared to simple coordinate distance calculations, it can more accurately determine the similarity of patterns, improving unlocking accuracy. At the same time, the image recognition model can handle more complex patterns, enhancing the system's adaptability to different types of unlock patterns. When acquiring a preset pattern, an unlock configuration page is displayed, with controls that include voice reading functionality, facilitating operation for blind or visually impaired users. This demonstrates the system's ease of use and inclusivity, expanding its applicable user base. Moreover, during pattern acquisition, the pattern gradually disappears (faded out), maximizing security during use, reducing the risk of information leakage, and preventing interference with subsequent operations due to pattern residue.

[0219] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0220] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A pattern unlocking method, executed by an electronic device, comprising: Collect the trajectory coordinates of the unlocking pattern for the object to be unlocked in a preset coordinate system to obtain the original coordinate set of the unlocking pattern; The starting coordinates of the pattern's starting point and the ending coordinates of the pattern's ending point are filtered out from the original set of coordinates. Based on the starting point coordinates and the ending point coordinates, a relative coordinate system is constructed, which is a coordinate system relative to the starting point and the ending point of the pattern; Based on the starting point coordinates, the original coordinates in the original coordinate set are converted into coordinates in the relative coordinate system to obtain the converted coordinate set; and Calculate the coordinate distance between the transformed coordinate set and the coordinate set of at least one preset pattern, and unlock the object to be unlocked based on the coordinate distance and a preset first distance threshold.

2. The pattern unlocking method according to claim 1, wherein constructing a relative coordinate system based on the starting point coordinates and the ending point coordinates includes: Based on the starting point coordinates and the ending point coordinates, the starting point and the ending point of the pattern are connected to obtain the pattern connecting line; The starting point of the pattern is taken as the origin of the relative coordinate system, and the straight line where the pattern connecting line is located is taken as the horizontal axis of the relative coordinate system. Based on the origin and the horizontal axis, construct the vertical axis corresponding to the horizontal axis to obtain a relative coordinate system.

3. The pattern unlocking method according to claim 2, wherein constructing the ordinate axis corresponding to the horizontal coordinate axis based on the origin and the horizontal coordinate axis to obtain a relative coordinate system includes: The direction from the starting point of the pattern to the ending point of the pattern on the horizontal axis is taken as the positive direction of the horizontal axis; Construct a straight line perpendicular to the horizontal coordinate axis as the vertical coordinate axis of the relative coordinate system, and take the counterclockwise direction of the positive direction of the horizontal coordinate axis as the positive direction of the vertical coordinate axis; The relative coordinate system is constructed based on the origin of the coordinate system, the positive direction of the horizontal axis, and the positive direction of the vertical axis.

4. The pattern unlocking method according to any one of claims 1 to 3, wherein converting the original coordinates in the original coordinate set into coordinates in the relative coordinate system based on the starting coordinates to obtain the converted coordinate set includes: Calculate the angle between the relative coordinate system and the preset coordinate system to obtain the coordinate system angle; Based on the included angle of the coordinate system and the starting coordinates, the original coordinates in the original coordinate set are transformed to obtain the transformed coordinate set.

5. The pattern unlocking method according to claim 4, wherein the step of performing coordinate transformation on the original coordinates in the original coordinate set according to the included angle of the coordinate system and the starting coordinates to obtain the transformed coordinate set includes: Calculate the difference between the original coordinates in the original coordinate set and the starting point coordinates to obtain the coordinate difference corresponding to each original coordinate. The coordinate difference includes the difference between the horizontal coordinate and the difference between the vertical coordinate. Based on the included angle of the coordinate system, the difference between the horizontal coordinates and the difference between the vertical coordinates are fused at least once to obtain the transformed horizontal coordinates and the transformed vertical coordinates; The transformed x-coordinate and transformed y-coordinate are used as the transformed coordinates corresponding to the original coordinates to obtain the set of transformed coordinates.

6. The pattern unlocking method according to claim 5, wherein fusing the difference between the horizontal coordinates and the difference between the vertical coordinates at least once based on the included angle of the coordinate system to obtain the transformed horizontal coordinates and the transformed vertical coordinates includes: Based on the included angle of the coordinate system, determine the horizontal coordinate transformation parameters and the vertical coordinate transformation parameters; Based on the horizontal coordinate transformation parameters, the difference between the horizontal coordinates and the difference between the vertical coordinates are added to obtain the transformed horizontal coordinates corresponding to the original coordinates; Based on the ordinate transformation parameters, the difference between the abscissa difference and the ordinate difference is calculated to obtain the transformed ordinate corresponding to the original coordinates.

7. The pattern unlocking method according to any one of claims 1 to 6, wherein calculating the coordinate distance between the transformed coordinate set and the coordinate set of at least one preset pattern, and unlocking the object to be unlocked based on the coordinate distance and a preset first distance threshold, comprises: The coordinate set of the reference pattern is selected from the coordinate set of the preset pattern to obtain the reference coordinate set; Based on the reference coordinate set, the transformed coordinate set is normalized to obtain the normalized coordinate set. Calculate the coordinate distance between the normalized coordinate set and the coordinate set of the preset pattern, and unlock the object to be unlocked based on the coordinate distance and a preset first distance threshold.

8. The pattern unlocking method according to claim 7, wherein the step of normalizing the transformed coordinate set based on the reference coordinate set to obtain a normalized coordinate set includes: The reference starting point coordinates and the reference ending point coordinates of the reference pattern are selected from the set of reference coordinates. Calculate the distance between the reference starting point coordinates and the reference ending point coordinates to obtain the reference distance, and calculate the distance between the starting point coordinates and the ending point coordinates in the transformed coordinate set to obtain the target distance; The ratio between the reference distance and the target distance is calculated to obtain a normalized parameter. The normalized parameter is then fused with the coordinates in the transformed coordinate set to obtain the normalized coordinate set.

9. The pattern unlocking method according to claim 7 or 8, wherein calculating the coordinate distance between the normalized coordinate set and the coordinate set of the preset pattern, and unlocking the object to be unlocked based on the coordinate distance and a preset first distance threshold, comprises: Based on the acquisition order of the preset pattern, a candidate coordinate set of candidate patterns is selected from the coordinate set of the preset pattern. Calculate the coordinate distance between the coordinates in the normalized coordinate set and the coordinates in the candidate coordinate set to obtain the target coordinate distance; When the target coordinate distance is less than a preset first distance threshold, the object to be unlocked is unlocked.

10. The pattern unlocking method according to claim 9, further comprising: When the target coordinate distance is greater than or equal to the preset first distance threshold, the step of selecting the candidate coordinate set of candidate patterns from the coordinate set of the preset patterns based on the acquisition order is returned to until all preset patterns are candidate patterns, so as to obtain at least one target coordinate distance; If there is no target coordinate distance less than the preset first distance threshold, a prompt message indicating that unlocking the object to be unlocked has failed is returned.

11. The pattern unlocking method according to any one of claims 1 to 10, further comprising, before calculating the coordinate distance between the transformed coordinate set and the coordinate set of at least one preset pattern, and before unlocking the object to be unlocked based on the coordinate distance and a preset first distance threshold: Based on the preset coordinate system, the trajectory coordinates of the first pattern used to unlock the object to be unlocked are collected in the first reference coordinate system to obtain the first coordinate set; The trajectory coordinates of the second pattern used to unlock the object to be unlocked are collected in the second reference coordinate system to obtain the second coordinate set, and the second coordinate set is normalized based on the first coordinate set. Calculate the coordinate distance between the normalized second coordinate set and the first coordinate set to obtain the coordinate set of at least one preset pattern.

12. The pattern unlocking method according to claim 11, wherein acquiring the trajectory coordinates of the first pattern used to unlock the object to be unlocked in the first reference coordinate system to obtain the first coordinate set includes: Collect the trajectory coordinates of the first pattern used to unlock the object to be unlocked in the preset coordinate system to obtain an initial coordinate set; The starting point coordinates and ending point coordinates of the first pattern are selected from the initial coordinate set, and a first reference coordinate system is constructed based on the starting point coordinates and ending point coordinates of the first pattern. Based on the starting coordinates of the first pattern, the coordinates in the initial coordinate set are converted into coordinates under the first reference coordinate system to obtain the first coordinate set.

13. The pattern unlocking method according to claim 11 or 12, wherein calculating the coordinate distance between the normalized second coordinate set and the first coordinate set to obtain at least one preset pattern coordinate set includes: Calculate the coordinate distance between the normalized second coordinate set and the first coordinate set to obtain the current coordinate distance; When the current coordinate distance is less than a preset second distance threshold, it is determined that the second pattern acquisition was successful; Return to the step of collecting the trajectory coordinates of the second pattern used to unlock the object to be unlocked in the second reference coordinate system until the number of successful collections reaches a preset number, and obtain at least one second pattern and the normalized second coordinate set corresponding to the second pattern; The first pattern and the second pattern are used as the preset pattern, and the first coordinate set and the normalized second coordinate set are used as the coordinate set of the preset pattern.

14. The pattern unlocking method according to claim 13, further comprising: When the current coordinate distance is greater than or equal to the preset second distance threshold, it is determined that the second pattern acquisition has failed, and a prompt message for re-acquisition is generated; Based on the prompt information for re-acquisition, return to the step of acquiring the trajectory coordinates of the second pattern used to unlock the object to be unlocked in the second reference coordinate system, until the second pattern is successfully acquired, so as to update the second pattern.

15. The pattern unlocking method according to any one of claims 1 to 14, wherein acquiring the trajectory coordinates of the unlocking pattern for the object to be unlocked in a preset coordinate system to obtain the original coordinate set of the unlocking pattern includes: When a single-point swipe operation to unlock an object is detected, the swipe trajectory of the single-point swipe operation is displayed. Collect the pixel coordinates of each pixel in the sliding trajectory in a preset coordinate system, and then fade out the sliding trajectory. When the single-point sliding operation is detected to be over, the sliding trajectory is used as the unlock pattern, and the pixel coordinates are used as the trajectory coordinates to obtain the original coordinate set of the unlock pattern.

16. The pattern unlocking method according to claim 15, wherein fading the sliding trajectory includes: When the acquisition of the pixel coordinates is completed, the acquisition time of the pixel coordinates is determined; The elimination time of the pixel is determined based on the acquisition time and the preset fade-out time; The pixels are eliminated from the sliding trajectory based on the elimination time to fade the sliding trajectory.

17. A pattern unlocking device, comprising: The acquisition unit is used to acquire the trajectory coordinates of the unlocking pattern for the object to be unlocked in a preset coordinate system, and obtain the original coordinate set of the unlocking pattern; A filtering unit is used to filter out the starting coordinates of the pattern's starting point and the ending coordinates of the pattern's ending point from the original coordinate set; A construction unit is used to construct a relative coordinate system based on the starting point coordinates and the ending point coordinates, wherein the relative coordinate system is a coordinate system relative to the starting point and the ending point of the pattern; The transformation unit is used to convert the original coordinates in the original coordinate set into coordinates in the relative coordinate system according to the starting point coordinates, so as to obtain the transformed coordinate set. and The unlocking unit is used to calculate the coordinate distance between the transformed coordinate set and the coordinate set of at least one preset pattern, and to unlock the object to be unlocked according to the coordinate distance and a preset first distance threshold.

18. An electronic device comprising a processor and a memory, the memory storing an application program, the processor being configured to run the application program within the memory to perform the steps of the pattern unlocking method according to any one of claims 1 to 16.

19. A computer program product comprising a computer program / instructions that, when executed by a processor, implement the steps of the pattern unlocking method according to any one of claims 1 to 16.

20. A computer readable storage medium storing a plurality of instructions adapted to be loaded by a processor to perform the steps of the pattern unlocking method of any one of claims 1 to 16.