Network parameter configuration method, system, terminal device and storage medium

By sending DHCP Request messages in multi-network port devices and restarting the DHCP process, the problem that cascaded devices cannot automatically access the network is solved, and the stability of device networking and user control capabilities are improved.

CN118694662BActive Publication Date: 2025-01-21APUTURE IMAGING IND CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411186730.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-28
Publication Date
2025-01-21
Estimated Expiration
2044-08-28

AI Technical Summary

Technical Problem

After the multi-network device is connected to the network server device in a cascaded manner, when the device is replaced, other cascading devices cannot automatically access the network except for directly connecting to the device, resulting in poor stability.

Method used

By sending a DHCP Request message to the DHCP server, the network connection status is determined based on whether a DHCP Ack message is received. If the connection is disconnected, the DHCP process is restarted to configure network parameters.

Benefits of technology

Improved the stability of the networking status of multi-network port devices in cascading state, ensuring that devices can automatically access the new network in time when the DHCP server is replaced, allowing users to control multiple multi-network port devices simultaneously.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118694662B_ABST
    Figure CN118694662B_ABST
Patent Text Reader

Abstract

The present application is applicable to the field of device cascade control technology, and provides a network parameter configuration method, system, terminal device and storage medium, wherein the method includes: sending a DHCP Request message to a DHCP server; determining whether the current network connection is disconnected according to whether a DHCP Ack message sent by the DHCP server is received; if it is determined that the current network connection is disconnected, restarting the DHCP process to configure the network parameters. The embodiment of the present application can effectively improve the stability of the networking state of a multi-network port device group in a cascade state, and ensure that when the DHCP server is replaced, each multi-network port device can automatically and timely access the new network, which is conducive to realizing the user's simultaneous control of multiple multi-network port devices.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the technical field of device cascade control, and in particular, relates to a network parameter configuration method, system, terminal device and storage medium. Background Art

[0002] The development of technology has made the simultaneous control of multiple devices a trend, and it has been widely used in smart home, industrial automation and other fields. For example, after using Ethernet to connect multiple multi-port devices to the same local area network, multiple multi-port devices can be controlled simultaneously. However, when multiple multi-port devices are connected to network server devices including routers in a cascade manner, once the network server device is replaced, only the multi-port devices directly connected to the network server device will reconnect to the network. Other multi-port devices in the cascade state will not be able to automatically connect to the network, and the stability is poor. Summary of the invention

[0003] In view of this, the embodiments of the present application provide a network parameter configuration method, system, terminal device and storage medium to improve the stability of the networking state of multi-network port devices in a cascade state.

[0004] A first aspect of an embodiment of the present application provides a network parameter configuration method, which is applied to a multi-network port device group. The network parameter configuration method includes:

[0005] Send DHCP Request message to DHCP server;

[0006] Determining whether the current network connection is disconnected according to whether a DHCP Ack message sent by the DHCP server is received;

[0007] If it is determined that the current network connection is disconnected, restart the DHCP process to configure the network parameters.

[0008] A second aspect of an embodiment of the present application provides a network parameter configuration method, which is applied to a DHCP server. The network parameter configuration method includes:

[0009] Receive DHCP Request messages sent by multi-network port devices;

[0010] Send a corresponding DHCP Ack message to the multi-network port device according to the DHCP Request message.

[0011] A third aspect of the embodiment of the present application provides a network parameter configuration system, the network parameter configuration system comprising a control terminal device, a DHCP server and a multi-network port device group; the multi-network port device group comprises a plurality of multi-network port devices cascaded to each other;

[0012] The control terminal device establishes a communication connection with the DHCP server and is used to manage the DHCP server;

[0013] The multi-network port device group establishes a communication connection with the DHCP server, thereby realizing data interaction between the multi-network port devices.

[0014] A fourth aspect of an embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the terminal device is a multi-network port device group, the processor implements the steps of the network parameter configuration method as described in the first aspect of the embodiment of the present application when executing the computer program;

[0015] When the terminal device is a DHCP server, the processor implements the steps of the network parameter configuration method as described in the second aspect of the embodiment of the present application when executing the computer program.

[0016] The fifth aspect of the embodiments of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the steps of the network parameter configuration method as described in the first aspect or the second aspect of the embodiments of the present application.

[0017] The network parameter configuration method provided in the first aspect of the embodiment of the present application is applied to a multi-network port device group. After the multi-network port device group is successfully networked, for each multi-network port device, a DHCP Request message is sent to the DHCP server; then, according to whether a DHCP Ack message sent by the DHCP server is received, it is determined whether the current network connection is disconnected; if it is determined that the current network connection is disconnected, the DHCP process is restarted to configure the network parameters. In this way, the stability of the networking state of the multi-network port device group in the cascade state can be effectively improved, ensuring that when the DHCP server is replaced, each multi-network port device can automatically and timely access the new network, which is conducive to the user's simultaneous control of multiple multi-network port devices.

[0018] The second aspect of the embodiment of the present application provides a network parameter configuration method, which is applied to a DHCP server. After a multi-network port device group is connected to the DHCP server, the method receives a DHCP Request message sent by the multi-network port device; and sends a corresponding DHCP Ack message to the multi-network port device according to the DHCP Request message. In this way, the stability of the networking state of the multi-network port device group in the cascade state can be effectively improved, ensuring that when the DHCP server is replaced, each multi-network port device can automatically and timely connect to the new network, which is conducive to realizing the user's simultaneous control of multiple multi-network port devices.

[0019] It can be understood that the beneficial effects of the third to fifth aspects mentioned above can be found in the relevant descriptions in the first or second aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0021] Figure 1 This is a schematic diagram of a device cascade provided in an embodiment of the present application;

[0022] Figure 2 This is a first flow chart of a first network parameter configuration method provided in an embodiment of the present application;

[0023] Figure 3 This is a second flow chart of the first network parameter configuration method provided in an embodiment of the present application;

[0024] Figure 4 It is a flowchart of a second network parameter configuration method provided in an embodiment of the present application;

[0025] Figure 5 is a structural diagram of a network parameter configuration system provided in an embodiment of the present application;

[0026] Figure 6 It is a structural diagram of the terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0027] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0028] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0029] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0030] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways. "Multiple" means "two" or "more than two".

[0031] The development of technology has made the simultaneous control of multiple devices a trend, and it has been widely used in smart home, industrial automation and other fields. For example, by using Ethernet to connect multiple multi-port devices to the same local area network, multiple multi-port devices can be controlled simultaneously, and data exchange between multi-port devices can be achieved.

[0032] Generally, IP allocation in Ethernet includes two methods: static IP allocation and automatic IP allocation. Static IP allocation means that users manually allocate IP addresses to (multi-network port) devices in the network. This method is usually used for (multi-network port) devices that require fixed IP addresses, such as network printers. Automatic IP allocation refers to the process of automatically allocating IP addresses and other network configuration information to (multi-network port) devices in the network through a DHCP (Dynamic Host Configuration Protocol) server.

[0033] However, when multiple multi-network port devices are connected to a network server device including a router in a cascade manner, once the network server device is replaced, only the multi-network port device directly connected to the network server device will reconnect to the network. Other multi-network port devices in the cascade state will not be able to automatically connect to the network, and the stability is poor.

[0034] For example, in Figure 1In the application scenario shown, taking a dual-network-port device as an example, when all dual-network-port devices are successfully networked through automatic IP allocation, when the router in the figure is replaced with another router, for dual-network-port device 1, since the connection status of port 1 of dual-network-port device 1 and the router has changed, it can be known that the router has been replaced, but for dual-network-port device 2 and other dual-network-port devices in the subsequent cascade state, since the connection status of port 1 and port 2 of each dual-network-port device has not changed, for other dual-network-port devices except dual-network-port device 1, it is impossible to know that the router has been replaced, resulting in other dual-network-port devices not being able to work normally after the router is replaced. For other multi-network-port devices cascaded with each other, this situation similar to that of cascaded dual-network-port devices will also occur.

[0035] Therefore, for mutually cascaded multi-network port devices (including dual-network port devices), an embodiment of the present application provides a network parameter configuration method, which is applied to a multi-network port device group. After the multi-network port device group is successfully networked, for each multi-network port device, a DHCP Request message is sent to the DHCP server; then, according to whether a DHCP Ack message sent by the DHCP server is received, it is determined whether the current network connection is disconnected; if it is determined that the current network connection is disconnected, the DHCP process is restarted to configure the network parameters. In this way, the stability of the networking state of the multi-network port device group in the cascade state can be effectively improved, ensuring that when the DHCP server is replaced, each multi-network port device can automatically and timely access the new network, which is conducive to the user's simultaneous control of multiple multi-network port devices.

[0036] Embodiment 1

[0037] like Figure 2 As shown, the network parameter configuration method provided in the embodiment of the present application is applied to a multi-network port device group, and includes the following steps S1 to S3:

[0038] In one embodiment, the multi-network port device group includes a plurality of multi-network port devices cascaded to each other.

[0039] In an application, a multi-network port device group may include any number of multi-network port devices, which is not limited in this application.

[0040] In the application, a multi-network port device refers to a device equipped with two or more Ethernet interfaces. This application does not limit the type of multi-network port device.

[0041] In an application, multiple multi-network port devices that are cascaded to each other may be connected in sequence according to a preset cascade order. The preset cascade order may be set according to actual needs and is not limited here.

[0042] In the application, before entering step S1, the following steps need to be performed to ensure that all multi-network port devices in the multi-network port device group have been connected to the network.

[0043] In one embodiment, before step S1, the method includes:

[0044] For each multi-port device, start the DHCP process and configure the network parameters;

[0045] The DHCP process includes:

[0046] Send a DHCP Discover message;

[0047] If a DHCP Offer message is received from the DHCP server, the DHCP Request message is sent;

[0048] If a DHCP Ack message sent by the DHCP server is received, network parameters are configured according to the DHCP Offer message.

[0049] In the application, before starting the DHCP process, you need to ensure that the DHCP server has enabled the DHCP service and made corresponding settings, such as setting the address pool range, subnet mask, default gateway, etc. This is just an example and is not limited.

[0050] In the application, for each port of each multi-network port device that is cascaded to each other, the DHCP process can be started to configure network parameters. Multiple ports of a multi-network port device can start the DHCP process at the same time, or they can be started in sequence (taking two ports as an example, one port can start the DHCP process first, and the other port can start the DHCP process later), which is not limited here; in addition, all multi-network port devices in a multi-network port device group can start the DHCP process at the same time, or they can start the DHCP process in sequence according to a preset cascade order, or they can start the DHCP process in other orders to configure network parameters, which is not limited here.

[0051] The following uses a multi-port device in a multi-port device group as an example to explain the DHCP process:

[0052] The multi-network port device sends a DHCP Discover message through broadcasting to find a DHCP server in the network. The DHCP Discover message includes a lot of information such as the message type, the MAC address of the multi-network port device, the boot file name, the source IP address, etc., which are not limited here. This information is used to help the DHCP server identify the multi-network port device and provide corresponding network configuration information;

[0053] After receiving the DHCP Discover message, if the DHCP server has an available IP address and other network configuration information, it sends a DHCP Offer message, which may include network configuration information such as IP address, subnet mask, and default gateway. It is understandable that when there are multiple DHCP servers in the network, the multi-network port device may receive multiple DHCP Offer messages.

[0054] If multiple DHCP Offer messages are received, one DHCP Offer message is selected and a DHCPRequest message is sent to the DHCP server that provided the ODHCP Offer message, requesting to accept the provided network configuration information;

[0055] After receiving the ODHCP Offer message, the DHCP server will send a DHCP Ack message to confirm that the multi-port device can use the provided network configuration information; or, if a problem occurs, the DHCP server will send a DHCP Nak message to refuse the multi-port device from using the provided network configuration information.

[0056] After receiving the DHCP Ack message, the multi-network port device configures its own network parameters according to the network configuration information provided in the DHCP Offer message.

[0057] Step S1, send a DHCP Request message to the DHCP server, and then go to step S2.

[0058] In the application, in order to ensure the network connection status of all multi-port devices in the multi-port device group, a DHCP Request message can be sent to the DHCP server, and the network connection status of the multi-port devices can be determined based on whether a DHCP Ack message sent by the DHCP server is received.

[0059] In one embodiment, step S1 specifically includes:

[0060] After each preset time interval, the DHCP Request message is sent to the DHCP server.

[0061] In the application, the time interval can be set according to actual needs and is not limited here.

[0062] In the application, one or two or more time intervals can be set for each multi-network port device in the multi-network port device group. The time interval of each multi-network port device can be the same or different; the time interval of each multi-network port device can also be set incrementally according to its cascade position in the multi-network port device group. For example, in a multi-network port device group including 5 multi-network port devices, the interval time of multi-network port device 1 can be set to 1 second, the interval time of multi-network port device 2 can be set to 2 seconds, the interval time of multi-network port device 3 can be set to 3 seconds, the interval time of multi-network port device 4 can be set to 4 seconds, and the interval time of multi-network port device 5 can be set to 5 seconds; of course, the time interval can also be set incrementally in multiples according to its cascade position in the multi-network port device group, etc., which is not limited here.

[0063] In an application, after a time interval is set for some or all of the multi-network port devices in a multi-network port device group, these multi-network port devices with the time interval set send a DHCPRequest message to the DHCP server once after each time interval.

[0064] Step S2: Determine whether the current network connection is disconnected according to whether a DHCP Ack message sent by the DHCP server is received.

[0065] In the application, if a DHCP Ack message is received from the DHCP server, it indicates that the current network connection is not disconnected, and the current network connection status can be maintained. If a DHCP Ack message is not received from the DHCP server, it is necessary to further determine whether the current network connection is disconnected. Once it is determined that the current network connection is disconnected, it is necessary to restart the DHCP process to access the network.

[0066] In one embodiment, Figure 3 As shown, step S2 specifically includes the following steps S21 to S24:

[0067] Step S21: If a DHCP Ack message sent by the DHCP server is received, it is determined that the current network connection is not disconnected, the receiving flag is cleared and the current network connection state is maintained.

[0068] In the application, one or more receive flags may be set for each multi-network port device in the multi-network port device group, and the receive flags may be initialized, for example, the initial value of the receive flag may be set to 0; one or more receive flags may also be set for at least one multi-network port device in the multi-network port device group, which is not limited here.

[0069] In the application, if the multi-network port device that has sent a DHCP Request message to the DHCP server receives a DHCP Ack message sent by the DHCP server, it indicates that the current network connection is normal. The receiving flag bit is cleared and the current network connection status is maintained.

[0070] Step S22: If the DHCP Ack message sent by the DHCP server is not received, the receiving flag is updated and the process proceeds to step S23 or S24.

[0071] In the application, if the DHCP Ack message sent by the DHCP server is not received, the receiving flag needs to be updated, so as to determine whether the current network connection is disconnected according to the updated receiving flag.

[0072] In one embodiment, updating the reception flag bit includes:

[0073] Add 1 to the current value of the receiving flag and save it.

[0074] In the application, after a multi-network port device sends a DHCP Request message to a DHCP server, if it does not receive a DHCPAck message from the DHCP server within a certain time range (the time range can be set according to actual needs), the receiving flag is updated, that is, 1 is added to the current value of the receiving flag, and the next operation is determined based on the updated receiving flag.

[0075] In an application, the preset flag bit threshold may be set according to actual needs. For example, the preset flag bit threshold may be set to 3, 5, or 7, etc. This is only an example and is not intended to be limiting.

[0076] Step S23: If the updated reception flag does not exceed the preset flag threshold, it is determined that the current network connection is not disconnected, and the process returns to the step of sending the DHCP Request message to the DHCP server.

[0077] In the application, if the DHCP Ack message sent by the DHCP server is not received, the receiving flag is updated first, and when the updated receiving flag does not exceed the preset flag threshold, the process returns to step S1.

[0078] Step S24: If the updated reception flag exceeds the preset flag threshold, it is determined that the current network connection is disconnected, and the process proceeds to step S3.

[0079] In the application, if the DHCP Ack message sent by the DHCP server is not received, the reception flag is updated first, and when the updated reception flag exceeds the preset flag threshold, it is determined that the current network connection is disconnected, and the next step needs to be entered to restart the DHCP process and configure the network parameters.

[0080] Step S3: If it is determined that the current network connection is disconnected, restart the DHCP process to configure the network parameters.

[0081] In the application, if it is determined that the current network connection has been disconnected, restart the DHCP process to configure the network parameters. The specific DHCP process is detailed in the previous content and will not be repeated here.

[0082] In one embodiment, the network parameters include at least one of an IP address, a subnet mask, a default gateway, and a DNS server.

[0083] In the application, network parameters include but are not limited to IP address, subnet mask, default gateway and DNS server.

[0084] In one embodiment, the network parameter configuration method further includes:

[0085] By querying the PHY register, determine whether the current network connection is disconnected;

[0086] If it is determined that the current network connection is disconnected, restart the DHCP process to configure the network parameters.

[0087] In applications, PHY (Physical Layer) registers can be used to configure and monitor Ethernet physical layer devices. Therefore, for multi-port devices directly connected to the DHCP server, you can also query the PHY register to quickly determine whether the current network connection is disconnected. Specifically, you can query the PHY register once every certain time interval (the interval time can be set according to time requirements and is not limited here) to determine the current network connection status.

[0088] In an application, the address of the PHY register may be obtained by referring to a data sheet of a network interface card (NIC) or documents provided by a manufacturer, and is not limited here.

[0089] In the application, if the current network connection is found to be disconnected by querying the PHY register, a new DHCP process needs to be started to configure the network parameters; if the current network connection is not disconnected by querying the PHY register, the current network connection state is maintained. The embodiment of the present application periodically sends a DHCP Request message to the DHCP server, and determines whether the network is disconnected based on whether a DHCP Ack message is received from the DHCP server. When the DHCP server is replaced, the method provided by the embodiment of the present application can quickly determine that the network has been disconnected, so that the DHCP process can be restarted in time to configure the network parameters, which can effectively improve the stability of the networking state of the multi-network port device group in the cascade state, and is conducive to the user's simultaneous control of multiple multi-network port devices.

[0090] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0091] Embodiment 2

[0092] It should be noted that the DHCP server in this embodiment may be any device having a DHCP service, for example, a router, or other devices except a router, which is not limited here.

[0093] like Figure 4 As shown, the network parameter configuration method provided in the embodiment of the present application is applied to a DHCP server, and includes the following steps S4 to S5:

[0094] Step S4: Receive a DHCP Request message sent by the multi-network port device, and proceed to step S5.

[0095] In an application, when a DHCP server receives a DHCP Request message sent by a multi-network port device, it can simultaneously receive a DHCP Request message sent by each port of multiple multi-network port devices.

[0096] In the application, after receiving the DHCP Request message, the DHCP server can process each DHCPRequest message, or put the received DHCP Request messages into a queue and then process them in a certain order (for example, according to the cascade order of multi-network port devices), which is not limited here.

[0097] In the application, if the multi-network port device sends DHCP Request messages at a set time interval, the DHCP server can also receive DHCP Request messages at a preset receiving time interval, which is greater than or equal to the time interval for the multi-network port device to send DHCP Request messages. Alternatively, the DHCP server can also be in a continuous receiving state to receive DHCP Request messages sent by the multi-network port device in a timely manner.

[0098] Step S5: Send a corresponding DHCP Ack message to the multi-network port device according to the DHCP Request message.

[0099] In the application, if the DHCP server receives DHCP Request messages sent by multiple multi-network port devices at the same time, it can reply with a corresponding DHCPAck message for the DHCP Request message sent by each port of each multi-network port device. It should be noted that the DHCP server can reply with a corresponding DHCP Ack message for the DHCP Request messages received at the same time, or it can reply to the received DHCP Request messages in a certain order (for example, in the cascade order of the multi-network port devices), which is not limited here.

[0100] In the application, before entering step S4, the following steps regarding the DHCP process need to be performed to ensure that all multi-network port devices have been connected to the network.

[0101] In one embodiment, step S4 includes:

[0102] Receiving a DHCP Discover message sent by the multi-network port device;

[0103] Sending a corresponding DHCP Offer message to the multi-network port device according to the DHCP Discover message;

[0104] If the DHCP Request message is received, a corresponding DHCPAck message is sent to the multi-network port device according to the DHCP Request message, so that the multi-network port device configures network parameters.

[0105] In this embodiment, it is also necessary to ensure that the DHCP server has enabled the DHCP service and made corresponding settings. Specifically, the DHCP server management interface can be logged in through the control terminal device, and then the DHCP service of the DHCP server can be enabled in the management interface, and the corresponding settings can be made, including but not limited to:

[0106] Set the address pool range to allocate IP addresses to multi-port devices; set the lease term, that is, the length of time that multi-port devices can use the allocated IP addresses (for example, one week, one month, or one year); set the DNS (Domain Name System) server address to provide domain name resolution services to ensure fast conversion between domain names and IP addresses; set the NTP (Network Time Protocol) server address to provide time synchronization services to ensure that the time of multi-port devices and DHCP servers is consistent; set the subnet mask to determine which subnet an IP address belongs to; set the default gateway to ensure normal communication between devices in the network, etc.

[0107] In the application, the control end device can be one of the devices such as a mobile phone, a tablet computer, a wearable device, an augmented reality (AR) / virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), etc.

[0108] In the application, a multi-network port device sends a DHCP Discover message by broadcasting to find a DHCP server in the network. The DHCP Discover message includes a lot of information such as the message type, the MAC address of the multi-network port device, the boot file name, the source IP address, etc. This is just an example and is not limited. This information is used to help the DHCP server identify the multi-network port device and provide corresponding network configuration information.

[0109] In the application, after receiving the DHCP Discover message, if the DHCP server has an available IP address and other network configuration information, it sends a DHCP Offer message, which may include network configuration information such as IP address, subnet mask, and default gateway.

[0110] In the application, if the multi-network port device receives the DHCP Offer message, it sends a DHCP Request message to the DHCP server. If the DHCP server receives the ODHCP Offer message, it sends a DHCP Ack message to the multi-network port device, so that the multi-network port device can configure its own network parameters according to the network configuration information provided in the DHCP Offer message after receiving the DHCP Ack message; or, if a problem occurs, the DHCP server can send a DHCP Nak message to the multi-network port device to refuse the multi-network port device to use the provided network configuration information.

[0111] In the embodiment of the present application, the DHCP server receives the DHCP Request message sent by the multi-network port device, and then replies with the corresponding DHCP Ack message, so that the multi-network port device can determine whether the network is disconnected based on whether it has received the DHCP Ack message replied by the DHCP server. When the DHCP server is replaced, the method provided by the embodiment of the present application can quickly determine that the network is disconnected, so that the DHCP process can be restarted in time to configure the network parameters, which can effectively improve the stability of the networking state of the multi-network port device group in the cascade state, and is conducive to the user's simultaneous control of multiple multi-network port devices.

[0112] It should be noted that for some contents not described in detail in this embodiment, please refer to the relevant description of Embodiment 1 and will not be repeated here.

[0113] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0114] Embodiment 3

[0115] The embodiment of the present application also provides a network parameter configuration system for executing the method steps in the above network parameter configuration method embodiment.

[0116] like Figure 5 As shown, the network parameter configuration system 100 provided in the embodiment of the present application includes a control terminal device 1, a DHCP server 2 and a multi-network port device group 3.

[0117] In one embodiment, the multi-network port device group includes a plurality of multi-network port devices cascaded to each other;

[0118] The control terminal device establishes a communication connection with the DHCP server and is used to manage the DHCP server;

[0119] The multi-network port device group establishes a communication connection with the DHCP server, thereby realizing data interaction between the multi-network port devices.

[0120] In one embodiment, the multi-network port device group 3 is further used for:

[0121] Send DHCP Request message to DHCP server;

[0122] Determining whether the current network connection is disconnected according to whether a DHCP Ack message sent by the DHCP server is received;

[0123] If it is determined that the current network connection is disconnected, restart the DHCP process to configure the network parameters.

[0124] In one embodiment, the multi-network port device group 3 is further used for:

[0125] For each multi-port device, start the DHCP process and configure the network parameters;

[0126] The DHCP process includes:

[0127] Send a DHCP Discover message;

[0128] If a DHCP Offer message is received from the DHCP server, the DHCP Request message is sent;

[0129] If a DHCP Ack message sent by the DHCP server is received, network parameters are configured according to the DHCP Offer message.

[0130] In one embodiment, the multi-network port device group 3 is further used for:

[0131] After each preset time interval, the DHCP Request message is sent to the DHCP server.

[0132] In one embodiment, the multi-network port device group 3 is further used for:

[0133] If a DHCP Ack message sent by the DHCP server is received, it is determined that the current network connection is not disconnected, the receiving flag is cleared and the current network connection state is maintained;

[0134] If the DHCP Ack message sent by the DHCP server is not received, updating the reception flag bit;

[0135] If the updated receiving flag bit does not exceed the preset flag bit threshold, it is determined that the current network connection is not disconnected, and the process returns to the step of sending the DHCP Request message to the DHCP server;

[0136] If the updated reception flag exceeds the preset flag threshold, it is determined that the current network connection is disconnected.

[0137] In one embodiment, updating the reception flag bit includes:

[0138] Add 1 to the current value of the receiving flag and save it.

[0139] In one embodiment, the network parameters include at least one of an IP address, a subnet mask, a default gateway, and a DNS server.

[0140] In one embodiment, the multi-network port device group 3 is further used for:

[0141] By querying the PHY register, determine whether the current network connection is disconnected;

[0142] If it is determined that the current network connection is disconnected, restart the DHCP process to configure the network parameters.

[0143] In one embodiment, the DHCP server 2 is specifically configured to:

[0144] Receive DHCP Request messages sent by multi-network port devices;

[0145] Send a corresponding DHCP Ack message to the multi-network port device according to the DHCP Request message.

[0146] In one embodiment, the DHCP server 2 is further configured to:

[0147] Receiving a DHCP Discover message sent by the multi-network port device;

[0148] Sending a corresponding DHCP Offer message to the multi-network port device according to the DHCP Discover message;

[0149] If the DHCP Request message is received, a corresponding DHCPAck message is sent to the multi-network port device according to the DHCP Request message, so that the multi-network port device configures network parameters.

[0150] Embodiment 4

[0151] like Figure 6As shown, the embodiment of the present application further provides a terminal device 200, including: at least one processor 201 ( Figure 6 Only one processor is shown), a memory 202, a computer program 203 stored in the memory 202 and executable on at least one processor 201; when the terminal device is a multi-network port device group, the processor 201 executes the computer program 203 to implement the method steps in the above-mentioned embodiment 1; when the terminal device is a DHCP server, the processor 201 executes the computer program 203 to implement the method steps in the above-mentioned embodiment 2.

[0152] In the application, the terminal device may include, but is not limited to, a processor, a memory, Figure 6 It is only an example of a terminal device and does not constitute a limitation on the terminal device. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components, such as human-computer interaction devices, input and output devices, network access devices, etc. The network access device may include a communication module for the terminal device to communicate with the user terminal.

[0153] In applications, the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. For example, the processor may be a timing controller (TCON). A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.

[0154] In applications, the memory may be an internal storage unit of a terminal device in some embodiments, such as a hard disk or memory of the terminal device. In other embodiments, the memory may also be an external storage device of the terminal device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device. The memory may also include both an internal storage unit and an external storage device of the terminal device. The memory is used to store operating systems, applications, boot loaders, data, and other programs, such as program codes of computer programs. The memory may also be used to temporarily store data that has been output or is to be output.

[0155] In the application, the communication module can be set as any device that can directly or indirectly communicate with the user terminal over a long distance by wire or wireless communication according to actual needs. For example, the communication module can provide communication solutions including wireless local area networks (WLAN) (such as Wi-Fi networks), Bluetooth, Zigbee, mobile communication networks, global navigation satellite systems (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to network devices. The communication module can include an antenna, which can have only one array element or an antenna array including multiple array elements. The communication module can receive electromagnetic waves through the antenna, frequency modulate and filter the electromagnetic wave signals, and send the processed signals to the processor. The communication module can also receive the signal to be sent from the processor, frequency modulate and amplify it, and convert it into electromagnetic waves for radiation through the antenna.

[0156] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / modules are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0157] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example for illustration. In actual applications, the above-mentioned function allocation can be completed by different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The functional modules in the embodiment can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware or in the form of software functional modules. In addition, the specific names of the functional modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0158] The embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

[0159] An embodiment of the present application provides a computer program product. When the computer program product runs on a terminal device, the terminal device can implement the steps in the above-mentioned various method embodiments.

[0160] If the integrated module is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, 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 at least include: any entity or device that can carry the computer program code to the terminal device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electric carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a disk or an optical disk.

[0161] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0162] Those of ordinary skill in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0163] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0164] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0165] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A network parameter configuration method, characterized in that: Applied to a multi-network port device group, the multi-network port device group includes a plurality of multi-network port devices cascaded to each other, and the network parameter configuration method includes: Starting the DHCP process for the multiple multi-network port devices at the same time, or starting the DHCP process in sequence according to a preset cascade order, to configure network parameters; wherein when starting the DHCP process for each of the multiple multi-network port devices, it includes starting the DHCP process for multiple ports of each multi-network port device at the same time or starting the DHCP process in sequence; For each multi-network port device in the multi-network port device group, a DHCPRequest message is sent to the DHCP server after each preset time interval; wherein the preset time interval includes one or two or more same or different time intervals set for each multi-network port device in the multi-network port device group, or the preset time interval is a time interval set according to the cascade position of each multi-network port device in the multi-network port device group, which increases by a multiple; If a DHCP Ack message sent by the DHCP server is received, it is determined that the current network connection is not disconnected, the receiving flag is cleared and the current network connection state is maintained; wherein the receiving flag includes one or more receiving flags set for each multi-network port device in the multi-network port device group; If the DHCP Ack message sent by the DHCP server is not received, updating the reception flag bit; If the updated receiving flag bit does not exceed the preset flag bit threshold, it is determined that the current network connection is not disconnected, and the process returns to the step of sending the DHCP Request message to the DHCP server; If the updated reception flag exceeds the preset flag threshold, it is determined that the current network connection is disconnected, and the DHCP process is restarted to configure the network parameters; For a multi-network port device directly connected to the DHCP server, after each interval, determine whether the current network connection is disconnected by querying the PHY register; If it is determined that the current network connection is disconnected, restart the DHCP process to configure the network parameters.

2. The network parameter configuration method according to claim 1, characterized in that: The DHCP process includes: Send a DHCP Discover message; If a DHCP Offer message is received from the DHCP server, the DHCP Request message is sent; If a DHCP Ack message sent by the DHCP server is received, network parameters are configured according to the DHCP Offer message.

3. The network parameter configuration method according to claim 1, characterized in that: The updating of the receiving flag bit comprises: Add 1 to the current value of the receiving flag and save it.

4. The network parameter configuration method according to any one of claims 1 to 3, characterized in that: The network parameters include at least one of an IP address, a subnet mask, a default gateway, and a DNS server.

5. A network parameter configuration method, characterized in that: Applied to a DHCP server, the network parameter configuration method includes: Receive DHCP Discover messages sent by multi-network port devices; Sending a corresponding DHCP Offer message to the multi-network port device according to the DHCP Discover message; If a DHCP Request message is received, a corresponding DHCP Ack message is sent to the multi-network port device according to the DHCP Request message, so that the multi-network port device configures network parameters; Receiving a DHCP Request message sent by the multi-network port device; Sending a corresponding DHCP Ack message to the multi-network port device according to the DHCP Request message; Each multi-port device is used for: After each preset time interval, a DHCP Request message is sent to the DHCP server; wherein the preset time interval includes one or two or more same or different time intervals set for each multi-network port device, or the preset time interval is a time interval set according to the cascade position of each multi-network port device in the multi-network port device group, which increases by a multiple; If a DHCP Ack message sent by the DHCP server is received, it is determined that the current network connection is not disconnected, the receiving flag is cleared and the current network connection state is maintained; wherein the receiving flag includes one or more receiving flags set for each multi-network port device in the multi-network port device group; If the DHCP Ack message sent by the DHCP server is not received, updating the reception flag bit; If the updated receiving flag bit does not exceed the preset flag bit threshold, it is determined that the current network connection is not disconnected, and the process returns to the step of sending the DHCP Request message to the DHCP server; If the updated reception flag exceeds the preset flag threshold, it is determined that the current network connection is disconnected, and the DHCP process is restarted to configure the network parameters; A multi-network port device directly connected to the DHCP server, used for: After each interval, the PHY register is queried to determine whether the current network connection is disconnected; If it is determined that the current network connection is disconnected, restart the DHCP process to configure the network parameters.

6. A network parameter configuration system, characterized in that: The network parameter configuration system includes a control terminal device, a DHCP server and a multi-network port device group; The multi-network port device group includes a plurality of multi-network port devices cascaded to each other; The control terminal device establishes a communication connection with the DHCP server and is used to manage the DHCP server; The multi-network port device group establishes a communication connection with the DHCP server, thereby realizing data interaction between the multi-network port devices: Wherein, each multi-network port device in the multi-network port device group is used for: After each preset time interval, a DHCP Request message is sent to the DHCP server; wherein the preset time interval includes one or two or more same or different time intervals set for each multi-network port device in the multi-network port device group, or the preset time interval is a time interval set according to the cascade position of each multi-network port device in the multi-network port device group, which increases by a multiple; If a DHCP Ack message sent by the DHCP server is received, it is determined that the current network connection is not disconnected, the receiving flag is cleared and the current network connection state is maintained; wherein the receiving flag includes one or more receiving flags set for each multi-network port device in the multi-network port device group; If the DHCP Ack message sent by the DHCP server is not received, updating the reception flag bit; If the updated receiving flag bit does not exceed the preset flag bit threshold, it is determined that the current network connection is not disconnected, and the process returns to the step of sending the DHCP Request message to the DHCP server; If the updated reception flag exceeds the preset flag threshold, it is determined that the current network connection is disconnected, and the DHCP process is restarted to configure the network parameters; A multi-network port device directly connected to the DHCP server, used for: After each interval, the PHY register is queried to determine whether the current network connection is disconnected; If it is determined that the current network connection is disconnected, restart the DHCP process to configure the network parameters.

7. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the terminal device is a multi-network port device group, the processor implements the steps of the network parameter configuration method according to any one of claims 1 to 4 when executing the computer program; When the terminal device is a DHCP server, the processor implements the steps of the network parameter configuration method as claimed in claim 5 when executing the computer program.

8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the network parameter configuration method according to any one of claims 1 to 4 or 5 are implemented.

Citation Information

Patent Citations

  • Method for quickly detecting communication of IP channel of household router

    CN104683188A

  • DHCP server state detection method and device, and DHCP repeater

    CN107968845A