Method, device and electronic device for verifying the legitimacy of a password

By dividing the smart lock password into parts and verification parts for comparison and verification, the problem of low security caused by password fixation in the prior art is solved, and more efficient and secure legality verification is achieved.

CN116152981BActive Publication Date: 2025-09-02ZHEJIANG KONIS INTELLIGENT CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310204482.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-24
Publication Date
2025-09-02
Estimated Expiration
2043-02-24

AI Technical Summary

Technical Problem

In the existing smart lock password legality verification technology, the password remains unchanged, there are hidden dangers of leakage, and low security.

Method used

The password is divided into a password part and a verification part, and the verification code is calculated for comparison and verification, so as to improve the security of legality verification.

Benefits of technology

By decomposing the password into multiple intermediate passwords and comparing the part and the verification part, the security and efficiency of password legality verification are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116152981B_ABST
    Figure CN116152981B_ABST
Patent Text Reader

Abstract

The present application relates to the field of computer technology, and in particular to a method, device, and electronic device for verifying the legitimacy of a password. The method includes: obtaining a first password input by a user. If it is determined that the number of password digits of the first password is less than a first preset number of digits, a verification failure reminder message is output. If it is determined that the number of password digits of the first password is equal to or greater than the first preset number of digits, the first password is decomposed into N1 first intermediate passwords according to the first preset number of digits, and whether there is a legal first intermediate password among the N1 first intermediate passwords is determined based on the password part and the verification part of each first intermediate password in the N1 first intermediate passwords. If it is determined that there is a legal first intermediate password among the N1 first intermediate passwords, the first password is determined to be legal. If it is determined that there is no legal first intermediate password among the N1 first intermediate passwords, a verification failure reminder message is output. The above method can improve the security of password legitimacy verification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a password validity verification method, device, and electronic device. Background Art

[0002] With the rapid development of science and technology, smart locks have been widely used in people's lives, and the widespread use of smart locks has also brought great convenience to people's lives.

[0003] When using a smart lock, password validation is often required. However, existing password validation technology often uses a fixed password, relying primarily on a simple digit comparison. This type of verification carries the risk of password leakage, resulting in extremely low password security. Therefore, improving the security of password validation has become a pressing technical issue. Summary of the Invention

[0004] The embodiments of the present application provide a method, device and electronic device for verifying the legitimacy of a password. By dividing a first password into a password part and a verification part, a verification code is calculated by a verification algorithm for the password part and then compared with the verification part of the first password to verify the legitimacy of the password, thereby realizing rapid verification of the legitimacy of the password.

[0005] In a first aspect, embodiments of the present invention provide a method for verifying the validity of a password. The method includes: obtaining a first password input by a user. If it is determined that a target correct password matching the first password does not exist in a preset password library, determining whether the number of digits of the first password is less than a first preset number of digits, wherein the preset password library includes one or more password sets, each of the one or more password sets being used to store at least one correct password, and the target correct password being equal to some or all consecutive digits of the first password. If it is determined that the number of digits of the first password is less than the first preset number of digits, outputting a verification failure reminder message, wherein the verification failure reminder message indicates that the first password is invalid. If it is determined that the number of digits of the first password is equal to or greater than the first preset number of digits, decomposing the first password into N1 first intermediate passwords based on the first preset number of digits, and determining whether any of the N1 first intermediate passwords is a valid first intermediate password based on the password portion and the verification portion of each of the N1 first intermediate passwords, wherein N1 is a positive integer greater than or equal to 1, and the number of digits of each first intermediate password is equal to the first preset number of digits. If it is determined that there is a valid first intermediate password among the N1 first intermediate passwords, the first password is determined to be valid. If it is determined that there is no valid first intermediate password among the N1 first intermediate passwords, the verification failure reminder information is output.

[0006] In an embodiment of the present application, after the first terminal device determines that there is no correct password matching the first password in the preset password library, the first terminal device can determine whether the number of password digits of the first password is less than the first preset number of digits. If the first terminal device determines that the number of password digits of the first password is greater than or equal to the first preset number of digits, the first password can be decomposed into N1 first intermediate passwords, and based on the password part and the verification part of each first intermediate password in the N1 first intermediate passwords, it can be determined whether there is a legal first intermediate password among the N1 first intermediate passwords. Further, if the first terminal device determines that there is a legal first intermediate password among the N1 first intermediate passwords, it can be determined that the first password is legal. If the first terminal device determines that there is no legal first intermediate password among the N1 first intermediate passwords, it can output a verification failure reminder message. Through the above-mentioned password legitimacy verification method, the first terminal device can divide the first intermediate password into a password part and a verification part to complete the legitimacy verification of the first intermediate password, thereby improving the security of the password legitimacy verification.

[0007] In conjunction with the first aspect, in a feasible implementation, determining whether a valid first intermediate password exists among the N1 first intermediate passwords based on the password part and the check part of each first intermediate password includes: performing the following first check operation on any first intermediate password among the N1 first intermediate passwords: determining the password part and the check part of any first intermediate password based on a first preset number of bits and a preset password format, wherein the preset password format includes at least two password number of bits and password component structures corresponding to each password number of bits, and the at least two password number of bits includes the first preset number of bits; calculating a calculated check part of any first intermediate password based on the password part of any first intermediate password; and determining whether the calculated check part of any first intermediate password and the check part of any first intermediate password are equal. If the calculated check part and the check part of any first intermediate password are equal, determining that any first intermediate password is valid. If the calculated check part and the check part of any first intermediate password are not equal, determining that any first intermediate password is invalid. It is determined whether there is a legal first intermediate password among the N1 first intermediate passwords according to a result of performing the first verification operation on each of the N1 first intermediate passwords.

[0008] In conjunction with the first aspect, in one feasible implementation, the method further includes: determining whether the number of digits of the first password is less than a second preset number of digits, wherein the second preset number of digits is greater than the first preset number of digits. If it is determined that the number of digits of the first password is less than the second preset number of digits, outputting the verification failure reminder message. If it is determined that the number of digits of the first password is greater than or equal to the second preset number of digits, decomposing the first password into N2 second intermediate passwords based on the second preset number of digits, and determining whether there is a valid second intermediate password among the N2 second intermediate passwords based on the password portion and the verification portion of each of the N2 second intermediate passwords, wherein the number of digits of each second intermediate password is equal to the second preset number of digits, and N2 is a positive integer greater than or equal to 1. If it is determined that there is a valid second intermediate password among the N2 second intermediate passwords, then the first password is determined to be valid. If it is determined that there is no valid second intermediate password among the N2 second intermediate passwords, then outputting the verification failure reminder message.

[0009] In conjunction with the first aspect, in a feasible implementation, determining whether a valid second intermediate password exists among the N2 second intermediate passwords based on the password portion and the check portion of each second intermediate password includes: performing the following second check operation on any second intermediate password among the N2 second intermediate passwords: determining the password portion and the check portion of any second intermediate password based on the second preset number of bits and a preset password format, wherein the preset password format includes at least two password bit lengths and password component structures corresponding to each password bit length, and the at least two password bit lengths include the second preset number of bits; calculating a calculated check portion of any second intermediate password based on the password portion of any second intermediate password; and determining whether the calculated check portion of any second intermediate password and the check portion of any second intermediate password are equal. If the calculated check portion and the check portion of any second intermediate password are equal, determining that any second intermediate password is valid. If the calculated check portion and the check portion of any second intermediate password are not equal, determining that any second intermediate password is invalid. It is determined whether there is a legal second intermediate password among the N2 second intermediate passwords according to a result of performing the second verification operation on each of the N2 second intermediate passwords.

[0010] In conjunction with the first aspect, in a feasible implementation, after determining that a legal first intermediate password exists among the N1 first intermediate passwords, the method further includes: determining a characteristic bit of the legal first intermediate password based on the first preset number of bits and a preset password format. Determining a password type of the legal first intermediate password based on the characteristic bit of the legal first intermediate password. Based on the password type of the legal first intermediate password, storing the password portion of the legal first intermediate password in a password set corresponding to the password type of the legal first intermediate password in the preset password library, wherein the preset password library includes at least one password set, and each password set in the preset password library corresponds to a password type.

[0011] In conjunction with the first aspect, in a feasible implementation, after determining that the first password is legal if a legal second intermediate password exists among the N2 second intermediate passwords, the method further includes: determining a characteristic bit of the legal second intermediate password based on the second preset number of bits and a preset password format. Determining the password type of the legal second intermediate password based on the characteristic bit of the legal second intermediate password. Determining a portion of the legal second intermediate password to be stored based on the characteristic bit of the legal second intermediate password and a password portion of the legal second intermediate password, wherein the password portion of the legal second intermediate password includes the characteristic bit and the portion to be stored. Based on the password type of the legal second intermediate password, the portion of the legal second intermediate password to be stored is stored in a password set corresponding to the password type of the legal second intermediate password in the preset password library, wherein each password set in the preset password library corresponds to a password type.

[0012] In conjunction with the first aspect, in a feasible implementation, before determining that a correct password matching the first password does not exist in a preset password library, the method further includes: determining whether the preset password library is empty. If it is determined that the preset password library is not empty, decomposing the first password into N3 third intermediate passwords based on a third preset number of bits, wherein the number of bits of the N3 third intermediate passwords is equal to the third preset number of bits, and N3 is a positive integer greater than or equal to 1. Performing the following password comparison operation on any of the N3 third intermediate passwords: Determining a characteristic bit of the third intermediate password based on a preset password format. Determining a password type of the third intermediate password based on the characteristic bit of the third intermediate password. Determining a password set corresponding to the password type of the third intermediate password in the preset password library based on the password type of the third intermediate password. Determining whether a correct password equal to the third intermediate password exists in the password set corresponding to the password type of the third intermediate password. Determining whether a correct password matching the first password exists in the preset password library based on the result of performing the password comparison operation on each of the N3 third intermediate passwords.

[0013] In a second aspect, embodiments of the present invention provide a password validity verification device. The device includes: an acquisition unit configured to acquire a first password input by a user; a processing unit configured to, if it is determined that a target correct password matching the first password does not exist in a preset password library, determine whether the number of password bits of the first password is less than a first preset number of bits, wherein the preset password library includes one or more password sets, each of the one or more password sets storing at least one correct password, and the target correct password is equal to consecutive password bits or all password bits of the first password; an output unit configured to, if it is determined that the number of password bits of the first password is less than the first preset number of bits, output a verification failure reminder message, wherein the verification failure reminder message indicates that the first password is invalid; and, if it is determined that the number of password bits of the first password is equal to or greater than the first preset number of bits, decompose the first password into N1 first intermediate passwords based on the first preset number of bits, and determine whether any of the N1 first intermediate passwords is a valid first intermediate password based on the password portion and the verification portion of each of the N1 first intermediate passwords, wherein N1 is a positive integer greater than or equal to 1, and the number of password bits of each first intermediate password is equal to the first preset number of bits. The processing unit is configured to determine that the first password is valid if it is determined that a valid first intermediate password exists among the N1 first intermediate passwords. The output unit is configured to output the verification failure reminder message if it is determined that a valid first intermediate password does not exist among the N1 first intermediate passwords.

[0014] In conjunction with the second aspect, in one feasible implementation, the apparatus further includes: a determination unit. The processing unit is configured to perform the following first verification operation on any first intermediate password among the N1 first intermediate passwords. The determination unit is configured to determine a password portion and a verification portion of the first intermediate password based on the first preset number of bits and a preset password format, wherein the preset password format includes at least two password bit lengths and password component structures corresponding to each password bit length, and the at least two password bit lengths include the first preset number of bits. The processing unit is configured to calculate a calculated verification portion of the first intermediate password based on the password portion of the first intermediate password. The processing unit is configured to determine whether the calculated verification portion of the first intermediate password is equal to the verification portion of the first intermediate password. The processing unit is configured to determine that the first intermediate password is legal if the calculated verification portion of the first intermediate password is determined to be equal to the verification portion of the first intermediate password. The processing unit is configured to determine that the first intermediate password is illegal if the calculated verification portion of the first intermediate password is determined to be unequal to the verification portion of the first intermediate password. The processing unit is configured to determine whether there is a legal first intermediate password among the N1 first intermediate passwords according to a result of performing the first verification operation on each of the N1 first intermediate passwords.

[0015] In conjunction with the second aspect, in one feasible implementation, the processing unit is configured to determine whether the number of digits of the first password is less than a second preset number of digits, wherein the second preset number of digits is greater than the first preset number of digits. The output unit is configured to output the verification failure reminder message if it is determined that the number of digits of the first password is less than the second preset number of digits. The processing unit is configured to decompose the first password into N2 second intermediate passwords based on the second preset number of digits if it is determined that the number of digits of the first password is greater than or equal to the second preset number of digits, and determine whether there is a valid second intermediate password among the N2 second intermediate passwords based on the password portion and the verification portion of each of the N2 second intermediate passwords, wherein the number of digits of each second intermediate password is equal to the second preset number of digits, and N2 is a positive integer greater than or equal to 1. The processing unit is configured to determine that the first password is valid if it is determined that there is a valid second intermediate password among the N2 second intermediate passwords. The output unit is configured to output the verification failure reminder message if it is determined that there is no valid second intermediate password among the N2 second intermediate passwords.

[0016] In conjunction with the second aspect, in one feasible implementation, the processing unit is configured to perform the following second verification operation on any second intermediate password among the N2 second intermediate passwords. The determining unit is configured to determine a password portion and a verification portion of the second intermediate password based on the second preset number of bits and a preset password format, wherein the preset password format includes at least two password bit lengths and password component structures corresponding to each password bit length, and the at least two password bit lengths include the second preset number of bits. The processing unit is configured to calculate a calculated verification portion of the second intermediate password based on the password portion of the second intermediate password. The processing unit is configured to determine whether the calculated verification portion of the second intermediate password and the verification portion of the second intermediate password are equal. If the calculated verification portion of the second intermediate password and the verification portion of the second intermediate password are equal, the processing unit is configured to determine that the second intermediate password is legal. If the calculated verification portion of the second intermediate password and the verification portion of the second intermediate password are not equal, the processing unit is configured to determine that the second intermediate password is illegal. The processing unit is configured to determine whether there is a legal second intermediate password among the N2 second intermediate passwords according to a result of performing the second verification operation on each of the N2 second intermediate passwords.

[0017] In conjunction with the second aspect, in a feasible implementation, the device further includes: a storage unit. The determination unit is configured to determine the characteristic bits of the legal first intermediate password based on the first preset number of bits and the preset password format. The determination unit is configured to determine the password type of the legal first intermediate password based on the characteristic bits of the legal first intermediate password. The storage unit is configured to store the password part of the legal first intermediate password into a password set corresponding to the password type of the legal first intermediate password in the preset password library based on the password type of the legal first intermediate password, wherein the preset password library includes at least one password set, and each password set in the preset password library corresponds to one password type.

[0018] In conjunction with the second aspect, in a feasible implementation, the determination unit is configured to determine the characteristic bits of the legal second intermediate password based on the second preset number of bits and the preset password format. The determination unit is configured to determine the password type of the legal second intermediate password based on the characteristic bits of the legal second intermediate password. The processing unit is configured to determine the portion of the legal second intermediate password to be stored based on the characteristic bits of the legal second intermediate password and the password portion of the legal second intermediate password, wherein the password portion of the legal second intermediate password includes the characteristic bits and the portion to be stored. The storage unit is configured to store the portion of the legal second intermediate password to be stored in the password set corresponding to the password type of the legal second intermediate password in the preset password library based on the password type of the legal second intermediate password, wherein each password set in the preset password library corresponds to a password type.

[0019] In conjunction with the second aspect, in one feasible implementation, the determining unit is configured to determine whether the preset password library is empty. The processing unit is configured to, if it is determined that the preset password library is not empty, decompose the first password into N3 third intermediate passwords based on a third preset number of bits, wherein the number of password bits of the N3 third intermediate passwords is equal to the third preset number of bits, and N3 is a positive integer greater than or equal to 1. The processing unit is configured to perform the following password comparison operation on any third intermediate password among the N3 third intermediate passwords. The determining unit is configured to determine a characteristic bit of the third intermediate password based on a preset password format. The determining unit is configured to determine a password type of the third intermediate password based on the characteristic bit of the third intermediate password. The determining unit is configured to determine a password set corresponding to the password type of the third intermediate password in the preset password library based on the password type of the third intermediate password. The processing unit is configured to determine whether there is a correct password equal to the third intermediate password in the password set corresponding to the password type of the third intermediate password. The processing unit is configured to determine whether there is a correct password matching the first password in the preset password library based on a result of performing the password comparison operation on each of the N3 third intermediate passwords.

[0020] In a third aspect, an embodiment of the present application provides a computer-readable storage medium for storing a computer program. When the computer program runs on a computer, the computer executes the password legitimacy verification method provided by any possible implementation method in the first aspect above, and can also achieve the beneficial effects of the password legitimacy verification method provided by the first aspect.

[0021] In a fourth aspect, embodiments of the present application provide an electronic device, which may include a processor and a memory, the processor and the memory being interconnected. The memory is configured to store a computer program, and the processor is configured to execute the computer program to implement the password validity verification method provided in the first aspect, thereby achieving the beneficial effects of the password validity verification method provided in the first aspect.

[0022] By implementing the embodiment of the present invention, after the first terminal device determines that the target correct password that matches the first password does not exist in the preset password library, it can determine whether the number of password digits of the first password is less than the first preset number of digits. If the first terminal device determines that the number of password digits of the first password is greater than or equal to the first preset number of digits, the first password can be decomposed into N1 first intermediate passwords, and based on the password part and the verification part of each of the N1 first intermediate passwords, it can be determined whether there is a legal first intermediate password in the N1 first intermediate passwords, and then the first password can be determined to be legal. If the first terminal device determines that there is no legal first intermediate password in the N1 first intermediate passwords, it can output a verification failure reminder message. Using the above-mentioned password legitimacy verification method, the first terminal device can divide the first intermediate password into a password part and a verification part to complete the password legitimacy verification, thereby improving the security of the password legitimacy verification. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0024] Figure 1 This is a flowchart of a password validity verification method provided by an embodiment of the present application;

[0025] Figure 2 This is another flowchart of a password validity verification method provided by an embodiment of the present application;

[0026] Figure 3 This is a schematic diagram of the structure of a password legitimacy verification device provided in an embodiment of the present application;

[0027] Figure 4 This is another structural diagram of a password legitimacy verification device provided in an embodiment of the present application;

[0028] Figure 5 This is another structural diagram of a password legitimacy verification device provided in an embodiment of the present application;

[0029] Figure 6 It is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0030] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0031] The terms "first," "second," and so on, in the specification and claims of this application and the accompanying drawings are used to distinguish between different objects, not to describe a specific order. Furthermore, the terms "including," "having," and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps is not limited to the listed steps but may optionally include steps not listed, or may optionally include other steps inherent to the process, method, product, or apparatus.

[0032] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0033] In existing password verification technologies, the validity of passwords is usually verified by methods such as data analysis or mathematical calculations. This verification process is relatively complex and usually takes a long time. Therefore, the technical problem to be solved by this application is: how to quickly verify the validity of passwords.

[0034] In the embodiments of the present application, the preset password format is used to indicate the number of password digits and the password component structure corresponding to each password digit. The password portion and the verification portion of the password can be determined based on each password component structure. In the embodiments of the present application, there are no specific restrictions on the number of password digits, the order of the password components, and the number of password digits corresponding to the password components.

[0035] For example, when the password has 9 digits, the preset password format can be a characteristic digit (1 digit) + time digit (3 digits) + validity period (2 digits) + check digit (3 digits). Among them, the first 6 digits are the password part of the password, and the last 3 check digits are the verification part of the password.

[0036] For another example, when the password has 10 digits, the preset password format can be offline custom password (10 digits in total) = feature digit (1 digit) + custom password (6 digits) + check digit (3 digits). Among them, the first 7 digits are the password part of the password, and the last 3 check digits are the verification part of the password.

[0037] It should be understood that the feature bit can be used to distinguish the password type. Password types include one-time passwords, time-limited passwords, recurring passwords, permanent passwords, custom passwords, and clear codes. For example, a feature bit of 1 indicates a one-time password. Another example is a feature bit of 2, which indicates a time-limited password.

[0038] It's also important to understand that the time digit and expiration date indicate the password's validity period. The expiration date represents the period of time the password is valid for use, such as one hour. If the password is a recurring password, the time digit may represent the start time of the recurring password. If the password is a permanent password or a custom password with no expiration date, the time digit and expiration date do not contain time information.

[0039] It should also be understood that the custom password can be a password that is customized and input by the user.

[0040] It is also important to understand that the check digit is used to verify the validity of the password. The check digit can be obtained by performing a hash operation on the password portion of the password combined with the current time information to obtain a hash information digest, and then taking the modulus of the digits of the hash information digest.

[0041] See Figure 1 , Figure 1 This is a flow chart of a password validity verification method provided in an embodiment of the present application. The password validity verification method can be specifically executed by a first terminal device. In an embodiment of the present application, the first terminal device can be any form of electronic device that can perform password validity verification, such as a smart lock, a smart phone, a tablet computer, a portable laptop computer, a desktop computer, a self-service terminal, etc. This application does not impose any specific restrictions on the implementation form of the first terminal device. Figure 1 As shown, the method may specifically include the following steps:

[0042] S101, obtaining a first password input by a user.

[0043] In some feasible implementations, the first terminal device can obtain the first password entered by the user. It should be noted that the number of digits of the first password entered by the user can be adjusted as needed by the user. In the embodiment of the present application, there is no specific limitation on the number of digits of the first password.

[0044] S102: If it is determined that there is no target correct password matching the first password in the preset password library, determine whether the password digit number of the first password is less than a first preset digit number.

[0045] In some feasible implementations, if the first terminal device determines that a target correct password that matches the first password does not exist in the preset password library, the first terminal device may determine whether the number of password digits of the first password is less than a first preset number of digits. It should be noted that the preset password library may include one or more password sets, each of the one or more password sets is used to store at least one correct password, and the target correct password is equal to some or all of the consecutive password digits of the first password. It should be understood that for the first terminal device used for the first time, the preset password library may not contain the correct password, that is, the preset password library may be empty.

[0046] In an optional embodiment, before determining that a correct password matching the first password does not exist in the preset password library, the first terminal device may first determine whether the preset password library is empty. Further, if the first terminal device determines that the preset password library is not empty (i.e., the preset password library contains at least one correct password), the first terminal device may decompose the first password into N3 third intermediate passwords based on a third preset number of bits.

[0047] Furthermore, the first terminal device may perform a password comparison operation on each of the N3 third intermediate passwords to determine whether a correct password matching the first password exists in a preset password library. It should be noted that the number of password digits in the N3 third intermediate passwords is equal to the third preset number of digits. N3 is a positive integer greater than or equal to 1.

[0048] The password comparison operation is described below by taking any third intermediate password among the N3 third intermediate passwords as an example. Specifically, the first terminal device can determine the characteristic bit of any third intermediate password based on the preset password format. Then, the first terminal device can determine the password type of any third intermediate password based on the characteristic bit of any third intermediate password. Further, the first terminal device can determine the password set corresponding to the password type of any third intermediate password in the preset password library based on the password type of any third intermediate password. Then, the first terminal device can determine whether there is a correct password equal to any third intermediate password in the password set corresponding to the password type of any third intermediate password. It should be noted here that the preset password library includes at least one password set, and each password set in the preset password library corresponds to a password type.

[0049] Furthermore, if the first terminal device determines that there is a correct password equal to one of the N3 third intermediate passwords in the password set corresponding to the password type of any third intermediate password, the first terminal device can determine that the first password is legal.

[0050] Furthermore, if the first terminal device determines that there is no correct password equal to one of the N3 third intermediate passwords in the password set corresponding to the password type of any third intermediate password, that is, the first terminal device can determine that there is no correct password matching the first password in the preset password library, then the first terminal device can determine whether the number of password digits of the first password is less than the first preset number of digits.

[0051] For example, assume that the third preset number of digits is 6, and the user enters the first password "1234567." Assume that the correct passwords in the password set corresponding to the one-time password in the preset password library include "123456," and assume that the correct passwords in the password set corresponding to the time-limited password in the preset password library do not include "234567." The first terminal device can determine that the first password "1234567" has 7 digits, which is greater than the third preset number of digits, which is 6. Furthermore, the first terminal device can decompose the first password "1234567" into two third intermediate passwords, "123456" and "234567," based on the third preset number of digits, where N3 is 2. For the third intermediate password "123456," the first terminal device can determine, based on the preset password format, that the characteristic bit of the third intermediate password "123456" is "1." Then, based on the characteristic bit "1," the first terminal device can determine that the password type of the third intermediate password "123456" is a one-time password. Furthermore, the first terminal device can determine a password set corresponding to the one-time password in a preset password library. The first terminal device can then determine that a correct password "123456" equal to the third intermediate password "123456" exists in the password set corresponding to the one-time password. Regarding the third intermediate password "234567," the first terminal device can determine, based on the preset password format, that the characteristic bit of the third intermediate password "234567" is "2." Based on the characteristic bit "2," the first terminal device can then determine that the password type of the third intermediate password "234567" is a time-limited password. Furthermore, the first terminal device can determine a password set corresponding to the time-limited password in a preset password library. The first terminal device can then determine that the third intermediate password "234567" does not exist in the password set corresponding to the time-limited password. Because a correct password equal to one of the third intermediate passwords "123456" corresponding to the first password exists in the preset password library, the first terminal device can determine that the first password "1234567" is valid.

[0052] S103: If it is determined that the number of digits of the first password is less than the first preset number of digits, output a verification failure reminder message.

[0053] In some feasible implementations, if the first terminal device determines that the password digit number of the first password is less than the first preset digit number, the first terminal device can output a verification failure reminder message. It should be noted that the verification failure reminder message is used to indicate that the first password is illegal.

[0054] Optionally, after the first terminal device determines that the number of digits in the first password is less than a first preset number of digits, the first terminal device may output a verification failure reminder message through text or voice. For example, after the first terminal device determines that the number of digits in the first password is less than the first preset number of digits, the first terminal device may display the text "Wrong Password" on the terminal device's display to remind the user that the password verification failed. For another example, after the first terminal device determines that the number of digits in the first password is less than the first preset number of digits, the first terminal device may announce "Wrong Password" through the first terminal device's speaker to remind the user that the password verification failed.

[0055] S104, if it is determined that the number of password digits of the first password is equal to or greater than the first preset number of digits, the first password is decomposed into N1 first intermediate passwords according to the first preset number of digits, and it is determined whether there is a legal first intermediate password in the N1 first intermediate passwords based on the password part and the check part of each first intermediate password in the N1 first intermediate passwords.

[0056] In some feasible implementations, if the first terminal device determines that the number of digits of the first password is equal to or greater than a first preset number of digits, the first terminal device may decompose the first password into N1 first intermediate passwords based on the first preset number of digits, and determine whether there is a valid first intermediate password among the N1 first intermediate passwords based on the password portion and the check portion of each of the N1 first intermediate passwords. It should be noted that the number of digits of each of the N1 first intermediate passwords is equal to the first preset number of digits. N1 is a positive integer greater than or equal to 1.

[0057] In an optional embodiment, if the first terminal device determines that the number of password digits of the first password is equal to or greater than a first preset number of digits, the first terminal device may decompose the first password into N1 first intermediate passwords based on the first preset number of digits. Furthermore, the first terminal device may perform a first verification operation on each of the N1 first intermediate passwords to determine whether there is a valid first intermediate password among the N1 first intermediate passwords.

[0058] The first verification operation described above is exemplified below using any first intermediate password among the N1 first intermediate passwords as an example. Specifically, the first terminal device can determine the password portion and verification portion of any first intermediate password based on a first preset number of bits and a preset format. Then, the first terminal device can calculate the calculation verification portion of any first intermediate password based on the password portion of any first intermediate password. Further, the first terminal device can determine whether the calculation verification portion of any first intermediate password is equal to the verification portion of any first intermediate password. Then, if the first terminal device determines that the calculation verification portion of any first intermediate password is equal to the verification portion of any first intermediate password, the first terminal device can determine that any first intermediate password is legal. If the first terminal device determines that the calculation verification portion of any first intermediate password is not equal to the verification portion of any first intermediate password, the first terminal device can determine that any first intermediate password is illegal.

[0059] It should be noted here that the preset password format includes at least two password digits and a password composition structure corresponding to each password digit, and the at least two password digits include the first preset digit.

[0060] For example, assume that the first preset number of digits is 9, and the user enters the first password "12XXX01YYY." The first terminal device can determine that the first password "12XXX01YYY" has 10 digits, which is greater than the first preset number of digits (9). Furthermore, the first terminal device can decompose the first password "12XXX01YYY" into two first intermediate passwords, "12XXX01YY" and "2XXX01YYY," based on the first preset number of digits (9), where N1 is equal to 2. For the first intermediate password "12XXX01YY," the first terminal device can determine, based on the first preset number of digits (9) and the preset password format, that the password portion of the first intermediate password is "12XXX0" and the check portion is "1YY." The first terminal device can then calculate the calculated check portion of the first intermediate password, "AAA," based on the password portion of the first intermediate password, "12XXX0." Furthermore, the first terminal device can determine that the calculated check portion of the first intermediate password, "AAA," is not equal to the check portion, "1YY." Furthermore, the first terminal device can determine that the first intermediate password "12XXX01YY" is invalid. For the first intermediate password "2XXX01YYY", the first terminal device can determine that the password part of the first intermediate password is "2XXX01" and the check part is "YYY" based on the first preset number of 9 digits and the preset password format. Then, the first terminal device can calculate the calculated check part of the first intermediate password as "YYY" based on the password part "2XXX01". Further, the first terminal device can determine that the calculated check part of the first intermediate password is "YYY" and is equal to the check part "YYY". Then, the first terminal device can determine that the first intermediate password "2XXX01YYY" is valid. Further, the first terminal device can determine that a valid first intermediate password "2XXX01YYY" exists among the two first intermediate passwords corresponding to the first password.

[0061] S105: If it is determined that there is a legal first intermediate password among the N1 first intermediate passwords, then the first password is determined to be legal.

[0062] In a feasible implementation manner, if the first terminal device determines that there is a valid first intermediate password among the N1 first intermediate passwords, the first terminal device may determine that the first password is valid.

[0063] In an optional embodiment, if the first terminal device determines that a legal first intermediate password exists among the N1 first intermediate passwords, then the first terminal device can determine that the first password is legal. The first terminal device can then determine the characteristic bits of the legal first intermediate password based on the first preset number of bits and the preset password format. The first terminal device can then determine the password type of the legal first intermediate password based on the characteristic bits of the legal first intermediate password. Furthermore, the first terminal device can store the password portion of the legal first intermediate password in a password set corresponding to the password type of the legal first intermediate password in a preset password library based on the password type of the legal first intermediate password.

[0064] It should be noted that the preset password library may include at least one password set, and each password set in the preset password library corresponds to a password type.

[0065] Optionally, each correct password included in each password set in the preset password library may have a corresponding number. For example, the correct passwords included in the password set corresponding to the one-time password type in the preset password library may be numbered from 0 to 19, and the correct passwords included in the password set corresponding to the cyclic password type in the preset password library may be numbered from 20 to 39.

[0066] Exemplarily, it is assumed here that there is a legal first intermediate password "2XXX01YYY" among the N1 first intermediate passwords, and the password part of "2XXX01YYY" is "2XXX01". Assume that the password type corresponding to the characteristic bit "2" is a time-limited password, and assume that the first preset number of digits is 9. The first terminal device can determine that the characteristic bit of "2XXX01YYY" is "2" based on the first preset number of digits and the preset password format. Then, the first terminal device can determine that the password type of "2XXX01YYY" is a time-limited password based on the characteristic bit "2". Further, the first terminal device can store the password part "2XXX01" of "2XXX01YYY" in the password set corresponding to the time-limited password in the preset password library.

[0067] S106: If it is determined that there is no valid first intermediate password among the N1 first intermediate passwords, output a verification failure reminder message.

[0068] In some feasible implementations, if the first terminal device determines that there is no valid first intermediate password among the N1 first intermediate passwords, the first terminal device may output verification failure reminder information.

[0069] In the above implementation, after the first terminal device determines that there is no correct password matching the first password in the preset password library, the first terminal device can determine whether the number of password digits of the first password is less than the first preset number of digits. If the first terminal device determines that the number of password digits of the first password is greater than or equal to the first preset number of digits, the first password can be decomposed into N1 first intermediate passwords, and based on the password part and the verification part of each first intermediate password in the N1 first intermediate passwords, it can be determined whether there is a legal first intermediate password among the N1 first intermediate passwords. Furthermore, if the first terminal device determines that there is a legal first intermediate password among the N1 first intermediate passwords, it can be determined that the first password is legal. If the first terminal device determines that there is no legal first intermediate password among the N1 first intermediate passwords, it can output a verification failure reminder message. Through the above-mentioned password legitimacy verification method, the first terminal device can divide the first intermediate password into a password part and a verification part to complete the verification of the legitimacy of the first intermediate password, thereby improving the security of the password legitimacy verification.

[0070] For some possible implementations, see Figure 2 , Figure 2 This is another flow chart of a password validity verification method provided by the embodiment of the present application. Figure 2 As shown, the method may specifically include the steps of:

[0071] S107, determining whether the number of digits of the first password is less than a second preset number of digits.

[0072] In some feasible implementations, the first terminal device may determine whether the number of digits of the first password is less than a second preset number of digits. It should be noted that the second preset number of digits is greater than the first preset number of digits.

[0073] S108: If it is determined that the number of digits of the first password is less than the second preset number of digits, a verification failure reminder message is output.

[0074] In some feasible implementations, if the first terminal device determines that the number of digits of the first password is less than the second preset number of digits, the first terminal device may determine to output a verification failure reminder message.

[0075] S109, if it is determined that the number of password digits of the first password is greater than or equal to the second preset number of digits, the first password is decomposed into N2 second intermediate passwords according to the second preset number of digits, and it is determined whether there is a legal second intermediate password in the N2 second intermediate passwords based on the password part and the check part of each second intermediate password in the N2 second intermediate passwords.

[0076] In some feasible implementations, if the first terminal device determines that the number of digits of the first password is greater than or equal to a second preset number of digits, the first terminal device may decompose the first password into N2 second intermediate passwords based on the second preset number of digits, and determine whether there is a valid second intermediate password among the N2 second intermediate passwords based on the password portion and the check portion of each of the N2 second intermediate passwords. It should be noted that the number of digits of each second intermediate password is equal to the second preset number of digits. N2 digits is a positive integer greater than or equal to 1.

[0077] In an optional embodiment, if the first terminal device determines that the number of password digits of the first password is greater than or equal to a second preset number of digits, the first terminal device may decompose the first password into N2 second intermediate passwords based on the second preset number of digits. Furthermore, the first terminal device may perform a second verification operation on each of the N2 second intermediate passwords to determine whether there is a valid second intermediate password among the N2 second intermediate passwords.

[0078] The second verification operation described above is exemplified below using any second intermediate password among the N2 second intermediate passwords as an example. Specifically, the first terminal device can determine the password portion and verification portion of any second intermediate password based on a second preset number of bits and a preset format. Then, the first terminal device can calculate the calculation verification portion of any second intermediate password based on the password portion of any second intermediate password. Further, the first terminal device can determine whether the calculation verification portion of any second intermediate password is equal to the verification portion of any second intermediate password. Then, if the first terminal device determines that the calculation verification portion of any second intermediate password is equal to the verification portion of any second intermediate password, the first terminal device can determine that any second intermediate password is legal. If the first terminal device determines that the calculation verification portion of any second intermediate password is not equal to the verification portion of any second intermediate password, the first terminal device can determine that any second intermediate password is illegal.

[0079] It should be noted here that the preset password format includes at least two password digits and password composition structures corresponding to each password digit, and the at least two password digits include a second preset digit.

[0080] S110: If it is determined that there is a legal second intermediate password among the N2 second intermediate passwords, then the first password is determined to be legal.

[0081] In some feasible implementations, if the first terminal device determines that there is a legal second intermediate password among the N2 second intermediate passwords, the first terminal device may determine that the first password is legal.

[0082] In an optional embodiment, if the first terminal device determines that a legal second intermediate password exists among the N2 second intermediate passwords, then the first terminal device can determine that the first password is legal. The first terminal device can then determine the characteristic bits of the legal second intermediate password based on the second preset number of bits and the preset password format. The first terminal device can then determine the password type of the legal second intermediate password based on the characteristic bits of the legal second intermediate password. Further, the first terminal device can determine the portion of the legal second intermediate password to be stored based on the characteristic bits of the legal second intermediate password and the password portion of the legal second intermediate password. The first terminal device can then store the portion of the legal second intermediate password to be stored in a password set corresponding to the password type of the legal second intermediate password in a preset password library based on the password type of the legal second intermediate password. It should be noted that the password portion of the legal second intermediate password includes the characteristic bits and the password portion to be stored, and each password set in the preset password library corresponds to a password type.

[0083] For example, it is assumed that a legitimate second intermediate password "5147147YYY" exists among the N2 second intermediate passwords, and the password portion of "5147147YYY" is "5147147." Assume that the password type corresponding to the characteristic bit "5" is a custom password, and assume that the second preset number of digits is 10. The first terminal device can determine, based on the first preset number of digits and the preset password format, that the characteristic bit of "5147147YYY" is "5." Then, the first terminal device can determine, based on the characteristic bit "5," that the password type of "5147147YYY" is a custom password. Further, the first terminal device can determine, based on the characteristic bit "5" of "5147147YYY" and the password portion "5147147," that the portion to be stored of "5147147YYY" is "147147." The first terminal device can then store the portion to be stored "147147" in the password set corresponding to the custom password in the preset password library.

[0084] In an optional embodiment, after the portion of the second intermediate password to be stored is stored in a preset password library, the first terminal device may directly receive an instruction from the user to input the portion of the second intermediate password to be stored into the terminal device as the first password. Furthermore, the first terminal device performs a password validity verification using the portion of the second intermediate password to be stored as the first password.

[0085] S111 : If it is determined that there is no valid second intermediate password among the N2 second intermediate passwords, output a verification failure prompt message.

[0086] In some feasible implementations, if the first terminal device determines that there is no valid second intermediate password among the N2 second intermediate passwords, the first terminal device may output verification failure reminder information.

[0087] It should be noted that the password validity verification method provided in the embodiment of the present application can be applied to different scenarios where it is necessary to verify whether the password is valid. The following example illustrates the password validity verification using the scenario of unlocking a smart lock as an example.

[0088] In a specific implementation, the application on the second terminal device can first be paired with the smart lock to obtain the password seed. In the embodiment of the present application, the second terminal device can be any electronic device that can be paired with the smart lock, such as a smartphone, tablet computer, portable laptop computer, desktop computer, self-service terminal, etc. The embodiment of the present application does not specifically limit the implementation form of the second terminal device.

[0089] Optionally, the application on the terminal device can complete the pairing with the smart lock by scanning the QR code. After the terminal device is successfully paired with the smart lock, the terminal device can receive an instruction from the user to enter the management password on the application. Then, the terminal device can send the management password to the smart lock. After the smart lock receives the management password sent by the terminal device, the smart lock can obtain the serial number SN (Serial Number) of the smart lock and the random number written when the smart lock leaves the factory. Furthermore, the smart lock can generate a password seed based on the serial number SN (Serial Number), the management password and the random number written when leaving the factory.

[0090] Optionally, the application on the terminal device can be paired with the smart lock through communication methods such as Bluetooth or WiFi. After the terminal device and the smart lock are successfully paired, the terminal device can receive an instruction from the user to enter the management password on the application. Then, the terminal device can send the management password to the smart lock. After the smart lock receives the management password sent by the terminal device, the smart lock can obtain the serial number SN (Serial Number) of the smart lock and the random number generated during pairing. Furthermore, the smart lock can generate a password seed based on the serial number SN (Serial Number), the management password and the random number generated during pairing.

[0091] Furthermore, the terminal device can use an application on the terminal device to perform a hash operation based on the password seed, combined with the current time information and the password information set by the user, to obtain a hash information digest. The hash information digest is then modulo the unlocking digits and added to the password characteristic information to obtain the first password. The terminal device can then push and display the first password to the user through the terminal device application for the user to use. Furthermore, the smart lock can obtain the first password entered by the user.

[0092] Furthermore, the smart lock first determines whether the first password entered by the user is a correct password stored in a preset password library. If the smart lock determines that a target correct password matching the first password exists in the preset password library, the smart lock can determine that the first password is valid. Furthermore, the smart lock can successfully unlock. If the smart lock determines that a target correct password matching the first password does not exist in the preset password library, the smart lock can determine whether the password length of the first password is less than 9 digits. Furthermore, if the smart lock determines that the password length of the first password is less than 9 digits, the smart lock can output a verification failure reminder message through text display or voice broadcast. If the smart lock determines that the password length of the first password is equal to or greater than 9 digits, the smart lock can decompose the first password into N1 9-digit first intermediate passwords and determine whether there is a valid first intermediate password among the N1 first intermediate passwords based on the password portion and the verification portion of each of the N1 9-digit first intermediate passwords. Further, if the smart lock determines that there is a valid first intermediate password among the N1 first intermediate passwords, the smart lock can determine that the first password is valid. The smart lock can then successfully unlock and store the password portion of the valid first intermediate password in the password set corresponding to the password type based on the characteristic bit. Furthermore, if the smart lock determines that there is no valid first intermediate password among the N1 first intermediate passwords, the smart lock can determine whether the password length of the first password is less than 10 digits. Furthermore, if the smart lock determines that the password length of the first password is less than 10 digits, the smart lock can output a verification failure reminder message through text display or voice broadcast. If the smart lock determines that the password length of the first password is greater than or equal to 10 digits, the smart lock can split the first password into N2 10-digit second intermediate passwords and determine whether there is a valid second intermediate password among the N2 second intermediate passwords based on the password portion and verification portion of each second intermediate password in these N2 10-digit second intermediate passwords. Furthermore, if the smart lock determines that there is a valid second intermediate password among the N2 second intermediate passwords, the smart lock can determine that the first password is valid. Then, the smart lock can successfully unlock and determine the password portion of the valid second intermediate password, excluding the characteristic bit, as the portion to be stored, and store the portion to be stored in the password set corresponding to the password type based on the characteristic bit. If the smart lock determines that there is no valid second intermediate password among the N2 second intermediate passwords, the smart lock can output a verification failure reminder message through text display or voice broadcast.

[0093] See Figure 3 , Figure 3 This is a schematic diagram of a password validity verification device provided by an embodiment of the present application. Figure 3 As shown, the password legitimacy verification device may include: an acquisition unit 31, a processing unit 32 and an output unit 33.

[0094] In a specific implementation, the acquisition unit 31 is configured to acquire a first password entered by a user. The processing unit 32 is configured to, if it is determined that a target correct password matching the first password does not exist in a preset password library, determine whether the number of digits of the first password is less than a first preset number of digits. The preset password library includes one or more password sets, each of which stores at least one correct password, and the target correct password is equal to consecutive digits or all digits of the password portion of the first password. The output unit 33 is configured to, if it is determined that the number of digits of the first password is less than the first preset number of digits, output a verification failure reminder message, wherein the verification failure reminder message indicates that the first password is invalid. The processing unit 32 is configured to, if it is determined that the number of digits of the first password is equal to or greater than the first preset number of digits, decompose the first password into N1 first intermediate passwords based on the first preset number of digits, and determine whether any of the N1 first intermediate passwords is a valid first intermediate password based on the password portion and the verification portion of each of the N1 first intermediate passwords, wherein N1 is a positive integer greater than or equal to 1, and the number of digits of each first intermediate password is equal to the first preset number of digits. The processing unit 32 is configured to determine that the first password is valid if a valid first intermediate password is found among the N1 first intermediate passwords. The output unit 33 is configured to output a verification failure reminder message if a valid first intermediate password is found among the N1 first intermediate passwords.

[0095] In an alternative embodiment, see Figure 4 , Figure 4 This is another structural diagram of a password legitimacy verification device provided by an embodiment of the present application. Figure 4As shown, the password legitimacy verification device may further include a determination unit 34. The processing unit 32 is configured to perform the following first verification operation on any of the N1 first intermediate passwords. The determination unit 34 is configured to determine the password portion and the verification portion of any of the first intermediate passwords based on a first preset number of bits and a preset password format, wherein the preset password format includes at least two password bit lengths and password component structures corresponding to each password bit length, and the at least two password bit lengths include the first preset number of bits. The processing unit 32 is configured to calculate the calculated verification portion of any of the first intermediate passwords based on the password portion of any of the first intermediate passwords. The processing unit 32 is configured to determine whether the calculated verification portion of any of the first intermediate passwords is equal to the verification portion of any of the first intermediate passwords. If the calculated verification portion of any of the first intermediate passwords is determined to be equal to the verification portion of any of the first intermediate passwords, the processing unit 32 is configured to determine that any of the first intermediate passwords is legal. If the calculated verification portion of any of the first intermediate passwords is determined to be unequal to the verification portion of any of the first intermediate passwords, the processing unit 32 is configured to determine that any of the first intermediate passwords is illegal. The processing unit 32 is configured to determine whether there is a legal first intermediate password among the N1 first intermediate passwords according to a result of performing a first verification operation on each of the N1 first intermediate passwords.

[0096] In an optional embodiment, the processing unit 32 is configured to determine whether the number of digits in the first password is less than a second preset number of digits, where the second preset number of digits is greater than the first preset number of digits. The output unit 33 is configured to output a verification failure reminder message if it is determined that the number of digits in the first password is less than the second preset number of digits. The processing unit 32 is configured to decompose the first password into N2 second intermediate passwords based on the second preset number of digits if it is determined that the number of digits in the first password is greater than or equal to the second preset number of digits, and determine whether there is a valid second intermediate password among the N2 second intermediate passwords based on the password portion and the verification portion of each of the N2 second intermediate passwords, where the number of digits in each second intermediate password is equal to the second preset number of digits, and N2 is a positive integer greater than or equal to 1. The processing unit 32 is configured to determine that the first password is valid if it is determined that there is a valid second intermediate password among the N2 second intermediate passwords. The output unit 33 is configured to output a verification failure reminder message if it is determined that there is no valid second intermediate password among the N2 second intermediate passwords.

[0097] In an optional embodiment, the processing unit 32 is configured to perform the following second verification operation on any second intermediate password among the N2 second intermediate passwords. The determining unit 34 is configured to determine the password portion and verification portion of any second intermediate password based on a second preset number of bits and a preset password format, wherein the preset password format includes at least two password bit lengths and password component structures corresponding to each password bit length, and the at least two password bit lengths include the second preset number of bits. The processing unit 32 is configured to calculate the calculated verification portion of any second intermediate password based on the password portion of any second intermediate password. The processing unit 32 is configured to determine whether the calculated verification portion of any second intermediate password and the verification portion of any second intermediate password are equal. The processing unit 32 is configured to determine that any second intermediate password is legal if the calculated verification portion of any second intermediate password and the verification portion of any second intermediate password are equal. The processing unit 32 is configured to determine that any second intermediate password is illegal if the calculated verification portion of any second intermediate password and the verification portion of any second intermediate password are not equal. The processing unit 32 is configured to determine whether there is a legal second intermediate password among the N2 second intermediate passwords according to a result of performing a second verification operation on each of the N2 second intermediate passwords.

[0098] In an alternative embodiment, see Figure 5 , Figure 5 This is another structural diagram of a password legitimacy verification device provided by an embodiment of the present application. Figure 5 As shown, the password legitimacy verification device may further include a storage unit 35. A determination unit 34 is configured to determine the characteristic bits of the legal first intermediate password based on the first preset number of bits and the preset password format. The determination unit 34 is configured to determine the password type of the legal first intermediate password based on the characteristic bits of the legal first intermediate password. The storage unit 35 is configured to store the password portion of the legal first intermediate password into a password set corresponding to the password type of the legal first intermediate password in a preset password library based on the password type of the legal first intermediate password, wherein the preset password library includes at least one password set, and each password set in the preset password library corresponds to a password type.

[0099] In an optional embodiment, the determination unit 34 is configured to determine the characteristic bits of the legal second intermediate password based on the second preset number of bits and the preset password format. The determination unit 34 is configured to determine the password type of the legal second intermediate password based on the characteristic bits of the legal second intermediate password. The processing unit 32 is configured to determine the portion of the legal second intermediate password to be stored based on the characteristic bits of the legal second intermediate password and the password portion of the legal second intermediate password, wherein the password portion of the legal second intermediate password includes the characteristic bits and the portion to be stored. The storage unit 35 is configured to store the portion of the legal second intermediate password to be stored in a password set corresponding to the password type of the legal second intermediate password in a preset password library based on the password type of the legal second intermediate password, wherein each password set in the preset password library corresponds to a password type.

[0100] In an optional embodiment, the determination unit 34 is configured to determine whether a preset password library is empty. The processing unit 32 is configured to, if it is determined that the preset password library is not empty, decompose the first password into N3 third intermediate passwords according to a third preset number of bits, wherein the number of password bits of the N3 third intermediate passwords is equal to the third preset number of bits, and N3 is a positive integer greater than or equal to 1. The processing unit 32 is configured to perform the following password comparison operation on any third intermediate password among the N3 third intermediate passwords. The determination unit 34 is configured to determine the characteristic bits of any third intermediate password according to the preset password format. The determination unit 34 is configured to determine the password type of any third intermediate password according to the characteristic bits of any third intermediate password. The determination unit 34 is configured to determine the password set corresponding to the password type of any third intermediate password in the preset password library according to the password type of any third intermediate password. The processing unit 32 is configured to determine whether there is a correct password equal to any third intermediate password in the password set corresponding to the password type of any third intermediate password. The processing unit 32 is configured to determine whether there is a correct password matching the first password in a preset password library according to a result of performing a password comparison operation on each of the N3 third intermediate passwords.

[0101] See Figure 6 , Figure 6 Schematic diagram of the structure of an electronic device provided in an embodiment of the present application. This electronic device may be the first terminal device in the above-mentioned embodiment and may be used to implement the steps of the password legitimacy verification method performed by the first terminal device described in the above-mentioned embodiment. The electronic device may include: a processor 61, a memory 62, and a bus system 63.

[0102] The memory 62 includes, but is not limited to, RAM, ROM, EPROM, or CD-ROM, and is used to store relevant instructions and data. The memory 62 stores the following elements, executable modules, or data structures, or subsets thereof, or extended sets thereof:

[0103] Operation instructions: include various operation instructions, used to implement various operations.

[0104] Operating system: includes various system programs used to implement various basic services and process hardware-based tasks.

[0105] Figure 6 Only one memory is shown in the figure. Of course, the memory can also be set to multiple as needed.

[0106] like Figure 6 As shown, the electronic device may further include an input / output device 64, which may be a communication module or a transceiver circuit. In the embodiment of the present application, the input / output device 64 is used to execute the process of transmitting and receiving data such as the first password or signaling involved in the embodiment.

[0107] The processor 61 may be a controller, a CPU, a general-purpose processor, a DSP, an ASIC, an FPGA, or other programmable logic device, a transistor logic device, a hardware component, or any combination thereof. It may implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the embodiments disclosed herein. The processor 61 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.

[0108] In a specific application, the various components of the electronic device are coupled together through the bus system 63, wherein the bus system 63 includes not only a data bus but also a power bus, a control bus, and a status signal bus. However, for the sake of clarity, Figure 6 In FIG. 6 , various buses are labeled as bus system 63. Figure 6 The drawing is only schematic.

[0109] It should be noted that in practical applications, the processor in the embodiment of the present application can be an integrated circuit chip with signal processing capabilities. In the implementation process, the steps of the above method embodiments can be completed by hardware integrated logic circuits in the processor or instructions in the form of software. The above processor can be a general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The disclosed methods, steps and logic block diagrams in the embodiments of the present application can be implemented or executed.

[0110] It is understood that the memory in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct RAM bus random access memory (DR RAM). It should be noted that the memory described in the embodiments of the present application is intended to include, but is not limited to, these and any other suitable types of memory.

[0111] An embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a computer, the method or steps performed by the first terminal device in the above embodiment are implemented.

[0112] An embodiment of the present application further provides a computer program product, which, when executed by a computer, implements the method or steps performed by the first terminal device in the above embodiment.

[0113] It should be noted that for the sake of simplicity, the embodiments of any of the above-mentioned password validity verification methods are described as a series of action combinations. However, those skilled in the art should be aware that this application is not limited to the order of the actions described, because according to this application, some of its steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions involved are not necessarily required by this application.

[0114] Although the present application is described herein in conjunction with various embodiments, in the process of implementing the present application to be protected, those skilled in the art may understand and implement other variations of the disclosed embodiments by reviewing the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude multiple components or steps. The fact that certain measures are recorded in different dependent claims does not mean that these measures cannot be combined to produce good results.

[0115] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above-mentioned method for verifying the legitimacy of a password may be completed by instructing relevant hardware through a program, and the program may be stored in a computer-readable memory, which may include a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc.

[0116] The above is a detailed introduction to the embodiments of the present application. Specific examples are used herein to illustrate the principles and implementation methods of a password legitimacy verification method, device, and electronic device of the present application. The description of the above embodiments is used to help understand the method and core idea of ​​the present application. At the same time, for those skilled in the art, based on the idea of ​​a password legitimacy verification method, device, and electronic device of the present application, there may be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

[0117] Those skilled in the art will appreciate that, in one or more of the examples above, the functions described herein may be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, these functions may be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any medium that facilitates the transmission of a computer program from one location to another. The storage medium may be any available medium that can be accessed by a general-purpose or special-purpose computer.

[0118] The specific implementation methods described above further illustrate the purpose, technical solutions and beneficial effects of this application. It should be understood that the above description is only the specific implementation methods of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent replacements, improvements, etc. made on the basis of the technical solutions of this application should be included in the scope of protection of this application.

Claims

1. A password validity verification method, characterized in that: The method comprises: Get the first password entered by the user; If it is determined that a target correct password matching the first password does not exist in a preset password library, determining whether the number of password digits of the first password is less than a first preset number of digits, wherein the preset password library includes one or more password sets, each of the one or more password sets is used to store at least one correct password, and the target correct password is equal to some or all of the consecutive password digits of the first password; If it is determined that the number of digits of the first password is less than the first preset number of digits, outputting a verification failure reminder message, wherein the verification failure reminder message is used to indicate that the first password is illegal; If it is determined that the number of password digits of the first password is equal to or greater than the first preset number of digits, decomposing the first password into N1 first intermediate passwords according to the first preset number of digits, and determining whether there is a valid first intermediate password among the N1 first intermediate passwords based on the password part and the check part of each of the N1 first intermediate passwords, where N1 is a positive integer greater than or equal to 1, and the number of password digits of each of the first intermediate passwords is equal to the first preset number of digits; If it is determined that a legal first intermediate password exists among the N1 first intermediate passwords, then the first password is determined to be legal; If it is determined that there is no legal first intermediate password among the N1 first intermediate passwords, the verification failure prompt information is output.

2. The method according to claim 1, characterized in that The determining whether there is a valid first intermediate password among the N1 first intermediate passwords according to the password part and the check part of each first intermediate password among the N1 first intermediate passwords includes: Perform the following first verification operation on any first intermediate cipher among the N1 first intermediate ciphers: determining a password portion and a verification portion of any one of the first intermediate passwords based on the first preset number of digits and a preset password format, wherein the preset password format includes at least two password digits and password component structures corresponding to the respective password digits, and the at least two password digits include the first preset number of digits; Obtaining a calculation verification part of any first intermediate password by calculation based on the password part of any first intermediate password; determining whether a calculated check portion of any of the first intermediate passwords is equal to a check portion of any of the first intermediate passwords; If it is determined that the calculated verification part of any of the first intermediate passwords is equal to the verification part of any of the first intermediate passwords, then it is determined that any of the first intermediate passwords is legal; If it is determined that the calculated verification part of any of the first intermediate passwords is not equal to the verification part of any of the first intermediate passwords, then it is determined that any of the first intermediate passwords is illegal; It is determined whether there is a legal first intermediate password among the N1 first intermediate passwords according to a result of performing the first verification operation on each of the N1 first intermediate passwords.

3. The method according to claim 1 or 2, characterized in that The method further comprises: Determining whether the number of digits of the first password is less than a second preset number of digits, wherein the second preset number of digits is greater than the first preset number of digits; If it is determined that the number of digits of the first password is less than the second preset number of digits, outputting the verification failure reminder message; If it is determined that the number of password digits of the first password is greater than or equal to the second preset number of digits, decomposing the first password into N2 second intermediate passwords according to the second preset number of digits, and determining whether there is a valid second intermediate password among the N2 second intermediate passwords based on the password part and the check part of each of the N2 second intermediate passwords, wherein the number of password digits of each second intermediate password is equal to the second preset number of digits, and N2 is a positive integer greater than or equal to 1; If it is determined that a legal second intermediate password exists among the N2 second intermediate passwords, then the first password is determined to be legal; If it is determined that there is no legal second intermediate password among the N2 second intermediate passwords, the verification failure prompt information is output.

4. The method according to claim 3, characterized in that The determining whether there is a legal second intermediate password among the N2 second intermediate passwords according to the password part and the check part of each second intermediate password includes: Perform the following second verification operation on any second intermediate cipher among the N2 second intermediate ciphers: determining a password portion and a verification portion of any second intermediate password according to the second preset number of digits and a preset password format, wherein the preset password format includes at least two password digits and password component structures corresponding to the respective password digits, and the at least two password digits include the second preset number of digits; Obtaining a calculation verification portion of any second intermediate password by calculation based on the password portion of any second intermediate password; determining whether a calculated check portion of any second intermediate password is equal to a check portion of any second intermediate password; If it is determined that the calculated verification part of any second intermediate password is equal to the verification part of any second intermediate password, then it is determined that any second intermediate password is legal; If it is determined that the calculated verification part of any second intermediate password is not equal to the verification part of any second intermediate password, then the any second intermediate password is determined to be illegal; It is determined whether there is a legal second intermediate password among the N2 second intermediate passwords according to a result of performing the second verification operation on each of the N2 second intermediate passwords.

5. The method according to claim 1 or 2, characterized in that After determining that a legal first intermediate password exists among the N1 first intermediate passwords, and determining that the first password is legal, the method further includes: Determining the characteristic bits of the legal first intermediate password according to the first preset number of bits and the preset password format; determining a password type of the legal first intermediate password according to a characteristic bit of the legal first intermediate password; According to the password type of the legal first intermediate password, the password part of the legal first intermediate password is stored in the password set corresponding to the password type of the legal first intermediate password in the preset password library, wherein the preset password library includes at least one password set, and each password set in the preset password library corresponds to a password type.

6. The method according to claim 4, characterized in that After determining that a legal second intermediate password exists among the N2 second intermediate passwords, and determining that the first password is legal, the method further includes: Determining the characteristic digits of the legal second intermediate password according to the second preset number of digits and the preset password format; determining the password type of the legal second intermediate password according to the characteristic bits of the legal second intermediate password; determining the portion of the legal second intermediate password to be stored according to the characteristic bit of the legal second intermediate password and the password portion of the legal second intermediate password, wherein the password portion of the legal second intermediate password includes the characteristic bit and the portion to be stored; According to the password type of the legal second intermediate password, the part to be stored of the legal second intermediate password is stored in the password set corresponding to the password type of the legal second intermediate password in the preset password library, wherein each password set in the preset password library corresponds to a password type.

7. The method according to claim 1, characterized in that Before determining that a correct password matching the first password does not exist in the preset password library, the method further includes: Determine whether the preset password library is empty; If it is determined that the preset password library is not empty, decomposing the first password into N3 third intermediate passwords according to a third preset number of digits, wherein the number of password digits of the N3 third intermediate passwords is equal to the third preset number of digits, and N3 is a positive integer greater than or equal to 1; The following password comparison operation is performed on any third intermediate password among the N3 third intermediate passwords: determining a characteristic bit of any third intermediate password according to a preset password format; determining a password type of any third intermediate password according to a characteristic bit of any third intermediate password; Determining, according to the password type of any third intermediate password, a password set corresponding to the password type of any third intermediate password in the preset password library; determining whether there is a correct password equal to any of the third intermediate passwords in a password set corresponding to the password type of any of the third intermediate passwords; Determine whether there is a correct password matching the first password in the preset password library according to the result of performing the password comparison operation on each third password in the N3 third intermediate passwords.

8. A password validity verification device, characterized in that: The device comprises: an acquiring unit, configured to acquire a first password input by a user; a processing unit, configured to, if it is determined that a target correct password matching the first password does not exist in a preset password library, determine whether the number of password digits of the first password is less than a first preset number of digits, wherein the preset password library includes one or more password sets, each of the one or more password sets is used to store at least one correct password, and the target correct password is equal to some consecutive digits or all digits of the first password; an output unit, configured to output a verification failure reminder message if it is determined that the number of password digits of the first password is less than the first preset number of digits, wherein the verification failure reminder message is used to indicate that the first password is illegal; the processing unit is configured to, if it is determined that the number of password digits of the first password is equal to or greater than the first preset number of digits, decompose the first password into N1 first intermediate passwords according to the first preset number of digits, and determine whether there is a valid first intermediate password among the N1 first intermediate passwords based on the password part and the check part of each of the N1 first intermediate passwords, wherein N1 is a positive integer greater than or equal to 1, and the number of password digits of each of the first intermediate passwords is equal to the first preset number of digits; the processing unit is configured to determine that the first password is legal if it is determined that a legal first intermediate password exists among the N1 first intermediate passwords; The output unit is configured to output the verification failure prompt information if it is determined that no legal first intermediate password exists among the N1 first intermediate passwords.

9. A computer-readable storage medium, characterized in that Used to store a computer program, which implements the steps of the method according to any one of claims 1 to 7 when executed by a processor.

10. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Method and system for interacting information based on production identity code

    CN101075326A

  • Password management method and device and computer readable storage medium

    CN107392008A