Self-driving management method of intelligent lock based on internet of things technology
By implementing three-level energy threshold management, dual-path energy acquisition, two-way authentication, and blockchain-based evidence storage at the lock end, the problems of inaccurate energy management, untimely permission updates, and unreliable data in passive smart locks have been solved, thereby improving the reliability and security of passive smart locks.
Patent Information
- Application Number
- CN202610610338.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-06
- Publication Date
- 2026-06-16
AI Technical Summary
Existing passive smart locks suffer from problems such as inaccurate energy management, untimely access control updates, unreliable status reporting, and the risk of data tampering, making it impossible to achieve keyless unlocking, autonomous status reporting, and secure and reliable management.
It employs a three-level time-series matching energy threshold, a press-type dual-path energy acquisition, two-way authentication, an asynchronous mechanism, and blockchain storage at the lock end to ensure accurate energy management, timely permission updates, reliable status reporting, and tamper-proof data.
This has improved the reliability and security of passive smart locks, solved problems such as insufficient energy, expired permissions, communication failures and data tampering, and ensured the integrity and security of operation records.
Smart Images

Figure CN122223818A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of smart lock management technology, and in particular to a self-driven management method for smart locks based on Internet of Things (IoT) technology. Background Technology
[0002] With the development of IoT technology, passive smart locks, due to their advantages of not requiring built-in batteries and being easy to install and maintain, are widely used in the management of outdoor equipment cabinets in industries such as power and communications. Existing passive smart locks are mainly divided into two categories: The first category is passive locks based on smart keys, which provide instantaneous power and communication to the lock when unlocking via a smart key. The drawbacks of this type of solution are: it still requires carrying a physical smart key, leading to problems with lost, copied, and inconvenient key handover; the lock loses power immediately after unlocking, making it impossible for the management platform to autonomously report the lock's status after the operation, thus preventing real-time monitoring of the lock's status. The second category is passive locks based on mobile phone NFC, which use the NFC radio frequency signal of the mobile phone to power the lock, achieving unlocking without a physical key. The drawbacks of this type of solution are: inaccurate energy management, easily leading to interruptions in authentication or unlocking due to insufficient energy; untimely permission updates, as the lock can only passively receive permission updates when unlocking, and permission data expires if not used for a long time; unreliable status reporting, with no effective retransmission or local storage mechanism after communication failure; and operation records stored on a centralized server, posing a single point of failure and the risk of data tampering.
[0003] While some existing solutions employ door handle mechanical energy harvesting technology to supplement energy, the harvested energy can only support a single unlocking authentication and cannot support the wireless communication module to complete status reporting. Some solutions use blockchain notarization technology, but only store the hash value of the operation record, which cannot achieve complete traceability verification. Therefore, there is an urgent need for a passive smart lock self-driven management method that can achieve precise energy management, timely access control updates, reliable status reporting, and tamper-proof records. Summary of the Invention
[0004] This invention provides a self-driven management method for smart locks based on Internet of Things (IoT) technology. It achieves precise energy control through three-level time-series matching of energy thresholds, solves the problem of insufficient energy by using a press-type dual-path energy acquisition, enhances security through two-way authentication, avoids deadlock by using an asynchronous mechanism of operation before reporting, and ensures data immutability through blockchain storage with direct signature at the lock end. This comprehensively improves the reliability and security of passive smart locks.
[0005] This invention provides a self-driven management method for smart locks based on Internet of Things (IoT) technology, comprising: Step 1: Energy self-sensing and graded wake-up control: The smart lock is in deep sleep mode by default, with only the energy harvesting module and voltage detection circuit working passively; When the user's mobile terminal enters the effective range of near-field communication, the near-field radio frequency rectification unit of the energy harvesting module receives the radio frequency signal and converts it into DC power to charge the energy storage module. The stored energy is determined by an energy threshold trigger formula, and when the first wake-up energy threshold is reached... When the signal is activated, the control unit will be switched to the working state. Step 2: Energy Assurance Determination and Two-Way Authentication Control: The control unit reads the real-time energy of the energy storage module and verifies whether the second authentication energy threshold has been reached using an energy threshold trigger formula. ; If the target is not met, the power will be continuously replenished; if the target is met, the near-field communication module will be activated to establish an encrypted data link and perform two-way random number signature authentication between the lock and the user's mobile terminal. Step 3: Local Dynamic Permission Verification and Control: After successful authentication, the control unit receives the unlocking task request data packet sent by the user's mobile terminal and performs four layers of local verification based on the dynamic permission verification formula: lock status, authorization time window, task-role mapping, and prerequisite task conditions. If all checks pass, proceed to step 4; otherwise, return a permission denial response and generate a local exception event record. Step 4: Lock body execution and status synchronization reporting control: After the permission verification is passed, the control unit sends a drive command carrying the action direction parameter to the drive module to drive the lock tongue to perform the unlocking or locking action, and at the same time starts the status feedback timer; The validity of the lock body status feedback is determined by the status validity determination formula. If it is normal, a status change event data packet is generated; if it is abnormal, a corresponding type of abnormal event data packet is generated. The control unit activates the IoT wireless communication module, first reports the event data packet to the management platform, then sends a permission update request to the management platform, receives and verifies the permission update data packet, and then reports the event data packet to the management platform; if the reporting fails, a retransmission mechanism is initiated. Step 5: Operation record blockchain evidence storage control: The management platform performs integrity verification and lock signature verification on the reported data packets. After verification, the data is encapsulated according to the preset on-chain data structure and submitted to the blockchain evidence storage terminal. Step 6: Post-task energy management and hibernation control: After reporting is completed, the control unit reads the remaining energy of the energy storage module. If the remaining energy is higher than the safe energy threshold... It will then directly enter a deep hibernation state; If the remaining energy is less than or equal to It will then immediately enter a deep sleep state, waiting for the next near-field communication to trigger wake-up.
[0006] Preferably, the energy threshold triggering formula is: ; in, The safe energy threshold; This is the total energy margin coefficient, with a value ranging from 1.2 to 1.5; The energy required to power on and initialize the control unit; Energy required for two-way identity authentication; Energy required for the operation of the lock body actuator; Energy required for IoT wireless communication reporting and permission updates; The total energy loss of the system includes rectification loss, leakage current loss, and wire loss; The third-level energy threshold is satisfied: , ,and ; Additional energy margin for the certification process. Additional energy margin for the awakening process.
[0007] Preferably, the specific process of the two-way random number signature authentication includes: Step 21: The control unit generates a 128-bit hardware true random number R1, extracts the locally pre-stored digital certificate of the lock end, packages R1 and the digital certificate of the lock end into a first authentication request message, and sends it to the user's mobile terminal through a near-field communication encrypted data link; Step 22: After receiving the first authentication request message, the user's mobile terminal verifies the validity of the digital certificate on the lock end, including certificate chain verification, validity period verification, and local cached CRL revocation status query. If the verification fails, the connection is disconnected and the authentication process is terminated. The CRL is generated daily by the management platform and synchronized to the lock end and the user's mobile terminal through permission update data packets. Step 23: After verification, the user's mobile terminal signs R1 using the locally stored user's private key according to the signature algorithm mode specified by the management platform, generates the first signature data Sig1, and returns Sig1 and the user's digital certificate to the control unit. The signature algorithm mode includes the standard SM2 signature mode and the enhanced geometric coding signature mode. Step 24: The control unit extracts the user's public key from the user's digital certificate and uses the user's public key to verify the signature of Sig1; if the signature verification fails, the authentication process is terminated and the exception is recorded. If the signature verification is successful, a signature verification success confirmation message will be sent to the user's mobile terminal; Step 25: After the signature verification is successful, the user's mobile terminal generates a 128-bit hardware true random number R2 and sends it to the control unit; Step 26: The control unit uses the lock end private key stored in the local security element to sign R2 using the same signature algorithm mode as in step 23, generates second signature data Sig2, and returns it to the user's mobile terminal. Step 27: The user's mobile terminal uses the verified lock end public key to verify the signature of Sig2. If the signature verification is successful, the two-way identity authentication is successfully completed.
[0008] Preferably, the dynamic permission verification formula is: Where: P is the permission boolean value, 1 = pass, 0 = deny; The lock status verification result is as follows: lock normal = 1, lock abnormal = 0; For the authorization time window verification result, the request time is set to 1 if it is within the valid window, and 0 otherwise. The result of the task-role mapping verification is: if the user role has the corresponding task permission, =1; otherwise, =0. The result is the conditional verification result of the prerequisite tasks. If all prerequisite tasks have been completed, the result is 1; otherwise, the result is 0. The result of the permission version verification is 1 if the local permission version has not expired, and 0 otherwise. The verification is performed in the order of priority: lock status, version permissions, authorization time, role permissions, and preconditions, and the reason code of the first failed item is returned. The authorized time window adopts the UTC time format and supports two modes: absolute time window and recurring periodic time window; the task-role mapping adopts a three-level permission granularity, including global permissions, regional permissions, and single lock permissions.
[0009] Preferably, the formula for determining the validity of the state is: ; in, The status validity indicator is as follows: 1 = normal, 0x01 = no feedback after timeout, 0x02 = invalid signal, 0x03 = bolt not in position, 0x04 = motor stalled. The actual duration of lock body status feedback is calculated from the moment the drive command is sent. The preset state feedback timer threshold; This is a flag indicating the validity of the sensor signal; the signal value is 1 if the signal is within the valid level range, and 0 otherwise. This refers to the actual position of the bolt, and the target position is either the unlocked or locked position. This refers to the actual operating current of the drive motor. This is the threshold value for the stall current of the motor.
[0010] Preferably, the retransmission mechanism includes: If the IoT wireless communication module fails to report, the control unit immediately initiates the first retransmission. If the first retransmission fails, wait n0 seconds and then start the second retransmission. If the initial report and two retransmissions both fail, the event data packet is stored in local memory and reported in batches when the communication connection is successfully established again.
[0011] Preferably, the process by which the near-field radio frequency rectifier unit of the energy harvesting module receives radio frequency signals and converts them into DC power to charge the energy storage module includes: Based on the real-time detection of the output power of the near-field radio frequency rectifier unit by the energy harvesting module, when the output power is greater than the preset power threshold, the energy storage module is charged only by the near-field radio frequency rectifier unit. When the output power is less than or equal to the preset power threshold, the power supply circuit of the press-type piezoelectric mechanical energy acquisition unit is automatically turned on, and it charges the energy storage module together with the near-field radio frequency rectifier unit. The press-type piezoelectric mechanical energy acquisition unit is installed on the surface of the door handle, and the piezoelectric ceramic sheet is triggered to generate electrical energy when the user presses the door handle. The two energy harvesting paths are connected in parallel via a diode isolation circuit.
[0012] Preferably, the verification process for the prerequisite task conditions includes: Extract the task type code from the unlocking task request data packet, query the local storage of the preceding task association table, and obtain all preceding task identifiers bound to this task type. When multiple prerequisite tasks are related by a logical AND relationship and all have been completed, or by a logical OR relationship and at least one has been completed, ,otherwise ; The status of the pre-processing tasks is synchronized from the management platform to the lock's local storage in each permission update data packet.
[0013] Preferably, in the enhanced geometric coding signature mode, the user mobile terminal uses the locally stored user private key to sign R1, generating first signature data Sig1, including: The polynomial factorization structure of the private key is obtained by consisting of n independent private key components, each component corresponding to a linear mapping polynomial. ,in, , The coefficients are integers between 0 and 255, and the coefficient combination is the set of coefficients of all mapping polynomials. , i=1,2,...,n; Perform an SM3 hash operation on the 128-bit hardware true random number R1, and convert the last byte of the hash value into an 8-bit unsigned integer. Let the radius of the circle be With the origin O(0,0) of the Cartesian coordinate system as the center, and... Draw a circle with radius The coefficients of each mapping polynomial As coefficient point Attached to the circle In the standard rectangular coordinate system; Determine the circle The midpoints of the line segments formed by the intersections of the angle bisectors of the four upper quadrants and the circle are taken as the quadrant center points, and their rectangular coordinates are respectively... , , ; Calculate each coefficient point separately The Euclidean distances to the centers of the four quadrants are selected, and the minimum value is chosen from the four initial distances of the points with the same coefficient. ; according to Calculate the first coded value for each coefficient point. ,in, This is the floor function; It is an 8-bit unsigned integer and ; From the interval Randomly select an integer L as the side length, and draw a square with the origin O(0,0) as the bottom left vertex. The coordinates of its four vertices are O(0,0), A(L,0), B(L,L), and D(0,L). All coefficient points By attaching the line to the standard rectangular coordinate system containing the square and applying the least squares method to perform a linear fit on all coefficient points, the equation of the fitted line is obtained. Where k is the slope and c is the intercept; Calculate the top right corner vertex of the square To the circle shortest distance ,like Then take ; Set the x-coordinate of the coefficient point Substituting the values into the fitted line equation yields the corresponding vertical coordinates. ; according to Calculate the second encoded value for each coefficient point. ,like Then take , It is an 8-bit unsigned integer; For each coefficient point, calculate the addition combination. Combinations of sum and subtraction ,in, To ensure the modulo operation, the result is an 8-bit unsigned integer; All coefficient points are added and subtracted sequentially and then concatenated with the SM3 hash value of the 128-bit random number R1, the side length L of the square, and the fitted line parameters (k, c) to generate the first signature data Sig1, whose structure is as follows: ,in, This indicates a byte concatenation operation.
[0014] Compared with the prior art, the beneficial effects of this application are as follows: 1. Energy Management: A three-level timing matching energy threshold is adopted, which first wakes up quickly at a low threshold and then replenishes energy to the full-process safety threshold, solving the problems of slow wake-up and energy waste in the original solution; a press-type piezoelectric acquisition is adopted, which can be pre-charged before authentication, solving the problem of incorrect timing of piezoelectric acquisition in the original solution.
[0015] 2. Identity Authentication: Add context information (lock ID, timestamp, counter) to prevent replay attacks; adopt OCSP+CRL dual certificate verification to shorten the certificate validity period to 7 days and solve the problem of CRL expiration in the original solution; supplement the complete verification logic of enhanced geometric coding signature to ensure that the algorithm is feasible.
[0016] 3. Permission Verification: Added mandatory verification of permission version; operations will be rejected if the version has not been updated for more than 7 days; adjusted the verification priority to prioritize the verification of permission version, resolving the issue of expired permissions still being usable in the original solution; synchronized UTC time to lock RTC during each authentication, resolving the issue of time synchronization failure.
[0017] 4. Execution and Reporting: The operation of the lock body is changed to be performed first, followed by the synchronous reporting of permissions to ensure that core functions are prioritized; the formula for judging the validity of the status is optimized to distinguish between motor stall and idling, avoiding misjudgment; a hierarchical priority retransmission and batch reporting mechanism is adopted to ensure that important events are reported first.
[0018] 5. Blockchain Evidence Storage: The lock device directly signs the complete on-chain data structure, and the management platform is only responsible for forwarding it, which solves the problem of data tampering in the original solution.
[0019] 6. Exception Handling: Improve the closed loop for handling all exception scenarios, including continuous authentication failure locking, local storage overflow handling, and permission update breakpoint resume, etc.; supplement the complete locking process to achieve symmetry between locking and unlocking logic.
[0020] Other features and advantages of the invention will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the written description and the accompanying drawings.
[0021] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0022] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1 This is a flowchart of a smart lock self-driving management method based on Internet of Things (IoT) technology in an embodiment of the present invention. Detailed Implementation
[0023] The preferred embodiments of the present invention will be described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.
[0024] This invention provides a self-driven management method for smart locks based on Internet of Things (IoT) technology, such as... Figure 1 As shown, it includes: Step 1: Energy self-sensing and graded wake-up control: The smart lock is in deep sleep mode by default, with only the energy harvesting module and voltage detection circuit working passively; When the user's mobile terminal enters the effective range of near-field communication, the near-field radio frequency rectification unit of the energy harvesting module receives the radio frequency signal and converts it into DC power to charge the energy storage module. The stored energy is determined by an energy threshold trigger formula, and when the first wake-up energy threshold is reached... When the signal is activated, the control unit will be switched to the working state. Step 2: Energy Assurance Determination and Two-Way Authentication Control: The control unit reads the real-time energy of the energy storage module and verifies whether the second authentication energy threshold has been reached using an energy threshold trigger formula. ; If the target is not met, the power will be continuously replenished; if the target is met, the near-field communication module will be activated to establish an encrypted data link and perform two-way random number signature authentication between the lock and the user's mobile terminal. Step 3: Local Dynamic Permission Verification and Control: After successful authentication, the control unit receives the unlocking task request data packet sent by the user's mobile terminal and performs four layers of local verification based on the dynamic permission verification formula: lock status, authorization time window, task-role mapping, and prerequisite task conditions. If all checks pass, proceed to step 4; otherwise, return a permission denial response and generate a local exception event record. Step 4: Lock body execution and status synchronization reporting control: After the permission verification is passed, the control unit sends a drive command carrying the action direction parameter to the drive module to drive the lock tongue to perform the unlocking or locking action, and at the same time starts the status feedback timer; The validity of the lock body status feedback is determined by the status validity determination formula. If it is normal, a status change event data packet is generated; if it is abnormal, a corresponding type of abnormal event data packet is generated. The control unit activates the IoT wireless communication module, first reports the event data packet to the management platform, then sends a permission update request to the management platform, receives and verifies the permission update data packet, and then reports the event data packet to the management platform; if the reporting fails, a retransmission mechanism is initiated. Step 5: Operation record blockchain evidence storage control: The management platform performs integrity verification and lock signature verification on the reported data packets. After verification, the data is encapsulated according to the preset on-chain data structure and submitted to the blockchain evidence storage terminal. Step 6: Post-task energy management and hibernation control: After reporting is completed, the control unit reads the remaining energy of the energy storage module. If the remaining energy is higher than the safe energy threshold... It will then directly enter a deep hibernation state; If the remaining energy is less than or equal to It will then immediately enter a deep sleep state, waiting for the next near-field communication to trigger wake-up.
[0025] Preferably, the energy threshold triggering formula is: ; in, The safe energy threshold; This is the total energy margin coefficient, with a value ranging from 1.2 to 1.5; The energy required to power on and initialize the control unit; Energy required for two-way identity authentication; Energy required for the operation of the lock body actuator; Energy required for IoT wireless communication reporting and permission updates; The total energy loss of the system includes rectification loss, leakage current loss, and wire loss; The third-level energy threshold is satisfied: , ,and ; Additional energy margin for the certification process. Additional energy margin for the awakening process.
[0026] In this embodiment, Values 60%~80%, The value is 80%~120%.
[0027] In this embodiment, the smart lock terminal includes: Control unit: STM32L476RG low-power MCU, ARM Cortex-M4F core, 80MHz main frequency, deep sleep power consumption Built-in hardware true random number generator; Dual-path energy harvesting module: The near-field radio frequency rectification unit uses the NFC radio frequency chip RC522 with a rectification efficiency of 45%; the push-type piezoelectric mechanical energy harvesting unit uses a PZT-5H piezoelectric ceramic sheet, measuring 20mm×20mm×0.5mm, installed on the door handle surface, and can output energy with a single rotation. ; Energy storage module: 1000 / 5.5V supercapacitor, self-discharge rate ≤1% / day, charge-discharge cycle count ≥10000 times; Near Field Communication Module: NFC module, supports ISO14443A standard, communication distance ≤10cm; IoT wireless communication module: NB-IoT module BC95, PSM mode power consumption 5μA, single reporting time ≤1 second; Lock status sensing module: Dual Hall position sensor A3144, which detects the unlocked and locked positions of the bolt respectively; Drive module: JGA25-370 DC geared motor, rated voltage 3.3V, output torque 10k. The stall current is 250mA. Current detection module: Uses INA219 current sensor to detect the operating current of the drive motor; Real-time clock module: Uses PCF8563 low-power RTC chip, with a supercapacitor as backup power; Security element: Employs an SE chip to store digital certificates and private keys; Memory: Flash memory W25Q80, capacity 8Mbit, divided into boot area, firmware area, permission data area and event storage area.
[0028] User mobile terminal: A smartphone that supports NFC and has a built-in secure element to store digital certificates and private keys.
[0029] Management platform: cloud server, deploying the permission management system, data verification system, and alarm management system.
[0030] Blockchain evidence storage: Consortium blockchain, using the PBFT consensus algorithm, and smart contracts written in Solidity.
[0031] In this embodiment, the drive instruction is a 1-byte binary data, with the high 4 bits being the instruction type code (0x01=unlock, 0x02=lock, 0x03=emergency stop) and the low 4 bits being the action direction parameter (0x01=forward, 0x02=reverse). For example, the unlock instruction is encoded as 0x11, and the lock instruction is encoded as 0x22.
[0032] In this embodiment, the status feedback timer uses the hardware timer TIM2 built into the control unit, with a clock source of a 32kHz low-speed internal clock and a timing accuracy of 1ms. When a drive command is sent, the control unit sets the timer preload value to 2000 (corresponding to a 2-second timeout) and enables the timer update interrupt; if a latch position signal is received before the interrupt is triggered, the timer is turned off and the interrupt flag is cleared; if no valid feedback is received when the interrupt is triggered, it is determined that there has been a timeout and no feedback has been received.
[0033] In this embodiment, the permission update request data packet (lock end → platform end) is shown in Table 1: Table 1. Fields of the Permission Update Request Data Packet In this embodiment, the permission update data packet (platform side → lock side) is shown in Table 2: Table 2. Fields of the Permission Update Data Packet Local abnormal events use a circular overwrite storage mechanism, storing a maximum of 100 records; important abnormal events (forced unlocking, motor stall, three consecutive authentication failures) are marked as non-overwriteable, and when the storage space is full, only the earliest ordinary abnormal record is overwritten.
[0034] In this embodiment, the value of k1 is determined based on the system's operating ambient temperature range. When the ambient temperature is -20℃ to 60℃, k1 is 1.2; when the ambient temperature is -40℃ to 85℃, k1 is 1.5; and 1.3 is recommended for normal temperature environments (0℃ to 40℃). The management platform can send a k1 value adjustment command to the lock terminal through a permission update data packet based on the historical temperature data of the lock's installation location. The lock terminal updates its local k1 value after verifying the command signature.
[0035] In this embodiment, the energy self-sensing and graded wake-up control anomaly handling is as follows: If the user's mobile terminal moves out of the effective range of near-field communication during charging, causing an interruption of radio frequency energy, the control unit immediately connects the current stored energy with the... Compare them. If the stored energy is higher than... If it is below, then continue with the next steps; if it is below If the current system state (including charging progress and wake-up flag) is not reached, the system will save the current system state to the backup area of non-volatile memory, then shut down all peripherals and enter deep sleep mode. Upon the next wake-up, the control unit will first read the state data from the backup area and continue executing the unfinished charging and wake-up process from the point of interruption.
[0036] In this embodiment, the energy security determination and two-way authentication anomaly handling are as follows: If two-way authentication fails three times consecutively, the control unit immediately generates a "consecutive authentication failure" anomaly record, marks it as an important and non-overwriteable event, and locks the lock for 10 minutes. During the locking period, the control unit rejects any near-field communication requests, retaining only energy harvesting and voltage detection functions. After 10 minutes, the lock automatically unlocks and returns to normal operation.
[0037] In this embodiment, the lock body performs abnormal reporting of status synchronization: if energy is exhausted during the permission update process, the control unit immediately saves the unreported event data packets to the event storage area and saves the intermediate state of the permission update (such as the length and version number of the received permission data). After the next wake-up, the control unit first sends a breakpoint resume request to the management platform to continue receiving permission update data from the last interrupted position, and then reports the event data packets after completion.
[0038] In this embodiment, ,in, For rectification loss, ,in, For NFC radio frequency input power, The rectification efficiency is 45% in this embodiment. This refers to charging time; For leakage current loss, , The leakage current of the supercapacitor (in this embodiment) ); The average voltage of the supercapacitor; This represents the total duration of a single operation. For conductor loss, , The average operating current of the system. The total resistance of the conductors (≤0.1Ω in this embodiment); This provides an additional energy margin for the wake-up process, such as the energy required for the control unit's power-on initialization. The 100% limit is used to handle voltage fluctuations that may occur during the wake-up process; in this embodiment... Therefore ; This is an additional energy margin for the authentication process, and its value is the energy required for two-way identity authentication. 67% is allocated to handle a potential data retransmission during the authentication process; in this embodiment... Therefore .
[0039] Core parameter calibration: The actual power consumption at each stage was measured experimentally. (Control unit power-on initialization); (Two-way authentication); (The lock body actuator moves); (NB-IoT permission update request + data packet reporting); (Total system losses); When k1=1.3, ; (Extra energy margin during the wake-up process); (Additional energy margin during the certification process); (First wake-up threshold: Upon reaching this threshold, the control unit is woken up and initialization is performed.) (Second certification threshold: certification is initiated after initialization is complete and energy levels meet the requirements). Available energy of a supercapacitor (charged to 3.3V, discharged to 2.2V): The energy consumption is far greater than the total energy consumption, and the energy supply and demand are in balance.
[0040] It should be noted that when the user's phone is brought close, it will first charge to... Wake up the MCU; charging continues during MCU initialization; charging will resume once initialization is complete and the energy reaches [a certain level]. Only when necessary will the energy-intensive identity authentication process be initiated to avoid running out of energy during the authentication process; This is the actual energy consumption during MCU initialization, which only occurs after wake-up. Therefore, it should be included in the energy requirements during the certification phase, not the wake-up phase.
[0041] In this embodiment, energy self-sensing and graded wake-up control: When a user brings an NFC-enabled smartphone close to the lock, and it enters a 10cm effective range, the phone's NFC radio frequency signal is received by the lock's near-field radio frequency rectification unit and converted into DC power. Supercapacitor charging. A voltage detection circuit monitors the supercapacitor voltage in real time; when the stored energy reaches 1045 kWh... When the voltage is approximately 2.9V, a wake-up signal is output to the control unit, and the control unit switches from deep sleep state to working state, completing the power-on initialization.
[0042] If the user's phone moves out of the effective range during charging, the radio frequency power is interrupted, and the control unit will activate when the stored energy drops to a certain level. The system will automatically enter deep sleep mode and will not perform any erroneous actions.
[0043] Energy Security Assessment and Two-Way Authentication Control: After the control unit is activated, it first reads the real-time energy storage of the supercapacitor to determine whether it has reached 1045. (Corresponding voltage is approximately 2.8V). If this threshold is not reached, the system will remain in a waiting state and continue charging via NFC radio frequency power until the authentication threshold is reached.
[0044] Once the energy storage capacity reaches the target, the control unit activates the NFC module to establish an encrypted data link with the user's mobile phone and perform two-way SM2 digital certificate authentication.
[0045] Local dynamic permission verification and control: After successful authentication, the user's mobile phone sends an unlocking task request data packet to the lock, which includes the user's identity identifier, the target lock identifier, the request timestamp, the task type, and the digital signature.
[0046] The control unit first verifies the digital signature of the data packet to confirm that the data has not been tampered with and originates from an authenticated user. Then, it performs four layers of local permission verification according to priority: Lock status verification: Check whether the lock is in normal condition. If it is in an alarm or fault state, reject the lock. Authorization time window verification: Checks whether the request time is within the user's valid authorization time window; Task-role mapping verification: Check whether the user role has the permission to execute the task. For example, an inspector can only perform inspection unlocking, while a maintenance engineer can perform maintenance unlocking and emergency unlocking. Prerequisite task condition verification: Check whether the prerequisite tasks associated with this task have been completed, such as whether the maintenance work order associated with the lock maintenance has been approved.
[0047] If all checks pass, proceed to the lock body execution steps; otherwise, return a permission denial response containing the specific failure reason code and generate a local exception event record.
[0048] Lock body execution and status synchronization reporting control: After the authorization verification is successful, the control unit sends an unlocking command to the drive module, and the drive motor rotates to retract the bolt. At the same time, a 2-second status feedback timer is started, and the motor operating current is monitored in real time through the current detection module.
[0049] The dual Hall effect position sensors detect the bolt position in real time, and send a position signal to the control unit when the bolt reaches the unlock position.
[0050] The control unit determines the operation result based on the state validity determination formula: If a valid arrival signal is received within 2 seconds and the motor current does not exceed the stall threshold, a status change event data packet is generated, and the status code is marked as 1 (normal). If no feedback signal is received within 2 seconds, the status code will be marked as 0x01 (no feedback timed out). If the received signal level is outside the 2.0-3.3V range, the status code will be marked as 0x02 (invalid signal). If the bolt does not reach the target position and the motor current does not exceed the stall threshold, the status code is marked as 0x03 (bolt not in position). If the motor current exceeds the 250mA stall threshold, the motor power supply will be immediately cut off, and the status code will be marked as 0x04 (motor stall).
[0051] The control unit activates the NB-IoT module and first sends a permission update request to the management platform. Upon receiving the request, the management platform sends the latest permission update data packet to the lock. The lock verifies the validity of the platform signature; if successful, it updates the permission data in its local Flash memory and returns a successful update confirmation to the platform. Then, the control unit signs the event data packet using the lock's private key with SM2 and reports it to the management platform. If the report fails, a first retransmission is initiated immediately; if the first retransmission fails, a second retransmission is initiated after 10 seconds; if all three retransmissions fail, the data packet is stored in the local Flash memory and reported in batches upon the next successful communication.
[0052] Operation record blockchain evidence storage control: After receiving the data packet, the management platform first verifies the validity of the digital signature on the lock end to confirm that the data source is authentic and has not been tampered with. Then, it extracts the key fields from the data packet and encapsulates them according to the preset on-chain data structure. The on-chain data includes: operation event number, user identity identifier SHA-256 hash value, lock identifier SHA-256 hash value, operation type code, operation timestamp, and operation result status code.
[0053] The management platform generates a notarization transaction request, calls the smart contract interface of the blockchain notarization terminal, and submits the notarization data to the consortium blockchain network. Consortium blockchain nodes use the PBFT consensus algorithm to verify and package the transaction, writing it into the distributed ledger. The blockchain notarization terminal returns a unique transaction hash value to the management platform.
[0054] The management platform associates the transaction hash value with the local storage entry of this operation record, forming a complete traceability chain from the IoT terminal to the blockchain terminal. Users or administrators can query the operation record in the blockchain explorer using the transaction hash value to verify its authenticity and completeness.
[0055] Post-task energy management and sleep control: After the report is completed, the control unit shuts down all peripherals (including NFC module, NB-IoT module, motor drive module, and sensor module) and immediately enters deep sleep state, waiting to be woken up by NFC radio frequency energy when the user's mobile phone is near again.
[0056] In this embodiment, the pre-task association table is stored in JSON format, and the logical relationship is identified by the "relation" field, where "AND" represents logical AND and "OR" represents logical OR.
[0057] The pre-defined on-chain data structure includes: Event Unique Identifier: UUID format, generated by the lock; User Identity Hash: SHA-256 hash value of the user's identity; Lock Identity Hash: SHA-256 hash value of the lock's unique identifier; Operation Type Encoding: 1 = Unlock, 2 = Lock, 3 = Abnormal Alarm; Operation Timestamp: UTC timestamp, accurate to the second; Operation Result Status Code: along with a status validity flag. Consistency; Lock end signature: SM2 digital signature of the above fields; The management platform encapsulates the above data into a notarized transaction, calls the smart contract interface of the blockchain notarization end to submit it to the consortium blockchain network, the consortium blockchain adopts the PBFT consensus algorithm, and the transaction confirmation time is ≤3 seconds.
[0058] This invention provides a self-driven management method for smart locks based on Internet of Things (IoT) technology. The specific process of the two-way random number signature authentication includes: Step 21: The control unit generates a 128-bit hardware true random number R1, extracts the locally pre-stored X.509v3 format lock terminal digital certificate, packages R1 and the lock terminal digital certificate into a first authentication request message, and sends it to the user's mobile terminal through a near-field communication encrypted data link. Step 22: After receiving the first authentication request message, the user's mobile terminal verifies the validity of the digital certificate on the lock end, including certificate chain verification, validity period verification, and local cached CRL revocation status query. If the verification fails, the connection is disconnected and the authentication process is terminated. The CRL is generated daily by the management platform and synchronized to the lock end and the user's mobile terminal through permission update data packets. Step 23: After verification, the user's mobile terminal signs R1 using the locally stored user's private key according to the signature algorithm mode specified by the management platform, generates the first signature data Sig1, and returns Sig1 and the user's digital certificate to the control unit. The signature algorithm mode includes the standard SM2 signature mode and the enhanced geometric coding signature mode. Step 24: The control unit extracts the user's public key from the user's digital certificate and uses the user's public key to verify the signature of Sig1; if the signature verification fails, the authentication process is terminated and the exception is recorded. If the signature verification is successful, a signature verification success confirmation message will be sent to the user's mobile terminal; Step 25: After the signature verification is successful, the user's mobile terminal generates a 128-bit hardware true random number R2 and sends it to the control unit; Step 26: The control unit uses the lock end private key stored in the local security element to sign R2 using the same signature algorithm mode as in step 23, generates second signature data Sig2, and returns it to the user's mobile terminal. Step 27: The user's mobile terminal uses the verified lock end public key to verify the signature of Sig2. If the signature verification is successful, the two-way identity authentication is successfully completed.
[0059] In this embodiment, the offline implementation of CRL revocation status query is as follows: The management platform generates the latest Certificate Revocation List (CRL) daily and synchronizes it to the local Flash memory of all online lock terminals via permission update data packets. The CRL is valid for 7 days. When a user's mobile terminal verifies the digital certificate of the lock terminal, it first checks whether a valid CRL is cached locally. If so, it directly queries the revocation status locally; if not, it downloads the latest CRL from the management platform via the mobile internet and caches it. The lock terminal does not participate in CRL query during the authentication process; it is only responsible for receiving CRL data synchronized from the platform.
[0060] Lock-side digital certificate format requirements: The lock-side digital certificate adopts the X.509v3 standard format, and the signature algorithm is SM2-with-SM3. The certificate extension fields include the lock's unique identifier, manufacturer, hardware version number, and firmware version number. The certificate is pre-stored in the lock-side security element and cannot be tampered with or exported.
[0061] The specific process of SM2 digital signature: Signing process: The data to be signed is first generated into a 256-bit hash value using the SM3 hash algorithm, and then the hash value is signed using the private key using SM2 to generate 64 bytes of signature data.
[0062] Verification process: Use the public key to perform SM2 verification on the signed data, recover the hash value, and compare it with the SM3 hash value of the data to be signed. If they match, the verification is successful.
[0063] In this embodiment, 128-bit hardware true random numbers are used instead of 256-bit. This reduces the computational load and energy consumption of random number generation, hash operation, and data transmission while meeting the national cryptographic security strength requirements. It achieves the optimal balance between security level and low power consumption characteristics, and is more suitable for energy-constrained scenarios of passive smart locks.
[0064] This invention provides a self-driven management method for smart locks based on Internet of Things (IoT) technology, wherein the dynamic permission verification formula is: Where: P is the permission boolean value, 1 = pass, 0 = deny; The lock status verification result is as follows: lock normal = 1, lock abnormal = 0; For the authorization time window verification result, the request time is set to 1 if it is within the valid window, and 0 otherwise. The result of the task-role mapping verification is: if the user role has the corresponding task permission, =1; otherwise, =0. The result is the conditional verification result of the prerequisite tasks. If all prerequisite tasks have been completed, the result is 1; otherwise, the result is 0. The result of the permission version verification is 1 if the local permission version has not expired, and 0 otherwise. The verification is performed in the order of priority: lock status, version permissions, authorization time, role permissions, and preconditions, and the reason code of the first failed item is returned. The authorized time window adopts the UTC time format and supports two modes: absolute time window and recurring periodic time window; the task-role mapping adopts a three-level permission granularity, including global permissions, regional permissions, and single lock permissions.
[0065] The task-role mapping table is a structured data table stored in the local Flash memory permission data area of the lock terminal. It defines the authorization correspondence between different user roles and executable task types, and specifies the permission granularity level for each authorization item. This table is maintained uniformly by the management platform and synchronized to the lock terminal via permission update data packets. The lock terminal only has read-only permissions and cannot modify it locally, as shown in Table 3: Table 3 Task-Role Mapping Table In this embodiment, single lock permission (0x01): The user can only operate the single lock specified by the permission scope identifier, which is applicable to temporary authorization or exclusive operation permissions for specific devices; area permission (0x02): The user can operate all locks within the area specified by the permission scope identifier. The area division is defined by the management platform based on geographical location or management needs, which is applicable to positions such as inspectors and area maintenance personnel; global permission (0x03): The user can operate all locks within the jurisdiction of the management platform, which is applicable to high-level positions such as administrators and emergency command personnel.
[0066] The authorized time window uses the ISO8601 standard UTC time format and supports two modes: Absolute time window: {"start":"2024-05-01T00:00:00Z","end":"2024-05-31T23:59:59Z"} Repeating period time window: {"repeat":"weekly","days":[1,3,5],"startTime":"08:00:00","endTime":"18:00:00"} where the repeat field can be daily, weekly, or monthly; the days field represents the day of the week (1 = Monday, 7 = Sunday), as shown in Table 4: Table 4. Encoding Table of Reason Codes for Permission Verification Failure This invention provides a self-driven management method for smart locks based on Internet of Things (IoT) technology, wherein the formula for determining the validity of the status is: ; in, The status validity indicator is as follows: 1 = normal, 0x01 = no feedback after timeout, 0x02 = invalid signal, 0x03 = bolt not in position, 0x04 = motor stalled. The actual duration of lock body status feedback is calculated from the moment the drive command is sent. The preset state feedback timer threshold; This is a flag indicating the validity of the sensor signal; the signal value is 1 if the signal is within the valid level range, and 0 otherwise. This refers to the actual position of the bolt, and the target position is either the unlocked or locked position. This refers to the actual operating current of the drive motor. This is the threshold value for the stall current of the motor.
[0067] In this embodiment, the dual Hall effect position sensor A3144 has an output high-level range of 2.4V~3.3V and an output low-level range of 0V~0.4V. To avoid noise interference, the effective level range is set to 2.0V~3.3V (active high) and 0V~0.8V (active low); when the sensor output level is between 0.8V and 2.0V, the signal is considered invalid. ).
[0068] In this embodiment, the actual position of the locking tongue The encoding method uses a 2-bit binary code to represent the bolt position: 00 = unknown position, 01 = unlocked position, 10 = locked position, 11 = intermediate position. Dual Hall position sensors are installed at the unlocked and locked positions of the bolt, respectively. When the Hall sensor at the corresponding position detects the magnet, it outputs a high level. The control unit determines the bolt position based on the combination of the two sensor outputs.
[0069] This invention provides a self-driven management method for smart locks based on Internet of Things (IoT) technology, wherein the retransmission mechanism includes: If the IoT wireless communication module fails to report, the control unit immediately initiates the first retransmission. If the first retransmission fails, wait n0 seconds and then start the second retransmission. If the initial report and two retransmissions both fail, the event data packet is stored in local memory and reported in batches when the communication connection is successfully established again.
[0070] In this embodiment, the base value of n0 is 10 seconds, which is dynamically adjusted according to the NB-IoT network signal strength: n0 seconds when the signal strength RSRP ≥ -100dBm; n0 = 10 seconds when -120dBm ≤ RSRP < -100dBm; and n0 = 20 seconds when RSRP < -120dBm. The signal strength is automatically detected by the IoT wireless communication module and reported to the control unit during each communication.
[0071] In this embodiment, the local storage allocation and batch reporting mechanism includes: Local storage allocation: The W25Q80 Flash memory on the lock end is divided into four areas: boot area (128KB), firmware area (3MB), permission data area (512KB), and event storage area (4MB). The event storage area is used to store unreported event data packets. Each event data packet is 256 bytes in size, and a maximum of 16,384 records can be stored.
[0072] Batch reporting mechanism: When communication is restored, the control unit reads up to 10 unreported events from the event storage area in chronological order, packages them into a composite data packet, and reports them to the management platform. After receiving the data, the platform returns an acknowledgment message, and the lock deletes the reported records. If the reporting fails, all records are retained and re-reported during the next communication.
[0073] In this embodiment, the event data packet is valid for 90 days from the date of generation, and unreported events that have exceeded the validity period will be automatically deleted. The control unit checks the event storage area each time it wakes up and deletes all expired records.
[0074] This invention provides a self-driven management method for smart locks based on Internet of Things (IoT) technology. The process of the near-field radio frequency rectifier unit of the energy harvesting module receiving radio frequency signals and converting them into DC power to charge the energy storage module includes: Based on the real-time detection of the output power of the near-field radio frequency rectifier unit by the energy harvesting module, when the output power is greater than the preset power threshold, the energy storage module is charged only by the near-field radio frequency rectifier unit. When the output power is less than or equal to the preset power threshold, the power supply circuit of the piezoelectric mechanical energy harvesting unit is automatically turned on, and the energy storage module is charged together with the near-field radio frequency rectifier unit. The piezoelectric mechanical energy harvesting unit is installed at the door handle pivot, and the piezoelectric ceramic sheet is triggered to generate electrical energy by rotating the door handle. The two energy harvesting paths are connected in parallel via a diode isolation circuit.
[0075] In this embodiment, the preset power threshold is: This value represents the minimum input power required to meet the system's maximum charging demand when the near-field radio frequency rectifier unit is powered alone. When the NFC radio frequency input power is greater than 500μW, charging is performed solely by the near-field radio frequency rectifier unit; when the input power is less than or equal to... At that time, the piezoelectric mechanical energy harvesting unit is automatically activated to achieve dual-path joint charging.
[0076] In this embodiment, the automatic turn-on control circuit uses an N-channel MOSFET SI2302 as a switch, with its gate connected to the power detection output terminal of the energy harvesting module. When the output power of the near-field RF rectifier unit is ≤500μW, the power detection output is high, the MOSFET is turned on, and the piezoelectric mechanical energy harvesting unit is connected to the charging circuit; conversely, when the output power is low, the MOSFET is turned off, and the piezoelectric unit is disconnected.
[0077] Diode isolation circuit: A Schottky diode SS14 is connected in series at the output terminals of both the near-field RF rectifier unit and the piezoelectric mechanical energy harvesting unit. The anode of the diode is connected to the output terminal of the harvesting unit, and the cathodes are connected to the input terminal of the energy storage module. This circuit prevents current backflow between the two harvesting units, ensuring unidirectional energy flow.
[0078] The piezoelectric ceramic element uses a cantilever beam mounting structure. The fixed end is mounted on a bracket on the door handle's rotating shaft, while the free end contacts a cam mechanism on the shaft. When the door handle rotates, the cam pushes the cantilever beam to bend, causing the piezoelectric ceramic element to generate an electric charge. A single rotation of the door handle can cause the cantilever beam to deflect by approximately 0.5 mm, with an output energy ≥ .
[0079] This invention provides a self-driven management method for smart locks based on Internet of Things (IoT) technology. The verification process for the pre-condition tasks includes: Extract the task type code from the unlocking task request data packet, query the local storage of the preceding task association table, and obtain all preceding task identifiers bound to this task type. When multiple prerequisite tasks are related by a logical AND relationship and all have been completed, or by a logical OR relationship and at least one has been completed, ,otherwise ; The status of the pre-processing tasks is synchronized from the management platform to the lock's local storage in each permission update data packet.
[0080] In this embodiment, as shown in Table 5: Table 5 Task Type Coding Table In this embodiment, for the preceding task association table, task_001 represents "maintenance work order has been approved", task_002 represents "safety briefing has been completed", task_003 represents "administrator authorization", and task_004 represents "emergency response has been initiated".
[0081] This invention provides a self-driven management method for smart locks based on Internet of Things (IoT) technology. In enhanced geometric coding signature mode, the user's mobile terminal uses the locally stored user-side private key to sign R1, generating first signature data Sig1, including: The polynomial factorization structure of the private key is obtained by consisting of n independent private key components, each component corresponding to a linear mapping polynomial. ,in, , The coefficients are integers between 0 and 255, and the coefficient combination is the set of coefficients of all mapping polynomials. , i=1,2,...,n; Perform an SM3 hash operation on the 128-bit hardware true random number R1, and convert the last byte of the hash value into an 8-bit unsigned integer. Let the radius of the circle be With the origin O(0,0) of the Cartesian coordinate system as the center, and... Draw a circle with radius The coefficients of each mapping polynomial As coefficient point Attached to the circle In the standard rectangular coordinate system; Determine the circle The midpoints of the line segments formed by the intersections of the angle bisectors of the four upper quadrants and the circle are taken as the quadrant center points, and their rectangular coordinates are respectively... , , ; Calculate each coefficient point separately The Euclidean distances to the centers of the four quadrants are selected, and the minimum value is chosen from the four initial distances of the points with the same coefficient. ; according to Calculate the first coded value for each coefficient point. ,in, This is the floor function; It is an 8-bit unsigned integer and ; From the interval Randomly select an integer L as the side length, and draw a square with the origin O(0,0) as the bottom left vertex. The coordinates of its four vertices are O(0,0), A(L,0), B(L,L), and D(0,L). All coefficient points By attaching the line to the standard rectangular coordinate system containing the square and applying the least squares method to perform a linear fit on all coefficient points, the equation of the fitted line is obtained. Where k is the slope and c is the intercept; Calculate the top right corner vertex of the square To the circle shortest distance ,like Then take ; Set the x-coordinate of the coefficient point Substituting the values into the fitted line equation yields the corresponding vertical coordinates. ; according to Calculate the second encoded value for each coefficient point. ,like Then take , It is an 8-bit unsigned integer; For each coefficient point, calculate the addition combination. Combinations of sum and subtraction ,in, To ensure the modulo operation, the result is an 8-bit unsigned integer; All coefficient points are added and subtracted sequentially and then concatenated with the SM3 hash value of the 128-bit random number R1, the side length L of the square, and the fitted line parameters (k, c) to generate the first signature data Sig1, whose structure is as follows: ,in, This indicates a byte concatenation operation.
[0082] The bidirectional random number signature authentication method described in this invention supports two signature algorithm modes: the standard SM2 signature mode and the enhanced geometric code signature mode. The standard SM2 signature mode is suitable for scenarios with general security requirements, while the enhanced geometric code signature mode is suitable for scenarios with high security requirements. The selection of the two modes is specified by the management platform in the permission update data packet through the "signature algorithm identifier" field, and the lock terminal and the user's mobile terminal automatically switch the corresponding algorithm based on this field.
[0083] The enhanced geometrically encoded signature algorithm is designed based on the geometric properties of elliptic cryptography. By mapping private key coefficients to circular and square geometric shapes for dual encoding, it significantly improves the signature's unforgeability and resistance to cracking. All computational steps of this algorithm can be hardware-accelerated in a secure element (SE). On the hardware platform described in this invention, the single signature computation time is ≤15ms, and the energy consumption is ≤ This meets the low power consumption requirements of passive locks.
[0084] In this embodiment, the Euclidean distance is: j=1,2,3,4, Let the coordinates be the center point of the j-th quadrant. At this time, .
[0085] In this embodiment, the private key is represented as follows: , where n is the length of the private key, and assume that n=4 corresponds to 4 private key components.
[0086] In this embodiment, the enhanced signature data Sig1 is a fixed-length byte array, which is composed of the addition and subtraction combinations of all coefficient points and the SM3 hash value of the random number R1, with a total length of n×4+32 bytes (48 bytes when n=4).
[0087] Suppose there are 4 coefficients, then the coefficient combination is {(12, 34), (56, 78), (90, 12), (34, 56)}, which corresponds to 4 coefficient points.
[0088] In the circle Above, take the midpoint of the line segment where the angle bisectors of the four quadrants intersect the circle as the quadrant center point, and the polar angles of the angle bisectors of the four quadrants are respectively... Converted to rectangular coordinates: , , The midpoint of the line segment intersecting the circle with the angle bisectors of the four quadrants is chosen as the quadrant center point. This aims to leverage the quadrant's strongest geometric symmetry and most uniform distribution to ensure that the private key coefficients at any position can obtain an effective reference distance, achieving a uniform distribution of the first encoded value within the range of 0-255 and avoiding encoding collisions. By utilizing the discontinuous jump characteristic of the minimum distance, the linear relationship between the private key coefficients and the encoded value is broken, constructing a many-to-one nonlinear mapping. This increases the computational complexity of reverse derivation by four times, significantly enhancing the algorithm's resistance to differential and statistical attacks. While ensuring security, the computational load is minimized, requiring only four distance calculations and one minimum value comparison, eliminating the need for additional storage of reference point coordinates, thus adapting to the low-power, low-resource-consumption hardware constraints of passive locks. This synergizes with the dynamic reference point mechanism driven by random number R1 and the square secondary encoding mechanism to jointly guarantee the uniqueness, unforgeability, and consistency of the signature verification logic.
[0089] In this embodiment, if L=128 is randomly selected, the vertices of the square are (0, 0), (128, 0), (128, 128), and (0, 128). A linear fit is performed on the four coefficient points (12, 34), (56, 78), (90, 12), and (34, 56) to obtain the fitted line equation y=0.21x+38.5.
[0090] In this embodiment, If the result is greater than 255, then take the modulo 256. If the result is less than 0, add 257 to make it an 8-bit unsigned integer.
[0091] In this embodiment, when n=4, the structure of Sig1 is shown in Table 6: Table 6. Structure of Sig1 It should be noted that the default value of the private key length n is 4, which can be adjusted to 8 or 16 according to security requirements; In this embodiment, the process of the control unit signing the random number R2 generated by the user's mobile terminal using the lock end private key stored in the local security element to generate the second signature data Sig2 is exactly the same as the process of the user terminal generating Sig1; the process of the user's mobile terminal verifying the signature of Sig2 is exactly the same as the process of the control unit verifying the signature of Sig1.
[0092] This embodiment uses an enhanced geometric coding signature algorithm for two-way authentication, and the specific process is as follows: After the user's mobile phone verifies the validity of the lock terminal certificate, the user's private key is read from the local security element. The coefficient combination is {(12,34),(56,78),(90,12),(34,56)}.
[0093] For example, the complete 32-byte SM3 hash value (hexadecimal) is: 66C7F0F45958C452B8C5E8C373A0F51979E97E057CBE32A28090B74A58F3073B. Calculate the SM3 hash for the 128-bit R1, take the last byte 0x3B (59), and get the radius: R=59+1=60. The last byte refers to the rightmost and lowest address byte, which is the last two bits of the hash value: 3B.
[0094] Randomly select L=32 as the side length and draw the vertices O (0,0), A (32,0), B (32,32), and D (0,32) of a square. Perform least-squares linear fitting on the four coefficient points to obtain the equation of the fitted line: y=-0.26506x+57.7229; Calculation and Combination With subtraction combination If the result is greater than 255, then take the modulo 256. The results are shown in Table 7. Table 7 Calculation Results At this point, the final 49-byte Sig1 generated by concatenating all fields is: D74D3181BADCB71D9F4D7A2B8C3E1F0A5B7D9F2A4C6E8B0D1F3A5C7E9B2D4F6A8C0E2B4D6F8A1C3B20BE87851E4266B852.
[0095] The beneficial effects of the above technical solution are as follows: By using cryptographically secure SM3 hash truncation mapping, a 128-bit hardware true random number is converted into a circular curve radius R within the range of 1-256. This not only fully preserves the entropy value and anti-replay and anti-forgery security strength of the 128-bit random number, but also improves boundary anomaly protection through fallback processing such as L=0 automatic correction. Combined with a dual nonlinear encoding mechanism of circular curve and square fitting, it ensures that the single signature calculation time is ≤15ms and the energy consumption is ≤ With its low power consumption characteristics, it improves the unforgeability of signatures and resistance to differential attacks, adapting to the hardware constraints of passive smart locks and the high security requirements of critical infrastructure.
[0096] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A self-driven management method for smart locks based on Internet of Things (IoT) technology, characterized in that, include: Step 1: Energy self-sensing and graded wake-up control: The smart lock is in deep sleep mode by default, with only the energy harvesting module and voltage detection circuit working passively; When the user's mobile terminal enters the effective range of near-field communication, the near-field radio frequency rectification unit of the energy harvesting module receives the radio frequency signal and converts it into DC power to charge the energy storage module. The stored energy is determined by an energy threshold trigger formula, and when the first wake-up energy threshold is reached... When the signal is activated, the control unit will be switched to the working state. Step 2: Energy Assurance Determination and Two-Way Authentication Control: The control unit reads the real-time energy of the energy storage module and verifies whether the second authentication energy threshold has been reached using an energy threshold trigger formula. ; If the target is not met, the power will be continuously replenished; if the target is met, the near-field communication module will be activated to establish an encrypted data link and perform two-way random number signature authentication between the lock and the user's mobile terminal. Step 3: Local Dynamic Permission Verification and Control: After successful authentication, the control unit receives the unlocking task request data packet sent by the user's mobile terminal and performs four layers of local verification based on the dynamic permission verification formula: lock status, authorization time window, task-role mapping, and prerequisite task conditions. If all checks pass, proceed to step 4; otherwise, return a permission denial response and generate a local exception event record. Step 4: Lock body execution and status synchronization reporting control: After the permission verification is passed, the control unit sends a drive command carrying the action direction parameter to the drive module to drive the lock tongue to perform the unlocking or locking action, and at the same time starts the status feedback timer; The validity of the lock body status feedback is determined by the status validity determination formula. If it is normal, a status change event data packet is generated; if it is abnormal, a corresponding type of abnormal event data packet is generated. The control unit activates the IoT wireless communication module, first reports the event data packet to the management platform, then sends a permission update request to the management platform, receives and verifies the permission update data packet, and then reports the event data packet to the management platform; if the reporting fails, a retransmission mechanism is initiated. Step 5: Operation record blockchain evidence storage control: The management platform performs integrity verification and lock signature verification on the reported data packets. After verification, the data is encapsulated according to the preset on-chain data structure and submitted to the blockchain evidence storage terminal. Step 6: Post-task energy management and hibernation control: After reporting is completed, the control unit reads the remaining energy of the energy storage module. If the remaining energy is higher than the safe energy threshold... It will then directly enter a deep hibernation state; If the remaining energy is less than or equal to It will then immediately enter a deep sleep state, waiting for the next near-field communication to trigger wake-up.
2. The management method according to claim 1, characterized in that, The energy threshold triggering formula is as follows: ; in, The safe energy threshold; This is the total energy margin coefficient, with a value ranging from 1.2 to 1.5; The energy required to power on and initialize the control unit; Energy required for two-way identity authentication; The energy required for the operation of the lock body actuator; Energy required for IoT wireless communication reporting and permission updates; The total energy loss of the system includes rectification loss, leakage current loss, and wire loss; The third-level energy threshold is satisfied: , ,and ; Additional energy margin for the certification process. Additional energy margin for the wake-up process.
3. The management method according to claim 1, characterized in that, The specific process of the two-way random number signature authentication includes: Step 21: The control unit generates a 128-bit hardware true random number R1, extracts the locally pre-stored digital certificate of the lock end, packages R1 and the digital certificate of the lock end into a first authentication request message, and sends it to the user's mobile terminal through a near-field communication encrypted data link; Step 22: After receiving the first authentication request message, the user's mobile terminal verifies the validity of the digital certificate on the lock end, including certificate chain verification, validity period verification, and local cached CRL revocation status query. If the verification fails, the connection is disconnected and the authentication process is terminated. The CRL is generated daily by the management platform and synchronized to the lock end and the user's mobile terminal through permission update data packets. Step 23: After verification, the user's mobile terminal signs R1 using the locally stored user's private key according to the signature algorithm mode specified by the management platform, generates the first signature data Sig1, and returns Sig1 and the user's digital certificate to the control unit. The signature algorithm mode includes the standard SM2 signature mode and the enhanced geometric coding signature mode. Step 24: The control unit extracts the user's public key from the user's digital certificate and uses the user's public key to verify the signature of Sig1; if the signature verification fails, the authentication process is terminated and the exception is recorded. If the signature verification is successful, a signature verification success confirmation message will be sent to the user's mobile terminal; Step 25: After the signature verification is successful, the user's mobile terminal generates a 128-bit hardware true random number R2 and sends it to the control unit; Step 26: The control unit uses the lock end private key stored in the local security element to sign R2 using the same signature algorithm mode as in step 23, generates second signature data Sig2, and returns it to the user's mobile terminal. Step 27: The user's mobile terminal uses the verified lock end public key to verify the signature of Sig2. If the signature verification is successful, the two-way identity authentication is successfully completed.
4. The management method according to claim 1, characterized in that, The dynamic permission verification formula is as follows: Where: P is the permission boolean value, 1 = pass, 0 = deny; The lock status verification result is as follows: lock normal = 1, lock abnormal = 0; For the authorization time window verification result, the request time is set to 1 if it is within the valid window, and 0 otherwise. The result of the task-role mapping verification is: if the user role has the corresponding task permission, =1; otherwise, =0. The result is the conditional verification result of the prerequisite tasks. If all prerequisite tasks have been completed, the result is 1; otherwise, the result is 0. The result of the permission version verification is 1 if the local permission version has not expired, and 0 otherwise. The verification is performed in the order of priority: lock status, version permissions, authorization time, role permissions, and preconditions, and the reason code of the first failed item is returned. The authorized time window adopts the UTC time format and supports two modes: absolute time window and recurring periodic time window; the task-role mapping adopts a three-level permission granularity, including global permissions, regional permissions, and single lock permissions.
5. The management method according to claim 1, characterized in that, The formula for determining the validity of the state is: ; in, The status validity indicator is as follows: 1 = normal, 0x01 = no feedback after timeout, 0x02 = invalid signal, 0x03 = bolt not in position, 0x04 = motor stalled. The actual duration of lock body status feedback is calculated from the moment the drive command is sent. The preset state feedback timer threshold; This is a flag indicating the validity of the sensor signal; the signal value is 1 if the signal is within the valid level range, and 0 otherwise. This refers to the actual position of the bolt, and the target position is either the unlocked or locked position. This refers to the actual operating current of the drive motor. This is the threshold value for the stall current of the motor.
6. The management method according to claim 1, characterized in that, The retransmission mechanism includes: If the IoT wireless communication module fails to report, the control unit immediately initiates the first retransmission. If the first retransmission fails, wait n0 seconds and then start the second retransmission. If the initial report and two retransmissions both fail, the event data packet is stored in local memory and reported in batches when the communication connection is successfully established again.
7. The management method according to claim 1, characterized in that, The near-field radio frequency rectification unit of the energy harvesting module receives radio frequency signals and converts them into DC power to charge the energy storage module, including: Based on the real-time detection of the output power of the near-field radio frequency rectifier unit by the energy harvesting module, when the output power is greater than the preset power threshold, the energy storage module is charged only by the near-field radio frequency rectifier unit. When the output power is less than or equal to the preset power threshold, the power supply circuit of the press-type piezoelectric mechanical energy acquisition unit is automatically turned on, and it charges the energy storage module together with the near-field radio frequency rectifier unit. The press-type piezoelectric mechanical energy acquisition unit is installed on the surface of the door handle, and the piezoelectric ceramic sheet is triggered to generate electrical energy when the user presses the door handle. The two energy harvesting paths are connected in parallel via a diode isolation circuit.
8. The management method according to claim 4, characterized in that, The verification process for the prerequisite task conditions includes: Extract the task type code from the unlocking task request data packet, query the local storage of the preceding task association table, and obtain all preceding task identifiers bound to this task type. When multiple prerequisite tasks are related by a logical AND relationship and all have been completed, or by a logical OR relationship and at least one has been completed, ,otherwise ; The status of the pre-processing tasks is synchronized from the management platform to the lock's local storage in each permission update data packet.
9. The management method according to claim 3, characterized in that, In the enhanced geometric coding signature mode, the user's mobile terminal uses the locally stored user's private key to sign R1, generating the first signature data Sig1, which includes: The polynomial factorization structure of the private key is obtained by consisting of n independent private key components, each component corresponding to a linear mapping polynomial. ,in, , The coefficients are integers between 0 and 255, and the coefficient combination is the set of coefficients of all mapping polynomials. , i=1,2,...,n; Perform an SM3 hash operation on the 128-bit hardware true random number R1, and convert the last byte of the hash value into an 8-bit unsigned integer. Let the radius of the circle be With the origin O(0,0) of the Cartesian coordinate system as the center, and... Draw a circle with radius The coefficients of each mapping polynomial As coefficient point Attached to the circle In the standard rectangular coordinate system; Determine the circle The midpoints of the line segments formed by the intersections of the angle bisectors of the four upper quadrants and the circle are taken as the quadrant center points, and their rectangular coordinates are respectively... , , ; Calculate each coefficient point separately The Euclidean distances to the centers of the four quadrants are selected, and the minimum value is chosen from the four initial distances of the points with the same coefficient. ; according to Calculate the first coded value for each coefficient point. ,in, This is the floor function; It is an 8-bit unsigned integer and ; From the interval Randomly select an integer L as the side length, and draw a square with the origin O(0,0) as the bottom left vertex. The coordinates of its four vertices are O(0,0), A(L,0), B(L,L), and D(0,L). All coefficient points By attaching the line to the standard rectangular coordinate system containing the square and applying the least squares method to perform a linear fit on all coefficient points, the equation of the fitted line is obtained. Where k is the slope and c is the intercept; Calculate the top right corner vertex of the square To the circle shortest distance ,like Then take ; Set the x-coordinate of the coefficient point Substituting the values into the fitted line equation yields the corresponding vertical coordinates. ; according to Calculate the second encoded value for each coefficient point. ,like Then take , It is an 8-bit unsigned integer; For each coefficient point, calculate the addition combination. Combinations of sum and subtraction ,in, To ensure the modulo operation, the result is an 8-bit unsigned integer; All coefficient points are added and subtracted sequentially and then concatenated with the SM3 hash value of the 128-bit random number R1, the side length L of the square, and the fitted line parameters (k, c) to generate the first signature data Sig1, whose structure is as follows: ,in, This indicates a byte concatenation operation.
