Data encryption method, device, electronic device and storage medium

By determining the priority and synchronization time of password data in smart door locks and using public-private key encryption technology to prioritize the synchronization of important data, the problems of low synchronization efficiency and insufficient security in smart door locks are solved, achieving a more efficient and secure password data transmission and unlocking experience.

CN119672836BActive Publication Date: 2025-09-26DONGGUAN XINXINGXIN INTELLIGENT TECH CO
View PDF 1 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In smart door locks, the synchronization of password data between the front and rear locks is inefficient and insecure. Especially when multiple users and multiple types of password data are updated, traditional synchronization methods can be easily intercepted and cracked, leading to asset security risks.

Method used

By determining the priority and synchronization time of password data, using public and private key encryption technology to encrypt and decrypt password data, prioritizing the synchronization of highly important data, and dynamically adjusting the synchronization order based on influencing factors in multiple dimensions, encryption processing is performed in combination with user permissions and unlocking function attributes.

Benefits of technology

It improves the security and efficiency of password data synchronization, ensures that important data is synchronized first, enhances the user unlocking experience, reduces illegal user misoperations, and saves communication resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119672836B_ABST
    Figure CN119672836B_ABST
Patent Text Reader

Abstract

The present application relates to a data encryption method, device, electronic device, and storage medium. The method includes: after the password data of a first password lock in a 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 a 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; the first target password file is synchronized to the second password lock through the first password lock, and the second public key of the first password lock and the second private key of the second password lock are obtained 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.
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 the 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] As IoT technology matures, smart door locks are gradually replacing traditional door locks. Compared to traditional door locks, smart door locks offer higher security. With the popularity of smart door locks, they are now available in a variety of styles, including those with split front and rear locks.

[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, posing a risk to the user's asset security.

[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 encrypts the updated password data of the corresponding priority 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;

[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 encrypts the updated password data of the corresponding priority 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, 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, encrypt the updated password data of the latter type 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 encryption of the updated password data of each type is completed, thereby obtaining a second target password file;

[0015] Determine a first key based on the first private key and the first public key;

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

[0017] Encrypting the preset number of bytes of header data 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.

[0018] In one embodiment, 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 operation authority on the smart door lock; the user routine attributes include historical habit data indicating the user's operation on the smart door lock.

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

[0020] Upon detecting a change operation on the first combination lock and / or in response to receiving a synchronization instruction for the second combination lock and the stored password data in the cloud, determining, based on the priorities of the stored password data, a first synchronization order for synchronizing the stored password data from the second combination lock to the first combination lock and a second synchronization order for synchronizing the stored password data from the cloud to the first combination lock; wherein the priorities of the stored password data are determined based on attributes of the first combination lock, the type of the stored password data, and / or 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 has a new second unlocking function and the stored combination data does not include the combination 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 combination 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 based on the identification data; wherein the user with special needs indicates a user with needs in a specific field; the specific field includes the field of hearing, the field of vision and / or the field of movement;

[0028] If the user is a user with special needs, a display area in the first combination 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] On 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 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 the user; wherein the identification data includes identity data;

[0032] Determine whether the user has operation authority based on the identification data.

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

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

[0035] Sending the first verification information to the 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 entered 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 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 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, configured to synchronize the first target password file to the second password lock via 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 via the second password lock;

[0042] a decryption module, configured to decrypt the first target password file using the second password lock 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;

[0043] The encryption module is specifically configured 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, encrypt the updated password data of the latter type 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 encryption of the updated password data of each type is completed, thereby obtaining a second target password file;

[0046] Determine a first key based on the first private key and the first public key;

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

[0048] Encrypting the preset number of bytes of header data 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.

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

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

[0051] In the above-described data encryption method, device, electronic device, and storage medium, the first password lock can comprehensively determine the priority and corresponding synchronization time of updated password data based on multiple factors. This multi-dimensional consideration allows for more comprehensive and accurate dynamic determination of the priority of updated password data each time the password data is updated. The first password lock synchronizes the first target password file with the second password lock based on the priority and corresponding synchronization time, ensuring that updated password data with higher priority, i.e., higher importance, is synchronized to the second password lock, improving the synchronization efficiency of updated password data with higher importance. This allows users to unlock their devices using the updated password data as soon as possible, enhancing the user's unlocking experience. Furthermore, the first password lock encrypts the updated password data using public and private keys, and the second password lock decrypts the first target password file using public and private keys. This provides high encryption and decryption processing efficiency, improving the security and reliability of password data synchronization between the first and second password locks, and achieving better synchronization of 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 illustrating 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 illustrating a data synchronization method according to an exemplary embodiment;

[0056] Figure 5 is a flowchart illustrating 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 solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0060] In the description of the present invention, "several" means one or more, "multiple" means more than two, "greater than," "less than," and "exceed" are understood to exclude the number itself, and "above," "below," and "within" are understood to include the number itself. The use of terms such as "first" and "second" is solely for the purpose of distinguishing technical features and should not be construed as indicating or implying relative importance, or implicitly specifying the number of the indicated technical features, or implicitly specifying 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; multiple is used to indicate two or more.

[0063] In some embodiments, as 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, 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;

[0065] S102: At the synchronization time corresponding to the priority, the first password lock encrypts the updated password data of the corresponding priority 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;

[0066] S103: 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;

[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 operation authority on the smart door lock; the user routine attributes include historical habit data indicating the user performing operations on the smart door lock.

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

[0073] For example, the historical habit data may include, but is not limited to, at least one of 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 factors affecting the priority of the updated password data in different dimensions, and then dynamically adjust the priority of the updated password data each time the password data is updated; the updated password data with higher priority will be synchronized first, ensuring the synchronization efficiency of the updated password data with higher importance, thereby improving 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 the identification data of the user; wherein the identification data includes identity data;

[0077] Determine whether the user has operation authority based on the identification data.

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

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

[0080] Sending the first verification information to the 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 entered by the user matches the second primary verification code, it is determined that the user has the operation permission and the operation permission includes adding password data, deleting password data, clearing password data, adding a temporary authorized user and / or deleting a temporary authorized user.

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

[0084] Randomly generate first verification information based on 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 temporarily authorized user; the first secondary verification code includes an authorization validity period;

[0085] Sending the first verification information to the 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 embodiments of the present application, the user terminal can be any electronic device with communication capabilities. 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. For example, the terminal can be an IoT terminal, such as a sensor device, a mobile phone or so-called "cellular" phone, and a computer with an IoT terminal. For example, it can be 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 communication resources consumed by unnecessary update or unlocking operations.

[0091] In an embodiment of the present application, the priority of the updated password data may include 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; where 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 first user is more important than 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 the updated password data of the first user is more than the type of the updated password data of the second user, then the priority of the updated password data of the second user can be determined to be the first priority, and the priority of the updated password data of the first user can be determined to be the second priority.

[0094] In one embodiment, since the memory occupied by face type password data is greater than the memory occupied by 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 cryptographic data corresponding to the third priority is voice-type cryptographic data. The first cryptographic lock and the second cryptographic lock each generate a public-private key pair based on the elliptic curve Diffie-Hellman (ECDH) algorithm and exchange their respective public keys. The first cryptographic lock uses the first private key A1 of the first cryptographic lock and the first public key B2 of the second cryptographic lock to generate a shared key C. The shared key C is used to encrypt the voice-type cryptographic data, or to encrypt the header data of the voice-type cryptographic data, to obtain a first target file. The first cryptographic lock transmits the first target cryptographic file to the second cryptographic lock. The second cryptographic lock uses the second public key A2 of the first cryptographic lock and the second private key B1 of the second cryptographic lock to generate a public-key secret key C. The shared key C is used to decrypt the first target cryptographic file to obtain the updated voice-type cryptographic 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 based on multi-dimensional influencing factors. This multi-dimensional consideration allows for a more comprehensive and accurate dynamic determination of the priority of the updated password data each time the password data is updated. The first password lock synchronizes the first target password file to the second password lock based on the priority and the corresponding synchronization time, ensuring that updated password data with a higher priority, i.e., a higher degree of importance, is synchronized to the second password lock, thereby improving the synchronization efficiency of updated password data with a higher degree of importance. This allows users to unlock using the updated password data as soon as possible, thereby improving the user's unlocking experience. Furthermore, the first password lock encrypts the updated password data using public and private keys, and the second password lock decrypts the first target password file using public and private keys. This provides a high encryption and decryption processing efficiency, thereby improving the security and reliability of password data synchronization between the first and second password locks, and achieving a better synchronization effect for updated password data.

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

[0098] The first method is to determine, based on 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 as a first priority, and the synchronization time corresponding to the first priority as a first time; and to determine the priority of the updated password data other than the type corresponding to the first unlocking function as a second priority, and the synchronization time of the second priority as a 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, 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 between the current time and the user is determined to be the first priority, and the synchronization time corresponding to the first priority is determined to be 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 determined to be the second priority, and the synchronization time of the second priority is determined to be 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] For example, the first password lock is the front lock and the second password lock is the rear lock. The front lock's first unlocking function may include fingerprint unlocking, password unlocking, voice unlocking, face unlocking, and NFC unlocking, while the rear lock's first unlocking function may include password unlocking and face unlocking. When password data is updated on the front lock and needs to be synchronized to the rear lock, the updated password data corresponding to the rear lock's first unlocking function may be prioritized. Specifically, the updated password data of numeric and facial types may be prioritized, while the priority of password data of image, fingerprint, voice, and NFC types may be prioritized. After synchronizing the updated password data of the first priority to the rear lock, the front lock may choose to continue transmitting the updated password data of the second priority immediately or at an idle time. This allows the front lock to synchronize the updated password data of the second priority from the rear lock even after it is replaced. For example, if the front lock is replaced and not connected to a wireless network, the password data stored in the rear lock may be synchronized from the rear lock via 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] For example, when the application scenario is a villa, and the first combination lock is a rear lock and the second combination lock is a front lock, the first unlocking function of the first combination lock to be replaced can be determined based on the difficulty of the user unlocking the first combination lock from the back of the first combination lock using different types of password data, that is, unlocking the first combination lock from the front of the second combination lock. To facilitate unlocking the first combination lock from the front of the second combination lock, for example, after the second combination lock is removed and before a new one is replaced, the villa door can only be unlocked using the first combination lock. When the user is in front of the villa door and the first combination lock is behind the villa door, they need to reach through the villa door fence to operate the first combination lock, making it difficult for the user to see the password input interface of the first combination lock. Therefore, the first unlocking function of the second combination lock can be determined to be at least one of the less difficult fingerprint unlocking, voice unlocking, and NFC unlocking. To increase the difficulty of unlocking the first combination lock from the front of the second combination lock, the first unlocking function of the second combination lock can be determined to be at least one of the more difficult pattern unlocking, face unlocking, and digital unlocking.

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

[0105] For example, 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 the 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, and 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 prioritize the transmission of updated password data corresponding to the first unlocking function of the second password lock through the first method, 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 common time and the current time, and the updated password data of frequent users can be prioritized 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 prioritized during the idle time of the smart door lock to meet the unlocking needs of more important users.

[0108] Furthermore, the smart door lock can also prioritize updated password data through a combination of methods. For example, when the first and second methods are combined, the password data used by the user to unlock the second lock can be transmitted first; while the password data used for backup storage (i.e., the password data corresponding to the unlocking function not available in the second lock) can be delayed. This way, while ensuring the user's normal unlocking function, 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 efficiency of password data synchronization.

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

[0110] Upon detecting a change operation on the first combination lock and / or in response to receiving a synchronization instruction for the second combination lock and the stored password data in the cloud, determining, based on the priorities of the stored password data, a first synchronization order for synchronizing the stored password data from the second combination lock to the first combination lock and a second synchronization order for synchronizing the stored password data from the cloud to the first combination lock; wherein the priorities of the stored password data are determined based on attributes of the first combination lock, the type of the stored password data, and / or 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 priority 1 to N; the first synchronization order is from 1 to N; the second synchronization order is from N to 1; wherein N is a positive integer; N is greater than 1; and 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 priority 1 to NM from the second password lock according to the synchronization order from 1 to N, and synchronizes password files of priority N to N-M+1 from the cloud according to the synchronization order from N to 1; 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 an 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 the need to transmit 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 has a new second unlocking function and the stored combination data does not include the combination 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 combination 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 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 based on the identification data; wherein the user with special needs indicates a user with needs in a specific field; the specific field includes the field of hearing, the field of vision and / or the field of movement;

[0126] If the user is a user with special needs, a display area in the first combination 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] On 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 input by the user.

[0128] In the embodiment of the present application, users with special needs may include children, the elderly and / or people with disabilities. Exemplarily, people with disabilities may include people with visual impairments, hearing impairments, speech impairments, movement impairments and / or operational impairments.

[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 portion 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, so that the child can enter the password or fingerprint to unlock; if the number of unlocking times is greater than 3 times, it can be determined that the child 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.

[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 unlocking by the visually impaired person; 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, it determines a display area that is convenient for the user to operate and provides the user with recommended information on more convenient unlocking functions to meet the unlocking needs of different groups of people, further improving the intelligence of the smart door lock and the user experience.

[0134] In some embodiments, as 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, comprising 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 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 encryption of the updated password data of each type is completed, thereby obtaining a second target password file;

[0137] S203: Determine a first key based on the first private key and the first public key;

[0138] S204: Determine, according to the first agreement, that the value of the preset number of bits 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 sequence, encoding method, file memory and / or file location of the second target password file.

[0140] Exemplarily, the updated cryptographic data is of an image type, and the updated cryptographic data may include, but is not limited to, at least one of the following to-be-encrypted images: a gesture image, a pattern image, and a slider image. The encryption method may be: using a mask, randomly generated or generated based on target data extracted from the previously updated cryptographic data, to superimpose the entire to-be-encrypted image or a specific region of the to-be-encrypted image to obtain the encrypted image. For example, the to-be-encrypted image is represented by a two-dimensional matrix array, and the mask may also be identified by a two-dimensional matrix data. The dimensions of the two-dimensional matrix array of each mask are the same as the dimensions of the two-dimensional matrix array of each to-be-encrypted image. The two-dimensional matrix array corresponding to the to-be-encrypted image 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 can 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 generated randomly or 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, where the voice information includes the voice content; combining the voiceprint information with the target data or voice information extracted from the updated password data of the previous type to generate a voiceprint password, and encrypting the voice frame to be encrypted using the preset encryption rules and 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. For example, 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. The embodiments of the present application do not elaborate on the specific encryption process.

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

[0145] In some embodiments, the types of updated password data for user A include fingerprint, numeric, and voice. The numeric type has a third priority, the fingerprint type has a second priority, and the voice type has a first priority. For each type of updated password data of user A with corresponding priorities, the first password lock firstly extracts first target data from a preset location in the numeric type updated password data and encrypts the numeric type updated password data using the encryption method corresponding to the numeric type. Secondly, it extracts second target data from a preset location in the fingerprint type updated password data and encrypts the fingerprint type updated password data using the first target data and the encryption method corresponding to the fingerprint type. Finally, it encrypts the voice type updated password data using the second target data and the encryption method corresponding to the voice type. The three encrypted files of different types are combined in order of type to obtain a second target password file. When decrypting, the second password lock first decrypts the voice type updated password data, then the fingerprint type updated password data, and finally the numeric type updated password data, obtaining the original file before encryption.

[0146] In the embodiment of the present application, the header data is a portion of data located in the header of the second target password file. The size of the header data can be set as needed, for example, 120 KB (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 sequence 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 a second target password file, and then encrypts the file header of the second target password file to obtain the first target password file. This can achieve double encryption of the updated password data, further improving the security and reliability of password data synchronization. In addition, the target data of the first type of password data is used as the encryption key for the second type of password data. During decryption, it is also necessary to continuously obtain different types of password data of the same user before decryption can be performed. Otherwise, the password data will be difficult to restore, reducing the risk of data leakage or cracking, and significantly 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 3This is an example architecture diagram of a smart door lock system. The smart door lock includes a front lock and a rear lock, each of which includes a fingerprint recognition module, a face recognition module, a password recognition module, an NFC card recognition module, a display module, an audio and visual 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 executed by a smart door lock, and the method includes:

[0151] S401: The first combination lock obtains identification data of the user and confirms the user's operation authority 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 combination lock determines that the user is a user with special needs, a combination input interface is displayed at a preset position of the first combination 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 the updated password data, the first combination lock determines the priority of the updated password data and the synchronization time corresponding to different priorities according to the attributes of the second combination 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-mentioned data synchronization method, the first password lock can comprehensively determine the priority of the updated password data and the corresponding synchronization time based on multi-dimensional influencing factors. This multi-dimensional consideration allows for a more comprehensive and accurate dynamic determination of the priority of the updated password data each time the password data is updated. The first password lock synchronizes the first target password file with the second password lock based on the priority and the corresponding synchronization time. This ensures that updated password data with a higher priority, i.e., a higher degree of importance, is synchronized to the second password lock, improving the synchronization efficiency of updated password data with a higher degree of importance. This allows users to unlock their devices using the updated password data as soon as possible, enhancing the user's unlocking experience. Furthermore, the first password lock encrypts the updated password data using public and private keys, and the second password lock decrypts the first target password file using public and private keys. This provides high encryption and decryption processing efficiency, improving the security and reliability of password data synchronization between the first and second password locks, and achieving better synchronization of 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 executed 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 attributes 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 combination lock encrypts the stored password data and synchronizes the stored password data to the first combination 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 order.

[0166] In an 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 the need to transmit 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 various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed 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 portion of steps or stages in other steps.

[0168] Based on the same inventive concept, embodiments of the present application also provide a data synchronization device for implementing the aforementioned data synchronization method. The implementation solution provided by this device is similar to the implementation solution described in the aforementioned method. Therefore, the specific limitations of one or more data synchronization device embodiments provided below can be found in the above-mentioned limitations of the data synchronization method and will not be repeated here.

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

[0170] A first determining module 610 is configured to determine, 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 based on the attributes of the second password lock, the type of the updated password data, and / or the user attributes of the updated password data;

[0171] A first processing module 620 is configured to encrypt, at the synchronization time corresponding to the priority, the updated password data of the corresponding priority 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;

[0172] Communication module 630, configured 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 configured to decrypt the first target password file using the second password lock 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 operation authority on the smart door lock; the user routine attributes include historical habit data indicating the user performing operations on the smart door lock.

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

[0176] The first method is to determine, based on 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 as a first priority, and the synchronization time corresponding to the first priority as a first time; and to determine the priority of the updated password data other than the type corresponding to the first unlocking function as a second priority, and the synchronization time of the second priority as a 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, 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 between the current time and the user is determined to be the first priority, and the synchronization time corresponding to the first priority is determined to be 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 determined to be the second priority, and the synchronization time of the second priority is determined to be 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 determining module 610 is configured to detect a change operation on the first combination lock and / or receive a synchronization instruction for the second combination lock and / or password data stored in the cloud, and determine, based on the priorities of the stored password data, a first synchronization order for synchronizing the stored password data from the second combination lock to the first combination lock and a second synchronization order for synchronizing the stored password data from the cloud to the first combination lock; wherein the priorities of the stored password data are determined based on the attributes of the first combination 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 combination lock has a newly added second unlocking function and the stored combination data does not include the combination data corresponding to the second unlocking function; wherein the prompt message is used to remind the user to update the combination 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 configured to stop outputting the prompt information if the prompt time and / or prompt times exceed 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, configured 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 configured to determine whether the user is a user with special needs based on the identification data; wherein the user with special needs refers to a user with needs in a specific field; the specific field includes the hearing field, the vision field and / or the mobility field;

[0188] The second determining module is configured to determine, if the user is a user with special needs, a display area in the first combination lock according to the height data; the display area is configured to display a password input interface; the password input interface is configured to receive the updated password data input by the user;

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

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

[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 via a system bus. 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 covering the display screen, or a button, trackball or touchpad provided on the housing of the electronic device, or an external keyboard, touchpad or mouse.

[0192] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the electronic device to which the solution 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 component arrangement.

[0193] In one embodiment, an electronic device is provided, including a memory and a processor. The memory stores a computer program, and the processor implements the following steps when executing the computer program: the computer program implements the steps in the above method embodiments.

[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 will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented 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 memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of 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 the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in the various embodiments provided herein may be, but are not limited to, a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, and the like.

[0197] The technical features of the above embodiments can be combined arbitrarily. In order 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 merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended 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 encrypts the updated password data of the corresponding priority 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; 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 encrypts the updated password data of the corresponding priority 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, 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, encrypt the updated password data of the latter type 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 encryption of the updated password data of each type is completed, thereby obtaining a second target password file; Determine a first key based on the first private key and the first public key; Determining, according to the first agreement, that the value of the preset number of bits in the first key is a preset number of bytes; Encrypting the preset number of bytes of header data 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.

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 operation authority on the smart door lock; the user routine attributes include historical habit data indicating the user performing operations on the smart door lock.

3. The method according to claim 2, characterized in that The method further comprises: Upon detecting a change operation on the first combination lock and / or in response to receiving a synchronization instruction for the second combination lock and the stored password data in the cloud, determining, based on the priorities of the stored password data, a first synchronization order for synchronizing the stored password data from the second combination lock to the first combination lock and a second synchronization order for synchronizing the stored password data from the cloud to the first combination lock; wherein the priorities of the stored password data are determined based on attributes of the first combination lock, the type of the stored password data, and / or 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 has a new second unlocking function and the stored combination data does not include the combination 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 combination 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, wherein Before updating the password data of the first password lock in the smart door lock, 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 based on the identification data; wherein the user with special needs indicates a user with needs in a specific field; the specific field includes the field of hearing, the field of vision and / or the field of movement; If the user is a user with special needs, a display area in the first combination 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; On 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 input by the user.

6. The method according to claim 1, characterized in that Before updating the password data of the first password lock in the smart door lock, the method further includes: Obtaining identification data of the user; wherein the identification data includes identity data; Determine whether the user has operation authority based on the identification data.

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 based on the identification data; wherein the first verification information includes a verification method and a first main verification code; the first main verification code is used to indicate that the user is a fixed authorized user; Sending the first verification information to the 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 entered 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 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 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, configured to synchronize the first target password file to the second password lock via 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 via the second password lock; a decryption module, configured to decrypt the first target password file using the second password lock 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 encryption module is specifically configured 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, encrypt the updated password data of the latter type 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 encryption of the updated password data of each type is completed, thereby obtaining a second target password file; Determine a first key based on the first private key and the first public key; Determining, according to the first agreement, that the value of the preset number of bits in the first key is a preset number of bytes; Encrypting the preset number of bytes of header data 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.

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

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

  • Data synchronization method and device, electronic equipment and storage medium

    CN118570908A