A method for batch burning and network sorting of internet of things devices and application thereof
By controlling the communication topology conversion and terminal-side level-triggered response mechanism within the gateway node, automatic network access and sequencing of IoT devices are achieved, solving the problems of low automation and high reliance on manual intervention in large-scale deployments, and improving the system's automation level and operational reliability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGDONG WODAWELL TECHNOLOGY CO LTD
- Filing Date
- 2026-03-12
- Publication Date
- 2026-07-31
AI Technical Summary
Existing methods for network access and sorting of IoT devices have low automation, high reliance on manual labor, and high after-sales maintenance costs in large-scale deployment scenarios. They are also prone to errors and inefficient, especially in complex topology environments.
By introducing a controllable port forwarding state network access control within the gateway node, the parallel communication topology is temporarily converted into a sequentially identifiable serial topology. Combined with the terminal-side level-triggered response mechanism and device attribute matching, automatic identification, automatic sorting, and network access of multiple gateways and multiple terminal devices are achieved.
It significantly reduces human intervention and the probability of errors, shortens project deployment time, reduces subsequent maintenance costs, and improves system automation and network initialization efficiency.
Smart Images

Figure CN122496515A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of Internet of Things (IoT) device technology, and particularly relates to a method and application for batch programming and network access sorting of IoT devices. Background Technology
[0002] With the rapid development of IoT technology, multi-level network architecture based on cloud, platform, gateway and terminal has been widely used in urban lighting, smart meters, industrial control, smart buildings and public infrastructure.
[0003] In the aforementioned application scenarios, it is typically necessary to deploy a large number of gateway devices and terminal node devices at the same project site to achieve centralized management and coordinated control of various sensors, actuators, or lighting devices. The continuous increase in the number of devices has made the initial configuration, network access authentication, numbering and sorting, and identification writing of devices key bottlenecks in the system deployment and operation and maintenance process.
[0004] Currently, the network access and sorting of mainstream smart gateways and smart terminals in the industry still mainly rely on manual methods. That is, on the project site, people manually register and authenticate by scanning the QR code on the device, manually entering the device number, or connecting to the network one by one.
[0005] This method can meet the needs when the number of nodes is small. However, in complex topology environments with multiple gateways, branches, and terminals connected in parallel, manual operation is not only inefficient but also prone to errors such as duplicate numbering, disordered logical order, or incorrect device binding, affecting the overall stability of the system. Furthermore, in complex outdoor construction environments such as high-altitude installations, underground utility tunnels, or outdoor installations, manually identifying equipment information and configuring network parameters for each device is difficult and costly. Moreover, manual operations are still required during equipment replacement or expansion during later maintenance, further increasing the operational burden.
[0006] On the other hand, existing network access technologies typically only focus on establishing connections between devices and the network. In multi-node parallel networks, there is often no natural correspondence between the actual location of each device in the cabling and its logical address. After the system goes live, manual comparison of construction drawings and on-site device numbers is still required for repeated calibration, which is time-consuming, error-prone, and difficult to standardize. During the terminal device manufacturing stage, identification information is often written using a single-machine, one-by-one burning method, making it difficult to achieve automated batch processing. When the number of devices reaches hundreds or even thousands, this significantly restricts production efficiency and increases manual management costs.
[0007] Therefore, existing methods for network access and sorting of IoT devices generally suffer from low automation, high reliance on manual labor, and high after-sales maintenance costs in large-scale deployment scenarios. Summary of the Invention
[0008] The purpose of this application is to provide a method for batch programming and network access sorting of IoT devices, which aims to solve the problems of low automation, high dependence on manual labor, and high after-sales maintenance costs that exist in existing IoT device network access and sorting methods in large-scale deployment scenarios.
[0009] This application provides a method for batch programming and network access sorting of IoT devices, the method comprising: Upon receiving the automatic network access control command, all gateway nodes in the target network are put into network access control mode. In the network access control mode, the parallel communication topology between gateway nodes is converted into a sequentially identifiable serial communication topology, and the sorting order of each gateway node in the serial communication topology is obtained. Based on the sorting order, network addresses and logical sequence numbers are assigned to each gateway node in sequence to obtain a gateway sorting list; Store the gateway sorting list and restore the communication ports of each gateway node to the parallel communication topology; Each gateway node sends a terminal access command to its subordinate terminal devices. Based on the response information of the terminal devices, the branch ordering information of each terminal device in its respective branch link is obtained. Obtain the device attribute information reported by the terminal device, match the device attribute information with the preset branch attribute information of the branch link, and obtain the entity correspondence between each branch link and the physical installation location based on the matching result; Based on the branch sorting information and the entity correspondence, automatic network access sorting and mapping control of each IoT device is completed.
[0010] Another objective of this application is to provide a device for batch programming and network access sorting of Internet of Things (IoT) devices, the device comprising: The network access command unit is used to enable all gateway nodes in the target network to enter the network access control mode after receiving the automatic network access control command. A serial sorting unit is used to convert the parallel communication topology between gateway nodes into a sequentially identifiable serial communication topology in the network access control mode, and to obtain the sorting order of each gateway node in the serial communication topology. A gateway sorting unit is used to assign network addresses and logical sequence numbers to each gateway node in sequence based on the sorting order, thereby obtaining a gateway sorting list. A communication recovery unit is used to store the gateway sorting list and restore the communication ports of each gateway node to the parallel communication topology. The branch sorting acquisition unit is used to send terminal network access instructions from each gateway node to its subordinate terminal devices, and obtain the branch sorting information of each terminal device in its respective branch link based on the response information of the terminal devices. The entity relationship correspondence unit is used to obtain the device attribute information reported by the terminal device, match the device attribute information with the preset branch attribute information of the branch link, and obtain the entity correspondence between each branch link and the physical installation location based on the matching result; The mapping relationship acquisition unit is used to complete the automatic network access sorting and mapping control of each IoT device based on the branch sorting information and the entity correspondence.
[0011] Another objective of this application is to provide a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform the steps of the IoT device batch programming and network access sorting method as described above.
[0012] Another objective of this application is to provide a smart gateway, including a memory and a processor. The memory stores a computer program, and when the computer program is executed by the processor, the smart gateway acts as a gateway node in the above-described method for batch programming and network access sorting of IoT devices, performing automatic network access and location mapping of IoT devices.
[0013] This application provides a method for batch programming and network access sequencing of IoT devices. Its key advantage lies in introducing controllable port forwarding status within the gateway node, temporarily converting the originally parallel multi-node communication network into a sequentially identifiable serial communication topology during the network access phase. This allows for automatic identification, sequencing, and network access of multiple gateways and terminal devices without requiring manual intervention. Furthermore, by combining a terminal-side level-triggered response mechanism and a device attribute matching mechanism, the physical connection order of terminal devices in complex branch links can be automatically acquired and matched with construction drawings or preset branch attributes, significantly reducing manual intervention and the probability of errors, shortening project deployment time, and reducing subsequent maintenance costs. Moreover, this solution requires no additional dedicated hardware; it can be implemented using only the existing communication ports of the gateway and the internal detection circuits of the terminals. It boasts advantages such as simple structure, low modification cost, strong adaptability, and good scalability, making it suitable for large-scale Y-shaped, star-shaped, or multi-branch complex topology networks. This improves system automation while enhancing network initialization efficiency and overall operational reliability. Attached Figure Description
[0014] Figure 1 This application provides an illustration of an application environment for a method of batch programming and network access sorting of IoT devices. Figure 2 A flowchart illustrating a method for batch programming and network access sorting of IoT devices provided in this application embodiment; Figure 3 This is a flowchart illustrating the steps of a method for obtaining the sorting order of a gateway node in a serial communication topology, as provided in an embodiment of this application.
[0015] Figure 4 A flowchart illustrating the steps of a method for obtaining branch sorting information provided in an embodiment of this application.
[0016] Figure 5 A structural block diagram of an IoT device batch programming and network access sorting device provided in this application embodiment; Figure 6 This is a block diagram of the internal structure of a computer device in one embodiment. Detailed Implementation
[0017] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0018] It is understood that the terms "first," "second," etc., used in this application may be used herein to describe various elements, but unless otherwise stated, these elements are not limited by these terms. These terms are used only to distinguish the first unit or module from another unit or module. For example, without departing from the scope of this application, the first script may be referred to as the second script, and similarly, the second script may be referred to as the first script.
[0019] Figure 1 This is an application environment diagram of the IoT device batch programming and network access sorting method provided in the embodiments of this application, such as... Figure 1 As shown, this application environment includes a gateway node 110, a cloud control device 120, a terminal device 100, and a power switch 130.
[0020] The cloud control device 120 can be an independent physical server or terminal, or a server cluster consisting of multiple physical servers. It can be a cloud server that provides basic cloud computing services such as cloud servers, cloud databases, cloud storage and CDN, or it can include smartphones, tablets, laptops, desktop computers, etc., but is not limited to these.
[0021] Gateway node 110 and cloud control device 120 can be connected via wired or various wireless networks, and this application does not impose any restrictions on this.
[0022] like Figure 2As shown, in one embodiment, a method for batch programming and network access sorting of IoT devices is proposed. This embodiment mainly applies this method to the above-mentioned... Figure 1 Let's take an application environment as an example. A method for batch programming and network access sorting of IoT devices may specifically include the following steps: Step S10: After obtaining the automatic network access control command, all gateway nodes in the target network are put into network access control mode.
[0023] In this embodiment, an automatic network access control command can be sent to all gateway nodes in the target network via dedicated management software or a cloud control platform from the management end. Upon receiving the command, each gateway node suspends its regular service data forwarding function and enters the network access control mode. In this mode, the gateway node can retain only the ability to receive control commands and provide status feedback, and no longer forward daily communication data, thus providing a stable control environment for subsequent topology switching and sequence identification, and avoiding interference from service traffic to the sorting process.
[0024] Step S20: In the network access control mode, the parallel communication topology between gateway nodes is converted into a sequentially identifiable serial communication topology, and the sorting order of each gateway node in the serial communication topology is obtained.
[0025] In this embodiment, in the network access control mode, the forwarding status of the gateway node's data port is uniformly controlled, causing all gateways to temporarily disable their output forwarding to lower-level nodes, while only the input communication ports of gateway nodes directly connected to the management terminal remain in listening mode. Since there is only one valid communication entry point in the network at this time, the first gateway node that maintains communication capability with the management terminal can be naturally identified.
[0026] Subsequently, by enabling and probing each port, the original multi-node parallel network structure can be logically transformed into a single-path serial structure, forming a controlled communication path that only allows sequential access to nodes, thereby enabling the identification of the physical connection order of each gateway node.
[0027] Step S30: Based on the sorting order, assign network addresses and logical sequence numbers to each gateway node in sequence to obtain a gateway sorting list.
[0028] In this embodiment, after a serial identification path is formed, each gateway node is identified sequentially according to its actual physical connection order. The system starts with the first gateway, assigns it an initial logical sequence number and network address, and records its device identifier to the management terminal. Subsequently, for each new gateway node identified, the logical sequence number and the last digit of the network address are incremented based on the previous node, and its device identifier information is recorded simultaneously. Through continuous cyclic identification, a gateway sorting list containing gateway identifiers, logical sequence numbers, and network addresses is finally formed.
[0029] Step S40: Store the gateway sorting list and restore the communication ports of each gateway node to the parallel communication topology.
[0030] In this embodiment, after the gateway sorting is completed, the system can write the assigned network address and logical sequence number into the non-volatile storage unit of each gateway by name, thereby storing the gateway sorting list and ensuring that the identification results can still be maintained after a power outage and restart.
[0031] After all gateways have been written, the management terminal issues a recovery command, and each gateway reopens all its output ports, restoring the forwarding capability of the previously restricted communication ports. The network structure is restored from a temporary serial identification state to a normal parallel communication state, thus regaining the ability for multiple nodes to communicate simultaneously.
[0032] In step S50, each gateway node sends a terminal network access command to its subordinate terminal devices, and obtains the branch ordering information of each terminal device in its respective branch link based on the response information of the terminal devices.
[0033] In this embodiment, after the gateways complete the sorting and restore parallel communication, each gateway begins to perform network access and sorting operations on its connected terminal devices. The gateway first enables the branch circuit to power on through the power supply control interface, and the level detection circuit inside the terminal device starts to work.
[0034] In each branch, the first terminal generates a trigger signal (e.g., a low-level trigger signal) internally because its PI signal line is directly connected to the power supply, and is in a "low-level state". When the gateway broadcasts the network access command via power line carrier, the terminal in the "low-level state" responds and reports its own identifier. Subsequently, the gateway performs name control on this terminal, causing its signal output terminal, i.e., the PO port, to output, triggering the PI input of the next-level terminal device to generate a new low level, thus putting it in a "low-level state". The terminal device in the low-level state reports its own information again, thereby enabling the gateway to identify the order of each terminal in sequence. Through the above cycle, each branch completes the terminal sorting, resulting in a sorted list for each branch.
[0035] Step S60: Obtain the device attribute information reported by the terminal device, and match the device attribute information with the preset branch attribute information of the branch link. Based on the matching result, obtain the entity correspondence between each branch link and the physical installation location.
[0036] In the above embodiments, only the order of the terminal devices within their respective branches can be known, but it is difficult to determine the correspondence between each branch and the actual installation location. In this embodiment, each terminal device synchronously reports its factory-pre-written device attribute information. For example, lighting devices will report the lighting type, power parameters, number of color channels, or working mode. The management terminal or cloud platform pre-establishes preset attribute templates for each branch link based on construction drawings or engineering configuration lists. The system compares the actual attribute information reported by the terminal with the preset template item by item. When the attribute matching conditions are met, the correspondence between the branch where the terminal is located and the actual physical installation area can be determined. If multiple branches have the same attributes, a terminal with a unique attribute feature can be set as an identifier to ensure the uniqueness of the mapping result.
[0037] Step S70: Based on the branch sorting information and the entity correspondence, complete the automatic network access sorting and mapping control of each IoT device.
[0038] In the steps described above, the system acquired the gateway node list, the device sorting list within each branch, and the corresponding list for each branch within the gateway. Therefore, in this step, the system can integrate the gateway sorting list, terminal branch sorting information, and entity correspondence between terminals and their physical installation locations collected in the previous steps, generating a complete device mapping control relationship table on the management end. At this point, all gateways and terminal devices in the network automatically complete network access, numbering, and location binding, eliminating the need for manual configuration and enabling unified management and normal operation. This significantly improves system initialization efficiency and reduces deployment and maintenance costs.
[0039] In this embodiment, the following example illustrates the situation: A network contains 10 gateways connected in series, from the first to the tenth. Each gateway has its own independent MAC address and device number, but the exact location of each gateway within the network is unknown. Traditionally, this involves manually entering a QR code or device number on the gateway, a cumbersome process. Therefore, in this embodiment, upon receiving an automatic network access control command from the management terminal, such as an automatic sorting command from the cloud, all gateways will switch to network access control mode, stopping all Ethernet port forwarding and cutting off information flow between gateways. Only the first gateway connected to the cloud will have a network data exchange path.
[0040] In one embodiment, if the IP address of the switch is 192.168.1.1, in order to ensure the sequential order of the gateway IPs, the logical sequence number of the gateway connected to the cloud can be set to 1. Then, the gateway IP addresses will be allocated starting from 192.168.1.2, with the numbers arranged from smallest to largest and increasing sequentially.
[0041] In one embodiment, to Figure 1 The example shown illustrates that the control terminal has at least two power input terminals, one signal output terminal PO, and one signal input terminal PI. The connection relationships of the devices are as follows: Figure 1 As shown. The method for uploading response information from terminal devices can be as follows: Assuming the trigger signal is low, after controlling the PC and clicking the "One-click Network Access" button for terminal device 1 under Gateway 1, the gateway node enables the air switch to supply power to the downstream branch through the 485 interface. The PI line of the first node on each branch is connected to the neutral or live line, and the first terminal device on each branch will generate a low level. The internal hardware circuit of the terminal device detects whether there is power input on the PI signal line. The PI signal line can be connected to either the neutral or live line. The gateway node sends a broadcast command to make the terminal with a low level report its ID. If there are three branches, then three terminal device IDs will be seen in the information table, and these standard serial numbers will be set to 1. It can be understood that the PI line of the first light is directly connected to the neutral or live line, so it has a low level and will respond to the reporting command; the PI signal lines of the other terminal devices have no input signal, so they cannot generate a low level, so they ignore the reporting command and do not upload response information.
[0042] The method provided in this application has the advantage of introducing controllable port forwarding status network access control within the gateway node, temporarily converting the originally parallel multi-node communication network into a sequentially identifiable serial communication topology during the network access phase. This enables automatic identification, automatic sorting, and automatic network access for multiple gateways and terminal devices without requiring manual intervention. Simultaneously, by combining a terminal-side level-triggered response mechanism and a device attribute matching mechanism, the physical connection order of terminal devices in complex branch links can be automatically obtained and matched with construction drawings or preset branch attributes, significantly reducing manual intervention and the probability of errors, shortening project deployment time, and reducing subsequent maintenance costs. Furthermore, this solution does not require additional dedicated hardware; it can be implemented using only the existing communication ports of the gateway and the internal detection circuits of the terminals. It has advantages such as simple structure, low modification cost, strong adaptability, and good scalability, and can be applied to large-scale Y-shaped, star-shaped, or multi-branch complex topology networks, improving network initialization efficiency and overall operational reliability while enhancing system automation.
[0043] In a preferred embodiment, the method for causing all gateway nodes in the target network to enter the network access control mode after obtaining the automatic network access control command is as follows: Waiting for the management terminal to trigger the automatic network access command; After receiving the automatic network access command, the cloud server generates a network access control instruction and broadcasts it to all gateway nodes in the target network. Upon receiving the network access control command, each gateway node switches from the regular service mode to the network access control mode.
[0044] In this embodiment, the management terminal can trigger an automatic network access operation command in the cloud control software. After receiving the operation command, the cloud server generates a unified format network access control command and broadcasts it to the target network, thereby ensuring that all gateway nodes in the network can receive the same control information within the same time window. After receiving the network access control command, each gateway node suspends the forwarding of current service data and enters the network access control mode, so that the network as a whole switches from the service communication state to the sorting and identification state. Through the above steps, full gateway synchronous control is achieved and concurrent interference is eliminated.
[0045] like Figure 3 The diagram illustrates a method for obtaining the order of gateway nodes in a serial communication topology. In a preferred embodiment, under the network access control mode, the method for converting the parallel communication topology between gateway nodes into a sequentially identifiable serial communication topology and obtaining the order of each gateway node in the serial communication topology is as follows: S21, Control the data port forwarding status of the gateway node, stop the regular service data forwarding of each gateway node, and ensure that only the first gateway node in the target network that has a connection path with the management end maintains the ability to exchange network data with the management end. S22, Starting from the first gateway node, send a probe frame to the target network to detect whether there are other unconnected gateway nodes in the target network; S23, when receiving response data from other gateway nodes that have not yet been connected in the topology, the newly connected gateway node is placed at the tail of the topology connection queue; S24, continuously send probe data frames to the target network until no response data is received from the new link gateway node, and obtain the complete serial topology queue; S25, based on the serial topology queue, obtain the sorting order of each gateway node in the serial communication topology.
[0046] Understandably, each gateway node has multiple data ports. Under normal circumstances, the gateway nodes are interconnected via data cables, and the network relationship is a parallel topology.
[0047] In this embodiment, when a gateway node receives a command to enter the network access control mode, it first stops the regular service forwarding process of each gateway node's Ethernet port, causing a temporary interruption of service communication in the network and transitioning to a serial topology. At this time, only the gateway node located on the upstream input side (i.e., the one closest to the management end path start point) is still on the same connected path, and this node can be set as the first gateway node; other gateways are temporarily disconnected because the upstream port no longer forwards.
[0048] Then, starting with the first gateway node in the serial topology, after it completes the data confirmation with the management end, it can send probe data frames downstream in a time-division manner through the data ports that connect the gateway to other gateway nodes to detect whether other gateway devices are connected under the gateway port.
[0049] If a gateway node returns a response, it indicates that the node is downstream of the current node on the physical link. The system then adds this node to the end of the inline topology queue, making it the next target node to be identified. Specifically, when a valid device is detected, the IP address is incremented by 1, and the sequence number is also incremented by 1 and written to the current device. After all the branch gateways under this port have been probed, other ports under that gateway are probed until no new response data is received after sending probe data frames, indicating that the end of the current link has been reached and there are no new unidentified nodes in the network.
[0050] The advantage of this embodiment is that, without changing the actual wiring structure, it transforms a complex parallel network into a logically serial structure that can be identified sequentially through the logical control and step-by-step probing of the communication port, thereby reducing manual intervention and improving identification accuracy.
[0051] In a preferred embodiment, the method for assigning network addresses and logical sequence numbers to each gateway node sequentially based on the sorting order to obtain the gateway sorting list is as follows: Set the logical sequence number of the first gateway node in the sorting order that has the unique ability to communicate with the management end to 1, and use the starting address of the preset local area network segment as the starting value of the network address of the first gateway node. After the first gateway node completes the setting of the sequence number and network address, it obtains the device identification information returned by the next-level gateway node; The logical sequence number of the next-level gateway node is incremented by 1 based on the previous gateway node, and the last digit of its network address is incremented by 1 based on the network address of the previous gateway node. Assign network addresses and logical sequence numbers to all gateway nodes, and generate a gateway sorting list.
[0052] In this embodiment, the first gateway node, which maintains unique communication with the management terminal, is used as the starting point for numbering. It is assigned an initial logical sequence number and a starting network address within a preset network segment, establishing the numbering baseline for the entire network. When the next-level gateway node returns its device identification information, this information is compared with the already recorded set of gateway identifiers to determine if the node has already been named. If it is determined to be a new node, the logical sequence number and the last digit of the network address are incremented based on the previous node, and the node is included in the sorting sequence; if it is determined to be a already recorded node, its information is ignored to avoid duplicate numbering.
[0053] In a preferred embodiment, the method for storing the gateway sorting list and restoring the communication ports of each gateway node to the parallel communication topology is as follows: After the network address and logical sequence number of a certain gateway node are determined, the previous sorted gateway node or management terminal sends a write instruction containing the network address and logical sequence number to the current gateway node, so that the current gateway node receives and writes the network address and logical sequence number into its local non-volatile memory for storage. After all gateway nodes have completed writing the network address and logical sequence number, the management terminal sends an exit sorting mode command to all gateway nodes. Upon receiving the exit sorting mode instruction, each gateway node re-enables the forwarding function of all data ports, restoring the communication topology between the gateway nodes from serial to parallel.
[0054] In this embodiment, after all gateway nodes have completed writing, the management terminal uniformly issues an exit sorting mode command. Each gateway node then restarts the forwarding function of all data ports, restoring the normal output capability of ports previously restricted for sequential identification. The advantage is that it ensures the long-term validity of the sorting results while avoiding the impact of continuously occupying the control mode on normal business communication.
[0055] like Figure 4 The diagram shows a flowchart of a method for obtaining branch sorting information. In a preferred embodiment, each gateway node sends a terminal network access command to its subordinate terminal devices. Based on the response information of the terminal devices, the method for obtaining the branch sorting information of each terminal device within its respective branch link is as follows: S51, the gateway node controls the power-on of the terminal devices of its downstream branch links; the signal input terminal of the first terminal device of the branch link is connected to the power line, and the signal input terminal of the subsequent terminal devices is connected to the signal output terminal of the previous level terminal device. S52, when the terminal device is powered on, it outputs an initialization trigger signal to the signal input terminal of the first terminal device in the branch link, so that the first terminal device enters the response preparation state; S53, the gateway node broadcasts a network access command, causing the terminal device in the response preparation state to report its terminal identification information, and assigns a sorting number within the branch to the terminal device; S54, issue a cascading trigger command to the terminal device with the assigned sorting sequence number, so that it outputs a cascading trigger signal to the signal input terminal of the next-level terminal device through the signal output terminal, so that the next-level terminal device enters the response preparation state; S55, repeat the cycle of "broadcasting network access command - receiving terminal identification information - assigning sorting number - issuing cascading trigger command" until no new terminal identification information is reported in the branch link, and obtain the branch sorting information of each terminal device in its respective branch link.
[0056] In this embodiment of the application, the connection relationship between terminal devices can be as follows: Figure 1 As shown in the diagram. In this embodiment, the gateway device controls the relay to start, supplying power to the downstream terminal devices. The signal input terminal of the first terminal device is directly connected to the power line. At this time, it can be considered that the signal input terminal of the first terminal device has received the initialization trigger signal. Then, through methods such as trigger signal response and cascading trigger transmission, all terminal devices can enter the response state one by one according to the actual physical connection order, avoiding communication conflicts and identification confusion caused by multiple terminals answering at the same time. At the same time, the trigger signal detection of the PI signal line and the PO cascading output realize automatic sequential transmission, eliminating the need for manual scanning or manual numbering of each terminal, thus completing the automatic network access and sorting of a large number of terminals. This method does not rely on additional dedicated identification equipment, but can be realized based solely on the internal detection circuit of the terminal and the gateway broadcast control. It has the advantages of low implementation cost, high identification accuracy, and strong adaptability to complex multi-branch cabling environments, which can significantly improve the efficiency of on-site deployment and reduce the workload of manual maintenance.
[0057] In a preferred embodiment, the method for obtaining the device attribute information reported by the terminal device and matching the device attribute information with the preset branch attribute information of the branch link to obtain the entity correspondence between the branch link and the physical installation location is as follows: Based on the engineering configuration information, a branch attribute information database corresponding to each branch link is pre-established. The branch attribute information is used to characterize the equipment type and / or parameter characteristics of the physical installation area corresponding to each branch link. The device attribute information reported by each terminal device is compared with the branch attribute information in the branch attribute information database. When the preset matching conditions are met, it is determined that the branch link to which the terminal device belongs and the corresponding physical installation location are established as an entity correspondence. When the branch attribute information of multiple branch links all meet the matching conditions with the device attribute information of the terminal device, but the entity correspondence cannot be uniquely determined, a feature terminal device with preset identification features is connected to the end of at least one of the multiple branch links. The multiple candidate branch links are distinguished by identifying the device attribute information of the feature terminal device, thereby uniquely determining the entity correspondence. After matching the device attribute information and branch attribute information of each terminal device, the entity correspondence is obtained.
[0058] In this embodiment, after matching is completed, a mapping table containing terminal identification information, branch link number, and physical installation location identifier can be obtained, thus establishing entity correspondence. Automatic mapping of attribute matching and branch feature verification is performed after network access sorting, enabling terminal devices to not only complete logical numbering but also automatically establish a correspondence with actual physical installation locations, avoiding reliance on manual verification of construction drawings or on-site markings. By pre-establishing a branch attribute information database and comparing each item, automatic location identification can be achieved without changing the cabling structure, improving deployment efficiency and accuracy. In cases where multiple branches have the same attributes, they are distinguished by accessing terminal devices with unique identification features, ensuring the uniqueness and reliability of the mapping results.
[0059] like Figure 5 As shown, in one embodiment, a batch programming and network access sorting device for IoT devices is provided. This device can be integrated into the aforementioned cloud control device 120, and specifically may include: The network access command unit 510 is used to cause all gateway nodes in the target network to enter the network access control mode after receiving the automatic network access control command. The serial sorting unit 520 is used to convert the parallel communication topology between gateway nodes into a sequentially identifiable serial communication topology in the network access control mode, and to obtain the sorting order of each gateway node in the serial communication topology. The gateway sorting unit 530 is used to assign network addresses and logical sequence numbers to each gateway node in sequence based on the sorting order, so as to obtain a gateway sorting list. The communication recovery unit 540 is used to store the gateway sorting list and restore the communication ports of each gateway node to the parallel communication topology. The branch sorting acquisition unit 550 is used to send terminal network access instructions from each gateway node to its subordinate terminal devices, and obtain the branch sorting information of each terminal device in its respective branch link based on the response information of the terminal devices. The entity relationship correspondence unit 560 is used to obtain the device attribute information reported by the terminal device, match the device attribute information with the preset branch attribute information of the branch link, and obtain the entity correspondence between each branch link and the physical installation location based on the matching result. The mapping relationship acquisition unit 570 is used to complete the automatic network access sorting and mapping control of each IoT device based on the branch sorting information and the entity correspondence.
[0060] In the embodiments of this application, the explanation and description of the above-mentioned IoT device batch programming and network access sorting device can be referred to the explanation and description of the corresponding method above. For the description of the IoT device batch programming and network access sorting method, please refer to the above text, and it will not be repeated here.
[0061] Figure 6 An internal structural diagram of a computer device in one embodiment is shown. Specifically, this computer device may be... Figure 1 The cloud-controlled device in the middle is 120. For example... Figure 6 As shown, the computer device includes a processor, memory, network interface, input device, and display screen connected via a system bus. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores an operating system and may also store computer programs. When executed by the processor, these computer programs enable the processor to implement a method for batch programming and network access sequencing of IoT devices. The internal memory may also store computer programs, which, when executed by the processor, enable the processor to implement the same method.
[0062] Those skilled in the art will understand that Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0063] In one embodiment, the IoT device batch programming and network access sorting device provided in this application can be implemented as a computer program, which can be implemented in the form of, for example... Figure 6 The device shown operates on this device. The device's memory can store the various program modules that make up the batch programming and network access sequencing device for this IoT device, for example... Figure 5 The network access instruction unit 510, serial sorting unit 520, etc., are shown. The computer program composed of various program modules causes the processor to execute the steps in the batch programming and network access sorting methods for IoT devices in the various embodiments of this application described in this specification.
[0064] For example, Figure 4The computer device shown can be used as follows Figure 3 The network access instruction unit 510 in the batch programming and network access sorting device for IoT devices shown executes step S10. The computer device can execute step S20 via the serial sorting unit 520. And so on.
[0065] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the processor performs the steps of the batch programming and network access sorting method for IoT devices as described above.
[0066] In the embodiments of this application, please refer to the above description of the method for batch programming and network access sorting of the above-mentioned IoT devices, which will not be repeated here.
[0067] In one embodiment, a smart gateway is provided, including a memory and a processor. The memory stores a computer program, which, when executed by the processor, causes the smart gateway to act as a gateway node in the batch programming and network access sorting method for IoT devices as described above, performing automatic network access and location mapping for IoT devices.
[0068] In this embodiment, the system can be a computer hardware system that executes its corresponding methods when running. For a description of the above-mentioned method for batch programming and network access sorting of IoT devices, please refer to the preceding text; it will not be repeated here.
[0069] It should be understood that although the steps in the flowcharts of the various embodiments of this application are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in each embodiment may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least a portion of the sub-steps or stages of other steps.
[0070] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Furthermore, any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory.
[0071] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
Claims
1. A method for batch programming and network access sorting of Internet of Things (IoT) devices, characterized in that, The method includes: Upon receiving the automatic network access control command, all gateway nodes in the target network are put into network access control mode. In the network access control mode, the parallel communication topology between gateway nodes is converted into a sequentially identifiable serial communication topology, and the sorting order of each gateway node in the serial communication topology is obtained. Based on the sorting order, network addresses and logical sequence numbers are assigned to each gateway node in sequence to obtain a gateway sorting list; Store the gateway sorting list and restore the communication ports of each gateway node to the parallel communication topology; Each gateway node sends a terminal access command to its subordinate terminal devices. Based on the response information of the terminal devices, the branch ordering information of each terminal device in its respective branch link is obtained. Obtain the device attribute information reported by the terminal device, match the device attribute information with the preset branch attribute information of the branch link, and obtain the entity correspondence between each branch link and the physical installation location based on the matching result; Based on the branch sorting information and the entity correspondence, automatic network access sorting and mapping control of each IoT device is completed.
2. The method for batch programming and network access sorting of IoT devices according to claim 1, characterized in that, After receiving the automatic network access control command, the method to put all gateway nodes in the target network into network access control mode is as follows: Waiting for the management terminal to trigger the automatic network access command; After receiving the automatic network access command, the cloud server generates a network access control instruction and broadcasts it to all gateway nodes in the target network. Upon receiving the network access control command, each gateway node switches from the regular service mode to the network access control mode.
3. The method for batch programming and network access sorting of IoT devices according to claim 1, characterized in that, In the network access control mode, the method for converting the parallel communication topology between gateway nodes into a sequentially identifiable serial communication topology, and obtaining the order of each gateway node in the serial communication topology, is as follows: Control the data port forwarding status of the gateway node, stop the regular business data forwarding of each gateway node, and ensure that only the first gateway node in the target network that has a connection path with the management terminal maintains the ability to exchange network data with the management terminal. Starting from the first gateway node, a probe frame is sent to the target network to detect whether there are other unconnected gateway nodes in the target network. When a response data is received from another gateway node that has not yet been connected in the topology chain, the newly connected gateway node is placed at the tail of the connection topology queue. Continuously send probe data frames to the target network until no response data is received from the new link gateway node, thus obtaining the complete serial topology queue; Based on the serial topology queue, the sorting order of each gateway node in the serial communication topology is obtained.
4. The method for batch programming and network access sorting of IoT devices according to claim 1, characterized in that, Based on the sorting order, network addresses and logical sequence numbers are assigned to each gateway node sequentially. The method for obtaining the gateway sorting list is as follows: Set the logical sequence number of the first gateway node in the sorting order that has the unique ability to communicate with the management end to 1, and use the starting address of the preset local area network segment as the starting value of the network address of the first gateway node. After the first gateway node completes the setting of the sequence number and network address, it obtains the device identification information returned by the next-level gateway node; The logical sequence number of the next-level gateway node is incremented by 1 based on the previous gateway node, and the last digit of its network address is incremented by 1 based on the network address of the previous gateway node. Assign network addresses and logical sequence numbers to all gateway nodes, and generate a gateway sorting list.
5. The method for batch programming and network access sorting of IoT devices according to claim 1, characterized in that, The method for storing the gateway sorting list and restoring the communication ports of each gateway node to the parallel communication topology is as follows: After the network address and logical sequence number of a certain gateway node are determined, the previous sorted gateway node or management terminal sends a write instruction containing the network address and logical sequence number to the current gateway node, so that the current gateway node receives and writes the network address and logical sequence number into its local non-volatile memory for storage. After all gateway nodes have completed writing the network address and logical sequence number, the management terminal sends an exit sorting mode command to all gateway nodes. Upon receiving the exit sorting mode instruction, each gateway node re-enables the forwarding function of all data ports, restoring the communication topology between the gateway nodes from serial to parallel.
6. The method for batch programming and network access sorting of IoT devices according to claim 1, characterized in that, The method for obtaining the branch order information of each terminal device within its respective branch link by having each gateway node send a terminal access command to its subordinate terminal devices and based on the terminal devices' response information is as follows: The gateway node controls the power-on of the terminal devices of its downstream branch links; the signal input terminal of the first terminal device of the branch link is connected to the power line, and the signal input terminal of the subsequent terminal devices is connected to the signal output terminal of the previous level terminal device. When the terminal device is powered on, it outputs an initialization trigger signal to the signal input terminal of the first terminal device in the branch link, so that the first terminal device enters the response preparation state. The gateway node broadcasts a network access command, causing the terminal devices in the response preparation state to report their terminal identification information and assigning a sorting number within the branch to the terminal devices. Send a cascading trigger command to the terminal device with the assigned sorting sequence number, so that it outputs a cascading trigger signal to the signal input terminal of the next level terminal device through the signal output terminal, so that the next level terminal device enters the response preparation state; Repeat the cycle of "broadcasting network access command - receiving terminal identification information - assigning sorting number - issuing cascading trigger command" until no new terminal identification information is reported in the branch link, and obtain the branch sorting information of each terminal device in its respective branch link.
7. The method for batch programming and network access sorting of IoT devices according to claim 1, characterized in that, The method for obtaining the device attribute information reported by the terminal device, matching the device attribute information with the preset branch attribute information of the branch links, and obtaining the entity correspondence between each branch link and the physical installation location based on the matching result is as follows: Based on the engineering configuration information, a branch attribute information database corresponding to each branch link is pre-established. The branch attribute information is used to characterize the equipment type and / or parameter characteristics of the physical installation area corresponding to each branch link. The device attribute information reported by each terminal device is compared with the branch attribute information in the branch attribute information database. When the preset matching conditions are met, it is determined that the branch link to which the terminal device belongs and the corresponding physical installation location are established as an entity correspondence. When the branch attribute information of multiple branch links all meet the matching conditions with the device attribute information of the terminal device, but the entity correspondence cannot be uniquely determined, a feature terminal device with preset identification features is connected to the end of at least one of the multiple branch links. The multiple candidate branch links are distinguished by identifying the device attribute information of the feature terminal device, thereby uniquely determining the entity correspondence. After matching the device attribute information and branch attribute information of each terminal device, the entity correspondence is obtained.
8. A device for batch programming and network access sorting of Internet of Things (IoT) devices, characterized in that, The device includes: The network access command unit is used to enable all gateway nodes in the target network to enter the network access control mode after receiving the automatic network access control command. A serial sorting unit is used to convert the parallel communication topology between gateway nodes into a sequentially identifiable serial communication topology in the network access control mode, and to obtain the sorting order of each gateway node in the serial communication topology. A gateway sorting unit is used to assign network addresses and logical sequence numbers to each gateway node in sequence based on the sorting order, thereby obtaining a gateway sorting list. A communication recovery unit is used to store the gateway sorting list and restore the communication ports of each gateway node to the parallel communication topology. The branch sorting acquisition unit is used to send terminal network access instructions from each gateway node to its subordinate terminal devices, and obtain the branch sorting information of each terminal device in its respective branch link based on the response information of the terminal devices. The entity relationship correspondence unit is used to obtain the device attribute information reported by the terminal device, match the device attribute information with the preset branch attribute information of the branch link, and obtain the entity correspondence between each branch link and the physical installation location based on the matching result; The mapping relationship acquisition unit is used to complete the automatic network access sorting and mapping control of each IoT device based on the branch sorting information and the entity correspondence.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which, when executed by a processor, causes the processor to perform the steps of the method for batch programming and network access sorting of IoT devices as described in any one of claims 1 to 7.
10. A smart gateway, characterized in that, It includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the smart gateway, as a gateway node in the batch programming and network access sorting method for IoT devices as described in any one of claims 1 to 7, performs automatic network access and location mapping of IoT devices.