Smart door lock control method based on bluetooth communication protocol

CN123016556APending Publication Date: 2026-10-30ZHONGKE YUNLIANG (XIAMEN) TECHNOLOGY GROUP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611466233.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-20
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

现有控制方式对连接中断前后的通信过程与机械动作缺少连续关联,连接恢复后难以准确判断锁梁当前位置及尚未完成的开锁行程,容易发生重复驱动、驱动不足或停止时机不准确,增加电机及传动机构的运行负担,影响智能门锁开锁控制的连续性、准确性与可靠性

Benefits of technology

(1)本发明将驱动电流与锁梁位移映射至蓝牙连接事件位置序列,按照连接事件位置形成锁梁开锁轨迹,减少蓝牙通信数据与锁体运行数据之间的时间错位,提高锁梁开锁状态的识别准确性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123016556A_ABST
    Figure CN123016556A_ABST
Patent Text Reader

Abstract

The application discloses a smart door lock control method based on a Bluetooth communication protocol and relates to the technical field of smart door lock control, which comprises the following steps: arranging a Bluetooth connection event to form a connection event position sequence; synchronously collecting a driving current and a lock beam displacement to form a lock beam unlocking track; constructing an improved liquid state machine to form a liquid state sequence; forming a release anchor point according to a driving current change direction reversal and a lock beam displacement continuous increase; updating the lock beam displacement after the release anchor point to form a lock beam receiving state; latching the lock beam receiving state when a connection is interrupted, collecting a reconnection lock beam displacement to form a reconnection receiving state when the connection is recovered; correcting a driving direction and a driving stroke according to the reconnection receiving state; and executing unlocking. The application keeps the unlocking process continuous before and after interruption, reduces repeated driving, and improves the lock beam release position accuracy and reconnection efficiency.
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 control technology, and in particular to a smart door lock control method based on the Bluetooth communication protocol. Background Technology

[0002] In the field of smart lock control technology, existing smart locks typically use passwords, fingerprints, cards, or mobile terminals for authentication. The lock controller sends control signals to the lock body's actuator, which in turn moves the lock beam via a motor and transmission mechanism to complete the unlocking action. When using a mobile terminal for short-range control, Bluetooth communication has become a commonly used communication method due to its low power consumption and convenient connection.

[0003] Bluetooth communication quality is easily affected by wireless interference, device obstruction, and terminal operating status, which may result in transmission delays, connection fluctuations, or unexpected interruptions. There is a time lag between the transmission of the unlocking command and the mechanical action of the lock body actuator, and the motor load also changes with the resistance of the lock body. It is difficult for the door lock controller to accurately determine the unlocking stage of the lock beam based solely on communication status or single detection data.

[0004] When the Bluetooth connection is interrupted during the unlocking process, the lock body actuator may have already completed part of its stroke. Existing control methods lack a continuous correlation between the communication process before and after the connection is interrupted and the mechanical actions. After the connection is restored, it is difficult to accurately determine the current position of the lock beam and the unlocking stroke that has not yet been completed. This can easily lead to repeated driving, insufficient driving, or inaccurate stopping timing, increasing the operating burden on the motor and transmission mechanism and affecting the continuity, accuracy, and reliability of the smart door lock unlocking control.

[0005] Therefore, how to provide a smart door lock control method based on the Bluetooth communication protocol is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0006] One objective of this invention is to propose a smart door lock control method based on the Bluetooth communication protocol. This invention utilizes an improved liquid state machine to process Bluetooth connection events, drive current, and lock beam displacement. After the Bluetooth connection is interrupted and restored, the drive direction and drive stroke are corrected. It has the advantages of accurate unlocking status recognition, continuous reconnection control, and reliable lock body drive.

[0007] The smart door lock control method based on the Bluetooth communication protocol according to an embodiment of the present invention includes the following steps: Establish a Bluetooth connection between the mobile terminal and the smart lock, receive unlocking commands, and arrange Bluetooth connection events in the order of occurrence to form a sequence of connection event locations. The lock body actuator is driven according to the unlocking command, and the drive current and lock beam displacement are collected synchronously. The collected results are mapped to the sequence of connected event positions to form the lock beam unlocking trajectory. An improved liquid state machine is constructed. The sequence of connection event positions and the unlocking trajectory of the locking beam are input into the liquid layer. The current and the displacement of the locking beam are driven according to the connection event position encoding to form a liquid state sequence. Compare the driving currents at adjacent connection event positions in the liquid state sequence, mark the positions where the current change direction reverses, and filter the positions where the lock beam displacement continuously increases from the marked positions to form release anchor points; Update the lock beam displacement after releasing the anchor point along the lock beam unlocking trajectory, retain the maximum release position of the lock beam and the current lock beam displacement, and form the lock beam bearing state; When the Bluetooth connection is interrupted, the locking beam bearing state is latched. When the Bluetooth connection is restored, the location of the restoration event and the displacement of the re-interlocking beam are collected. The location of the restoration event is used to index the displacement of the re-interlocking beam, and the locking beam bearing state is updated to form the reconnection bearing state. The driving direction and driving stroke of the lock body actuator are adjusted according to the reconnection status to perform the unlocking action.

[0008] Optionally, the formation of the connection event location sequence includes the following steps: Extract the Bluetooth connection event carrying the unlock command and mark the Bluetooth connection event as a start connection event; Collect the occurrence time and event count value of each Bluetooth connection event after the initial connection event; Arrange the Bluetooth connection events according to their occurrence time, and identify the event interval between adjacent Bluetooth connection events based on the event count value; Starting with the initial connection event as the sequence starting point, the connection event positions of each Bluetooth connection event are marked according to the arrangement result and event interval, forming a connection event position sequence.

[0009] Optionally, the formation of the lock beam unlocking trajectory includes the following steps: When the lock body actuator responds to the unlocking command, it activates the current sampling circuit and the displacement sensor to collect the drive current and lock beam displacement through the same sampling trigger signal. Call the hardware timer to mark the acquisition time of each sampling trigger signal, and combine the driving current, lock beam displacement and acquisition time corresponding to the same sampling trigger signal to form a sampling record; The sampling time is compared with the occurrence time in the sequence of connection event locations. The Bluetooth connection event that occurs earlier than the sampling time is selected from the Bluetooth connection events that occur earlier than the sampling time, and the sampling record is mapped to the corresponding connection event location. First, arrange the sampling records according to the location of the connection event, then arrange the sampling records corresponding to the same connection event location according to the acquisition time, and combine adjacent sampling records in the order of arrangement to form the lock beam unlocking trajectory.

[0010] Optionally, constructing the improved liquid state machine includes the following steps: In the membrane potential feedback connection of the liquid layer, a time-gated branch is set up to calculate the acquisition time interval of adjacent acquisition results in the unlocking trajectory of the lock beam, and the acquisition time interval is input into the time-gated branch. In the membrane potential feedback connection, an event-gated branch is set up to compare the connection event positions mapped by adjacent acquisition results and input the comparison results into the event-gated branch. The time-gated branch adjusts the feedback amount of the previous membrane potential according to the acquisition time interval. The event-gated branch transmits the membrane potential feedback amount when the connection event position is the same. When the connection event position changes, the last membrane potential of the previous connection event position is retained, and the last membrane potential is transmitted to the membrane potential update of the next connection event position.

[0011] Optionally, the formation of the liquid state sequence includes the following steps: The collected results in the lock beam unlocking trajectory are arranged according to the sequence of connection event positions. The drive current and lock beam displacement are encoded according to the connection event positions to form an input pulse sequence. The input pulse sequence is input into the liquid layer, and the membrane potential is updated with the first input pulse. When the connection event positions are the same, the time-gated branch adjusts the feedback amount of the previous membrane potential according to the acquisition time interval, and updates the membrane potential with the current input pulse. When the location of a connection event changes, the event gating branch retains the last membrane potential of the previous connection event location and updates the membrane potential with the last membrane potential and the first input pulse of the next connection event location. Each membrane potential is converted into a liquid state, and the liquid states are arranged according to the location of the connection event and the time of acquisition to form a liquid state sequence.

[0012] Optionally, the formation of the release anchor point includes the following steps: The liquid states are arranged according to the location of the connection event. Based on the acquisition time associated with each liquid state, the corresponding driving current and lock beam displacement are retrieved from the lock beam unlocking trajectory. Select the latest acquisition time of the driving current among the locations of each connection event, calculate the change in driving current corresponding to adjacent connection event locations in turn, and determine the direction of current change based on the sign of the change in driving current. Compare the current change direction corresponding to adjacent drive current changes in turn, and mark the connection event position corresponding to the next drive current when the current change direction is reversed as a candidate position. Starting from each candidate position, arrange the lock beam displacement according to the acquisition time, compare adjacent lock beam displacements in turn, retain candidate positions where the lock beam displacement increases continuously along the unlocking direction, and register the retained candidate positions as release anchor points.

[0013] Optionally, the formation of the lock beam bearing state includes the following steps: The sampling record in the unlocking trajectory of the lock beam is located by the position of the connection event in the release anchor point. The sampling record with the latest acquisition time is selected and the corresponding lock beam displacement is registered as the current lock beam displacement. The trajectory pointer moves along the order of the sampling records in the lock beam unlocking trajectory. Each time a sampling record is reached, the current lock beam displacement is updated using the corresponding lock beam displacement, and the corresponding connection event position is registered as the current connection event position. Locate the current lock beam displacement and the maximum release position of the lock beam in the displacement calibration table. Mark the start point of the lock beam's incomplete stroke with the current lock beam displacement and mark the end point of the lock beam's incomplete stroke with the maximum release position of the lock beam. Arrange the calibrated positions between the starting and ending points according to the unlocking direction, and associate the arrangement results with the current connection event position to form the lock beam bearing state.

[0014] Optionally, the locking and recovery acquisition of the locking beam bearing state includes the following steps: Receive the connection interruption flag output by the Bluetooth controller and save the last lock beam bearing state formed before the connection interruption to the latching area. Locate the last Bluetooth connection event that occurred before the connection was interrupted, and register the corresponding connection event location as the connection interruption event location; After the Bluetooth connection is restored, retrieve the event count value at the time of connection restoration, and append the event count value to the connection event position sequence according to the position of the interrupted connection event to obtain the connection restoration event position. The lock beam displacement is collected at the first sampling trigger moment after the Bluetooth connection is restored. The location of the restored connection event, the collection time, and the lock beam displacement are combined to form a reconnection sampling record, and the lock beam displacement is registered as the reconnection beam displacement.

[0015] Optionally, the formation of the reconnection acceptance state includes the following steps: Based on the location of the reconnection event, the reconnection sampling record will be continued to the lock beam unlocking trajectory; Re-interlock beam displacement by restoring the connection event location index, and replace the current lock beam displacement in the lock beam bearing state with the re-interlock beam displacement; Locate the displacement of the interlocking beam and the maximum release position of the locking beam in the displacement calibration table, and arrange the calibration positions between the two according to the unlocking direction; Associate the location of the restored connection event with the starting point of the arrangement result, and update the lock beam bearing status using the associated arrangement result to form a reconnected bearing status.

[0016] Optionally, the correction of the driving direction and driving stroke includes the following steps: Retrieve the displacement of the interlocking beam from the reconnection and support state, and locate the displacement of the interlocking beam and the maximum release position of the locking beam in the displacement calibration table; The driving direction of the lock body actuator is determined according to the calibration sequence of the displacement of the interlocking beam pointing to the maximum release position of the lock beam; The displacement span of the locking beam at adjacent calibrated positions between the displacement of the interlocking beam and the maximum release position of the locking beam is retrieved in sequence. The displacement span of each locking beam is calculated according to the transmission ratio of the lock body actuator. The calculation results are accumulated to obtain the remaining drive stroke. Update the drive direction of the lock body actuator using the determined drive direction, and update the drive stroke of the lock body actuator using the remaining drive stroke; Drive the lock body actuator according to the updated drive direction and drive stroke, synchronously collect the lock beam displacement, and stop the drive when the lock beam displacement reaches the maximum release position of the lock beam to complete the unlocking action.

[0017] The beneficial effects of this invention are: (1) The present invention maps the driving current and the lock beam displacement to the Bluetooth connection event position sequence, and forms the lock beam unlocking trajectory according to the connection event position, thereby reducing the time misalignment between Bluetooth communication data and lock body operation data and improving the recognition accuracy of lock beam unlocking status.

[0018] (2) The present invention uses the time-gated branch and event-gated branch of the improved liquid state machine to process the time interval and the position change of the connected events, retain the state continuity between adjacent connected events, accurately identify the direction of current change and the displacement change of the lock beam during the release process, and improve the reliability of the release anchor point positioning.

[0019] (3) When the Bluetooth connection is interrupted, the present invention locks the lock beam bearing state. After the connection is restored, the reconnection bearing state is formed according to the displacement of the reconnection beam, which corrects the driving direction and driving stroke of the lock body actuator, avoids repeating the complete unlocking stroke, reduces the motor load and transmission mechanism wear, and improves the continuity and reliability of the reconnection unlocking process. Attached Figure Description

[0020] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1 This is an overall flowchart of the smart door lock control method based on the Bluetooth communication protocol proposed in this invention; Figure 2 This is a timing diagram of Bluetooth connection events, drive current, and lock beam displacement sampling in this invention; Figure 3 This is a graph showing the relationship between the driving current and the displacement of the locking beam as the location of the connection event changes in this invention. Detailed Implementation

[0021] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.

[0022] refer to Figures 1-3 A smart door lock control method based on the Bluetooth communication protocol includes the following steps: Establish a Bluetooth connection between the mobile terminal and the smart lock, receive unlocking commands, and arrange Bluetooth connection events in the order of occurrence to form a sequence of connection event locations. The lock body actuator is driven according to the unlocking command, and the drive current and lock beam displacement are collected synchronously. The collected results are mapped to the sequence of connected event positions to form the lock beam unlocking trajectory. An improved liquid state machine is constructed. The sequence of connection event positions and the unlocking trajectory of the locking beam are input into the liquid layer. The current and the displacement of the locking beam are driven according to the connection event position encoding to form a liquid state sequence. Compare the driving currents at adjacent connection event positions in the liquid state sequence, mark the positions where the current change direction reverses, and filter the positions where the lock beam displacement continuously increases from the marked positions to form release anchor points; Update the lock beam displacement after releasing the anchor point along the lock beam unlocking trajectory, retain the maximum release position of the lock beam and the current lock beam displacement, and form the lock beam bearing state; When the Bluetooth connection is interrupted, the locking beam bearing state is latched. When the Bluetooth connection is restored, the location of the restoration event and the displacement of the re-interlocking beam are collected. The location of the restoration event is used to index the displacement of the re-interlocking beam, and the locking beam bearing state is updated to form the reconnection bearing state. The driving direction and driving stroke of the lock body actuator are adjusted according to the reconnection status to perform the unlocking action.

[0023] In this embodiment, the formation of the connection event location sequence includes the following steps: Extract the Bluetooth connection event carrying the unlock command and mark the Bluetooth connection event as a start connection event; After a connection is established, the Bluetooth link layer starts a connection event counter, updating the event count value each time a connection anchor point is reached. The command parsing program first locates the unlock command transmission channel based on the attribute handle, then compares the data packet opcode with the unlock opcode. If the opcodes match, the current event count value is latched, the corresponding Bluetooth connection event is registered as a connection start event, and event recording is initiated.

[0024] Collect the occurrence time and event count value of each Bluetooth connection event after the initial connection event; After event logging is initiated, the Bluetooth controller latches the hardware timer value when each connection anchor point is reached, converting the hardware timer value into the occurrence time. The Bluetooth controller combines the occurrence time of the same connection anchor point with the event count value into an event record, which is then stored in the event buffer according to the occurrence time.

[0025] Arrange the Bluetooth connection events according to their occurrence time, and identify the event interval between adjacent Bluetooth connection events based on the event count value; The occurrence times of adjacent event records are compared sequentially, and the event records are arranged in chronological order of occurrence time. Then, the event count values ​​of adjacent event records are compared. If the count value of a later event is greater than that of a previous event, the span between the two event count values ​​is recorded as the event interval. If the count value of a later event is less than that of a previous event and its occurrence time is later than that of the previous event record, the count value of the later event is extended to after the end of the previous counting cycle before the event interval is recorded.

[0026] Starting with the initial connection event as the sequence starting point, the connection event positions of each Bluetooth connection event are marked according to the arrangement result and event interval, forming a connection event position sequence.

[0027] The connection event position of the initial connection event is marked as the start of the sequence. Subsequent Bluetooth connection events are processed according to the order of the event records. When the event intervals of adjacent event records are consecutive, the next Bluetooth connection event is marked at the adjacent connection event position; when there is a count span between event intervals, the connection event position of the next Bluetooth connection event is moved according to the count span, and no empty event records are generated. The connection event position, event count value, and occurrence time are combined into a sequence item, and the sequence items are arranged according to the connection event position to form a connection event position sequence.

[0028] In this embodiment, the formation of the lock beam unlocking trajectory includes the following steps: When the lock body actuator responds to the unlocking command, it activates the current sampling circuit and the displacement sensor to collect the drive current and lock beam displacement through the same sampling trigger signal. A displacement sensor is installed inside the lock body to detect the movement of the lock beam. The power supply circuit of the motor of the lock body actuator is connected to a current sampling resistor. The motor is driven by a calibration current, and the current sampling value corresponding to the calibration current is recorded to establish a current calibration table. The lock beam is moved along its travel, and the displacement sampling value corresponding to the calibration position is recorded to establish a displacement calibration table. After the timer generates a sampling trigger signal, both the current sampling channel and the displacement sampling channel are triggered simultaneously. The driving current is obtained according to the current calibration table, and the lock beam displacement is obtained according to the displacement calibration table. The same sampling sequence number is assigned to the same sampling result.

[0029] Call the hardware timer to mark the acquisition time of each sampling trigger signal, and combine the driving current, lock beam displacement and acquisition time corresponding to the same sampling trigger signal to form a sampling record; The Bluetooth communication program and the sampling program run in the same door lock controller, sharing a continuously running hardware timer. The latching time is recorded when the connection anchor point arrives, and the latching acquisition time is recorded when the sampling trigger signal is generated. The drive current, lock beam displacement, and acquisition time corresponding to the same sampling sequence number are recorded in the same sampling record.

[0030] The sampling time is compared with the occurrence time in the sequence of connection event locations. The Bluetooth connection event that occurs earlier than the sampling time is selected from the Bluetooth connection events that occur earlier than the sampling time, and the sampling record is mapped to the corresponding connection event location. Set the current event pointer for the connection event position sequence, pointing it to the starting connection event. Retrieve the occurrence time of the current event and the occurrence time of the next Bluetooth connection event, and compare them with the acquisition time in the sampling record. When the acquisition time reaches the occurrence time of the next Bluetooth connection event, move the current event pointer to the next Bluetooth connection event and continue comparing acquisition times. If the acquisition time is earlier than the occurrence time of the next Bluetooth connection event, stop moving the current event pointer, retrieve the connection event position pointed to by the current event, and register the connection event position in the connection event position field of the sampling record, associating the sampling record with the connection event position using the sampling sequence number.

[0031] First, arrange the sampling records according to the location of the connection event, then arrange the sampling records corresponding to the same connection event location according to the acquisition time, and combine adjacent sampling records in the order of arrangement to form the lock beam unlocking trajectory.

[0032] First, arrange the sampling records according to the location of the connection event, then arrange the sampling records corresponding to the same connection event location according to the acquisition time. Continue adjacent sampling records according to the order of connection event location and acquisition time. Mark the first sampling record formed after the lock body actuator starts driving as the trajectory start point, and mark the last sampling record formed before the driving stops as the trajectory end point. Continue the sampling records from the trajectory start point to the trajectory end point according to the order of the sampling records to form the lock beam unlocking trajectory.

[0033] In this embodiment, constructing the improved liquid state machine includes the following steps: In the membrane potential feedback connection of the liquid layer, a time-gated branch is set up to calculate the acquisition time interval of adjacent acquisition results in the unlocking trajectory of the lock beam, and the acquisition time interval is input into the time-gated branch. The acquisition results from the lock beam unlocking trajectory are arranged according to the connection event location and acquisition time. Adjacent acquisition results are selected sequentially to obtain the acquisition time interval between two acquisition times. The timing cycle length of the liquid layer is retrieved, and the number of decay times is determined according to the complete timing cycle covered by the acquisition time interval. For the remaining duration that is less than one timing cycle, partial decay is performed once according to the proportion of the timing cycle. The single-cycle decay coefficient configured for each spiking neuron is retrieved, and the previous membrane potential is updated according to the number of decay times.

[0034] The time-gated branch is positioned between the membrane potential storage location and the membrane potential update location of the spiking neuron. The time-gated branch receives the previous membrane potential from each spiking neuron sequentially and outputs a decayed membrane potential. The output membrane potentials are arranged according to the spiking neuron number, and the arrangement result is recorded as the membrane potential feedback quantity. The single-cycle decay coefficient is taken from the configuration parameters of the corresponding spiking neuron and remains unchanged during the unlocking action of the smart lock.

[0035] In the membrane potential feedback connection, an event-gated branch is set up to compare the connection event positions mapped by adjacent acquisition results and input the comparison results into the event-gated branch. Extract the location of connected events mapped from adjacent acquisition results, and compare the sequence numbers of the two connected event locations. If the sequence numbers match, generate a marker indicating the same location; if the sequence numbers do not match, generate a marker indicating a change in location.

[0036] The event-gated branch is positioned between the time-gated branch and the membrane potential update location. The control end of the event-gated branch receives both a position-same flag and a position-change flag, the data end receives the membrane potential feedback, and the storage end saves the last membrane potential. The position-same flag controls the membrane potential feedback to enter the current membrane potential update, while the position-change flag controls the storage end to maintain the last membrane potential of the previously connected event location.

[0037] The time-gated branch adjusts the feedback amount of the previous membrane potential according to the acquisition time interval. The event-gated branch transmits the membrane potential feedback amount when the connection event position is the same. When the connection event position changes, the last membrane potential of the previous connection event position is retained, and the last membrane potential is transmitted to the membrane potential update of the next connection event position.

[0038] When markers of the same position arrive at the event-gated branch, the membrane potentials in the membrane potential feedback quantity are sent to the feedback input terminal of the corresponding spiking neuron according to the spiking neuron number.

[0039] When the position change marker reaches the event-gated branch, the last acquisition time corresponding to the previous connected event position is located. The membrane potentials of each spiking neuron in the liquid layer at that acquisition time are extracted, and the obtained membrane potentials are arranged according to the spiking neuron number. The arrangement result is recorded as the last membrane potential. The event-gated branch maintains the last membrane potential and stops performing the membrane potential clearing operation when the connected event position changes.

[0040] After the first input pulse arrives at the next connected event location, the event-gated branch sends the membrane potentials in the last membrane potential to the feedback input terminal of the corresponding spiking neuron according to the spiking neuron number, and sends the synaptic response generated by the first input pulse to the pulse input terminal.

[0041] In this embodiment, the formation of the liquid state sequence includes the following steps: The collected results in the lock beam unlocking trajectory are arranged according to the sequence of connection event positions. The drive current and lock beam displacement are encoded according to the connection event positions to form an input pulse sequence. For each acquisition result, record the connection event location, acquisition time, drive current, and lock beam displacement. First, arrange the acquisition results according to the connection event location, and then arrange the acquisition results corresponding to the same connection event location according to the acquisition time.

[0042] A current encoding time window is set based on the driving current acquisition range. The minimum driving current is mapped to the end of the current encoding time window, and the maximum driving current is mapped to the beginning of the current encoding time window. The timing of the current pulse is determined according to the relative position of the driving current within the acquisition range. A displacement encoding time window is set based on the locking beam closing position and the maximum release position of the locking beam. The timing of the displacement pulse corresponding to the locking beam displacement is determined in the same way.

[0043] Upon entering the first acquisition result corresponding to each connection event location, a position marker pulse is generated at the start of the encoding time window. The firing times of the position marker pulse, current pulse, and displacement pulse are recorded respectively, and the three types of pulses are arranged according to their firing times to obtain the input pulse sequence. The position marker pulse, current pulse, and displacement pulse are respectively sent to the corresponding input neurons in the liquid layer. The correspondence between the three types of pulses and the input neurons remains unchanged after the model configuration is completed.

[0044] The input pulse sequence is input into the liquid layer, and the membrane potential is updated with the first input pulse. When the connection event positions are the same, the time-gated branch adjusts the feedback amount of the previous membrane potential according to the acquisition time interval, and updates the membrane potential with the current input pulse. The first input pulse in the input pulse sequence is sent to the corresponding input neuron. The membrane potential of each pulse neuron in the liquid layer is updated according to the synaptic response generated by the first input pulse. The update result is then associated with the location of the connection event corresponding to the first input pulse and the acquisition time.

[0045] Upon arrival of the corresponding marker at the location of a subsequent input pulse, the membrane potential feedback is retrieved from the time-gated branch. Each membrane potential in the feedback is then sent to the feedback input of the corresponding spiking neuron, and the synaptic response generated by the current input pulse is sent to the pulse input. After updating the membrane potential, the spiking neuron associates the update result with the location of the connection event corresponding to the current input pulse and the acquisition time. When the membrane potential reaches the pulse firing threshold, a pulse is output, and the membrane potential is then adjusted according to the spiking neuron's reset parameters.

[0046] When the location of a connection event changes, the event gating branch retains the last membrane potential of the previous connection event location and updates the membrane potential with the last membrane potential and the first input pulse of the next connection event location. Upon arrival of the location change marker, the last membrane potential stored in the event-gated branch is retrieved. When the first input pulse of the next connected event location arrives, according to the spiking neuron number, the membrane potentials in the last membrane potential are sent to the feedback input terminal of the corresponding spiking neuron, and the synaptic response generated by the first input pulse is sent to the pulse input terminal.

[0047] After the liquid layer completes the current membrane potential update, the update result is associated with the first acquisition time of the next connected event location, and then the last membrane potential stored in the event-gated branch is cleared. Subsequent input pulses in the next connected event location continue to call the membrane potential feedback quantity output by the time-gated branch according to the same position marker.

[0048] Each membrane potential is converted into a liquid state, and the liquid states are arranged according to the location of the connection event and the time of acquisition to form a liquid state sequence.

[0049] At each acquisition time, the membrane potential of each spiking neuron in the liquid layer is extracted, and the obtained membrane potentials are arranged according to the spiking neuron number. The arrangement result is recorded as the liquid state at the corresponding acquisition time.

[0050] For each liquid state, the location of the connection event and the acquisition time are recorded. First, the liquid states are arranged according to the location of the connection event, and then the liquid states corresponding to the same connection event location are arranged according to the acquisition time. When the location of the connection event corresponding to an adjacent liquid state changes, a boundary marker is recorded. The arranged liquid states and boundary markers are saved as a liquid state sequence.

[0051] In this embodiment, the formation of the release anchor point includes the following steps: The liquid states are arranged according to the location of the connection event. Based on the acquisition time associated with each liquid state, the corresponding driving current and lock beam displacement are retrieved from the lock beam unlocking trajectory. The location of the connection event registered in the liquid state and the acquisition time form a retrieval identifier. Sampling records with the same connection event location and acquisition time are searched in the lock beam unlocking trajectory. The driving current and lock beam displacement from the sampling records are retrieved, and the driving current, lock beam displacement, and sampling sequence number are associated with the corresponding liquid state. The association results are arranged according to the connection event location, and then the association results corresponding to the same connection event location are arranged according to the acquisition time.

[0052] Select the latest acquisition time of the driving current among the locations of each connection event, calculate the change in driving current corresponding to adjacent connection event locations in turn, and determine the direction of current change based on the sign of the change in driving current. For each connection event location, the latest acquired correlation result is identified, and the corresponding drive current is registered as the last drive current. Adjacent last drive currents are selected sequentially according to the connection event location, and the difference between the subsequent last drive current and the preceding last drive current forms the drive current change. A positive drive current change is registered as an increasing direction, a negative change as a decreasing direction, and no change is registered as the current change direction. The drive current change and its direction are then associated with the connection event location corresponding to the next last drive current.

[0053] Compare the current change direction corresponding to adjacent drive current changes in turn, and mark the connection event position corresponding to the next drive current when the current change direction is reversed as a candidate position. Starting with the first registered current change direction, the system sequentially searches for the next registered current change direction, excluding connection events with unregistered current change directions in between. If two current change directions differ, the system locates the connection event associated with the next current change direction and registers it as a candidate location. If two current change directions are the same, the next current change direction is retained for the next comparison.

[0054] Starting from each candidate position, arrange the lock beam displacement according to the acquisition time, compare adjacent lock beam displacements in turn, retain candidate positions where the lock beam displacement increases continuously along the unlocking direction, and register the retained candidate positions as release anchor points.

[0055] Starting with the first sampling record corresponding to the candidate position, subsequent sampling records are retrieved according to the order of sampling records in the lock beam unlocking trajectory until the next candidate position or the end of the trajectory is reached. The lock beam displacement in adjacent sampling records is compared one by one. If the later lock beam displacement is greater than the previous lock beam displacement, the comparison continues. If a sampling record shows that the lock beam displacement has not increased, the corresponding candidate position is excluded.

[0056] In this embodiment, the formation of the lock beam bearing state includes the following steps: The sampling record in the unlocking trajectory of the lock beam is located by the position of the connection event in the release anchor point. The sampling record with the latest acquisition time is selected and the corresponding lock beam displacement is registered as the current lock beam displacement. Retrieve the connection event position from the release anchor point, filter the sampled records with the same connection event position field in the lock beam unlocking trajectory, and sort the filtered results according to the acquisition time. Locate the last sampled record in the sorted list, save the corresponding lock beam displacement to the current lock beam displacement storage location, save the corresponding connection event position as the current connection event position, and save the corresponding sampling sequence number to the trajectory pointer.

[0057] The trajectory pointer moves along the order of the sampling records in the lock beam unlocking trajectory. Each time a sampling record is reached, the current lock beam displacement is updated using the corresponding lock beam displacement, and the corresponding connection event position is registered as the current connection event position. Retrieve the sampling record currently pointed to by the trajectory pointer and check if there is a subsequent sampling record in the lock beam unlocking trajectory. If there is a subsequent sampling record, move the trajectory pointer to the next sampling record, overwrite the original lock beam displacement in the current lock beam displacement storage position with the corresponding lock beam displacement, and save the corresponding connection event position as the current connection event position.

[0058] If there is no subsequent sampling record in the lock beam unlocking trajectory, maintain the trajectory pointer, current lock beam displacement, and current connection event position. After a new sampling record is generated, append the new sampling record to the end of the lock beam unlocking trajectory, then move the trajectory pointer and update the current lock beam displacement and current connection event position.

[0059] Locate the current lock beam displacement and the maximum release position of the lock beam in the displacement calibration table. Mark the start point of the lock beam's incomplete stroke with the current lock beam displacement and mark the end point of the lock beam's incomplete stroke with the maximum release position of the lock beam. Compare the current lock beam displacement with the displacement sample values ​​in the displacement calibration table. If a matching displacement sample value exists, retrieve the corresponding calibration position; if no matching displacement sample value exists, locate the displacement sample value with the smallest numerical difference and retrieve its corresponding calibration position. Record the retrieved calibration position as the starting point of the lock beam's incomplete stroke.

[0060] Locate the end calibration position corresponding to the maximum release position of the locking beam in the displacement calibration table, and register the end calibration position as the end point of the uncompleted stroke of the locking beam.

[0061] Arrange the calibrated positions between the starting and ending points according to the unlocking direction, and associate the arrangement results with the current connection event position to form the lock beam bearing state.

[0062] The unlocking direction is determined according to the calibration sequence from the closed position to the maximum release position of the lock beam in the displacement calibration table. Starting from the beginning of the lock beam's incomplete stroke, the calibration positions are retrieved sequentially along the unlocking direction until the end of the lock beam's incomplete stroke is reached. The retrieved results are then arranged in the calibration sequence.

[0063] Associate the current connection event position with the starting point of the arrangement result, save the associated arrangement result to the state buffer, and obtain the lock beam bearing state. After the current lock beam displacement is updated, relocate the starting point of the lock beam's incomplete stroke, update the arrangement result, and use the updated result to overwrite the previous lock beam bearing state in the state buffer.

[0064] In this embodiment, the locking and recovery acquisition of the lock beam bearing state includes the following steps: Receive the connection interruption flag output by the Bluetooth controller and save the last lock beam bearing state formed before the connection interruption to the latching area. Upon detecting a link termination event, the Bluetooth controller latches the moment the event occurred, generates a connection interruption flag, and sends it to the state latching program. Upon receiving the connection interruption flag, the state latching program stops updating the lock beam bearing status and copies the last updated lock beam bearing status to the latch area. The original data in the latch area remains unchanged until the copy is complete; after copying, the overlay entry point to the latch area is closed.

[0065] Locate the last Bluetooth connection event that occurred before the connection was interrupted, and register the corresponding connection event location as the connection interruption event location; Using the occurrence time of the link termination event as the time boundary, retrieve event records in the connection event position sequence whose occurrence time is earlier than the time boundary, and select the last event record in the sequence. Retrieve the connection event position from the last event record and register the connection event position as the interruption connection event position. Assign the same latching identifier to the interruption connection event position and the lock beam bearing status, and save the interruption connection event position to the latching area.

[0066] After the Bluetooth connection is restored, retrieve the event count value at the time of connection restoration, and append the event count value to the connection event position sequence according to the position of the interrupted connection event to obtain the connection restoration event position. After the Bluetooth connection is restored, the event count and hardware timer value are latched when the first connection anchor point is reached. The hardware timer value is then converted into the occurrence time of the connection restoration event. The location of the interrupted connection event in the latch area is retrieved, and the position after the interrupted connection event location is assigned to the first connection restoration event. The assigned position is then registered as the connection restoration event location.

[0067] For subsequent connection recovery events, the event count value and occurrence time are latched respectively, and the connection event position is moved according to the count span of adjacent event count values. The connection recovery event position, event count value, and occurrence time are registered as event records and continued into the connection event position sequence.

[0068] The lock beam displacement is collected at the first sampling trigger moment after the Bluetooth connection is restored. The location of the restored connection event, the collection time, and the lock beam displacement are combined to form a reconnection sampling record, and the lock beam displacement is registered as the reconnection beam displacement.

[0069] After the reconnection event record is generated, a sampling trigger signal is activated. When the first sampling trigger signal arrives, the sampling sequence number and acquisition time are latched, triggering the displacement sensor to acquire the lock beam displacement. The acquisition time is compared with the occurrence time of the reconnection event to locate the position of the last reconnection event that occurred before the acquisition time arrived. The position of the reconnection event is associated with the acquisition results, and the associated lock beam displacement is registered as the re-interlocked beam displacement.

[0070] In this embodiment, the formation of the reconnection acceptance state includes the following steps: Based on the location of the reconnection event, the reconnection sampling record will be continued to the lock beam unlocking trajectory; The displacement, acquisition time, and sampling sequence number of the reconnected beam are recorded in the same sampling record. The location of the restored connection event is saved to the connection event location field of the sampling record. The completed sampling record is saved as the reconnection sampling record. The last sampling record before the connection interruption in the positioning lock beam unlocking trajectory is used to continue the reconnection sampling record after the last sampling record before the connection interruption.

[0071] Re-interlock beam displacement by restoring the connection event location index, and replace the current lock beam displacement in the lock beam bearing state with the re-interlock beam displacement; The lock beam unlocking trajectory is retrieved by restoring the connection event location. Sampling records with consistent connection event location fields are filtered, and the earliest reconnection sampling record is selected. The re-interlocking beam displacement is then retrieved. The lock beam bearing state is retrieved from the latching area, and the current lock beam displacement stored in the lock beam bearing state is located. The re-interlocking beam displacement is then used to overwrite the current lock beam displacement, keeping the maximum release position of the lock beam unchanged.

[0072] Locate the displacement of the interlocking beam and the maximum release position of the locking beam in the displacement calibration table, and arrange the calibration positions between the two according to the unlocking direction; Compare the displacement of the interlocking beam with the displacement sample values ​​in the displacement calibration table. If a consistent value exists, retrieve the corresponding calibration position; if no consistent value exists, locate the displacement sample value with the smallest difference and retrieve the corresponding calibration position.

[0073] The unlocking direction is determined according to the calibration sequence from the closed position to the maximum release position of the lock beam in the displacement calibration table. Starting from the calibration position corresponding to the displacement of the interlocking beam, the calibration positions are retrieved sequentially along the unlocking direction until the end calibration position corresponding to the maximum release position of the lock beam is reached. The retrieved results are then arranged in the calibration order.

[0074] Associate the location of the restored connection event with the starting point of the arrangement result, and update the lock beam bearing status using the associated arrangement result to form a reconnected bearing status.

[0075] Register the location of the restored connection event at the starting point of the arrangement result, and associate the arrangement result with the reconnection sampling record through the location of the restored connection event. Save the re-interlocked beam displacement, the location of the restored connection event, and the associated arrangement result to the same state record. After saving, open the overlay entry of the latch area, use the state record to overwrite the lock beam bearing state saved before the connection was interrupted, and register the overlay result as the reconnection bearing state.

[0076] In this embodiment, the correction of the driving direction and driving stroke includes the following steps: Retrieve the displacement of the interlocking beam from the reconnection and support state, and locate the displacement of the interlocking beam and the maximum release position of the locking beam in the displacement calibration table; Retrieve the displacement of the reconnected beam saved in the reconnection state. Compare the reconnected beam displacement with the displacement sample values ​​in the displacement calibration table item by item; if a matching value exists, retrieve the corresponding calibration position; if no matching value exists, retrieve the calibration position corresponding to the displacement sample value with the smallest difference. Search the position attribute in the displacement calibration table and retrieve the end calibration position corresponding to the maximum release position of the locking beam.

[0077] The driving direction of the lock body actuator is determined according to the calibration sequence of the displacement of the interlocking beam pointing to the maximum release position of the lock beam; Compare the sequence numbers of the displacement of the interlocking beam corresponding to the calibration position and the end calibration position to determine the progression direction of the sequence numbers. Retrieve the transmission direction correspondence table saved during the calibration process of the lock body actuator, and search the transmission direction correspondence table according to the progression direction of the sequence numbers to obtain the corresponding motor rotation direction. Register the motor rotation direction as the driving direction of the lock body actuator.

[0078] The displacement span of the locking beam at adjacent calibrated positions between the displacement of the interlocking beam and the maximum release position of the locking beam is retrieved in sequence. The displacement span of each locking beam is calculated according to the transmission ratio of the lock body actuator. The calculation results are accumulated to obtain the remaining drive stroke. Starting from the calibration position corresponding to the displacement of the interlocking beam, adjacent calibration positions are selected one by one along the direction of the end calibration position. The difference between the displacement sampling values ​​corresponding to each group of adjacent calibration positions is obtained, and the difference is recorded as the displacement span of the lock beam. The transmission ratio of the lock body actuator is retrieved, and the displacement span of each lock beam is converted into the corresponding drive stroke according to the transmission ratio. The drive stroke is accumulated according to the order of the calibration positions, and the accumulated result is saved as the remaining drive stroke.

[0079] Update the drive direction of the lock body actuator using the determined drive direction, and update the drive stroke of the lock body actuator using the remaining drive stroke; The direction control field in the location lock controller is used to overwrite the drive direction saved before the connection interruption with the newly determined drive direction. The drive stroke corresponding to a single control pulse recorded during motor calibration is retrieved, and the remaining drive stroke is converted into the number of control pulses. If the conversion result contains a portion less than one control pulse, this portion is included in the output duration of the last control pulse. The remaining drive stroke, the number of control pulses, and the output duration of the last control pulse are saved to their respective control fields, and the updated results are latched before the lock actuator is started.

[0080] Drive the lock body actuator according to the updated drive direction and drive stroke, synchronously collect the lock beam displacement, and stop the drive when the lock beam displacement reaches the maximum release position of the lock beam to complete the unlocking action.

[0081] The updated drive direction is sent to the motor direction control terminal. Control pulses are sent sequentially to the motor drive terminal according to the number of control pulses. When the last control pulse is sent, the control pulse is output according to the saved output duration. During the control pulse output, a sampling trigger signal is generated. When each sampling trigger signal arrives, the lock beam displacement is collected, and the collected results are associated with the corresponding control pulse.

[0082] The collected lock beam displacement is compared with the displacement sampling value in the displacement calibration table to locate the corresponding calibration position. When the positioning result is the end calibration position corresponding to the maximum release position of the lock beam, subsequent control pulses are stopped and the motor drive output is turned off.

[0083] Example 1: To verify the feasibility of this invention in practice, it was applied to a Bluetooth unlocking scenario for a residential smart door lock. The smart door lock includes a Bluetooth controller, a door lock controller, a current sampling circuit, a displacement sensor, and a lock body actuator. After the Bluetooth controller establishes a connection with the mobile terminal, the door lock controller receives the unlocking command and activates the lock body actuator. The Bluetooth control program and the sampling program share a continuously running hardware timer to uniformly record the occurrence time of the Bluetooth connection event and the acquisition time of the drive current and lock beam displacement. Before implementation, current calibration tables, displacement calibration tables, and transmission direction correspondence tables were generated through motor calibration and lock beam stroke calibration for use during the unlocking process.

[0084] The door lock controller identifies the Bluetooth connection event carrying the unlocking command based on the attribute handle and operation code, and registers the corresponding event as the initial connection event. Subsequently, it records the event count and occurrence time when each connection anchor point is reached, and arranges the event records according to the occurrence time. When the event count increases normally, the event interval is determined based on the span between adjacent count values; when the event count restarts after a cycle, the new event count value is appended to the previous counting cycle, thus maintaining the continuity of event positions. The door lock controller uses the initial connection event as the starting point of the sequence, and allocates connection event positions according to the event arrangement and event intervals, forming a connection event position sequence.

[0085] After the lock body actuator starts driving, the same sampling trigger signal simultaneously triggers the current sampling circuit and the displacement sensor. The door lock controller combines the driving current, lock beam displacement, sampling time, and sampling sequence number obtained in the same sampling into a sampling record, and compares the sampling time with the occurrence time of the connection event. The sampling record is mapped to the connection event position corresponding to the last Bluetooth connection event that occurred before the sampling time arrives. The sampling records corresponding to the same connection event position are arranged according to the sampling time, and adjacent sampling records are consecutive according to the arrangement order of connection event position and sampling time, forming the lock beam unlocking trajectory. Figure 2 The timing correspondence between Bluetooth connection events, drive current sampling, and lock beam displacement sampling is shown, as well as the continuity between connection event positions and sampling records after connection restoration.

[0086] The door lock controller converts the drive current and lock beam displacement in the lock beam unlocking trajectory into input pulses, adding a position marker pulse at the beginning of each connection event position. After the input pulses are sent to the improved liquid state machine, the time-gated branch attenuates the previous membrane potential according to the acquisition time interval of adjacent sampling records. When adjacent sampling records belong to the same connection event position, the event-gated branch transmits the attenuated membrane potential to update the current membrane potential; when the connection event position changes, the event-gated branch retains the last membrane potential corresponding to the previous connection event position and transmits the last membrane potential to update the first membrane potential of the next connection event position. The membrane potentials corresponding to each acquisition time are arranged according to the connection event position and acquisition time to form a liquid state sequence.

[0087] The door lock controller retrieves the corresponding drive current and lock beam displacement from the lock beam unlocking trajectory based on the location and acquisition time of the connection event associated with the liquid state. For each connection event location, the drive current with the latest acquisition time is selected. The direction of current change is determined by comparing adjacent last drive currents. The connection event location corresponding to the next drive current when the current change direction reverses is marked as a candidate location. Subsequently, the lock beam displacement is checked along the lock beam unlocking trajectory from the candidate location. When the lock beam displacement continuously increases along the unlocking direction, the candidate location is registered as a release anchor point. Figure 3The diagram illustrates the relationship between the change in the direction of the driving current and the reversal of the direction of the current, as well as the continuous increase in the displacement of the lock beam starting from the position of the corresponding connection event.

[0088] The door lock controller uses the sampling records in the lock beam unlocking trajectory to locate the release anchor point, and registers the latest lock beam displacement within the corresponding connected event position as the current lock beam displacement. As subsequent sampling records are generated in the trajectory, the trajectory pointer moves along the order of the sampling records in the lock beam unlocking trajectory, continuously updating the current lock beam displacement and the current connected event position. The door lock controller locates the current lock beam displacement and the maximum release position of the lock beam in the displacement calibration table, and associates the calibration positions arranged along the unlocking direction between the two with the current connected event position to form the lock beam receiving state.

[0089] After the Bluetooth controller outputs a connection interruption flag, the door lock controller stops updating the lock beam bearing state and saves the last lock beam bearing state and the location of the interruption event to the lock storage area. After the Bluetooth connection is restored, the door lock controller records the event count and occurrence time when the first restored connection event arrives, assigns the position after the interruption event location as the restored connection event location, and appends subsequent connection events to the connection event location sequence. At the first sampling trigger time after restoration, the lock beam displacement is sampled, and the restored connection event location, reconnection beam displacement, sampling time, and sampling sequence number form a reconnection sampling record, which is then appended to the lock beam unlocking trajectory.

[0090] The door lock controller indexes the re-interlock beam displacement using the reconnection event position, updates the current latched beam displacement using the re-interlock beam displacement, and keeps the maximum release position of the beam unchanged. Then, it locates the calibration position corresponding to the re-interlock beam displacement in the displacement calibration table, arranges them along the unlocking direction to the calibration position of the maximum release position of the beam, and associates the arrangement result with the reconnection event position to form a reconnection acceptance state. The door lock controller determines the drive direction based on the arrangement order of the two calibration positions and the corresponding transmission direction table, accumulates the beam displacement span between adjacent calibration positions, and calculates the remaining drive stroke based on the transmission ratio of the lock body actuator. The lock body actuator continues to operate according to the corrected drive direction and drive stroke, and the displacement sensor synchronously collects the beam displacement. The drive stops when the beam displacement reaches the maximum release position.

[0091] like Figure 3As shown, the final drive currents corresponding to connection event positions P2, P3, and P4 are 0.31A, 0.46A, and 0.39A, respectively. The direction of drive current change reverses at connection event position P4, therefore P4 is marked as a candidate position. Starting from P4, the lock beam displacements are 5.6mm, 6.4mm, 7.3mm, and 8.1mm, respectively. The lock beam displacement increases continuously along the unlocking direction, therefore P4 is registered as the release anchor point. After the Bluetooth connection is restored, the re-locking beam displacement is 8.4mm, and the maximum release position of the lock beam is 12.0mm. Therefore, the incomplete displacement of the lock beam is determined to be 3.6mm. The remaining drive stroke is then calculated based on the transmission ratio of the lock body actuator.

[0092] Under the same door lock state, communication interference conditions, and unlocking stroke conditions, the unlocking control method, the fixed drive parameter continuation control method, and the present invention were verified by re-execution, and the application results were statistically analyzed by the door lock control log.

[0093] Table 1 Comparison of the application effects of different smart door lock control methods

[0094] As shown in Table 1, this invention achieves good overall performance in unlocking control after Bluetooth connection restoration. Compared with the re-execution unlocking control method and the fixed drive parameter continuation control method, the unlocking success rate after reconnection of this invention reaches 97.1%, and the repeated drive occurrence rate is reduced to 3.4%. This indicates that this invention utilizes the displacement of the re-locking beam to update the lock beam bearing state, which can maintain the continuity of the unlocking process before and after connection interruption, and reduce repeated drives caused by re-execution of unlocking actions or the use of drive parameters before the interruption.

[0095] The lock beam release position error of this invention is 0.82 mm, lower than the 1.42 mm and 1.16 mm of the two comparative methods; the lock beam incomplete release rate is 2.5%, lower than the 4.7% and 3.8% of the two comparative methods. This indicates that correcting the drive direction and remaining drive stroke of the lock body actuator based on the reconnection state can improve the control accuracy of the lock beam release position and reduce the occurrence of incomplete lock beam release.

[0096] The reconnection unlocking time of this invention is 1.21s, shorter than the 1.48s of the re-execution unlocking control method and the 1.36s of the fixed drive parameter continuation control method. This is because after the Bluetooth connection is restored, the lock beam bearing state locked before the interruption can be directly recalled, and the remaining unlocking stroke can be continued by combining the reconnection lock beam displacement, without having to re-execute the complete unlocking process. The above results show that this invention can simultaneously improve the unlocking success rate and position control accuracy after reconnection, and reduce the repetitive drive rate, the lock beam incomplete release rate, and the reconnection unlocking time.

[0097] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. A smart door lock control method based on Bluetooth communication protocol, characterized in that, Includes the following steps: Establish a Bluetooth connection between the mobile terminal and the smart lock, receive unlocking commands, and arrange Bluetooth connection events in the order of occurrence to form a sequence of connection event locations. The lock body actuator is driven according to the unlocking command, and the drive current and lock beam displacement are collected synchronously. The collected results are mapped to the sequence of connected event positions to form the lock beam unlocking trajectory. An improved liquid state machine is constructed. The sequence of connection event positions and the unlocking trajectory of the locking beam are input into the liquid layer. The current and the displacement of the locking beam are driven according to the connection event position encoding to form a liquid state sequence. Compare the driving currents at adjacent connection event positions in the liquid state sequence, mark the positions where the current change direction reverses, and filter the positions where the lock beam displacement continuously increases from the marked positions to form release anchor points; Update the lock beam displacement after releasing the anchor point along the lock beam unlocking trajectory, retain the maximum release position of the lock beam and the current lock beam displacement, and form the lock beam bearing state; When the Bluetooth connection is interrupted, the locking beam bearing state is latched. When the Bluetooth connection is restored, the location of the restoration event and the displacement of the re-interlocking beam are collected. The location of the restoration event is used to index the displacement of the re-interlocking beam, and the locking beam bearing state is updated to form the reconnection bearing state. The driving direction and driving stroke of the lock body actuator are adjusted according to the reconnection status to perform the unlocking action.

2. The smart door lock control method based on Bluetooth communication protocol according to claim 1, characterized in that, The formation of the connection event location sequence includes the following steps: Extract the Bluetooth connection event carrying the unlock command and mark the Bluetooth connection event as a start connection event; Collect the occurrence time and event count value of each Bluetooth connection event after the initial connection event; Arrange the Bluetooth connection events according to their occurrence time, and identify the event interval between adjacent Bluetooth connection events based on the event count value; Starting with the initial connection event as the sequence starting point, the connection event positions of each Bluetooth connection event are marked according to the arrangement result and event interval, forming a connection event position sequence.

3. The smart door lock control method based on Bluetooth communication protocol according to claim 1, characterized in that, The formation of the lock beam unlocking trajectory includes the following steps: When the lock body actuator responds to the unlocking command, it activates the current sampling circuit and the displacement sensor to collect the drive current and lock beam displacement through the same sampling trigger signal. Call the hardware timer to mark the acquisition time of each sampling trigger signal, and combine the driving current, lock beam displacement and acquisition time corresponding to the same sampling trigger signal to form a sampling record; The sampling time is compared with the occurrence time in the sequence of connection event locations. The Bluetooth connection event that occurs earlier than the sampling time is selected from the Bluetooth connection events that occur earlier than the sampling time, and the sampling record is mapped to the corresponding connection event location. First, arrange the sampling records according to the location of the connection event, then arrange the sampling records corresponding to the same connection event location according to the acquisition time, and combine adjacent sampling records in the order of arrangement to form the lock beam unlocking trajectory.

4. The smart door lock control method based on Bluetooth communication protocol according to claim 1, characterized in that, The construction of the improved liquid state machine includes the following steps: In the membrane potential feedback connection of the liquid layer, a time-gated branch is set up to calculate the acquisition time interval of adjacent acquisition results in the unlocking trajectory of the lock beam, and the acquisition time interval is input into the time-gated branch. In the membrane potential feedback connection, an event-gated branch is set up to compare the connection event positions mapped by adjacent acquisition results and input the comparison results into the event-gated branch. The time-gated branch adjusts the feedback amount of the previous membrane potential according to the acquisition time interval. The event-gated branch transmits the membrane potential feedback amount when the connection event position is the same. When the connection event position changes, the last membrane potential of the previous connection event position is retained, and the last membrane potential is transmitted to the membrane potential update of the next connection event position.

5. The smart door lock control method based on Bluetooth communication protocol according to claim 4, characterized in that, The formation of the liquid state sequence includes the following steps: The collected results in the lock beam unlocking trajectory are arranged according to the sequence of connection event positions. The drive current and lock beam displacement are encoded according to the connection event positions to form an input pulse sequence. The input pulse sequence is input into the liquid layer, and the membrane potential is updated with the first input pulse. When the connection event positions are the same, the time-gated branch adjusts the feedback amount of the previous membrane potential according to the acquisition time interval, and updates the membrane potential with the current input pulse. When the location of a connection event changes, the event gating branch retains the last membrane potential of the previous connection event location and updates the membrane potential with the last membrane potential and the first input pulse of the next connection event location. Each membrane potential is converted into a liquid state, and the liquid states are arranged according to the location of the connection event and the time of acquisition to form a liquid state sequence.

6. The smart door lock control method based on Bluetooth communication protocol according to claim 1, characterized in that, The formation of the release anchor point includes the following steps: The liquid states are arranged according to the location of the connection event. Based on the acquisition time associated with each liquid state, the corresponding driving current and lock beam displacement are retrieved from the lock beam unlocking trajectory. Select the latest acquisition time of the driving current among the locations of each connection event, calculate the change in driving current corresponding to adjacent connection event locations in turn, and determine the direction of current change based on the sign of the change in driving current. Compare the current change direction corresponding to adjacent drive current changes in turn, and mark the connection event position corresponding to the next drive current when the current change direction is reversed as a candidate position. Starting from each candidate position, arrange the lock beam displacement according to the acquisition time, compare adjacent lock beam displacements in turn, retain candidate positions where the lock beam displacement increases continuously along the unlocking direction, and register the retained candidate positions as release anchor points.

7. The smart door lock control method based on Bluetooth communication protocol according to claim 1, characterized in that, The formation of the lock beam bearing state includes the following steps: The sampling record in the unlocking trajectory of the lock beam is located by the position of the connection event in the release anchor point. The sampling record with the latest acquisition time is selected and the corresponding lock beam displacement is registered as the current lock beam displacement. The trajectory pointer moves along the order of the sampling records in the lock beam unlocking trajectory. Each time a sampling record is reached, the current lock beam displacement is updated using the corresponding lock beam displacement, and the corresponding connection event position is registered as the current connection event position. Locate the current lock beam displacement and the maximum release position of the lock beam in the displacement calibration table. Mark the start point of the lock beam's incomplete stroke with the current lock beam displacement and mark the end point of the lock beam's incomplete stroke with the maximum release position of the lock beam. Arrange the calibrated positions between the starting and ending points according to the unlocking direction, and associate the arrangement results with the current connection event position to form the lock beam bearing state.

8. The smart door lock control method based on Bluetooth communication protocol according to claim 1, characterized in that, The locking and recovery data acquisition of the lock beam bearing state includes the following steps: Receive the connection interruption flag output by the Bluetooth controller and save the last lock beam bearing state formed before the connection interruption to the latching area. Locate the last Bluetooth connection event that occurred before the connection was interrupted, and register the corresponding connection event location as the connection interruption event location; After the Bluetooth connection is restored, retrieve the event count value at the time of connection restoration, and append the event count value to the connection event position sequence according to the position of the interrupted connection event to obtain the connection restoration event position. The lock beam displacement is collected at the first sampling trigger moment after the Bluetooth connection is restored. The location of the restored connection event, the collection time, and the lock beam displacement are combined to form a reconnection sampling record, and the lock beam displacement is registered as the reconnection beam displacement.

9. The smart door lock control method based on Bluetooth communication protocol according to claim 8, characterized in that, The formation of the reconnection acceptance state includes the following steps: Based on the location of the reconnection event, the reconnection sampling record will be continued to the lock beam unlocking trajectory; Re-interlock beam displacement by restoring the connection event location index, and replace the current lock beam displacement in the lock beam bearing state with the re-interlock beam displacement; Locate the displacement of the interlocking beam and the maximum release position of the locking beam in the displacement calibration table, and arrange the calibration positions between the two according to the unlocking direction; Associate the location of the restored connection event with the starting point of the arrangement result, and update the lock beam bearing status using the associated arrangement result to form a reconnected bearing status.

10. The smart door lock control method based on Bluetooth communication protocol according to claim 1, characterized in that, The correction of the driving direction and driving stroke includes the following steps: Retrieve the displacement of the interlocking beam from the reconnection and support state, and locate the displacement of the interlocking beam and the maximum release position of the locking beam in the displacement calibration table; The driving direction of the lock body actuator is determined according to the calibration sequence of the displacement of the interlocking beam pointing to the maximum release position of the lock beam; The displacement span of the locking beam at adjacent calibrated positions between the displacement of the interlocking beam and the maximum release position of the locking beam is retrieved in sequence. The displacement span of each locking beam is calculated according to the transmission ratio of the lock body actuator. The calculation results are accumulated to obtain the remaining drive stroke. Update the drive direction of the lock body actuator using the determined drive direction, and update the drive stroke of the lock body actuator using the remaining drive stroke; Drive the lock body actuator according to the updated drive direction and drive stroke, synchronously collect the lock beam displacement, and stop the drive when the lock beam displacement reaches the maximum release position of the lock beam to complete the unlocking action.