IP address dynamic allocation method, system and storage medium

By using the dynamic IP address allocation method in the energy storage control system, the control equipment and sub-equipments connected to the network cable are automatically completed, and the problems of high error rate and wiring complexity in traditional methods are solved, achieving higher accuracy and stability.

CN119383166BActive Publication Date: 2025-05-16SYL (NINGBO) BATTERY CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411944876.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2025-05-16
Estimated Expiration
2044-12-27

AI Technical Summary

Technical Problem

Traditional IP address allocation methods are prone to errors and increase wiring complexity, making it difficult to meet the data transmission needs in energy storage control systems.

Method used

By connecting the network cable between the control device and the sub-device, preparatory instructions and allocation instructions are issued, dynamic allocation of IP addresses is automatically completed, including closing and opening the second port of the sub-device, updating the configuration status until the allocation end condition is met.

Benefits of technology

It realizes the automatic allocation of IP addresses of multiple network devices when only network cables are required, reducing allocation complexity, improving accuracy and stability, and reducing error rates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119383166B_ABST
    Figure CN119383166B_ABST
Patent Text Reader

Abstract

One or more embodiments of the present application propose a method, system and storage medium for dynamic allocation of IP addresses, which belong to the field of network technology. The method includes: sending a preparation instruction to each sub-device by multicast to instruct the switching chip of each sub-device to close the second port, and reporting preparation response data after closing the second port; when the preparation response data meets the allocation start condition, sending an allocation instruction to instruct the sub-device to configure the IP address, open the second port, and report the allocation response data; according to the received allocation response data, the current configuration status is obtained, and if the configuration status meets the condition for continuing allocation, the allocation instruction continues to be sent, otherwise, the address allocation is terminated. In this way, the IP address allocation of multiple network devices is automatically completed without or with a reduction in additional control lines through the network cable, which solves the problem of unstable communication, thereby improving the stability of IP address allocation and reducing the error rate of address allocation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of network technology, and in particular to a method, system and storage medium for dynamically allocating IP addresses. Background Art

[0002] In the operation of energy storage control systems, traditional communication methods such as CAN / RS485 can no longer meet the growing demand for data transmission. Therefore, control units based on network communication are gradually being used in energy storage systems, and such control units need to be assigned IP addresses.

[0003] In relevant application scenarios, static IP addresses are usually used to bind to actual devices. For a single network control unit, IP address allocation can be achieved through manual configuration or by adding address control lines in the network cable. However, manually setting IP addresses is prone to errors; if additional address control lines are used for IP address allocation, it will increase wiring complexity and easily cause errors. Summary of the invention

[0004] In view of this, one or more embodiments of the present application provide a method, system and storage medium for dynamic allocation of IP addresses.

[0005] The technical solutions adopted by one or more embodiments of the present application are as follows:

[0006] In a first aspect, one or more embodiments of the present application provide a method for dynamically allocating an IP address, which is applied to a control device, wherein the control device is connected to a first port of a sub-device via a network cable, and a second port of each sub-device is connected to a first port of a sub-device at a next level via a network cable, and the sub-device includes a switching chip, and the method includes:

[0007] Sending a preparation instruction to each of the sub-devices, the preparation instruction including a command to close the second port and a trigger condition for reporting preparation response data;

[0008] detecting the preparation response data received from each of the sub-devices to determine whether the allocation start condition is met;

[0009] If the preparation response data satisfies the allocation start bar, an allocation instruction is issued, wherein the allocation instruction includes IP address configuration information and a command to open the second port, and a trigger condition for reporting the allocation response data;

[0010] receiving allocation response data reported by the sub-device, and updating the configuration state according to the allocation response data;

[0011] When the configuration state satisfies the condition for continuing allocation, continue to issue the allocation instruction;

[0012] When the configuration state satisfies the allocation end condition, the address allocation is ended.

[0013] Optionally, the step of updating the configuration state according to the allocation response data comprises:

[0014] The preset response time is used as the total time, and the time when the allocation instruction is issued is used as the starting time to obtain the target time period;

[0015] taking the allocation response data received within the target period as target response data;

[0016] The current configuration state is obtained according to the target response data.

[0017] Optionally, the step of obtaining the current configuration state according to the target response data includes:

[0018] Extracting the response code in the target response data, and taking the total number of the allocated response data as the number of response frames;

[0019] When the response code is failure and / or the number of response frames is not one, setting the current configuration state to the first state;

[0020] When the response code is success and the number of response frames is one, the configured number is increased by one, and the current configuration state is set to the second state and the latest configured number.

[0021] Optionally, when the configuration state satisfies an allocation termination condition, the step of terminating address allocation includes:

[0022] When the second state exists in the configuration state and the latest configured number is equal to the target configuration number, multicasting a first end instruction to each of the sub-devices; wherein the first end instruction is used to instruct the sub-device to reset and initialize the network protocol stack according to the newly configured IP address;

[0023] When the first state exists in the configuration state, a second end instruction is multicasted to each of the sub-devices; wherein the second end instruction is used to execute the sub-device without resetting and control the switching chip to open the second port.

[0024] Optionally, when the configuration state satisfies a condition for continuing allocation, the step of continuing to issue the allocation instruction includes:

[0025] When the second state exists in the configuration state and the latest configured number is less than the target configuration number, the allocation instruction continues to be issued.

[0026] Optionally, before the step of sending the preparation instruction to each of the sub-devices, the method further includes:

[0027] Sending an adaptive instruction to each of the sub-devices, the adaptive instruction including a trigger condition for reporting adaptive response data;

[0028] The total number of devices that successfully respond is obtained based on the adaptive response data received from each of the sub-devices, and when the total number of devices is equal to the total number of target configurations, the step of sending the preparation instruction to each of the sub-devices is performed.

[0029] In a second aspect, one or more embodiments of the present application provide a method for dynamically allocating an IP address, which is applied to a sub-device, wherein the sub-device includes a switching chip, a first port of the sub-device is connected to a second port of the control device or an upper-level sub-device via a network cable, and a second port of the sub-device is connected to a first port of a lower-level sub-device via a network cable, and the method includes:

[0030] In the case of receiving a preparation instruction, controlling the switch chip to close the second port and reporting preparation response data to enter an allocation preparation state, wherein the preparation instruction is issued by the control device;

[0031] Upon receiving an allocation instruction and being in an allocation preparation state, checking the legality of the current address allocation according to the reference address and the total number to be configured in the allocation instruction, wherein the allocation instruction is issued by the control device when the preparation response data meets the allocation start condition or the current configuration state meets the allocation continuation condition;

[0032] In the case where the legality check passes, the IP address is configured according to the reference address, and after the IP address configuration is completed, the switching chip is controlled to open the second port, and after the second port is opened, the allocation response data is reported to enter the allocation completion state;

[0033] When receiving an allocation end instruction, exiting the address allocation process, the allocation end instruction is issued by the control device when the current configuration state meets the allocation end condition;

[0034] So that the control device can implement the method for dynamic allocation of IP addresses as described in any one of the first aspects.

[0035] Optionally, the method further comprises:

[0036] Upon receiving the adaptive instruction sent by the control device, checking the legality of the address allocation according to the reference address and the total number to be configured in the adaptive instruction;

[0037] According to the legitimacy check result, a response code is configured, and adaptive response data is reported according to the response code and its own MAC address.

[0038] In a third aspect, one or more embodiments of the present application provide a system for dynamic allocation of IP addresses, including a control device and multiple sub-devices, wherein the sub-devices include a switching chip, a first port of the first sub-device is connected to the control device via a network cable, and a second port of each sub-device is connected to a first port of a next-level sub-device via a network cable;

[0039] The control device is used to implement the method for dynamic allocation of IP addresses as described in any one of the first aspects;

[0040] The sub-device is used to implement the method for dynamic allocation of IP addresses as described in the above-mentioned implementation manner.

[0041] In a fourth aspect, one or more embodiments of the present application provide a storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the method for dynamic allocation of IP addresses as described in any one of the first aspects is implemented.

[0042] The embodiments of the present application provide a method, system and storage medium for dynamic allocation of IP addresses, and the method includes: sending a preparation instruction to each sub-device to instruct the switching chip of each sub-device to close the second port and report preparation response data; when the preparation response data meets the allocation start condition, sending an allocation instruction to instruct the sub-device to configure the IP address, control the switching chip to open the second port and report the allocation response data; receiving the allocation response data reported by the sub-device, updating the configuration status according to the allocation response data, and if the configuration status meets the condition for continuing allocation, continuing to send the allocation instruction, otherwise, ending the address allocation.

[0043] In this way, IP address allocation for multiple network devices can be automatically completed with only network cables and no additional control cables, which reduces the complexity of IP address allocation and greatly improves the accuracy of IP address allocation.

[0044] In addition, each sub-device and control device only needs to be connected by a network cable, which solves the problem of unstable communication caused by long connection cables when network devices are networked using switches, thereby improving the stability of IP address allocation and reducing the error rate of address allocation.

[0045] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0047] Figure 1 A schematic diagram of the system architecture of the IP address dynamic allocation system provided in an embodiment of the present application is shown.

[0048] Figure 2 A schematic diagram of the module architecture of an electronic device provided in an embodiment of the present application is shown.

[0049] Figure 3 One of the flow charts of the method for dynamic allocation of IP addresses provided in an embodiment of the present application is shown.

[0050] Figure 4 The second flowchart of the method for dynamic allocation of IP addresses provided in an embodiment of the present application is shown.

[0051] Figure 5 Shows Figure 4 and Figure 5 Schematic diagram of the process of some sub-steps of step 16.

[0052] Figure 6 The third flowchart of the method for dynamic allocation of IP addresses provided in an embodiment of the present application is shown.

[0053] Explanation of the reference numerals: 10 - IP address dynamic allocation system; 110 - control device; 120 - sub-device; 130 - switching chip; 140 - network cable; P1 - first port; P2 - second port; 20 - electronic device; 210 - memory; 220 - processor; 230 - communication module. DETAILED DESCRIPTION

[0054] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.

[0055] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.

[0056] It should be noted that relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0057] The method for dynamic allocation of IP addresses provided in the embodiment of the present application can be applied to Figure 1 In the IP address dynamic allocation system 10 shown, the IP address dynamic allocation system 10 includes a control device 110 and multiple sub-devices 120. The sub-device 120 includes a switching chip 130 and a first port P1 and a second port P2 provided by the switching chip 130. The first port P1 of a sub-device 120 is connected to the control device 110 via a network cable 140, and the second port P2 of each sub-device 120 is connected to the first port P1 of the next-level sub-device 120 to form a cascade.

[0058] In addition, the first port P1 and the second port P2 of each sub-device 120 are both provided with a UDP (User Datagram Protocol) communication service, so that the control device 110 can multicast to each cascaded sub-device 120 through UDP, such as sending a preparation instruction, an adaptation instruction, an allocation instruction, and an end instruction in a multicast manner, so that the instruction reaches each sub-device whose communication is in an open state. The sub-device supports wired network communication through a switching chip, and the connection method between the control device 110 and the sub-device 120 is optimized.

[0059] The control device 110 sends a preparation instruction to each sub-device 120 by multicast.

[0060] After receiving the preparation instruction, the sub-device 120 controls the switching chip 130 to close the second port P2, and reports the preparation response data after closing the second port P2. After each sub-device 120 closes the second port P2, only the first sub-device 120 is physically connected to the upper controller for communication, and the communication between each sub-device 120 is closed.

[0061] The control device 110 issues an allocation instruction when each received preparation response data meets the allocation start condition.

[0062] Upon receiving the allocation instruction and satisfying the legality of address allocation, the sub-device 120 performs IP address configuration, controls the switch chip 130 to open the second port P2 after completing the IP address configuration, and reports allocation response data after opening the second port P2.

[0063] The control device 110 obtains the current configuration state according to the received allocation response data, and continues to issue allocation instructions when the configuration state meets the allocation continuation condition, and ends the address allocation when the configuration state meets the allocation end condition.

[0064] In this way, the IP address allocation of the first sub-device 120 is implemented first. When the preparation response data of the first sub-device 120 meets the condition for continuing allocation, the control device 110 continues to issue allocation instructions to allocate the IP address of the second sub-device 120. The cycle is repeated until the IP address allocation of all devices is completed, or an error occurs in the IP address allocation.

[0065] In addition, after power-on, the first port P1 and the second port P2 of each sub-device 120 are both in an open state. In order to ensure that IP address allocation is carried out in an orderly manner to reduce the error rate, after power-on, the control device 110 first multicasts and sends an adaptive instruction to each sub-device 120. After receiving the adaptive instruction, each sub-device 120 reports the adaptive response data.

[0066] Furthermore, the control device 110 obtains the total number of devices that have responded successfully based on each adaptive response data, and when the total number of devices is equal to the total number of target configurations, executes the step of multicasting and sending a preparation instruction to each sub-device 120 .

[0067] Among them, the control device 110 can be a personal computer, a laptop, a tablet computer, a mobile terminal, a server, etc., and the sub-device 120 can be a network device, an SDN controller, a WLAN controller, a network traffic controller, a switch control or any network controller (i.e., a controller of a network device).

[0068] Please refer to Figure 2 , is a block diagram of an electronic device 20, which may be Figure 1 The control device 110 or the sub-device 120 in the IP address dynamic allocation system 10 shown. The electronic device 20 includes a memory 210, a processor 220 and a communication module 230. The memory 210, the processor 220 and the communication module 230 are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines.

[0069] The memory 210 is used to store programs or data and can be, but not limited to, a random access memory, a read-only memory, a programmable read-only memory, an erasable read-only memory, an electrically erasable read-only memory, and the like.

[0070] The processor 220 is used to read / write data or programs stored in the memory 210 and execute corresponding functions. For example, Figure 1 In the IP address dynamic allocation system 10 shown, the processor 220 of the control device 110 executes the computer program stored in the memory 210 to implement the IP address dynamic allocation method provided in the embodiment of the present application, and the processor 220 of the sub-device 120 executes the computer program stored in the memory 210 to implement the IP address dynamic allocation method provided in the embodiment of the present application.

[0071] The communication module 230 is used to establish a communication connection between the electronic device 20 and other communication terminals through the network cable 140, and is used to send and receive data through the network cable 140. For example, Figure 1 In the IP address dynamic allocation system 10 shown, the communication between the control device 110 and the sub-device 120 is achieved by connecting the communication modules 230 via the network cable 140 .

[0072] It should be understood that Figure 2 The structure shown is only a schematic diagram of the structure of the electronic device 20. The electronic device 20 may also include Figure 2 More or fewer components as shown, or with Figure 2 Different configurations are shown. Figure 2 Each component shown in the figure can be implemented by hardware, software or a combination thereof.

[0073] In order to improve the problem that manual setting is prone to errors when allocating IP addresses, additional CAN lines and address control lines need to be added. It is difficult to recover the network device IP address after misconfiguration. In addition, the network device uses a switch to connect the network cable 140, which causes unstable communication. The embodiment of the present application provides a method for dynamically allocating IP addresses. Figure 3 , including steps 12 to 19. Thus,: Figure 1 In the IP address dynamic allocation system 10 shown in FIG. Figure 2 The structure shown implements steps 12 to 19 when the processor 220 executes the computer program stored in the memory.

[0074] Step 12A: Send a preparation instruction to each sub-device.

[0075] The preparation instruction includes a command to close the second port and a trigger condition for reporting preparation response data, which is used to instruct the switch chip of each sub-device to close the second port and report preparation response data after closing the second port. Before issuing the preparation instruction, the first port and the second port of each sub-device are both in an open state.

[0076] Step 13, detect the preparation response data received from the sub-device to determine whether the allocation start condition is met. If yes, execute step 14, if not, end the address allocation.

[0077] Step 14: Issue allocation instructions.

[0078] Among them, the allocation instruction includes IP address configuration information and a command to open the second port, as well as a trigger condition for reporting allocation response data, which is used to instruct the sub-device to perform IP address configuration, control the switching chip to open the second port after completing the IP address configuration, and report the allocation response data after opening the second port.

[0079] Step 16: Receive allocation response data reported by the sub-device, and update the configuration state according to the allocation response data.

[0080] Step 18: When the configuration status satisfies the condition for continued allocation, continue to issue allocation instructions.

[0081] Step 19: When the configuration state satisfies the allocation end condition, end the address allocation.

[0082] For example, in combination Figure 1 In the IP address dynamic allocation system 10 shown, when the preparation stage of IP address allocation is reached, the first port P1 and the second port P2 of each sub-device 120 are both in an open state (i.e., the cascaded control device 110 and each sub-device 120 can communicate with each other), and the control device 110 multicasts a preparation instruction to the sub-device 120, and the preparation instruction arrives at each sub-device 120 in turn. After receiving the preparation instruction, the sub-device 120 performs an operation according to the triggering condition that the preparation instruction includes a command to close the second port and report preparation response data, such as closing its own second port P2 through the switching chip 130, and reporting preparation response data after closing the second port P2.

[0083] After each sub-device 120 closes the second port P2, only the first sub-device 120 (i.e., the sub-device 120 connected to the control device 110) communicates with the control device 110, and the connections between other sub-devices 120 are all closed. Therefore, ideally, only the preparation response data of the first sub-device 120 will reach the control device 110.

[0084] After the control device 110 determines that the allocation start condition is met based on the received preparation response data, it issues an allocation instruction. At this time, only the first sub-device 120 receives the allocation instruction. After receiving the allocation instruction, the sub-device 120 performs address configuration operations, such as IP address configuration, based on the IP address configuration information and the command to open the second port in the allocation instruction, as well as the triggering condition for reporting the allocation response data. After completing the IP address configuration, the switch chip 130 is controlled to open the second port P2, and the allocation response data is reported after the second port P2 is opened. At this time, since the second port P2 of the first sub-device 120 is opened, the second sub-device 120 can achieve communication with the control device 110.

[0085] The control device 110 updates the configuration state according to the allocation response data and obtains the current configuration state. If the configuration state meets the conditions for continued allocation, the control device 110 continues to issue allocation instructions to enable the second sub-device 120 to perform the address configuration operation. If not, the address allocation is terminated. Ideally, the control device 110 will repeatedly issue allocation instructions until the address configuration of all sub-devices 120 is completed. In non-ideal situations, the address allocation will be terminated immediately.

[0086] Common IP address allocation methods include: (1) multiple network devices are uniformly connected to the switch, the switch is connected to the main controller, and the technician manually sets the IP address for each network device through the main controller; (2) CAN lines, address lines and network cables are combined as communication lines, and network devices are connected hand in hand through communication lines. CAN communication and address lines are used to set IP addresses. The first method is time-consuming, error-prone, inconvenient to replace equipment later, and the network cable of the farthest network device is too long, resulting in communication anomalies, and the network device IP address is difficult to recover after misconfiguration. The communication line of the second method needs to be customized, and directly connected to the main controller will cause the device to burn, which is not conducive to the connection of the main controller or other standard network devices. It is difficult to find the problem when the internal wiring harness is poorly crimped.

[0087] The dynamic IP address allocation method provided in the embodiment of the present application can automatically complete the IP address allocation of multiple network devices with only a network cable without an additional control line, thereby reducing the complexity of IP address allocation and greatly improving the accuracy of IP address allocation.

[0088] In addition, each sub-device and the control device only need to be connected by a network cable, and the cascade method shortens the length of the network cable, solving the problem of unstable communication caused by the long network cable when the network device is connected using a switch, thereby improving the stability of IP address allocation. Through the opening and closing control of the second port, it is ensured that under normal circumstances, only one sub-device that is not configured with an IP address communicates with the control device at a time, and performs address configuration in response to the allocation instruction, which to a certain extent avoids multiple sub-devices performing address configuration in response to the same allocation instruction, and the occurrence of confusion such as the same IP address configuration, thereby reducing the error rate of address allocation.

[0089] Reference Figure 4 The method for dynamic IP address allocation provided in the embodiment of the present application further includes steps 22 to 28. Thus,: Figure 1 In the IP address dynamic allocation system 10 shown in FIG. Figure 2 The structure shown implements steps 22 to 28 when the processor 220 executes the computer program stored in the memory.

[0090] Step 22: upon receiving the preparation instruction, control the switch chip to close the second port and report preparation response data to enter the allocation preparation state.

[0091] The preparation instruction is issued by the control device and includes a command to close the second port and a trigger condition for reporting preparation response data.

[0092] Step 24, when the allocation instruction is received and the allocation is ready, the legality of the current address allocation is checked according to the reference address in the allocation instruction and the total number to be configured.

[0093] Among them, the allocation instruction is issued by the control device when the prepared response data meets the allocation start condition, or the current configuration status meets the continued allocation condition. It includes IP address configuration information and the command to open the second port, as well as the trigger condition for reporting the allocation response data.

[0094] Step 26, if the legality check passes, configure the IP address according to the reference address, control the switch chip to open the second port after the IP address configuration is completed, and report allocation response data after opening the second port to enter the allocation completion state.

[0095] Step 28: upon receiving the allocation end instruction, exit the address allocation process.

[0096] The allocation end instruction is issued by the control device when the current configuration state satisfies the allocation end condition.

[0097] Therefore, the sub-device 120 executes steps 22 to 28 to cooperate with the control device 110 to implement the IP address dynamic allocation method provided in the embodiment of the present application.

[0098] Another example is to combine Figure 1 In the IP address dynamic allocation system 10 shown, when the preparation stage of IP address allocation is reached, the first port P1 and the second port P2 of each sub-device 120 are both in an open state (i.e., the cascaded control device 110 and each sub-device 120 can communicate), and the control device 110 multicasts the preparation instruction to the sub-device 120, and the preparation instruction arrives at each sub-device 120 in turn. After receiving the preparation instruction, the sub-device 120 closes its own second port P2 through the switching chip 130, and reports the preparation response data (i.e., the trigger condition for reporting the preparation response data) after closing the second port P2, so as to enter the allocation preparation state. At this time, only the first sub-device 120 (i.e., the sub-device 120 connected to the control device 110) communicates with the control device 110, and the connections between other sub-devices 120 are all closed. Therefore, ideally, only the preparation response data of the first sub-device 120 will reach the control device 110.

[0099] Here, each sub-device 120 includes at least three states, namely, allocation preparation state, allocation completion state and idle state. The state value corresponding to the allocation preparation state may be 0, the state value corresponding to the allocation completion state may be 1, and the state value corresponding to the idle state may be 2.

[0100] The control device 110 determines that the allocation start condition is met based on the received preparation response data, and then issues an allocation instruction. When it is the first allocation instruction, only the first sub-device 120 receives the allocation instruction. After receiving the allocation instruction, the sub-device 120 checks the legality of the current address allocation according to the allocation instruction. If the legality check passes, the address configuration operation is performed, such as IP address configuration. After the IP address configuration is completed, the control switch chip 130 opens the second port P2, and after opening the second port P2, the allocation response data (i.e., the trigger condition for reporting the allocation response data) is reported to enter the allocation completion state (i.e., the state value is set to 1). At this time, since the second port P2 of the first sub-device 120 is open, the second sub-device 120 can communicate with the control device 110.

[0101] The control device 110 updates the configuration state according to the received allocation response data, that is, obtains the current configuration state. If the configuration state meets the conditions for continued allocation, it continues to issue the second allocation instruction to enable the second sub-device 120 to perform the address configuration operation. If not, the address allocation is terminated. Ideally, the control device 110 will repeatedly issue n allocation instructions until the address configuration of all sub-devices 120 is completed. In non-ideal situations, the address allocation will be terminated immediately, such as issuing an allocation end instruction. After receiving the allocation end instruction, the sub-device 120 exits the address allocation process.

[0102] In the above process, after the sub-device 120 checks the legality of the current address allocation according to the allocation instruction, if the legality check fails, the allocation response data is directly returned without performing the address configuration operation. The allocation response data returned directly and the allocation response data returned after performing the address configuration operation correspond to different configuration states.

[0103] In the above steps 12A to 19, and steps 22 to 28, the implementation method of each step can be flexibly set.

[0104] For example, in step 22, the sub-device 120 may directly close the second port P2 and report the preparation response data to enter the allocation preparation state, or may perform a status check first and then close the second port P2, and the implementation method is not limited.

[0105] In order to improve the situation where errors in address configuration midway lead to waste of resources, the idea of ​​the sub-device 120 first checking the legality of address allocation is introduced in step 22, and then entering the allocation preparation state when the legality is passed.

[0106] For example, after receiving the preparation instruction, the sub-device 120 parses the IP address configuration information from the preparation instruction, obtains the reference address (the reference address is the last network part of the configured IP address in the network segment to which each sub-device 120 belongs) and the total number to be configured, calculates the sum of the reference address and the total number to be configured, and obtains the end address. If the end address exceeds the legal address segment range (such as 100 to 199), the legitimacy of the address allocation is not met. If the end address is within the legal address segment range, the legitimacy of the address allocation is met.

[0107] If the legitimacy condition is not met, the sub-device 120 sets the response code to failure, and reports the response code, the current address and the MAC address of the sub-device 120 as preparation response data.

[0108] Under the condition of meeting the legitimacy, the sub-device 120 closes the second port P2, counts down according to the preset port closing delay, and after the countdown ends (which means that the second port P2 has been closed and the trigger condition for reporting the allocation response data is met), reports the allocation response data and the preparation response data to enter the allocation preparation state. At this time, the second response address includes the current address of the sub-device 120, the MAC address and the response code set to success.

[0109] The port closing delay can be 100ms or 150ms, and its value is not limited.

[0110] Ideally, since the second port P2 of each sub-device 120 is closed, the control device 110 will only receive the preparation response data of the first sub-device 120. Therefore, in step 13, after the preparation instruction is issued, if a frame of preparation response data is received within the preset response time (such as 1s, 1.5s, etc.), and the response code therein is successful, it is determined that the allocation start condition is met. If no preparation response data is received, multiple frames of preparation response data are received, or one frame of preparation response data is received but the response code is failed, it means that there is an error and the allocation start condition is not met.

[0111] Through the above method, errors are corrected in time during the preparation stage to avoid resource consumption caused by errors in the middle. When communication is correct and address allocation is legal, the control device 110 sends the allocation start again to enter the allocation stage.

[0112] In step 24, after receiving the allocation instruction, it can be checked whether the current state meets the legality requirements (such as whether the resources are sufficient, whether the IP address has been configured, etc.), or the legality of the information in the allocation instruction can be checked. The above methods are all examples and their implementation methods are not limited.

[0113] In order to avoid address configuration exceeding the limit and wasting resources, similar to step 22, in step 24, a concept of checking whether the reference address in the allocation instruction and the total number to be configured meet the legality is introduced.

[0114] For example, the sum of the reference address and the total number to be configured is calculated to obtain the end address. If the end address exceeds the legal address segment range (such as 100-199), the legality of the address allocation is not met. If the end address is within the legal address segment range, the legality of the address allocation is met.

[0115] If the legitimacy condition is not met, the sub-device 120 sets the response code to failure, and reports the response code, the current address and the MAC address of the sub-device 120 as allocation response data.

[0116] Under the condition of meeting the legality, the sub-device 120 sets the response code to success, adds one to the reference address as the host part, combines the preset network part and the host part as the IP address of the sub-device 120, controls the switching chip 130 to open the second port P2, counts down according to the preset port opening delay, and reports the allocation response data after the countdown ends (which means that the second port P2 has been opened and the trigger condition for reporting the preparation response data has been met) to enter the allocation completion state. The second response address at this time includes the IP address, MAC address and the response code set to success. Among them, the port opening delay can be 100ms or 150ms, and the above data are all examples, and their values ​​are not limited.

[0117] Here, the cascaded sub-devices belong to the same network segment, so the network part of the IP address is the same. For example, if the network part is 192.168.1, the IP address of the first sub-device is 192.168.1.10 / 24, and the IP address of the second sub-device is 192.168.1.11 / 24. The only difference between the two is the host part "10" and "11". In addition, the network part is stored in the sub-devices.

[0118] In addition, after entering the allocation phase, the reference address and the total number to be configured change dynamically. For example, the reference address and the total number to be configured in the allocation instruction received by the first sub-device 120 are 101 and 10 respectively, and the reference address and the total number to be configured in the allocation instruction received by the second sub-device 120 are 102 and 9 respectively.

[0119] In the above manner, after receiving the allocation instruction, each sub-device 120 first performs an address allocation legitimacy check, and then performs address configuration if the check passes, so as to ensure the accuracy of the configured IP address, thereby greatly reducing the error rate.

[0120] After the control device 110 issues the allocation instruction, in order to correctly obtain and identify the current configuration status, the concept of using the allocation response data within a specified period as a basis for judgment is introduced in the process of updating the configuration status in step 16. Figure 5 , the process of step 16 updating the configuration status according to the allocation response data includes steps 161 to 165.

[0121] Step 161, taking the preset response time as the total time and the time when the preparation instruction is issued as the starting time, to obtain the target time period.

[0122] The response time can be 1s or 2s, and its value is not limited.

[0123] Step 163: Use the allocation response data received within the target period as target response data.

[0124] Step 165, obtaining the current configuration state according to the target response data.

[0125] Through the above method, the configuration state is accurately obtained according to the allocation response data corresponding to the allocation instruction, and the interfering incorrect response data is eliminated, so that the configuration state is more accurate.

[0126] After entering the allocation phase, the sub-device 120 in the allocation completion state does not respond to the allocation instruction. Therefore, ideally, each time the control device 110 issues an allocation instruction, only one allocation response data is obtained within the target time period of the allocation instruction.

[0127] In order to timely identify the situation of address configuration error and avoid the situation of resource consumption caused by error in the middle, in step 165, the response code in the target response data is extracted, and the total number of allocated response data is used as the number of response frames.

[0128] When the response code is failure and / or the number of response frames is not one, the current configuration state is set to the first state, wherein the first state indicates that the address allocation is incorrect.

[0129] When the response code is success and the number of response frames is one, the configured number is increased by one, and the current configuration state is set to the second state and the latest configured number. The second state indicates that the address allocation is correct.

[0130] A response code of failure means that the address allocation is illegal, and a response frame number of not one means that communication with the sub-device 120 is disordered, and two or more sub-devices 120 may be configured with the same IP address.

[0131] Through the above method, in the address allocation stage, illegal address allocation, two or more sub-devices 120 configured with the same IP address and other errors are promptly identified to ensure that the address allocation is performed correctly, greatly reducing the error rate of address allocation. At the same time, when an error occurs in address allocation, it is stopped in time to avoid further consumption of resources.

[0132] On the basis of the above, the method of judging whether the configuration state meets the condition of continuing allocation or the condition of ending allocation can be flexibly set. For example, when the second state (i.e., the last address configuration) exists in the configuration state, the condition of continuing allocation is met, otherwise the condition of ending allocation is met, or the judgment can be made based on the first state, the second state, and the number of configurations in the comprehensive configuration state. The above methods are all examples, and the implementation method is not limited.

[0133] In order to ensure that the IP address allocation of each sub-device 120 is completed in an orderly and correct manner, and the sub-device 120 can be restored normally after misconfiguration, the concept of continuing the allocation when the address configuration is successful and there are sub-devices 120 to be configured, ending the allocation when the address configuration is successful and there are no sub-devices 120 to be configured, and resetting the sub-device 120 when the address configuration fails is introduced in step 18 and step 19.

[0134] For example, in step 18, when the second state exists in the configuration state and the latest configured number is equal to the target configuration number, it means that the IP address configuration of each sub-device 120 is accurately completed. At this time, the control device 110 multicasts and sends a first end instruction to each sub-device 120. The first end instruction is used to instruct the sub-device 120 to reset and initialize the network protocol stack according to the newly configured IP address.

[0135] When the first state exists in the configuration state, it means that the address configuration is illegal or the IP address is repeated. At this time, the second end instruction is multicast to each sub-device 120. The second end instruction is used to execute the sub-device 120 without resetting and control the switch chip 130 to open the second port P2.

[0136] In step 28, if the sub-device 120 receives the first end instruction, the sub-device 120 performs a reset operation and initializes the network protocol stack according to the newly configured IP address to use the newly configured IP address. If the sub-device 120 receives the second end instruction, each sub-device 120 maintains the original state, the sub-device 120 is not reset, and the newly configured IP address is not used. Each sub-device 120 is still in a state without an IP address.

[0137] In step 19, when the first state exists in the configuration state and the latest configured number is less than the target configuration number, it means that the IP address configuration is correct but there are still sub-devices 120 to be configured. At this time, the control device 110 continues to issue allocation instructions.

[0138] By the above method, after the IP address misconfiguration is identified, the newly configured IP address is not applied, which improves the problem of difficulty in normal recovery after no configuration. At the same time, it ensures that the IP address configuration of the sub-device 120 is carried out in an orderly and correct manner, avoids missing devices, and greatly reduces the probability of IP address misconfiguration.

[0139] In order to complete the IP address allocation of each sub-device 120 as adaptively and accurately as possible, and to timely identify the configuration error, to avoid the difficulty in normal recovery after the IP address misconfiguration due to communication or quantity errors. The concept of pre-preparation device quantity detection is introduced in the IP address dynamic allocation method provided in the embodiment of the present application. Figure 6The method for dynamic allocation of IP addresses also includes step 11 and step 12B, both of which are performed by Figure 1 The control device 110 in the IP address dynamic allocation system 10 is executed.

[0140] Step 11: Send an adaptive instruction to each sub-device.

[0141] Step 12B, according to each adaptive response data, the total number of devices that respond successfully is obtained, and when the total number of devices is equal to the total number of target configurations, a preparation instruction is issued to each sub-device.

[0142] The adaptive instruction includes a trigger condition for reporting adaptive response data, which is used to instruct the sub-device to report adaptive response data. The total number of devices that successfully respond is equal to the total number of adaptive response data with a response code of success. In the above step 12B, only the adaptive response data received within the response time is used to count the total number of devices that successfully respond, eliminating interference from other additional signals.

[0143] After receiving the adaptive command, the sub-devices with correct communication will feedback the adaptive response data.

[0144] Therefore, through the above steps 11 to 12B, the preparation stage is entered only when the total number of devices that respond successfully is equal to the total number of target configurations. This can detect both the communication status of the sub-devices and the response status of the sub-devices, thereby avoiding the situation where the IP address is misconfigured due to incorrect communication or quantity.

[0145] To further ensure the accuracy of IP address configuration, please refer to Figure 6 The method for dynamic allocation of IP addresses also includes step 21A and step 21B, both of which are performed by Figure 1 The sub-device 120 in the IP address dynamic allocation system 10 is shown to execute.

[0146] Step 21A: upon receiving the adaptation instruction sent by the control device, checking the legality of the address allocation according to the reference address and the total number to be configured in the adaptation instruction.

[0147] Step 21B, configure the response code according to the legitimacy check result, and report the adaptive response data according to the response code and its own MAC address.

[0148] Among them, the trigger condition for reporting the adaptive response data is to obtain the legitimacy check result and complete the response code configuration. The adaptive response data is used to instruct the control device to issue a preparation instruction. The process of checking the legitimacy of the address allocation is the same as the address allocation legitimacy check mentioned above, that is, the sum of the reference address and the total number to be configured is calculated to obtain the terminal address. If the terminal address exceeds the legal address segment range, the legitimacy of the address allocation is not met. If the terminal address is within the legal address segment range, the legitimacy of the address allocation is met.

[0149] In the above manner, during the adaptive process before the preparation stage, the sub-device detects whether the address configuration to be performed is legal (i.e., whether it exceeds the limit), and the control device determines whether to issue a preparation instruction based on the legality check result of the address configuration of each sub-device. In this way, both the communication status of the sub-device and the legality of the address configuration can be detected, which helps to further ensure the accuracy of IP address configuration.

[0150] Under abnormal conditions, some sub-devices 120 may not be able to successfully receive various instructions from the control device 110. In view of this, in the method for dynamic IP address allocation, a specific time window mechanism is configured for each sub-device 120: if no further instructions related to address allocation are received within the time window, the sub-device 120 will automatically exit the address adaptive mode and control the switch chip 130 to open the second port P2. In this way, it is ensured that when the IP address dynamic allocation system 10 encounters an abnormal situation, each sub-device 120 can still maintain data communication capabilities with each other.

[0151] The above-mentioned adaptive response data, preparation response data and allocation response data all contain MAC addresses and response codes (success or failure). Therefore, when the control device ends the address allocation due to receiving multiple allocation response data within the response time, the corresponding sub-device can be located based on the MAC address to quickly locate the sub-device that caused the abnormal address allocation. Similarly, when the address allocation is ended because the response code in the adaptive response data, preparation response data or allocation response data is failure, the corresponding sub-device can also be located based on the MAC address to quickly locate the sub-device that caused the abnormal address allocation. In this way, the efficiency and accuracy of troubleshooting are greatly improved, and the difficulty of maintenance is reduced.

[0152] Based on the same application concept as the above-mentioned IP address dynamic allocation method, refer to Figure 1 The embodiment of the present application also provides an IP address dynamic allocation system 10, including a control device 110 and multiple sub-devices 120, the sub-device 120 includes a switching chip 130, the first port P1 of the first sub-device 120 is connected to the network cable 140 of the control device 110, and the second port P2 of each sub-device 120 is connected to the first port P1 of the next-level sub-device 120 by the network cable 140.

[0153] The control device 110 is used to implement the method for dynamic allocation of IP addresses including steps 11 to 19 as provided above.

[0154] The sub-device 120 is used to implement the method for dynamic allocation of IP addresses including steps 21A to 28 provided above.

[0155] The above-mentioned IP address dynamic allocation system 10 can automatically complete the IP address allocation of multiple network devices without additional control lines, reducing the complexity of IP address allocation and greatly improving the accuracy of IP address allocation. At the same time, it improves the problem that the IP address of the network device is difficult to recover normally after misconfiguration, and the problem that the connection cable is too long and causes unstable communication when the network device uses a switch to form a network.

[0156] Based on the same application concept as the above-mentioned IP address dynamic allocation method, the embodiment of the present application also provides an IP address dynamic allocation device, including an allocation control module and an allocation execution module.

[0157] The allocation control module is used to execute steps 11 to 19 provided above, that is, to issue an adaptation instruction, a preparation instruction, an allocation instruction and an end instruction.

[0158] An execution module is allocated to execute steps 21 to 28 provided above.

[0159] The above distribution control module is applied to Figure 1 The control device 110 in the IP address dynamic allocation system 10 shown in the figure, the allocation execution module is applied to Figure 1 The sub-device 120 in the IP address dynamic allocation system 10 is shown.

[0160] Through the synergy of the allocation control module and the allocation execution module, the IP address allocation of multiple network devices can be automatically completed without additional control lines, reducing the complexity of IP address allocation and greatly improving the accuracy of IP address allocation. At the same time, it improves the problem that the IP address of network devices is difficult to recover normally after misconfiguration, and the problem of unstable communication caused by the long connection cable when network devices are connected using switches.

[0161] Each module of the above-mentioned IP address dynamic allocation device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor 220 in the electronic device 20 in the form of hardware, or can be stored in the memory 210 of the electronic device 20 in the form of software, so that the processor 220 can call and execute the operations corresponding to each of the above modules to implement the IP address dynamic allocation method provided above.

[0162] The embodiment of the present application also provides an electronic device 20, including a processor 220 and a memory 210, wherein the memory 210 stores a computer program that can be executed by the processor 220, and the processor 220 can execute the computer program to implement the dynamic IP address allocation method provided above.

[0163] The embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by the processor 220, the method for dynamic allocation of IP addresses proposed in the embodiment of the present application is implemented.

[0164] In summary, the method, system, and storage medium for dynamic IP address allocation provided by the embodiments of the present application have at least the following beneficial effects:

[0165] (I) One-click adaptive allocation of IP addresses, not limited by the network segment where the current IP address of the network controller is located. Through the UDP multicast communication principle, one-click IP address allocation can be achieved, which can solve the problem of being unable to find the network controller normally due to incorrect IP address configuration;

[0166] (ii) Avoid electrical interference: Using hand-in-hand cascading to build a network can avoid electromagnetic interference caused by long wiring harnesses at the remote network controller;

[0167] (III) Rapid fault location: By controlling the opening and closing of specific ports (i.e., the first port and the second port) of the switching chip, abnormalities in address allocation can be quickly located, greatly improving the efficiency and accuracy of troubleshooting and reducing the difficulty of maintenance;

[0168] (IV) Use standard network cable harness: There is no need to combine CAN cables, address cables and other signal cables with network cables as in other solutions. Use standard network cable harness, which is convenient for replacement or connection with other devices.

[0169] (V) Easy to implement: This technical solution has no hardware platform restrictions and can be implemented on a variety of hardware platforms;

[0170] (VI) It reduces the probability of IP address misconfiguration, solves the problem of the need to add additional CAN lines and address control lines when allocating network IP addresses, the difficulty in restoring IP addresses after misconfiguration, and the problem of unstable communications caused by long network cables when using switches for networking.

[0171] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0172] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0173] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories, random access memories, magnetic disks, or optical disks.

[0174] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method for dynamic allocation of IP addresses, characterized in that: Applied to a control device, the control device is connected to a first port of a sub-device through a network cable, the second port of each sub-device is connected to the first port of the sub-device at the next level through a network cable, the sub-device includes a switching chip, and the method includes: Sending a preparation instruction to each of the sub-devices, wherein the preparation instruction includes a command to close the second port and a trigger condition for reporting preparation response data; detecting the preparation response data received from each of the sub-devices to determine whether the allocation start condition is met; If the preparation response data meets the allocation start condition, an allocation instruction is issued, wherein the allocation instruction includes IP address configuration information and a command to open the second port, and a trigger condition for reporting the allocation response data; receiving allocation response data reported by the sub-device, and updating the configuration state according to the allocation response data; When the configuration state satisfies the condition for continuing allocation, continue to issue the allocation instruction; When the configuration state satisfies the allocation end condition, ending the address allocation; The preparation response data and the allocation response data both include a response code, the preparation instruction and the allocation instruction both include a reference address and a total number to be configured, the sum of the reference address and the total number to be configured is the end address, if the end address exceeds the legal address segment range, the response code is failure, if the end address is within the legal address segment range, the response code is success; After the preparation instruction is issued, if a frame of preparation response data is received within the preset response time, and the response code therein is successful, it is determined that the allocation start condition is met; if no preparation response data is received, multiple frames of preparation response data are received, or one frame of preparation response data is received but the response code is failure, the allocation start condition is not met; The step of updating the configuration state according to the allocation response data comprises: updating the configuration state according to the response frame number of the allocation response data and / or the response code in the response data; The step of ending address allocation when the configuration state satisfies the allocation end condition comprises: When the second state exists in the configuration state and the latest configured number is equal to the target configuration number, multicasting a first end instruction to each of the sub-devices; wherein the first end instruction is used to instruct the sub-device to reset and initialize the network protocol stack according to the newly configured IP address; When the first state exists in the configuration state, a second end instruction is multicasted to each of the sub-devices; wherein the second end instruction is used to execute the sub-device without resetting and control the switching chip to open the second port.

2. The method for dynamic allocation of IP addresses according to claim 1, characterized in that: The step of updating the configuration state according to the allocation response data comprises: The preset response time is used as the total time, and the time when the allocation instruction is issued is used as the starting time to obtain the target time period; taking the allocation response data received within the target period as target response data; The current configuration state is obtained according to the target response data.

3. The method for dynamic allocation of IP addresses according to claim 2, characterized in that: The step of obtaining the current configuration state according to the target response data comprises: Extracting the response code in the target response data, and taking the total number of the allocated response data as the number of response frames; When the response code is failure and / or the number of response frames is not one, setting the current configuration state to the first state; When the response code is success and the number of response frames is one, the configured number is increased by one, and the current configuration state is set to the second state and the latest configured number.

4. The method for dynamic allocation of IP addresses according to any one of claims 1 to 3, characterized in that: The step of continuing to issue the allocation instruction when the configuration state meets the continued allocation condition includes: When the second state exists in the configuration state and the latest configured number is less than the target configuration number, the allocation instruction continues to be issued.

5. The method for dynamic allocation of IP addresses according to any one of claims 1 to 3, characterized in that: Before the step of sending the preparation instruction to each of the sub-devices, the method further includes: Sending an adaptive instruction to each of the sub-devices, the adaptive instruction including a trigger condition for reporting adaptive response data; The total number of devices that successfully respond is obtained based on the adaptive response data received from each of the sub-devices, and when the total number of devices is equal to the total number of target configurations, the step of sending the preparation instruction to each of the sub-devices is performed.

6. A method for dynamic allocation of IP addresses, characterized in that: Applied to a sub-device, the sub-device includes a switching chip, the first port of the sub-device is connected to the second port of the control device or the upper-level sub-device through a network cable, and the second port of the sub-device is connected to the first port of the sub-device of the next level through a network cable, the method includes: In the case of receiving a preparation instruction, controlling the switch chip to close the second port and reporting preparation response data to enter an allocation preparation state, wherein the preparation instruction is issued by the control device; Upon receiving an allocation instruction and being in an allocation preparation state, checking the legality of the current address allocation according to the reference address and the total number to be configured in the allocation instruction, wherein the allocation instruction is issued by the control device when the preparation response data meets the allocation start condition or the current configuration state meets the allocation continuation condition; In the case where the legality check passes, the IP address is configured according to the reference address, and after the IP address configuration is completed, the switching chip is controlled to open the second port, and after the second port is opened, the allocation response data is reported to enter the allocation completion state; When receiving an allocation end instruction, exiting the address allocation process, the allocation end instruction is issued by the control device when the current configuration state meets the allocation end condition; So that the control device can implement the method for dynamic allocation of IP addresses as described in any one of claims 1 to 5.

7. The method for dynamic allocation of IP addresses according to claim 6, characterized in that: The method further comprises: Upon receiving the adaptive instruction sent by the control device, checking the legality of the address allocation according to the reference address and the total number to be configured in the adaptive instruction; According to the legitimacy check result, a response code is configured, and adaptive response data is reported according to the response code and its own MAC address.

8. A system for dynamic allocation of IP addresses, characterized in that: It includes a control device and multiple sub-devices, wherein the sub-devices include a switching chip, a first port of the first sub-device is connected to the control device via a network cable, and a second port of each sub-device is connected to a first port of a sub-device at a next level via a network cable; The control device is used to implement the method for dynamic allocation of IP addresses according to any one of claims 1 to 5; The sub-device is used to implement the method for dynamic IP address allocation as described in claim 6 or 7.

9. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for dynamic IP address allocation according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Address allocation system and method

    CN110995889A