Intelligent lock key management system and method

By strictly controlling the keys during the decryption process of the cable pipeline intelligent lock, the problem of insufficient key management mechanism by the key management platform is solved, which reduces security risks and improves overall security.

CN119274255APending Publication Date: 2025-01-07GUANGZHOU PANYU CABLE WORKS

Patent Information

Application Number
CN202411458113.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-18
Publication Date
2025-01-07

AI Technical Summary

Technical Problem

The decryption process of the cable pipe intelligent lock does not have enough key control mechanism, which can easily cause safety hazards.

Method used

By strictly controlling the keys during the decryption process of the cable pipeline intelligent lock, including the key management platform to generate and manage keys, encrypted transmission between the client and the smart key, identity authentication of the smart key and the smart lock, and After the key is used, the key is invalidated.

Benefits of technology

It effectively reduces the security risks of keys during the decryption process and improves the overall security of the smart lock system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119274255A_ABST
    Figure CN119274255A_ABST
Patent Text Reader

Abstract

The invention discloses an intelligent lock key management system and method, and the method comprises the steps: a key management platform transmits key information to a client, and marks the key state of the key information as a to-be-transmitted state; the client receives the secret key information and transmits the secret key information to the intelligent key, and when the client receives a receiving success result sent by the intelligent key, a secret key state is marked as a to-be-used state, and the secret key state is fed back to the secret key management platform; and the intelligent key and the intelligent lock perform identity authentication based on the key information, and under the condition of successful authentication, the intelligent key marks a key state as a use completion state and feeds back the key state to the key management platform, so that the key management platform performs cancellation processing on the key information. According to the technical scheme, the security risk of the secret key in the decryption process is effectively reduced, and the overall security of the intelligent lock system is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of cable duct smart locks, and specifically relates to a smart lock key management system and method. Background Art

[0002] At present, in order to solve the problem that the cable pipes are not installed in the prescribed order during the cable laying process, and the cable pipes as special pipes for cable laying are often occupied, cable pipe pluggers are widely used in the field of cable installation. The cable pipe plugger includes a plugging module and a passive smart lock module. Through the pre-installed cable pipe smart lock, the background APP visual management can be realized, thereby preventing the construction workers from not installing and disassembling according to the prescribed order when adding new cables in the later stage, and the cable pipes are occupied by unauthorized units.

[0003] However, in the related art, the decryption process of the cable duct smart lock is that the key management platform sends the key to the client, and the client transmits the key to the smart key, which is inserted into the smart lock for identity authentication. If the verification is successful, the smart lock will be opened. The whole process lacks a key management and control mechanism, which can easily cause security risks. Summary of the invention

[0004] The purpose of the embodiment of the present application is to provide a smart lock key management system and method, which aims to solve the problem that the key control mechanism in the decryption process of the cable duct smart lock in the related technology is insufficient, which easily causes security risks. This solution strictly controls the key during the decryption process of the cable duct smart lock, thereby effectively reducing the security risks of the key in the decryption process and improving the overall security of the smart lock system.

[0005] In a first aspect, an embodiment of the present application provides a smart lock key management method, the method comprising:

[0006] The key management platform sends the key information to the client and marks the key status of the key information as a waiting-for-transmission status;

[0007] The client receives the key information and transmits the key information to the smart key. When the client receives a successful reception result sent by the smart key, the key status is marked as a ready-to-use status and the key status is fed back to the key management platform.

[0008] The smart key and the smart lock perform identity authentication based on the key information. If the authentication is successful, the smart key marks the key status as a use-completed status and feeds back the key status to the key management platform so that the key management platform invalidates the key information.

[0009] Furthermore, before the key management platform sends the key information to the client and marks the key state of the key information as a state to be transmitted, the method further includes:

[0010] The key management platform generates a key according to the key request sent by the client, and associates a unique key ID with the key;

[0011] The key management platform encapsulates the key, the key ID and a preset key validity period into key information based on an AES encryption algorithm, stores the key information in a database of the key management platform and marks the status information as not transmitted.

[0012] Furthermore, the key request includes the API key and user identity information added by the client, and before the key management platform sends the key information to the client and marks the key state of the key information as a state to be transmitted, it also includes:

[0013] The key management platform obtains the API key and the user identity information in the key request, and compares the API key and the user identity information with the security key and security user information pre-stored in the database;

[0014] When the API key and the user identity information are consistent, the key management platform and the client establish a secure channel;

[0015] Correspondingly, the key management platform sends the key information to the client and marks the key state of the key information as a state to be transmitted, including:

[0016] The key management platform sends the key information to the client based on a pre-established secure channel;

[0017] The key management platform modifies the key state in the database from a non-transmitted state to a to-be-transmitted state.

[0018] Further, the client receives the key information and transmits the key information to the smart key. When the client receives a successful reception result sent by the smart key, the key state is marked as a ready-to-use state, and the key state is fed back to the key management platform, including:

[0019] The client receives the key information and transmits the key information to the smart key via a pre-established Bluetooth connection;

[0020] When the client receives a successful reception result sent by the smart key, the client marks the key status in the memory as a waiting-for-use status, and constructs a feedback request including the key ID and the current key status, and sends the feedback request to the key management platform based on a pre-established secure channel, so that the key management platform changes the key status in the database from a waiting-for-transmission status to a waiting-for-use status.

[0021] Furthermore, the smart key and the smart lock perform identity authentication based on the key information. When the authentication is successful, the smart key marks the key status as a use-completed status and feeds back the key status to the key management platform so that the key management platform invalidates the key information, including:

[0022] The smart key generates an identity authentication request message based on the key information, and sends the identity authentication request message to the smart lock, wherein the identity authentication request message includes a key ID and encrypted data;

[0023] The smart lock uses the key information to decrypt the identity authentication request message sent by the smart key, generates a verification response message according to the decrypted data, and sends the verification response message to the smart key;

[0024] The smart key decrypts the response message based on the key information. If the decrypted verification response data is correct, the identity authentication between the smart key and the smart lock is successful. The smart key marks the key management status as the use-completed status, and constructs a feedback request including the key ID and the current key status, and sends the feedback request to the key management platform based on the pre-established secure channel;

[0025] The key management platform modifies the key status in the database from a waiting-for-use status to a use-completed status based on the feedback request sent by the smart key, and deletes the key information from the database.

[0026] Furthermore, the method further comprises:

[0027] The client sends an HTTP GET access request to the API interface of the key management platform, wherein the request includes the key ID to be queried;

[0028] After receiving the access request, the key management platform verifies the identity and authority of the client;

[0029] Under the condition that the client is authorized to access the requested key status, the key management platform queries the storage information of the corresponding key in the database according to the access request, and generates a query result, wherein the query result includes the current status information of the key, the historical key status change information, the key creation time and the last use time of the key;

[0030] The key management platform encapsulates the query result into an HTTP response and returns it to the client;

[0031] The client receives the HTTP response, parses the data in the response body, and obtains the query result.

[0032] Furthermore, the method further comprises:

[0033] The client and the smart key send a key status acquisition request to the API interface of the key management platform based on a preset period of time, wherein the key status acquisition request includes a key ID;

[0034] The key management platform queries the current key state of the key in the database based on the key ID and encapsulates the key state into a response message and returns it to the client and the smart key;

[0035] The client and the smart key extraction response message compare the key status with the key status recorded by themselves. If the comparison results are consistent, a key status acquisition request is re-sent to the API interface of the key management platform after a preset time period. If the comparison results are inconsistent, the key status recorded by itself is modified to the key status extracted from the response message.

[0036] In a second aspect, an embodiment of the present application provides a smart lock key management system, the system comprising:

[0037] The key management platform is configured to send the key information to the client, mark the key status of the key information as a waiting-for-transmission status, modify the key status to a waiting-for-use status based on the key status fed back by the client as a waiting-for-use status, and invalidate the key information based on the key status fed back by the smart key as a completed-use status;

[0038] The client is configured to receive the key information and transmit the key information to the smart key. When the client receives a successful reception result sent by the smart key, the key status is marked as a ready-to-use status and the key status is fed back to the key management platform.

[0039] A smart key, configured to perform identity authentication with the smart lock based on the key information. If the authentication is successful, the smart key marks the key status as a use-completed status and feeds back the key status to the key management platform;

[0040] The smart lock is configured to perform identity authentication with the smart key based on the key information.

[0041] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the method described in the first aspect.

[0042] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0043] In an embodiment of the present application, the key management platform sends key information to the client, and marks the key status of the key information as a state to be transmitted; the client receives the key information and transmits the key information to the smart key. When the client receives the successful reception result sent by the smart key, the key status is marked as a state to be used, and the key status is fed back to the key management platform; the smart key and the smart lock perform identity authentication based on the key information. When the authentication is successful, the smart key marks the key status as a state of use completion, and feeds back the key status to the key management platform, so that the key management platform invalidates the key information. The above-mentioned smart lock key management method solves the problem that the decryption process of the cable duct smart lock in the related technology is insufficient in the control mechanism of the key, which is easy to cause security risks. This solution effectively reduces the security risks of the key in the decryption process by strictly controlling the key in the cable duct smart lock, thereby improving the overall security of the smart lock system. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 It is a flowchart of a smart lock key management method provided by an embodiment of the present application;

[0045] Figure 2 It is a flowchart of another smart lock key management method provided in an embodiment of the present application;

[0046] Figure 3 It is a flowchart of another smart lock key management method provided by an embodiment of the present application;

[0047] Figure 4It is a structural diagram of a smart lock key management system provided by an embodiment of the present application;

[0048] Figure 5 It is a structural diagram of a smart lock key management electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0049] In order to make the purpose, technical scheme and advantages of the present application clearer, the specific embodiments of the present application are further described in detail below in conjunction with the accompanying drawings. It is understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for the convenience of description, only the part related to the present application but not all the contents are shown in the accompanying drawings. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow chart describes each operation (or step) as a sequential process, many of the operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of each operation can be rearranged. The process can be terminated when its operation is completed, but it can also have additional steps not included in the accompanying drawings. The process can correspond to a method, a function, a procedure, a subroutine, a subprogram, etc.

[0050] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0051] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0052] The following, in combination with the accompanying drawings, describes in detail the smart lock key management method, system and device provided in the embodiments of the present application through specific embodiments and their application scenarios.

[0053] The application scenario of the embodiment of the present application is to realize the visual management of the cable duct blocking process through the cable duct smart lock. The execution subject of the embodiment of the present application is the smart lock key management system.

[0054] Figure 1 Schematic diagram of a smart lock key management method provided by an embodiment of the present application. Figure 1 As shown, the method includes:

[0055] S101. The key management platform sends key information to the client and marks the key status of the key information as a waiting-for-transmission status.

[0056] Among them, the key management platform is a system for centralized key management, ensuring the secure storage, generation, distribution, and destruction of keys. The client refers to the application or software that interacts with the key management platform. Key information refers to the information encapsulated by the key generated based on the client request, the key ID, and the pre-set key validity period. The key state refers to the different stages or conditions of the key in its life cycle, which define the key's availability, security, and role in the system. For example, common key states include the state to be transferred, the state to be used, and the state to be destroyed. Among them, the state to be transferred can be regarded as the state of the key before it is ready to be securely transferred from one party to another. At this stage, the key may have been generated, activated, and is ready to be sent to the recipient through some secure transmission mechanism.

[0057] In one embodiment, the key management platform sends the pre-packaged key information to the client, and after sending, marks the current state of the key as a state to be transmitted, and records it in a database.

[0058] Optionally, before the key management platform sends the key information to the client and marks the key state of the key information as a state to be transmitted, the method further includes:

[0059] The key management platform generates a key according to the key request sent by the client, and associates a unique key ID with the key;

[0060] The key management platform encapsulates the key, the key ID and a preset key validity period into key information based on an AES encryption algorithm, stores the key information in a database of the key management platform and marks the status information as not transmitted.

[0061] Among them, the AES encryption algorithm is a symmetric encryption algorithm. Symmetric encryption means that the same key is used for encryption and decryption. AES can encrypt data and convert plaintext data into ciphertext data. Only those who have the correct key can decrypt the ciphertext into the original plaintext. The key ID is a unique identifier used to identify a specific key. The key validity period refers to the time range in which the key can be used normally.

[0062] In one embodiment, the client sends a key request to the key management platform. This request may include the client's authentication information, key type, key length and other parameters. The key management platform generates a key using a secure random number generator based on the client's request parameters, and associates a unique key ID with the generated key. This ID is used to uniquely identify the key in subsequent operations for easy management and query.

[0063] Then, the key management platform uses the AES encryption algorithm to encapsulate the key, key ID, and the pre-set key validity period to generate key information, and stores the encapsulated key information in the database of the key management platform. It can be understood that the key validity period is an important security parameter used to control the life cycle of the key. During the validity period, the key can be used for encryption and decryption operations; after expiration, the key will be destroyed or no longer used to prevent security risks.

[0064] During the storage process, the key management platform can further encrypt the key information to ensure that even if the database is compromised, the key information cannot be easily obtained. At this time, the key management platform marks the status information of the key information as "not transmitted". This status information is used to track the transmission status of the key information to ensure that the key information is correctly transmitted to the client in the subsequent process.

[0065] Optionally, the key request includes the API key and user identity information added by the client, and before the key management platform sends the key information to the client and marks the key state of the key information as a state to be transmitted, further includes:

[0066] The key management platform obtains the API key and the user identity information in the key request, and compares the API key and the user identity information with the security key and security user information pre-stored in the database;

[0067] When the API key and the user identity information are consistent, the key management platform and the client establish a secure channel;

[0068] Correspondingly, the key management platform sends the key information to the client and marks the key state of the key information as a state to be transmitted, including:

[0069] The key management platform sends the key information to the client based on a pre-established secure channel;

[0070] The key management platform modifies the key state in the database from a non-transmitted state to a to-be-transmitted state.

[0071] Among them, the API key is an authentication tool for accessing the API, which is used to identify and verify the application or user requesting the API (application programming interface) service. It is an identifier for API access control, which is used to verify the identity of the API requester and determine whether the request is allowed. API keys are usually provided by the API provider and transmitted securely over the HTTPS protocol. Each API key is unique, similar to the username and password of an account, and is used to authorize access to the API. User identity information refers to various information that can identify the user's personal identity alone or in combination with other information. This includes but is not limited to the user's name, date of birth, ID number, personal biometric information, address, telephone number, etc. User identity information is sensitive information and needs to be properly protected to prevent unauthorized access and use. Secure channel is an encryption protocol used to ensure that data transmission between communicating parties cannot be intercepted or tampered with by unauthorized third parties.

[0072] In one embodiment, when constructing a key request, the client adds the API key and user identity information to the key request, and sends the key request to the key management platform. When the key management platform receives the key request from the client, it parses the request content and extracts the API key and user identity information therein. The key management platform reads the pre-stored security keys and security user information from the database, and compares the extracted API keys and user identity information with the security keys and security user information in the database one by one. When the API key and user identity information are both consistent, the key management platform and the client use an encryption protocol to establish a secure channel, such as the SSL protocol or TLS, which is not specifically limited in this application.

[0073] On this basis, based on the pre-established secure channel, the key management platform can use a secure communication method to send the key information to the client. For example, an encrypted network protocol (such as HTTPS) can be used for data transmission to ensure that the key information is not stolen or tampered with during the transmission process. After the key information is sent, the key management platform uses a database update operation to change the key state from the untransmitted state to the pending transmission state, where the database update operation can be an SQL update statement or an update method provided by the database access framework, which is not specifically limited.

[0074] S102, the client receives the key information and transmits the key information to the smart key. When the client receives a successful reception result sent by the smart key, the key status is marked as a ready-to-use status and the key status is fed back to the key management platform.

[0075] Among them, the smart key is a device specifically used to operate a cable smart lock. Unlike traditional keys, the smart key has a microprocessor and memory integrated inside, where the microprocessor is responsible for handling the communication and authentication process. The memory is used to save important data such as keys and authentication information. In addition, the smart key contains a Bluetooth module, which can use low-power Bluetooth technology to achieve wireless communication with the APP. The smart key is also equipped with a rechargeable battery to provide a stable operating voltage for the microprocessor, Bluetooth module, etc. At the same time, the power management system ensures efficient use and long life of the battery. In addition, the smart key also includes a display screen that displays the current operating status, as well as the necessary physical interfaces, charging interfaces, and buttons for manually triggering communication or authentication. The key's pending status indicates that the key has been successfully transmitted from the client to the corresponding smart key and other devices, and has been received and confirmed. This means that the key is ready and can be used to perform operations such as encryption or decryption.

[0076] In one embodiment, when the client receives the key information sent by the key management platform, it first needs to parse and store the information. Specifically, the corresponding parsing operation can be performed according to the transmission format of the key information (such as JSON, XML, etc.), and the parsed key information is stored in the client's memory or local storage. The client can use the Bluetooth API to establish a connection with the smart key and transmit the key information to the smart key via Bluetooth.

[0077] After receiving the key information, the smart key will perform a series of verification and processing operations. If the reception is successful, the smart key will send a successful reception result to the client. This result can be a specific data packet, signal or status code. After receiving the successful reception result sent by the smart key, the client marks the key status as a waiting state and feeds back the current key status to the key management platform. Specifically, this can be achieved by sending a status update request to the key management platform, which contains the key ID and the new key status (waiting state). After receiving the request, the key management platform can update the key status in the database to a waiting state.

[0078] S103. The smart key and the smart lock perform identity authentication based on the key information. If the authentication is successful, the smart key marks the key status as a use-completed status and feeds back the key status to the key management platform so that the key management platform invalidates the key information.

[0079] Among them, the smart lock is an electronic device used to protect the safety of cable-related facilities. It can lock cable boxes, cable connectors and other parts. This smart lock uses electronic control to unlock. Specifically, it can use a matching smart key for authorized operation. Identity authentication refers to the process of verifying whether the smart key is authorized to operate the smart lock in the smart lock system. The use-completed state refers to a state in which the key has completed the encryption, decryption or other related security operations assigned to it. For example, in the cable smart lock scenario, when the smart key successfully opens or closes the smart lock using the key, the key enters the use-completed state. Abolition processing refers to the operation taken on the key to make it no longer available when the key life cycle ends or the key presents a security risk.

[0080] In one embodiment, the smart key transmits the received key information to the smart lock via Bluetooth transmission. After receiving the key information, the smart lock performs identity authentication. The authentication method can be to compare the pre-stored security key information. Specifically, some security keys or key feature information may be pre-stored in the smart lock, and the received key information is compared with the pre-stored information. If they are completely consistent, the authentication is successful. When the smart lock is successfully authenticated, the smart key marks the key status as the use-completed state by modifying the key status flag in the storage area inside the smart key. After the modification is completed, the smart key feeds back the key status to the key management platform. After receiving the key status feedback, the key management platform invalidates the key information. First, the key management platform will search the corresponding key record in the database according to the received key ID, and mark the status of the key as "invalidated" in the database, but will not actually delete the key data, so that it can be audited or traced when needed.

[0081] In an embodiment of the present application, the key management platform sends key information to the client, and marks the key status of the key information as a state to be transmitted; the client receives the key information and transmits the key information to the smart key. When the client receives the successful reception result sent by the smart key, the key status is marked as a state to be used, and the key status is fed back to the key management platform; the smart key and the smart lock perform identity authentication based on the key information. When the authentication is successful, the smart key marks the key status as a state of use completion, and feeds back the key status to the key management platform, so that the key management platform invalidates the key information. The above-mentioned smart lock key management method solves the problem that the decryption process of the cable duct smart lock in the related technology is insufficient in the control mechanism of the key, which is easy to cause security risks. This solution effectively reduces the security risks of the key in the decryption process by strictly controlling the key in the cable duct smart lock, thereby improving the overall security of the smart lock system.

[0082] Figure 2 FIG. 1 is a flow chart of another smart lock key management method provided by an embodiment of the present application. Figure 2 As shown, the method includes:

[0083] S201. The key management platform sends key information to the client and marks the key status of the key information as a waiting-for-transmission status.

[0084] S202: The client receives the key information and transmits the key information to the smart key via a pre-established Bluetooth connection.

[0085] Among them, Bluetooth connection is a short-range wireless communication technology used to transmit data between devices.

[0086] In one embodiment, the client scans nearby Bluetooth devices through the Bluetooth API (application programming interface) provided by the system. For example, in the Android system, the startDiscovery method of the BluetoothAdapter class can be used to start the scan. After scanning the Bluetooth device of the smart key, the client needs to pair and connect with the smart key. Before transmission, the client needs to convert and process the stored key information in an appropriate format so that it can be transmitted via Bluetooth. For example, if the key information is a complex data structure, it may need to be serialized into a byte stream. Then, the client sends the key information to the smart key through a pre-established Bluetooth connection. Specifically, the RFCOMM protocol of Bluetooth Classic or the related data transmission protocol of Bluetooth Low Energy can be used, which is not specifically limited here.

[0087] S203, when the client receives the successful reception result sent by the smart key, the client marks the key status in the memory as a waiting-for-use state, and constructs a feedback request including the key ID and the current key status, and sends the feedback request to the key management platform based on a pre-established secure channel, so that the key management platform changes the key status in the database from a waiting-for-transmission state to a waiting-for-use state. The successful reception result refers to the feedback information sent by the smart key to the client after successfully receiving the key information.

[0088] The feedback request refers to a request message containing the response content to a specific operation, event or request.

[0089] In one embodiment, after the client receives the successful reception result sent by the smart key through a pre-established communication mechanism, the client searches for the storage location corresponding to the key in the memory, and marks the key state as a ready-to-use state by updating a variable or flag representing the key state in the memory data structure. For example, the client may use a hash table to store key information, where each key corresponds to an entry, including a key ID, key data, and a state flag. After receiving the successful result of the smart key, the client finds the corresponding entry according to the key ID and modifies the state flag to "ready-to-use state".

[0090] After confirming that the smart key has been successfully received and marked, the client starts to build a feedback request. First, it determines the information to be included in the feedback request, namely the key ID and the current key status. Then, the client organizes this information in an agreed format, such as building a JSON object or a specific data packet format. For example, a JSON object is constructed as follows: {"keyId":"specific key ID value","keyStatus":"to be used status"}. On this basis, the client uses a pre-established secure channel to send the feedback request to the key management platform.

[0091] After receiving the feedback request, the key management platform first parses the request content and extracts the key ID and key status information. Then, it uses the key ID to find the corresponding key record in the database. After finding the corresponding key record, the key management platform changes the key status in the database from the pending transmission status to the pending use status. Specifically, the key management platform can use SQL update statements or update methods provided by the database access framework to modify the key status. For example, if using SQL, execute "UPDATE key_table SET status = 'pending use status' WHERE key_id = 'specific key ID value'". It should be noted that the above method is only an example of a specific implementation method and is not a limitation.

[0092] S204. The smart key and the smart lock perform identity authentication based on the key information. If the authentication is successful, the smart key marks the key status as a use-completed status and feeds back the key status to the key management platform so that the key management platform invalidates the key information.

[0093] Figure 3 FIG. 1 is a flow chart of another smart lock key management method provided by an embodiment of the present application. Figure 3 As shown, the method includes:

[0094] S301. The key management platform sends key information to the client and marks the key status of the key information as a waiting-for-transmission status.

[0095] S302, the client receives the key information and transmits the key information to the smart key. When the client receives a successful reception result sent by the smart key, the key status is marked as a ready-to-use status, and the key status is fed back to the key management platform;

[0096] S303: The smart key generates an identity authentication request message based on the key information, and sends the identity authentication request message to the smart lock, where the identity authentication request message includes a key ID and encrypted data.

[0097] Among them, the identity authentication request message is a communication data used to start the identity authentication process. Encrypted data refers to the data obtained by encrypting specific content using a key (a key associated with a key ID). For example, a randomly generated challenge code (Challenge Code) is encrypted with the key. The authenticator (such as a smart lock) generates a challenge code and sends it to the authenticated party (such as a smart key). The authenticated party encrypts the challenge code with the key and returns the encrypted data. After receiving the encrypted data, the authenticator uses the same key to decrypt it. If the challenge code obtained is consistent with the one sent, the identity of the authenticated party can be verified.

[0098] In one embodiment, when the smart key generates an identity authentication request, the smart key encrypts the challenge code using the key corresponding to the key information. Encryption can use a symmetric encryption algorithm (such as AES) or an asymmetric encryption algorithm (such as RSA). For example, if AES encryption is used, the smart key uses the key and challenge code as input and generates encrypted data through the encryption algorithm. The smart key and the smart lock may be connected via wireless communication methods such as Bluetooth and NFC. The smart key sends the identity authentication request message to the smart lock based on the established communication channel.

[0099] S304. The smart lock uses the key information to decrypt the identity authentication request message sent by the smart key, generates a verification response message according to the decrypted data, and sends the verification response message to the smart key.

[0100] The verification response message is a message returned by the verifying party (such as a smart lock) after the verified party (such as a smart key) sends an authentication request message during the authentication process. This message is mainly used to inform the verified party whether the authentication is successful.

[0101] In one embodiment, the smart lock first needs to obtain the corresponding key information from its own storage system. This can be stored in the previous interaction with the key management system or the client, and ensure that the key obtained matches the key ID in the identity authentication request message sent by the smart key. According to the key type, select the appropriate decryption algorithm. For example, if it is a symmetric key (such as an AES key), use the corresponding symmetric decryption algorithm; if asymmetric encryption (such as RSA) is involved, use the corresponding asymmetric decryption algorithm to process it. The received encrypted data (from the identity authentication request message sent by the smart key) and the obtained key are used as input, and the challenge code is obtained by decrypting it through the selected decryption algorithm. The smart lock compares the challenge code that it previously generated and sent to the smart key with the decrypted challenge code. If the two are the same, it means that the smart key has the correct key and the identity authentication is initially passed.

[0102] On this basis, the smart lock constructs a verification response message according to the verification result. If the verification is successful, the verification result is marked as "successful" (for example, a Boolean value is set to "true" or the status code is "200"); if the verification fails, it is marked as "failed" (the Boolean value is "false" or the status code is "401", etc.). At the same time, if the verification fails, the reason for the failure can be added to the message, such as "key mismatch" and "signature verification failure" and other explanatory content. The smart lock encapsulates the constructed verification response message according to the selected communication protocol, and then sends it to the smart key through the communication channel. For example, when communicating via Bluetooth, the message is packaged into a Bluetooth data packet and sent to the smart key.

[0103] S305. The smart key decrypts the response message based on the key information. If the decrypted verification response data is correct, the identity authentication between the smart key and the smart lock is successful. The smart key marks the key management status as the use completion status, and constructs a feedback request including the key ID and the current key status, and sends the feedback request to the key management platform based on a pre-established secure channel.

[0104] In one embodiment, the smart key first obtains the key information related to the previous identity authentication from its own storage. This part of information has been stored in the previous interaction with the client or other initialization process, and it is necessary to ensure that the key is the same as the key used for identity authentication. According to the type of key and encryption method, select a suitable decryption algorithm to verify the response message as input, and use the selected key and decryption algorithm for decryption. The decrypted verification response data should conform to the predefined format. For example, it may be a simple Boolean value ("true" indicates success, "false" indicates failure) or a structure containing a status code and related explanations. If the decrypted verification response data indicates that the identity authentication is successful (such as a Boolean value of "true" or a status code of "200" and other successful identifiers), it is determined that the identity authentication between the smart key and the smart lock is successful.

[0105] On this basis, the smart key marks the key management status as the use-completed status in the internal storage. This can be achieved by modifying the variable or data structure that stores the key status. For example, the smart key has a database table or object that stores key-related information, which contains a field for indicating the key status, and the value of the field is modified to "use-completed status". Then, a feedback request containing the key ID and the current key status (ie, "use-completed status") is constructed. The format of the feedback request can be determined based on the communication protocol with the key management platform and is not limited here. The smart key sends the constructed feedback request to the key management platform based on a pre-established secure channel.

[0106] S306: The key management platform modifies the key status in the database from a waiting-for-use status to a use-completed status based on the feedback request sent by the smart key, and deletes the key information from the database.

[0107] In one embodiment, the key management platform continuously monitors communications from the smart key. When the smart key sends a feedback request, the key management platform receives the request through a pre-established communication interface (such as a network port, a message queue, etc.). The key management platform parses the received request and extracts key information therein, including the key ID and the current key status (use completed status). According to the extracted key ID, the corresponding key record is searched in the database. After finding the corresponding record, the key status field in the record is modified from the waiting state to the use completed state. After confirming that the key status modification is successful, the key information is deleted.

[0108] Based on the above embodiment, optionally, the method further includes:

[0109] The client sends an HTTP GET access request to the API interface of the key management platform, wherein the request includes the key ID to be queried;

[0110] After receiving the access request, the key management platform verifies the identity and authority of the client;

[0111] Under the condition that the client is authorized to access the requested key status, the key management platform queries the storage information of the corresponding key in the database according to the access request, and generates a query result, wherein the query result includes the current status information of the key, the historical key status change information, the key creation time and the last use time of the key;

[0112] The key management platform encapsulates the query result into an HTTP response and returns it to the client;

[0113] The client receives the HTTP response, parses the data in the response body, and obtains the query result.

[0114] Among them, the API (Application Programming Interface) interface is a set of well-defined rules and protocols for communication between different software components. The API interface enables different applications to collaborate with each other. HTTP (Hypertext Transfer Protocol) is a protocol for transmitting hypertext (such as web pages) and is the basis for data transmission on the Internet. GET is a request method in the HTTP protocol.

[0115] In one embodiment, the client determines the key ID to be queried and adds it as a parameter to the URL of the key management platform API interface. For example, if the API address of the key management platform is "https: / / key-management-platform.com / api / keys", then the request URL may be "https: / / key-management-platform.com / api / keys?keyId=12345", where "12345" is the key ID to be queried. Then use the HTTP library or network request framework to send an HTTP GET request. After the server of the key management platform receives the HTTP GET request from the client, it first extracts the information in the request, including the client's IP address, authentication information in the request header, etc., and checks whether the client has provided valid authentication credentials.

[0116] When the client's identity authentication is passed, the key management platform constructs a database query statement based on the key ID in the request. For example, if a SQL database is used, the query statement may be "SELECT * FROM keys_table WHERE key_id = '12345'", where "12345" is the key ID to be queried. The key management platform uses the database connection library or database driver to execute the query statement and obtain the storage information of the corresponding key from the database. The key management platform organizes the queried information into query results. The query results include the current status information of the key (such as "to be used" and "completed", etc.), historical key status change information (recording the history of key status changes from creation to the current state), key creation time, and the last use time of the key. This information can be stored in the form of data structures (such as dictionaries, objects, etc.) so that it can be encapsulated into HTTP responses later. Specifically, the key management platform converts the query results into a format suitable for transmission in HTTP responses, usually JSON or XML format. For example, if the JSON format is used, the response body may be "{"currentStatus":"Use completed status","history":"[creation time: 2024-09-01, status: to be used; 2024-09-15, status: use completed]","creationTime":"2024-09-01","lastUsedTime":"2024-09-25"}". And set the appropriate HTTP status code according to the query result. If the query is successful, it is usually set to "200OK"; if the key does not exist or the client has no access, it may be set to "404Not Found" or "403Forbidden", etc. The key management platform uses an HTTP server framework (such as the Express framework of Node.js or the Flask framework of Python in the backend server) to send the constructed HTTP response back to the client.

[0117] After the client's HTTP library or network request framework receives the HTTP response returned by the key management platform, it first checks the status code of the response to determine whether the request is successful. If the status code is "200OK", it means that the query is successful and the data in the response body can continue to be parsed; if it is another status code, error handling is required according to the specific situation. If the request is successful, use the corresponding parsing library (such as using the JSON.parse function in JavaScript) to parse the data in the response body into a format that the client can handle. For example, if the response body is in JSON format, the client can parse it into a JavaScript object and then extract the query result information from it, such as the current status of the key, historical status changes, creation time, and last use time.

[0118] Based on the above embodiment, optionally, the method further includes:

[0119] The client and the smart key send a key status acquisition request to the API interface of the key management platform based on a preset period of time, wherein the key status acquisition request includes a key ID;

[0120] The key management platform queries the current key state of the key in the database based on the key ID and encapsulates the key state into a response message and returns it to the client and the smart key;

[0121] The client and the smart key extraction response message compare the key status with the key status recorded by themselves. If the comparison results are consistent, a key status acquisition request is re-sent to the API interface of the key management platform after a preset time period. If the comparison results are inconsistent, the key status recorded by itself is modified to the key status extracted from the response message.

[0122] The preset period refers to the time interval set by the technician to send a key status acquisition request to the key management platform as needed. The key status acquisition request is a request sent by the client or smart key to the API interface of the key management platform to obtain the latest status of the key. This is usually an HTTP request (such as a GET request) that contains the necessary information so that the key management platform can identify the key to be queried and return its current status.

[0123] In one embodiment, in the programs of the client and the smart key, a timer library provided by the programming language is used to set a timer, and an event is triggered after a preset period of time (such as 5 minutes). The event triggers the operation of sending a key status acquisition request. When the timer triggers the event, the client and the smart key construct a key status acquisition request. This request is usually an HTTP GET request, which contains the key ID to be queried. For example, the requested URL can be "https: / / key-management-platform / api / keys?keyId=specific key ID". The client and the smart key use a network communication library or framework to send the constructed request to the API interface of the key management platform. For example, in the programs of the client and the smart key, an HTTP client library can be used to send a request.

[0124] The server of the key management platform receives the key status acquisition request sent by the client and the smart key, extracts the key ID in the request, for example, obtains the key ID from the URL parameter, and uses the database connection library or database driver to query the corresponding key record in the database according to the key ID and obtain the current key status. The key management platform encapsulates the queried key status into a response message and uses the HTTP server framework to return the constructed response message to the client and the smart key.

[0125] The client and smart key receive the response message returned by the key management platform and extract the key status in the response message. The key status in the extracted response message is compared with the key status recorded by itself. If the two are consistent, it means that the key status has not changed; if they are inconsistent, it means that the key status has changed. If the comparison results are consistent, the client and smart key will resend the key status acquisition request after waiting for a preset period of time. If the comparison results are inconsistent, the client and smart key will modify the key status recorded by themselves to the key status extracted from the response message.

[0126] Figure 4 Schematic diagram of a smart lock key management system provided by an embodiment of the present application. Figure 4 As shown, the system specifically includes:

[0127] 401. A key management platform is configured to send key information to a client, mark a key state of the key information as a waiting-for-transmission state, modify the key state to a waiting-for-use state based on feedback from the client that the key state is a waiting-for-use state, and invalidate the key information based on feedback from the smart key that the key state is a completed-use state;

[0128] 402. The client is configured to receive the key information and transmit the key information to the smart key. When the client receives a successful reception result sent by the smart key, the key status is marked as a ready-to-use status and the key status is fed back to the key management platform.

[0129] 403. The smart key is configured to perform identity authentication with the smart lock based on the key information. If the authentication is successful, the smart key marks the key status as a use-completed status and feeds back the key status to the key management platform;

[0130] 404. The smart lock is configured to perform identity authentication with the smart key based on the key information.

[0131] The smart lock key management system provided in the embodiment of the present application corresponds to the smart lock key management method provided in the above embodiment, has the same functional modules and beneficial effects, and will not be repeated here to avoid repetition.

[0132] Figure 5 Schematic diagram of a smart lock key management electronic device provided in an embodiment of the present application. Figure 5 As shown, the device includes a processor 501, a memory 502, an input device 503 and an output device 504; the number of processors 501 in the device can be one or more. Figure 5 A processor 501 is taken as an example; the processor 501, the memory 502, the input device 503 and the output device 504 in the device can be connected by a bus or other means. Figure 5 The example of connecting through a bus is taken. The memory 502, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions or modules corresponding to the cable defect detection method based on image recognition in the embodiment of the present invention. The processor 501 executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory 502, that is, realizes the above-mentioned cable defect detection method based on image recognition. The input device 503 can be used to receive input digital or character information, and generate key signal input related to user settings and function control of the device. The output device 504 may include a display device such as a display screen.

[0133] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.

[0134] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned smart lock key management device embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0135] The processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0136] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0137] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware system, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0138] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

[0139] The above are only preferred embodiments of the present application and the technical principles used. The present application is not limited to the specific embodiments described herein, and various obvious changes, readjustments and substitutions that can be made by those skilled in the art will not deviate from the scope of protection of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the claims.

Claims

1. A smart lock key management method, characterized in that: The method comprises: The key management platform sends the key information to the client and marks the key status of the key information as a waiting-for-transmission status; The client receives the key information and transmits the key information to the smart key. When the client receives a successful reception result sent by the smart key, the key status is marked as a ready-to-use status and the key status is fed back to the key management platform. The smart key and the smart lock perform identity authentication based on the key information. If the authentication is successful, the smart key marks the key status as a use-completed status and feeds back the key status to the key management platform so that the key management platform invalidates the key information.

2. The smart lock key management method according to claim 1, characterized in that: Before the key management platform sends the key information to the client and marks the key state of the key information as a state to be transmitted, the method further includes: The key management platform generates a key according to the key request sent by the client, and associates a unique key ID with the key; The key management platform encapsulates the key, the key ID and a preset key validity period into key information based on an AES encryption algorithm, stores the key information in a database of the key management platform and marks the status information as not transmitted.

3. The smart lock key management method according to claim 2, characterized in that: The key request includes the API key and user identity information added by the client, and before the key management platform sends the key information to the client and marks the key state of the key information as a state to be transmitted, it also includes: The key management platform obtains the API key and the user identity information in the key request, and compares the API key and the user identity information with the security key and security user information pre-stored in the database; When the API key and the user identity information are consistent, the key management platform and the client establish a secure channel; Correspondingly, the key management platform sends the key information to the client and marks the key state of the key information as a state to be transmitted, including: The key management platform sends the key information to the client based on a pre-established secure channel; The key management platform modifies the key state in the database from a non-transmitted state to a to-be-transmitted state.

4. The smart lock key management method according to claim 1, characterized in that: The client receives the key information and transmits the key information to the smart key. When the client receives a successful reception result sent by the smart key, the key status is marked as a ready-to-use status and the key status is fed back to the key management platform, including: The client receives the key information and transmits the key information to the smart key via a pre-established Bluetooth connection; When the client receives a successful reception result sent by the smart key, the client marks the key status in the memory as a waiting-for-use status, and constructs a feedback request including the key ID and the current key status, and sends the feedback request to the key management platform based on a pre-established secure channel, so that the key management platform changes the key status in the database from a waiting-for-transmission status to a waiting-for-use status.

5. The smart lock key management method according to claim 1, characterized in that: The smart key and the smart lock perform identity authentication based on the key information. When the authentication is successful, the smart key marks the key status as a use-completed status and feeds back the key status to the key management platform so that the key management platform invalidates the key information, including: The smart key generates an identity authentication request message based on the key information, and sends the identity authentication request message to the smart lock, wherein the identity authentication request message includes a key ID and encrypted data; The smart lock uses the key information to decrypt the identity authentication request message sent by the smart key, generates a verification response message according to the decrypted data, and sends the verification response message to the smart key; The smart key decrypts the response message based on the key information. If the decrypted verification response data is correct, the identity authentication between the smart key and the smart lock is successful. The smart key marks the key management status as the use-completed status, and constructs a feedback request including the key ID and the current key status, and sends the feedback request to the key management platform based on the pre-established secure channel; The key management platform modifies the key status in the database from a waiting-for-use status to a use-completed status based on the feedback request sent by the smart key, and deletes the key information from the database.

6. The smart lock key management method according to claim 1, characterized in that: The method further comprises: The client sends an HTTP GET access request to the API interface of the key management platform, wherein the request includes the key ID to be queried; After receiving the access request, the key management platform verifies the identity and authority of the client; Under the condition that the client is authorized to access the requested key status, the key management platform queries the storage information of the corresponding key in the database according to the access request, and generates a query result, wherein the query result includes the current status information of the key, the historical key status change information, the key creation time and the last use time of the key; The key management platform encapsulates the query result into an HTTP response and returns it to the client; The client receives the HTTP response, parses the data in the response body, and obtains the query result.

7. The smart lock key management method according to claim 6, characterized in that: The method further comprises: The client and the smart key send a key status acquisition request to the API interface of the key management platform based on a preset period of time, wherein the key status acquisition request includes a key ID; The key management platform queries the current key state of the key in the database based on the key ID and encapsulates the key state into a response message and returns it to the client and the smart key; The client and the smart key extraction response message compare the key status with the key status recorded by themselves. If the comparison results are consistent, a key status acquisition request is re-sent to the API interface of the key management platform after a preset time period. If the comparison results are inconsistent, the key status recorded by itself is modified to the key status extracted from the response message.

8. A smart lock key management system, characterized in that: The system comprises: The key management platform is configured to send the key information to the client, mark the key status of the key information as a waiting-for-transmission status, modify the key status to a waiting-for-use status based on the key status fed back by the client as a waiting-for-use status, and invalidate the key information based on the key status fed back by the smart key as a completed-use status; The client is configured to receive the key information and transmit the key information to the smart key. When the client receives a successful reception result sent by the smart key, the key status is marked as a ready-to-use status and the key status is fed back to the key management platform. A smart key, configured to perform identity authentication with the smart lock based on the key information. If the authentication is successful, the smart key marks the key status as a use-completed status and feeds back the key status to the key management platform; The smart lock is configured to perform identity authentication with the smart key based on the key information.

9. A smart lock key management device, the device comprising: one or more processors; A storage device, used to store one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the smart lock key management method as described in any one of claims 1-7.

10. A storage medium storing computer executable instructions, wherein the computer executable instructions are used to execute the smart lock key management method as described in any one of claims 1 to 7 when executed by a computer processor.

Citation Information

Patent Citations

  • VPN secure access method and system thereof

    CN101447907A

  • Mobile Internet virtual key authorizing system and hardware door lock control method thereof

    CN105871874A

  • Mobile terminal, server, vehicle and control system

    CN106408700A

  • Secret key updating method and system

    CN106533659A

  • A digital certificate processing method and device based on a digital certificate authentication system

    CN109829282A

Cited By

  • Digital key access authentication method and device, terminal equipment and storage medium

    CN120582912A

  • Digital key access authentication method and device, terminal equipment and storage medium

    CN120582912B