Data encryption method and device, electronic equipment and storage medium

By adopting public-private key encryption method and priority synchronization mechanism in smart door locks, the problems of low synchronization efficiency and insufficient security when updating password data of smart door locks are solved, and efficient and secure password data synchronization is achieved.

CN119672836AActive Publication Date: 2025-03-21DONGGUAN XINXINGXIN INTELLIGENT TECH CO
View PDF 10 Cites 0 Cited by

Patent Information

Application Number
CN202411751138.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-24
Publication Date
2025-03-21
Estimated Expiration
2044-05-24

AI Technical Summary

Technical Problem

When the password data is updated, the synchronization efficiency and insufficient security of the smart door lock is easily intercepted and cracked, resulting in user asset security risks.

Method used

Through the public-private key encryption method between the first password lock and the second password lock in the smart door lock, the synchronization time is determined based on the priority and attributes of the password data, and the secure synchronization of the password data is achieved through the encryption module, the communication module and the decryption module.

Benefits of technology

It improves the efficiency and security of password data synchronization, ensures the early synchronization of password data with high priority, improves the user's unlocking experience, and enhances the security and reliability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119672836A_ABST
    Figure CN119672836A_ABST
Patent Text Reader

Abstract

The invention relates to a data encryption method and device, electronic equipment and a storage medium. The method comprises the following steps: after password data of a first password lock in the intelligent door lock is updated, determining priorities of updated password data and synchronization time corresponding to different priorities according to an attribute of a second password lock, a type of the updated password data and / or a user attribute of the updated password data; at the synchronization time corresponding to the priority, the first password lock encrypts the updated password data of the corresponding priority by using a first private key of the first password lock and a first public key of the second password lock to obtain a first target password file; synchronizing the first target password file to a second password lock through the first password lock, and obtaining a second public key of the first password lock and a second private key of the second password lock through the second password lock; and the second coded lock decrypts the first target password file according to the second public key and the second private key to obtain the updated password data of the corresponding priority in the first coded lock.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the invention patent application with application date of May 24, 2024, application number 202410651790.3, and invention name “Data synchronization method, device, electronic device and storage medium”. Technical Field

[0002] The present application relates to the technical field of smart door locks, and in particular to a data encryption method, device, electronic device and storage medium. Background Art

[0003] At present, the Internet of Things technology is becoming more and more mature, and smart door locks have gradually replaced traditional door locks. Compared with traditional door locks, smart door locks have a higher safety factor. With the popularization of smart door locks, door locks have various forms, and smart door locks with front and rear lock split designs have appeared.

[0004] When the password data needs to be updated, on the one hand, the front lock or the rear lock may update multiple types of password data and / or password data of multiple users at the same time, and the data memory is relatively large and cannot be transmitted simultaneously; on the other hand, the updated password data between the traditional front and rear locks is transmitted through a wired connection or a wireless connection, but the security is not high and it is easy to be intercepted and cracked by the data, thereby being illegally remotely controlled, causing asset security risks to users.

[0005] Therefore, how to improve the security of synchronization of front and back lock password data while improving synchronization efficiency is an urgent problem to be solved. Summary of the invention

[0006] Based on this, it is necessary to provide a data encryption method, device, electronic device and storage medium to address the above technical problems.

[0007] In a first aspect, the present application provides a data encryption method, the method comprising:

[0008] After the password data of the first password lock in the smart door lock is updated, the priority of the updated password data and the synchronization time corresponding to different priorities are determined according to the attributes of the second password lock, the type of the updated password data and / or the user attributes of the updated password data;

[0009] At the synchronization time corresponding to the priority, the first password lock uses the first private key of the first password lock and the first public key of the second password lock to encrypt the updated password data of the corresponding priority to obtain a first target password file;

[0010] Synchronize the first target password file to the second password lock through the first password lock, and obtain the second public key of the first password lock and the second private key of the second password lock through the second password lock;

[0011] The second password lock decrypts the first target password file according to the second public key and the second private key to obtain the updated password data of the corresponding priority in the first password lock;

[0012] The first password lock uses the first private key of the first password lock and the first public key of the second password lock to encrypt the updated password data of the corresponding priority to obtain a first target password file, including:

[0013] Determining an encryption method for the updated password data according to the type of the updated password data;

[0014] For the updated password data of different types and corresponding priorities of the same user, the updated password data of the latter type is encrypted using the target data extracted from the updated password data of the previous type and the encryption method corresponding to the latter type, until the updated password data of each type is completely encrypted, thereby obtaining a second target password file;

[0015] Determine a first key according to the first private key and the first public key;

[0016] Determine, according to the first agreement, that the value of the preset number of bits in the first key is the preset number of bytes;

[0017] The header data of the preset number of bytes in the second target password file is encrypted to obtain the first target password file; wherein the header data includes the data type and type order, encoding method, file memory and / or file location of the second target password file.

[0018] In one of the embodiments, the attributes of the second password lock include functional attributes and operation difficulty attributes; the types of the updated password data include digital type, image type, fingerprint type, voice type, face type and / or near field communication technology NFC type; the user attributes of the updated password data include user authority attributes and user routine attributes; wherein the user authority attributes include indicating the user's operating authority on the smart door lock; the user routine attributes include historical habit data indicating the user's operations on the smart door lock.

[0019] In one embodiment, the method further comprises:

[0020] Detecting a replacement operation on the first password lock and / or in response to receiving a synchronization instruction for the second password lock and the password data stored in the cloud, determining, according to the priorities corresponding to the stored password data, a first synchronization order for synchronizing the stored password data from the second password lock to the first password lock and a second synchronization order for synchronizing the stored password data from the cloud to the first password lock; wherein the priorities corresponding to the stored password data are determined according to the attributes of the first password lock, the type of the stored password data and / or the user attributes of the stored password data;

[0021] The stored password data is synchronized from the second password lock and the cloud according to the first synchronization sequence and the second synchronization sequence respectively.

[0022] In one embodiment, after detecting the replacement operation of the first combination lock, the method further includes:

[0023] If the updated first combination lock adds a second unlocking function and the stored password data does not include the password data corresponding to the second unlocking function, the updated first combination lock outputs a prompt message within a preset range; wherein the prompt message is used to remind the user to update the password data corresponding to the second unlocking function; the preset range includes a preset time and / or a preset number of times;

[0024] If the prompt time and / or prompt times exceed the preset range, stop outputting the prompt information.

[0025] In one embodiment, before the password data of the first password lock in the smart door lock is updated, the method further includes:

[0026] Obtaining identification data of the user; wherein the identification data includes height data, age data, identity data, feature data and / or security question data;

[0027] Determining whether the user is a user with special needs according to the identification data; wherein the user with special needs indicates a user with needs in a specific field; the specific field includes the hearing field, the vision field and / or the movement field;

[0028] If the user is the user with special needs, a display area in the first password lock is determined according to the height data; the display area is used to display a password input interface; the password input interface is used to receive the updated password data input by the user;

[0029] In the password input interface, recommendation information is output according to the specific field; wherein the recommendation information is used to indicate a type of the updated password data recommended to be input by the user.

[0030] In one embodiment, before the password data of the first password lock in the smart door lock is updated, the method further includes:

[0031] Obtaining identification data of a user; wherein the identification data includes identity data;

[0032] According to the identification data, it is determined whether the user has the operation authority.

[0033] In one embodiment, determining whether the user has operation authority according to the identification data includes:

[0034] The first password lock in the smart door lock randomly generates first verification information according to the identification data; wherein the first verification information includes a verification method and a first master verification code; the first master verification code is used to indicate that the user is a fixed authorized user;

[0035] Sending the first verification information to a user terminal; wherein the first verification information is used by the user terminal to randomly generate second verification information;

[0036] Receiving the second verification information sent by the user terminal; wherein the second verification information includes the verification method and a second primary verification code;

[0037] When the third verification code input by the user matches the second primary verification code, it is determined that the user has the operation authority; the operation authority includes adding password data, deleting password data, clearing password data, adding temporary authorized users and / or deleting temporary authorized users.

[0038] In a second aspect, the present application further provides a data encryption device, the device comprising:

[0039] A determination module, which is used to determine the priority of the updated password data and the synchronization time corresponding to different priorities according to the attributes of the second password lock, the type of the updated password data and / or the user attributes of the updated password data after the password data of the first password lock in the smart door lock is updated;

[0040] An encryption module, configured to, at the synchronization time corresponding to the priority, encrypt the updated password data of the corresponding priority by the first password lock using the first private key of the first password lock and the first public key of the second password lock to obtain a first target password file;

[0041] A communication module, used for synchronizing the first target password file to the second password lock through the first password lock, and obtaining the second public key of the first password lock and the second private key of the second password lock through the second password lock;

[0042] a decryption module, used for the second password lock to decrypt the first target password file according to the second public key and the second private key, and obtain the updated password data of the corresponding priority in the first password lock;

[0043] The encryption module is specifically used to perform the following steps:

[0044] Determining an encryption method for the updated password data according to the type of the updated password data;

[0045] For the updated password data of different types and corresponding priorities of the same user, the updated password data of the latter type is encrypted using the target data extracted from the updated password data of the previous type and the encryption method corresponding to the latter type, until the updated password data of each type is completely encrypted, thereby obtaining a second target password file;

[0046] Determine a first key according to the first private key and the first public key;

[0047] Determine, according to the first agreement, that the value of the preset number of bits in the first key is the preset number of bytes;

[0048] The header data of the preset number of bytes in the second target password file is encrypted to obtain the first target password file; wherein the header data includes the data type and type order, encoding method, file memory and / or file location of the second target password file.

[0049] In a third aspect, the present application further provides an electronic device, wherein the electronic device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the data encryption method described in any embodiment of the present application is implemented.

[0050] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the data encryption method described in any embodiment of the present application is implemented.

[0051] In the above-mentioned data encryption method, device, electronic device and storage medium, the first password lock can comprehensively determine the priority of the updated password data and the corresponding synchronization time according to the influencing factors of multiple dimensions, and the priority of the updated password data can be more comprehensively and accurately determined dynamically each time the password data is updated from the perspective of multiple dimensions. The first password lock synchronizes the first target password file to the second password lock according to the priority and the corresponding synchronization time, which can ensure that the updated password data with a higher priority, that is, a higher degree of importance, is synchronized to the second password lock, and improve the synchronization efficiency of the updated password data with a higher degree of importance; thereby allowing the user to unlock the password as soon as possible, thereby improving the user's unlocking experience. In addition, the first password lock encrypts the updated password data by means of public and private keys, and the second password lock decrypts the first target password file by means of public and private keys, and the encryption and decryption processing efficiency is high, which improves the security and reliability of the synchronization of the password data between the first password lock and the second password lock, and achieves a better synchronization effect of the updated password data. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1 is a process environment diagram of a data synchronization method according to an exemplary embodiment;

[0053] Figure 2 is a flowchart of a data synchronization method according to an exemplary embodiment;

[0054] Figure 3 is a schematic diagram of the architecture of a smart door lock system according to an exemplary embodiment;

[0055] Figure 4 is a flowchart of a data synchronization method according to an exemplary embodiment;

[0056] Figure 5 is a flowchart of a data synchronization method according to an exemplary embodiment;

[0057] Figure 6 is a structural block diagram of a data synchronization device according to an exemplary embodiment;

[0058] Figure 7 It is a diagram showing the internal structure of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0059] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0060] In the description of the present invention, "several" means one or more, "multiple" means more than two, greater than, less than, and exceeding are understood as not including the number itself, and "above", "below", and "within" are understood as including the number itself. If there is a description of "first", "second", etc., it is only used for the purpose of distinguishing technical features, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.

[0061] The methods described in the embodiments of the present application are applied to smart door locks and / or systems, platforms and / or applications located in smart door locks; the applications may be, but are not limited to, various software programs, quick applications and / or applets.

[0062] In the embodiment of the present application, at least one is used to indicate one or more; and multiple is used to indicate two or more.

[0063] In some embodiments, Figure 1 As shown; Figure 1 A data synchronization method is provided, comprising the following steps:

[0064] S101, after the password data of the first password lock in the smart door lock is updated, the priority of the updated password data and the synchronization time corresponding to different priorities are determined according to the attributes of the second password lock, the type of the updated password data and / or the user attributes of the updated password data;

[0065] S102, at the synchronization time corresponding to the priority, the first password lock uses the first private key of the first password lock and the first public key of the second password lock to encrypt the updated password data of the corresponding priority to obtain a first target password file;

[0066] S103, synchronizing the first target password file to the second password lock through the first password lock, and obtaining a second public key of the first password lock and a second private key of the second password lock through the second password lock;

[0067] S104: The second password lock decrypts the first target password file according to the second public key and the second private key to obtain the updated password data of the corresponding priority in the first password lock.

[0068] In the embodiments of the present application, the smart door lock can be used in scenarios such as villas, hospitals, offices and / or laboratories.

[0069] In an embodiment of the present application, the smart door lock includes a first password lock, a second password lock and a lock body; wherein the first password lock and the second password lock are respectively located on both sides of the door, and the first password lock and the second password lock are both used to control the locking or unlocking of the lock body.

[0070] In some embodiments, if the user updates the password data in the front lock of the smart door lock, the first password lock is the front lock and the second password lock is the rear lock; or, if the user updates the password data in the rear lock of the smart door lock, the first password lock is the rear lock and the second password lock is the front lock.

[0071] In some embodiments, the attributes of the second password lock include functional attributes and operation difficulty attributes; the type of the updated password data includes digital type, image type, fingerprint type, voice type, face type and / or near field communication technology NFC type; the user attributes of the updated password data include user authority attributes and user routine attributes; wherein, the user authority attributes include indicating the user's operating authority on the smart door lock; the user routine attributes include historical habit data indicating the user's operations on the smart door lock.

[0072] Exemplarily, the functional attributes of the second password lock include fingerprint unlocking and digital unlocking, and the operational difficulty attribute includes the operational difficulty of a user unlocking the second password lock from the front of the second password lock and the operational difficulty of a user unlocking the second password lock from the back of the second password lock; wherein the back of the second password lock is the front of the first password lock. The first password lock can determine that the operational difficulty of unlocking the second password lock through fingerprint unlocking is less than the operational difficulty of unlocking the second password lock through digital unlocking.

[0073] Exemplarily, the historical habit data may include, but is not limited to, at least one of the user's common unlocking time data, unlocking preference data, unlocking location data, and unlocking frequency data.

[0074] In this way, the embodiment of the present application can comprehensively consider the influencing factors of different dimensions on the priority of updated password data, and then dynamically adjust the priority of the updated password data each time the password data is updated; synchronize the updated password data with higher priority first, ensure the synchronization efficiency of the updated password data with higher importance, and thus improve the user's unlocking experience.

[0075] In some embodiments, before the password data of the first password lock in the smart door lock is updated, the method further includes:

[0076] The first password lock in the smart door lock obtains identification data of the user; wherein the identification data includes identity data;

[0077] According to the identification data, it is determined whether the user has the operation authority.

[0078] In some embodiments, determining whether the user has operation authority according to the identification data includes:

[0079] The first password lock in the smart door lock randomly generates first verification information according to the identification data; wherein the first verification information includes a verification method and a first master verification code; the first master verification code is used to indicate that the user is a fixed authorized user;

[0080] Sending the first verification information to a user terminal; wherein the first verification information is used by the user terminal to randomly generate second verification information;

[0081] Receiving the second verification information sent by the user terminal; wherein the second verification information includes the verification method and a second primary verification code;

[0082] When the third verification code input by the user matches the second primary verification code, it is determined that the user has the operation authority and the operation authority includes adding password data, deleting password data, clearing password data, adding temporary authorized users and / or deleting temporary authorized users.

[0083] In some embodiments, determining whether the user has operation authority according to the identification data includes:

[0084] Randomly generate first verification information according to the identification data; wherein the first verification information includes a verification method and a first secondary verification code; the first secondary verification code is used to indicate that the user is a temporary authorized user; the first secondary verification code includes an authorization validity period;

[0085] Sending the first verification information to a user terminal; wherein the first verification information is used by the user terminal to randomly generate second verification information;

[0086] Receiving the second verification information sent by the user terminal; wherein the second verification information includes the verification method and a second secondary verification code; the second secondary verification code includes the authorization validity period;

[0087] When the third verification code input by the user matches the second verification code and the input time of the third verification code is within the authorization validity period, it is determined that the user has the operation authority and the operation authority includes adding password data and / or deleting password data.

[0088] In some embodiments, the operation authority of a fixed authorized user is higher than the operation authority of a temporary authorized user.

[0089] In the embodiment of the present application, the user terminal can be any electronic device with communication function. The electronic device can be any mobile terminal or fixed terminal. The terminal can be a device that provides voice and / or data connectivity to the user. Exemplarily, the terminal can be an Internet of Things terminal, such as a sensor device, a mobile phone or a so-called "cellular" phone and a computer with an Internet of Things terminal, for example, a fixed, portable, pocket-sized, handheld, computer-built-in or vehicle-mounted device. Among them, the portable device can be a smart watch, a smart bracelet, a head-mounted device, etc.

[0090] In this way, in the embodiment of the present application, by confirming the user's operating authority, operations such as updating, deleting or unlocking password data can be performed only after confirming that the user has the operating authority. This can reduce accidental touches by abnormal users or illegal users, ensure the service life of the smart door lock, and further improve the intelligence and security of the smart door lock, saving unnecessary communication resources consumed by update or unlocking operations.

[0091] In the embodiment of the present application, the priority of the updated password data may include the first to Nth priorities; the synchronization time corresponding to the first priority is the first time, the synchronization time corresponding to the second priority is the second time, and so on, the synchronization time corresponding to the Nth priority is the Nth time; wherein N is greater than 1 and N is a positive integer. The first password lock may determine that the first priority is higher than the second priority, the second priority is higher than the third priority, and so on, the N-1th priority is higher than the Nth priority; and the first time is earlier than the second time, the second time is earlier than the third time, and so on, the N-1th time is earlier than the Nth time.

[0092] In one embodiment, the smart lock determines that the importance of the first user is higher than that of the second user, and then determines that the priority of the updated password data of the first user is the first priority and the priority of the updated password data of the second user is the second priority.

[0093] In one embodiment, the smart lock determines that the type of updated password data of the first user is more than the type of updated password data of the second user, then the priority of the updated password data of the second user can be determined as the first priority and the priority of the updated password data of the first user as the second priority.

[0094] In one embodiment, since the memory occupied by the face type password data is greater than the memory occupied by the fingerprint type password data, the smart lock can determine that the priority of the updated face type password data is the first priority, and the priority of the updated fingerprint type password data is the second priority.

[0095] In one embodiment, the priority is the third priority, the synchronization time is the third time, and the updated password data corresponding to the third priority is voice-type password data. The first password lock and the second password lock generate a public-private key pair based on the elliptic curve (Diffie-Hellman, ECDH) algorithm, respectively, and exchange their respective public keys. The first password lock uses the first private key A1 of the first password lock and the first public key B2 of the second password lock to generate a shared key C, and uses the shared key C to encrypt the voice-type password data, or encrypts the header data of the voice-type password data to obtain a first target file; the first password lock transmits the first target password file to the second password lock, and the second password lock uses the second public key A2 of the first password lock and the second private key B1 of the second password lock to generate a public key C, and uses the shared key C to decrypt the first target password file to obtain the updated voice-type password data.

[0096] In the embodiment of the present application, the first password lock can comprehensively determine the priority of the updated password data and the corresponding synchronization time according to the influencing factors of multiple dimensions. Considering multiple dimensions, the priority of the updated password data can be more comprehensively and accurately determined dynamically each time the password data is updated. The first password lock synchronizes the first target password file to the second password lock according to the priority and the corresponding synchronization time, which can ensure that the updated password data with higher priority, that is, higher importance, is synchronized to the second password lock, and improve the synchronization efficiency of the updated password data with higher importance; thereby allowing the user to unlock the password as soon as possible, improving the user's unlocking experience. In addition, the first password lock encrypts the updated password data by means of public and private keys, and the second password lock decrypts the first target password file by means of public and private keys. The encryption and decryption processing efficiency is high, which improves the security and reliability of the synchronization of the password data between the first password lock and the second password lock, and achieves a better synchronization effect of the updated password data.

[0097] In some embodiments, determining the priority of the updated password data and the synchronization time corresponding to different priorities according to the attributes of the second password lock, the type of the updated password data and / or the user attributes of the updated password data includes one of the following methods:

[0098] The first method is to determine, according to the first unlocking function of the second password lock, the priority of the updated password data of the type corresponding to the first unlocking function is the first priority, and the synchronization time corresponding to the first priority is the first time; and determine the priority of the updated password data other than the type corresponding to the first unlocking function is the second priority, and the synchronization time of the second priority is the second time; wherein the first priority is higher than the second priority; and the first time is earlier than the second time;

[0099] The second method is to determine, based on the common time data in the routine attributes of the user, that the priority of the updated password data of the user whose common time is at the current time or whose common time has the shortest time interval with the current time is the first priority, and the synchronization time corresponding to the first priority is the first time; and the priority of the updated password data of the user whose common time is the next time adjacent to the current time is the second priority, and the synchronization time of the second priority is the second time;

[0100] The third type is, if the user authority attribute of the updated password data represents that the user is a fixed authorized user, the priority of the password data corresponding to the fixed authorized user is determined to be the first priority, and the synchronization time corresponding to the first priority is the first time; or, if the user authority attribute of the updated password data represents that the user is a temporary authorized user, the priority of the password data corresponding to the temporary authorized user is determined to be the second priority, and the synchronization time of the second priority is the second time.

[0101] In the embodiment of the present application, the first unlocking function and the second unlocking function in the following embodiments may include but are not limited to at least one of fingerprint unlocking, password unlocking, pattern unlocking, voice unlocking, gesture unlocking, NFC unlocking and pupil unlocking.

[0102] Exemplarily, the first password lock is the front lock and the second password lock is the rear lock. The first unlocking function of the front lock may include fingerprint unlocking, password unlocking, voice unlocking, face unlocking and NFC unlocking, and the first unlocking function of the rear lock may include password unlocking and face unlocking. When the password data is updated in the front lock and needs to be synchronized to the rear lock, it can be determined that the updated password data corresponding to the first unlocking function of the rear lock is the first priority, that is, the updated password data of the digital type and the face type is the first priority; and the priority of the password data of the image type, fingerprint type, voice type and NFC type is the second priority. After synchronizing the updated password data of the first priority to the rear lock, the front lock can choose to continue to transmit the updated password data of the second priority immediately or in idle time, so that the front lock can also synchronize the updated password data of the second priority from the rear lock after replacement; for example, after the front lock is replaced and is not connected to the wireless network, the password data stored in the rear lock can be synchronized from the rear lock through physical transmission. Alternatively, the front lock may choose not to continue transmitting the updated password data of the second priority, saving wireless resources for data transmission while meeting the unlocking requirements of the rear lock. Selectively synchronizing the updated password data may improve transmission efficiency.

[0103] Exemplarily, when the application scenario is a villa scenario, and the first password lock is a rear lock and the second password lock is a front lock, the first unlocking function of the first password lock to be replaced can be determined according to the difficulty of the user unlocking the first password lock from the back of the first password lock using different types of password data, that is, unlocking the first password lock from the front of the second password lock. If it is convenient to unlock the first password lock from the front of the second password lock, for example, after the second password lock is removed and before it is replaced with a new one, the villa door can only be unlocked by the first password lock, when the user is in front of the villa door and the first password lock is located behind the villa door, it is necessary to operate the first password lock by extending the hand through the fence of the villa door, and it is difficult for the user to see the password input interface of the first password lock; therefore, it can be determined that the first unlocking function of the second password lock can be at least one of fingerprint unlocking, voice unlocking and NFC unlocking with lower operating difficulty. If it is to increase the difficulty of unlocking the first password lock from the front of the second password lock, it can be determined that the first unlocking function of the second password lock can be at least one of pattern unlocking, face unlocking and digital unlocking with higher unlocking difficulty.

[0104] For example, the common time data of user A is 5:30 p.m., indicating that user A often uses the unlocking function at 5:30 p.m.; the common time data of user B is 10 a.m.; and the common time data of user C is 11 p.m. In the smart door lock, when users A, B, and C all need to synchronize the updated password data from the first password lock to the second password lock, the current time can be obtained; for example, if the current time is 5 p.m., and the user with the shortest time interval between the common time and the current time is user A, then the updated password data of user A can be determined to be the first priority; if the user with the common time being the next time adjacent to the current time is user C, then the updated password data of user C can be determined to be the second priority; if the user with the common time being the second time adjacent to the current time is user B, then the updated password data of user B can be determined to be the third priority.

[0105] Exemplarily, the user authority attribute of the user corresponding to the updated first password data indicates that the first user is a temporary authorized user, and the user authority attribute of the user corresponding to the updated second password data indicates that the second user is a fixed authorized user. Then the smart lock can determine that the priority of the second password data updated by the second user is the first priority, and determine that the priority of the first password data updated by the first user is the second priority.

[0106] It should be noted that the method for determining the priority of updated password data and the synchronization time corresponding to different priorities in the embodiment of the present application is not limited to the above method, but can also be other methods or a combination of multiple methods, which is not limited here.

[0107] In the embodiment of the present application, the smart door lock can, through the first method, give priority to transmitting the updated password data corresponding to the first unlocking function of the second password lock, thereby ensuring the basic unlocking function of the second password lock; through the second method, priority can be given to frequent users who have the shortest time interval between the current time or the usual time and the current time, and the updated password data of frequent users can be transmitted preferentially to ensure the normal unlocking use of the users and improve the user experience; through the third method, the updated password data of users with higher operating permissions can be transmitted preferentially during the idle time of the smart door lock to meet the unlocking needs of more important users.

[0108] In addition, the smart door lock can also determine the priority of the updated password data through a combination of methods. For example, when the first method and the second method are combined, the password data used by the common user to unlock the second password lock can be transmitted first; while the password data used for backup storage (i.e. the password data corresponding to the unlocking function that the second password lock does not have) can be transmitted later. In this way, when ensuring the normal unlocking of the user, there is no need to transmit the password data corresponding to the user's unlocking function other than the first unlocking function, further improving the synchronization efficiency of the password data.

[0109] In some embodiments, the method further comprises:

[0110] Detecting a replacement operation on the first password lock and / or in response to receiving a synchronization instruction for the second password lock and the password data stored in the cloud, determining, according to the priorities corresponding to the stored password data, a first synchronization order for synchronizing the stored password data from the second password lock to the first password lock and a second synchronization order for synchronizing the stored password data from the cloud to the first password lock; wherein the priorities corresponding to the stored password data are determined according to the attributes of the first password lock, the type of the stored password data and / or the user attributes of the stored password data;

[0111] The stored password data is synchronized from the second password lock and the cloud according to the first synchronization sequence and the second synchronization sequence respectively.

[0112] In some embodiments, the stored password data includes password files of 1st to Nth priority; the first synchronization order is from 1st to Nth; the second synchronization order is from Nth to 1st; wherein N is a positive integer; N is greater than 1; synchronizing the stored password data from the second password lock and the cloud according to the first synchronization order and the second synchronization order respectively includes:

[0113] The first password lock synchronizes password files of 1st to NMth priority levels from the second password lock according to a synchronization order from 1st to Nth, and synchronizes password files of Nth to N-M+1th priority levels from the cloud according to a synchronization order from Nth to 1st; M is a positive integer; M is greater than 1.

[0114] In some embodiments, before the first password lock synchronizes the stored password data, the second password lock and the cloud can encrypt the stored password data. The encryption method can be the encryption method described in any embodiment of the present application, which will not be elaborated here.

[0115] In the embodiment of the present application, after replacing the new first password lock, the password data stored can be synchronized from the second password lock and the cloud through the first synchronization sequence and the second synchronization sequence respectively, without transmitting all the stored password data through a single device, which can further speed up the synchronization efficiency, ensure the normal use of the replaced first password lock, and improve the user experience.

[0116] In some embodiments, after detecting the replacement operation of the first combination lock, the method further includes:

[0117] If the updated first combination lock adds a second unlocking function and the stored password data does not include the password data corresponding to the second unlocking function, the updated first combination lock outputs a prompt message within a preset range; wherein the prompt message is used to remind the user to update the password data corresponding to the second unlocking function; the preset range includes a preset time and / or a preset number of times;

[0118] If the prompt time and / or prompt times exceed the preset range, stop outputting the prompt information.

[0119] Exemplarily, the preset time may be 1 second, 3 seconds, or 5 seconds, etc.

[0120] Exemplarily, the preset number of times may be 1 time, 2 times, 4 times, or an unlimited number of times.

[0121] In some embodiments, the first unlocking function of the first password lock in the smart door lock before the update includes password unlocking and fingerprint unlocking, and the password data stored before the update only includes password data of digital type and fingerprint type; the updated first password lock has added a second unlocking function of face unlocking and voice unlocking. In response to receiving the user's unlocking command, the first password lock outputs a prompt message to remind the user to enter the face password data and voiceprint password data, and the preset number of times is 5 times; if the first password lock prompts the customer more than or equal to 5 times, it stops outputting the prompt message.

[0122] In an embodiment of the present application, after replacing the new first password lock, a second unlocking function is added to the first password lock, and a prompt message can be output to remind the user to enter the password data corresponding to the second unlocking function in time to ensure the normal use of the second unlocking function; and when the prompt time or the number of prompts exceeds a preset range, it can be determined that the user does not need to use the second unlocking function, and the reminder to the user is stopped, thereby reducing unnecessary waste of communication resources.

[0123] In some embodiments, before the password data of the first password lock in the smart door lock is updated, the method further includes:

[0124] Obtaining identification data of the user; wherein the identification data includes height data, age data, identity data, feature data and / or security question data;

[0125] Determining whether the user is a user with special needs according to the identification data; wherein the user with special needs indicates a user with needs in a specific field; the specific field includes the hearing field, the vision field and / or the movement field;

[0126] If the user is the user with special needs, a display area in the first password lock is determined according to the height data; the display area is used to display a password input interface; the password input interface is used to receive the updated password data input by the user;

[0127] In the password input interface, recommendation information is output according to the specific field; wherein the recommendation information is used to indicate a type of the updated password data recommended to be input by the user.

[0128] In the embodiment of the present application, users with special needs may include children, the elderly and / or disabled persons. Exemplarily, disabled persons may include visually impaired persons, hearing impaired persons, speech impaired persons, movement impaired persons and / or operation impaired persons.

[0129] In the embodiment of the present application, the password input interface may include an input area; the input area may be the entire area or a part of the area of ​​the password input interface.

[0130] In some embodiments, if the smart door lock determines that the user is a child and the number of unlocking times is less than or equal to 3 times, the display area can be adjusted to the bottom of the first password lock according to the child's height to facilitate the child to enter a password or fingerprint to unlock; if the number of unlocking times is greater than 3 times, it can be determined that the child has touched it by mistake and the display area can be adjusted to the top of the first password lock to reduce the occurrence of accidental unlocking touches.

[0131] In one embodiment, if the smart door lock determines that the user is an elderly person, first recommendation information can be output to facilitate the elderly person to unlock the door; the first recommendation information is used to indicate that the user is recommended to enter updated password data of fingerprint type, face type and / or pupil pattern type.

[0132] In one embodiment, if the smart door lock determines that the user's identity information is a visually impaired person, second recommendation information can be output to facilitate the visually impaired person to unlock the door; the second recommendation information is used to indicate that the user is recommended to enter updated password data of face type and / or voice type.

[0133] In an embodiment of the present application, the smart door lock determines whether the user is a special needs user through the user's identification data. If the user is determined to be a special needs user, a display area is determined to facilitate user operation and recommended information of more convenient unlocking functions is provided to the user to meet the unlocking needs of different groups of people, thereby further improving the intelligence of the smart door lock and the user experience.

[0134] In some embodiments, Figure 2 As shown; the first password lock uses the first private key of the first password lock and the first public key of the second password lock to encrypt the updated password data of the corresponding priority to obtain a first target password file, including the following steps:

[0135] S201, determining an encryption method for the updated password data according to the type of the updated password data;

[0136] S202, for the updated password data of different types and corresponding priorities of the same user, encrypt the updated password data of the latter type by using the target data extracted from the updated password data of the previous type and the encryption method corresponding to the latter type, until the updated password data of each type is completely encrypted, thereby obtaining a second target password file;

[0137] S203, determining a first key according to the first private key and the first public key;

[0138] S204, determining, according to the first agreement, that the value of the preset number of digits in the first key is a preset number of bytes;

[0139] S205, encrypting the header data of the preset number of bytes in the second target password file to obtain the first target password file; wherein the header data includes the data type and type order, encoding method, file memory and / or file location of the second target password file.

[0140] Exemplarily, the type of the updated password data is an image type, and the updated password data may include but is not limited to at least one of the images to be encrypted among gesture images, pattern images, and slider images; the encryption method may be: using a mask generated randomly or based on target data extracted from the updated password data of the previous type, superimposing the entire image to be encrypted or a specific area of ​​the image to be encrypted to obtain an encrypted image. For example, the image to be encrypted is represented by a two-dimensional matrix array, and the mask can also be identified by a two-dimensional matrix data, and the dimension of the two-dimensional matrix array of each mask is the same as the dimension of the two-dimensional matrix array of each image to be encrypted, and the two-dimensional matrix array corresponding to the image to be encrypted and the two-dimensional matrix array corresponding to the mask are superimposed to obtain the encrypted image.

[0141] Exemplarily, the type of the updated password data is a fingerprint type, and the updated password data is a fingerprint image; the encryption method may be: dividing the fingerprint image into multiple image blocks of preset sizes and determining the identifiers corresponding to the image blocks; encrypting the multiple image blocks using a preset encryption rule according to an encryption password randomly generated or generated according to target data extracted from the updated password data of the previous type to obtain an encrypted fingerprint image; the multiple image blocks in the encrypted fingerprint image are arranged in an encryption order indicated by the image block identifiers.

[0142] Exemplarily, the type of the updated password data is a voice type, and the updated password data is a voice frame to be encrypted; the encryption method can be: extracting the voiceprint information and voice information in the voice frame to be encrypted, the voice information including the voice content; combining the voiceprint information with the target data or voice information extracted by the updated password data of the previous type to generate a voiceprint password, and encrypting the voice frame to be encrypted using a preset encryption rule and the voiceprint password to obtain an encrypted voice file.

[0143] In the embodiments of the present application, the encryption rule used in any of the above encryption methods can be any encryption algorithm, function and / or model. Exemplarily, the encryption rule can be a hash function, an International Data Encryption Algorithm (IDEA) algorithm, a Data Encryption Standard (DES) algorithm or an Advanced Encryption Standard (AES) algorithm, etc. The embodiments of the present application do not elaborate on the specific encryption process.

[0144] It should be noted that the encryption method of each type of updated password data may be any appropriate encryption method, which is not limited here. The encryption methods of different types of updated password data may be the same or different.

[0145] In some embodiments, the types of the updated password data of user A include fingerprint type, digital type and voice type; the priority of the updated password data of the digital type is the third priority, the priority of the updated password data of the fingerprint type is the second priority, and the priority of the updated password data of the voice type is the first priority. For the updated password data of different types of corresponding priorities of user A, the first password lock firstly extracts the first target data of the preset position from the updated password data of the digital type, and encrypts the updated password data of the digital type by the encryption method corresponding to the digital type; secondly, extracts the second target data from the preset position of the updated password data of the fingerprint type, and encrypts the updated password data of the fingerprint type by the first target data and the encryption method corresponding to the fingerprint type; finally, encrypts the updated password data of the voice type by the second target data and the encryption method corresponding to the voice type; the encrypted files of the three different types are combined in the order of type to obtain the second target password file. When the second password lock decrypts, the updated password data of the voice type is first decrypted, then the updated password data of the fingerprint type is decrypted, and finally the updated password data of the digital type is decrypted to obtain the original file before encryption.

[0146] In the embodiment of the present application, the header data is a part of the data located in the header of the second target password file, and the size of the header data can be set as needed, for example, 120KB (kilobytes). If the second target password file includes password data of digital type, image type and voice type, the header data may include information such as the data type and type order of the password data, digital format, image format, voice format, digital data memory, image data memory and / or voice data memory.

[0147] In the embodiment of the present application, the first password lock encrypts the data content of the updated password data to obtain the second target password file, and then encrypts the file header of the second target password file to obtain the first target password file, which can achieve double encryption of the updated password data, further improving the security and reliability of password data synchronization. In addition, according to the target data of the former type of password data as the encryption key of the latter type of password data, it is also necessary to continuously obtain different types of password data of the same user before decryption, otherwise the password data is difficult to restore, reducing the risk of data leakage or cracking, and greatly improving the security of password data synchronization.

[0148] In the embodiments of the present application, the following provides specific examples in combination with any of the above embodiments:

[0149] Specific example 1: Figure 3The figure is an exemplary architecture diagram of a smart door lock system. The smart door lock includes a front lock and a rear lock, and the front lock and the rear lock each include a fingerprint recognition module, a face recognition module, a password recognition module, an NFC card recognition module, a display module, an audio and video prompt module, a communication module, an actuator, and a main control circuit.

[0150] Specific example 2: Figure 4 A data synchronization method is shown as an example; Figure 4 As shown, the method is performed by a smart door lock, and the method includes:

[0151] S401, the first combination lock obtains identification data of the user and confirms the operation authority of the user according to the identification data.

[0152] S402: When confirming that the user has the operation authority, the first combination lock determines whether the user is a user with special needs according to the identification data.

[0153] S403: If the first password lock determines that the user is a user with special needs, a password input interface is displayed at a preset position of the first password lock.

[0154] S404, the first password lock outputs recommendation information on the password input interface; the recommendation information includes an indication of the type of updated password data input by the recommended user.

[0155] S405, after the user inputs updated password data, the first password lock determines the priority of the updated password data and the synchronization time corresponding to different priorities according to the attributes of the second password lock, the type of the updated password data and / or the user attributes of the updated password data.

[0156] S406: At the synchronization time corresponding to the priority, the first password lock uses the first private key of the first password lock and the first public key of the second password lock to encrypt the updated password data of the corresponding priority to obtain a first target password file.

[0157] S407: The first password lock synchronizes the first target password file to the second password lock.

[0158] S408: The second password lock uses the second private key of the second password lock and the second public key of the first password lock to decrypt the first target password file to obtain the original file of the updated password data.

[0159] In the above data synchronization method, the first password lock can comprehensively determine the priority of the updated password data and the corresponding synchronization time according to the influencing factors of multiple dimensions. Considering multiple dimensions, the priority of the updated password data can be more comprehensively and accurately determined dynamically each time the password data is updated. The first password lock synchronizes the first target password file to the second password lock according to the priority and the corresponding synchronization time, which can ensure that the updated password data with higher priority, that is, higher importance, is synchronized to the second password lock, and improve the synchronization efficiency of the updated password data with higher importance; thereby allowing the user to unlock the password as soon as possible, improving the user's unlocking experience. In addition, the first password lock encrypts the updated password data by means of public and private keys, and the second password lock decrypts the first target password file by means of public and private keys. The encryption and decryption processing efficiency is high, which improves the security and reliability of the synchronization of the password data between the first password lock and the second password lock, and achieves a better synchronization effect of the updated password data.

[0160] Specific example 3: Figure 5 A data synchronization method is shown as an example; Figure 5 As shown, the method is performed by a smart door lock, and the method includes:

[0161] S501, after the first combination lock is replaced, the first combination lock receives a synchronization instruction for the second combination lock and the password data stored in the cloud.

[0162] S502: The second combination lock determines the priority corresponding to the stored password data according to the attributes of the first combination lock, the type of the stored password data and / or the user attribute of the stored password data, and determines a first synchronization order according to the priority.

[0163] S503, the cloud determines the priority corresponding to the stored password data according to the attributes of the first password lock, the type of the stored password data and / or the user attributes of the stored password data, and determines the second synchronization order according to the priority.

[0164] S504: The second password lock encrypts the stored password data and synchronizes the stored password data to the first password lock according to the first synchronization sequence.

[0165] S505, the cloud encrypts the stored password data and synchronizes the stored password data to the first password lock according to the second synchronization sequence.

[0166] In the embodiment of the present application, after replacing the new first password lock, the password data stored can be synchronized from the second password lock and the cloud through the first synchronization sequence and the second synchronization sequence respectively, without transmitting all the stored password data through a single device, which can further speed up the synchronization efficiency, ensure the normal use of the replaced first password lock, and improve the user experience.

[0167] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0168] Based on the same inventive concept, the embodiment of the present application also provides a data synchronization device for implementing the data synchronization method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more data synchronization device embodiments provided below can refer to the limitations on the data synchronization method above, and will not be repeated here.

[0169] In some embodiments, Figure 6 As shown, the present application also provides a data synchronization device, the device comprising:

[0170] A first determination module 610 is used to determine the priority of the updated password data and the synchronization time corresponding to different priorities according to the attributes of the second password lock, the type of the updated password data and / or the user attributes of the updated password data after the password data of the first password lock in the smart door lock is updated;

[0171] The first processing module 620 is configured to encrypt the updated password data of the corresponding priority by using the first private key of the first password lock and the first public key of the second password lock at the synchronization time corresponding to the priority to obtain a first target password file;

[0172] The communication module 630 is used to synchronize the first target password file to the second password lock through the first password lock, and obtain the second public key of the first password lock and the second private key of the second password lock through the second password lock;

[0173] The second processing module 640 is used for the second password lock to decrypt the first target password file according to the second public key and the second private key to obtain the updated password data of the corresponding priority in the first password lock.

[0174] In some embodiments, the attributes of the second password lock include functional attributes and operation difficulty attributes; the type of the updated password data includes digital type, image type, fingerprint type, voice type, face type and / or near field communication technology NFC type; the user attributes of the updated password data include user authority attributes and user routine attributes; wherein, the user authority attributes include indicating the user's operating authority on the smart door lock; the user routine attributes include historical habit data indicating the user's operations on the smart door lock.

[0175] In some embodiments, the first processing module 620 is used to perform one of the following steps:

[0176] The first method is to determine, according to the first unlocking function of the second password lock, the priority of the updated password data of the type corresponding to the first unlocking function is the first priority, and the synchronization time corresponding to the first priority is the first time; and determine the priority of the updated password data other than the type corresponding to the first unlocking function is the second priority, and the synchronization time of the second priority is the second time; wherein the first priority is higher than the second priority; and the first time is earlier than the second time;

[0177] The second method is to determine, based on the common time data in the routine attributes of the user, that the priority of the updated password data of the user whose common time is at the current time or whose common time has the shortest time interval with the current time is the first priority, and the synchronization time corresponding to the first priority is the first time; and the priority of the updated password data of the user whose common time is the next time adjacent to the current time is the second priority, and the synchronization time of the second priority is the second time;

[0178] The third type is, if the user authority attribute of the updated password data represents that the user is a fixed authorized user, the priority of the password data corresponding to the fixed authorized user is determined to be the first priority, and the synchronization time corresponding to the first priority is the first time; or, if the user authority attribute of the updated password data represents that the user is a temporary authorized user, the priority of the password data corresponding to the temporary authorized user is determined to be the second priority, and the synchronization time of the second priority is the second time.

[0179] In some embodiments, the apparatus further comprises:

[0180] The first determination module 610 is used to detect a replacement operation on the first password lock and / or in response to receiving a synchronization instruction for the second password lock and / or password data stored in the cloud, and determine, according to the priorities corresponding to the stored password data, a first synchronization order for synchronizing the stored password data from the second password lock to the first password lock and a second synchronization order for synchronizing the stored password data from the cloud to the first password lock; wherein the priorities corresponding to the stored password data are determined according to the attributes of the first password lock, the type of the stored password data and / or the user attributes of the stored password data;

[0181] A synchronization module is used to synchronize the stored password data from the second password lock and the cloud according to the first synchronization sequence and the second synchronization sequence respectively.

[0182] In some embodiments, after detecting the replacement operation of the first combination lock, the device further includes:

[0183] a prompt module, configured to output a prompt message within a preset range if the updated first password lock adds a second unlocking function and the stored password data does not contain the password data corresponding to the second unlocking function; wherein the prompt message is used to remind the user to update the password data corresponding to the second unlocking function; the preset range includes a preset time and / or a preset number of times;

[0184] The prompt module is used to stop outputting the prompt information if the prompt time and / or the number of prompts exceeds the preset range.

[0185] In some embodiments, before the password data of the first password lock in the smart door lock is updated, the device further includes:

[0186] An acquisition module, used to acquire identification data of the user; wherein the identification data includes height data, age data, identity data, feature data and / or security question data;

[0187] A second determination module is used to determine whether the user is a user with special needs according to the identification data; wherein the user with special needs indicates a user with needs in a specific field; the specific field includes the hearing field, the vision field and / or the movement field;

[0188] The second determination module is used to determine the display area in the first password lock according to the height data if the user is the special needs user; the display area is used to display the password input interface; the password input interface is used to receive the updated password data input by the user;

[0189] An output module is used to output recommendation information according to the specific field in the password input interface; wherein the recommendation information is used to indicate the type of the updated password data recommended to be input by the user.

[0190] Each module in the above data synchronization device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in an electronic device in the form of hardware, or can be stored in a memory in an electronic device in the form of software, so that the processor can call and execute operations corresponding to each module.

[0191] In one embodiment, an electronic device is provided. The electronic device may be a terminal, and its internal structure diagram may be as follows: Figure 7 As shown. The electronic device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the electronic device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a data synchronization method is implemented. The display screen of the electronic device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the housing of the electronic device, or an external keyboard, touchpad or mouse, etc.

[0192] Those skilled in the art will understand that Figure 7 The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the electronic device to which the scheme of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0193] In one embodiment, an electronic device is provided, including a memory and a processor. A computer program is stored in the memory. When the processor executes the computer program, the following steps are implemented: When the computer program executes the computer program, the steps in the above method embodiments are implemented.

[0194] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0195] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0196] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0197] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0198] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A data encryption method, characterized in that: The method comprises: After the password data of the first password lock in the smart door lock is updated, the priority of the updated password data and the synchronization time corresponding to different priorities are determined according to the attributes of the second password lock, the type of the updated password data and / or the user attributes of the updated password data; At the synchronization time corresponding to the priority, the first password lock uses the first private key of the first password lock and the first public key of the second password lock to encrypt the updated password data of the corresponding priority to obtain a first target password file; Synchronize the first target password file to the second password lock through the first password lock, and obtain the second public key of the first password lock and the second private key of the second password lock through the second password lock; The second password lock decrypts the first target password file according to the second public key and the second private key to obtain the updated password data of the corresponding priority in the first password lock; The first password lock uses the first private key of the first password lock and the first public key of the second password lock to encrypt the updated password data of the corresponding priority to obtain a first target password file, including: Determining an encryption method for the updated password data according to the type of the updated password data; For the updated password data of different types and corresponding priorities of the same user, the updated password data of the latter type is encrypted using the target data extracted from the updated password data of the previous type and the encryption method corresponding to the latter type, until the updated password data of each type is completely encrypted, thereby obtaining a second target password file; Determine a first key according to the first private key and the first public key; Determine, according to the first agreement, that the value of the preset number of bits in the first key is the preset number of bytes; The header data of the preset number of bytes in the second target password file is encrypted to obtain the first target password file; wherein the header data includes the data type and type order, encoding method, file memory and / or file location of the second target password file.

2. The method according to claim 1, characterized in that The attributes of the second password lock include functional attributes and operation difficulty attributes; the types of the updated password data include digital type, image type, fingerprint type, voice type, face type and / or near field communication technology NFC type; the user attributes of the updated password data include user authority attributes and user routine attributes; wherein the user authority attributes include indicating the user's operating authority on the smart door lock; the user routine attributes include historical habit data indicating the user's operations on the smart door lock.

3. The method according to claim 2, characterized in that The method further comprises: Detecting a replacement operation on the first password lock and / or in response to receiving a synchronization instruction for the second password lock and the password data stored in the cloud, determining, according to the priorities corresponding to the stored password data, a first synchronization order for synchronizing the stored password data from the second password lock to the first password lock and a second synchronization order for synchronizing the stored password data from the cloud to the first password lock; wherein the priorities corresponding to the stored password data are determined according to the attributes of the first password lock, the type of the stored password data and / or the user attributes of the stored password data; The stored password data is synchronized from the second password lock and the cloud according to the first synchronization sequence and the second synchronization sequence respectively.

4. The method according to claim 3, characterized in that After detecting the replacement operation of the first combination lock, the method further includes: If the updated first combination lock adds a second unlocking function and the stored password data does not include the password data corresponding to the second unlocking function, the updated first combination lock outputs a prompt message within a preset range; wherein the prompt message is used to remind the user to update the password data corresponding to the second unlocking function; the preset range includes a preset time and / or a preset number of times; If the prompt time and / or prompt times exceed the preset range, stop outputting the prompt information.

5. The method according to claim 1, characterized in that Before the password data of the first password lock in the smart door lock is updated, the method further includes: Obtaining identification data of the user; wherein the identification data includes height data, age data, identity data, feature data and / or security question data; Determining whether the user is a user with special needs according to the identification data; wherein the user with special needs indicates a user with needs in a specific field; the specific field includes the hearing field, the vision field and / or the movement field; If the user is the user with special needs, a display area in the first password lock is determined according to the height data; the display area is used to display a password input interface; the password input interface is used to receive the updated password data input by the user; In the password input interface, recommendation information is output according to the specific field; wherein the recommendation information is used to indicate a type of the updated password data recommended to be input by the user.

6. The method according to claim 1, characterized in that Before the password data of the first password lock in the smart door lock is updated, the method further includes: Obtaining identification data of a user; wherein the identification data includes identity data; According to the identification data, it is determined whether the user has the operation authority.

7. The method according to claim 6, characterized in that The determining, based on the identification data, whether the user has the operation authority includes: The first password lock in the smart door lock randomly generates first verification information according to the identification data; wherein the first verification information includes a verification method and a first master verification code; the first master verification code is used to indicate that the user is a fixed authorized user; Sending the first verification information to a user terminal; wherein the first verification information is used by the user terminal to randomly generate second verification information; Receiving the second verification information sent by the user terminal; wherein the second verification information includes the verification method and a second primary verification code; When the third verification code input by the user matches the second primary verification code, it is determined that the user has the operation authority; the operation authority includes adding password data, deleting password data, clearing password data, adding temporary authorized users and / or deleting temporary authorized users.

8. A data encryption device, characterized in that: The device comprises: A determination module, which is used to determine the priority of the updated password data and the synchronization time corresponding to different priorities according to the attributes of the second password lock, the type of the updated password data and / or the user attributes of the updated password data after the password data of the first password lock in the smart door lock is updated; An encryption module, configured to, at the synchronization time corresponding to the priority, encrypt the updated password data of the corresponding priority by the first password lock using the first private key of the first password lock and the first public key of the second password lock to obtain a first target password file; A communication module, used for synchronizing the first target password file to the second password lock through the first password lock, and obtaining the second public key of the first password lock and the second private key of the second password lock through the second password lock; a decryption module, used for the second password lock to decrypt the first target password file according to the second public key and the second private key, and obtain the updated password data of the corresponding priority in the first password lock; The encryption module is specifically used to perform the following steps: Determining an encryption method for the updated password data according to the type of the updated password data; For the updated password data of different types and corresponding priorities of the same user, the updated password data of the latter type is encrypted using the target data extracted from the updated password data of the previous type and the encryption method corresponding to the latter type, until the updated password data of each type is completely encrypted, thereby obtaining a second target password file; Determine a first key according to the first private key and the first public key; Determine, according to the first agreement, that the value of the preset number of bits in the first key is the preset number of bytes; The header data of the preset number of bytes in the second target password file is encrypted to obtain the first target password file; wherein the header data includes the data type and type order, encoding method, file memory and / or file location of the second target password file.

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

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Secure password generation and management using NFC and contactless smart cards

    CA3121757A1

  • Method for setting and updating dynamic password lock OTC (One Time Code) key

    CN106934886A

  • Intelligent door lock control method, intelligent door lock and computer readable storage medium

    CN108173822A

  • Method and device for encrypting data

    CN110516462A

  • Unlocking authentication method and device, security chip and electronic key management system

    CN114267100A