Door lock communication method and door lock

CN122676584APending Publication Date: 2026-09-01SHENZHEN KAADAS INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610830759.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-10
Publication Date
2026-09-01

AI Technical Summary

Technical Problem

然而,这些方案在实际应用中均存在不同程度的局限性

Benefits of technology

主控模块在门锁的系统初始化后,控制通信模块进入休眠模式,其中,在休眠模式下通信模块的功耗小于预设的功耗阈值,能够有效减少功耗,主控模块监听唤醒源,其中,唤醒源包括事件触发唤醒和定时器周期唤醒;当主控模块检测到目标事件时,主控模块唤醒处于休眠模式的通信模块,控制通信模块进入短连接模式,在短连接模式结束后,主控模块控制通信模块进入休眠模式;当主控模块检测到达到定时器周期时,主控模块唤醒处于休眠模式的通信模块,控制通信模块进入周期同步模式,在周期同步模式结束后,主控模块控制通信模块进入休眠模式。本公开实施例提供的门锁通信方法,通过事件触发唤醒和定时器周期唤醒的混合唤醒机制,能够在降低成本与功耗的同时,提升通信可靠性和实时性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122676584A_ABST
    Figure CN122676584A_ABST
Patent Text Reader

Abstract

This disclosure provides a door lock communication method and a door lock. After the door lock's system initialization, the main control module controls the communication module to enter sleep mode, effectively reducing power consumption. The main control module listens for wake-up sources. When the main control module detects a target event, it wakes up the communication module in sleep mode and controls it to enter short connection mode. After the short connection mode ends, the main control module controls the communication module to enter sleep mode. When the main control module detects that a timer period has been reached, it wakes up the communication module in sleep mode and controls it to enter periodic synchronization mode. After the periodic synchronization mode ends, the main control module controls the communication module to enter sleep mode. The door lock communication method provided in this disclosure, through a hybrid wake-up mechanism of event-triggered wake-up and timer periodic wake-up, can improve communication reliability and real-time performance while reducing cost and power consumption.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of smart lock technology, and in particular to a door lock communication method and a door lock. Background Technology

[0002] With the rapid development of IoT technology and the continued boom in the smart home market, smart door locks, as the first line of defense for home security and the core entry point device for smart homes, have seen their market penetration rate increase year by year. Modern smart door locks have evolved from simple mechanical replacement products into intelligent terminals integrating biometrics, wireless communication, remote control, and security alarms. Remote communication capability, as one of the core functions of smart door locks, directly determines the product's user experience, security, and market competitiveness.

[0003] Currently, mainstream remote communication solutions for smart locks on the market mainly include communication technologies such as ZigBee, Wi-Fi, and Bluetooth. However, these solutions all have limitations to varying degrees in practical applications. Therefore, the market urgently needs a smart lock remote communication solution that can achieve a better balance between cost, power consumption, communication reliability, and real-time performance. Summary of the Invention

[0004] The main objective of this disclosure is to propose a door lock communication method and door lock that can achieve a better balance between cost, power consumption, communication reliability and real-time performance.

[0005] To achieve the above objectives, a first aspect of this disclosure provides a door lock communication method applied to a door lock, the door lock including a main control module and a communication module, the door lock communication method including: After the door lock system is initialized, the main control module controls the communication module to enter a sleep mode, wherein the power consumption of the communication module in the sleep mode is less than a preset power consumption threshold. The main control module monitors wake-up sources, including event-triggered wake-up and timer-period wake-up; When the main control module detects a target event, the main control module wakes up the communication module which is in sleep mode and controls the communication module to enter short connection mode. After the short connection mode ends, the main control module controls the communication module to enter sleep mode. When the main control module detects that the timer period has been reached, the main control module wakes up the communication module which is in sleep mode and controls the communication module to enter the periodic synchronization mode. After the periodic synchronization mode ends, the main control module controls the communication module to enter sleep mode.

[0006] In some embodiments, controlling the communication module to enter a short connection mode, and then controlling the communication module to enter a sleep mode after the short connection mode ends, includes: The communication module is controlled to attach to the network and establish a communication connection with the cloud platform within a preset duration, wherein the duration of the communication connection is less than a preset duration threshold, and the duration threshold is less than the timer period. The communication module sends the event data packet corresponding to the target event to the cloud platform, and the capacity of the event data packet is less than a preset capacity threshold. When the communication module receives a confirmation message from the cloud platform, it releases the communication connection established with the cloud platform, and the main control module controls the communication module to enter sleep mode.

[0007] In some embodiments, controlling the communication module to enter a periodic synchronization mode, and then controlling the communication module to enter a sleep mode after the periodic synchronization mode ends, includes: The communication module is controlled to attach to the network and establish a communication connection with the cloud platform to synchronize data. After the communication module completes data synchronization, it releases the communication connection established with the cloud platform, and the main control module controls the communication module to re-enter sleep mode.

[0008] In some embodiments, the data synchronization includes at least one of the following tasks: uploading non-urgent logs accumulated in the previous timer period, synchronizing system time, checking and downloading pending instructions issued by the cloud platform, querying for firmware upgrades, and reporting complete device status information.

[0009] In some embodiments, the door lock communication method further includes: When the main control module detects that the communication module has failed to establish a communication connection with the cloud platform, it controls the communication module to re-establish a communication connection with the cloud platform based on the retry interval until the communication module successfully establishes a communication connection with the cloud platform. The retry interval is gradually extended.

[0010] In some embodiments, when the main control module detects that the communication module has failed to establish a communication connection with the cloud platform, it controls the communication module to re-establish a communication connection with the cloud platform based on a retry interval, including: Initialize the retry counter. When the main control module detects that the communication module has failed to connect with the cloud platform, it reads the retry count of the retry counter. Obtain a preset initial interval, determine a retry interval based on the initial interval and the retry count, and add jitter to the retry interval; Update the retry counter, and when the retry interval after adding jitter is reached, control the communication module to re-establish the communication connection with the cloud platform.

[0011] In some embodiments, the door lock communication method further includes: When the main control module detects that the timer period has been reached, if the target event is detected during the period synchronization mode, the main control module interrupts the period synchronization mode and controls the communication module to enter the short connection mode. After the short connection mode ends, the control module controls the communication module to enter the periodic synchronization mode from the interrupt node. After the periodic synchronization mode ends, the main control module controls the communication module to enter the sleep mode.

[0012] In some embodiments, the communication module establishes a communication connection with the cloud platform via a mobile communication network, and the door lock communication method further includes at least one of the following: When the main control module detects that the signal strength of the communication module is lower than the preset signal strength threshold, the duration of the sleep mode is extended. When the main control module detects that the door lock battery level is lower than the preset power threshold, it extends the timer period and disables non-door lock key functions.

[0013] To achieve the above objectives, a second aspect of this disclosure provides a door lock, including a main control module and a communication module: The main control module is used to control the communication module to enter a sleep mode after the system initialization of the door lock, wherein the power consumption of the communication module in the sleep mode is less than a preset power consumption threshold. The main control module is also used to monitor wake-up sources, including event-triggered wake-up and timer-period wake-up; The main control module is also used to wake up the communication module in sleep mode when a target event is detected, control the communication module to enter short connection mode, and control the communication module to enter sleep mode after the short connection mode ends. The main control module is also used to detect when the timer period is reached, wake up the communication module which is in sleep mode, control the communication module to enter the periodic synchronization mode, and control the communication module to enter the sleep mode after the periodic synchronization mode ends.

[0014] To achieve the above objectives, a fourth aspect of the present disclosure provides a storage medium, which is a computer-readable storage medium storing a computer program that, when executed by a processor, implements the door lock communication method described in the first or second aspect of the present disclosure.

[0015] The beneficial effects of the embodiments disclosed herein include: After the door lock system is initialized, the main control module controls the communication module to enter sleep mode. In sleep mode, the power consumption of the communication module is less than a preset power consumption threshold, effectively reducing power consumption. The main control module listens for wake-up sources, including event-triggered wake-up and timer-period wake-up. When the main control module detects a target event, it wakes up the communication module in sleep mode and controls it to enter short-connection mode. After the short-connection mode ends, the main control module controls the communication module to enter sleep mode. When the main control module detects that a timer period has been reached, it wakes up the communication module in sleep mode and controls it to enter periodic synchronization mode. After the periodic synchronization mode ends, the main control module controls the communication module to enter sleep mode. The door lock communication method provided in this embodiment, through a hybrid wake-up mechanism of event-triggered wake-up and timer-period wake-up, can improve communication reliability and real-time performance while reducing cost and power consumption. Attached Figure Description

[0016] Figure 1 A flowchart of a door lock communication method provided in an embodiment of this disclosure; Figure 2 This is a schematic diagram of the interaction of a short connection provided in an embodiment of this disclosure; Figure 3 This is a schematic diagram of the specific process of step S130; Figure 4 This is a schematic diagram of the specific process of step S140; Figure 5 This is a schematic diagram illustrating the overall interaction process between the door lock and the cloud. Figure 6 A schematic diagram illustrating the specific process for re-establishing a communication connection; Figure 7 This is a partial structural diagram of a door lock provided in an embodiment of this disclosure. Detailed Implementation

[0017] The accompanying drawings in the embodiments clearly and completely describe the technical solutions in the embodiments of this disclosure. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments in this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.

[0018] It is understood that in the specific embodiments of this disclosure, which involve the retrieval of relevant data, when the above embodiments of this disclosure are applied to specific products or technologies, permission or consent from the subject is required, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards.

[0019] In this disclosure, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0020] Reference Figure 1 , Figure 1 This is a flowchart of a door lock communication method provided in an embodiment of the present disclosure. The door lock communication method is applied to a door lock, which can be any lock with electronic control functions, such as a smart door lock that integrates functions such as biometric identification, password input, and remote control. The door lock includes a main control module and a communication module. The door lock communication method can include the following steps S110 to S140.

[0021] Step S110: After the door lock system is initialized, the main control module controls the communication module to enter sleep mode.

[0022] Upon first power-on or after a complete system reset, a system initialization process is executed. This process is led by the main control module and includes, but is not limited to, loading firmware, initializing internal registers, configuring input / output pins, detecting the status of various sensors, and initializing the communication module.

[0023] Specifically, at the end of the system initialization process, the main control module sends a predefined sleep command or state switching instruction to the communication module through a specific hardware interface. The hardware interface can be a Universal Asynchronous Receiver / Transmitter (UART) or a Serial Peripheral Interface (SPI). This instruction triggers a state machine transition within the communication module, causing it to switch from the initial standby or idle state to a low-power operating state defined as sleep mode.

[0024] In this embodiment, the sleep mode is the operating mode with the lowest power consumption of the communication module. In sleep mode, the power consumption of the communication module is less than a preset power consumption threshold. In this mode, most of the internal functional modules of the communication module, such as the RF transceiver, power amplifier, baseband signal processor, and high-level protocol stack processing unit, are turned off or placed in a hold-at-very-low clock frequency state. As a result, the power consumption of the communication module is reduced to below a preset power consumption threshold.

[0025] Step S120: The main control module listens for the wake-up source.

[0026] The wake-up sources include event-triggered wake-up and timer-period wake-up.

[0027] Specifically, after the control communication module enters sleep mode, the main control module itself does not completely stop working, but switches to a low-power operating mode and continuously listens for two main wake-up sources: event-triggered wake-up and timer-period wake-up.

[0028] Event-triggered wake-up refers to a wake-up signal triggered by a physical or logical event occurring locally on the door lock. These events typically have suddenness, randomness, and high real-time requirements. The main control module detects these events through hardware interrupts or periodic polling. Specific event types may include, but are not limited to, unauthorized unlocking attempts, forced entry alarms, extremely low battery alarms, user-initiated unlocking operations, or abnormal door opening alarms, etc. An illegal unlocking attempt occurs when a user attempts to use the wrong fingerprint on the fingerprint module more than a preset number of times, such as 5 times, or enters the wrong password on the keypad more than a preset number of times, such as 3 times. In this case, the main control module will receive an interrupt signal from the corresponding sensor, which is the illegal unlocking attempt event.

[0029] The forced entry alarm occurs when the anti-pry sensor on the door lock housing is triggered, for example, when an attempt is made to forcibly pry open or remove the door lock panel. This triggers a level transition signal, which is captured by the corresponding interrupt pin of the main control module, thus generating a forced entry alarm event.

[0030] The low battery alarm is triggered when the main control module periodically collects battery voltage data via an analog-to-digital converter. When the detected voltage value remains below a preset first threshold (e.g., indicating less than 10% remaining battery power), a low battery alarm event is generated. This event can be configured to trigger immediately or only when a critical level is reached.

[0031] User-initiated unlocking means that regardless of whether the user successfully unlocks the door via fingerprint, password, IC card, or mobile phone Bluetooth, the main control module can also treat it as a user-initiated unlocking event while verifying the information and driving the motor to unlock.

[0032] The door abnormal opening alarm is triggered by the door magnetic sensor detecting the open or closed status of the door. If the main control module detects the door changing from closed to open during unauthorized periods, such as from midnight to 5 a.m. (which can be configured by the user via a mobile app), it will generate a door abnormal opening alarm event.

[0033] Timer-based wake-up refers to a periodic wake-up signal triggered by a real-time clock or a low-power timer integrated within the main control module. Unlike random event triggers, timer-based wake-up is deterministic and periodic. The system presets a relatively long timer period. The main control module is configured during initialization to generate an interrupt signal after the timer period ends. This interrupt signal is the source of the periodic wake-up.

[0034] By listening to these two types of wake-up sources, the main control module ensures that the entire door lock system remains in a state of extremely low power consumption for most of the time when no wake-up source is triggered.

[0035] Step S130: When the main control module detects the target event, the main control module wakes up the communication module which is in sleep mode and controls the communication module to enter short connection mode.

[0036] The target event is the event-triggered wake-up source monitored by the main control module in the aforementioned step S120. When any critical event defined as needing to be reported immediately is detected, such as an illegal unlocking attempt, a violent destruction alarm, or a very low battery alarm, the main control module will immediately execute the event response process.

[0037] First, the main control module fully wakes up from its low-power mode and resumes full-speed operation. Then, it sends a wake-up pulse or a specific wake-up command to the communication module, which is in deep sleep mode, via a hardware interface; for example, this could be achieved by pulling a dedicated wake-up pin high. Upon receiving this wake-up signal, the communication module initiates its internal wake-up process, powering on the RF and baseband circuits, loading firmware, and searching for and synchronizing with the network.

[0038] Subsequently, the main control module controls the communication module to enter short connection mode. In short connection mode, after the communication module is woken up, it only establishes a very short communication connection with the cloud platform, releases the connection immediately after completing the data reporting, and enters sleep mode again.

[0039] In one embodiment, the main control module controls the communication module to enter short-connection mode. The main control module can command the communication module to establish a transport layer secure connection with a pre-configured cloud platform server based on the attached network, using a domain name or static IP address identifier. The duration of the entire connection establishment process is controlled within a preset duration threshold, such as 10 seconds. This duration threshold is much smaller than the timer period, ensuring the short duration of each communication. After the connection is established, the communication module packages and sends an event data packet containing detailed information about the target event. The size of the event data packet is limited to a preset capacity threshold, such as 500 bytes. The content of the data packet may include the door lock's unique device ID, event type code, timestamp of the event occurrence, and some auxiliary information. After successfully receiving and parsing the data packet, the cloud platform returns a reception confirmation message to the door lock. Upon receiving this reception confirmation message, the communication module considers the event reporting task to have been reliably completed. At this time, the main control module commands the communication module to actively send a connection release message to disconnect from the cloud platform. The main control module then sends a sleep command to the communication module, causing it to return to a low-power mode such as PSM.

[0040] It is evident that the entire process avoids the continuous power consumption overhead of maintaining a long-term heartbeat connection, and compresses the communication power consumption almost entirely within the short time window of the event.

[0041] For example, refer to Figure 2 , Figure 2 The diagram illustrates the interaction of a short connection provided in this embodiment. After a user performs remote management operations on a door lock via a mobile app, the relevant operation instructions are first cached in the cloud platform. The door lock actively establishes a short connection with the cloud platform at a specific time, and the cloud platform sends the cached instructions to the door lock one by one. The door lock receives the instructions and performs the corresponding operations. After the operations are completed, the door lock reports the results to the cloud platform, and then the connection is disconnected, and the door lock re-enters sleep mode.

[0042] Step S140: When the main control module detects that the timer period has been reached, the main control module wakes up the communication module which is in sleep mode and controls the communication module to enter the periodic synchronization mode.

[0043] When the RTC timer inside the main control module reaches the preset timer period, a periodic interrupt will be generated. After detecting this interrupt, the main control module performs a wake-up operation similar to step S130: it wakes up itself and wakes up the communication module in sleep mode through the hardware interface.

[0044] After this wake-up, the main control module controls the communication module to enter the periodic synchronization mode. The periodic synchronization mode is a mode for handling batch, non-urgent tasks that must ensure consistency. Its purpose is to periodically calibrate the status of the door lock and the cloud platform, ensure that cloud commands can be reliably issued, and upload the door lock's daily operation log completely.

[0045] In one embodiment, the main control module controls the communication module to enter a periodic synchronization mode and establish a stable connection. First, the communication module also needs to attach to the network and establish an encrypted connection with the cloud platform. Since multiple data transmissions may be required in periodic synchronization mode, the connection duration may be slightly longer than in short connection mode, but it is usually within tens of seconds to one or two minutes. This connection duration is also much shorter than the synchronization cycle. After the connection is established, the communication module will perform a relatively comprehensive data synchronization process. Specifically, it can upload non-emergency logs accumulated in the previous cycle, such as all normal unlocking records, normal door opening and closing records, sensor self-test status, etc. Alternatively, it can synchronize time with the time server of the cloud platform to calibrate the door lock's local RTC clock and ensure that the timestamps of all events are absolutely accurate. Alternatively, it can send a command query request to the cloud platform to check if there are any execution commands to be issued, such as temporary passwords added by the user through the mobile APP, deleted expired fingerprints, remote unlocking requests, etc. Alternatively, it can check if there is an over-the-air upgrade task for the door lock firmware, and if so, start the download of the upgrade package. After synchronization is complete, the connection is released. Once all scheduled synchronization tasks have been executed, the communication module will proactively release the connection with the cloud platform. Subsequently, the main control module will again control the communication module to enter sleep mode, and the door lock system will return to listening mode, waiting for the next event or the next synchronization cycle.

[0046] After the door lock system is initialized, the main control module controls the communication module to enter sleep mode. In sleep mode, the power consumption of the communication module is less than a preset power consumption threshold, effectively reducing power consumption. The main control module listens for wake-up sources, including event-triggered wake-up and timer-period wake-up. When the main control module detects a target event, it wakes up the communication module in sleep mode and controls it to enter short-connection mode. After the short-connection mode ends, the main control module controls the communication module to enter sleep mode. When the main control module detects that a timer period has been reached, it wakes up the communication module in sleep mode and controls it to enter periodic synchronization mode. After the periodic synchronization mode ends, the main control module controls the communication module to enter sleep mode. The door lock communication method provided in this embodiment, through a hybrid wake-up mechanism of event-triggered wake-up and timer-period wake-up, can improve communication reliability and real-time performance while reducing cost and power consumption.

[0047] In some embodiments, refer to Figure 3, Figure 3 The flowchart for step S130 is as follows: The communication module is controlled to enter short connection mode. After the short connection mode ends, the main control module controls the communication module to enter sleep mode. This may include the following steps: Step S131: Control the communication module to attach to the network and establish a communication connection with the cloud platform within a preset time period.

[0048] The communication connection duration is less than a preset duration threshold, and the duration threshold is less than the timer period. After the main control module wakes up the communication module, it issues a series of AT commands to control its behavior. For example, it first sends the AT+CGATT=1 command to attach the module to the GPRS / LTE network, and then establishes a TCP connection via the AT+CIPSTART command. To ensure system real-time performance and controllable power consumption, the main control module sets a total timeout for these operations, i.e., a preset duration threshold. As an example, this duration threshold can be set to 15 seconds to meet the requirements of short connections.

[0049] Step S132: The communication module sends the event data packet corresponding to the target event to the cloud platform.

[0050] After the connection is established, the main control module sends out the encapsulated event data packet through the established connection. The size of the event data packet is less than a preset capacity threshold, such as 500 bytes. By limiting the size of the event data packet, communication power consumption can be reduced and communication efficiency can be improved.

[0051] Step S133: After the communication module receives the acceptance confirmation message sent by the cloud platform, it releases the communication connection established with the cloud platform, and the main control module controls the communication module to enter sleep mode.

[0052] After sending a data packet, the communication module waits for an ACK message from the cloud platform. If no ACK is received within the preset timeout period, the transmission is considered a failure, and a retry mechanism is triggered. Once a confirmation message is received from the cloud platform, the main control module considers the reporting task successful. Then, the main control module sends a command to close the network connection and then sends a command to put the communication module into sleep mode.

[0053] By limiting the duration of the communication connection and the size of the event data packet, the power consumption of the short connection mode can be reduced.

[0054] In some embodiments, refer to Figure 4 , Figure 4 The flowchart for step S140 is as follows: The control communication module enters the periodic synchronization mode. After the periodic synchronization mode ends, the main control module controls the communication module to enter the sleep mode. Specifically, this may include the following steps: Step S141: After the control communication module attaches to the network and establishes a communication connection with the cloud platform, it performs data synchronization.

[0055] In the periodic synchronization mode, after the connection is established, the main control module drives the communication module to execute a series of data synchronization tasks. These tasks constitute a synchronization task set, the contents of which can be dynamically adjusted according to system configuration and current needs.

[0056] Step S142: After the communication module completes data synchronization, it releases the communication connection established with the cloud platform, and the main control module controls the communication module to re-enter sleep mode.

[0057] Regardless of the number of tasks in the synchronization task set, the communication module must complete them one by one, either sequentially or in parallel. Once all tasks have been successfully executed, or when the main control module determines that the maximum allowed time for this synchronization has been reached, the communication module will proactively release the connection and re-enter sleep mode according to the instructions of the main control module, thus avoiding excessively long synchronization times.

[0058] In some embodiments, the data synchronization content in step S141 may include at least one of the following tasks: uploading non-emergency logs accumulated in the previous timer period, synchronizing system time, checking and downloading pending instructions issued by the cloud platform, querying whether there is a firmware upgrade, and reporting complete device status information, so as to ensure the integrity of the door lock status and the real-time nature of cloud instructions.

[0059] When uploading accumulated non-emergency logs, the main control module will package and upload the non-emergency event records stored in the local Flash since the last successful synchronization to the cloud, such as the time, method, and operator ID of each normal unlocking.

[0060] When synchronizing system time, the main control module can initiate a time synchronization request to the time server in the cloud via the NTP (Network Time Protocol) or its simplified version to obtain the accurate UTC time and use it to calibrate the door lock's local RTC.

[0061] When checking and downloading pending instructions from the cloud platform, the door lock sends an instruction retrieval request to the cloud. Upon receiving the request, the cloud platform queries the instruction queue associated with the door lock device ID. If pending instructions exist, the cloud sends these instructions to the door lock. After receiving and parsing these instructions, the door lock's main control module either executes them immediately or stores them locally for later execution.

[0062] When checking for firmware upgrades, the door lock can query the cloud for its current firmware version number and compare it with the latest stable version number marked on the cloud. If a new version is found and meets the OTA upgrade policy, the door lock can initiate the download of the upgrade package.

[0063] When reporting complete device status information, in addition to the logs, the door lock will also report a detailed snapshot of the device status, including but not limited to the current battery percentage, signal strength, operating temperature of the communication module, and self-test status of each sensor.

[0064] Furthermore, the timer period is a remotely configurable parameter. For example, the system can default to a 6-hour timer period when the door lock leaves the factory. If the user wants more timely status feedback and lower command latency, they can change the timer period to 2 hours via a mobile app. Conversely, if the user wants to maximize battery life, they can extend the period to 24 hours. The cloud platform can remotely update the timer period on the door lock based on user configuration by issuing commands during the period synchronization process, achieving a balance between flexibility and energy consumption.

[0065] For example, refer to Figure 5 , Figure 5 This diagram illustrates the overall interaction process between the door lock and the cloud. The door lock first establishes a connection to the cloud platform's MQTT server. The door lock subscribes to the message topic ` / orangeiot / {esn} / call` to listen for and receive control commands from the cloud platform. The cloud platform then sends cached control commands to the door lock via the subscribed topic. The door lock receives the commands and executes the corresponding actions. After execution, the door lock reports multiple types of data to the cloud platform sequentially: first, it reports initialization data (currently `randomCode`), then it reports the door lock status information `lockInf`, followed by the door lock attributes and running status `action`. In power-on trigger scenarios, the door lock additionally reports the user list data `reportUserGroup` to the cloud platform.

[0066] In some embodiments, the door lock communication method provided in this disclosure further includes the following steps: When the main control module detects a communication failure between the communication module and the cloud platform, it controls the communication module to re-establish the communication connection with the cloud platform based on the retry interval, until the communication module and the cloud platform successfully establish a communication connection. The retry interval is gradually increased.

[0067] Specifically, there are several ways to gradually increase the retry interval, such as linear growth or exponential growth. This embodiment preferably uses exponential growth and introduces a maximum upper limit for the retry interval to avoid the problem from becoming unrecoverable for an extended period due to excessively long retry intervals.

[0068] In some embodiments, refer to Figure 6 , Figure 6 The specific process diagram for re-establishing the communication connection is as follows: When the main control module detects that the communication module has failed to establish a communication connection with the cloud platform, it controls the communication module to re-establish the communication connection with the cloud platform based on the retry interval. This may include the following steps: Step S151: Initialize the retry counter. When the main control module detects that the communication module has failed to connect with the cloud platform, it reads the retry count of the retry counter.

[0069] The main control module maintains a retry counter in its memory. Before the first communication attempt, the value of this counter, `retry_count`, is initialized to 0. Whether it's a short-connection mode or a periodic synchronization mode connection, after a communication connection attempt fails, the main control module reads the current `retry_count` value.

[0070] Step S152: Obtain the preset initial interval, determine the retry interval based on the initial interval and the retry count, and add jitter to the retry interval.

[0071] The system presets a basic initial retry interval, for example, base_delay = 1 minute. Then, it calculates an original retry interval raw_delay based on the retry count. Specifically, raw_delay = base_delay * (2 ^ retry_count). For example, when retry_count is 0, raw_delay is 1 minute; when retry_count is 1, raw_delay is 2 minutes; when retry_count is 2, raw_delay is 4 minutes, and so on.

[0072] However, if a large number of locks enter the retry process at the same time for the same reason, such as a base station in a certain area recovering after a brief failure, the calculated raw_delay may be the same, which will cause a large number of locks to flood into the network at almost the same time, causing network failure.

[0073] To address this issue, this embodiment adds or subtracts a random increment `jitter` from the calculated original retry interval `raw_delay`. The final `final_delay` = `raw_delay` + `random(-max_jitter, +max_jitter)`. For example, `max_jitter` is set to 0.2 * `raw_delay`. This ensures that the final waiting time for each lock is randomly distributed within a certain range, effectively avoiding retry synchronization problems.

[0074] Step S153: Update the retry counter. When the retry interval after adding jitter is reached, control the communication module to re-establish the communication connection with the cloud platform.

[0075] After calculating the final_delay, the main control module first increments the retry_count by 1, and then sets a low-power timer with a duration of final_delay. When the timer expires, the main control module wakes up the communication module again to attempt to re-establish the connection. If this retry fails again, steps S151 to S153 are repeated, and the retry count continues to increase.

[0076] To prevent retries from going on indefinitely, the system also sets a maximum number of retries or a maximum retry interval. When the limit is reached, the main control module will temporarily give up on retries, record the failure in the local log, and put the communication module into sleep mode, waiting for the next synchronization cycle or a new event to trigger before retrying.

[0077] Through the aforementioned retry mechanism with jitter, the door lock communication method of this disclosure not only ensures the final success rate of communication, but also maximizes the protection of battery power and maintains the network health of the entire Internet of Things system.

[0078] In some embodiments, there is a priority relationship between the event-driven short connection mode and the periodic synchronization mode. In order to meet the real-time requirements of the target event, the event-driven short connection mode has a higher priority than the periodic synchronization mode.

[0079] When the main control module detects that the timer period has been reached, that is, when the door lock is in the process of executing the periodic synchronization mode, if the main control module detects a new target event at this time, the main control module will interrupt the current periodic synchronization mode and control the communication module to enter the short connection mode.

[0080] The interruption of the current periodic synchronization mode does not involve an immediate and abrupt severing of the communication connection. The main control module first assesses the completion status of the current periodic synchronization task. If the currently executing task has just finished sending data, the main control module will control the communication module to pause subsequent synchronization tasks and immediately switch to short-connection mode for event reporting. If a large data packet is being transmitted, to avoid wasting already sent data, the main control module can choose to wait for the current data packet to complete transmission and receive confirmation before pausing subsequent tasks. After preemption occurs, the control flow enters short-connection mode. The communication module utilizes the existing network connection to send the event data packet of the target event to the cloud platform with the highest priority.

[0081] After the short connection mode ends, the main control module will control the communication module to resume from the interrupted point and enter the periodic synchronization mode. That is, after the emergency event is handled, the door lock will intelligently resume the previously interrupted tasks, continuing the synchronization work from where it left off, such as log uploading and instruction downloading. Only when all interrupted periodic synchronization tasks are completed, i.e., after the periodic synchronization mode ends, will the main control module finally control the communication module to enter sleep mode.

[0082] The above processing not only ensures the highest real-time performance of the target event, but also ensures that periodic tasks are not delayed or missed indefinitely, achieving efficient collaboration between the two modes.

[0083] In some embodiments, the communication module establishes a communication connection with the cloud platform through a mobile communication network, such as a 4G Cat.1 communication module. When the main control module detects that the signal strength of the communication module is lower than a preset signal strength threshold, the duration of the sleep mode is extended.

[0084] The main control module periodically or irregularly obtains the signal strength indication or reference signal reception power of the current cell via AT commands from the communication module. When the main control module detects that the signal strength of the communication module is lower than a preset signal strength threshold, it determines that the network environment at the current location of the door lock is poor. In this case, frequent attempts to connect to the network not only have a low success rate but also lead to a sharp increase in power consumption because the communication module needs to transmit data at a higher transmission power. For example, the main control module can dynamically extend the timer period of the periodic synchronization mode from the default 4 hours to 8 hours or even 12 hours. At the same time, for non-critical events, such as normal user unlocking records, they can be cached locally and reported only after the signal recovers or in the next long period. The communication module is only awakened in the event of a real emergency, thereby effectively reducing power consumption of the door lock in signal dead zones.

[0085] In some embodiments, when the main control module detects that the door lock battery level is lower than a preset power threshold, it extends the timer period and disables non-door lock key functions.

[0086] The door lock's battery management unit continuously monitors the remaining battery capacity. The main control module reads this data via an ADC. When the main control module detects that the door lock battery level is below a preset threshold, the system determines that the battery has entered low-battery protection mode. At this point, to ensure the door lock's security functions can continue for as long as possible, the main control module can extend the timer period and disable non-key functions. For example, the main control module can significantly extend the timer period in the periodic synchronization mode from a few hours to 24 or even 48 hours, thereby greatly reducing the energy consumed by periodic communication. Simultaneously, if the door lock has a voice prompt function, the volume will be turned off or lowered. If the door lock has a touchscreen or breathing light effect, the brightness will be turned off or reduced. In this mode, the event-driven short-connection mode still operates, but the reported content can include a low-battery alarm event, prompting the user to replace the battery as soon as possible. Only when the battery level drops further to a lower threshold may the communication module be completely disabled, retaining only the door lock's most basic local unlocking function until the battery is replaced. After the battery is replaced, the system will be reinitialized, and all extended cycles and disabled functions will be restored to normal.

[0087] Through the two adaptive adjustment mechanisms described above, the door lock communication method provided in this embodiment can improve the reliability of door lock communication.

[0088] Reference Figure 7 , Figure 7 This is a partial structural diagram of a door lock provided in an embodiment of the present disclosure. The door lock includes a main control module 701 and a communication module 702: The main control module 701 is used to control the communication module 702 to enter sleep mode after the door lock system is initialized. In sleep mode, the power consumption of the communication module 702 is less than a preset power consumption threshold. The main control module 701 is also used to monitor wake-up sources, including event-triggered wake-up and timer-period wake-up; The main control module 701 is also used to wake up the communication module 702, which is in sleep mode, when a target event is detected, and control the communication module 702 to enter short connection mode. After the short connection mode ends, the main control module 701 controls the communication module 702 to enter sleep mode. The main control module 701 is also used to wake up the communication module 702, which is in sleep mode, when the timer period is reached, and control the communication module 702 to enter the periodic synchronization mode. After the periodic synchronization mode ends, the main control module 701 controls the communication module 702 to enter the sleep mode.

[0089] The above-mentioned door lock and door lock communication method are based on the same inventive concept, and therefore have all the beneficial effects of door lock communication method, which will not be repeated here.

[0090] This disclosure also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the aforementioned door lock communication method.

[0091] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0092] The embodiments described in this disclosure are for the purpose of more clearly illustrating the technical solutions of this disclosure and do not constitute a limitation on the technical solutions provided by this disclosure. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by this disclosure are also applicable to similar technical problems.

[0093] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this disclosure, and may include more or fewer steps than shown, or combine certain steps, or different steps.

[0094] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of the embodiments disclosed herein, depending on actual needs.

[0095] Those skilled in the art will understand that all or some of the steps, apparatuses, or functional modules / units in the methods disclosed above can be implemented as software, firmware, hardware, or suitable combinations thereof.

[0096] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in this disclosure and the foregoing drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, apparatus, product, or device that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.

[0097] It should be understood that in this disclosure, "at least one item" means one or more, and "more than one" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0098] In the several embodiments provided in this disclosure, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0099] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of the embodiments of this disclosure, depending on actual needs.

[0100] Furthermore, the functional units in the various embodiments of this disclosure can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0101] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0102] The preferred embodiments of the present disclosure have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present disclosure. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and spirit of the present disclosure shall be within the scope of the claims of the present disclosure.

Claims

1. A door lock communication method, characterized in that, Applied to door locks, the door lock includes a main control module and a communication module, and the door lock communication method includes: After the door lock system is initialized, the main control module controls the communication module to enter a sleep mode, wherein the power consumption of the communication module in the sleep mode is less than a preset power consumption threshold. The main control module monitors wake-up sources, including event-triggered wake-up and timer-period wake-up; When the main control module detects a target event, the main control module wakes up the communication module which is in sleep mode and controls the communication module to enter short connection mode. After the short connection mode ends, the main control module controls the communication module to enter sleep mode. When the main control module detects that the timer period has been reached, the main control module wakes up the communication module which is in sleep mode and controls the communication module to enter the periodic synchronization mode. After the periodic synchronization mode ends, the main control module controls the communication module to enter sleep mode.

2. The door lock communication method according to claim 1, characterized in that, The process of controlling the communication module to enter short connection mode and then controlling the communication module to enter sleep mode after the short connection mode ends includes: The communication module is controlled to attach to the network and establish a communication connection with the cloud platform within a preset duration, wherein the duration of the communication connection is less than a preset duration threshold, and the duration threshold is less than the timer period. The communication module sends the event data packet corresponding to the target event to the cloud platform, and the capacity of the event data packet is less than a preset capacity threshold. When the communication module receives a confirmation message from the cloud platform, it releases the communication connection established with the cloud platform, and the main control module controls the communication module to enter sleep mode.

3. The door lock communication method according to claim 1, characterized in that, The process of controlling the communication module to enter a periodic synchronization mode, and then controlling the communication module to enter a sleep mode after the periodic synchronization mode ends, includes: The communication module is controlled to attach to the network and establish a communication connection with the cloud platform to synchronize data. After the communication module completes data synchronization, it releases the communication connection established with the cloud platform, and the main control module controls the communication module to re-enter sleep mode.

4. The door lock communication method according to claim 3, characterized in that, The data synchronization includes at least one of the following tasks: uploading non-urgent logs accumulated in the previous timer cycle, synchronizing system time, checking and downloading pending instructions issued by the cloud platform, checking for firmware upgrades, and reporting complete device status information.

5. The door lock communication method according to claim 2 or 3, characterized in that, The door lock communication method further includes: When the main control module detects that the communication module has failed to establish a communication connection with the cloud platform, it controls the communication module to re-establish a communication connection with the cloud platform based on the retry interval until the communication module successfully establishes a communication connection with the cloud platform. The retry interval is gradually extended.

6. The door lock communication method according to claim 5, characterized in that, When the main control module detects that the communication module has failed to establish a communication connection with the cloud platform, it controls the communication module to re-establish a communication connection with the cloud platform based on the retry interval, including: Initialize the retry counter. When the main control module detects that the communication module has failed to connect with the cloud platform, it reads the retry count of the retry counter. Obtain a preset initial interval, determine a retry interval based on the initial interval and the retry count, and add jitter to the retry interval; Update the retry counter, and when the retry interval after adding jitter is reached, control the communication module to re-establish the communication connection with the cloud platform.

7. The door lock communication method according to claim 1, characterized in that, The door lock communication method further includes: When the main control module detects that the timer period has been reached, if the target event is detected during the period synchronization mode, the main control module interrupts the period synchronization mode and controls the communication module to enter the short connection mode. After the short connection mode ends, the control module controls the communication module to enter the periodic synchronization mode from the interrupt node. After the periodic synchronization mode ends, the main control module controls the communication module to enter the sleep mode.

8. The door lock communication method according to claim 1, characterized in that, The communication module establishes a communication connection with the cloud platform via a mobile communication network, and the door lock communication method further includes at least one of the following: When the main control module detects that the signal strength of the communication module is lower than the preset signal strength threshold, the duration of the sleep mode is extended. When the main control module detects that the door lock battery level is lower than the preset power threshold, it extends the timer period and disables non-door lock key functions.

9. A door lock, characterized in that, Includes the main control module and the communication module: The main control module is used to control the communication module to enter a sleep mode after the system initialization of the door lock, wherein the power consumption of the communication module in the sleep mode is less than a preset power consumption threshold. The main control module is also used to monitor wake-up sources, including event-triggered wake-up and timer-period wake-up; The main control module is also used to wake up the communication module in sleep mode when a target event is detected, control the communication module to enter short connection mode, and control the communication module to enter sleep mode after the short connection mode ends. The main control module is also used to detect when the timer period is reached, wake up the communication module which is in sleep mode, control the communication module to enter the periodic synchronization mode, and control the communication module to enter the sleep mode after the periodic synchronization mode ends.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the door lock communication method according to any one of claims 1 to 8.