Equipment networking method, equipment, system and medium in complex network environment

By enabling the device to self-determine the DHCP server role, broadcast configuration requests, and interact with LLDP packets, it solves the cumbersome configuration and stability issues of smart conference device networking in complex network environments, and achieves fast and stable network connections.

CN120750837APending Publication Date: 2025-10-03YEALINK (XIAMEN) NETWORK TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510900141.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-01
Publication Date
2025-10-03

AI Technical Summary

Technical Problem

In a complex network environment, traditional smart conference equipment networking methods have problems such as cumbersome configuration, prone to errors, IP address conflicts and instability. Especially when multiple devices are started at the same time, network communication interruptions and increased management complexity are caused.

Method used

The device can determine whether it is acting as a DHCP server, broadcast address configuration requests, generate and exchange LLDP packets, dynamically delay receiving IP addresses, optimize role allocation and topology identification, avoid address conflicts, and ensure uniqueness and stability.

Benefits of technology

It improves the device networking efficiency in complex network environments, ensures network stability and reliability, and avoids networking failures caused by unclear roles, IP address conflicts, and DHCP server response delays.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120750837A_ABST
    Figure CN120750837A_ABST
Patent Text Reader

Abstract

The invention discloses an equipment networking method, equipment, a system and a medium in a complex network environment. The method comprises the following steps: judging whether a local machine serves as a DHCP (Dynamic Host Configuration Protocol) server in a network or not; if not, an address configuration request is broadcasted to the network, so that an allocation address of a DHCP server in the current network is received within a preset time threshold value, and a local LLDP message is generated to be broadcasted to neighbor equipment in the current network; receiving a neighbor LLDP message sent by the neighbor equipment, analyzing the neighbor LLDP message to obtain a second identifier of the neighbor equipment, and judging whether the neighbor equipment serves as a DHCP server or not based on the second identifier; and if the neighbor equipment serves as a DHCP server, delaying a preset time threshold value of the local machine so as to ensure that the local machine sets the allocation address as a target protocol address of the local machine and sets the first candidate address as invalid within the delayed preset time threshold value. According to the invention, the networking efficiency in a complex network environment can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of network configuration, and in particular to a device networking method, device, system and medium in a complex network environment. Background Art

[0002] Efficient network configuration is crucial in intelligent conferencing systems, as the proper functioning of intelligent conferencing equipment relies heavily on stable, fast network connections. Network configuration ensures that devices can communicate with each other, share resources, access the internet, and support the operation of various applications and services. A good and fast network configuration improves meeting efficiency, reduces interruptions or delays caused by network issues, and ensures smooth meetings.

[0003] Currently, the networking of smart conferencing equipment mainly relies on traditional network configuration methods. Typical traditional methods include manual configuration and automatic IP address allocation using a DHCP server. However, these methods all have drawbacks. Manual configuration requires the user to enter information such as the IP address, subnet mask, default gateway, and DNS server. This configuration process is cumbersome and prone to errors. Moreover, when there are a large number of devices, the workload and complexity increase significantly. While the automatic allocation of IP addresses by DHCP servers solves the tedious problem of manual configuration, it still has some drawbacks in complex network environments. For example, if the order in which device services are started is uncertain, IP address hopping may occur. That is, the IP address of a device may change at different times, leading to communication interruptions between devices and affecting the stability and reliability of the service. In addition, when there are multiple DHCP servers in the network environment, IP address allocation may become chaotic, further increasing the complexity of network management and the difficulty of maintenance. Summary of the Invention

[0004] The present invention provides a device networking method, device, system and medium in a complex network environment, which can improve the efficiency of networking in a complex network environment and ensure the stability of the network.

[0005] An embodiment of the present invention provides a method for networking devices in a complex network environment, including:

[0006] Determining whether the local machine serves as a DHCP server in the network according to the first identifier configured on the local machine;

[0007] If not, broadcast an address configuration request to the network to receive an address assigned by a DHCP server in the current network within a preset time threshold, and generate a local LLDP message to broadcast to neighboring devices in the current network, wherein the local LLDP message includes the first identifier and the first candidate address of the local device;

[0008] Receiving a neighbor LLDP message sent by a neighboring device, parsing the neighbor LLDP message to obtain a second identifier of the neighboring device, and determining whether the neighboring device acts as a DHCP server based on the second identifier;

[0009] If the neighboring device acts as a DHCP server, the preset time threshold of the local device is delayed to ensure that the local device sets the allocated address to the target protocol address of the local device within the preset time threshold after the delay, and sets the first candidate address to invalid.

[0010] In the embodiments of the present invention, by checking the first identifier, the local device can quickly determine its role in the network and quickly enter the corresponding configuration process, avoiding confusion and conflicts between devices due to unclear roles. By broadcasting an address configuration request, the local device actively requests an IP address from the DHCP server, ensuring that a valid IP address is obtained within a preset time. Simultaneously, the LLDP message is generated and broadcast, helping neighboring devices quickly identify and exchange information, thereby enhancing network stability and inter-device communication efficiency. Through message interaction, the local device can obtain the identifier and candidate IP address of the neighboring device, thereby determining whether the neighboring device is a DHCP server. This helps the device understand the network topology and the role of the neighboring device, avoid IP address conflicts, and ensure that the DHCP server role in the network is unique, thereby improving network stability and reliability. By delaying for a preset time threshold, sufficient time is ensured to receive the IP address assigned by the DHCP server, avoiding network failures caused by delayed DHCP server responses, ensuring that the device can correctly obtain an IP address, and improving network stability and reliability. Simultaneously, the first candidate address is set to invalid, avoiding address conflicts. Compared with the prior art, the present application can improve networking efficiency in complex network environments and ensure network stability.

[0011] Furthermore, the determining whether the local device acts as a DHCP server in the network further includes:

[0012] Acquire its own configuration information, wherein the configuration information includes a first identifier and a device external connection status;

[0013] If the first identifier is true or the device external status is valid, it is determined that the local device acts as a DHCP server in the network.

[0014] In this way, the device determines whether to act as a DHCP server by obtaining its configuration information. This process optimizes the role allocation of devices in the network, avoids unnecessary DHCP server conflicts, thereby improving the efficiency of device networking in complex network environments and ensuring network stability.

[0015] Furthermore, after determining whether the local device serves as a DHCP server in the network, the method further includes:

[0016] If the machine acts as a DHCP server, it will detect whether there are other DHCP servers in the network;

[0017] If it exists, modify its own first identifier to false so as not to act as a DHCP server;

[0018] If it does not exist, the local device acts as a DHCP server in the network, sets the first candidate address as the target protocol address of the local device, obtains the configuration file, and sends the allocated address preset in the configuration file to the neighboring device in the network.

[0019] In this way, by detecting whether there are other DHCP servers in the network, IP address conflicts and confusion caused by the coexistence of multiple DHCP servers are avoided, ensuring the uniqueness and stability of the network configuration; if this machine acts as a DHCP server, it can actively generate and assign addresses to other devices in the network, quickly complete network configuration, and improve networking efficiency.

[0020] Furthermore, the neighbor LLDP message includes the second candidate address, and after determining whether the local device acts as a DHCP server in the network, the method further includes:

[0021] When the local device does not act as a DHCP server, determine whether the neighboring device acts as a DHCP server;

[0022] If yes, and the second candidate address obtained by parsing conflicts with the first candidate address of the local machine, a third candidate address that does not conflict with the second candidate address is generated, and the third candidate address replaces the first candidate address in the local machine LLDP message.

[0023] In this way, when the neighboring device does not act as a DHCP server and there is an address conflict, a new valid candidate address is autonomously generated and the relevant information in the LLDP message is updated, thereby ensuring the accuracy of network configuration and the stability of network communication.

[0024] Further, after replacing the first candidate address in the local LLDP message with the third candidate address, the method further includes:

[0025] If the address allocated by the DHCP server is not received within the preset time threshold, the third candidate address is set as the target protocol address of the local device.

[0026] This mechanism improves the device's adaptability and reliability in complex network environments, enhancing the stability of network services.

[0027] Furthermore, after determining whether the local device serves as a DHCP server in the network, the method further includes:

[0028] If the local device does not act as a DHCP server and does not receive an address allocated by the DHCP server within the preset time threshold, the first candidate address is set as the target protocol address.

[0029] This ensures that the local device can configure its own network address in a timely manner, quickly join the network and communicate even in a complex network environment where there is no DHCP server or the DHCP server responds too slowly, avoiding networking delays or failures caused by waiting for the DHCP server to respond.

[0030] Furthermore, after determining whether the local device serves as a DHCP server in the network, the method further includes:

[0031] If the local device does not act as a DHCP server and the neighboring device does not act as a DHCP server;

[0032] Determine whether the second candidate address obtained by parsing conflicts with the first candidate address of the local machine; if not, set the first candidate address as the target protocol address of the local machine.

[0033] This ensures that when the neighboring device does not act as a DHCP server and there is no address conflict, the machine can reasonably set its own IP address, thereby achieving fast and stable networking.

[0034] Another embodiment of the present invention further provides a networking device, comprising: a judgment module, a waiting module, a parsing module, and a configuration module;

[0035] The determining module is configured to determine whether the local device serves as a DHCP server in the network according to the first identifier configured on the local device;

[0036] The waiting module is configured to, if not, broadcast an address configuration request to the network, so as to receive an address assigned by a DHCP server in the current network within a preset time threshold, and generate a local LLDP message to broadcast to neighboring devices in the current network, wherein the local LLDP message includes the first identifier and the first candidate address of the local device;

[0037] The parsing module is configured to receive a neighbor LLDP message sent by a neighbor device, parse the neighbor LLDP message to obtain a second identifier of the neighbor device, and determine whether the neighbor device acts as a DHCP server based on the second identifier;

[0038] The configuration module is used to delay the preset time threshold of the local device if the neighboring device acts as a DHCP server, so as to ensure that the local device sets the allocated address to the target protocol address of the local device within the preset time threshold after the delay, and sets the first candidate address to invalid.

[0039] In the embodiments of the present invention, by checking the first identifier, the local device can quickly determine its role in the network and quickly enter the corresponding configuration process, avoiding confusion and conflicts between devices due to unclear roles. By broadcasting an address configuration request, the local device actively requests an IP address from the DHCP server, ensuring that a valid IP address is obtained within a preset time. Simultaneously, the LLDP message is generated and broadcast, helping neighboring devices quickly identify and exchange information, thereby enhancing network stability and inter-device communication efficiency. Through message interaction, the local device can obtain the identifier and candidate IP address of the neighboring device, thereby determining whether the neighboring device is a DHCP server. This helps the device understand the network topology and the role of the neighboring device, avoid IP address conflicts, and ensure that the DHCP server role in the network is unique, thereby improving network stability and reliability. By delaying for a preset time threshold, sufficient time is ensured to receive the IP address assigned by the DHCP server, avoiding network failures caused by delayed DHCP server responses, ensuring that the device can correctly obtain an IP address, and improving network stability and reliability. Simultaneously, the first candidate address is set to invalid, avoiding address conflicts. Compared with the prior art, the present application can improve networking efficiency in complex network environments and ensure network stability.

[0040] Another embodiment of the present invention further provides a networking system, comprising: a DHCP server and at least one networking device, each of the networking devices comprising a DHCP configurator, a Zeroconf configurator and an LLDP tool; when starting to network, each of the networking devices can implement the steps of the device networking method in a complex network environment of the present invention.

[0041] Another embodiment of the present invention further provides a computer-readable storage medium item, comprising: a stored computer program, which, when the computer program is running, controls the device where the computer-readable storage medium is located to execute the steps of the device networking method in a complex network environment of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the technical solution of the present application, the following is a brief introduction to the drawings required for use in the implementation. Obviously, the drawings described below are only some implementation methods of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0043] Figure 1 This is a flowchart of an embodiment of a device networking method in a complex network environment provided by the present application;

[0044] Figure 2 This is a flow chart of another embodiment of the device networking method in a complex network environment provided by the present application;

[0045] Figure 3 This is a structural diagram of an embodiment of the networking device provided by this application;

[0046] Figure 4 It is a structural diagram of an embodiment of the networking system provided by this application. DETAILED DESCRIPTION

[0047] To make the objectives, technical solutions, and advantages of this application more clear, the technical solutions in this application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making any creative efforts are within the scope of protection of this application.

[0048] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application belongs; the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned figure descriptions are intended to cover non-exclusive inclusions.

[0049] In the description of the embodiments of this application, the technical terms "first" and "second" are used only to distinguish different objects and should not be understood to indicate or imply relative importance or implicitly specify the quantity, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, the meaning of "plurality" is more than two, unless otherwise clearly and specifically defined.

[0050] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0051] In the description of the embodiments of this application, the term "and / or" is simply a description of the association relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent the following three situations: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this document generally indicates that the associated objects are in an "or" relationship.

[0052] In the description of the embodiments of the present application, the term "multiple" refers to more than two (including two). Similarly, "multiple groups" refers to more than two groups (including two groups), and "multiple pieces" refers to more than two pieces (including two pieces).

[0053] In the description of the embodiments of the present application, unless otherwise expressly specified or limited, technical terms such as "installed," "connected," "connected," and "fixed" should be understood in a broad sense. For example, they can refer to fixed connections, detachable connections, or integration; mechanical connections or electrical connections; direct connections or indirect connections through an intermediate medium; internal connections between two components or interactions between two components. Those skilled in the art can understand the specific meanings of the above terms in the embodiments of the present application based on specific circumstances.

[0054] Efficient network configuration is crucial in intelligent conferencing systems, as the proper functioning of these devices relies on a stable, fast network connection. Traditional configuration methods include manual configuration and automatic IP address assignment using a DHCP server. However, the former is cumbersome and prone to errors, while the latter can lead to IP address hopping and chaotic allocation in complex network environments, impacting communication stability and network management efficiency.

[0055] It should be noted that the complex network environment in this application mainly refers to network conditions that have an adverse impact on the networking process of conference room equipment. The complexity of the network environment is manifested as follows: (1) Delayed or unstable response of the DHCP server: Traditional networking relies on the DHCP server to allocate IP addresses. If the DHCP server load in the network is too high, the link is congested, or there are cross-segment routing restrictions, the time for the device to receive the DHCP response will be uncontrollable, or even the address cannot be obtained, resulting in networking failure. (2) The risk of IP address conflicts for multiple devices: When there are a large number of devices to be networked in the network (such as multiple smart conference terminals started at the same time), if there is a lack of an effective address conflict detection mechanism, IP addresses are easily allocated repeatedly during the self-networking process, resulting in service interruption or network hopping. (3) DHCP server role competition confusion: If multiple devices try to act as DHCP servers at the same time, there will be multiple DHCP service sources in the network. The IP addresses obtained by the devices may change frequently due to server competition, causing "IP address hopping" problems and affecting service stability.

[0056] It should be noted that the DHCP server is the Dynamic Host Configuration Protocol, which is a device or software that provides network configuration information such as IP addresses on the network. Its function is to assign appropriate IP addresses to devices based on device requests.

[0057] See also Figure 1 In order to realize rapid networking in a complex network environment, an embodiment of the present invention provides a device networking method in a complex network environment, including: steps S101 to S104;

[0058] Step S101: judging whether the local device serves as a DHCP server in the network according to the first identifier configured for the local device.

[0059] Specifically, first, after the local device is turned on and completes basic hardware initialization, it reads its configured first identifier from the device's storage system. If the first identifier is true, the local device will enter the network as a DHCP server. If the first identifier is false, the local device will not act as a DHCP server in the current network.

[0060] It should be noted that multiple networking devices participate in the networking of this application, and each device in the network includes a DHCP configurator (also known as a DHCP client) and a Zeroconf configurator (also known as an ad hoc network configurator). The DHCP configurator is a device in the network that needs to obtain network configuration information such as an IP address from a DHCP server and can be understood as a device that requests an IP address. The Zeroconf configurator is a zero-configuration network protocol configurator that can help devices automatically allocate IP addresses, multicast DNS, and service discovery for themselves in the absence of a DHCP server. This configurator is like a "self-service system" for the device. When the network environment is unstable or there is no DHCP server, the device can rely on itself to solve network configuration problems.

[0061] It should be noted that the device in the present invention determines the source of its own target protocol address based on whether it acts as a DHCP server. When acting as a DHCP server, it uses the candidate address set by the Zeroconf configurator as its own target protocol address; when not acting as a DHCP server, it gives priority to using the DHCP configurator to obtain the allocated address as its own target protocol address. If there is no DHCP server response, it will not participate in the configuration and will not use the Zeroconf configurator to set the candidate address. That is, the device does not have to be configured with two addresses. During normal operation, the device either obtains the allocated address through the DHCP configurator or sets its own address through the Zeroconf configurator. It will not use two configurators to set two different IP addresses at the same time.

[0062] Step S102: If not, broadcast an address configuration request to the network to receive an address assigned by a DHCP server in the current network within a preset time threshold, and generate a local LLDP message to broadcast to neighboring devices in the current network, wherein the local LLDP message includes the first identifier and the first candidate address of the local device.

[0063] Specifically, if the local machine is not acting as a DHCP server, it broadcasts multiple DHCPDiscover address configuration requests to the network environment, announcing its need to obtain an IP address from a DHCP server, and then waits for a response from the DHCP server within a preset time threshold, where the preset time threshold can be configured based on the network environment and requirements. Simultaneously, the local machine's Zeroconf configurator automatically generates a first candidate address and a first identifier for the local machine, which are used for temporary communication within the network.

[0064] In some embodiments, after the first candidate address is generated, an ARP verification mechanism is used to check whether the generated first candidate address conflicts with other devices in the network. If a conflict is found, a new candidate address is regenerated and ARP verification is performed again until a conflict-free candidate address is found to ensure that the IP addresses of the devices in the environment do not conflict. If no conflict is found, the first candidate address is saved and packaged into the local LLDP message to communicate with other neighboring devices in the network, and the DHCP server's response is continued. This process avoids subsequent unnecessary address conflicts and the step of regenerating candidate addresses, effectively reducing the time and resource consumption of devices during the network configuration process.

[0065] It should be noted that ARP verification does not require receiving LLDP. It can be achieved by simply detecting whether there are already "set" duplicate IPs in the environment through ARP packets.

[0066] Step S103: Receive a neighbor LLDP message sent by a neighbor device, parse the neighbor LLDP message to obtain a second identifier of the neighbor device, and determine whether the neighbor device acts as a DHCP server based on the second identifier.

[0067] It should be noted that the second identifier is a flag indicating whether the neighboring device functions as a DHCP server.

[0068] Step S104: If the neighboring device acts as a DHCP server, the preset time threshold of the local device is delayed to ensure that the local device sets the allocated address to the target protocol address of the local device within the preset time threshold after the delay, and sets the first candidate address to invalid.

[0069] Specifically, if the neighboring device acts as a DHCP server, the local device will update the internal neighbor device information table, mark the neighboring device as a DHCP server, and dynamically extend the preset time threshold for waiting for the local device to configure the IP address (which can be achieved through a timer) to ensure that there is enough time to receive the IP address assigned by the DHCP server, until the assigned address of the DHCP server is received within the extended preset time threshold. After receiving the assigned address, the first candidate address is discarded, that is, the first candidate address of the Zeroconf configurator is set to invalid, and the candidate address is no longer considered for network communication. The assigned address is set as the target protocol address of the local device. The target protocol address used by the local device in network communication (that is, configured using the IP address of the DHCP configurator) is authorized by the DHCP server, ensuring its uniqueness and legitimacy in the network.

[0070] Furthermore, the dynamic extension time can be determined based on network conditions or predefined policies. Once the local machine receives an assigned address from the DHCP server within the extended waiting time, the timer will be stopped and the DHCP configuration process will be entered.

[0071] It should be noted that when the neighboring device is a DHCP server, the local device will give priority to using the address assigned by the DHCP server instead of the first candidate address generated by the self-networking configurator for address configuration. Only when all neighboring devices in the network are not DHCP servers will the local device's first candidate address be used as the target protocol address for address configuration.

[0072] It should be noted that the purpose of extending the waiting time for the DHCP server response is to ensure that the IP address does not jump during the configuration process when a DHCP server is known to exist in the environment. In other words, it can prevent network failure caused by premature end of the DHCP server wait time, as well as IP address jumps caused by setting the Zeroconf IP address first and then setting DHCP.

[0073] This dynamically extends the waiting time to ensure that the device can preferentially obtain the address assigned by the DHCP server in a complex network environment, avoiding networking failures or address conflicts caused by server response delays, thereby improving networking efficiency and enhancing network stability.

[0074] In the embodiments of the present invention, by checking the first identifier, the local device can quickly determine its role in the network and quickly enter the corresponding configuration process, avoiding confusion and conflicts between devices due to unclear roles. By broadcasting an address configuration request, the local device actively requests an IP address from the DHCP server, ensuring that a valid IP address is obtained within a preset time. Simultaneously, the LLDP message is generated and broadcast, helping neighboring devices quickly identify and exchange information, thereby enhancing network stability and inter-device communication efficiency. Through message interaction, the local device can obtain the identifier and candidate IP address of the neighboring device, thereby determining whether the neighboring device is a DHCP server. This helps the device understand the network topology and the role of the neighboring device, avoid IP address conflicts, and ensure that the DHCP server role in the network is unique, thereby improving network stability and reliability. By delaying for a preset time threshold, sufficient time is ensured to receive the IP address assigned by the DHCP server, avoiding network failures caused by delayed DHCP server responses, ensuring that the device can correctly obtain an IP address, and improving network stability and reliability. Simultaneously, the first candidate address is set to invalid, avoiding address conflicts. Compared with the prior art, the present application can improve networking efficiency in complex network environments and ensure network stability.

[0075] In some embodiments, the determination of whether the local machine acts as a DHCP server within the network is specifically as follows: obtaining its own configuration information, wherein the configuration information includes a first identifier and a device external connection status; if the first identifier is true or the device external connection status is valid, then determining that the local machine acts as a DHCP server within the network.

[0076] Specifically, after the local device is powered on and completes basic hardware initialization, it reads configuration information from the device's storage system. This configuration information includes a first identifier for the local device and the device's external connection status. If the first identifier is true or the device's external connection status is valid, the local device is designated as a DHCP server and must enter the current network as a DHCP server. The device's external connection status indicates the local device's interface connection status, for example, whether the local device is connected to another device via a USB port. If so, the device's external connection status is valid.

[0077] It should be noted that the configuration information may also include hardware information of the local machine, and the hardware information is used to determine whether the local machine has sufficient hardware resources (such as memory, processor capacity, etc.) to assume the responsibilities of the DHCP server.

[0078] It should be noted that the first identifier is a preset flag used to preliminarily determine whether the device is designated as a DHCP server. For example, the first identifier can be a Boolean value (true or false) indicating whether the device is configured as a DHCP server. The device's external connection status is determined by the device's external connection information, which may include the device's hardware configuration, connected network interface information, device type, etc. This information can help further determine whether the device is suitable for acting as a DHCP server.

[0079] It should be noted that when either the local device's first identifier or the device's external connection status is met, the device marks itself as the DHCP server for the current network. However, this marking does not guarantee that the device will ultimately serve as a DHCP server. The device must determine whether another device in the environment is already acting as a DHCP server. If so, the local device will modify its first identifier.

[0080] In this way, the device determines whether to act as a DHCP server by obtaining its configuration information. This process optimizes the role allocation of devices in the network, avoids unnecessary DHCP server conflicts, thereby improving the efficiency of device networking in complex network environments and ensuring network stability.

[0081] In some embodiments, after determining whether the local machine acts as a DHCP server in the network, it also includes: if the local machine acts as a DHCP server, detecting whether there are other DHCP servers in the network; if so, modifying its own first identifier to false so as not to act as a DHCP server; if not, the local machine acts as a DHCP server in the network, setting the first candidate address as the target protocol address of the local machine, obtaining a configuration file, and sending the preset allocation address in the configuration file to neighboring devices in the network.

[0082] Specifically, if this machine acts as a DHCP server in the network, it will send its own LLDP message to the network to announce its status, and at the same time receive the neighbor LLDP message from the neighbor device, and parse the neighbor LLDP message to determine whether there are other DHCP servers in the network; if there are other DHCP servers, its own first identifier will be modified to false, so that this machine no longer acts as a DHCP server. At the same time, it will stop the DHCP server-related services and functions to avoid conflicts with existing DHCP servers; if there are no other DHCP servers, then this machine will officially act as a DHCP server in the network. At this time, the first candidate address previously generated and verified by the self-networking configurator will be set as the target protocol address of this machine, and a preset configuration file will be obtained at the same time. The configuration file contains the IP addresses and related network configuration information allocated to other devices in the network, and the IP addresses preset in the configuration file will be sent to the neighbor devices in the network in turn. The neighbor devices will set the IP address distributed by the DHCP server as their own target protocol address to ensure network communication of devices in the network.

[0083] In this way, by detecting whether there are other DHCP servers in the network, IP address conflicts and confusion caused by the coexistence of multiple DHCP servers are avoided, ensuring the uniqueness and stability of the network configuration; if this machine acts as a DHCP server, it can actively generate and allocate target protocol addresses to other devices in the network, quickly complete network configuration, and improve networking efficiency.

[0084] In some embodiments, the neighbor LLDP message includes a second candidate address. After determining whether the local device acts as a DHCP server in the network, it also includes: when the local device does not act as a DHCP server, determining whether the neighboring device acts as a DHCP server; if it does, and the second candidate address obtained by resolution conflicts with the first candidate address of the local device, generating a third candidate address that does not conflict with the second candidate address, and replacing the first candidate address in the local device LLDP message with the third candidate address.

[0085] Specifically, if the local device does not act as a DHCP server and the neighboring device does not act as a DHCP server, the local device will further detect whether the second candidate address obtained by resolution conflicts with the first candidate address of the local device. Once an address conflict is detected, the local device will start the address generation mechanism, randomly generate a new third candidate address, and perform ARP verification on the newly generated third candidate address to ensure that the address does not conflict with the addresses of other devices in the network. If a conflict still exists, the above process will be repeated, and new candidate addresses will be continuously generated and ARP verification will be performed until a third candidate address that does not conflict with the second candidate address is obtained. Finally, the generated third candidate address will replace the original first candidate address information in the local LLDP message.

[0086] It should be noted that after replacing the first candidate address in the local LLDP message with the third candidate address, the local device carries the updated local LLDP message and resends it to the neighboring device to ensure that the devices in the network obtain the latest candidate address information and avoid network communication problems caused by address conflicts.

[0087] In this way, when the neighboring device does not act as a DHCP server and there is an address conflict, a new valid candidate address is autonomously generated and the relevant information in the LLDP message is updated, thereby ensuring the accuracy of network configuration and the stability of network communication.

[0088] In some embodiments, after replacing the first candidate address in the local LLDP message with the third candidate address, the method further includes: if the allocated address from the DHCP server is not received within the preset time threshold, setting the third candidate address as the target protocol address of the local machine.

[0089] Specifically, if the device does not receive a response from the DHCP server within the preset time threshold, it will assume that there is no available DHCP server in the current network environment, or that the DHCP server cannot respond in time. At this time, the device will no longer wait for the DHCP server to assign an address. At the same time, the device will officially set the previously generated third candidate address as the target protocol address of the device.

[0090] This mechanism improves the device's adaptability and reliability in complex network environments, enhancing the stability of network services.

[0091] In some embodiments, after determining whether the local device acts as a DHCP server in the network, the method further includes:

[0092] If the local device does not act as a DHCP server and does not receive an address allocated by the DHCP server within the preset time threshold, the first candidate address is set as the target protocol address.

[0093] Specifically, when the local device does not act as a DHCP server and the local device has not received an address allocation response from the DHCP server within a preset time threshold, the local device will skip the step of waiting for the DHCP server to allocate an address and directly set the first candidate address that has been generated and confirmed to be conflict-free by ARP verification as the local device's target protocol address for subsequent network communications.

[0094] This ensures that the local device can configure its own network address in a timely manner, quickly join the network and communicate even in a complex network environment where there is no DHCP server or the DHCP server responds too slowly, avoiding networking delays or failures caused by waiting for the DHCP server to respond.

[0095] In some embodiments, after determining whether the local device acts as a DHCP server within the network, the method further includes: if the local device does not act as a DHCP server and the neighboring device does not act as a DHCP server; determining whether the second candidate address obtained by resolution conflicts with the first candidate address of the local device; if not, setting the first candidate address to the target protocol address of the local device.

[0096] Specifically, if the local device does not act as a DHCP server and the neighboring device does not act as a DHCP server, the second candidate address is re-checked to see if it conflicts with the local device's first candidate address. This further ensures the uniqueness of each subsequent device's official setting of the candidate address as its own target protocol address. If the neighboring device is not a DHCP server and detects that the second candidate address does not conflict with the local device's first candidate address, the first candidate address is confirmed as the local device's target protocol address, completing IP address configuration.

[0097] In some embodiments, after setting the third candidate address as the target protocol address, the method further includes: sending device information to other devices in the network via a multicast domain name system, wherein the device information includes the target protocol address, device type, device name, and device status; determining whether there are multiple DHCP servers in the network based on the received device information, and if so, determining the target DHCP server through an election algorithm. Specifically, after completing the address configuration, the device starts the mDNS service to announce the local device information and status within the network. At this time, the device discovers other devices in the network by listening to mDNS broadcast messages. That is, the device receives mDNS broadcasts sent by other devices and obtains the types and functions of the other devices from them. In the received device information, the device needs to identify which devices are DHCP servers. This can be achieved by checking the device service identifier. If there are multiple DHCP servers, the device will run an election algorithm to determine which DHCP server will be the target DHCP server. The unselected DHCP server needs to notify the devices to which it has assigned IP addresses that they need to reconfigure their addresses. This can be achieved by sending a specific notification message, which can include the reason for the reconfiguration (such as a change in the DHCP server).

[0098] It should be noted that the election algorithm can be set based on a variety of factors, such as the priority of the device (devices with higher priority are elected), the response time of the device (devices with shorter response time are elected), the load of the device (devices with lower load are elected), etc., and this application does not impose any restrictions.

[0099] It's important to note that after reconfiguring the IP address, the device needs to confirm that the new IP address is valid and can communicate normally. Also, after the IP address is changed, the device needs to update the device information sent via mDNS to ensure that other devices in the network can obtain the latest information.

[0100] In this way, by dynamically allocating and adaptively configuring IP addresses and utilizing the multicast domain name system and election algorithm, the device networking efficiency in complex network environments is optimized, address conflicts are effectively prevented, and fast and stable device connections are ensured.

[0101] like Figure 2 For ease of understanding, this application provides a flowchart of another embodiment of a method for networking devices in a complex network environment;

[0102] First, when the device is first started, start both the DHCP configurator and the Zeroconf configurator.

[0103] The DHCP configuration process includes: (1) Sending configuration requests: The DHCP configuration device broadcasts multiple DHCPDiscover address configuration requests to the network. (2) Receiving neighbor LLDP messages: Receive neighbor LLDP messages sent by neighbor devices and parse them. (3) Determine whether the neighbor device is a DHCP server: Based on the parsed neighbor LLDP message, determine whether the neighbor device acts as a DHCP server; if so, extend the delay time of the DHCP timer; if not, continue to wait for the response of the DHCP server. (4) Receive DHCP server response: Within the time set by the DHCP timer, receive the response message sent by the DHCP server, obtain the allocated address, and perform address verification. (5) Verify the address: If the verification is successful, send a confirmation message to the DHCP server and clear the candidate address in the Zeroconf configurator. (6) Configure the IP address: Based on the allocated address sent by the DHCP server, finally configure the local IP address (target protocol address).

[0104] The Zeroconf configurator process includes: (1) Randomly generate the first candidate address: The Zeroconf configurator randomly generates a candidate address. (2) ARP check: Perform an ARP check on the generated candidate address to ensure that there is no address conflict. (3) If the ARP check finds an address conflict, a new candidate address is regenerated and the ARP check is performed again; if the ARP check passes, the subsequent process continues.

[0105] The LLDP process includes: (1) Receiving neighbor LLDP messages from neighboring devices: The LLDP tool receives neighbor LLDP messages sent by neighboring devices. (2) Parsing neighbor LLDP messages: Parsing the neighbor LLDP message content to obtain the neighbor device's identifier and candidate address. (3) Generating and sending the local LLDP message: Based on the local device's initial identifier and first candidate address, the local device generates and sends an LLDP message to the neighboring device.

[0106] It should be noted that the DHCP configurator process, the Zeroconf configurator process and the LLDP process can be executed sequentially or in parallel, and the order is not distinguished. For details, please refer to the description of the first embodiment.

[0107] like Figure 3 As shown, based on the above method embodiment, a corresponding device embodiment is provided;

[0108] An embodiment of the present invention provides a networking device, comprising: a determination module 100, a waiting module 200, an analysis module 300, and a configuration module 400;

[0109] The determining module 100 is configured to determine whether the local device serves as a DHCP server in the network according to the first identifier configured therewith;

[0110] The waiting module 200 is configured to, if not, broadcast an address configuration request to the network, so as to receive an address assigned by a DHCP server in the current network within a preset time threshold, and generate a local LLDP message to broadcast to neighboring devices in the current network, wherein the local LLDP message includes a first identifier and a first candidate address of the local device;

[0111] The parsing module 300 is configured to receive a neighbor LLDP message sent by a neighbor device, parse the neighbor LLDP message to obtain a second identifier of the neighbor device, and determine whether the neighbor device acts as a DHCP server based on the second identifier;

[0112] The configuration module 400 is used to delay the preset time threshold of the local device if the neighboring device acts as a DHCP server, so as to ensure that the local device sets the assigned address to the target protocol address of the local device within the preset time threshold after the delay, and sets the first candidate address to invalid.

[0113] It can be understood that the above-mentioned device embodiment corresponds to the method embodiment of the present invention, which can implement the device networking method in a complex network environment described in any of the above-mentioned method embodiments of the present invention.

[0114] It should be noted that the device embodiments described above are merely illustrative, and some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment. Furthermore, in the drawings of the device embodiments provided by the present invention, the connection relationship between modules indicates that they have a communication connection, which may be implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement the present invention without inventive effort.

[0115] Please refer to Figure 4 Based on the embodiment of the device networking method under a complex network environment described above, another embodiment of the present invention provides a networking system, comprising: a DHCP server and at least one networking device, each of the configuration devices comprising a DHCP configurator, a Zeroconf configurator, and an LLDP tool; when networking begins, each of the networking devices can implement the device networking method under a complex network environment as described in the present invention.

[0116] Based on the above-mentioned method embodiments, another embodiment of the present invention provides a computer-readable storage medium, including a stored computer program, wherein, when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the device networking method in a complex network environment described in any one of the above-mentioned method embodiments of the present invention.

[0117] Wherein, the module / unit integrated in the device / terminal equipment, if implemented in the form of a software functional unit and sold or used as an independent product, can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the process in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by the processor, it can implement the steps of the above-mentioned various method embodiments. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device that can carry the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.

[0118] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A device networking method in a complex network environment, characterized in that: include: Determining whether the local machine serves as a DHCP server in the network according to the first identifier configured on the local machine; If not, broadcast an address configuration request to the network to receive an address allocated by a DHCP server in the current network within a preset time threshold, and generate a local LLDP message to broadcast to neighboring devices in the current network, wherein the local LLDP message includes the first identifier and the first candidate address of the local device; Receiving a neighbor LLDP message sent by a neighboring device, parsing the neighbor LLDP message to obtain a second identifier of the neighboring device, and determining whether the neighboring device acts as a DHCP server based on the second identifier; If the neighboring device acts as a DHCP server, the preset time threshold of the local device is delayed to ensure that the local device sets the allocated address to the target protocol address of the local device within the preset time threshold after the delay, and sets the first candidate address to invalid.

2. The device networking method in a complex network environment according to claim 1, characterized in that: The determining whether the local machine acts as a DHCP server in the network further includes: Acquire its own configuration information, wherein the configuration information includes a first identifier and a device external connection status; If the first identifier is true or the device external status is valid, it is determined that the local device acts as a DHCP server in the network.

3. The device networking method in a complex network environment according to claim 1, characterized in that: After determining whether the local device serves as a DHCP server in the network, the method further includes: If the machine acts as a DHCP server, it will detect whether there are other DHCP servers in the network; If it exists, modify its own first identifier to false so as not to act as a DHCP server; If it does not exist, the local device acts as a DHCP server in the network, sets the first candidate address as the target protocol address of the local device, obtains the configuration file, and sends the allocated address preset in the configuration file to the neighboring device in the network.

4. The device networking method in a complex network environment according to claim 1, characterized in that: The neighbor LLDP message includes the second candidate address, and after determining whether the local device acts as a DHCP server in the network, the method further includes: When the local device does not act as a DHCP server, determine whether the neighboring device acts as a DHCP server; If yes, and the second candidate address obtained by parsing conflicts with the first candidate address of the local machine, a third candidate address that does not conflict with the second candidate address is generated, and the third candidate address replaces the first candidate address in the local machine LLDP message.

5. The device networking method in a complex network environment according to claim 4, characterized in that: After replacing the first candidate address in the local LLDP message with the third candidate address, the method further includes: If the address allocated by the DHCP server is not received within the preset time threshold, the third candidate address is set as the target protocol address of the local device.

6. The device networking method in a complex network environment according to claim 1, characterized in that: After determining whether the local device serves as a DHCP server in the network, the method further includes: If the local device does not act as a DHCP server and does not receive an address allocated by the DHCP server within the preset time threshold, the first candidate address is set as the target protocol address.

7. The device networking method in a complex network environment according to any one of claims 4 to 6, characterized in that: After determining whether the local machine serves as a DHCP server in the network, the method further includes: If the local device does not act as a DHCP server and the neighboring device does not act as a DHCP server; Determine whether the second candidate address obtained by parsing conflicts with the first candidate address of the local machine; if not, set the first candidate address as the target protocol address of the local machine.

8. A networking device, characterized in that: include: Judgment module, waiting module, parsing module and configuration module; The determining module is configured to determine whether the local device serves as a DHCP server in the network according to the first identifier configured on the local device; The waiting module is configured to, if not, broadcast an address configuration request to the network, so as to receive an address assigned by a DHCP server in the current network within a preset time threshold, and generate a local LLDP message to broadcast to neighboring devices in the current network, wherein the local LLDP message includes the first identifier and the first candidate address of the local device; The parsing module is configured to receive a neighbor LLDP message sent by a neighbor device, parse the neighbor LLDP message to obtain a second identifier of the neighbor device, and determine whether the neighbor device acts as a DHCP server based on the second identifier; The configuration module is used to delay the preset time threshold of the local device if the neighboring device acts as a DHCP server, so as to ensure that the local device sets the allocated address to the target protocol address of the local device within the preset time threshold after the delay, and sets the first candidate address to invalid.

9. A networking system, characterized in that: include: A DHCP server and at least one networking device, each of the networking devices including a DHCP configurator, a Zeroconf configurator and an LLDP tool; when starting to network, each of the networking devices can implement the device networking method in a complex network environment as described in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the device networking method in a complex network environment as described in any one of claims 1 to 7 is implemented.