Bluetooth electronic door lock, unlocking control method and storage medium

By combining internal and external Bluetooth modules and a directional antenna, the signal round-trip time and phase/amplitude are measured, solving the problem of misjudgment in Bluetooth electronic door locks, enabling accurate determination of user location, and improving security and user experience.

CN121075013APending Publication Date: 2025-12-05SHENZHEN LANKE XUNTONG TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511340353.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-19
Publication Date
2025-12-05

AI Technical Summary

Technical Problem

Existing Bluetooth electronic door locks rely on signal strength to estimate distance for unlocking, which is susceptible to environmental interference and can lead to misjudgments. They cannot accurately distinguish whether the user is inside or outside the door, posing security risks and user experience issues.

Method used

By employing dual Bluetooth modules (inner and outer sides) combined with a directional antenna, the system accurately determines the user's location by measuring the round-trip time and phase/amplitude of the signal. This enhances the directivity of the directional antenna, suppresses signal interference in non-target areas, and achieves precise spatial positioning.

Benefits of technology

It effectively avoids unintended unlocking behavior caused by accidental triggering of indoor devices, improves positioning accuracy and security, and enhances user experience and door lock reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121075013A_ABST
    Figure CN121075013A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of intelligent door locks, and discloses a Bluetooth electronic door lock, an unlocking control method and a storage medium. By arranging the inner and outer Bluetooth modules and comparing the round-trip time and phase / amplitude, accurate judgment of the position of a user is realized in combination with the directional antenna, the inside and outside states of the door are effectively distinguished, the problem of misjudgment caused by the fact that a traditional scheme depends on single signal strength is solved, and the system has the advantages of improving the positioning accuracy and safety and reducing the risk of misoperation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of smart door lock technology, and in particular to a Bluetooth electronic door lock, an unlocking control method, and a storage medium. Background Technology

[0002] With the continuous development of wireless control technology, smart electronic door locks have achieved keyless unlocking. Current keyless unlocking is mainly achieved through NFC and Bluetooth. Bluetooth keyless unlocking schemes estimate the distance based on the Bluetooth signal strength and unlock when the distance meets a set value.

[0003] However, this approach has significant drawbacks: First, relying solely on signal strength for distance judgment is susceptible to environmental interference, leading to misjudgments. Second, existing solutions cannot accurately distinguish whether the user is inside or outside the door; unlocking is triggered as long as the distance condition is met, causing unnecessary unlocking operations when the user is indoors, impacting user experience and posing security risks. Furthermore, current technology lacks a precise mechanism for determining the location of Bluetooth devices, failing to effectively prevent unauthorized unlocking. These issues severely limit the reliability and security of Bluetooth electronic door locks in practical applications. Summary of the Invention

[0004] The main objective of this invention is to solve the problem of accidental unlocking that occurs with existing Bluetooth proximity unlocking solutions.

[0005] The first aspect of the present invention provides a Bluetooth electronic door lock, comprising: a first Bluetooth module, a second Bluetooth module, and an electronic lock body;

[0006] The first Bluetooth module and the second Bluetooth module are electrically connected to the electronic lock body; both the first Bluetooth module and the second Bluetooth module are equipped with directional antennas, the first Bluetooth module is installed on the side of the electronic lock body closer to the outside of the door, and the second Bluetooth module is installed on the side of the electronic lock body closer to the inside of the door;

[0007] The first Bluetooth module and the second Bluetooth module receive Bluetooth signals returned by authorized Bluetooth devices based on the broadcast through a directional antenna, and after adding the identifier of the first Bluetooth module or the second Bluetooth module, send them to the electronic lock body;

[0008] The electronic lock body extracts the round-trip time and phase / amplitude of the Bluetooth signals received by the first Bluetooth module and the second Bluetooth module respectively, compares the round-trip time and phase / amplitude extracted from the two Bluetooth signals, and triggers unlocking based on the comparison result.

[0009] Optionally, the first Bluetooth module includes a first Bluetooth circuit and a first directional antenna. The first directional antenna is installed on the side of the electronic lock body near the outside of the door, and the signal transmission and reception direction of the first directional antenna is towards the outside space. It is connected to the electronic lock body through the first Bluetooth circuit.

[0010] The second Bluetooth module includes a second Bluetooth circuit and a second directional antenna. The second directional antenna is installed on the side of the electronic lock body closer to the inside of the door, and the signal transmission and reception direction of the second directional antenna is towards the space inside the door. It is connected to the electronic lock body through the second Bluetooth circuit.

[0011] Optionally, the electronic lock body includes: a lock, a drive module, and a main control module; the lock is connected to the main control module through the drive module;

[0012] The main control module parses the Bluetooth signals sent by the first Bluetooth module and the second Bluetooth module respectively, extracts the round-trip time and phase / amplitude; uses the round-trip time and phase / amplitude of the first Bluetooth module as the main trigger feature of the lock and the round-trip time and phase / amplitude of the second Bluetooth module as the auxiliary trigger feature of the lock, performs unlocking identification according to the unlocking logic, and outputs a drive signal based on the identification result;

[0013] The drive module drives the lock to open and close based on the drive signal.

[0014] A second aspect of the present invention provides an unlocking control method for a Bluetooth electronic door lock as described above, the unlocking control method comprising:

[0015] Detect whether there are authorized Bluetooth devices within the signal coverage area of ​​the Bluetooth electronic door lock;

[0016] If present, the first Bluetooth module collects the Bluetooth signal emitted by the Bluetooth device and outputs it as the main trigger signal; the second Bluetooth module collects the Bluetooth signal emitted by the Bluetooth device and outputs it as an auxiliary signal.

[0017] The round-trip time and phase / amplitude of the main trigger signal and the auxiliary signal are extracted respectively, and the Bluetooth device is located based on the time delay characteristics of the two signals;

[0018] Unlocking control is performed based on the positioning results and the round-trip time of the signal.

[0019] Optionally, before performing the unlocking control based on the positioning result and the round-trip time, the method further includes:

[0020] The request is to collect multi-frequency detection signals from authorized Bluetooth devices.

[0021] By comparing the phase / amplitude differences at different frequency points in the multi-band detection signals, the first distance between the Bluetooth device and the Bluetooth electronic door lock is calculated;

[0022] Calculate the round-trip time of the multi-frequency detection signal, and determine a second distance between the Bluetooth device and the Bluetooth electronic door lock based on the round-trip time;

[0023] Based on the first distance and the second distance, the positioning results are cross-validated, and the positioning results are output.

[0024] Optionally, the multi-band detection signal includes three detection signals of different frequencies; the step of comparing the phase / amplitude differences at different frequency points in the multi-band detection signal to calculate the first distance between the Bluetooth device and the Bluetooth electronic door lock includes:

[0025] Calculate the phase difference between the probe signal at each frequency and the standard probe signal;

[0026] Using a preset distance calculation formula, based on the distances corresponding to each phase difference, and averaging the distances, a first distance between the Bluetooth device and the Bluetooth electronic door lock is obtained; the distance calculation formula is:

[0027] Where Δφ is the phase difference, c is the speed of light, and Δf is the frequency difference.

[0028] Optionally, the unlocking control based on the positioning result and the round-trip time includes:

[0029] Extract the identity identifier carried in the main trigger signal, and verify the legitimacy of the authorized Bluetooth device based on the identity identifier;

[0030] Determine whether the positioning result is less than a preset unlocking threshold, and whether the round-trip time meets the preset characteristics of the area outside the door;

[0031] If all conditions are met, an unlocking signal is generated to drive the lock to unlock.

[0032] Optionally, the unlocking control based on the positioning result and the round-trip time further includes:

[0033] Real-time monitoring of ambient noise and determination of whether the ambient noise exceeds a preset threshold, wherein the ambient noise is the Bluetooth channel occupancy rate;

[0034] If so, the preset unlock threshold will be reduced according to the preset level.

[0035] Optionally, after locating the Bluetooth device based on the time delay characteristics of the two signals, the method further includes:

[0036] The first Bluetooth module is controlled to randomly generate N challenge codes and send them to the Bluetooth device. A timer is started to detect whether the Bluetooth device returns a hash value based on the challenge code and key before the timer expires.

[0037] If not, immediately terminate the location tracking of the Bluetooth device, mark the Bluetooth device as a suspicious device, and temporarily block the communication permissions of the Bluetooth device if no hash value is received for M consecutive times.

[0038] A third aspect of the present invention provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the steps of the above-described unlocking control method.

[0039] The aforementioned Bluetooth electronic door lock, door lock control method, and storage medium. In this embodiment of the invention, by setting up dual Bluetooth modules on both the inner and outer sides and comparing round-trip time and phase / amplitude, combined with a directional antenna, the user's location is accurately determined, effectively distinguishing between the inside and outside states of the door. This solves the problem of misjudgment caused by relying on a single signal strength in traditional solutions, and has the advantages of improving positioning accuracy and security, and reducing the risk of misoperation.

[0040] Other features and advantages of the invention will be set forth in the description which follows, 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 are realized and obtained in accordance with the structures particularly pointed out in the description, claims and drawings.

[0041] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0042] Figure 1 This is a schematic diagram of a first embodiment of the Bluetooth electronic door lock provided by the present invention;

[0043] Figure 2 This is a schematic diagram of a second embodiment of the Bluetooth electronic door lock provided by the present invention;

[0044] Figure 3 A schematic diagram showing the positions of each module of the Bluetooth electronic door lock provided in an embodiment of the present invention;

[0045] Figure 4 This is a schematic diagram of an embodiment of the unlocking control method for a Bluetooth electronic door lock provided in this invention. Detailed Implementation

[0046] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0047] The terms "comprising" and "having," and any variations thereof, used in the embodiments of this invention are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the steps or units listed, but may optionally include other steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices.

[0048] In existing technologies, with the widespread adoption of wireless control technology, Bluetooth electronic door locks achieve keyless unlocking by estimating distance based on signal strength. However, such solutions cannot distinguish whether the device is inside or outside the door. When a user is indoors, if the signal strength reaches a threshold, it may lead to accidental unlocking, posing a security risk and affecting the user experience. For example, when a user is resting inside the door with an authorized device, the door lock may accidentally unlock due to sufficient signal strength.

[0049] To address the aforementioned issues, this application proposes a scheme for determining the spatial location of a Bluetooth device. Based on the difference in signal propagation paths inside and outside a door, dual modules are used to cover the areas inside and outside the door respectively. By combining round-trip time and phase / amplitude, spatial orientation can be determined. Furthermore, a directional antenna can enhance signal directionality. By comparing the differences in the physical characteristics of the signals received by the two modules, the location of the device can be accurately determined.

[0050] like Figure 1 As shown, this application provides a Bluetooth electronic door lock, which includes a first Bluetooth module 110, a second Bluetooth module 120, and an electronic lock body 130. The first Bluetooth module 110, the second Bluetooth module 120, and the electronic lock body 130 are electrically connected by wires. These wires can be communication buses or conventional jumpers, and can simultaneously transmit power and control signals.

[0051] The first Bluetooth module 110 is installed on the outside of the door, and the second Bluetooth module 120 is installed on the inside of the door. Both are equipped with directional antennas and are electrically connected to the electronic lock body 130. After receiving Bluetooth signals from authorized devices, the two Bluetooth modules attach an identifier and send it to the electronic lock body 130. The electronic lock body 130 extracts the round-trip time and phase / amplitude of the two signals and compares them. Based on the comparison result, it triggers unlocking.

[0052] Specifically, the first Bluetooth module 110 and the second Bluetooth module 120 receive Bluetooth signals returned by authorized Bluetooth devices based on the broadcast through a directional antenna, and after adding the identifier of the first Bluetooth module 110 or the second Bluetooth module 120, send them to the electronic lock body 130; the electronic lock body 130 extracts the round-trip time and phase / amplitude of the Bluetooth signals received by the first Bluetooth module 110 and the second Bluetooth module 120 respectively, compares the round-trip time and phase / amplitude extracted from the two Bluetooth signals, and triggers unlocking based on the comparison result.

[0053] It should be noted that a directional antenna is an antenna with directional radiation characteristics, which can be implemented using microstrip patch antennas or waveguide slot antennas. Its main radiating lobe is oriented towards a specified spatial area to suppress interference from signals in other directions.

[0054] Round-trip time (RTT) refers to the total time it takes for a signal to travel from the initiator to the reflector and back. By measuring this time and considering the speed of wireless signal propagation (approximately the speed of light), the distance between the two devices can be estimated.

[0055] Phase / amplitude measurement estimates distance by analyzing the phase changes of wireless signals transmitted at different frequencies (channels). Its basic principle is:

[0056] The initiator and reflector exchange signals at multiple frequencies.

[0057] At each frequency, the device collects the I / Q (In-phase / Quadrature) data of the signal to obtain phase information.

[0058] Since the wavelength of a signal differs at different frequencies, comparing the phase difference at each frequency can eliminate the uncertainty of integer wavelengths, thereby obtaining a more accurate distance estimate.

[0059] The electronic lock body 130 can be based on an existing mechanical door lock, and obtained through electronic control improvement. This electronic control improvement can be understood as using electronic devices such as digital signal processors and relays to design the electric control of the lock tongue, and giving the digital signal processor the function of feature extraction and comparison operation, such as determining the position of the device through preset logic.

[0060] Specifically, when an authorized Bluetooth device enters the signal coverage area of ​​both Bluetooth modules, the first Bluetooth module 110 on the outside of the door receives the signal via a directional antenna and adds an outside-door identifier, while the second Bluetooth module 120 on the inside of the door simultaneously receives the signal and adds an inside-door identifier. The electronic lock body 130 analyzes the two signals respectively, extracting signal strength and delay data. By comparing the signal strength differences between the two modules, it can determine whether the device is near the outside or inside of the door; simultaneously, by analyzing the differences in delay characteristics, it can identify whether the signal propagation path passes through the door / wall structure. When the round-trip time and phase / amplitude on the outside of the door meet the preset conditions, while the characteristics on the inside of the door deviate significantly, it is determined that the device is outside the door and unlocking is triggered.

[0061] Compared to existing technologies, traditional solutions rely on the strength threshold of a single module, failing to eliminate misjudgments in areas where signals overlap between the inside and outside of a door. The solution provided in this application utilizes dual Bluetooth modules working collaboratively, combined with a directional antenna and multi-dimensional signal feature analysis, to establish a spatial positioning model, effectively distinguishing the actual location of the device. For example, when the device is inside a door, the signal strength received by the Bluetooth module inside the door may be higher due to the device's proximity to the antenna, but the latency characteristic is lower due to the shorter direct path, creating a significant difference from the characteristics outside the door, thus avoiding false triggering. Simultaneously, it can accurately identify the spatial location of the Bluetooth device, preventing accidental unlocking in door-indoor scenarios. The directional antenna enhances directional selectivity, the feature comparison of the dual Bluetooth modules eliminates single-point measurement errors, and the latency feature analysis improves positioning accuracy, ultimately achieving safe and reliable keyless unlocking control.

[0062] In this embodiment, the first Bluetooth module 110 includes a first Bluetooth circuit 111 and a first directional antenna 112. The first directional antenna 112 is installed on the side of the electronic lock body 130 near the outside of the door, and the signal transmission and reception direction of the first directional antenna 112 faces the space outside the door. It is communicatively connected to the electronic lock body 130 through the first Bluetooth circuit 111. The second Bluetooth module 120 includes a second Bluetooth circuit 121 and a second directional antenna 122. The second directional antenna 122 is installed on the side of the electronic lock body 130 near the inside of the door, and the signal transmission and reception direction of the second directional antenna 122 faces the space inside the door. It is communicatively connected to the electronic lock body 130 through the second Bluetooth circuit 121. Figure 2 As shown.

[0063] The Bluetooth circuitry can be implemented using an integrated Bluetooth chip and peripheral circuitry, including a baseband processor, an RF transceiver, and a power management unit. This module converts the RF signals received by the directional antenna into digital signals and transmits them to the electronic lock body.

[0064] Directional antennas can also be implemented using microstrip antennas or array antennas, with their signal transmission and reception directions limited to either outside or inside the gate space. By enhancing the signal gain in a specific direction, interference signals from other directions are suppressed. Specifically, the first directional antenna 112 is configured with a horizontal beamwidth not exceeding 90° and a vertical beamwidth not exceeding 60°, while the second directional antenna 122 is configured with a gain 3-5 dB lower than the first directional antenna 112 to enhance the priority of receiving signals outside the gate.

[0065] The Bluetooth circuit and the electronic lock body 130 can communicate via a serial communication interface or a wireless communication protocol, such as transmitting data through a UART interface. This connection is used to transmit information containing signal identifiers to the electronic lock body 130 for further processing.

[0066] like Figure 3 As shown, with the electronic lock body 130 as the center, the area to the left of the electronic lock body 130 is defined as outside the door, and the area to the right of the electronic lock body 130 is defined as inside the door. The first Bluetooth module 110 transmits and receives Bluetooth signals towards the space outside the door through the first directional antenna 112, and the second Bluetooth module 120 transmits and receives Bluetooth signals towards the space inside the door through the second directional antenna 122. When an authorized Bluetooth device is outside the door, the signal strength received by the first directional antenna 112 is significantly higher than that of the second directional antenna 122, and the phase / amplitude characteristics match the propagation path in the space outside the door; conversely, when the device is inside the door, the signal characteristics of the second directional antenna 112 are dominant. The two Bluetooth modules transmit the received signals to the electronic lock body 130 after adding an identifier, and the direction of the signal source can be determined by comparing the identifier. Thus, the electronic lock body 130 can determine the device position based on the direction of the signal source and the phase / amplitude, avoiding false triggering caused by the omnidirectional antenna's inability to distinguish between the inside and outside scenes.

[0067] In other words, by using a split-type directional antenna design, signals outside and inside the door are physically isolated. The antenna's directivity enhances signal coverage in the target area while suppressing signal interference in non-target areas. For example, when a user moves around indoors with their device, the signal strength of the second directional antenna 122 is further attenuated by the door structure, while the first directional antenna 112, facing outwards, cannot effectively receive indoor signals, thus forming a dual isolation mechanism.

[0068] By implementing the above technical solution, the spatial location of Bluetooth devices—whether inside or outside the door—can be accurately distinguished, avoiding unintended unlocking behavior caused by accidental triggering of indoor devices. For example, when a user places an authorized mobile phone on a table inside the door, the round-trip time received by the second Bluetooth module 120 may exceed a threshold. However, because its signal direction is limited to the space inside the door, the electronic lock body 130 can determine it as an invalid unlocking request based on the direction indicator. This solution effectively solves the problem in existing technologies where distance is determined solely by signal strength without being able to identify spatial orientation, thus improving the accuracy of door lock control and user experience.

[0069] In another embodiment, an electronic lock body 130 is proposed, comprising a lock 131, a drive module 132, and a main control module 133. The lock 131 is connected to the main control module 133 via the drive module 132. The main control module 133 analyzes the Bluetooth signals sent by the first Bluetooth module 110 and the second Bluetooth module 120, extracting the round-trip time and phase / amplitude. Using the round-trip time and phase / amplitude of the first Bluetooth module 110 as the main trigger feature of the lock and the round-trip time and phase / amplitude of the second Bluetooth module 120 as the auxiliary trigger feature of the lock, the unlocking logic is used for unlocking identification, and a drive signal is output based on the identification result. The drive module 132 drives the lock 131 to open and close based on the drive signal.

[0070] In practical applications, the main control module 133 refers to the core processing unit used to process Bluetooth signals and control the lock's actions. Specifically, it can be implemented using an embedded microcontroller, which achieves positioning judgment by parsing the characteristic parameters in the Bluetooth signal.

[0071] The drive module 132 is an actuator that converts electrical signals into mechanical actions. Specifically, it can be implemented using a motor drive circuit. It controls the extension and retraction of the bolt in the lock 131 according to the instructions of the main control module 133. The lock 131 is a mechanical structure that locks the door. Specifically, it can be implemented using an electromagnetic lock or a motor-driven mechanical lock structure. Its operation is directly controlled by the drive module 132.

[0072] Specifically, after receiving Bluetooth signals from the first Bluetooth module 110 and the second Bluetooth module 120, the main control module 133 first decodes the signals to obtain device identity information, and then measures the round-trip time of the two channels and records the phase / amplitude.

[0073] The primary trigger feature is generated by a signal collected by a first Bluetooth module 110 installed facing outwards, while the secondary trigger feature is generated by a signal collected by a second Bluetooth module 120 installed facing inwards. Both feature parameters are simultaneously input to the unlocking logic judgment unit for comparison. When the primary trigger feature meets the preset external area judgment conditions and the secondary trigger feature does not reach the internal trigger threshold, a drive signal is generated and sent to the drive module 132. Upon receiving a valid drive signal, the drive module 132 controls the motor inside the lock 131 to perform the unlocking action, completing the door lock state switch. In other words, through a dual-channel signal feature comparison mechanism combined with the spatial coverage characteristics of a directional antenna, the actual location of the device can be effectively identified, avoiding false triggering issues in indoor scenarios. Simultaneously, it can accurately distinguish the spatial positions of authorized devices on both sides of the door, eliminating false unlocking indoors due to single signal strength judgments. Furthermore, delay feature analysis enhances positioning reliability, improving the security of the door lock system while maintaining convenience.

[0074] In this embodiment, by working collaboratively with dual Bluetooth modules and combining directional antennas with multi-dimensional signal feature analysis, a spatial positioning model is established to effectively distinguish the actual location of the device. For example, when the device is inside a door, the signal strength received by the Bluetooth module on the inside of the door may be higher due to the device's proximity to the antenna, but the latency characteristic is lower due to the shorter direct path, forming a significant difference from the characteristics on the outside of the door. This allows for accurate identification of the Bluetooth device's spatial location and avoids accidental unlocking in door-indoor scenarios.

[0075] Based on the Bluetooth electronic door lock provided above, this application also provides an unlocking control method, applied to the Bluetooth electronic door lock provided in the above embodiments. Please refer to [link to relevant documentation]. Figure 4 The unlocking control method for a Bluetooth electronic door lock proposed in this embodiment of the invention specifically includes the following steps:

[0076] 410. Detect whether there are authorized Bluetooth devices within the signal coverage area of ​​the Bluetooth electronic door lock;

[0077] In this embodiment, the signal coverage range refers to the spatial area in which the Bluetooth module can effectively receive the Bluetooth device signal. The size of this range can be achieved by adjusting the antenna gain and transmission power. For example, when the antenna gain is set to 5dBi and the transmission power is controlled at 4dBm, a coverage area with a radius of about 10 meters can be formed.

[0078] Specifically, when a Bluetooth device enters the coverage area, the Bluetooth modules installed on both the inside and outside of the door simultaneously collect signal data.

[0079] 420, if present, the first Bluetooth module collects the Bluetooth signal emitted by the Bluetooth device and outputs it as the main trigger signal, and the second Bluetooth module collects the Bluetooth signal emitted by the Bluetooth device and outputs it as an auxiliary signal.

[0080] The main trigger signal here is defined as the Bluetooth signal data collected by the first Bluetooth module facing outwards. Specifically, it can be generated by parsing the field strength indication value and timestamp information in the data packet, and is used to determine whether the device is in the valid unlocking area outside the door.

[0081] The round-trip time parameter carried by the main trigger signal is used to determine the straight-line distance between the device and the door lock, while the phase / amplitude in the auxiliary signal is used to identify differences in the signal propagation path.

[0082] 430. Extract the round-trip time and phase / amplitude from the main trigger signal and auxiliary signal respectively, and locate the Bluetooth device based on the time delay characteristics in the two signals;

[0083] Delay characteristics refer to the propagation delay parameters generated during signal transmission. Specifically, this can be obtained by calculating the signal arrival time difference. For example, device location can be determined by comparing the time difference between the first and second Bluetooth modules receiving the same data packet. This is achieved by comparing the phase changes of the wireless signals received by the two modules at different frequencies (channels). If the measured distance is less than a set threshold (such as the thickness of a door), the device can be determined to be outside the door. In this case, combining the round-trip time with the preset threshold will trigger unlocking. This dual-judgment mechanism effectively eliminates false triggering of indoor devices.

[0084] 440, unlocking control is performed based on the positioning results and round-trip time.

[0085] When the positioning result indicates that the effective area outside the door and the round-trip time reach the preset threshold, an unlocking signal is output to control the main control module to unlock the bolt, thereby realizing the automatic opening of the door lock.

[0086] In this embodiment, before performing unlocking control based on the positioning result and the round-trip time, the method further includes:

[0087] The request is to collect multi-frequency detection signals from authorized Bluetooth devices.

[0088] By comparing the phase / amplitude differences at different frequency points in the multi-band detection signals, the first distance between the Bluetooth device and the Bluetooth electronic door lock is calculated;

[0089] Calculate the round-trip time of the multi-frequency detection signal, and determine a second distance between the Bluetooth device and the Bluetooth electronic door lock based on the round-trip time;

[0090] Based on the first distance and the second distance, the positioning results are cross-validated, and the positioning results are output.

[0091] It should be noted that multi-frequency detection signals refer to a sequence of detection signals containing multiple different frequencies. Specifically, this can be achieved using Bluetooth signals at three preset different frequencies. Transmitting signals at multiple frequencies reduces the impact of environmental interference on a single frequency. Phase difference refers to the phase shift difference generated during the transmission of signals of different frequencies. This can be achieved by comparing the phase difference between the received signal and the standard reference signal. The relative distance between the device and the door lock can be derived using the linear relationship between phase difference and distance. Round-trip time refers to the time required for the signal to travel from the door lock to the Bluetooth device and back. This can be achieved by starting a timer when sending the detection signal and stopping the timer when a response signal is received. The absolute distance can be calculated based on the product of the speed of light and time. Cross-validation refers to verifying the consistency between the distance calculated from the phase difference and the distance calculated from the round-trip time. This can be achieved using threshold comparison or error range matching algorithms. Double verification can eliminate errors caused by a single measurement method.

[0092] In practical applications, after a Bluetooth device enters the signal coverage area, the door lock actively sends a detection signal containing multiple frequencies, such as Bluetooth pulses at three different frequencies. Each frequency signal experiences phase shift during transmission due to path differences. By measuring the phase difference between each frequency and substituting it into a preset formula, the first distance between the device and the door lock can be calculated. Simultaneously, the round-trip time of the detection signal from transmission to reception is recorded, and a second distance is calculated using the speed of light. If the difference between the first and second distances is within a preset error range, the positioning result is considered valid; otherwise, the detection is re-initiated or the device is marked as abnormal. Therefore, through dual distance measurement and cross-validation, positioning accuracy can be improved and misjudgments caused by environmental interference can be reduced.

[0093] In another embodiment, the multi-band detection signal includes three detection signals of different frequencies; the step of comparing the phase / amplitude differences of different frequency points in the multi-band detection signal to calculate the first distance between the Bluetooth device and the Bluetooth electronic door lock includes:

[0094] Calculate the phase difference between the probe signal at each frequency and the standard probe signal;

[0095] Using a preset distance calculation formula, based on the distances corresponding to each phase difference, and averaging the distances, a first distance between the Bluetooth device and the Bluetooth electronic door lock is obtained; the distance calculation formula is: Where Δφ is the phase difference, c is the speed of light, and Δf is the frequency difference.

[0096] The three different frequency wireless signals here can be 2.4GHz, 2.41GHz, and 2.42GHz, specifically generated using frequency hopping sequences supported by the Bluetooth protocol. This feature eliminates ranging errors caused by environmental interference with a single frequency signal through multi-frequency measurement.

[0097] The distance calculation formula is based on a mathematical model of the relationship between phase difference and frequency difference. For example, by substituting Δφ and Δf into the formula and combining them with the speed of light parameter, the propagation distance can be calculated. This calculation process improves ranging accuracy through multi-frequency data fusion; for example, averaging the results from three frequency points can suppress random errors.

[0098] Specifically, when a Bluetooth device enters the communication range, the electronic door lock control module generates a sequence of detection signals at three different frequencies. Each frequency's detection signal is sent to the target device via the Bluetooth channel, while a standard reference signal of the same frequency is generated locally. The receiving end compares the phase of the returned signal with the reference signal, recording the phase difference values ​​corresponding to the three frequency points. The phase difference at each frequency point is used in a preset formula to calculate the distance. For example, for a 2.4GHz frequency point, if the measured phase difference is π / 2 and the frequency difference is 1MHz, the calculated distance is 37.5 meters. The calculation results for the three frequency points are then arithmetically averaged to output the final distance value. For example, if the three frequency points measure 35 meters, 38 meters, and 40 meters respectively, the final distance is determined to be 37.67 meters. This process effectively suppresses ranging errors caused by multipath effects through multi-frequency data redundancy.

[0099] The calculation of the phase difference also includes temperature compensation for the phase difference, specifically:

[0100] The Bluetooth module has a built-in temperature sensor that collects the ambient temperature (-20℃~60℃) in real time.

[0101] Based on the temperature-frequency drift curve, the phase / amplitude difference at each frequency point is corrected (e.g., for every 10° increase in temperature, the phase compensation is +0.5°).

[0102] Substitute the compensated phase difference into the distance calculation formula to ensure that the distance measurement error is ≤10 cm when the temperature changes.

[0103] In this embodiment, the unlocking control based on the positioning result and the round-trip time includes:

[0104] Extract the identity identifier carried in the main trigger signal, and verify the legitimacy of the authorized Bluetooth device based on the identity identifier;

[0105] Determine whether the positioning result is less than a preset unlocking threshold, and whether the round-trip time meets the preset characteristics of the area outside the door;

[0106] If all conditions are met, an unlocking signal is generated to drive the lock to unlock.

[0107] It should be noted that the identity identifier refers to the unique identification code assigned to a Bluetooth device during the authorization process. Specifically, it can be implemented using an encrypted MAC address or a device fingerprint, to ensure that only registered and legitimate devices can trigger the unlocking operation.

[0108] The preset unlock threshold refers to the maximum distance range from which the door lock is allowed to trigger unlocking, such as 2 meters. The specific range can be determined through signal propagation models and actual scenario testing, and is used to prevent long-distance signal spoofing attacks.

[0109] The characteristics of the area outside the door refer to the distribution pattern of Bluetooth round-trip time on both sides of the door. Specifically, it can be defined by the difference in round-trip time between the first Bluetooth module and the second Bluetooth module. For example, when the difference in the main trigger signal is lower than the difference in the auxiliary signal, it is determined that the device is outside the door.

[0110] Specifically, when a Bluetooth device enters the signal coverage area, the identity identifier in the main trigger signal is extracted and matched against the authorized list for verification. If the verification is successful, the system further determines whether the device is outside the door area: by comparing the positioning result with a preset unlock threshold and combining the round-trip time difference between the main trigger signal and the auxiliary signal, it is determined whether the device is outside the door. For example, if the positioning result shows that the device is less than 1.5 meters away from the door lock, and the round-trip time of the main trigger signal is lower than that of the auxiliary signal, the device is determined to be in a legal area outside the door, and an unlocking signal is generated to drive the lock to unlock.

[0111] In practical applications, authentication can be achieved by having the Bluetooth device generate a dynamic authentication code via its built-in security chip (SE) after receiving a ranging request from a multi-band signal. This authentication code is calculated based on the terminal device's unique identifier (UDID), the current timestamp, and a pre-stored key. The first Bluetooth module compares the received authentication code with the expected value generated locally using the same algorithm. If they match, the electronic key ID is extracted and matched against the pre-registered ID list in the door lock control unit. Authentication is then successful, and subsequent ranging operations are performed.

[0112] Furthermore, for unlocking control, the unlocking sensitivity can be dynamically adjusted according to the actual environmental conditions. Specifically, the unlocking control based on the positioning result and the round-trip time also includes: real-time monitoring of environmental noise and determining whether the environmental noise exceeds a preset threshold, wherein the environmental noise is the Bluetooth channel occupancy rate; if so, the preset unlocking threshold is reduced according to a preset level. This solves the problem of accumulated positioning errors caused by Bluetooth channel interference in existing technologies, maintains stable unlocking judgment logic in complex wireless environments, reduces the probability of false triggering or missed triggering caused by environmental noise, and improves the environmental adaptability of the door lock control system.

[0113] Among them, environmental noise refers to the Bluetooth channel occupancy rate, which can be achieved by periodically sampling the channel activity status using the radio frequency detection circuit of the Bluetooth module. This parameter reflects the interference level of the current wireless communication environment.

[0114] The unlocking threshold is set by determining the critical safe distance value under different scenarios through experimental testing, and its value is directly related to the reliability of the positioning algorithm.

[0115] The preset level refers to the gradient division rule for unlocking the threshold adjustment. Specifically, it can be implemented by adopting a linear or exponential decreasing step size strategy. For example, the threshold can be divided into three levels: high, medium, and low, with different reduction magnitudes.

[0116] Specifically, when the Bluetooth channel occupancy rate exceeds a preset threshold, it indicates the presence of numerous Bluetooth devices or wireless interference sources in the environment, potentially increasing signal transmission delay measurement errors. In this case, by gradually lowering the unlock threshold—for example, adjusting the original threshold from 3 meters to 2.5 meters, then 2 meters—it can dynamically adapt to changes in channel quality. This adjustment process is implemented through an algorithm in the main control module, maintaining the positioning verification mechanism while lowering the threshold to ensure the security of the unlocking operation. For instance, if the channel occupancy rate exceeds 60% for five consecutive seconds, the main control module lowers the unlock threshold by one level and resets the threshold after the channel recovers.

[0117] In practical applications, the unlocking threshold can actually be set based on user habits. If a user stays within 1-1.5 meters multiple times (such as waiting for family members), the threshold will be automatically extended to 2 meters. At this time, the user can manually adjust the threshold through the mobile APP, allowing the user to customize it within the range of 0.5-3 meters.

[0118] In this embodiment, after locating the Bluetooth device based on the time delay characteristics of the two signals, the method further includes:

[0119] The first Bluetooth module is controlled to randomly generate N challenge codes and send them to the Bluetooth device. A timer is started to detect whether the Bluetooth device returns a hash value based on the challenge code and key before the timer expires.

[0120] If not, immediately terminate the location tracking of the Bluetooth device, mark the Bluetooth device as a suspicious device, and temporarily block the communication permissions of the Bluetooth device if no hash value is received for M consecutive times.

[0121] The challenge code is a random number sequence generated by the first Bluetooth module, which can be implemented using a pseudo-random number generation algorithm, such as a linear feedback shift register or timestamp-based dynamic encoding, to verify the legitimacy of the Bluetooth device. The timer is a timing module used to set the response time window, which can be implemented using the clock interrupt function of the embedded system, for example, setting the response time window to within 500 milliseconds to 2 seconds, to constrain the Bluetooth device to complete the hash calculation and return within a limited time. The hash value is a fixed-length data generated by operating a cryptographic hash function on the challenge code and the pre-stored key, specifically using SHA-256 or HMAC algorithms, to ensure that the Bluetooth device holds a legitimate key and can respond to verification requests in real time. A suspicious device is a Bluetooth device that fails to return the correct hash value within the specified time, which can be implemented by adding a status indicator to the device management list, such as marking the device as "pending verification" or "high risk," to trigger subsequent security policies. Communication permission blocking temporarily prohibits Bluetooth communication connections with suspicious devices, which can be implemented by updating the Bluetooth whitelist or closing the communication channel of the corresponding MAC address, for example, prohibiting the device from initiating unlock requests for 24 hours, to prevent malicious devices from continuously attempting attacks.

[0122] Specifically, after the Bluetooth electronic door lock completes the initial location of the Bluetooth device, the first Bluetooth module generates a random challenge code and sends it to the device via a directional antenna. Simultaneously, the main control module starts a timer and monitors whether the Bluetooth device returns the correct hash value within a preset time window. The hash value is generated by combining the key stored internally by the Bluetooth device with the received challenge code. If the timer expires without a response, or if the returned hash value does not match the expected result, the device is deemed to pose an illegal operation risk, the current location process is immediately terminated, and the device is added to the suspicious list. When the same device fails multiple consecutive verifications, the system automatically restricts its communication permissions, thereby blocking potential attacks.

[0123] In some specific implementations, the number of challenge codes N can be 3 to 5. For example, three different random numbers are sent for each verification, requiring the Bluetooth device to calculate and return the corresponding hash values ​​in sequence. The timer's timeout can be set to 1 second, for example, starting from the sending of the challenge code; if not all responses are received within 1 second, the operation is terminated. The number of consecutive failures M can be 2 to 3, for example, the same device is temporarily blocked after two verification failures. This solves the risk of unauthorized unlocking caused by the lack of dynamic authentication in existing Bluetooth door locks. Through dual verification of challenge codes and hash values, it ensures that only devices holding legitimate keys and within effective communication range can trigger unlocking, significantly improving the door lock system's resistance to attacks.

[0124] Furthermore, after unlocking, the system continues to detect the Bluetooth device's signal, and triggers locking when the detected device moves away.

[0125] Specifically, after a user enters the room, the Bluetooth device establishes a connection with the Bluetooth module inside the door, and the communication interval is extended from 10ms in the ranging phase to 500ms. The Bluetooth module inside the door periodically sends low-power detection packets (≤128 bytes), and the Bluetooth device only responds when the round-trip time is less than 100ms. If no response is received from the Bluetooth device for three consecutive communication cycles, it is determined that the user has moved away, and the door is locked.

[0126] The above-mentioned solution sets up dual Bluetooth modules on the inner and outer sides and compares signal strength and time delay characteristics. Combined with a directional antenna, it enables accurate determination of the user's location and effectively distinguishes between the inside and outside of the door. This solves the problem of misjudgment caused by the reliance on a single signal strength in traditional solutions. It has the advantages of improving positioning accuracy and security and reducing the risk of misoperation.

[0127] The present invention also provides a computer-readable storage medium, which can be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium, wherein the computer-readable storage medium stores instructions that, when the instructions are executed on a computer, cause the computer to perform each step of the unlocking control method of the Bluetooth electronic door lock provided in the above embodiments.

[0128] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0129] 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 the present invention, 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 several 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 described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0130] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0131] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A Bluetooth electronic door lock characterized by, include: The first Bluetooth module, the second Bluetooth module, and the electronic lock body; The first Bluetooth module and the second Bluetooth module are electrically connected to the electronic lock body; both the first Bluetooth module and the second Bluetooth module are equipped with directional antennas, the first Bluetooth module is installed on the side of the electronic lock body closer to the outside of the door, and the second Bluetooth module is installed on the side of the electronic lock body closer to the inside of the door; The first Bluetooth module and the second Bluetooth module receive Bluetooth signals returned by authorized Bluetooth devices based on Bluetooth connections through directional antennas, add the identifier of the first Bluetooth module or the second Bluetooth module, and then send them to the electronic lock body; The electronic lock body extracts the round-trip time and phase / amplitude of the Bluetooth signals received by the first Bluetooth module and the second Bluetooth module respectively, compares the round-trip time and phase / amplitude extracted from the two Bluetooth signals, and triggers unlocking based on the comparison result.

2. The Bluetooth electronic door lock of claim 1, wherein, The first Bluetooth module includes a first Bluetooth circuit and a first directional antenna. The first directional antenna is installed on the side of the electronic lock body closer to the outside of the door, and the signal transmission and reception direction of the first directional antenna is towards the space outside the door. It is connected to the electronic lock body through the first Bluetooth circuit. The second Bluetooth module includes a second Bluetooth circuit and a second directional antenna. The second directional antenna is installed on the side of the electronic lock body closer to the inside of the door, and the signal transmission and reception direction of the second directional antenna is towards the space inside the door. It is connected to the electronic lock body through the second Bluetooth circuit.

3. The Bluetooth electronic door lock according to claim 1 or 2, characterized in that, The electronic lock body includes: a lock, a drive module, and a main control module; the lock is connected to the main control module through the drive module; The main control module parses the Bluetooth signals sent by the first Bluetooth module and the second Bluetooth module respectively, extracts the round-trip time and phase / amplitude; uses the round-trip time and phase / amplitude of the first Bluetooth module as the main trigger feature of the lock and the round-trip time and phase / amplitude of the second Bluetooth module as the auxiliary trigger feature of the lock, performs unlocking identification according to the unlocking logic, and outputs a drive signal based on the identification result; The drive module drives the lock to open and close based on the drive signal.

4. A method for controlling the opening of a Bluetooth electronic door lock according to any one of claims 1 to 3, characterized in that, The unlocking control method includes: Detect whether there are authorized Bluetooth devices within the signal coverage area of ​​the Bluetooth electronic door lock; If present, the first Bluetooth module collects the Bluetooth signal emitted by the Bluetooth device and outputs it as the main trigger signal; the second Bluetooth module collects the Bluetooth signal emitted by the Bluetooth device and outputs it as an auxiliary signal. The round-trip time and phase / amplitude of the main trigger signal and the auxiliary signal are extracted respectively, and the Bluetooth device is located based on the time delay characteristics of the two signals; Unlocking control is performed based on the positioning results and the round-trip time.

5. The unlocking control method according to claim 4, characterized by, Before performing the unlocking control based on the positioning result and the round-trip time, the method further includes: The request is to collect multi-frequency detection signals from authorized Bluetooth devices. By comparing the phase / amplitude differences at different frequency points in the multi-band detection signals, the first distance between the Bluetooth device and the Bluetooth electronic door lock is calculated; calculating a round trip time of the multi-frequency probe signal, and determining a second distance between the Bluetooth device and the Bluetooth electronic door lock based on the round trip time; cross-checking a result of positioning based on the first distance and the second distance, and outputting a positioning result.

6. The unlocking control method according to claim 5, characterized by, The multi-frequency probe signal includes three probe signals of different frequencies; the comparison of the phase / amplitude difference of different frequency points in the multi-frequency probe signal includes: calculating the phase difference of each frequency probe signal and a standard probe signal; using a preset distance calculation formula, calculating the distance corresponding to each phase difference, and averaging each distance to obtain the first distance between the Bluetooth device and the Bluetooth electronic door lock; the distance calculation formula is: where Δφ is the phase difference, c is the speed of light, and Δf is the frequency difference.

7. The unlocking control method according to claim 5, characterized by, The unlocking control based on the positioning result and the round trip time includes: extracting the identity carried in the main trigger signal, and verifying the legitimacy of the authorized Bluetooth device based on the identity; determining whether the positioning result is less than a preset unlocking threshold, and whether the round trip time meets a preset door area characteristic; if both conditions are met, an unlocking signal is generated to drive the lock to unlock.

8. The unlocking control method according to claim 7, characterized by, The unlocking control based on the positioning result and the round trip time also includes: monitoring the environmental noise in real time, and determining whether the environmental noise is greater than a preset threshold, wherein the environmental noise is the Bluetooth channel occupancy rate; if yes, the preset unlocking threshold is reduced by a preset level.

9. The unlocking control method according to claim 4, characterized by, After the Bluetooth device is positioned based on the phase / amplitude in the two signals, it also includes: controlling the first Bluetooth module to randomly generate N challenge codes and send them to the Bluetooth device, and starting a timer to detect whether the Bluetooth device returns a hash value based on the challenge code and the key before the timer expires; if no, immediately terminate the positioning of the Bluetooth device, mark the Bluetooth device as a suspicious device, and temporarily shield the communication authority of the Bluetooth device if M consecutive times do not receive the hash value.

10. A computer-readable storage medium having stored thereon instructions, the instructions comprising, The instructions are executed by the processor to implement the unlocking control method of any one of claims 4-9.