Test method and equipment of intelligent door lock and storage medium

By using a variety of test cases at different test time stages of smart door locks, including verification algorithm accuracy testing, application integrity testing and random number testing, the inaccuracy problem caused by single test instructions in the prior art is solved, and the accuracy of the safety test results of smart door locks is improved.

CN119621591AInactive Publication Date: 2025-03-14DINGXUAN COMMERCIAL PASSWORD EVALUATION TECH (SHENZHEN) CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510163569.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-14
Publication Date
2025-03-14
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the existing safety testing methods for smart door locks, single test instructions lead to inaccurate test results.

Method used

By determining the current test time phase of the smart door lock, obtain corresponding test cases, including verification algorithm accuracy test, application integrity test and random number test, and conduct comprehensive testing of smart door locks based on these use cases to obtain test results.

Benefits of technology

Through the combination of multiple test cases, the accuracy of the safety test results of smart door locks is improved, and the inaccuracy problem caused by a single test instruction is solved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119621591A_ABST
    Figure CN119621591A_ABST
Patent Text Reader

Abstract

The invention discloses a test method and device for an intelligent door lock and a storage medium, and relates to the technical field of intelligent door locks, and the test method for the intelligent door lock comprises the steps that the current test time stage of the intelligent door lock is determined; a corresponding test case of the intelligent door lock in the test time stage is obtained, and the test case comprises at least one of a verification algorithm accuracy test of the intelligent door lock, an integrity test of an application program associated with the intelligent door lock and a random number test; the intelligent door lock is tested based on the test case, the test result of the intelligent door lock is obtained, and the safety of the intelligent door lock is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of smart door locks, and in particular to a testing method, device and storage medium for smart door locks. Background Art

[0002] With the widespread use of smart door locks, people's security requirements for smart door locks are getting higher and higher. Therefore, it is necessary to conduct security tests on smart door locks to ensure their security.

[0003] In the related technology, during the security test of the smart door lock, the host computer can send fixed test instructions to the smart door lock through the serial port, receive feedback results, compare the received feedback results with the standard results, and finally verify whether the smart door lock is safe based on whether the comparison results are consistent.

[0004] However, when the above test method is used to test the smart door lock, the test instructions are relatively simple, resulting in inaccurate security test results of the smart door lock.

[0005] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention

[0006] The main purpose of this application is to provide a testing method, device and storage medium for a smart door lock, aiming to solve the technical problem that a single test instruction leads to inaccurate security test results of the smart door lock.

[0007] To achieve the above purpose, the present application proposes a testing method for a smart door lock, and the testing method for a smart door lock includes: Determine the current test time stage of the smart door lock; Obtaining test cases corresponding to the smart door lock in the test time phase, wherein the test cases include: at least one of: a verification algorithm accuracy test of the smart door lock, an integrity test of an application associated with the smart door lock, and a random number test; The smart door lock is tested based on the test case to obtain the test result of the smart door lock.

[0008] In one embodiment, the step of obtaining the test case corresponding to the smart door lock in the test time phase includes: When the test time phase is the power-on test phase of the smart door lock, the accuracy test of the verification algorithm of the smart door lock, the integrity test of the application associated with the smart door lock, and the random number test are obtained as test cases; When the test time phase is the use test phase of the smart door lock, a random number test is obtained as a test case; When the test time phase is the periodic test phase of the smart door lock, the verification algorithm accuracy test of the smart door lock, the integrity test of the application associated with the smart door lock, and the random number test are obtained as test cases.

[0009] In one embodiment, when the test case is a verification algorithm accuracy test of a smart door lock, the steps of testing the smart door lock based on the test case and obtaining the test result of the smart door lock include: Generate ciphertext according to preset key, preset parameters and preset plaintext; If the ciphertext is inconsistent with the preset ciphertext, the test result is determined to be unqualified; or, If the ciphertext is consistent with the preset ciphertext, the test result is determined to be qualified.

[0010] In one embodiment, when the test case is a verification algorithm accuracy test of a smart door lock, the steps of testing the smart door lock based on the test case and obtaining the test result of the smart door lock include: Use the preset private key to perform private key calculation on the first preset data to obtain a first calculation result; if the first calculation result is inconsistent with the second preset data, determine that the test result is unqualified; if the first calculation result is consistent with the second preset data, use the first preset public key to perform public key calculation on the second preset data to obtain a second calculation result; use the preset private key to perform private key calculation on the second calculation result to obtain a third calculation result; if the third calculation result is inconsistent with the second preset data, determine that the test result is unqualified; if the third calculation result is consistent with the second preset data, determine that the test result is qualified; Alternatively, the first preset public key is used to perform public key calculation on the first preset data and the second preset data. If the verification result is incorrect, the test result is determined to be unqualified; if the verification result is correct, the preset private key is used to perform private key calculation on the first preset data to obtain a fourth operation result; the first preset public key is used to perform public key calculation on the first preset data and the fourth operation result. If the verification result is incorrect, the test result is determined to be unqualified; if the verification result is correct, the test result is determined to be qualified.

[0011] In one embodiment, when the test case is an integrity test of an application associated with a smart door lock, the steps of testing the smart door lock based on the test case and obtaining the test result of the smart door lock include: Determine the file data of the application and the signature value, hash value, message authentication code and cyclic redundancy check value corresponding to the application; Use the second preset public key to verify the file data and the signature value, and compare the hash value, the message authentication code and the cyclic redundancy check value with the corresponding preset hash value, preset message authentication code and preset cyclic redundancy check value for consistency; If any comparison result is inconsistent or the signature verification result is unqualified, the test result is determined to be unqualified; or, If all comparison results are consistent and the signature verification result is qualified, the test result is determined to be qualified.

[0012] In one embodiment, when the test case is a random number test, the steps of testing the smart door lock based on the test case and obtaining the test result of the smart door lock include: Get the random number generated by the random source of the smart door lock; Split the random number by a fixed number of bits to obtain multiple random number blocks; Based on the digital combination pattern corresponding to each random number block, determining the actual frequency of each digital combination pattern appearing in all random number blocks; According to the actual frequency and theoretical frequency of each digital combination pattern, the chi-square value is obtained; If the chi-square value is greater than or equal to the preset chi-square critical value, the test result is determined to be unqualified; or, If the chi-square value is less than the preset chi-square critical value, the test result is determined to be qualified.

[0013] In one embodiment, after the step of testing the smart door lock based on the test case and obtaining the test result of the smart door lock, the method further includes: If the test result is unqualified, a lock command is sent to the control module of the smart door lock, and an alarm command is sent to the alarm module of the smart door lock.

[0014] In one embodiment, determining the current test time stage of the smart door lock includes: When the smart door lock receives a power-on trigger signal, the test time phase is determined to be a power-on test phase of the smart door lock; When the smart door lock receives the wake-up signal, the test time phase is determined to be the use test phase of the smart door lock; When the accumulated operation time of the smart door lock is a multiple of the preset time interval, the test time phase is determined to be the periodic test phase of the smart door lock.

[0015] In addition, to achieve the above-mentioned purpose, the present application also proposes a testing device for a smart door lock, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the testing method for the smart door lock as described above.

[0016] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium. A computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the smart door lock testing method as described above are implemented.

[0017] The present application determines the current test time stage of the smart door lock; obtains the test cases corresponding to the smart door lock in the test time stage, wherein the test cases include: at least one of the accuracy test of the verification algorithm of the smart door lock, the integrity test of the application associated with the smart door lock, and the random number test; tests the smart door lock based on the test cases to obtain the test results of the smart door lock. Since multiple test cases are used in multiple test time stages of the smart door lock, the technical problem of inaccurate security test results of the smart door lock caused by a single test instruction is solved, thereby improving the security of the smart door lock. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0019] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0020] Figure 1 A flowchart of the first embodiment of the testing method of the smart door lock of the present application is provided; Figure 2 A detailed flow chart of step S10 in the first embodiment of the test method of the smart door lock of the present application; Figure 3 A detailed flow chart of step S20 in the first embodiment of the test method of the smart door lock of the present application; Figure 4 A detailed flow chart of step S30 in the first embodiment of the test method of the smart door lock of the present application; Figure 5 Another detailed flow chart of step S30 in the first embodiment of the test method of the smart door lock of the present application; Figure 6 A further detailed flow chart of step S30 in the first embodiment of the test method of the smart door lock of the present application is provided; Figure 7 Another detailed flow chart of step S30 in the first embodiment of the test method of the smart door lock of the present application; Figure 8 This is a schematic diagram of the device structure of the hardware operating environment involved in the testing method of the smart door lock in the embodiment of the present application.

[0021] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0022] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0023] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0024] With the widespread use of smart door locks, people have higher and higher requirements for the security of smart door locks. Therefore, it is necessary to perform security tests on smart door locks to ensure their security. In the related art, during the security test of smart door locks, a host computer can send fixed test instructions to the smart door lock through a serial port, receive feedback results, compare the received feedback results with the standard results, and finally verify whether the smart door lock is safe based on whether the comparison results are consistent. However, when the above test method is used to test the smart door lock, the test instructions are relatively simple, resulting in inaccurate security test results of the smart door lock.

[0025] In response to the above problems, the main solutions of the present application are: determine the current test time stage of the smart door lock; obtain the test cases corresponding to the smart door lock in the test time stage, wherein the test cases include: at least one of the accuracy test of the verification algorithm of the smart door lock, the integrity test of the application associated with the smart door lock, and the random number test; test the smart door lock based on the test case to obtain the test result of the smart door lock.

[0026] The solution of the present application solves the problem of inaccurate security test results of smart door locks due to a single test instruction, since multiple security test cases are performed on the smart door lock at multiple test time stages, thereby improving the security of the smart door lock.

[0027] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a test device for a smart door lock, etc. The following takes the test device for a smart door lock as an example to illustrate this embodiment and the following embodiments.

[0028] Based on this, the present application embodiment provides a method for testing a smart door lock. Figure 1 , Figure 1 This is a flow chart of the first embodiment of the testing method of the smart door lock of the present application.

[0029] In this embodiment, the testing method of the smart door lock includes steps S10 to S30: Step S10, determining the current test time stage of the smart door lock.

[0030] It should be noted that the test time stage refers to the current operating state of the smart door lock, for example, the standby state, wake-up state, identification and verification state, unlocking state, abnormal warning state, etc. of the smart door lock.

[0031] Further, see Figure 2 , step S10 includes steps S11 to S13: Step S11, when the smart door lock receives a power-on trigger signal, it determines the test time phase as the power-on test phase of the smart door lock.

[0032] Step S12, when the smart door lock receives the wake-up signal, it determines the test time period as the usage test period of the smart door lock.

[0033] Step S13, when the accumulated operation time of the smart door lock is a multiple of the preset time interval, the test time phase is determined to be the periodic test phase of the smart door lock.

[0034] In a feasible implementation manner, the current test time stage of the smart door lock is determined based on a trigger signal received by the smart door lock, wherein the trigger signal comes from outside or inside the smart door lock.

[0035] In this embodiment, when the trigger signal comes from outside the smart door lock, the trigger signal can be a power-on trigger signal, that is, a signal that drives the device to work when the smart door lock is connected to the power supply. At this time, the test time stage of the smart door lock is the power-on test stage, and the trigger signal can also be a wake-up signal. The wake-up signal can be triggered by a button or a sensor. At this time, the test time stage of the smart door lock is the usage test stage; when the trigger signal comes from inside the smart door lock, the trigger signal can be triggered by a timer inside the smart door lock. When the cumulative operating time of the smart door lock calculated by the timer is a multiple of the preset time interval, the smart door lock enters the periodic test stage to clarify the different test time stages of the smart door lock, and then adopt different test cases to achieve full coverage of the security test of the smart door lock and improve the security of the smart door lock.

[0036] Step S20, obtaining the test cases corresponding to the smart door lock in the test time stage, wherein the test cases include: at least one of the accuracy test of the verification algorithm of the smart door lock, the integrity test of the application associated with the smart door lock, and the random number test.

[0037] It should be noted that the verification algorithm accuracy test is a key measure to evaluate whether the algorithm can accurately detect data errors and deviations and ensure data integrity. In smart door locks, it can verify whether the password, password or fingerprint generation algorithm in the smart door lock is correct, so as to avoid the risk of using the wrong password, password or fingerprint to open the smart door lock; the application integrity test is to ensure that the application and its related components have not been tampered with or damaged, and that the functions are intact. In smart door locks, it can verify whether the code file of the application burned in the smart door lock is correct and complete, and whether the functions implemented by the smart door lock based on the application are complete, for example, whether the multiple unlocking methods supported by the smart door lock are normal; the random number test can be used to detect whether the dynamic password of the smart door lock is truly random, so as to ensure the strength of the dynamic password and reduce the risk of brute force cracking the dynamic password to open the door.

[0038] In addition, since the integrity test of the application will use the built-in algorithm of the smart door lock, the verification algorithm accuracy test should be performed before the integrity test of the application.

[0039] Further, see Figure 3 , step S20 includes steps S21 to S23: Step S21, when the test time phase is the power-on test phase of the smart door lock, obtain the accuracy test of the verification algorithm of the smart door lock, the integrity test of the application associated with the smart door lock, and the random number test as test cases.

[0040] In this embodiment, when the test time stage is the power-on test stage of the smart door lock, the index of the verification algorithm accuracy test, the application integrity test and the random number test corresponding to the power-on test stage is obtained from the built-in configuration file, and the verification algorithm accuracy test, the application integrity test and the random number test are found in the test case library according to the index as the test cases corresponding to the power-on test stage to implement a preliminary test of the smart door lock and verify that all functions of the smart door lock are normal before use.

[0041] Step S22, when the test time phase is the usage test phase of the smart door lock, obtain a random number test as a test case.

[0042] In this embodiment, when the test time stage is the usage test stage of the smart door lock, the index of the random number test corresponding to the usage test stage is obtained from the built-in configuration file, and the random number test is found in the test case library according to the index as the test case corresponding to the usage test stage to verify that the password strength of the smart door lock in use is qualified. Since only the randomness of the random number is verified during the usage test stage, the test waiting time of the usage test stage is reduced, the user experience is improved, and the safety of the smart door lock in use is ensured.

[0043] Step S23, when the test time phase is the periodic test phase of the smart door lock, obtain the accuracy test of the verification algorithm of the smart door lock, the integrity test of the application associated with the smart door lock, and the random number test as test cases.

[0044] In this embodiment, when the test time stage is the periodic test stage of the smart door lock, the indexes corresponding to the verification algorithm accuracy test, the application integrity test and the random number test in the periodic test stage are obtained from the built-in configuration file, and the test cases corresponding to the verification algorithm accuracy test, the application integrity test and the random number test are respectively found in the test case library according to the index, thereby realizing the phased detection of the security of the smart door lock, making it convenient to know the security of the smart door lock in a timely manner.

[0045] Step S30, testing the smart door lock based on the test case to obtain the test result of the smart door lock.

[0046] It should be noted that the test result is qualified or unqualified. Pass means that the smart door lock operates normally as of the moment the current test is completed; unqualified means that the smart door lock fails the security test, and the smart door lock can be warned of the failure of the security test by locking the door lock or alarming, so as to inform the user in time when the security of the smart door lock fails, thereby improving the user's sense of security when using the smart door lock.

[0047] Further, see Figure 4 When the test case is a test of the accuracy of the verification algorithm of the smart door lock, step S30 includes steps S31 to S33: Step S31, generating ciphertext according to the preset key, preset parameters and preset plaintext.

[0048] It should be noted that the preset key refers to a pre-set and stored encryption key or decryption key. It is a specific sequence of numbers and characters that has been determined before the encryption algorithm is executed, and is intended to ensure the security and consistency of the data encryption and decryption process; preset parameters are various parameters that are pre-set before the algorithm, program, and system are run, and can be used in conjunction with the preset key to enhance the security of encryption; preset plaintext refers to the original information text to be encrypted that has been prepared in advance, that is, the original data that has not been encrypted, which can be used to test and verify the integrity and accuracy of the encryption system.

[0049] In this embodiment, the preset key is converted into a preset key in binary format, the initialization vector in the preset parameter is converted into an initialization vector in binary format with the same length as the preset key in binary format, and the preset plaintext is encoded into a byte array in UTF-8 (8-bit Unicode Transformation Format, a variable-length character encoding for Unicode) format; based on the Advanced Encryption Standard (AES) algorithm, an encryption module in Python (a programming language), such as a cryptography library, is used to receive the preset key in binary format, the initialization vector in binary format, and the preset plaintext in UTF-8 format to generate a ciphertext. The ciphertext is usually presented as a byte sequence in the form of garbled code. During subsequent transmission and storage, this ciphertext data needs to be properly processed to prevent leakage, so as to verify the correctness of the built-in algorithm of the smart door lock.

[0050] Step S32: If the ciphertext is inconsistent with the preset ciphertext, the test result is determined to be unqualified.

[0051] Step S33, or, if the ciphertext is consistent with the preset ciphertext, the test result is determined to be qualified.

[0052] In a feasible implementation, the ciphertext is restored to plaintext by using a preset key in binary format and an initialization vector in binary format to encrypt the ciphertext, and the plaintext is compared with the preset plaintext to determine whether the test result is qualified.

[0053] In this embodiment, based on the advanced encryption standard algorithm, the encryption module in Python is used to receive preset keys, preset parameters and ciphertext, decrypt the ciphertext to obtain plaintext, and compare the plaintext with the preset plaintext for consistency. If they are consistent, the test result is determined to be qualified, the symmetric encryption algorithm based on the advanced encryption standard is qualified, and the algorithm security of the smart door lock is verified; if they are inconsistent, the test result is determined to be unqualified, the symmetric encryption algorithm based on the advanced encryption standard is unqualified, the algorithm of the smart door lock is unsafe, and the door lock may be opened with an incorrect password, thereby reducing the security of the smart door lock, thereby obtaining the result of the security of the smart door lock algorithm.

[0054] Further, see Figure 5 When the test case is a test of the accuracy of the verification algorithm of the smart door lock, step S30 includes steps S301 to S310: Step S301: Use a preset private key to perform private key calculation on first preset data to obtain a first calculation result.

[0055] Step S302: If the first operation result is inconsistent with the second preset data, the test result is determined to be unqualified.

[0056] Step S303: If the first operation result is consistent with the second preset data, the first preset public key is used to perform public key calculation on the second preset data to obtain a second operation result.

[0057] Step S304: Use the preset private key to perform private key calculation on the second operation result to obtain a third operation result.

[0058] Step S305: If the third operation result is inconsistent with the second preset data, the test result is determined to be unqualified.

[0059] Step S306: If the third operation result is consistent with the second preset data, the test result is determined to be qualified.

[0060] It should be noted that the preset public key and preset private key are pre-set and stored public keys and private keys in the asymmetric encryption system. The preset public key builds a bridge for external secure interaction, while the preset private key is the key line of defense for protecting internal information. The two work together to realize core functions such as confidentiality and authentication in asymmetric encryption.

[0061] In addition, the first preset data refers to the encrypted original data, and the second preset data refers to the original data.

[0062] In this embodiment, first, the availability of the preset private key is ensured, and the preset private key is loaded from the storage location. Then, the first preset data and the second preset data are clarified, the former is the data to be calculated for the private key, and the latter is the expected result for comparison. Then, the preset private key is used to calculate the private key on the first preset data to obtain a first operation result. Finally, the first operation result is compared with the second preset data, and if the two are inconsistent, the test result is determined to be unqualified.

[0063] If they are consistent, the first preset public key is obtained from a safe place, and based on the encryption module in Python, the first preset public key is used in combination with the optimal asymmetric encryption padding method (OAEP, Optimal Asymmetric Encryption Padding) to perform public key calculation on the second preset data to obtain a second operation result, and then the preset private key is used in combination with the same optimal asymmetric encryption padding method to perform private key operation on the second operation result to obtain a third operation result, and the third operation result is compared byte by byte with the second preset data. If the two are exactly the same, it means that the public and private key encryption and decryption process is accurate and the test result is qualified; otherwise, if there is any difference, it means that there is a problem in the encryption and decryption process, and the test result is judged to be unqualified, so as to verify the correctness of the encryption and decryption algorithm and improve the security of the smart door lock.

[0064] Step S307, alternatively, the first preset public key is used to perform public key calculation on the first preset data and the second preset data, and if the verification result is wrong, the test result is determined to be unqualified.

[0065] Step S308: If the verification result is correct, use the preset private key to perform private key calculation on the first preset data to obtain a fourth calculation result.

[0066] Step S309: Use the first preset public key to perform public key calculation on the first preset data and the fourth operation result. If the verification result is wrong, determine that the test result is unqualified.

[0067] Step S310: If the verification result is correct, determine that the test result is qualified.

[0068] In this embodiment, first, the first preset public key is obtained from a safe place, and then the first preset data and the second preset data are determined, wherein the second preset data is obtained by signing the first preset data with the corresponding private key, and finally, the first preset public key is used to perform public key calculation on the first preset data and the second preset data, that is, the signature verification operation is performed. If an InvalidSignature exception (an exception thrown when signature verification fails) is thrown during the verification process, it means that the verification result is wrong and the test result is judged to be unqualified.

[0069] If no exception is thrown during the verification process, indicating that the verification result is correct, then based on the encryption module in Python, the preset private key is used in combination with the probabilistic signature scheme (PSS, Probabilistic Signature Scheme) to sign the first preset data to obtain the fourth operation result, and then the verify method of the first preset public key (the key function of the public key object in programming for verifying the digital signature) is used to verify the consistency of the fourth operation result and the first preset data. If the verification passes, it means that the public and private keys match, the operation is correct, and the test result is qualified; otherwise, it means that the test result is unqualified. In the code, if the verify method is executed normally, the test result is qualified, and if an exception is thrown, the test result is unqualified. To verify the correctness and reliability of the public and private keys in the asymmetric encryption system, ensure that the encryption, decryption, signature, and verification processes can accurately restore the data or verify the authenticity of the signature, thereby verifying the security of the smart door lock.

[0070] Further, see Figure 6 When the test case is an integrity test of an application associated with a smart door lock, step S30 includes steps A01 to A04: Step A01, determine the file data of the application and the signature value, hash value, message authentication code and cyclic redundancy check value corresponding to the application.

[0071] Step A02, using the second preset public key to verify the file data and the signature value, and comparing the hash value, the message authentication code and the cyclic redundancy check value with the corresponding preset hash value, preset message authentication code and preset cyclic redundancy check value for consistency.

[0072] Step A03: If any comparison result is inconsistent or the signature verification result is unqualified, the test result is determined to be unqualified.

[0073] Step A04, or, if all comparison results are consistent and the signature verification result is qualified, then the test result is determined to be qualified.

[0074] It should be noted that the file data of the application refers to a collection of various digital information constituting the application, which includes all instructions and related resources required for the application to run. The second preset public key may be the same as the first preset public key, or may be different.

[0075] In this embodiment, the file data of the application is found according to the installation path of the application, and Python is used to determine the signature value, hash value, message authentication code and cyclic redundancy check value corresponding to the application. First, the file data of the second preset public key is read from the storage according to a specific format and parsed into a usable public key object using the corresponding cryptographic library function. Then, the file data is preprocessed to ensure the purity of the data. Then, the signature verification function corresponding to the second preset public key in the cryptographic library is used to take the preprocessed file data and the signature value as input parameters, so that the signature verification function is used to verify the signature value and the file data according to the public key algorithm rules. Then, the SHA-256 (Secure Hash Algorithm 256-bit) hash function is used to operate the application data to obtain a hash value of a fixed length. Then, based on the preset key and the application data, the message authentication code is calculated with the help of the hash-based message authentication code (HMAC, Hash-basedMessage Authentication Code) algorithm and the SHA-256 hash function. Finally, the application data is passed to the crc32 (CyclicRedundancy Check 32-bit) function of the zlib library (an open source software library that provides data compression and decompression functions) to obtain a cyclic redundancy check value for fast error detection. Compare the just-calculated hash value, message authentication code, and cyclic redundancy check value with the corresponding preset hash value, preset message authentication code, and preset cyclic redundancy check value one by one. As long as any of them is not equal or the signature verification result is unqualified, the test result is determined to be unqualified; when all the comparison items are completely consistent and the signature verification result is qualified, it indicates that the file data of the application has not been tampered with during the transmission or storage process and is indeed signed by the corresponding private key holder, then the test result is determined to be qualified. By verifying the signature value and comparing the hash value, message authentication code, and cyclic redundancy check value, it is intended to verify the data integrity and source authenticity of the application, improve the data security of the application, and improve the security of the smart door lock.

[0076] Further, see Figure 7 , when the test case is a random number test, step S30 includes steps B01 to B06: Step B01, obtain the random number generated by the random source of the smart door lock.

[0077] Step B02, dividing the random number according to a fixed number of bits to obtain multiple random number blocks.

[0078] Step B03, based on the digital combination pattern corresponding to each random number block, determining the actual frequency of occurrence of each digital combination pattern in all random number blocks.

[0079] Step B04, obtaining the chi-square value according to the actual frequency and theoretical frequency of each digital combination pattern.

[0080] Step B05: If the chi-square value is greater than or equal to the preset chi-square critical value, the test result is determined to be unqualified.

[0081] Step B06, or, if the chi-square value is less than the preset chi-square critical value, the test result is determined to be qualified.

[0082] It should be noted that the random source refers to a mechanism, device, algorithm or data source that can generate random numbers or random sequences. In a smart door lock, the random source is used to generate a door opening password composed of random numbers. When the randomness of the random number generated by the random source is qualified, the password strength of the smart door lock's door opening password is qualified, thereby reducing the risk of the smart door lock being cracked by brute force and improving the security of the smart door lock.

[0083] In this embodiment, Python programming language is used to implement the random number test of the smart door lock. First, the random number generation interface is used to interactively generate a random number, such as 1010110011100101, and then a fixed number of bits is set. For example, if the fixed number of bits is 4, the random number is divided into four random number blocks: 1010, 1100, 1110, and 0101. Since the fixed number of bits is 4, the total number of digital combination pattern data in the random number block is 2 4 There are 16 types, that is, 16 types. Among all the random number blocks, the actual frequency of 1010 is once, the actual frequency of 1100 is once, the actual frequency of 1100 is once, the actual frequency of 0101 is once, and the actual frequency of the remaining digital combination patterns is zero. Under the assumption of complete randomness, the theoretical frequency of each 4-digit combination is the total number of data groups multiplied by its theoretical probability of occurrence. Therefore, the theoretical frequency of each combination is 4×(1 / 16). Then, the chi-square calculation formula shown in formula (1) is used to calculate the chi-square value of the random number.

[0084]

[0085] Among them, i is the actual frequency of the ith combination, E i is the theoretical frequency of the ith combination, and n is the total number of data groups.

[0086] Compare the chi-square value with the preset chi-square critical value. If the chi-square value is greater than or equal to the preset chi-square critical value, it indicates that the random number is significantly different from the random distribution, the randomness of the random number is questionable, and the test result is unqualified; if the calculated chi-square value is less than the preset chi-square critical value, there is insufficient evidence to reject the assumption that the random number is random. It can be considered that the data sequence has good randomness and the test result is qualified, thereby providing a randomness quantification method for the random numbers generated by the smart door lock, thereby testing the security of the smart door lock.

[0087] This embodiment is implemented based on the first embodiment. In the second embodiment of the present application, after step S30 of the testing method of the smart door lock, step C01 is further included: Step C01, if the test result is unqualified, a lock command is sent to the control module of the smart door lock, and an alarm instruction is sent to the alarm module of the smart door lock.

[0088] It should be noted that the control module, as the core control unit of the smart door lock, receives and processes various functional instructions, and directs the mechanical and electronic components of the door lock to work together. The alarm module ensures the safety warning of the smart door lock and integrates sound and light alarm components, such as buzzers and LED flashes.

[0089] In this embodiment, when the test result is unqualified, the self-test module of the smart door lock can send a locking command to the control module, and at the same time, send an alarm instruction to the alarm module. After receiving the locking command, the control module will cut off the power supply of the door lock motor and other unlocking related components, or start the mechanical locking mechanism to prevent the lock cylinder from being rotated to prevent illegal unlocking. The alarm module receives the alarm instruction, starts the high-decibel buzzer to attract the attention of the surrounding personnel, and flashes the strong light LED light to give a visual warning to inform the people inside and outside the house that the door lock may encounter a security threat. At the same time, the self-test module of the smart door lock can send an alarm message to the terminal device located in the same local area network as the smart door lock, such as a mobile phone or some home appliances, and the mobile phone or home appliance reminds the user that the smart door lock has risks to further improve safety. When the test result is qualified, the test process ends normally, and the smart door lock maintains the current normal standby or working state, waiting for the next test trigger or user operation.

[0090] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the testing method of the smart door lock of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0091] The present application provides a testing device for a smart door lock, and the testing device for the smart door lock includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the testing method for the smart door lock in the above-mentioned embodiment one.

[0092] Reference below Figure 8, which shows a schematic diagram of the structure of the test equipment of the smart door lock suitable for implementing the embodiment of the present application. The test equipment of the smart door lock in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, personal digital assistants (PDA, Personal Digital Assistant), tablet computers (PAD, Portable Application Description), portable multimedia players (PMP, Portable Media Player), vehicle terminals (such as vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 8 The testing equipment for the smart door lock shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0093] like Figure 8 As shown, the test equipment of the smart door lock may include a processing device 1001 (such as a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1002 or the program loaded from the storage device 1003 to the random access memory (RAM) 1004. In the random access memory 1004, various programs and data required for the operation of the test equipment of the smart door lock are also stored. The processing device 1001, the read-only memory 1002 and the random access memory 1004 are connected to each other through a bus 1005. The input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1003 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 1009. The communication device 1009 can allow the test device of the smart door lock to communicate wirelessly or wired with other devices to exchange data. Although the figure shows a test device of a smart door lock with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or provided alternatively.

[0094] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a read-only memory 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0095] The testing device for the smart door lock provided by the present application adopts the testing method for the smart door lock in the above embodiment, which can solve the technical problem that the security test result of the smart door lock is inaccurate due to the single test instruction. Compared with the prior art, the beneficial effects of the testing device for the smart door lock provided by the present application are the same as the beneficial effects of the testing method for the smart door lock provided by the above embodiment, and the other technical features in the testing device for the smart door lock are the same as the features disclosed in the method of the previous embodiment, which will not be described in detail here.

[0096] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0097] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0098] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the testing method of the smart door lock in the above-mentioned embodiment.

[0099] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory (EPROM, Erasable Programmable ReadOnly Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM, CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, radio frequencies (RF, Radio Frequency), etc., or any suitable combination of the above.

[0100] The above-mentioned computer-readable storage medium may be included in the testing device of the smart door lock; or it may exist independently without being assembled into the testing device of the smart door lock.

[0101] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the testing device of the smart door lock, the testing device of the smart door lock: determines the current test time stage of the smart door lock; obtains the test cases corresponding to the smart door lock in the test time stage, wherein the test cases include: at least one of the accuracy test of the verification algorithm of the smart door lock, the integrity test of the application associated with the smart door lock, and the random number test; tests the smart door lock based on the test cases to obtain the test results of the smart door lock.

[0102] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0103] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0104] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0105] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned test method for the smart door lock, and can solve the technical problem that the security test results of the smart door lock are inaccurate due to the single test instruction. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the test method for the smart door lock provided by the above-mentioned embodiment, and will not be elaborated here.

[0106] The above are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect application in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A method for testing a smart door lock, characterized in that: The testing method of the smart door lock includes: Determine the current test time stage of the smart door lock; Obtaining a test case corresponding to the smart door lock in the test time phase, wherein the test case includes: at least one of a verification algorithm accuracy test of the smart door lock, an integrity test of an application associated with the smart door lock, and a random number test; The smart door lock is tested based on the test case to obtain a test result of the smart door lock.

2. The method for testing a smart door lock according to claim 1, characterized in that: The step of obtaining the test case corresponding to the smart door lock in the test time phase includes: When the test time phase is the power-on test phase of the smart door lock, obtaining the accuracy test of the verification algorithm of the smart door lock, the integrity test of the application associated with the smart door lock and the random number test as the test cases; When the test time phase is the use test phase of the smart door lock, obtaining a random number test as the test case; When the test time phase is the periodic test phase of the smart door lock, the verification algorithm accuracy test of the smart door lock, the integrity test of the application associated with the smart door lock and the random number test are obtained as the test cases.

3. The method for testing a smart door lock according to claim 1, characterized in that: When the test case is a test of the accuracy of the verification algorithm of the smart door lock, the step of testing the smart door lock based on the test case to obtain the test result of the smart door lock includes: Generate ciphertext according to preset key, preset parameters and preset plaintext; If the ciphertext is inconsistent with the preset ciphertext, the test result is determined to be unqualified; or, If the ciphertext is consistent with the preset ciphertext, the test result is determined to be qualified.

4. The method for testing a smart door lock according to claim 1, characterized in that: When the test case is a test of the accuracy of the verification algorithm of the smart door lock, the step of testing the smart door lock based on the test case to obtain the test result of the smart door lock includes: Performing private key calculation on the first preset data using a preset private key to obtain a first calculation result; if the first calculation result is inconsistent with the second preset data, determining that the test result is unqualified; if the first calculation result is consistent with the second preset data, performing public key calculation on the second preset data using the first preset public key to obtain a second calculation result; performing private key calculation on the second calculation result using the preset private key to obtain a third calculation result; if the third calculation result is inconsistent with the second preset data, determining that the test result is unqualified; if the third calculation result is consistent with the second preset data, determining that the test result is qualified; Alternatively, the first preset public key is used to perform public key calculation on the first preset data and the second preset data. If the verification result is incorrect, the test result is determined to be unqualified; if the verification result is correct, the preset private key is used to perform private key calculation on the first preset data to obtain a fourth operation result; the first preset public key is used to perform public key calculation on the first preset data and the fourth operation result. If the verification result is incorrect, the test result is determined to be unqualified; if the verification result is correct, the test result is determined to be qualified.

5. The method for testing a smart door lock according to claim 1, characterized in that: When the test case is an integrity test of an application associated with the smart door lock, the step of testing the smart door lock based on the test case to obtain a test result of the smart door lock includes: Determine file data of the application and a signature value, a hash value, a message authentication code, and a cyclic redundancy check value corresponding to the application; Use the second preset public key to verify the file data and the signature value, and compare the hash value, the message authentication code and the cyclic redundancy check value with the corresponding preset hash value, preset message authentication code and preset cyclic redundancy check value for consistency; If any comparison result is inconsistent or the signature verification result is unqualified, the test result is determined to be unqualified; or, If all comparison results are consistent and the signature verification result is qualified, the test result is determined to be qualified.

6. The method for testing a smart door lock according to claim 1, characterized in that: When the test case is a random number test, the step of testing the smart door lock based on the test case to obtain the test result of the smart door lock includes: Get the random number generated by the random source of the smart door lock; Splitting the random number according to a fixed number of bits to obtain a plurality of random number blocks; Based on the digital combination pattern corresponding to each random number block, determining the actual frequency of occurrence of each digital combination pattern in all random number blocks; Obtaining a chi-square value according to the actual frequency and theoretical frequency of each of the digital combination patterns; If the chi-square value is greater than or equal to a preset chi-square critical value, the test result is determined to be unqualified; or, If the chi-square value is less than the preset chi-square critical value, the test result is determined to be qualified.

7. The method for testing a smart door lock according to any one of claims 3 to 6, characterized in that: After the step of testing the smart door lock based on the test case to obtain the test result of the smart door lock, the method further includes: If the test result is unqualified, a lock command is sent to the control module of the smart door lock, and an alarm instruction is sent to the alarm module of the smart door lock.

8. The method for testing a smart door lock according to claim 1, characterized in that: Determining the current test time stage of the smart door lock includes: When the smart door lock receives a power-on trigger signal, determining the test time phase as a power-on test phase of the smart door lock; When the smart door lock receives a wake-up signal, determining the test time period as a use test period of the smart door lock; When the accumulated operation time of the smart door lock is a multiple of the preset time interval, the test time phase is determined to be a periodic test phase of the smart door lock.

9. A test device for a smart door lock, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the testing method for the smart door lock as described in any one of claims 1 to 8.

10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the smart door lock testing method as described in any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Intelligent lock testing device and testing method thereof

    CN110262468A

  • Test configuration method and device, computer equipment and storage medium

    CN116126603A

  • Demand testing method and device, storage medium and computer equipment

    CN117743176A

  • Python language password API misuse automatic detection method, system and equipment and medium

    CN119357958A