Smart door lock networking method, device, equipment, storage medium and program product

By calculating the gateway score and ranking table of smart lock nodes, and selecting locks with strong adaptability as gateways, the problem of insufficient network coverage of smart locks is solved, and efficient network management and resource optimization are achieved.

CN122372353APending Publication Date: 2026-07-10CHINA MOBILE M2M +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA MOBILE M2M
Filing Date
2026-03-02
Publication Date
2026-07-10

Smart Images

  • Figure CN122372353A_ABST
    Figure CN122372353A_ABST
Patent Text Reader

Abstract

This application discloses a method, apparatus, device, storage medium, and program product for networking smart door locks, belonging to the field of Internet of Things (IoT) technology. The method includes: for each door lock node, determining a gateway score based on the door lock node's capability information; this gateway score characterizes the door lock node's adaptability as a gateway node; determining a gateway application ranking table based on the gateway scores and device identification information of multiple door lock nodes; selecting a gateway node from the multiple door lock nodes according to the gateway application ranking table, and determining the child nodes associated with the gateway node; and completing the networking by establishing a master-slave relationship between the gateway node and the child nodes. This method ensures that all door lock nodes are included in the network, achieving comprehensive coverage of the smart door lock network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of Internet of Things (IoT) technology, and in particular to a smart door lock networking method, device, equipment, storage medium, and program product. Background Technology

[0002] With the rapid development of the Internet of Things (IoT) industry, smart home appliances are gradually entering people's daily lives, and the networking and connection of smart devices has become a hot technological topic. Currently, smart terminals typically connect to various smart home devices through a central controller (i.e., a dedicated control node), which then forwards the instructions from the smart terminals to other smart home devices. This approach forms a typical star network structure.

[0003] However, in smart lock management, especially for rental housing, the traditional star network structure faces certain challenges. For example, in a rental building, each room is equipped with a smart lock with networking capabilities, and the management requirement is to manage all smart locks in the entire building uniformly. Using a star network structure, the central node must cover all smart lock nodes. However, due to the limited transmission distance of the devices, a star network struggles to cover the edge nodes within the building. Summary of the Invention

[0004] This application provides a method, apparatus, device, storage medium, and program product for networking smart locks, to at least solve the problem that existing networks cannot cover all smart lock nodes.

[0005] To solve the above-mentioned technical problems, this application is implemented as follows: In a first aspect, embodiments of this application provide a smart door lock networking method applied to multiple door lock nodes, wherein the multiple door lock nodes are interconnected and communicate with each other. The method includes: for each door lock node, determining a gateway score based on the capability information of the door lock node, wherein the gateway score is used to characterize the adaptability of the door lock node as a gateway node; determining a gateway application sorting table based on the gateway scores and device identification information of the multiple door lock nodes; selecting a gateway node from the multiple door lock nodes according to the gateway application sorting table, and determining the child nodes associated with the gateway node; and completing the networking by establishing a master-slave relationship between the gateway node and the child nodes.

[0006] Secondly, embodiments of this application provide a smart door lock networking device applied to multiple door lock nodes, wherein the multiple door lock nodes are interconnected and communicate with each other. The device includes: a first determining module, used to determine a gateway score for each door lock node based on the capability information of the door lock node, wherein the gateway score is used to characterize the adaptability of the door lock node as a gateway node; a second determining module, used to determine a gateway application ranking table based on the gateway scores and device identification information of the multiple door lock nodes; and a networking module, used to select a gateway node from the multiple door lock nodes according to the gateway application ranking table, and determine the child nodes associated with the gateway node, thereby completing the networking by establishing a master-slave relationship between the gateway node and the child nodes.

[0007] Thirdly, embodiments of this application provide an electronic device, which includes a processor and a memory. The memory stores programs or instructions that can run on the processor, and when the programs or instructions are executed by the processor, they implement the steps of the method described in the first aspect above.

[0008] Fourthly, embodiments of this application provide a computer-readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect above.

[0009] Fifthly, embodiments of this application provide a computer program product, the computer program product including a computer program stored on a non-transitory computer-readable storage medium, the computer program including program instructions, which, when executed by a computer, cause the computer to perform the steps of the method described in the first aspect above.

[0010] In this embodiment, for each door lock node, a gateway score is determined based on the node's capability information. This gateway score characterizes the door lock node's adaptability as a gateway node. A gateway application ranking table is determined based on the gateway scores and device identification information of multiple door lock nodes. A gateway node is selected from the multiple door lock nodes according to the ranking table, and child nodes associated with the gateway node are determined. A master-slave relationship is established between the gateway node and its child nodes to complete the network formation. Thus, by calculating the gateway score based on the capability information of each door lock node and determining the gateway application ranking table based on the gateway score, it is ensured that door lock nodes with strong adaptability are selected as gateway nodes. Furthermore, by establishing a master-slave relationship between the gateway node and its child nodes, it is ensured that all door lock nodes are included in the network, thereby achieving comprehensive coverage of the smart door lock network.

[0011] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description

[0012] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0013] Figure 1 A flowchart illustrating a smart door lock networking method provided in some embodiments of this application is shown; Figure 2 This paper illustrates a graph showing the functional relationship between the coverage score of a door lock node and the number of neighboring nodes provided in some embodiments of this application. Figure 3 The present application provides a schematic diagram of the structure of a smart door lock networking device according to some embodiments; Figure 4 The diagram shows a schematic representation of the structure of an electronic device provided in some embodiments of this application. Detailed Implementation

[0014] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0015] With the intelligent transformation of short-term rental scenarios such as online rental rooms, training bases, and apartments, more and more check-in scenarios are using cellular smart door locks. However, in scenarios with large-scale operation, each smart door lock independently connects to the platform for data reporting and command drop-down operations, which leads to at least the following problems: (1) This independent connection architecture puts great pressure on the server's processing power and network bandwidth. The server needs to respond to a large number of concurrent requests from door locks at the same time. As the number of door locks deployed increases, the system response latency will increase significantly and the stability will continue to decline. At the same time, the decentralized device management method is not conducive to centralized monitoring and rapid repair of faults, which reduces the overall reliability of the system.

[0016] (2) The distribution of smart door lock devices is relatively scattered. Due to the limited transmission distance of the devices, the platform is difficult to cover the edge nodes, which increases the difficulty of unified management of smart door locks.

[0017] To address the aforementioned problems in the management of smart locks, this application provides a smart lock networking method. This method calculates a gateway score based on the capability information of each lock node, determines a gateway application ranking table based on the gateway score, and ensures that lock nodes with strong adaptability are selected as gateway nodes. By establishing a master-slave relationship between the gateway node and its child nodes, it ensures that all lock nodes are included in the network, thereby achieving comprehensive coverage of the smart lock network.

[0018] Please see Figure 1 , Figure 1 The diagram illustrates a flowchart of a smart lock networking method provided in some embodiments of this application. The method can be implemented by multiple smart lock nodes, which communicate and connect with each other. Figure 1 As shown, the method 100 may include the following steps: Step 101: For each door lock node, determine the gateway score based on the capability information of the door lock node. The gateway score is used to characterize the adaptability of the door lock node as a gateway node.

[0019] In practice, each smart lock can act as a lock node, and each lock node can independently connect to the server. When it receives a network command from the server, or when an administrator manually triggers network formation via a combination of keys on the lock panel, each lock node determines its gateway score based on its own capabilities. This gateway score characterizes the lock node's adaptability as a gateway node. For example, the gateway score can be calculated based on the lock node's signal coverage capability; it can also be calculated based on the lock node's battery level, message frequency, signal strength, and other information; or it can comprehensively consider the lock node's battery level, message frequency, signal strength, coverage capability, and other capability information to calculate the gateway score for that lock node.

[0020] Step 102: Determine the gateway application sorting table based on the gateway scores and device identification information of multiple door lock nodes.

[0021] In some possible implementations, a gateway application sorting table can be determined based on a preset sorting rule according to the gateway scores and device identification information of multiple door lock nodes. The sorting rule includes sorting the gateways from high to low scores, and sorting them according to the device identification information of the door lock nodes when the gateway scores are the same.

[0022] In practice, after calculating its final gateway score, each door lock node can broadcast its gateway score to other door lock nodes via flooding. Each door lock node will receive the gateway scores from other door lock nodes and build a gateway application sorting table based on the gateway scores received from all door lock nodes.

[0023] The gateway application ranking table is arranged in descending order of gateway score. Devices with the same score are ranked according to their device identification information (such as device ID). The gateway application ranking table is generated in each door lock node to ensure consistency in the ranking of potential gateway nodes across all devices.

[0024] In an exemplary embodiment, taking four thread door lock devices (i.e., door lock nodes) as an example, assume their device attributes are as follows: Device 1: ID = 12, Gateway Score = 50.4; Device 2: ID = 8, Gateway Score = 48.7; Device 3: ID = 15, Gateway Score = 50.4; Device 4: ID = 6, Gateway Score = 42.3.

[0025] After each device calculates its own final gateway score, it broadcasts its score to other devices via a flood message. During this process, all devices receive each other's final gateway scores. Device 1 broadcasts its gateway score of 50.4 to Devices 2, 3, and 4. Device 2 broadcasts its gateway score of 48.7 to other devices, and so on.

[0026] After receiving the final scores from other devices, each device generates a gateway application sorting table locally. This sorting table is arranged from highest to lowest gateway score; if gateway scores are the same, they are sorted in ascending order by device ID. This sorting table is generated by each device to ensure consistency and avoid conflicts in subsequent gateway applications.

[0027] Based on the IDs and scores of the aforementioned four devices, the sorting table is as follows: Device 1: ID = 12, Gateway Score = 50.4; Device 3: ID = 15, Gateway Score = 50.4 (Device 1 and Device 3 have the same gateway score, sorted in ascending order by ID, ID = 12 is listed before ID = 15); Device 2: ID = 8, Gateway Score = 48.7; Device 4: ID = 6, Gateway Score = 42.3; It should be noted that during the synchronization process of the gateway request sorting table, all devices generate the same gateway request sorting table according to the sorting method described above, based on the received messages. Because Thread devices and other mesh technologies have multi-hop communication capabilities, even if some devices are far apart, they can receive scores and broadcast messages through intermediate nodes, ensuring score synchronization throughout the network. Once all devices have completed the above steps, each device independently generates its own gateway request sorting table, and these sorting tables are completely identical.

[0028] Step 103: Select a gateway node from multiple door lock nodes according to the gateway application sorting table, and determine the child nodes associated with the gateway node. Complete the network by establishing a master-slave relationship between the gateway node and the child nodes.

[0029] In practice, the gateway node can be selected from multiple lock nodes based on the gateway application sorting table and a preset topology optimization algorithm, such as the shortest path tree (SPT) or other clustering algorithms. The child nodes associated with the gateway node are then determined, and the network is completed by establishing a master-slave relationship between the gateway node and the child nodes.

[0030] This application provides a smart lock networking method. For each lock node, a gateway score is determined based on its capability information. This gateway score characterizes the lock node's adaptability as a gateway node. A gateway application ranking table is determined based on the gateway scores and device identification information of multiple lock nodes. A gateway node is selected from the multiple lock nodes according to the ranking table, and child nodes associated with the gateway node are determined. A master-slave relationship is established between the gateway node and its child nodes to complete the networking. By calculating the gateway score based on the capability information of each lock node and determining the gateway application ranking table based on the gateway score, it is ensured that lock nodes with strong adaptability are selected as gateway nodes. Furthermore, by establishing a master-slave relationship between the gateway node and its child nodes, it is ensured that all lock nodes are included in the network, thereby achieving comprehensive coverage of the smart lock network.

[0031] In some embodiments, in step 101 above, the capability information includes device status information and neighbor node information; determining the gateway score based on the door lock node's capability information includes: Based on the device status information of the door lock node, determine the initial gateway score; wherein the device status information includes at least one of the following: battery level, message frequency within a preset time period, and signal strength; based on the neighbor node information of the door lock node, determine the coverage score, which is used to indicate the coverage capability of the door lock node; based on the initial gateway score and the coverage score, determine the gateway score.

[0032] In one exemplary embodiment, each door lock node can connect to the server independently. When it receives a network formation command from the server, or when an administrator manually triggers network formation via a combination of keys on the door lock panel, the door lock node enters a search process. Within the configured time window, all door lock nodes that triggered network formation start search mode, scan surrounding thread door lock nodes, and obtain information about neighboring nodes, such as recording the number of neighboring nodes scanned (t) and the device identifier ID of the neighboring nodes.

[0033] After collecting information from surrounding neighboring nodes, each door lock device calculates its initial gateway score. This initial gateway score can be calculated by combining one or more factors, including the device's battery level, recent message frequency, and 4G signal strength. Specifically, it can be calculated as follows: The initial gateway score measures the ability of a door lock device to function as a gateway node under current internal conditions. The calculation formula is as follows: ; in: Indicates the initial gateway score; This indicates the device's current battery level. This is the device's maximum power. To ensure the minimum power consumption required for a gateway to function in cellular communication, Values ​​in and In between, The value ranges from 0 to 1 and increases linearly with the current battery level; a higher value indicates greater suitability as a gateway node. Less than When this occurs, it indicates that the device cannot perform cellular communication and can only exchange data with other nodes by joining a thread network as a child node. In this case, directly setting... If the value is 0, stop calculating the gateway score; This indicates the recent message frequency of the device (the number of messages sent and received), with 1 added to avoid division by zero. A low message frequency indicates that the lock is not used by customers or is used infrequently, making it more suitable as a gateway node for handling message reporting and distribution. The value ranges from 0 to 1, with higher values ​​indicating lower recent message frequency. Indicates the device's 4G signal strength. This represents the maximum signal strength. This represents the worst possible signal strength to support cellular communication and function as a gateway. Similar to the battery power calculation formula, a stronger signal receives a higher score. Less than If necessary, directly set the gateway score to 0 to stop gateway score calculation; , , This is a weighting factor used to balance the effects of battery power, message frequency, and signal strength. It is dynamically adjusted according to actual needs and defaults to 1.

[0034] In addition, each device will calculate a coverage score based on the number of other devices it can cover (i.e., neighboring nodes that can exchange information with other thread lock devices). .

[0035] Determine the gateway score based on the initial gateway score and coverage score. For example, the product of the initial gateway score and the coverage score determines the gateway score, as shown in the following formula: ; The final gateway score represents the device's overall capability as a gateway node, encompassing the device's internal status (battery, signal, message frequency) and its external coverage capabilities.

[0036] This application embodiment comprehensively considers the device's battery level, message frequency, and 4G signal strength, and uses an algorithm to select healthy devices with high battery level, low message frequency, and strong signal strength as gateway nodes. Specifically, when the battery level or signal strength falls below a certain threshold, the device can be automatically excluded from the gateway candidate node list to ensure efficient network allocation.

[0037] In some possible implementations, the coverage score can adopt a gradient curve that first rises and then falls, meaning that the coverage score only changes significantly when the number of covered devices reaches a certain range; and the gain in coverage score gradually decreases after the number of covered devices increases to a certain extent. This is because for any potential gateway node, if its covered nodes are less than a certain threshold A, it has virtually no value in being prioritized as a gateway; and once its covered nodes exceed a certain threshold B, the extra covered nodes are meaningless since the gateway device itself can only connect to a limited number of child nodes. Based on this, this application's embodiment selects the Sigmoid function as the coverage score calculation function, meaning that the aforementioned neighbor node information includes the number of neighbor nodes, and the coverage score is determined in the following way: ; in, The coverage score is t; the number of neighboring nodes is t. The baseline value for the number of covered nodes reflects the location where the coverage score changes rapidly (for example, setting this value to 6 indicates that the function value changes the fastest when t is around 6); k is an adjustment parameter used to control the increment of the coverage score.

[0038] In an exemplary embodiment, the smart lock used in the survey ideally has thresholds A and B of 1 and 5, respectively. After modeling, the appropriate formula for calculating the coverage score is as follows: ; The functional relationship between the coverage score of a door lock node and the number of neighboring nodes is as follows: Figure 2 As shown, the coverage score is basically 0 when the number of covered devices is 1 or less, changes rapidly between 2 and 4, and is basically 1 when the number of covered devices is 5 or more, which can well meet the requirements for calculating the coverage score.

[0039] In this embodiment, the coverage score is a key indicator measuring the coverage capability of each gateway node to other nodes during network formation. The coverage score uses a Sigmoid curve, meaning that the score increases rapidly when the number of covered nodes is small, and then gradually levels off as the number of covered nodes increases. This approach allows for the priority selection of nodes with strong coverage capabilities during initial network formation, while avoiding excessive reliance on nodes with large coverage areas, thus maintaining load balance and efficiency for each gateway node in the network. The coverage score calculation is combined with the gateway score to generate a comprehensive gateway score for each node, used for priority ranking in gateway selection, ensuring efficient node distribution and optimal utilization of network resources.

[0040] In some embodiments, in step 103 above, selecting a gateway node from multiple door lock nodes according to the gateway application sorting table, determining the child nodes associated with the gateway node, and completing the network formation by establishing a master-slave relationship between the gateway node and the child nodes includes: According to the gateway application sorting table, the door lock node currently in the first position initiates a gateway application in sequence. If the gateway application is successful, the door lock node becomes the gateway node, and the gateway node selects a preset number of neighbor nodes as child nodes. The gateway node broadcasts its own and its corresponding child node's device identifiers. Other door lock nodes remove the device identifiers of the gateway node and its corresponding child nodes based on the broadcast information. The door lock node currently in the first position that meets the gateway application conditions then repeats the above operations of gateway application, child node selection, and gateway application sorting table update until the gateway application sorting table is empty, thus completing the network formation.

[0041] In one exemplary embodiment, gateway requests are made sequentially according to the order of the gateway request sorting table. The first device in the gateway request sorting table initiates the gateway request.

[0042] Each gateway node can be configured with a maximum number of connected child nodes, n (e.g., a maximum of 6 child nodes). This means that each gateway node can only manage a fixed number of child nodes to prevent any single node from becoming overloaded or consuming too many network resources. Once a door lock node applies to become a gateway node, the selection and allocation of child nodes can be performed according to the following steps: (1) Select child nodes: After applying to become a gateway node, the first lock node in the gateway application ranking list randomly selects child nodes from its neighboring nodes within its coverage area for connection, with a maximum of n child nodes selected. If the number of child nodes within the coverage area of ​​the gateway node is less than n, then all of them are selected.

[0043] The randomness in selecting child nodes is intended to improve network speed. Simultaneously, a selection algorithm (e.g., prioritizing nodes with lower gateway scores based on surrounding child nodes) can be incorporated to optimize child node selection. In the network configuration provided in this embodiment, this local optimization strategy does not significantly improve overall performance. While it may locally optimize the power consumption of individual nodes, it cannot reduce the total number of gateway nodes ultimately generated in the entire network, thus failing to effectively reduce overall system power consumption. Furthermore, the balance issue in child node selection will be globally optimized through subsequent periodic reconfiguration processes, thus eliminating the need for excessive complex optimizations during the initial network configuration phase.

[0044] (2) Count the nodes to be deleted: After confirming the child nodes, the node sets its own attributes to gateway node. Then, the gateway node establishes a master-slave relationship with its selected child nodes (this master-slave relationship can be understood as a simplified routing table; since all child nodes can be directly accessed by the gateway node, no specific routing information needs to be established). It also counts the nodes to be broadcast as to be deleted (nodes to be deleted include the gateway node itself and its selected child nodes; these nodes are excluded, considered as partially successful network formation, and will not participate in subsequent network formation processes).

[0045] For example, suppose a thread-based door lock device requests to become a gateway node. It has 8 adjacent nodes, but it can only select 6 of them as child nodes. These 6 child nodes, along with its own node (a total of 7), will be counted and await broadcast.

[0046] (3) Broadcast gateway message and information on nodes to be deleted: Once a device successfully applies to become a gateway node, it broadcasts a success message to all other lock nodes in the Thread network. This message notifies the lock node that it has successfully become a gateway node and that up to n child nodes have selected it to establish connections. The broadcast message must contain at least the following information: a) Successful application information for the gateway node.

[0047] b. A list of IDs of all devices selected as child nodes, which will be removed from the list of available nodes for other devices.

[0048] All devices receiving this message will delete the child nodes already connected to the gateway node within their coverage area, based on the broadcast content. This ensures that these child nodes will not be selected repeatedly by other gateway nodes. The current lock node then repeats the above operations of gateway application, child node selection, and gateway application sorting table update until the gateway application sorting table is empty, completing the network setup.

[0049] In this embodiment, by combining the sequential list gateway application and child node deletion mechanism, the system finds a balance between network coverage and performance optimization during the gateway selection process. While quickly selecting the optimal gateway node for network formation, it reduces unnecessary gateway nodes and optimizes resource utilization.

[0050] In some possible implementations, the aforementioned operations of repeatedly executing the gateway application, child node selection, and gateway application sorting table update by the current lock node that meets the gateway application conditions include: In response to the current lock node meeting the gateway application conditions, the gateway score is re-determined based on its updated device status information and its neighbor node information, so as to update the gateway application sorting table; Repeat the above operations of gateway application, child node selection, and gateway application sorting table update based on the updated gateway application sorting table.

[0051] Continuing with the above embodiment, since the first node in the sorting table has successfully applied to become a gateway node, the first node in the sorting table will then become the previous second node. Considering factors such as changes in signal strength or changes in the battery level of devices that do not respond in real time, the door lock node in this position can reassess whether it is still the first node and meets the gateway application requirements. The specific process is as follows: (1) Reorganize the sorting table: The node will first update its sorting table and remove the nodes to be deleted obtained from the broadcast message from the sorting table. If the node itself is a node to be deleted, it will immediately exit the gateway application process and notify other devices to continue the gateway application via broadcast.

[0052] (2) Check its own eligibility: If the node is not a node to be deleted, it needs to recalculate its coverage and final score. If the coverage score decreases due to the deletion of some coverage nodes, the final score will also decrease. At this time, the node should check whether its position in the ranking table has changed due to the decrease in score. If the decrease in score causes its ranking to no longer be first, then the node will give up applying for the gateway and broadcast its new score and the decision to give up the application.

[0053] (3) Continuing the gateway application: After the application is abandoned, the next device in the sorting table (the third device in the original sorting table) will receive the broadcast message and reorganize the sorting table according to the same process to check whether it is eligible to apply for the gateway. This process will be repeated until the sorting of a certain node has not changed due to the change of the node to be deleted. This node is the next gateway applicant and enters the step of selecting child nodes.

[0054] For example, the above method can be explained using the gateway application sorting table as an example: Device 1: ID = 12, Gateway Score = 50.4; Device 3: ID = 15, Gateway Score = 50.4 (Device 1 and Device 3 have the same gateway score, sorted in ascending order by ID, ID = 12 is listed before ID = 15); Device 2: ID = 8, Gateway Score = 48.7; Device 4: ID = 6, Gateway Score = 42.3; Device 1 (ID = 12, Gateway Score = 50.4) initiates a gateway application as the first node in the gateway application ranking list. Based on its coverage area, it selects up to n child nodes and successfully applies to become the gateway. After successful application, Device 1 broadcasts a message to other devices, notifying them that it has become the gateway and listing its selected child nodes.

[0055] After the broadcast ended, Device 3 found that it was at the top of the sorting list. After updating the sorting list, Device 3 checked and found that Device 3 was a child node of Device 1 and could not participate in the gateway application. Therefore, it broadcasted that it would give up applying for the gateway.

[0056] After the broadcast ends, device 2 finds itself at the top of the sorting table. After updating the sorting table, device 2 checks and finds that although it is not a child node of device 1, some of the child nodes selected by device 1 are its own overlay nodes. After removing these child nodes, device 2's final score is lower than that of device 4. Therefore, it broadcasts that it will give up applying for the gateway and broadcasts its new final score.

[0057] After the broadcast ends, device 4 finds itself at the top of the sorting list. After updating the sorting list, device 4 finds itself still at the top of the sorting list, so it initiates a gateway request.

[0058] It's important to note that in this process, each lock node checks its eligibility to apply for a gateway according to the mine-clearing order in the gateway application sorting table. If a node finds itself ineligible, it recalculates its score, broadcasts the new score, and then relinquishes the gateway application right to the next node. Unlike the initial global synchronization of the sorting table, subsequent sorting updates do not involve all nodes simultaneously broadcasting their final scores and synchronizing the sorting table. Instead, each node only broadcasts its updated score and adjusts the sorting table when it's its turn.

[0059] In this way, the sequential operation ensures that only the currently selected node broadcasts, avoiding the complexity of all nodes broadcasting scores at the same time and preventing broadcast conflicts. Furthermore, this delay does not lead to incorrect node selection because the sorting table is updated based on the priority of devices at the top of the current round. Each node adjusts its state and sorting table sequentially, so even with the delay, priority nodes in the sorting table will still execute the gateway application process first, thus guaranteeing the efficiency and correctness of the process.

[0060] Although this process appears to involve multiple node checks and sorting adjustments, potentially increasing time consumption, in reality, due to the characteristics of the Sigmoid coverage function, the final score changes of nodes are mainly concentrated in cases with small coverage areas, resulting in less drastic fluctuations in scores. Take the coverage score mentioned above as an example: ; The function's value remains largely unchanged when the independent variable t is greater than 5, but rapidly decays to near zero when t is between 2 and 5. Specifically, when a thread-based door lock device recalculates its coverage score due to node deletion, if its coverage score is still greater than 5, its coverage score and sequential position remain essentially unchanged. However, if its coverage score is less than 5, its coverage score drops rapidly, causing it to be placed at a later position in the sorting list. This significantly reduces the likelihood of the same node being repeatedly abandoned during gateway checks. Therefore, the overall process is highly efficient, with a low frequency of sequence changes, ensuring the smooth completion of the networking process without significantly increasing time costs.

[0061] In some embodiments, after establishing the master-slave relationship between the gateway node and the child node in step 103 above, the method further includes: If any of the multiple door lock nodes is determined to be a detached node that has not been connected to a gateway node, the available gateway nodes within a preset hop count range are determined based on the network identity of the detached node's neighbor nodes; a target gateway node is selected from the available gateway nodes, and a multi-hop communication connection is established between the detached node and the target gateway node.

[0062] In some embodiments, the aforementioned detached nodes refer to those nodes whose neighboring nodes have all become other gateways or child nodes of other gateways. The formation of detached nodes is due to the following reasons: (1) Limitation on the number of child nodes of a gateway node: During the gateway application process, the number of child nodes that each gateway node can select is limited, and a maximum number of connections is usually set (e.g., 6 child nodes). When the number of child nodes of a gateway node reaches the limit, even if it can cover more adjacent nodes, these additional nodes cannot be selected as child nodes. Therefore, these unselected nodes will become potential detached nodes.

[0063] (2) Distance factor: Free nodes are usually located at the edge of the network, or their adjacent nodes have been covered by other gateway nodes. Since they are not directly selected as child nodes by any gateway node, they cannot communicate with the gateway node in a one-hop manner, but can only communicate in multiple hops through intermediate nodes (such as other child nodes).

[0064] (3) Competition for gateway application ranking: In the gateway application process, multiple nodes are ranked according to their gateway scores and apply to become gateway nodes in sequence. Some nodes fail to become gateways or child nodes in time due to their late ranking. During the selection process of gateways and child nodes of preceding nodes, these late nodes may not be directly selected, causing them to be excluded from the main gateway-child node structure.

[0065] The gateway application process officially ends when only detached nodes remain in the gateway sorting table. During this process, the network has formed multiple small networks consisting of gateway nodes and their directly connected child nodes. The distance between these child nodes and their respective gateway nodes is one-hop communication, ensuring efficient data transmission. However, detached nodes are not directly connected to gateway nodes; they need to rely on other nodes for multi-hop communication.

[0066] Since the neighboring nodes of a detached node have become child nodes of other gateways, the communication distance between the detached node and the gateway node does not exceed two hops. Therefore, the detached node can perform an active path optimization process, determining reachable gateway nodes by scanning neighboring devices. The specific process is as follows: (1) Scanning neighboring devices: The free node first scans all its neighboring nodes to identify which nodes are gateway nodes and which nodes are child nodes of the gateway.

[0067] (2) Confirm the location of the gateway within two hops: The free node will confirm the gateway nodes reachable within its two-hop range based on the scan results. These gateway nodes may be the free node's own neighboring nodes, or gateway nodes connected to its neighboring nodes.

[0068] (3) Select the lightest load gateway: After determining all available gateways within the two-hop range, the free node will select a gateway with a lighter load to connect to based on the current load of the gateway, that is, the gateway with the fewest connected child nodes.

[0069] (4) Establishing multi-hop connections: Once the optimal gateway is selected, the free nodes will establish a communication connection with the gateway. Although these free nodes cannot directly connect to the gateway, they can communicate with the gateway node through a two-hop path by using adjacent nodes as relays, ensuring reliable data transmission.

[0070] Once the free node successfully selects and connects to the gateway, the network setup process is complete. At this point, the entire network has formed a stable structure, containing multiple gateway nodes and their directly or indirectly connected child nodes. All nodes will communicate normally with the server and other devices through their selected paths.

[0071] Through the above steps, free nodes can also be successfully integrated into the network, ensuring the connectivity of the entire system and the efficiency of data transmission.

[0072] After modeling and verification, using a scale-free BA network (commonly used in simulated networking environments) with 60 vertices to generate gateway nodes, under the condition that each gateway can connect to a maximum of 6 child nodes, repeated 100 times, an average of 13 gateway nodes were generated, which saves 78.3% (i.e. 47 / 60) of cellular communication resources.

[0073] After the above networking process is completed, all the thread-based door lock devices that act as gateways report successful networking information to the platform and also report the IDs of their child node door locks. When the platform needs to send information to a specific door lock, it only needs to find its gateway to send the message, and the gateway door lock device directly forwards it to the child node based on the message ID. When a child node door lock device needs to report, it only needs to forward the message to the gateway door lock device, which then uploads it to the platform.

[0074] In some embodiments, after completing the network formation in step 103, the method further includes: For a new device that triggers network formation, the new device scans its neighboring nodes to obtain the node status of the neighboring nodes. If it is determined that the new device is only adjacent to a free node based on the node status of the neighboring nodes, the new device is controlled to refuse to join the network and wait for the next network optimization.

[0075] In one exemplary embodiment, when a new Thread door lock device triggers network formation, it first scans its surrounding neighboring nodes and checks whether any devices on those neighboring nodes have already completed network formation, based on the node status of those neighboring nodes. If a device is found to be a gateway node, child node, or detached node in the vicinity, the new device will join the Thread network in a manner similar to a detached node, depending on the status of the neighboring nodes.

[0076] Key point 1: No two adjacent free nodes will appear in the initial network setup.

[0077] According to the definition of a detached node, it is impossible for two adjacent detached nodes to exist during the initial network setup. Detached nodes are those nodes whose adjacent devices are already child nodes of other gateways, and they cannot directly connect to the gateway. Therefore, if two adjacent nodes are both marked as detached nodes, they should not actually be considered detached nodes. If two adjacent nodes are both outside the coverage of the gateway, it means they are not yet fully covered by the network and should be addressed by readjusting the roles of the gateway or child nodes. Therefore, in this scenario, although the new device adopts a similar network entry method to a detached node, it is not actually a true detached node, but rather connects to the network through a multi-hop path.

[0078] Key point 2: The case where there are only free nodes around.

[0079] If a new device scans and finds that all its adjacent nodes are detached nodes, and no gateway node or child node can provide a direct network connection, this indicates that the device does not meet the requirements to participate in the current Thread network. Since detached nodes are connected to the gateway node via multi-hop paths, and the new device cannot directly connect to the gateway, the device will not join the network. It will remain offline temporarily, waiting for the next network reorganization or optimization before attempting to join the network again.

[0080] In some possible implementations, after the devices complete the initial network setup, periodic reorganization can be performed according to the platform settings to address changes in the devices' own status or external network connections. For example, when a new device joins the network, or the conditions of existing devices change (such as decreased battery power or weakened signal strength), the number of detached devices may increase, affecting network performance and stability. Periodic reorganization can effectively optimize the network topology and ensure that all nodes are adequately covered.

[0081] Furthermore, gateway nodes and child nodes can proactively request reconfiguration based on their own status. When a gateway node is in poor health (e.g., low battery or degraded signal quality), or when a child node is unable to communicate normally with the gateway, it can send a reconfiguration request to the system. This mechanism ensures that devices can quickly self-repair when encountering faults or performance degradation, avoiding impact on the overall network functionality.

[0082] Since smart door locks are fixed devices and their physical location does not change, the Thread network formed through the initial networking process is generally stable and does not frequently undergo proactive reorganization. Periodic reorganization is mainly used to address changes in the status of a few devices or changes in the external network environment, ensuring the long-term stability and efficient operation of the network.

[0083] The efficient and reliable smart lock mesh networking process described in this application is particularly suitable for large-scale, multi-node application scenarios. This system ensures stable network operation in various complex environments through optimized gateway selection algorithms, proactive path optimization, and periodic reconfiguration strategies.

[0084] Please refer to Figure 3. Figure 3 This illustration shows a schematic diagram of a smart lock networking device provided in some embodiments of this application. This smart lock networking device is applied to multiple lock nodes, which are interconnected and can achieve, for example… Figure 1 The smart door lock networking device 300, as shown in the embodiments, includes all or part of the following: The first determining module 310 is used to determine a gateway score for each door lock node based on the capability information of the door lock node. The gateway score is used to characterize the adaptability of the door lock node as a gateway node. The second determining module 320 is used to determine a gateway application sorting table based on the gateway scores and device identification information of the multiple door lock nodes; The networking module 330 is used to select a gateway node from the plurality of door lock nodes according to the gateway application sorting table, and determine the child nodes associated with the gateway node, and complete the networking by establishing a master-slave relationship between the gateway node and the child nodes.

[0085] In some embodiments, the capability information includes device status information and neighbor node information; the first determining module 310, when determining the gateway score based on the capability information of the door lock node, is specifically used for: The initial gateway score is determined based on the device status information of the door lock node; wherein the device status information includes at least one of the following: battery level, message frequency within a preset time period, and signal strength; Based on the neighbor node information of the door lock node, a coverage score is determined, which is used to indicate the coverage capability of the door lock node; The gateway score is determined based on the initial gateway score and the coverage score.

[0086] In some embodiments, when the networking module 330 selects a gateway node from the plurality of door lock nodes according to the gateway application sorting table, determines the child nodes associated with the gateway node, and completes the networking by establishing a master-slave relationship between the gateway node and the child nodes, it is specifically used for: According to the gateway application sorting table, the door lock node currently in the first position initiates a gateway application in sequence. If the gateway application is successful, the door lock node becomes the gateway node, and the gateway node selects a preset number of neighboring nodes as child nodes. The gateway node broadcasts its own and its corresponding child node's device identifiers. Other door lock nodes remove the device identifiers of the gateway node and its corresponding child nodes according to the broadcast information. The door lock node currently in the first position that meets the gateway application conditions repeats the above operations of gateway application, child node selection, and gateway application sorting table update until the gateway application sorting table is empty, thus completing the network formation.

[0087] In some embodiments, when the networking module 330 is used to repeatedly execute the above-mentioned gateway application, child node selection, and gateway application sorting table update operations by the door lock node that is currently in the order and meets the gateway application conditions, it is specifically used for: In response to the current lock node meeting the gateway application conditions, the gateway score is re-determined based on its updated device status information and its neighbor node information, so as to update the gateway application sorting table; Repeat the above operations of gateway application, child node selection, and gateway application sorting table update based on the updated gateway application sorting table.

[0088] In some embodiments, the networking module 330 is further configured to: If any of the multiple door lock nodes is determined to be a detached node that has not been connected to a gateway node, an available gateway node within a preset hop count range is determined based on the network identity of the detached node's neighbor nodes. Select a target gateway node from the available gateway nodes and establish a multi-hop communication connection between the roaming node and the target gateway node.

[0089] In some embodiments, the smart lock networking device 300 described above further includes: The device access module is used to scan its neighboring nodes and obtain the node status of the neighboring nodes for a new device that triggers the network. If, based on the node status of the adjacent nodes, it is determined that the new device is only adjacent to a free node, the new device is controlled to refuse to join the network and wait for the next network optimization.

[0090] This application provides a smart lock networking device, including a first determining module, a second determining module, and a networking module. The first determining module determines a gateway score for each lock node based on its capability information. This gateway score characterizes the lock node's adaptability as a gateway node. The second determining module determines a gateway application ranking table based on the gateway scores of multiple lock nodes and device identification information. The networking module selects a gateway node from the multiple lock nodes according to the gateway application ranking table and determines the child nodes associated with the gateway node. By establishing a master-slave relationship between the gateway node and its child nodes, the networking is completed. In this way, calculating the gateway score based on the capability information of each lock node and determining the gateway application ranking table based on the gateway score ensures that lock nodes with strong adaptability are selected as gateway nodes. Furthermore, by establishing a master-slave relationship between the gateway node and its child nodes, it ensures that all lock nodes are included in the network, thereby achieving comprehensive coverage of the smart lock network.

[0091] Figure 4 The diagram illustrates the structure of an electronic device according to some embodiments of this application. Referring to the diagram, at the hardware level, the electronic device 400 includes a processor 410, and optionally includes an internal bus 420, a network interface 430, and a memory. The memory may include main memory 441, such as high-speed random-access memory (RAM), and may also include non-volatile memory 442, such as at least one disk storage device. Of course, the electronic device may also include other hardware required for other services.

[0092] The processor 410, network interface 430, and memory can be interconnected via an internal bus 420. This internal bus 420 can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be categorized as an address bus, data bus, control bus, etc. For ease of illustration, only a single bidirectional arrow is used in this diagram, but this does not imply that there is only one bus or one type of bus.

[0093] The memory stores programs. Specifically, the program may include program code, which includes computer operation instructions. The memory may include main memory 441 and non-volatile memory 442, and provides instructions and data to the processor 410.

[0094] Processor 410 reads the corresponding computer program from non-volatile memory 442 into memory and then runs it, forming a device for locating the target user at the logical level. Processor 410 executes the program stored in memory and specifically performs the following: Figure 1 The methods disclosed in the embodiments shown achieve the functions and beneficial effects of the methods described in the preceding method embodiments, and will not be repeated here.

[0095] The above is as stated in this application. Figure 1 The methods disclosed in the illustrated embodiments can be applied to or implemented by processor 410. Processor 410 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by integrated logic circuits in the hardware or by instructions in software form within processor 410. Processor 410 can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.

[0096] The computer device can also execute the methods described in the preceding method embodiments and achieve the functions and beneficial effects of the methods described in the preceding method embodiments, which will not be repeated here.

[0097] Of course, in addition to software implementation, the electronic device of this application does not exclude other implementation methods, such as logic devices or a combination of hardware and software, etc. In other words, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0098] This application also proposes a computer-readable storage medium that stores one or more programs, which, when executed by an electronic device including multiple applications, cause the electronic device to perform... Figure 1 The methods disclosed in the embodiments shown achieve the functions and beneficial effects of the methods described in the preceding method embodiments, and will not be repeated here.

[0099] The computer-readable storage medium mentioned above includes read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, etc.

[0100] Furthermore, embodiments of this application also provide a computer program product, the computer program product including a computer program stored on a non-transitory computer-readable storage medium, the computer program including program instructions, which, when executed by a computer, implement the following process: Figure 1 The methods disclosed in the embodiments shown achieve the functions and beneficial effects of the methods described in the preceding method embodiments, and will not be repeated here.

[0101] The embodiments of this application can be applied to various scenarios of electronic device collaboration or interconnection, including: collaboration and interconnection between mobile phones and laptops / tablets; collaboration and interconnection between mobile terminals and smart TVs / monitors; collaboration and interconnection between mobile phones or tablets and in-vehicle entertainment systems; collaboration and interconnection between mobile terminals and smart conferencing systems, etc. This satisfies users' diverse needs in smart home, smart office, and smart travel scenarios.

[0102] In summary, the above description is merely a preferred embodiment of this application and does not limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

[0103] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.

[0104] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0105] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0106] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.

Claims

1. A method for networking smart door locks, characterized in that, The method, applied to multiple door lock nodes that are interconnected and communicate with each other, includes: For each door lock node, a gateway score is determined based on the capability information of the door lock node. The gateway score is used to characterize the adaptability of the door lock node as a gateway node. Based on the gateway scores and device identification information of the multiple door lock nodes, a gateway application sorting table is determined; According to the gateway application sorting table, a gateway node is selected from the plurality of door lock nodes, and the child nodes associated with the gateway node are determined. By establishing a master-slave relationship between the gateway node and the child nodes, the network is completed.

2. The method according to claim 1, characterized in that, The capability information includes device status information and neighbor node information; determining the gateway score based on the door lock node's capability information includes: The initial gateway score is determined based on the device status information of the door lock node; wherein the device status information includes at least one of the following: battery level, message frequency within a preset time period, and signal strength; Based on the neighbor node information of the door lock node, a coverage score is determined, which is used to indicate the coverage capability of the door lock node; The gateway score is determined based on the initial gateway score and the coverage score.

3. The method according to claim 1, characterized in that, The step of selecting a gateway node from the plurality of door lock nodes according to the gateway application sorting table, determining the child nodes associated with the gateway node, and completing the network formation by establishing a master-slave relationship between the gateway node and the child nodes includes: According to the gateway application sorting table, the door lock node currently in the first position initiates a gateway application in sequence. If the gateway application is successful, the door lock node becomes the gateway node, and the gateway node selects a preset number of neighboring nodes as child nodes. The gateway node broadcasts its own and its corresponding child node's device identifiers. Other door lock nodes remove the device identifiers of the gateway node and its corresponding child node according to the broadcast information. The door lock node currently in the first position that meets the gateway application conditions then repeats the above operations of gateway application, child node selection, and gateway application sorting table update until the gateway application sorting table is empty, thus completing the network formation.

4. The method according to claim 3, characterized in that, The process of repeatedly executing the above-mentioned gateway application, child node selection, and gateway application sorting table update operations by the current lock node that meets the gateway application conditions includes: In response to the current lock node meeting the gateway application conditions, the gateway score is re-determined based on its updated device status information and its neighbor node information, so as to update the gateway application sorting table; Repeat the above operations of gateway application, child node selection, and gateway application sorting table update based on the updated gateway application sorting table.

5. The method according to any one of claims 1 to 4, characterized in that, After establishing the master-slave relationship between the gateway node and the child node, and before completing the network formation, the method further includes: If any of the multiple door lock nodes is determined to be a detached node that has not been connected to a gateway node, an available gateway node within a preset hop count range is determined based on the network identity of the detached node's neighbor nodes. Select a target gateway node from the available gateway nodes and establish a multi-hop communication connection between the roaming node and the target gateway node.

6. The method according to any one of claims 1 to 4, characterized in that, After the network is completed, the method further includes: For a new device that triggers the network, the new device scans its neighboring nodes to obtain the node status of the neighboring nodes; If, based on the node status of the adjacent nodes, it is determined that the new device is only adjacent to a free node, the new device is controlled to refuse to join the network and wait for the next network optimization.

7. A smart door lock networking device, characterized in that, The device, applicable to multiple door lock nodes that are interconnected and communicate with each other, includes: The first determining module is used to determine a gateway score for each door lock node based on the capability information of the door lock node. The gateway score is used to characterize the adaptability of the door lock node as a gateway node. The second determining module is used to determine a gateway application sorting table based on the gateway scores and device identification information of the multiple door lock nodes; The networking module is used to select a gateway node from the plurality of door lock nodes according to the gateway application sorting table, and determine the child nodes associated with the gateway node. By establishing a master-slave relationship between the gateway node and the child nodes, the networking is completed.

8. An electronic device, characterized in that, The electronic device includes a processor and a memory, the memory storing programs or instructions that can run on the processor, the programs or instructions being executed by the processor to implement the steps of the method as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the method as described in any one of claims 1 to 6.

10. A computer program product, characterized in that, The computer program product includes a computer program stored on a non-transitory computer-readable storage medium, the computer program including program instructions that, when executed by a computer, cause the computer to perform the steps of the method as described in any one of claims 1 to 6.