A door lock cooperative night guiding method and system
By introducing a global priority list and a network unicast negotiation mechanism into the smart lock system, the problem of resource contention under multi-lock collaboration is solved, achieving decentralized and low-latency resource allocation, and improving user experience and system efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- DESSMANN CHINA MACHINERY & ELECTRONICS
- Filing Date
- 2026-05-09
- Publication Date
- 2026-07-10
AI Technical Summary
Existing smart lock systems cannot effectively coordinate multiple locks to compete for and guide resources when users get up at night, resulting in a poor user experience. Furthermore, existing cloud or central scheduling solutions suffer from high network dependence, response latency, and communication congestion, making it difficult to support flexible priority-based preemption strategies.
A decentralized door lock collaboration method is adopted. By maintaining a global priority list locally and using network unicast messages for chain negotiation, the preemption requests and resource allocation between smart door locks are realized, including preemption request initiation, chain preemption negotiation, preemption confirmation and status update and process termination.
It achieves low-latency door lock collaborative preemption, shortens user waiting time, reduces network dependence, improves system real-time performance and robustness, supports differentiated services for different user priorities, and improves the utilization rate of public resources and system scalability.
Smart Images

Figure CN122157401B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of smart door lock technology, and in particular to a nighttime guidance method and system for door lock collaboration. Background Technology
[0002] With the increasing prevalence of smart homes and age-friendly scenarios, guiding activities such as using the restroom at night has become a crucial requirement for improving residential safety and convenience. Existing smart lock and sensor systems primarily provide independent security or status monitoring functions, failing to dynamically coordinate multiple locks for orderly guidance based on the actual occupancy of public facilities like restrooms when users get up at night. This results in users having to blindly try or wait, leading to a poor user experience. While some solutions attempt centralized scheduling via a central server, these suffer from high response latency, reliance on network stability, and inability to work offline. Particularly in multi-lock collaborative scenarios, they lack a flexible and efficient distributed negotiation mechanism. Therefore, there is an urgent need for a lock collaboration method based on localized priority and chained negotiation, enabling rapid resource acquisition and guidance to improve efficiency and user experience in nighttime scenarios. Summary of the Invention
[0003] The purpose of this invention is to provide a nighttime guidance method and system for door lock collaboration, in order to overcome the shortcomings of the prior art, and to achieve decentralized, low-latency door lock collaboration preemption and guidance, effectively shortening user waiting time.
[0004] One embodiment of this application provides a door lock-coordinated nighttime guidance method, the method comprising:
[0005] Preemption request initiation: Based on the user getting up at night event triggered by the sensing device, the initiating door lock queries the resource occupancy status of public service facilities, selects the target door lock according to the locally maintained global priority list, and sends a unicast preemption request message;
[0006] Chain-based preemption negotiation: Based on the preemption request message received by the target lock, it determines whether it can be preempted; if it cannot be preempted, it selects the next target lock based on the global priority list and forwards the preemption request message, thus forming a chain-based negotiation.
[0007] Confirmation of Preemption and Status Update: Based on the confirmation result of the first door lock that can be preempted during the negotiation process, update the reservation information of the public service facility, and simultaneously update the status indicators of the preemption initiator and the preempted party.
[0008] Process termination and feedback: Based on the termination conditions of successful reservation, unsuccessful traversal, or reaching the progressive level threshold, the relevant door lock will provide feedback and guidance to the user, and add unsuccessful reservation requests to the queue.
[0009] Optionally, the preemption request initiation includes:
[0010] Event Triggering and Status Inquiry: Based on the human activity signal detected by the motion-activated night light in the room, a night-time notification is sent to the corresponding smart door lock, triggering the door lock to initiate a reservation request to public service facilities;
[0011] Resource insufficiency determination and target selection: Based on the resource saturation status reported by public service facilities and the current list of bookers, the system initiates the selection of bookers' locks from the local global priority list. Locks with lower priority than the system and marked as available for preemption are selected, and a list of available target locks is generated.
[0012] Target selection: According to the preset sorting rules, select the lowest priority door lock from the list of available target locks as the first target to be captured;
[0013] Preemption request sending: Based on the network address of the selected target lock, construct a unicast preemption request message containing its own identifier, priority and the list of preemptible target locks, and send it to the target lock.
[0014] Optionally, the chained preemption negotiation includes:
[0015] Request reception and priority verification: Based on the preemption request message received by the target door lock, extract the priority information of the preemption initiator and compare it with its own priority to obtain the priority validity determination result;
[0016] Determining the preemptibility status: Based on the result of the priority check, query the local record of the preemption flag status to determine whether preemption is currently allowed;
[0017] Progressive preemption processing: Based on the judgment that its own status is not preemptible, it is excluded from the list of preemptible target locks attached to the request message, and then the next target lock is selected according to the same sorting rules;
[0018] Request forwarding and status notification: Based on the selected next target lock, the preemption request message is forwarded to that lock; at the same time, a progressive preemption notification message is sent to the original preemption initiator to inform that the negotiation has been forwarded and the new target information.
[0019] Optionally, the preemption confirmation and status update include:
[0020] Preemptible Confirmation: Based on the target door lock, if the user determines that its status is preemptible, update its status to "preempted" and change the local indicator light status to "waiting for user instruction".
[0021] Confirmation message reply: Based on the status update completion event, send a preemption confirmation message unicast to the preemption initiator;
[0022] Facility reservation information update: Based on the preemption confirmation behavior, a reservation update message is sent to the public service facility, requesting that the original reservation holder be changed to the preemption initiator;
[0023] Initiator Status Switching: Based on the preemption confirmation message received by the preemptor, send confirmation information to the public service facility and switch its own indicator light status to indicate successful resource acquisition.
[0024] Optionally, the process termination and feedback include:
[0025] Successful preemption terminated: The process ends when the initiator receives a preemption confirmation message.
[0026] Termination upon failure of traversal: During the chain negotiation process, when a lock determines that it cannot be preempted and there are no other selectable targets in the list of preemptible target locks, it sends a termination message indicating that traversal has failed to succeed to the preemption initiator.
[0027] Level threshold termination: According to the system's preset progressive level threshold, when the number of negotiation transmissions reaches the threshold, the door lock currently holding the request sends a level limit termination message to the initiator.
[0028] Results Feedback and Queuing: Based on any termination message received, the preemption initiator updates the user's indication to wait and notifies the public service facility to add this reservation request to the queue waiting sequence.
[0029] Optionally, the method further includes preset conditions and a coordination mechanism:
[0030] Global list maintenance: Based on the system administrator's configuration, a global priority list containing the unique identifier, IP address, priority level, and current preemption status of all door locks is generated and synchronized to the local storage of each smart door lock;
[0031] Facility status synchronization: Based on the resource usage of public service facilities, dynamically maintain a status table including resource number, reservation status, usage status and current reservation holder identifier, and provide an interface for door lock query and update requests;
[0032] Event-triggered linkage: Based on events detected by devices such as motion-sensor nightlights and human body sensors in the room, a notification is automatically sent to the associated smart door lock to trigger the subsequent reservation or pre-emption process.
[0033] Another embodiment of this application provides a door lock-assisted nighttime guidance system, the system comprising:
[0034] The initiation module is used to initiate a preemption request: based on the user getting up at night event triggered by the sensing device, the initiating door lock queries the resource occupancy status of the public service facility, selects the target door lock according to the locally maintained global priority list, and sends a unicast preemption request message;
[0035] The negotiation module is used for chain-style preemption negotiation: based on the preemption request message received by the target lock, it determines whether it can be preempted; if it cannot be preempted, it selects the next target lock based on the global priority list and forwards the preemption request message, thus forming a chain-style negotiation.
[0036] The update module is used for preemption confirmation and status update: based on the confirmation result of the first door lock that can be preempted during the negotiation process, the reservation information of the public service facility is updated, and the status indicators of the preemption initiator and the preempted party are updated simultaneously.
[0037] The feedback module is used for process termination and feedback: based on the termination conditions of successful reservation, unsuccessful traversal, or reaching the progressive level threshold, the relevant door lock provides feedback to the user on the guidance result and adds unsuccessful reservation requests to the queue.
[0038] Another embodiment of this application provides a storage medium storing a computer program, wherein the computer program is configured to execute the method described in any of the preceding claims when running.
[0039] Another embodiment of this application provides an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the method described in any of the preceding claims.
[0040] Compared with existing technologies, the nighttime guidance method for door lock collaboration provided by this invention can achieve decentralized, low-latency door lock collaborative preemption and guidance, effectively shortening user waiting time. Attached Figure Description
[0041] Figure 1 A hardware structure block diagram of a computer terminal for a door lock-coordinated nighttime guidance method provided in an embodiment of the present invention;
[0042] Figure 2 A flowchart illustrating a nighttime guidance method with door lock coordination provided in an embodiment of the present invention;
[0043] Figure 3 This is a schematic diagram of a door lock-coordinated nighttime guidance system provided in an embodiment of the present invention. Detailed Implementation
[0044] The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0045] With the development of IoT and smart home technologies, smart door locks have been widely used in collective residential areas such as student apartments, factory dormitories, and elderly care facilities. Existing smart door locks typically possess basic capabilities such as identity recognition and network communication, and can work in conjunction with other smart devices (such as sensor lights, service robots, and public restroom access control systems) to expand their application scenarios.
[0046] In collective housing environments, the number of public service facilities (such as public restrooms and public service robots) is typically limited. When multiple users request the same public service at the same time, resource competition can easily arise. Existing solutions often employ the following approaches:
[0047] 1. Centralized cloud scheduling: Requests are received and resources are allocated uniformly by the cloud server;
[0048] 2. Central control node scheduling: Scheduling is performed through the central controller in the local area network.
[0049] The above solution has the following shortcomings:
[0050] 1. Cloud-based scheduling increases network communication overhead and is highly dependent on the network;
[0051] 2. The central node is prone to becoming a single point of failure;
[0052] 3. As the number of devices increases, communication congestion and response delays become more pronounced;
[0053] 4. It is difficult to flexibly support priority preemption strategies based on personnel attributes (such as the elderly or pregnant women).
[0054] Therefore, there is an urgent need for a distributed public resource preemption method that does not require cloud participation or a central node and is completed autonomously by smart locks, in order to reduce network load and improve system real-time performance and robustness.
[0055] This invention first provides a nighttime guidance method in conjunction with door locks. This method can be applied to electronic devices, such as computer terminals, specifically ordinary computers.
[0056] The following detailed explanation uses a computer terminal as an example. Figure 1 This is a hardware structure block diagram of a computer terminal for a door lock-coordinated nighttime guidance method provided in an embodiment of the present invention. (See diagram below.) Figure 1 As shown, the computer device includes a processor, memory, and network interface connected via a system bus, wherein the memory may include non-volatile storage media and internal memory.
[0057] See Figure 2 The present invention provides a nighttime guidance method in conjunction with door locks, which may include the following steps:
[0058] S201, Preemption Request Initiation: Based on the user's nighttime wake-up event triggered by the sensing device, the initiating door lock queries the resource occupancy status of the public service facility, and selects the target door lock according to the locally maintained global priority list and sends a unicast preemption request message; specifically, the preemption request initiation includes:
[0059] Event Triggering and Status Inquiry: Based on the human activity signal detected by the motion-activated night light in the room, a night-time notification is sent to the corresponding smart door lock, triggering the door lock to initiate a reservation request to public service facilities;
[0060] Resource insufficiency determination and target selection: Based on the resource saturation status reported by public service facilities and the current list of bookers, the system initiates the selection of bookers' locks from the local global priority list. Locks with lower priority than the system and marked as available for preemption are selected, and a list of available target locks is generated.
[0061] Target selection: According to the preset sorting rules, select the lowest priority door lock from the list of available target locks as the first target to be captured;
[0062] Preemption request sending: Based on the network address of the selected target lock, construct a unicast preemption request message containing its own identifier, priority and the list of preemptible target locks, and send it to the target lock.
[0063] S202, Chained Preemption Negotiation: Based on the preemption request message received by the target lock, it determines whether it can be preempted; if it cannot be preempted, it selects the next target lock based on the global priority list and forwards the preemption request message, forming a chained negotiation; specifically, the chained preemption negotiation includes:
[0064] Request reception and priority verification: Based on the preemption request message received by the target door lock, extract the priority information of the preemption initiator and compare it with its own priority to obtain the priority validity determination result;
[0065] Determining the preemptibility status: Based on the result of the priority check, query the local record of the preemption flag status to determine whether preemption is currently allowed;
[0066] Progressive preemption processing: Based on the judgment that its own status is not preemptible, it is excluded from the list of preemptible target locks attached to the request message, and then the next target lock is selected according to the same sorting rules;
[0067] Request forwarding and status notification: Based on the selected next target lock, the preemption request message is forwarded to that lock; at the same time, a progressive preemption notification message is sent to the original preemption initiator to inform that the negotiation has been forwarded and the new target information.
[0068] S203, Confirmation of Preemption and Status Update: Based on the confirmation result of the first lock determined to be preemptible during the negotiation process, update the reservation information of the public service facility, and simultaneously update the status indicators of the preemption initiator and the preempted party; specifically, the confirmation of preemption and status update includes:
[0069] Preemptible Confirmation: Based on the target door lock, if the user determines that its status is preemptible, update its status to "preempted" and change the local indicator light status to "waiting for user instruction".
[0070] Confirmation message reply: Based on the status update completion event, send a preemption confirmation message unicast to the preemption initiator;
[0071] Facility reservation information update: Based on the preemption confirmation behavior, a reservation update message is sent to the public service facility, requesting that the original reservation holder be changed to the preemption initiator;
[0072] Initiator Status Switching: Based on the preemption confirmation message received by the preemptor, send confirmation information to the public service facility and switch its own indicator light status to indicate successful resource acquisition.
[0073] S204, Process Termination and Feedback: Based on the termination conditions of successful pre-booking, unsuccessful traversal, or reaching the progressive level threshold, the relevant door lock provides feedback on the guidance result to the user and adds unsuccessful reservation requests to the queue sequence. Specifically, the process termination and feedback includes:
[0074] Successful preemption terminated: The process ends when the initiator receives a preemption confirmation message.
[0075] Termination upon failure of traversal: During the chain negotiation process, when a lock determines that it cannot be preempted and there are no other selectable targets in the list of preemptible target locks, it sends a termination message indicating that traversal has failed to succeed to the preemption initiator.
[0076] Level threshold termination: According to the system's preset progressive level threshold, when the number of negotiation transmissions reaches the threshold, the door lock currently holding the request sends a level limit termination message to the initiator.
[0077] Results Feedback and Queuing: Based on any termination message received, the preemption initiator updates the user's indication to wait and notifies the public service facility to add this reservation request to the queue waiting sequence.
[0078] Furthermore, the method also includes preset conditions and a collaborative mechanism:
[0079] Global list maintenance: Based on the system administrator's configuration, a global priority list containing the unique identifier, IP address, priority level, and current preemption status of all door locks is generated and synchronized to the local storage of each smart door lock;
[0080] Facility status synchronization: Based on the resource usage of public service facilities, dynamically maintain a status table including resource number, reservation status, usage status and current reservation holder identifier, and provide an interface for door lock query and update requests;
[0081] Event-triggered linkage: Based on events detected by devices such as motion-sensor nightlights and human body sensors in the room, a notification is automatically sent to the associated smart door lock to trigger the subsequent reservation or pre-emption process.
[0082] The purpose of this invention is to provide a chain-based negotiation priority preemption method based on network unicast messages, enabling multiple smart locks to autonomously negotiate and preempt and allocate public service resources without cloud scheduling, thereby bringing the following benefits and advantages:
[0083] 1. To achieve efficient and rational use of public service facilities;
[0084] 2. Support differentiated services for users with different priorities;
[0085] 3. Reduce communication interference caused by network broadcasting or multicasting;
[0086] 4. Improve the scalability and reliability of the system.
[0087] 1. Core idea:
[0088] To achieve the above objectives, this invention adopts the following technical solution: In a dormitory environment, each smart lock is interconnected via a network and maintains a consistent "global priority list" locally, meaning each lock records the priority level of all locks locally. When a lock needs to reserve public service facilities for a corresponding user (using the scenario of elderly / pregnant women and other cared-for groups vying for public restrooms at night as an example), "reservation and use" is usually sufficient (the number of reservations is less than the total available public restrooms). However, when the number of reservations exceeds the total available public restrooms at the same time, priority preemption is required. This invention uses a network unicast communication method between smart locks to conduct a sequential, progressive preemption negotiation with other locks that can be preempted according to priority order until resources are successfully acquired or termination conditions are met. The specific operation steps are detailed below.
[0089] 2. The complete technical implementation process is as follows:
[0090] (1) Prerequisites:
[0091] The system should at least have the following basic requirements:
[0092] 1. Smart door lock node (Smart door locks are installed and connected to the network in each dormitory room. The door lock can interact with users, recognize user requests, maintain its own status and priority information, and perform preemption judgment through network communication. The door lock has an indicator light that can indicate the preemption result to the user through red and green lights or audio).
[0093] 2. Sensor-linked devices (including motion-activated nightlights and human body sensors inside the room; these devices can communicate and link with door locks to trigger events such as getting up at night).
[0094] 3. Access control nodes for public service facilities (such as sensor doors in public restrooms, used to receive lock reservation and occupancy instructions, and to determine their own occupancy and vacancy status, etc.).
[0095] 4. Communication network (can be a local area network, wired or wireless network, supporting point-to-point unicast communication);
[0096] 5. Global Priority List (Each smart lock maintains a global priority list locally. The list includes at least the lock's unique identifier, the corresponding priority level, and a flag indicating whether preemption is allowed. This list is configured by the system administrator and distributed to each lock locally on each update).
[0097] (2) Procedure under normal conditions:
[0098] Under normal circumstances, the procedure for someone getting up to use the toilet at night is as follows:
[0099] 1. The motion-sensor night light detects human activity;
[0100] 2. The night light sends a notification of nighttime activity to the corresponding smart door lock via the network;
[0101] 3. The door lock reserves services from the public restroom and its indicator light is set to green;
[0102] 4. Public restrooms update their availability status and availability data, allowing people to use the restrooms at night;
[0103] 5. When a person leaves the public restroom after using the toilet at night, the public restroom updates its own availability status and availability data.
[0104] The normal process is now complete. When the total number of people getting up at night does not exceed the number of available public restrooms at the same time, the process for handling nighttime toilet use will always follow the above procedure. When the number of people getting up at night exceeds the number of available public restrooms at the same time, a priority process is required, which is the key content of this invention (as described below).
[0105] (3) Seizure Process (Key Content of this Invention):
[0106] Step 1: Initiate the preemption request;
[0107] When dormitory occupants get up at night, the following events occur within the system:
[0108] 1. The motion-sensor night light detects human activity;
[0109] 2. The night light sends a notification of nighttime activity to the corresponding smart door lock via the network;
[0110] 3. The smart door lock allows users to reserve public restroom services and learn that the public restrooms are unavailable;
[0111] 4. The smart lock acts as the preemption origin, selecting the first target lock to preempt according to a preset order (e.g., from low priority to high priority) based on the global priority list;
[0112] 5. Send a preemption request message to the target door lock via a network unicast message.
[0113] Taking door lock 001 initiating a preemption request as an example, when door lock 001 reserves service from the public restroom, the public restroom knows from its own status table that there are no available spaces. The following table represents the public restroom's status table 1:
[0114] Table 1
[0115] ;
[0116] Note: There are two reservation statuses: unreserved / reserved. There are three usage statuses: in use / unused / released. Because there is a status of unreserved but directly used, when actually grabbing the door lock, it can only grab the reserved but unused resources, indicating that the person has gotten up at night but has not yet used the toilet resources.
[0117] The public restroom, based on the information in the aforementioned status table, reports the current resource status to lock 001, along with information about the stall reservation holders. As shown in the example above, the stalls that have been reserved but not yet used are: locks 011-015. Upon receiving this information, lock 001 queries its local lock priority list. This list is the "global priority list" mentioned earlier, maintained centrally by the system administrator and synchronously distributed to each lock upon any changes. An example of this lock priority list is shown in Table 2 below.
[0118] Table 2
[0119] ;
[0120] Note: The priority levels in this example range from 1 to 5, with 1 being the highest priority and 5 being the lowest priority.
[0121] Therefore, door lock 001 first queries the local "global priority list" to obtain the priority information of the currently reserved door locks 011-015, and selects the lowest priority one as the target to preempt, which is door lock 015 in this case, with the unique ID: Lock_015 and IP address: 10.10.10.15. (If there are multiple lowest priority options, one is selected randomly). Then, door lock 001 sends a network unicast message to it, carrying its own door lock number, door lock unique ID, door lock IP address, door lock priority, and the list of door locks that can be preempted (door locks 011-015, this list is key to the subsequent chained transmission), and makes a request to preempt the public restroom.
[0122] Step Two: Determining the Lock Being Preempted and Proceeding with the Preemption Process;
[0123] After receiving a takeover request, the preempted lock executes the following logic:
[0124] 1. Determine whether the current state of the lock allows it to be preempted (e.g., if the user has left the house, the lock will set its state to non-preemptible; if the user has not yet left the house, the lock will set its state to preemptible).
[0125] 2. If it is determined that it cannot be preempted, then:
[0126] Select the next preemptible target lock from the local global priority list, following the same sorting rules;
[0127] Send a preemption request to the next target lock, along with information about the preemption source;
[0128] At the same time, a progressive preemption status notification is sent to the preemption origin, indicating that the preemption has been passed on and information such as the new preemption target is provided.
[0129] 3. If it is determined that the territory can be preempted, then:
[0130] Proceed to the preemption confirmation and permission handover process (Step 3).
[0131] The above process can be executed sequentially among multiple door locks.
[0132] Taking the example of lock 001 preempting lock 015 in step one, after receiving the unicast preemption message from lock 001, lock 015 first confirms its priority. According to the message sent by lock 001, lock 001's priority is 2, and lock 015's own priority is 5. Therefore, it can preempt the lock based on its priority. Then, lock 015 confirms its own preemption flag and finds that the current preemption flag status is unpreemptible (indicating that the person has already left or other unpreemptible factors are being triggered). So, lock 015 queries the list of preemptible locks (locks 011-015, passed from lock 001) and the "global priority list". It finds that the next lowest priority lock besides itself is lock 014, and sends a network unicast message to lock 014, carrying the relevant information of the preemption source (lock 001) (number, ID, IP, priority), as well as the list of preemptible locks (locks 011-015, this list is key to the subsequent chain transmission), and makes a request to preempt the public restroom. Then, door lock 015 replies to door lock 001 with a unicast message indicating that it has refused to preempt the lock and notifies the progressive preemption status. The message carries the information of the target door lock for progressive preemption (the number, ID, IP and priority of door lock 014), as well as its own door lock information (the number, ID, IP and priority of door lock 015) and the reason for refusing to preempt the lock.
[0133] After receiving the preemption message, door lock 014 first confirms its priority. According to the message, door lock 001 has a priority of 2, and door lock 014 itself has a priority of 4. Therefore, it can preempt based on its priority. After that, door lock 014 confirms its own preemption status and finds that it is currently preemptible. So door lock 014 enters the preemption confirmation and permission handover process (detailed in step 3).
[0134] If lock 014 still cannot be preempted at this point, it can continue to pass on the preemption message according to the above process until a preemption target is found or the condition is terminated. (Steps three and four are described in detail)
[0135] Step 3: Confirmation of authorization and handover of permissions;
[0136] When a door lock determines that it can be preempted:
[0137] 1. Update its status to "preempted" (at this time, the door lock will turn its indicator light red to indicate to the user that they need to wait);
[0138] 2. A preemption confirmation message is sent back to the preemption originator via network unicast message;
[0139] 3. Send a reservation update message to the previously booked public restrooms, and the public restrooms will update the original reservation holder information;
[0140] 4. The system will seize the initiative, receive confirmation of the initiative, verify the status with the public restroom, and switch its own display status.
[0141] 5. Public restrooms will be placed in a pre-arranged queue for those whose locks have been seized, and you will be notified when they become available.
[0142] Taking the confirmation of door lock 014's reservation as an example, it first switches its display status (red light) to indicate that the user needs to wait. Then, it sends a reservation confirmation message to the reservation source (door lock 001) via network unicast. Afterward, it sends a reservation update message to the previously reserved public restroom, notifying the public restroom that the previous reservation holder has been replaced by door lock 001. The public restroom then updates its reservation information. After receiving the reservation confirmation message, the reservation source (door lock 001) sends a confirmation message to the public restroom and switches its display status (green light). At the same time, the public restroom has added door lock 014's reservation to its reservation queue list, waiting to notify the user when it becomes available.
[0143] Step 4: Preempt the termination condition;
[0144] The preemption process terminates when any of the following conditions are met:
[0145] 1. When a specific target door lock is successfully captured;
[0146] 2. When all preemptible locks in the global priority list have been traversed (including when there are no preemptible locks);
[0147] 3. Reach the preset progressive level threshold (e.g., a maximum of 5 progressive levels; this condition is optional and can be preset by the system).
[0148] After the event concludes, the system updates its status based on the result and provides feedback to the user via indicator lights and sounds. Simultaneously, the public restroom adds the user to its reservation queue, waiting to notify them when it becomes available.
[0149] In the example of step three above, door lock 001 has successfully preempted the target door lock 014, thus the preemption termination is completed in step three. The following assumes that the preemption flags of door locks 011-015 are all non-preemptible, to illustrate the termination method under other conditions: Under the current conditions, step two above will start with door lock 015, and the preemption message of door lock 001 will be passed sequentially as follows: door lock 015 -> door lock 014 -> door lock 013 -> door lock 012 -> door lock 011. When it reaches door lock 011, door lock 011, after confirming its own preemption flag, finds it is still non-preemptible, therefore... After checking the list of available locks (locks 011-015, relayed from lock 001), lock 011 finds that there are no more locks available. Therefore, lock 011 replies to the seizure source (lock 001) with a seizure termination message. This message carries lock 011's information (lock number, ID, IP address, and priority), the list of available locks (locks 011-015), and notifies that the seizure has been completed and no locks are available. Lock 001 receives this termination message and confirms, displaying a red light on its device to indicate that the user needs to wait. Lock 001's reservation message will then be registered in the public restroom's reservation queue, awaiting notification when the public restroom becomes available.
[0150] Beneficial effects:
[0151] Compared with existing technologies, this method has the following advantages and beneficial effects:
[0152] 1. No cloud-based scheduling required, reducing network and central dependency;
[0153] 2. Employ unicast communication to reduce broadcast storms in the network;
[0154] 3. Supports distributed priority preemption to avoid central node failure;
[0155] 4. Improve the utilization rate of public resources;
[0156] 5. Flexibly adapt to the different user priority requirements, improving system scalability and flexibility.
[0157] Innovation points:
[0158] 1. A global priority list on the door lock side based on personnel attribute priority, so that priority preemption negotiation strategies can be carried out in a distributed manner among door lock sides;
[0159] 2. Negotiation methods and mechanisms based on network unicast messages between endpoints;
[0160] 3. Negotiation methods and mechanisms for chained transmission of network unicast messages when multi-level priority and non-preemptive state are combined.
[0161] Another embodiment of the present invention provides a door lock-coordinated nighttime guidance system, see [link to relevant documentation]. Figure 3 The system may include:
[0162] Initiation module 301 is used to initiate a preemption request: based on the user getting up at night event triggered by the sensing device, the initiating door lock queries the resource occupancy status of the public service facility, and selects the target door lock according to the locally maintained global priority list and sends a unicast preemption request message;
[0163] The negotiation module 302 is used for chain-style preemption negotiation: based on the preemption request message received by the target door lock, it determines whether it can be preempted; if it cannot be preempted, it selects the next target door lock based on the global priority list and forwards the preemption request message to form a chain-style negotiation.
[0164] Update module 303 is used for preemption confirmation and status update: based on the confirmation result of the first door lock that can be preempted during the negotiation process, update the reservation information of the public service facility, and simultaneously update the status indication of the preemption initiator and the preempted party.
[0165] Feedback module 304 is used for process termination and feedback: based on the termination conditions of successful preemption, unsuccessful traversal, or reaching the progressive level threshold, the relevant door lock provides feedback to the user on the guidance result and adds unsuccessful reservation requests to the queue sequence.
[0166] This invention also provides a storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above method embodiments when running.
[0167] This invention also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0168] Specifically, the aforementioned electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the aforementioned processor, and the input / output device is connected to the aforementioned processor.
[0169] The above description, based on the embodiments shown in the figures, details the structure, features, and effects of the present invention. The above description is only a preferred embodiment of the present invention, but the present invention is not limited to the scope of implementation shown in the figures. Any changes made in accordance with the concept of the present invention, or equivalent embodiments modified to have equivalent changes, that do not exceed the spirit covered by the specification and figures, should be within the protection scope of the present invention.
Claims
1. A nighttime guidance method in conjunction with door locks, characterized in that, The method includes: Preemption request initiation: Based on the user getting up at night event triggered by the sensing device, the initiating door lock queries the resource occupancy status of public service facilities, selects the target door lock according to the locally maintained global priority list, and sends a unicast preemption request message; Chain-based preemption negotiation: Based on the preemption request message received by the target lock, it determines whether it can be preempted; if it cannot be preempted, it selects the next target lock based on the global priority list and forwards the preemption request message, thus forming a chain-based negotiation. Confirmation of Preemption and Status Update: Based on the confirmation result of the first door lock that can be preempted during the negotiation process, update the reservation information of the public service facility, and simultaneously update the status indicators of the preemption initiator and the preempted party. Process termination and feedback: Based on the termination conditions of successful reservation, unsuccessful traversal, or reaching the progressive level threshold, the relevant door lock will provide feedback and guidance to the user, and add unsuccessful reservation requests to the queue.
2. The method according to claim 1, characterized in that, The preemption request is initiated by including: Event Triggering and Status Inquiry: Based on the human activity signal detected by the motion-activated night light in the room, a night-time notification is sent to the corresponding smart door lock, triggering the door lock to initiate a reservation request to public service facilities; Resource insufficiency determination and target selection: Based on the resource saturation status reported by public service facilities and the current list of bookers, the system initiates the selection of bookers' locks from the local global priority list. Locks with lower priority than the system and marked as available for preemption are selected, and a list of available target locks is generated. Target selection: According to the preset sorting rules, select the lowest priority door lock from the list of available target locks as the first target to be captured; Preemption request sending: Based on the network address of the selected target lock, construct a unicast preemption request message containing its own identifier, priority and the list of preemptible target locks, and send it to the target lock.
3. The method according to claim 2, characterized in that, The chain-like preemption negotiation includes: Request reception and priority verification: Based on the preemption request message received by the target door lock, extract the priority information of the preemption initiator and compare it with its own priority to obtain the priority validity determination result; Determining the preemptibility status: Based on the result of the priority check, query the local record of the preemption flag status to determine whether preemption is currently allowed; Progressive preemption processing: Based on the judgment that its own status is not preemptible, it is excluded from the list of preemptible target locks attached to the request message, and then the next target lock is selected according to the same sorting rules; Request forwarding and status notification: Based on the selected next target lock, the preemption request message is forwarded to that lock; at the same time, a progressive preemption notification message is sent to the original preemption initiator to inform that the negotiation has been forwarded and the new target information.
4. The method according to claim 3, characterized in that, The preemption confirmation and status update include: Preemptible Confirmation: Based on the target door lock, if the user determines that its status is preemptible, update its status to "preempted" and change the local indicator light status to "waiting for user instruction". Confirmation message reply: Based on the status update completion event, send a preemption confirmation message unicast to the preemption initiator; Facility reservation information update: Based on the preemption confirmation behavior, a reservation update message is sent to the public service facility, requesting that the original reservation holder be changed to the preemption initiator; Initiator Status Switching: Based on the preemption confirmation message received by the preemptor, send confirmation information to the public service facility and switch its own indicator light status to indicate successful resource acquisition.
5. The method according to claim 4, characterized in that, The process termination and feedback include: Successful preemption terminated: The process ends when the initiator receives a preemption confirmation message. Termination upon failure of traversal: During the chain negotiation process, when a lock determines that it cannot be preempted and there are no other selectable targets in the list of preemptible target locks, it sends a termination message indicating that traversal has failed to succeed to the preemption initiator. Level threshold termination: According to the system's preset progressive level threshold, when the number of negotiation transmissions reaches the threshold, the door lock currently holding the request sends a level limit termination message to the initiator. Results Feedback and Queuing: Based on any termination message received, the preemption initiator updates the user's indication to wait and notifies the public service facility to add this reservation request to the queue waiting sequence.
6. The method according to claim 5, characterized in that, The method also includes preset conditions and a collaborative mechanism: Global list maintenance: Based on the system administrator's configuration, a global priority list containing the unique identifier, IP address, priority level, and current preemption status of all door locks is generated and synchronized to the local storage of each smart door lock; Facility status synchronization: Based on the resource usage of public service facilities, dynamically maintain a status table including resource number, reservation status, usage status and current reservation holder identifier, and provide an interface for door lock query and update requests; Event-triggered linkage: Based on events detected by devices such as motion-sensor nightlights and human body sensors in the room, a notification is automatically sent to the associated smart door lock to trigger the subsequent reservation or pre-emption process.
7. A door lock-coordinated nighttime guidance system, characterized in that, The system includes: The initiation module is used to initiate a preemption request: based on the user getting up at night event triggered by the sensing device, the initiating door lock queries the resource occupancy status of the public service facility, selects the target door lock according to the locally maintained global priority list, and sends a unicast preemption request message; The negotiation module is used for chain-style preemption negotiation: based on the preemption request message received by the target lock, it determines whether it can be preempted; if it cannot be preempted, it selects the next target lock based on the global priority list and forwards the preemption request message, thus forming a chain-style negotiation. The update module is used for preemption confirmation and status update: based on the confirmation result of the first door lock that can be preempted during the negotiation process, the reservation information of the public service facility is updated, and the status indicators of the preemption initiator and the preempted party are updated simultaneously. The feedback module is used for process termination and feedback: based on the termination conditions of successful reservation, unsuccessful traversal, or reaching the progressive level threshold, the relevant door lock provides feedback to the user on the guidance result and adds unsuccessful reservation requests to the queue.
8. The system according to claim 7, characterized in that, The initiating module is specifically used for: Event Triggering and Status Inquiry: Based on the human activity signal detected by the motion-activated night light in the room, a night-time notification is sent to the corresponding smart door lock, triggering the door lock to initiate a reservation request to public service facilities; Resource insufficiency determination and target selection: Based on the resource saturation status reported by public service facilities and the current list of bookers, the system initiates the selection of bookers' locks from the local global priority list. Locks with lower priority than the system and marked as available for preemption are selected, and a list of available target locks is generated. Target selection: According to the preset sorting rules, select the lowest priority door lock from the list of available target locks as the first target to be captured; Preemption request sending: Based on the network address of the selected target lock, construct a unicast preemption request message containing its own identifier, priority and the list of preemptible target locks, and send it to the target lock.
9. A storage medium, characterized in that, The storage medium stores a computer program, wherein the computer program is configured to execute the method of any one of claims 1-6 when it is run.
10. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the method of any one of claims 1-6.