Equipment network access method and system, storage medium and electronic device

CN121967104APending Publication Date: 2026-05-01HAIER YOUJIA INTELLIGENT TECH (BEIJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HAIER YOUJIA INTELLIGENT TECH (BEIJING) CO LTD
Filing Date
2025-12-30
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

[0004]本申请实施例提供了一种设备入网方法、系统、存储介质及电子装置,以至少解决相关技术中,高密度的物联网设备接入局域网环境时面临网络负载过重的问题

Benefits of technology

[0016]在本申请实施例中,通过网关设备代理物联网子设备加入局域网,由网关设备统一向管理设备进行广播,上报接入网关设备的子设备列表版本号,管理设备根据本地版本号和上报版本号进行入网设备列表同步。解决了高密度的物联网设备接入局域网环境时面临网络负载过重的问题,进而达到实现在高密度的物联网设备接入局域网环境时降低网络负载的效果。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121967104A_ABST
    Figure CN121967104A_ABST
Patent Text Reader

Abstract

The invention discloses an equipment network access method and system, a storage medium and an electronic device, and relates to the technical field of network communication, the equipment network access method comprises the following steps: receiving a first broadcast message sent by gateway equipment, the first broadcast message comprising a first sub-equipment list and a first version number, the first sub-device list comprises all sub-devices accessing the gateway device, and the first version number represents a list version corresponding to the first sub-device list; updating the first local sub-device list according to the first sub-device list to obtain a second local sub-device list, and updating the first local version number according to the first version number to obtain a second local version number; and according to the second local sub-device list, determining a device to join in a target local area network, the target local area network representing a local area network where the management device is located. By adopting the technical scheme, the problem that the network load is too heavy when the high-density Internet of Things equipment accesses the local area network environment is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of network communication technology, and more specifically, to a method, system, storage medium, and electronic device for a device to access the network. Background Technology

[0002] With the widespread adoption of IoT technology, the number of smart devices within local area networks (LANs) has exploded. Device discovery mechanisms, as a fundamental aspect of IoT communication, directly impact the performance of the entire system. Currently, IoT device discovery primarily relies on broadcast communication mechanisms within the LAN. Each IoT device needs to periodically send broadcast or multicast messages to the LAN to announce its presence. An inherent drawback of this mechanism is that when the number of connected devices reaches a certain scale, the dense, periodic broadcast messages consume significant network bandwidth, easily triggering broadcast storms and severely affecting the communication quality of other normal services within the LAN. Regarding device status synchronization, existing technologies mainly rely on subscribers periodically polling to query device status. This method generates a large amount of query communication even if the device status has not changed, resulting in a waste of network resources. Therefore, related technologies face the problem of excessive network load when high-density IoT devices are connected to a LAN environment.

[0003] There is still no effective solution to the problem of reducing network load when a high density of IoT devices are connected to a local area network. Summary of the Invention

[0004] This application provides a device network access method, system, storage medium, and electronic device to at least solve the problem of excessive network load faced by high-density Internet of Things (IoT) devices when accessing a local area network environment, as described in related technologies.

[0005] According to one embodiment of this application, a device network access method is provided, applied to a management device. The management device manages a gateway device and sub-devices connected to the gateway device. The management device, the gateway device, and the sub-devices are connected via a hybrid network. The method includes: receiving a first broadcast message sent by the gateway device, wherein the first broadcast message includes a first sub-device list and a first version number, wherein the first sub-device list includes all sub-devices connected to the gateway device, and the first version number represents the list version corresponding to the first sub-device list; updating a first local sub-device list according to the first sub-device list to obtain a second local sub-device list, and updating a first local version number according to the first version number to obtain a second local version number, wherein the first local sub-device list represents a sub-device list stored locally by the management device, and the first local version number represents the list version corresponding to the first local sub-device list; and determining devices to join a target local area network according to the second local sub-device list, wherein the target local area network represents the local area network where the management device is located.

[0006] In one exemplary embodiment, the method further includes: receiving a second broadcast message sent by the gateway device, wherein the second broadcast message includes a second version number; determining a comparison result between the second version number and a second local version number, wherein the comparison result includes whether the second version number and the second local version number are the same or whether the second version number and the second local version number are different; if the comparison result indicates that the second version number and the second local version number are different, updating the second local sub-device list to obtain a third local sub-device list, and updating the second local version number to obtain a third local version number.

[0007] In one exemplary embodiment, updating the second local sub-device list to obtain a third local sub-device list and updating the second local version number to obtain a third local version number include: sending a first device query request to the gateway device; receiving a first response message sent by the gateway device based on the first device query request, wherein the first response message includes a second sub-device list corresponding to the second version number; updating the second local sub-device list according to the second sub-device list to obtain the third local sub-device list; and updating the second local version number according to the second version number to obtain the third local version number.

[0008] In an exemplary embodiment, before receiving the first broadcast message sent by the gateway device, the method further includes: receiving a third broadcast message sent by the gateway device, wherein the third broadcast message includes a gateway identifier, network address, service port number, and third version number of the gateway device; establishing a network connection with the gateway device based on the gateway identifier, network address, and service port number, and sending a second device query request to the gateway device; receiving a second response message sent by the gateway device based on the second device query request, wherein the second response message includes a third sub-device list corresponding to the third version number; determining a first local sub-device list based on the third sub-device list, and determining a first local version number based on the third version number.

[0009] According to one embodiment of this application, a device network access method is also provided, applied to a gateway device. The gateway device supports access to sub-devices. The gateway device and the sub-devices accessing the gateway device are managed by a management device. The management device, the gateway device, and the sub-devices are connected through a hybrid network. The method includes: when an update is detected in the number of sub-devices accessing the gateway device, sending a first broadcast message to the management device. The first broadcast message includes a first sub-device list and a first version number. The first sub-device list includes all sub-devices accessing the gateway device, and the first version number represents the list version corresponding to the first sub-device list.

[0010] In one exemplary embodiment, the method further includes: obtaining the current version number corresponding to the sub-device list of the current period according to a preset period, and determining a second version number based on the current version number; sending a second broadcast message to the management device, wherein the second broadcast message includes the second version number; and in response to a first device query request sent by the management device after receiving the second broadcast message, sending a first response message to the management device, wherein the first response message includes a second sub-device list, and the second sub-device list is determined based on the sub-device list of the current period.

[0011] In an exemplary embodiment, before sending a first broadcast message to the management device when an update is detected in the number of sub-devices connected to the gateway device, the method further includes: determining a third sub-device list based on the sub-devices connected to the gateway device, generating a third version number corresponding to the third sub-device list; sending a third broadcast message to the management device, wherein the third broadcast message includes the gateway identifier, network address, service port number, and third version number of the gateway device; and in response to a second device query request sent by the management device after receiving the third broadcast message, sending a second response message to the management device to enable the management device to determine a first local sub-device list, wherein the second response message includes the third sub-device list corresponding to the third version number.

[0012] According to another aspect of the embodiments of this application, a device network access system is also provided, including: a gateway device, a management device, and sub-devices connected to the gateway device. The management device is used to manage the gateway device and the sub-devices connected to the gateway device. The management device, the gateway device, and the sub-devices are connected via a hybrid network. The gateway device is used to send a first broadcast message to the management device when it detects an update in the number of sub-devices connected to the gateway device. The first broadcast message includes a first sub-device list and a first version number. The first sub-device list includes all sub-devices connected to the gateway device, and the first version number represents the version number corresponding to the first sub-device list. The management device is configured to receive the first broadcast message sent by the gateway device; the management device is further configured to update the first local sub-device list according to the first sub-device list to obtain a second local sub-device list, and update the first local version number according to the first version number to obtain a second local version number, wherein the first local sub-device list represents the sub-device list stored locally by the management device, and the first local version number represents the list version corresponding to the first local sub-device list; the management device is further configured to determine the devices to join the target local area network according to the second local sub-device list, wherein the target local area network represents the local area network where the management device is located.

[0013] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer-readable storage medium, and the computer program is configured to execute the above-described device network access method when running.

[0014] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the above-described device network access method through the computer program.

[0015] According to another aspect of the embodiments of this application, a computer program product is also provided, including a computer program that, when executed by a processor, implements the steps in any of the above method embodiments.

[0016] In this embodiment, a gateway device proxies IoT sub-devices to join the local area network (LAN). The gateway device broadcasts the list of sub-devices accessing the gateway device to the management device, reporting the version numbers of these sub-devices. The management device then synchronizes the list of devices joining the network based on both its local and reported version numbers. This solves the problem of excessive network load when a high density of IoT devices accesses a LAN environment, thereby reducing network load in such situations. Attached Figure Description

[0017] 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.

[0018] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a schematic diagram of the hardware environment for a device network access method according to an embodiment of this application;

[0020] Figure 2 This is a flowchart of a device network access method according to an embodiment of this application;

[0021] Figure 3 This is a schematic diagram of device interaction according to an embodiment of this application;

[0022] Figure 4 This is a schematic diagram illustrating a device discovery and synchronization method according to an embodiment of this application;

[0023] Figure 5 This is a structural block diagram of a device network access system according to an embodiment of this application. Detailed Implementation

[0024] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0025] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0026] According to one aspect of the embodiments of this application, a device network access method is provided. This device network access method is widely used in application scenarios such as software development. Optionally, in this embodiment, the above-described device network access method can be applied to, for example... Figure 1 The hardware environment shown consists of terminal device 102 and server 104. For example... Figure 1 As shown, server 104 is connected to terminal device 102 via a network and can be used to provide services (such as application services) to the terminal or clients installed on the terminal. A database can be set up on the server or independently of the server to provide data storage services for server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data processing services for server 104.

[0027] The aforementioned network may include, but is not limited to, at least one of the following: wired network, wireless network. The aforementioned wired network may include, but is not limited to, at least one of the following: wide area network, metropolitan area network, local area network. The aforementioned wireless network may include, but is not limited to, at least one of the following: Wi-Fi (Wireless Fidelity), Bluetooth. The terminal device 102 may not be limited to PC, mobile phone, tablet computer, smart air conditioner, smart range hood, smart refrigerator, smart oven, smart stove, smart washing machine, smart water heater, smart washing equipment, smart dishwasher, smart projector, smart TV, smart clothes rack, smart curtains, smart audio-visual equipment, smart socket, smart speaker, smart speaker box, smart fresh air equipment, smart kitchen and bathroom equipment, smart bathroom equipment, smart robot vacuum cleaner, smart window cleaning robot, smart mopping robot, smart air purifier, smart steam oven, smart microwave oven, smart water heater, smart air purifier, smart water dispenser, smart door lock, etc.

[0028] This embodiment provides a device network access method applied to a management device. The management device manages gateway devices and sub-devices connected to the gateway devices. The management device, the gateway devices, and the sub-devices are connected via a hybrid network. Figure 2 This is a flowchart of a device network access method according to an embodiment of this application, which includes the following steps:

[0029] Step S202: Receive a first broadcast message sent by the gateway device, wherein the first broadcast message includes a first sub-device list and a first version number, wherein the first sub-device list includes all sub-devices connected to the gateway device, and the first version number represents the list version corresponding to the first sub-device list;

[0030] Step S204: Update the first local sub-device list according to the first sub-device list to obtain the second local sub-device list, and update the first local version number according to the first version number to obtain the second local version number, wherein the first local sub-device list represents the list of sub-devices stored locally by the management device, and the first local version number represents the list version corresponding to the first local sub-device list.

[0031] Step S206: Determine the devices to be added to the target local area network based on the second local sub-device list, wherein the target local area network refers to the local area network where the management device is located.

[0032] Optionally, in the above steps, the management device, the gateway device, and the sub-device are described as being connected via a hybrid network. For example, the management device and the gateway device both have independent Internet of Things (IoT) capabilities and are located on the same local area network. The sub-devices are IoT devices such as smart lights and sensors, which do not have independent Internet of Things (IoT) capabilities. The sub-devices are connected to the gateway device via IoT (wired, Zigbee, Bluetooth, etc.).

[0033] For example, a smart home control panel (management device) receives a broadcast from a home lighting gateway (gateway device). The broadcast message specifies: "Current sub-device list version is V3, list includes: Smart Light A, Smart Light B, Smart Light C." The control panel then overwrites its locally stored old list with this new list and updates its local version number to V3. Based on this new list, the control panel's UI is refreshed, accurately displaying all smart lights currently connected to the network.

[0034] Through the above steps, IoT sub-devices are added to the local area network (LAN) via a gateway device. The gateway device then broadcasts the version numbers of the sub-devices connected to the gateway to the management device. The management device synchronizes the list of connected devices based on the local version number and the reported version number. This solves the problem of excessive network load when high-density IoT devices are connected to a LAN, thereby reducing network load in such environments.

[0035] In one exemplary embodiment, the method further includes: receiving a second broadcast message sent by the gateway device, wherein the second broadcast message includes a second version number; determining a comparison result between the second version number and a second local version number, wherein the comparison result includes whether the second version number and the second local version number are the same or whether the second version number and the second local version number are different; if the comparison result indicates that the second version number and the second local version number are different, updating the second local sub-device list to obtain a third local sub-device list, and updating the second local version number to obtain a third local version number.

[0036] Optionally, in the above embodiment, the version number stored locally on the central control screen is V3. Subsequently, it receives a new broadcast from the lighting gateway containing version number V4. The central control screen compares the version number and finds that version number V4 is greater than the local version number V3, determining that the local list has expired. Therefore, it initiates an update process to obtain the latest device list.

[0037] The above embodiments introduce a lightweight version number broadcasting and comparison mechanism, which greatly reduces network communication load while ensuring data consistency. The gateway only needs to periodically send a very small version number message, and the management device can intelligently detect data inconsistencies through simple local comparison, providing a basis for decision-making to update the device list on demand. This avoids the bandwidth waste caused by continuously transmitting the full list while ensuring reliability.

[0038] In one exemplary embodiment, updating the second local sub-device list to obtain a third local sub-device list and updating the second local version number to obtain a third local version number include: sending a first device query request to the gateway device; receiving a first response message sent by the gateway device based on the first device query request, wherein the first response message includes a second sub-device list corresponding to the second version number; updating the second local sub-device list according to the second sub-device list to obtain the third local sub-device list; and updating the second local version number according to the second version number to obtain the third local version number.

[0039] Optionally, in the above embodiments, after determining that the list has expired, the central control screen initiates an update procedure and sends a unicast query request to the lighting gateway. Upon receiving the request, the gateway returns the latest list (version number V4) containing "Smart Light A, Smart Light B, Smart Light D" to the central control screen. The central control screen then updates its local storage with this new list and updates the version number to V4.

[0040] Through the above embodiments, the version comparison and on-demand query steps are tightly coupled to build a reliable synchronous fault-tolerant mechanism. When a list version update is detected, a targeted unicast query is initiated to actively pull the latest data, thereby ensuring eventual data consistency between the management device and the gateway.

[0041] In an exemplary embodiment, before receiving the first broadcast message sent by the gateway device, the method further includes: receiving a third broadcast message sent by the gateway device, wherein the third broadcast message includes a gateway identifier, network address, service port number, and third version number of the gateway device; establishing a network connection with the gateway device based on the gateway identifier, network address, and service port number, and sending a second device query request to the gateway device; receiving a second response message sent by the gateway device based on the second device query request, wherein the second response message includes a third sub-device list corresponding to the third version number; determining a first local sub-device list based on the third sub-device list, and determining a first local version number based on the third version number.

[0042] Optionally, in the above embodiments, for example, in the initial stage, before the central control screen is connected to the gateway device, the central control screen listens to the broadcast of the home lighting gateway in the environment. The broadcast includes the gateway's IP address, port, and initial version number V1. Based on this address information, the central control screen sends a query request to the gateway. The gateway responds to this request and returns a list of all currently proxied lighting devices (e.g., "Smart Light A, Smart Light B"). The central control screen then establishes its initial local device list and local version number accordingly.

[0043] The above embodiments define a clear initial discovery and handshake process, ensuring that the management device can reliably build an initial device list. This enables the management device to proactively and accurately obtain a complete list of sub-devices and a base version number from the gateway when joining the network or starting up, establishing a correct initial state for subsequent incremental synchronization and avoiding a series of synchronization problems caused by missing or incorrect initial data.

[0044] According to one embodiment of this application, a device network access method is also provided, applied to a gateway device. The gateway device supports access to sub-devices. The gateway device and the sub-devices accessing the gateway device are managed by a management device. The management device, the gateway device, and the sub-devices are connected through a hybrid network. The method includes: when an update is detected in the number of sub-devices accessing the gateway device, sending a first broadcast message to the management device. The first broadcast message includes a first sub-device list and a first version number. The first sub-device list includes all sub-devices accessing the gateway device, and the first version number represents the list version corresponding to the first sub-device list.

[0045] Optionally, in the above embodiment, a lighting gateway is initially connected to smart light A and smart light B. A new lighting device, smart light C, is then connected. The gateway detects this change, increments its sub-device list version number from V2 to V3, and immediately broadcasts a message to the central control screen of the management device stating: "Current sub-device list version is V3, and the list includes: smart light A, smart light B, and smart light C."

[0046] The above embodiments stipulate that the gateway must immediately broadcast all information and the updated version number when the sub-device list changes, achieving real-time announcement of network status changes. This enables near real-time push of sub-device layer topology changes to the network, allowing all monitoring management devices to detect and respond to changes immediately, significantly reducing the latency between device status changes and the managed devices' awareness of the changes.

[0047] In one exemplary embodiment, the method further includes: obtaining the current version number corresponding to the sub-device list of the current period according to a preset period, and determining a second version number based on the current version number; sending a second broadcast message to the management device, wherein the second broadcast message includes the second version number; and in response to a first device query request sent by the management device after receiving the second broadcast message, sending a first response message to the management device, wherein the first response message includes a second sub-device list, and the second sub-device list is determined based on the sub-device list of the current period.

[0048] Optionally, in the above embodiments, even without any device changes, the lighting gateway broadcasts the current version number, such as "Version V4," every certain period of time (e.g., 60 seconds). When the central control screen of the management device in the local area network discovers that this version number is newer than its stored version number (e.g., V3), it will send a query to the gateway. After receiving the query, the gateway will return the latest list (version V4) containing "Smart Light A, Smart Light B, Smart Light D" to the central control screen.

[0049] Through the above embodiments, the gateway periodically broadcasts its version number and responds to query requests from the management device, forming a low-overhead, highly reliable heartbeat and synchronization mechanism. On the one hand, the periodic version number broadcast, as a lightweight heartbeat, maintains the gateway's online visibility; on the other hand, if the gateway's broadcast is abnormal when the sub-device list changes, this periodic broadcast allows the management device to detect it promptly, serving as a remedial measure for proactively reporting failures.

[0050] In an exemplary embodiment, before sending a first broadcast message to the management device when an update is detected in the number of sub-devices connected to the gateway device, the method further includes: determining a third sub-device list based on the sub-devices connected to the gateway device, generating a third version number corresponding to the third sub-device list; sending a third broadcast message to the management device, wherein the third broadcast message includes the gateway identifier, network address, service port number, and third version number of the gateway device; and in response to a second device query request sent by the management device after receiving the third broadcast message, sending a second response message to the management device to enable the management device to determine a first local sub-device list, wherein the second response message includes the third sub-device list corresponding to the third version number.

[0051] Optionally, in the above embodiments, during the initialization phase of smart device deployment, after a lighting gateway starts up, it begins periodically broadcasting within the local area network: "Gateway ID: Light_Gateway_001, IP: 192.168.1.10, Port: 8888, List Version: V1". Upon receiving this broadcast, the central control screen sends a query request to 192.168.1.10:8888. After receiving the request, the gateway returns a list of all smart lights it manages (version V1) to the central control screen.

[0052] The above embodiments solve the problem of gateway discovery and initialization by the management device. A communication bridge is established between the management device and the gateway, enabling the management device to accurately know the existence, location, and initial integrity status of the gateway and its proxied sub-devices.

[0053] To better understand the process of the above-mentioned device network access method, the following description, in conjunction with optional embodiments, further illustrates the implementation process of the above-mentioned clothing matching method, but is not intended to limit the technical solutions of the embodiments of this application.

[0054] In an optional embodiment, Figure 3 This is a schematic diagram of device interaction according to an embodiment of this application, such as... Figure 3 As shown, the management device (e.g., the central control screen) and the gateway device are connected via a local area network (LAN). They can interact via broadcast or UDP (User Datagram Protocol) unicast. Sub-devices are IoT devices without independent internet access capabilities, such as smart lights and sensors. They connect to the gateway device via wired, Zigbee, Bluetooth, or other methods, and the gateway device acts as an intermediary for the sub-devices to access the LAN. For independent devices with independent internet access capabilities (e.g., Wi-Fi devices), they can directly connect to the management device via UDP unicast to join the LAN.

[0055] In an optional embodiment, Figure 4 This is a schematic diagram illustrating device discovery and synchronization according to an embodiment of this application, such as... Figure 4 As shown, the specific steps include:

[0056] 1. Initialization and Broadcast Announcement: The gateway device, acting as an independent device, periodically sends broadcast messages within the local area network. These broadcast messages include, but are not limited to, the following fields:

[0057] Device_ID: A unique identifier for the gateway.

[0058] IP_Address: The IP address of the gateway.

[0059] Service_Port: The port number on which the gateway provides query services.

[0060] SubDevice_List_Version: The version number of the list of sub-devices currently proxied by the gateway (initially V1, for example).

[0061] The technical advantage of this step is that it allows other devices within the local area network (referred to as "subscribers," such as a central touchscreen) to become aware of the gateway's existence and capabilities, including the current version of the sub-device list, with minimal network overhead (gateway broadcast only). The sub-devices themselves do not send any broadcast or multicast messages, fundamentally reducing the number of messages in the network.

[0062] 2. On-demand query for the full list: When a subscriber (such as a newly launched central control touchscreen) needs to obtain a complete list of sub-devices under a certain gateway, it will not wait for the sub-devices to broadcast. Instead, it will send a query request directly to the gateway IP address and port obtained in step 1 via unicast UDP communication. This is an on-demand triggered action, avoiding the waste of traffic caused by unrelated devices continuously broadcasting.

[0063] 3. Gateway Response and List Transmission: After receiving a query request, the gateway retrieves the complete list of sub-devices (including the ID, type, status, etc. of each sub-device) from its local storage and returns this list, along with the current sub-device list version number (V1), to the subscriber via UDP unicast.

[0064] 4. The subscriber receives and stores the list and version number. At this point, the subscriber has obtained a flat view of all sub-devices under this gateway.

[0065] 5. List Change Detection and Version Update: When the status of a sub-device represented by the gateway changes (e.g., a new smart light joins the network or an old sensor goes offline), the gateway detects this change. Subsequently, the gateway increments the version number of its sub-device list (e.g., from V1 to V2) and updates the locally stored sub-device list. This version number increment is the core mechanism that triggers subsequent synchronization.

[0066] 6. Proactive Reporting of Changes: After the version number is updated, the gateway will immediately and proactively report the latest list of sub-devices and their new version number (V2) to all known subscribers (i.e., devices that have previously queried it). This step aims to achieve timely synchronization of changes.

[0067] 7. Subscribers update their local V1 version sub-device list based on the latest V2 version sub-device list.

[0068] 8. Mechanism for handling reporting failures: Due to network fluctuations, the proactive reporting in step 6 may fail, and the subscriber's local V1 version sub-device list may not be updated in a timely manner. To ensure eventual data consistency, the gateway device will periodically broadcast the current sub-device list version, and subscribers will continuously listen for the gateway's periodic broadcasts.

[0069] 9. When a subscriber receives a broadcast and finds that the version number V2 of the sub-device list announced in the broadcast is greater than the version number V1 stored locally, it determines that the local list has expired.

[0070] 10. At this point, the subscriber will automatically trigger a UDP unicast query to the gateway to retrieve the latest list of sub-devices.

[0071] 11. The gateway device responds with a complete list of sub-devices for version V2.

[0072] 12. Update the local sub-device list to V2, synchronization complete.

[0073] Through the above steps, broadcast messages from quantum devices are prohibited, limiting periodic broadcast sources to a small number of gateway devices, eliminating the cause of network storms at the source and reducing network load. Combined with an on-demand query mechanism based on version comparison, the network communication volume for most of the time is changed from full list polling to lightweight version number broadcasting and comparison, effectively reducing redundant communication traffic within the local area network and ensuring the quality of network services for critical businesses. An innovative combination of event-driven proactive reporting and state-driven on-demand querying constructs a dual-guarantee synchronization mechanism. When the sub-device list changes, the gateway's proactive reporting ensures timely transmission of changes; and when a reporting message is lost, subscribers automatically trigger a resynchronization mechanism through version number comparison, achieving eventual data consistency. Ultimately, this constitutes an efficient, reliable, and scalable IoT device discovery solution, effectively addressing the industry pain point of balancing network load and data consistency in high-density device access network environments.

[0074] In an optional embodiment, the device network access method of this application is described using a smart office scenario as an example. For instance, a smart office scenario has 50 smart lights, and the method specifically includes the following steps:

[0075] 1. Initial discovery: The smart lighting gateway broadcasts the following every 60 seconds: Device_ID:Light_Gateway_01, IP:192.168.1.100, Port:8888, SubDevice_List_Version:5.

[0076] 2. Control Terminal Retrieves List: The newly installed central control touchscreen listens to this broadcast and immediately sends a UDP query message to the address 192.168.1.100:8888. The gateway returns a list containing information on 50 lights and the version number V5. The central control touchscreen stores this information.

[0077] 3. List changes and synchronization:

[0078] Scenario A (Successful Reporting): The 51st light has been added. The gateway list version has been updated to V6, and the new list is immediately reported to the touchscreen. The touchscreen successfully receives the report and updates its local data.

[0079] Scenario B (Synchronization after Reporting Failure): Four LEDs fail and go offline. The gateway list version changes to V7, but the reporting message is lost due to momentary network congestion. Approximately 30 seconds later, the gateway broadcasts again with the version number V7. The touchscreen compares the data and finds that V7 > V6, immediately initiates a query, and finally obtains the latest list of 47 LEDs, completing the synchronization.

[0080] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of this application.

[0081] Figure 5 This is a structural block diagram of a device accessing the network according to an embodiment of this application; as shown below. Figure 5 As shown, it includes:

[0082] Gateway device 52, management device 54, and sub-device 56 connected to the gateway device. The management device 54 is used to manage the gateway device 52 and the sub-device 56 connected to the gateway device. The management device 54, the gateway device 52, and the sub-device 56 are connected through a hybrid network.

[0083] The gateway device 52 is configured to send a first broadcast message to the management device when it detects an update in the number of sub-devices connected to the gateway device. The first broadcast message includes a first sub-device list and a first version number. The first sub-device list includes all sub-devices connected to the gateway device, and the first version number represents the list version corresponding to the first sub-device list.

[0084] The management device 54 is used to receive the first broadcast message sent by the gateway device;

[0085] The management device 54 is further configured to update the first local sub-device list according to the first sub-device list to obtain a second local sub-device list, and to update the first local version number according to the first version number to obtain a second local version number, wherein the first local sub-device list is used to represent the sub-device list stored locally by the management device, and the first local version number represents the list version corresponding to the first local sub-device list.

[0086] The management device 54 is further configured to determine the devices to be added to the target local area network based on the second local sub-device list, wherein the target local area network refers to the local area network where the management device is located.

[0087] The system described above uses a gateway device to proxy IoT sub-devices joining the local area network (LAN). The gateway device broadcasts the list of sub-devices connected to the gateway to the management device, reporting their version numbers. The management device then synchronizes the list of connected devices based on both its local and reported version numbers. This solves the problem of excessive network load when high-density IoT devices are connected to a LAN, thereby reducing network load in such environments.

[0088] In one exemplary embodiment, the management device 54 is configured to receive a second broadcast message sent by the gateway device, wherein the second broadcast message includes a second version number; determine a comparison result between the second version number and a second local version number, wherein the comparison result includes whether the second version number and the second local version number are the same or whether the second version number and the second local version number are different; if the comparison result indicates that the second version number and the second local version number are different, update the second local sub-device list to obtain a third local sub-device list, and update the second local version number to obtain a third local version number.

[0089] In one exemplary embodiment, the management device 54 is configured to send a first device query request to the gateway device; receive a first response message sent by the gateway device based on the first device query request, wherein the first response message includes a second sub-device list corresponding to the second version number; update the second local sub-device list according to the second sub-device list to obtain the third local sub-device list, and update the second local version number according to the second version number to obtain the third local version number.

[0090] In one exemplary embodiment, the management device 54 is configured to receive a third broadcast message sent by the gateway device, wherein the third broadcast message includes a gateway identifier, network address, service port number, and third version number of the gateway device; establish a network connection with the gateway device based on the gateway identifier, network address, and service port number, and send a second device query request to the gateway device; receive a second response message sent by the gateway device based on the second device query request, wherein the second response message includes a third sub-device list corresponding to the third version number; determine a first local sub-device list based on the third sub-device list, and determine a first local version number based on the third version number.

[0091] In an exemplary embodiment, the gateway device 52 is configured to send a first broadcast message to the management device when it detects an update in the number of sub-devices connected to the gateway device. The first broadcast message includes a first sub-device list and a first version number. The first sub-device list includes all sub-devices connected to the gateway device, and the first version number represents the list version corresponding to the first sub-device list.

[0092] In an exemplary embodiment, the gateway device 52 is configured to obtain the current version number corresponding to the sub-device list of the current period according to a preset period, determine a second version number based on the current version number; send a second broadcast message to the management device, wherein the second broadcast message includes the second version number; and in response to a first device query request sent by the management device after receiving the second broadcast message, send a first response message to the management device, wherein the first response message includes a second sub-device list, and the second sub-device list is determined based on the sub-device list of the current period.

[0093] In an exemplary embodiment, the gateway device 52 is configured to determine a third sub-device list based on the sub-devices accessing the gateway device, generate a third version number corresponding to the third sub-device list, send a third broadcast message to the management device, wherein the third broadcast message includes the gateway identifier, network address, service port number, and third version number of the gateway device, and in response to a second device query request sent by the management device after receiving the third broadcast message, send a second response message to the management device to enable the management device to determine a first local sub-device list, wherein the second response message includes the third sub-device list corresponding to the third version number.

[0094] Embodiments of this application also provide a storage medium including a stored program, wherein the program executes any of the methods described above when it is run.

[0095] Optionally, in this embodiment, the storage medium may be configured to store program code for performing the following steps:

[0096] S1, receive a first broadcast message sent by the gateway device, wherein the first broadcast message includes a first sub-device list and a first version number, wherein the first sub-device list includes all sub-devices connected to the gateway device, and the first version number represents the list version corresponding to the first sub-device list;

[0097] S2, update the first local sub-device list according to the first sub-device list to obtain the second local sub-device list, and update the first local version number according to the first version number to obtain the second local version number, wherein the first local sub-device list represents the list of sub-devices stored locally by the management device, and the first local version number represents the list version corresponding to the first local sub-device list;

[0098] S3, determine the devices to be added to the target local area network based on the second local sub-device list, wherein the target local area network refers to the local area network where the management device is located.

[0099] Embodiments of this application also provide 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.

[0100] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.

[0101] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:

[0102] S1, receive a first broadcast message sent by the gateway device, wherein the first broadcast message includes a first sub-device list and a first version number, wherein the first sub-device list includes all sub-devices connected to the gateway device, and the first version number represents the list version corresponding to the first sub-device list;

[0103] S2, update the first local sub-device list according to the first sub-device list to obtain the second local sub-device list, and update the first local version number according to the first version number to obtain the second local version number, wherein the first local sub-device list represents the list of sub-devices stored locally by the management device, and the first local version number represents the list version corresponding to the first local sub-device list;

[0104] S3, determine the devices to be added to the target local area network based on the second local sub-device list, wherein the target local area network refers to the local area network where the management device is located.

[0105] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0106] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above method embodiments.

[0107] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps in any of the above method embodiments.

[0108] The embodiments described herein also provide a computer program that includes computer instructions stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the steps in any of the above method embodiments.

[0109] Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated here.

[0110] Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.

[0111] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A method for connecting a device to a network, characterized in that, An application for a management device, wherein the management device manages a gateway device and sub-devices connected to the gateway device, the management device, the gateway device, and the sub-devices are connected via a hybrid network, including: The gateway device receives a first broadcast message, wherein the first broadcast message includes a first sub-device list and a first version number, wherein the first sub-device list includes all sub-devices connected to the gateway device, and the first version number represents the list version corresponding to the first sub-device list; The first local sub-device list is updated according to the first sub-device list to obtain the second local sub-device list, and the first local version number is updated according to the first version number to obtain the second local version number. The first local sub-device list represents the list of sub-devices stored locally by the management device, and the first local version number represents the list version corresponding to the first local sub-device list. The devices to be added to the target local area network are determined based on the second local sub-device list, wherein the target local area network refers to the local area network where the management device is located.

2. The device network access method according to claim 1, characterized in that, The method further includes: Receive a second broadcast message sent by the gateway device, wherein the second broadcast message includes a second version number; Determine the comparison result between the second version number and the second local version number, wherein the comparison result includes whether the second version number and the second local version number are the same or whether the second version number and the second local version number are different; If the comparison result indicates that the second version number is inconsistent with the second local version number, the second local sub-device list is updated to obtain a third local sub-device list, and the second local version number is updated to obtain a third local version number.

3. The device network access method according to claim 2, characterized in that, The second local sub-device list is updated to obtain a third local sub-device list, and the second local version number is updated to obtain a third local version number, including: Send a first device query request to the gateway device; Receive a first response message sent by the gateway device based on the first device query request, wherein the first response message includes a second sub-device list corresponding to the second version number; The second local sub-device list is updated according to the second sub-device list to obtain the third local sub-device list, and the second local version number is updated according to the second version number to obtain the third local version number.

4. The device network access method according to claim 1, characterized in that, Before receiving the first broadcast message sent by the gateway device, the method further includes: Receive a third broadcast message sent by the gateway device, wherein the third broadcast message includes the gateway identifier, network address, service port number and third version number of the gateway device; Establish a network connection with the gateway device based on the gateway identifier, network address and service port number, and send a second device query request to the gateway device; Receive a second response message sent by the gateway device based on the query request of the second device, wherein the second response message includes a list of third sub-devices corresponding to the third version number; The first local sub-device list is determined based on the third sub-device list, and the first local version number is determined based on the third version number.

5. A method for connecting a device to a network, characterized in that, Applied to a gateway device, the gateway device supports access to sub-devices, and the gateway device and the sub-devices accessing the gateway device are managed through a management device, wherein the management device, the gateway device, and the sub-devices are connected through a hybrid network, including: If an update is detected in the number of sub-devices connected to the gateway device, a first broadcast message is sent to the management device. The first broadcast message includes a first sub-device list and a first version number. The first sub-device list includes all sub-devices connected to the gateway device, and the first version number represents the list version corresponding to the first sub-device list.

6. The device network access method according to claim 5, characterized in that, The method further includes: Obtain the current version number corresponding to the sub-device list of the current period according to the preset period, and determine the second version number based on the current version number; Send a second broadcast message to the management device, wherein the second broadcast message includes the second version number; In response to a first device query request sent by the management device after receiving the second broadcast message, a first response message is sent to the management device, wherein the first response message includes a second sub-device list, the second sub-device list being determined based on the sub-device list of the current period.

7. The device network access method according to claim 5, characterized in that, Before sending a first broadcast message to the management device upon detecting an update in the number of sub-devices connected to the gateway device, the method further includes: A third sub-device list is determined based on the sub-devices connected to the gateway device, and a third version number corresponding to the third sub-device list is generated. Send a third broadcast message to the management device, wherein the third broadcast message includes the gateway identifier, network address, service port number and third version number of the gateway device; In response to a second device query request sent by the management device after receiving the third broadcast message, a second response message is sent to the management device to enable the management device to determine a first local sub-device list, wherein the second response message includes the third sub-device list corresponding to the third version number.

8. A device network access system, characterized in that, include: A gateway device, a management device, and sub-devices connected to the gateway device; the management device is used to manage the gateway device and the sub-devices connected to the gateway device; the management device, the gateway device, and the sub-devices are connected via a hybrid network. The gateway device is configured to send a first broadcast message to the management device when it detects an update in the number of sub-devices connected to the gateway device. The first broadcast message includes a first sub-device list and a first version number. The first sub-device list includes all sub-devices connected to the gateway device, and the first version number represents the list version corresponding to the first sub-device list. The management device is used to receive the first broadcast message sent by the gateway device; The management device is further configured to update the first local sub-device list according to the first sub-device list to obtain a second local sub-device list, and to update the first local version number according to the first version number to obtain a second local version number, wherein the first local sub-device list is used to represent the sub-device list stored locally by the management device, and the first local version number represents the list version corresponding to the first local sub-device list. The management device is further configured to determine the devices to be added to the target local area network based on the second local sub-device list, wherein the target local area network refers to the local area network where the management device is located.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program, when executed, performs the method described in any one of claims 1 to 7.

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 execute the method described in any one of claims 1 to 7 through the computer program.