Equipment opening method, equipment and storage medium
By employing unicast communication and event-driven notification mechanisms in IoT devices, the network congestion and latency issues caused by multicast communication are resolved, enabling efficient parallel operation during device startup and improving startup efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHEJIANG DAHUA TECH CO LTD
- Filing Date
- 2025-12-03
- Publication Date
- 2026-04-14
AI Technical Summary
In the large-scale deployment of IoT devices, existing technologies result in low device startup efficiency, especially in smart security and smart building scenarios. Multicast communication leads to network congestion, packet loss, and latency, affecting the success rate and efficiency of device startup.
Unicast communication is used to establish a one-to-one communication link with the managed device using its link address, enabling device initialization and network configuration. This avoids conflicts and delays caused by multicast communication and improves information transmission efficiency through an event-driven notification mechanism.
It significantly improves commissioning efficiency in large-scale equipment deployments, reduces equipment contention for channel conflicts and latency, and increases the success rate and overall efficiency of equipment commissioning.
Smart Images

Figure CN121864585A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a device commissioning method, device, and storage medium. Background Technology
[0002] In the field of large-scale deployment of IoT devices, especially in scenarios such as smart security and smart buildings, device network commissioning is a core step in achieving plug-and-play and automated configuration of devices. As the number of devices grows exponentially (e.g., a single system often needs to manage thousands of devices), the efficiency requirements for device commissioning are also gradually increasing. Therefore, improving device commissioning efficiency is of great significance. Summary of the Invention
[0003] The main technical problem addressed by this application is to provide a device commissioning method, device, and storage medium that can improve the commissioning efficiency of the device.
[0004] To solve the above-mentioned technical problems, one technical solution adopted in this application is: to provide a device commissioning method, the method comprising: sending a device discovery request; receiving a response from a device to be managed in response to the device discovery request, wherein the response includes the link address of the device to be managed; and using the link address to perform unicast communication with the device to be managed to implement a preset commissioning operation of the device to be managed, wherein the preset commissioning operation includes at least one of device initialization and network configuration.
[0005] The method of using a link address to unicast communication with the device under management to implement the preset commissioning operation of the device under management includes: in response to the preset commissioning operation including device initialization, sending an initialization command to the device under management via the link address, so that the device under management performs device initialization in response to the initialization command; and / or, in response to the preset commissioning operation including network configuration, sending a network configuration command to the device under management via the link address, so that the device under management interacts with the network configuration server via unicast in response to the network configuration command to obtain network configuration information.
[0006] The network configuration command contains server information of the network configuration server, and the managed device can perform unicast interaction with the network configuration server based on the server information in the network configuration command.
[0007] The network configuration instruction includes a network configuration flag. When the network configuration flag is the first character, the device under management is instructed to directly obtain the server information in the network configuration instruction. When the network configuration flag is the second character, the device under management is instructed to probe for the network configuration server. And / or, the method further includes: before the device search phase is completed, searching for the network configuration server to obtain the server information of the network configuration server.
[0008] The network configuration instruction includes a message header and server information. The message header includes a link address, a source address, and a network configuration flag. The server information includes the address of the network configuration server. Before unicasting the network configuration instruction to the managed device via the link address, the instruction also includes setting the network configuration flag in the network configuration instruction corresponding to each managed device.
[0009] The method further includes: receiving event notifications proactively fed back by the managed device, wherein the event notifications include notifications from the managed device regarding the execution results of critical operations, and the critical operations include IP configuration and / or other network configurations.
[0010] The event notification includes the unique identifier of the managed device, the execution result information of key operations, and other event information. The other event information includes the server information of the network configuration server and at least one of the parameters maintained by the current session of the managed device.
[0011] Sending device discovery requests includes sending device discovery requests via multicast.
[0012] To address the aforementioned technical problems, another technical solution adopted in this application is: providing a device commissioning method, the method comprising: receiving a device discovery request sent by a control device; sending a response to the device discovery request to the control device, wherein the response includes the link address of the device to be managed; receiving an operation instruction unicast by the control device through the link address, and executing a preset commissioning operation corresponding to the operation instruction, wherein the preset commissioning operation includes at least one of device initialization and network configuration.
[0013] To solve the above-mentioned technical problems, another technical solution adopted in this application is: to provide an electronic device, including a memory and a processor coupled to each other, wherein the memory stores program instructions; and the processor is used to execute the program instructions stored in the memory to implement the above-mentioned method.
[0014] To solve the above-mentioned technical problems, another technical solution adopted in this application is to provide a computer-readable storage medium for storing program instructions that can be executed to implement the above-mentioned method.
[0015] The above-mentioned scheme utilizes the link address of the device to be managed to conduct unicast communication with the device to be managed, thereby realizing the preset commissioning operation of the device to be managed. Compared with the device commissioning method where each preset commissioning operation relies on multicast communication, this application can establish a one-to-one communication link with each device to be managed, which can effectively avoid conflicts, packet loss or corresponding delays caused by multiple devices competing for the channel, thereby effectively promoting the commissioning operation of each device to be managed. Especially in large-scale deployment scenarios with thousands of devices, it can significantly improve the overall commissioning efficiency. Attached Figure Description
[0016] Figure 1 This is a schematic flowchart of an embodiment of the device commissioning method provided in this application; Figure 2 This is a schematic flowchart of another embodiment of the device commissioning method provided in this application; Figure 3 This is a flowchart illustrating an embodiment of the event-driven mechanism provided in this application; Figure 4 This is a flowchart illustrating yet another embodiment of the device commissioning method provided in this application; Figure 5 This is a flowchart of another embodiment of the event-driven mechanism provided in this application; Figure 6 This is a schematic diagram of the framework of an embodiment of the electronic device provided in this application; Figure 7 This is a schematic diagram of the framework of the computer-readable storage medium provided in this application. Detailed Implementation
[0017] To make the purpose, technical solution and effects of this application clearer and more explicit, the following describes this application in further detail with reference to the accompanying drawings and embodiments.
[0018] Furthermore, if the embodiments of this application involve descriptions such as "first" or "second," these descriptions are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, features defined with "first" or "second" may explicitly or implicitly include at least one of those features. Additionally, the technical solutions of various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. If the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed in this application.
[0019] To facilitate understanding of this application, the relevant concepts involved in this application are introduced below: Device commissioning: This usually refers to a series of automated configuration and initialization operations performed on devices (such as network switches, routers, cameras, etc.) after they are first started and connected to the network in a network environment.
[0020] Device initialization: This involves completing the configuration of device user information and other related information. After the managed device leaves the factory, user information needs to be configured before network services and other functions can be configured. Device initialization can be understood as the process from the start of device initialization to the device obtaining an IP address, which makes the device usable.
[0021] Dynamic Host Configuration Protocol (DHCP) is a network protocol used to automatically assign IP addresses and other network configuration parameters in an IP network. It includes DHCP discovery, DHCP offer, DHCP request, and DHCP confirmation.
[0022] Device discovery / discovery refers to the process of automatically identifying and locating available devices in a computer network using specific protocols and methods, often employing multicast. The purpose of device discovery is to enable newly joined devices to find other devices and services, thereby achieving interconnection and communication. This process typically occurs during device startup or when a device needs to interact with other components in the network.
[0023] IPv4: The fourth version of the Internet Protocol, widely used for network communication and data exchange. It is one of the fundamental protocols of the Internet, responsible for transmitting data packets between different computers. It uses 32-bit addresses, allowing approximately 4.2 billion unique IP addresses.
[0024] IPv6: The sixth version of the Internet Protocol, designed to address the IPv4 address shortage. IPv6 addresses are 128 bits long, providing virtually unlimited address space to accommodate the explosive growth in demand from the Internet of Things and mobile devices.
[0025] Link address: In a computer network, a link address is used to uniquely identify devices within the same local area network (LAN). Link addresses typically reside at the link layer (Layer 2) of network protocols and are responsible for device identification and communication on the physical network. Most devices generate their link addresses using the EUI-64 algorithm based on their MAC addresses.
[0026] Unicast: A point-to-point communication method in which a data stream is sent to only one specific receiver. Whenever a data packet is sent from the source address, only one destination address (the receiver) receives the data packet.
[0027] Multicast: A point-to-multipoint communication method in which a data stream is sent to a specific group of receivers, rather than a single receiver. The sender sends data packets to a multicast address, and all receivers subscribed to that multicast address can receive the data.
[0028] The device commissioning method provided in this application is applicable to the rapid commissioning and deployment of IoT devices such as large-scale monitoring and smart buildings.
[0029] It's important to note that current network device deployment relies heavily on multicast communication in key steps such as device discovery, device initialization, enabling DHCP, and status confirmation. For example, during device (managed device) initialization, encrypted negotiation messages and user information configuration transmission messages are sent via multicast. Enabling DHCP also requires negotiation of multiple multicast messages, with each device triggering 5-10 multicast interactions. When more than 50 devices are connected concurrently, multicast messages account for over 80% of the total, leading to a sharp increase in average switching latency and packet loss rate, resulting in a significant spike in network deployment failure rate. Furthermore, if too many devices simultaneously enable DHCP during deployment, the surge in instantaneous broadcast messages will also cause a significant increase in latency. Finally, the control device needs to send multicast probe messages to detect whether the device's DHCP is successful and wait for the device's response. In order to detect the device's IP change, the control device also needs to send multicast probe messages periodically, which greatly increases the device startup time and reduces the device startup performance. The multicast flooding problem also greatly limits the startup capability of the existing solution, which can only process 5-10 devices per batch and has to wait for the last one to complete before continuing to the next batch, which is extremely inefficient.
[0030] As can be seen, the current solution relies on multicast messages to complete device discovery and address allocation. When the number of devices surges, multicast storms cause network congestion and message loss, which seriously reduces the configuration success rate. At the same time, the serialized configuration process requires multiple stages such as "device search, DHCP wait, IP modification, and session configuration", which increases the time consumption per device. This results in low deployment efficiency in a cluster of thousands of devices, which seriously restricts the efficiency of business launch.
[0031] To improve the efficiency of device deployment, this application, upon discovering a device to be managed, utilizes the link address responded by the managed device to conduct unicast communication with it during device initialization and / or network configuration. Unicast is a "one sender, one receiver" communication mode. The control device establishes an independent one-to-one communication link through the link address of the managed device (such as a MAC address or IPv6 link address), enabling parallel configuration of multiple devices: the control device can simultaneously send commands to different managed devices (e.g., sending a DHCP configuration command to device A while simultaneously sending an initialization command to device B; the communication links of the two are completely isolated and do not consume resources). The stage execution status of each device (such as whether DHCP is completed) is fed back to the management device only through its own unicast link. The control device can track the progress of different devices separately through multithreading / multiprocessing, without waiting for one device to complete before processing another, completely breaking the synchronization dependency of multicast and realizing the parallelization of multi-device configuration.
[0032] Please see Figure 1 , Figure 1This is a schematic flowchart of an embodiment of the device commissioning method provided in this application. It should be noted that if substantially the same result is achieved, this embodiment does not necessarily reflect that outcome. Figure 1 The illustrated process sequence is limited. For example... Figure 1 As shown, this embodiment includes: S11: Send a device discovery request.
[0033] The method in this embodiment is executed by a control device, such as a management platform or controller, or the device where the APP is located.
[0034] This step is to discover devices to be managed. In this embodiment, to quickly locate all devices to be managed in the network, a device discovery request can be sent via multicast. Multicast can cover all online devices at once, avoiding redundant communication of unicasting to unknown devices one by one, which is suitable for the need to quickly locate all devices to be managed; devices to be managed include, for example, cameras, sensors, and other devices that need to be configured.
[0035] S12: Receive the response from the managed device to the device discovery request, wherein the response contains the link address of the managed device.
[0036] After receiving a device discovery request, the managed device will return a response to the device discovery request to the control device. This response contains the link address of the managed device. Subsequently, unicast communication can be carried out with the managed device through the link address of the managed device.
[0037] There are multiple devices to be managed. Each device to be managed that receives a device discovery request will respond to the control device with a response containing its link address.
[0038] S13: Use the link address to perform unicast communication with the device under management to realize the preset start-up operation of the device under management, wherein the preset start-up operation includes at least one of device initialization and network configuration.
[0039] In other words, at least one of the initialization operations in the device initialization and network configuration in this embodiment is implemented by using the link address to communicate with the device to be managed via unicast.
[0040] In one implementation scenario, the link address of each managed device can be used to perform unicast communication with the corresponding managed device to achieve device initialization of the managed device.
[0041] In short, the control device uses the link address of the device under management to communicate with the device under management via unicast in order to interact and complete the configuration of information such as the username of the device under management.
[0042] Specifically, for each device to be managed, the control device sends an initialization command (or initialization request) to the device through the specified link address of the device to be managed, so that the device to be managed can respond to the initialization command to perform device initialization and obtain user information and other related configurations for initialization settings.
[0043] In another implementation scenario, after obtaining the link addresses of each managed device, unicast communication can be performed between the managed devices using the link addresses of each managed device to achieve network configuration of the managed devices.
[0044] In one embodiment, to implement network configuration for a device under management, it is necessary to determine a corresponding network configuration server so that the device under management can obtain the corresponding network configuration information by interacting with the determined network configuration server; for example, the device under management can obtain the IP address determined by the network configuration server, and the subsequent control device can determine which device corresponds to the IP address through the IP address.
[0045] In addition, the control device acts as the manager of the devices under management, which depends on its ability to access the network (e.g., to communicate with the devices under management and access the upper-level management system). To access the network, the control device needs an IP address, and it must rely on a network configuration server (e.g., a DHCP server) to dynamically obtain an IP address. Therefore, the control device also needs to identify the corresponding network configuration server to obtain its own IP address and other configuration information, ensuring that it can be found on the network and initiate management communication.
[0046] In a traditional setup, taking a DHCP server as an example, both the control device and the managed device act as independent DHCP clients. They need to independently send DHCP Discover broadcast messages to discover DHCP servers in the network through the standard DHCP process to obtain their own IP addresses and other information. The DHCP discovery processes of the two devices are completely parallel and independent of each other: the control device does not actively inform the managed device where DHCP servers are located, and the managed device does not query the control device, but instead repeatedly performs the same DHCP discovery operation.
[0047] In traditional technologies, the control device and the managed device are independent DHCP clients that perform DHCP server discovery. This results in a large number of redundant DHCP Discover broadcast messages in the network (especially when the number of managed devices is large), which is one of the important reasons for the low efficiency of device deployment.
[0048] In view of this, in order to further improve the commissioning efficiency of a large number of devices, the following measures were taken: Before the control device discovers the device to be managed (completed in the device search phase), the network configuration server is searched to obtain the server information of the network configuration server, and the server information of the network configuration server found is sent to the device to be managed via unicast using the link address responded by the device to be managed.
[0049] Specifically, before the control device discovers the device to be managed, it can determine whether it currently stores the latest network configuration server information. If so, during the device DHCP enabling phase after discovering the device to be managed, it can use the link address responded by the device to unicast the server information of the network configuration server it stores. If it determines that it does not currently store the latest network configuration server information, it can use relevant protocols to obtain the server information of the network configuration server and store it. During the device DHCP enabling phase after discovering the device to be managed, it can use the link address responded by the device to unicast the obtained server information of the network configuration server it stores. For example, the control device can use the DHCP protocol to obtain the server information of the DHCP server.
[0050] The server information includes at least the server address, and may also include other network configuration information such as lease period parameters and network options.
[0051] In one embodiment, during the DHCP enabling phase of the device, the control device needs to send network configuration commands to the managed device. In this embodiment, the server information of the network configuration server to be sent by the control device to the managed device can be set in the network configuration command. After obtaining the link address of the managed device's response, the control device unicasts the corresponding network configuration command to the managed device through the link address, so that the managed device can subsequently perform unicast interaction with the network configuration server based on the network configuration command to obtain the network configuration information configured for it by the network configuration server. In this method, the network configuration server used by the managed device is the network configuration server corresponding to the server information provided by the control device.
[0052] In addition, it should be noted that in some scenarios, the number of devices to be managed by the control device is very large. The upper limit of the number of IP addresses that the network configuration server can allocate may be less than the total number of devices to be managed. That is, the number of IP addresses that the network configuration server can allocate may not be sufficient to allow all devices to be managed to share the same network configuration server with the control device.
[0053] Considering this, before sending the corresponding network configuration command, such as when discovering a device to be managed, the control device can first determine whether its acquired or stored network configuration server has a sufficient number of allocable IP addresses. If so, the network configuration command can be configured to include the server information corresponding to the network configuration server, so that the device to be managed can directly use the server information in the network configuration server to perform unicast interaction with the corresponding network configuration server. If not, the control device can decide which devices to be managed can directly use the server information in the network configuration server, and which devices to be managed need to discover the network configuration server themselves.
[0054] In addition, to enable each managed device to distinguish whether to directly use the network configuration server information sent by the control device or to probe the network configuration server itself, the control device can pre-set an indicator character corresponding to the network configuration flag in the network configuration command before sending the corresponding network configuration command to the managed devices, based on the number of IP addresses that can be allocated by the network configuration server and the number of managed devices. This allows each managed device to determine whether to directly use the network configuration server information sent by the control device or to probe the network configuration server itself based on the indicator character of the network configuration flag in the received network configuration command.
[0055] In simple terms, before the control device unicasts network configuration commands to the managed devices via link addresses, it needs to set the network configuration flag bit in the network configuration command corresponding to each managed device based on the number of IP addresses that can be allocated by the network configuration server and the number of managed devices.
[0056] In the network configuration command for each managed device, the network configuration flag is either a first character or a second character. The first character indicates that the managed device can directly obtain the server information in the network configuration command and use this information to unicast with the corresponding network configuration server to obtain the corresponding network configuration information. The second character indicates that the managed device needs to perform its own network configuration server probe. The first and second characters can be numbers (e.g., 0 and 1 respectively) or letters (e.g., Y and N respectively).
[0057] In one specific embodiment, the network configuration instruction sent by the control device to the managed device includes a header and server information of the network configuration server it is searching for. The header includes the link address of the managed device, the source address of the control device, and a network configuration flag. Upon receiving the network configuration instruction, the managed device extracts the network configuration flag and, based on the characters corresponding to the flag, determines whether to directly use the server information of the network configuration server sent by the control device or to probe for the network configuration server itself.
[0058] In one implementation scenario, the network configuration command sent by the control device is, for example, a DHCP command, the network configuration server is, for example, a DHCP server, and the network configuration information obtained is, for example, an IP address and other network configuration information, such as subnet mask, gateway, DNS server, IP lease period, etc.
[0059] The above-mentioned scheme utilizes the link address of the device to be managed to conduct unicast communication with the device to be managed, thereby realizing the preset commissioning operation of the device to be managed. Compared with the device commissioning method where each preset commissioning operation relies on multicast communication, this application can establish a one-to-one communication link with each device to be managed, which can effectively avoid conflicts, packet loss or corresponding delays caused by multiple devices competing for the channel, thereby effectively promoting the commissioning operation of each device to be managed. Especially in large-scale deployment scenarios with thousands of devices, it can significantly improve the overall commissioning efficiency.
[0060] In some embodiments, considering that during the traditional device commissioning process, the update of the network configuration of the managed device often relies on a probing mechanism, that is, the control device needs to periodically query the network configuration status of the managed device. This not only wastes bandwidth resources, but also leads to a longer response time and affects the user experience.
[0061] To address this issue, managed devices are configured to proactively report their status changes to the control device after completing DHCP or other network configurations, thereby improving the efficiency of information transmission.
[0062] For example, after the managed device completes critical operations (such as IP settings and / or other network configurations), the managed device does not need to wait for the control device's probe request, but instead actively feeds back its current status to the control device via unicast.
[0063] When a managed device completes any critical operation (such as obtaining an IP address via DHCP or modifying network configuration), it first checks its state within its internal state machine. Once the managed device successfully obtains an IP address or completes other network configurations after enabling DHCP, it marks its current state as "configured." When DHCP is successfully completed, the managed device generates a notification to the control device, informing it that the DHCP service is complete, along with the new IP address and network parameters. If any problems occur during the configuration process (such as DHCP timeout or IP address conflicts), the managed device can also immediately send an error notification so that the control device can intervene promptly and resolve the issue.
[0064] As can be understood from the above, the managed device will proactively report the execution results of its critical operations to the control device (which can be called event notification). The critical operations include IP configuration and / or other critical network configurations.
[0065] For control devices, instead of periodically probing the network configuration status of managed devices, they directly receive the aforementioned event notifications proactively fed back by the managed devices. These event notifications include the results of the managed devices' execution of critical operations, and may also include other information.
[0066] In one specific embodiment, the event notification proactively fed back by the managed device includes the managed device's unique identifier (such as a MAC address), execution result information of key operations (such as DHCP success or IP configuration failure), and other event information. The other event information includes at least one of the following: server information of the network configuration server (such as the assigned IP address, subnet mask, gateway, etc.) and various parameters maintained by the managed device's current session (such as version detection, time synchronization, etc.).
[0067] In one embodiment, the device to be managed can use unicast to send event notifications back to the control device to improve information flow efficiency and further improve startup efficiency.
[0068] Please see Figure 2 , Figure 2 This is a flowchart illustrating another embodiment of the device commissioning method provided in this application. The device commissioning method provided in this embodiment is executed by the device to be managed, and the method includes: S21: Receive a device discovery request sent by the control device.
[0069] Please refer to the relevant description in step S11 for details.
[0070] S22: Send a response to the device discovery request to the control device, wherein the response contains the link address of the device to be managed.
[0071] Please refer to the relevant description in step S12 for details.
[0072] S23: Receive the operation command sent by the control device via unicast through the link address, and execute the preset initialization operation corresponding to the operation command, wherein the preset initialization operation includes at least one of device initialization and network configuration.
[0073] Please refer to the relevant description in step S13 for details.
[0074] It should be noted that if the operation command sent by the control device via unicast through the link address is a network configuration command containing server information of the network configuration server, then the device can unicast with the network configuration server based on the server information in the network configuration command to obtain network configuration information.
[0075] In one embodiment, the network configuration instruction further includes a network configuration flag. When the network configuration flag is the first character, the managed device directly obtains the server information in the network configuration instruction; when the network configuration flag is the second character, the managed device probes the network configuration server.
[0076] In some embodiments, when the managed device receives the execution result of a critical operation, it can supplement the execution result of the critical operation into the event notification and actively feed back the event notification to the control device. The critical operation includes IP configuration and / or other network configuration during the network configuration process.
[0077] To facilitate understanding of the above-mentioned equipment commissioning method provided in this application, the ideas and logic of the equipment commissioning method provided in this application are explained below: First, the overall process of device (managed device) commissioning generally includes key steps such as device discovery, device initialization, enabling device DHCP function, and status confirmation. In the traditional method, these key steps all rely on multicast communication, which leads to multicast flooding throughout the commissioning process and greatly limits the commissioning capability of the device.
[0078] To address the limitation on initial setup caused by the proliferation of multicast, this application proposes to conduct multicast communication only during the device discovery phase, while using unicast communication for other initial setup phases (such as device initialization, enabling device DHCP function, status confirmation, etc.).
[0079] For example, during the device discovery phase, the control device sends a device discovery request to multiple managed devices via multicast. Upon receiving the request, each managed device responds (with its link address), thus being discovered by the control device. After discovery, the control device constructs an address table containing the link addresses of each managed device. Then, it uses these link addresses to communicate unicastly with the managed devices, enabling subsequent device initialization and network configuration. Specifically, after device initialization begins, the control device can use the link address to establish a unicast communication channel with the managed devices. Based on this channel, the control device logs into the managed device using the user information configured during the initialization phase and issues a command to enable DHCP. After the managed device executes the command and enables DHCP, it replies to the control device via the same unicast channel. Subsequently, the control device can also use this link address to communicate unicastly with the managed devices to achieve detailed network configuration.
[0080] Furthermore, considering that in traditional solutions, both the managed device and the control device need to independently discover the DHCP server, which further impacts the initial setup efficiency, this application proposes integrating the traditionally independent process of the managed device discovering the DHCP server with the control device to address this issue. Specifically, before completing the device discovery phase, the control device first searches for the DHCP server (either by checking if it has a stored list of available DHCP servers or by finding one via the DHCP protocol) to obtain the DHCP server information. Then, after device initialization, it unicasts the DHCP server information to the managed device via a link address. This eliminates the need for the managed device to multicast discover the DHCP server; it can directly use the DHCP server information sent by the control device to connect to the DHCP server and interact with it via unicast to obtain an IP address and other network configuration information. In other words, in this approach, only the control device performs the DHCP server discovery process; the managed device does not need to perform the DHCP server discovery itself.
[0081] The above method is applicable when the number of devices to be managed is less than or equal to the number of IPs that the DHCP server can assign. However, in scenarios where the number of devices to be managed is greater than the number of IPs that the DHCP server can assign, some devices still need to perform DHCP server discovery / probing.
[0082] In the process of unicast communication between the managed device and the managed device using the link address to configure the network, the control device needs to send network configuration commands to the managed device via unicast through the link address. To help the managed device know whether it needs to perform DHCP server detection, a network configuration flag, such as the D flag (DHCP detection flag), can be added to the network configuration command sent by the control device via unicast through the link address. It is specified that when the flag is 1, it means that the managed device needs to discover / detect the DHCP server itself, and when the flag is 0, it means that the managed device does not need to discover / detect the DHCP server itself and can directly use the server information of the DHCP server found by the control device carried in the network configuration command.
[0083] In one specific embodiment, the unicast network configuration instruction includes a header and server information of the DHCP server found by the control device. The header includes the link address of the device to be managed, the source address of the control device, and network configuration flags.
[0084] Furthermore, considering that in traditional equipment deployment schemes, the update of network configuration of managed devices often relies on a detection mechanism, that is, the control device needs to periodically query the status of managed devices. This method not only wastes bandwidth resources, but also leads to a longer response time, affecting the user experience.
[0085] To address this issue, this application proposes an event-driven notification mechanism, advocating that managed devices proactively report their state changes to the control device after completing DHCP or other network configurations, thereby improving the efficiency of information transmission. Specifically, the reporting of state changes to the control device can be achieved via unicast.
[0086] The event-driven notification mechanism emphasizes relying on events to trigger responses. For an example, please refer to... Figure 3 , Figure 3 This is a flowchart illustrating an embodiment of the event-driven mechanism provided in this application. After the managed device completes a critical operation (such as DHCP configuration, IP setting, etc.), the managed device no longer needs to wait for a request from the control device, but instead proactively notifies the management system (which can be understood as the control device) of its current status via unicast. Please refer to the following documentation. Figure 5 , Figure 5 This is a flowchart of another embodiment of the event-driven mechanism provided in this application, such as... Figure 5 As shown, the main process of the event-driven mechanism is as follows: Identification of status changes of managed devices: When a managed device completes any critical operation (such as obtaining an address via DHCP, modifying network configuration, etc.), it will first perform a status check in its internal state machine to determine the operation status of the critical operation. If the device successfully obtains an IP address via DHCP or completes other network configurations, it will mark the current device status as configured; otherwise, it will mark the current device status as failed and record the error type.
[0087] Active notification trigger conditions: When DHCP completes successfully, the managed device will generate a notification informing the control device that the DHCP service has been completed and includes a new IP address and network parameters. If any problems occur during the configuration process (such as DHCP timeout, IP address conflict, etc.), the managed device should also be able to immediately send an error notification so that the management system can intervene and resolve the issue promptly.
[0088] The structure and content of the notification message: When actively notifying, the managed device will construct a formatted message packet, which includes at least the following: the unique identifier of the managed device (such as MAC address), current status information (such as DHCP success or IP configuration failure), DHCP server information (such as the assigned IP address, subnet mask, gateway, etc.), various parameters maintained by the device in the current session (such as version detection, time synchronization, etc.), error details, etc.
[0089] In the process of proactive notification, the device to be managed uses unicast to push the message directly to the control device.
[0090] Furthermore, it should be noted that current equipment commissioning generally adopts a serial process, where all devices to be managed are processed one by one according to a preset list. Only after the previous device completes all configuration tasks will the management system (the system where the control device is located) start the commissioning process for the next device. Even if a small number of devices can be commissioned concurrently, the concurrency is relatively small. This application adopts a unicast method based on link addresses, which reduces the amount of network packets and greatly increases the number of devices commissioned at one time. At the same time, this application can adopt a pipeline commissioning method, where after the previous batch of devices completes initialization, it enters the IP acquisition stage (i.e., the network configuration stage), and the next batch continues the initialization stage.
[0091] In one specific embodiment, reference may be made to Figure 4 , Figure 4 This is a flowchart illustrating yet another embodiment of the device commissioning method provided in this application. Figure 4 As shown, the device on the left refers to the managed device to be commissioned, and the APP controller refers to the control device. Figure 4As shown, the control device discovers devices via multicast. The managed device responds with a device discovery message and then communicates with the managed device via unicast based on the link address contained in the response. It sends initialization commands and unicasts DHCP server information using the link address contained in the response. The managed device replies with the DHCP execution status based on the execution results of the key operations, and then the control device performs the relevant configuration.
[0092] Figure 6 This is a schematic diagram of a framework of an embodiment of the electronic device provided in this application. In this embodiment, the electronic device 60 includes a memory 61 and a processor 62 coupled to each other.
[0093] The memory 61 stores program instructions, and the processor 62 executes the program instructions stored in the memory 61 to implement the steps of any of the above-described method implementations. In a specific implementation scenario, the electronic device 60 may include, but is not limited to, a microcomputer or a server. In addition, the electronic device 60 may also include mobile devices such as laptops and tablets, which are not limited here.
[0094] Specifically, processor 62 controls itself and memory 61 to implement the steps of any of the above embodiments. Processor 62 may also be referred to as a CPU (Central Processing Unit). Processor 62 may be an integrated circuit chip with signal processing capabilities. Processor 62 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor may be a microprocessor or any conventional processor. Furthermore, processor 62 may be implemented using integrated circuit chips.
[0095] Please see Figure 7 , Figure 7This is a schematic diagram of the framework of the computer-readable storage medium provided in this application. The computer-readable storage medium 70 of this application embodiment stores program instructions 71, which, when executed, implement the methods provided in any embodiment or any non-conflicting combination of the above-described methods. The program instructions 71 can form a program file and be stored in the computer-readable storage medium 70 in the form of a software product, so that a computer device (which may be a personal computer, server, or network device, etc.) can execute all or part of the steps of the methods of various embodiments of this application. The aforementioned computer-readable storage medium 70 includes various media capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, or terminal devices such as computers, servers, mobile phones, and tablets.
[0096] The above-mentioned scheme utilizes the link address of the device to be managed to conduct unicast communication with the device to be managed, thereby realizing the preset commissioning operation of the device to be managed. Compared with the device commissioning method where each preset commissioning operation relies on multicast communication, this application can establish a one-to-one communication link with each device to be managed, which can effectively avoid conflicts, packet loss or corresponding delays caused by multiple devices competing for the channel, thereby effectively promoting the commissioning operation of each device to be managed. Especially in large-scale deployment scenarios with thousands of devices, it can significantly improve the overall commissioning efficiency.
[0097] In some embodiments, the functions or modules of the apparatus provided in this disclosure can be used to perform the methods described in the above method embodiments. The specific implementation can be referred to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.
[0098] The description of the various embodiments above tends to emphasize the differences between the various embodiments. The similarities or similarities between them can be referred to, and for the sake of brevity, they will not be repeated here.
[0099] In the several embodiments provided in this application, it should be understood that the disclosed methods and apparatus can be implemented in other ways. For example, the apparatus implementations described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0100] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0101] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0102] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods of various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0103] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A method for commissioning equipment, characterized in that, include: Send a device discovery request; Receive a response from the managed device in response to the device discovery request, wherein the response contains the link address of the managed device; The link address is used to perform unicast communication with the device under management to realize the preset initialization operation of the device under management, wherein the preset initialization operation includes at least one of device initialization and network configuration.
2. The method according to claim 1, characterized in that, The step of using the link address to perform unicast communication with the device under management to realize the preset initial operation of the device under management includes: In response to the preset initialization operation including the device initialization, an initialization command is unicasted to the managed device via the link address, so that the managed device performs device initialization in response to the initialization command; and / or, In response to the preset initial setup operation including network configuration, a network configuration command is unicasted to the managed device via the link address, so that the managed device responds to the network configuration command and performs unicast interaction with the network configuration server to obtain network configuration information.
3. The method according to claim 2, characterized in that, The network configuration instruction contains server information of the network configuration server, and the managed device can perform unicast interaction with the network configuration server based on the server information in the network configuration instruction.
4. The method according to claim 3, characterized in that, The network configuration instruction includes a network configuration flag. When the network configuration flag is the first character, it instructs the managed device to directly obtain the server information in the network configuration instruction. When the network configuration flag is set to the second character, the managed device is instructed to probe the network configuration server. And / or, the method further includes: Before the device search phase is completed, the network configuration server is located to obtain its server information.
5. The method according to claim 4, characterized in that, The network configuration instruction includes a header and the server information. The header includes the link address, source address, and network configuration flags. And / or, the server information includes the address of the network configuration server; And / or, before sending the network configuration command via unicast to the managed device through the link address, the method further includes: Configure the network configuration flag bit in the network configuration instruction corresponding to each of the managed devices.
6. The method according to claim 1, characterized in that, The method further includes: Receive event notifications proactively fed back by the managed device, wherein the event notifications include notifications from the managed device regarding the execution results of critical operations, the critical operations including IP configuration and / or other network configurations.
7. The method according to claim 6, characterized in that, The event notification includes the unique identifier of the managed device, the execution result information of the key operation, and other event information. The other event information includes server information of the network configuration server and at least one of the parameters maintained by the current session of the managed device.
8. The method according to claim 1, characterized in that, The sending device discovery request includes: Send device discovery requests via multicast.
9. A method for commissioning equipment, characterized in that, include: Receive device discovery requests sent by the control device; Send a response to the device discovery request to the control device, wherein the response contains the link address of the device to be managed; The system receives an operation command sent by the control device via unicast through the link address and executes a preset initialization operation corresponding to the operation command, wherein the preset initialization operation includes at least one of device initialization and network configuration.
10. The method according to claim 9, characterized in that, The step of receiving the operation command sent by the control device via unicast through the link address and executing the preset commissioning operation corresponding to the operation command includes: In response to the operation instruction including a network configuration instruction containing server information of a network configuration server, a unicast interaction is performed with the network configuration server based on the server information in the network configuration instruction to obtain network configuration information.
11. The method according to claim 10, characterized in that, The network configuration instruction also includes a network configuration flag. When the network configuration flag is the first character, the managed device directly obtains the server information in the network configuration instruction. When the network configuration flag is set to the second character, the managed device will probe the network configuration server.
12. The method according to claim 9, characterized in that, The method further includes: Actively send event notifications to the control device, wherein the event notifications include notifications of the execution results of key operations by the managed device, and the key operations include IP configuration and / or other network configurations.
13. An electronic device, characterized in that, Including interconnected memory and processor, The memory stores program instructions; The processor is used to execute program instructions stored in the memory to implement the method according to any one of claims 1-12.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores program instructions that can be executed by a processor to implement the method of any one of claims 1-12.