IP address allocation method and device, electronic equipment and medium

Through unicast communication between AP and DHCP server, network shocks caused by broadcast packets during IP address acquisition in wireless LAN are solved, and the IP address allocation speed is improved.

CN120529293APending Publication Date: 2025-08-22NEW H3C TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510715147.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-29
Publication Date
2025-08-22

AI Technical Summary

Technical Problem

Frequent broadcast messages during the acquisition of IP addresses by terminal devices in wireless LANs affect network traffic and speed, especially in high concurrency situations.

Method used

The AP intercepts the DHCP request packets of the terminal device and sends them to the DHCP server in unicast form. The DHCP server also replys to the IP address in unicast form to avoid the propagation of broadcast messages in the wireless network.

Benefits of technology

It reduces the impact of broadcasting in wireless networks, reduces the impact on normal traffic, and improves the speed at which terminal devices acquire IP addresses.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120529293A_ABST
    Figure CN120529293A_ABST
Patent Text Reader

Abstract

The invention provides an IP address allocation method and device, electronic equipment and a medium. The method comprises the following steps: the AP intercepts a first dynamic host configuration protocol DHCP request message sent by a first terminal device; according to the recorded server unicast address, a first DHCP request message is sent to a DHCP server in a unicast mode; the DHCP server receives a first DHCP request message sent by the AP in a unicast form; allocating an IP address to the first terminal device according to the first DHCP request message; sending a first DHCP allocation message to the AP in a unicast form, wherein the first DHCP allocation message comprises an IP address allocated to the first terminal device; and if the AP receives a first DHCP allocation message sent by the DHCP server in a unicast form, and the first DHCP allocation message comprises the IP address allocated to the first terminal device, the IP address is sent to the first terminal device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the field of communication technology, and in particular to methods, devices, electronic devices, and media for allocating IP addresses. Background Art

[0002] Wireless LANs typically use an AC and AP architecture. When a terminal goes online in a wireless LAN, it requests an IP address from a DHCP server. However, in the DHCP protocol, all interactive messages are sent as broadcasts. During each IP address acquisition process, the terminal sends five broadcast messages to the AP, which then broadcasts them within the wireless LAN. All devices in the wireless LAN (including other APs, ACs, and terminals) receive these broadcasts. Furthermore, the DHCP server also sends responses to terminals in a broadcast format. As a result, broadcasts are frequent within the wireless LAN. Broadcasts can have a significant impact on the network. When there are a large number of terminals or a high number of concurrent online connections, this can affect normal wireless LAN traffic and the speed at which terminals can obtain IP addresses. Summary of the Invention

[0003] To overcome the problems existing in the related art, this specification provides an IP address allocation method, device, electronic device and medium.

[0004] According to a first aspect of an embodiment of the present specification, an IP address allocation method is provided, which is applied to an access point AP. The method includes: intercepting a first Dynamic Host Configuration Protocol (DHCP) request message sent by a first terminal device; sending the first DHCP request message to a DHCP server in unicast form according to a recorded server unicast address; and if a first DHCP allocation message sent by the DHCP server in unicast form is received, and the first DHCP allocation message includes an IP address allocated to the first terminal device, sending the IP address to the first terminal device.

[0005] According to a second aspect of an embodiment of the present specification, an IP address allocation method is provided, which is applied to a Dynamic Host Configuration Protocol DHCP server. The method includes: receiving a first DHCP request message sent by an AP in unicast form, where the first DHCP request message is used to request allocation of an IP address for a first terminal device; allocating an IP address to the first terminal device based on the first DHCP request message; and sending a first DHCP allocation message to the AP in unicast form, where the first DHCP allocation message includes the IP address allocated to the first terminal device.

[0006] According to a third aspect of the embodiments of this specification, an IP address allocation device is provided, which is applied to an AP. The device includes: a first interception module, which is used to intercept a first Dynamic Host Configuration Protocol DHCP request message sent by a first terminal device; a first sending module, which is used to send the first DHCP request message to a DHCP server in unicast form according to a recorded server unicast address; and an allocation message forwarding module, which is used to send the IP address allocated to the first terminal device to the first terminal device upon receiving a first DHCP allocation message sent by the DHCP server in unicast form.

[0007] According to a fourth aspect of the embodiments of this specification, an IP address allocation device is provided, which is applied to a DHCP server. The device includes: a first receiving module, configured to receive a first DHCP request message sent by an AP in unicast form, where the first DHCP request message is used to request allocation of an IP address for a first terminal device; an address allocation module, configured to allocate an IP address to the first terminal device based on the first DHCP request message; and an allocation message sending module, configured to send a first DHCP allocation message to the AP in unicast form, where the first DHCP allocation message includes the IP address allocated to the first terminal device.

[0008] According to a fifth aspect of the embodiments of this specification, there is provided an electronic device, including:

[0009] processor;

[0010] a memory for storing processor-executable instructions;

[0011] The processor is configured to execute the IP address allocation method of the first aspect or any corresponding embodiment thereof.

[0012] According to a sixth aspect of the embodiments of this specification, there is provided an electronic device, including:

[0013] processor;

[0014] a memory for storing processor-executable instructions;

[0015] The processor is configured to execute the IP address allocation method of the second aspect or any corresponding embodiment thereof.

[0016] According to the seventh aspect of the embodiments of this specification, a computer-readable storage medium is provided, on which computer instructions are stored, and the computer instructions are used to enable a computer to execute the IP address allocation method of the above-mentioned first aspect or any corresponding embodiment thereof.

[0017] According to an eighth aspect of the embodiments of this specification, a computer-readable storage medium is provided, on which computer instructions are stored, and the computer instructions are used to enable a computer to execute the IP address allocation method of the above-mentioned second aspect or any corresponding embodiment thereof.

[0018] The technical solutions provided by the embodiments of this specification may have the following beneficial effects:

[0019] In the embodiment of this specification, the AP intercepts the DHCP request message and sends the DHCP request message of the terminal device to the DHCP server in unicast form according to the recorded server unicast address, so that the DHCP request message is no longer broadcast to all devices in the wireless network, avoiding the impact of frequent broadcasts on the network during the process of the terminal device obtaining an IP address, reducing the impact on normal traffic in the wireless network, and also improving the speed at which the terminal device obtains an IP address.

[0020] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the specification and, together with the description, serve to explain the principles of the specification.

[0022] Figure 1 It is a schematic diagram of a system architecture according to an exemplary embodiment of this specification.

[0023] Figure 2 This is a flowchart of an IP address allocation method according to an exemplary embodiment of this specification.

[0024] Figure 3 This is a hardware structure diagram of the computer device where the IP address allocation device in the embodiment of this specification is located.

[0025] Figure 4 This is a block diagram of an IP address allocation device according to an exemplary embodiment of the present specification.

[0026] Figure 5 This is a block diagram of another IP address allocation device according to an exemplary embodiment of this specification. DETAILED DESCRIPTION

[0027] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with this specification. Rather, they are merely examples of apparatus and methods consistent with certain aspects of this specification, as detailed in the appended claims.

[0028] The terms used in this specification are for the purpose of describing specific embodiments only and are not intended to limit this specification. As used in this specification and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.

[0029] It should be understood that although the terms first, second, third, etc. may be used in this specification to describe various information, such information should not be limited to these terms. These terms are merely used to distinguish information of the same type from one another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information without departing from the scope of this specification. Depending on the context, the term "if" as used herein may be interpreted as "when," "when," or "in response to determining."

[0030] Next, the embodiments of this specification are described in detail.

[0031] The following combination Figure 1 The system architecture to which the IP address allocation method and apparatus can be applied in the embodiments of this specification is described. It should be noted that: Figure 1 What is shown is merely an example of a system architecture to which the embodiments of this specification can be applied, to help those skilled in the art understand the technical content of this specification, but does not mean that the embodiments of this specification cannot be used in other devices, systems, environments or scenarios.

[0032] Figure 1 It is a schematic diagram of a system architecture shown in this specification according to an exemplary embodiment.

[0033] like Figure 1 As shown, the system architecture may include, for example, a terminal device (terminal for short), an AC (access controller) and an AP (access point).

[0034] APs include but are not limited to Fit APs (thin APs). APs and ACs can be connected directly or through switches, and switches can include Core switches, L2 switches, and the like.

[0035] The AC can be used to centrally control and manage APs. All configurations can be saved on the AC and distributed by the AC, and no configuration is required on the APs.

[0036] When a terminal goes online in a wireless LAN, it needs to obtain an IP address. In this embodiment, a Core switch or AC can be used as a DHCP server to assign an IP address to the terminal.

[0037] For example, in this embodiment, the terminal may be located in an office building. Employees in the office building arrive at work at 8:00 a.m. and clock in wirelessly using the terminal. A high number of people clock in between 7:45 and 8:00 a.m. correspond to a high number of concurrent terminals going online. During this time period, many terminals send DHCP request messages to AP1. After receiving these messages, the AP broadcasts them within the corresponding wireless LAN, including to AP2, the L2 switch, the AC, the Core switch, and so on. Frequent broadcasts within the wireless LAN can affect normal traffic within the wireless LAN and slow down the speed at which terminals acquire IP addresses.

[0038] The IP address allocation method provided in the embodiments of this specification is described in detail below. Figure 2 As shown, Figure 2 This is a flowchart of an IP address allocation method according to an exemplary embodiment of this specification. The IP address allocation method provided in the embodiment of this specification may include the following steps.

[0039] In step S210, the AP intercepts a first DHCP request message sent by the first terminal device.

[0040] According to an embodiment of the present specification, the first DHCP request message may be used to request a DHCP server to allocate an IP address to a first terminal device. The first terminal device may access a wireless network according to the allocated IP address.

[0041] In step S220, the AP sends a first DHCP request message to the DHCP server in unicast form according to the recorded server unicast address.

[0042] According to an embodiment of this specification, the AP may pre-record the unicast address of the DHCP server. After receiving the DHCP request message from the terminal device, the AP may send the DHCP request message to the DHCP server in unicast form according to the unicast address of the DHCP server.

[0043] In step S230, the DHCP server receives a first DHCP request message sent by the AP in unicast form.

[0044] In step S240, the DHCP server allocates an IP address to the first terminal device according to the first DHCP request message.

[0045] In step S250, the DHCP server sends a first DHCP allocation message to the AP in a unicast manner. The first DHCP allocation message includes an IP address allocated to the first terminal device.

[0046] In step S260, if the AP receives the first DHCP allocation message sent by the DHCP server in unicast form, it sends the IP address to the first terminal device.

[0047] According to an embodiment of the present disclosure, after receiving the first DHCP request message, the DHCP server can assign an IP address to the first terminal device, and then send the first DHCP assignment message containing the IP address to the AP in unicast form, which is forwarded by the AP to the first terminal device. The first terminal device can access the wireless network based on the IP address in the first DHCP assignment message.

[0048] According to the embodiments of the present specification, the AP intercepts the DHCP request message and sends the DHCP request message of the terminal device to the DHCP server in unicast form according to the recorded server unicast address, so that the DHCP request message is no longer broadcast to all devices in the wireless network, avoiding the impact of frequent broadcasts on the network during the process of the terminal device obtaining an IP address, reducing the impact on normal traffic in the wireless network, and also improving the speed at which the terminal device obtains an IP address.

[0049] According to another embodiment of the present specification, the server unicast address in the AP may be obtained by the following operations:

[0050] The AP receives the second DHCP request message sent by the second terminal device, and then broadcasts the second DHCP request message.

[0051] After receiving the second DHCP request message, the DHCP server broadcasts a second DHCP allocation message, where the second DHCP allocation message includes the server unicast address of the DHCP server.

[0052] The AP receives the second DHCP allocation message broadcast by the DHCP server, and records the server unicast address in the second DHCP allocation message.

[0053] Optionally, before broadcasting the second DHCP request message, the AP may add the AP unicast address of the AP to the second DHCP request message, and then broadcast the second DHCP request message with the added AP unicast address to send the AP unicast address to the DHCP server.

[0054] After receiving the broadcast second DHCP request message, the DHCP server may send a second DHCP allocation message to the AP in unicast form according to the AP unicast address in the second DHCP request message. The second DHCP allocation message includes the server unicast address of the DHCP server.

[0055] The AP receives the second DHCP allocation message sent by the DHCP server in unicast form, and records the server unicast address in the second DHCP allocation message.

[0056] Thereby, broadcast in the wireless network can be further reduced.

[0057] It is understood that, based on the aforementioned embodiment, after receiving the second broadcast DHCP request message, the DHCP server may further allocate an IP address to the second terminal device based on the second DHCP request message, and then include the IP address in the second DHCP allocation message. After receiving the second DHCP allocation message, the AP may further send the IP address in the second DHCP allocation message to the second terminal device.

[0058] According to another embodiment of the present specification, if it is determined that the operation of sending the first DHCP request message to the DHCP server in unicast form fails, the AP can delete the recorded server unicast address and broadcast the first DHCP request message to re-acquire the server unicast address.

[0059] After receiving the first DHCP request message, the DHCP server may broadcast a third DHCP allocation message, where the third DHCP allocation message includes the server unicast address of the DHCP server.

[0060] The AP receives the third DHCP allocation message broadcast by the DHCP server, and records the server unicast address in the third DHCP allocation message.

[0061] Optionally, before broadcasting the first DHCP request message, the AP may add the AP unicast address of the AP to the first DHCP request message, and then broadcast the first DHCP request message with the added AP unicast address to send the AP unicast address to the DHCP server.

[0062] After receiving the first DHCP request message, the DHCP server may send a third DHCP allocation message to the AP in unicast form according to the AP unicast address in the first DHCP request message. The third DHCP allocation message includes the server unicast address of the DHCP server.

[0063] The AP receives the third DHCP allocation message sent by the DHCP server in unicast form, and records the server unicast address in the third DHCP allocation message.

[0064] Thereby, broadcast in the wireless network can be further reduced.

[0065] It is understood that, based on the aforementioned embodiment, after receiving the first broadcast DHCP request message, the DHCP server may further allocate an IP address to the first terminal device based on the first DHCP request message, and then include the IP address in a third DHCP allocation message. After receiving the third DHCP allocation message, the AP may further send the IP address in the third DHCP allocation message to the first terminal device.

[0066] Optionally, if the AP receives a corresponding first DHCP allocation message within a preset time period after sending the first DHCP request message, the AP may determine that the operation of sending the first DHCP request message to the DHCP server in unicast mode is successful. If the AP does not receive the corresponding first DHCP allocation message within the preset time period after sending the first DHCP request message, the AP may determine that the operation of sending the first DHCP request message to the DHCP server in unicast mode has failed. The preset time period can be set according to actual needs.

[0067] Optionally, the AP may further detect the reachability of the server unicast address. If it is detected that the server unicast address is unreachable, it may be determined that the operation of sending the first DHCP request message to the DHCP server in unicast form has failed.

[0068] Corresponding to the embodiments of the aforementioned method, this specification also provides embodiments of an IP address allocation device and a terminal to which it is applied.

[0069] The embodiments of the IP address allocation device in this specification can be applied to computer devices, such as servers or terminal devices. The device embodiments can be implemented through software, hardware, or a combination of software and hardware. Taking software implementation as an example, as a device in a logical sense, it is formed by the processor in which it is located reading the corresponding computer program instructions in the non-volatile memory into the memory and running them. From the hardware level, if Figure 3 The figure is a hardware structure diagram of the computer device where the IP address allocation device of the embodiment of this specification is located, except Figure 3 In addition to the processor 310, memory 330, network interface 320, and non-volatile memory 340 shown, the server or electronic device where the device 331 is located in the embodiment may also include other hardware according to the actual function of the computer device, which will not be described in detail.

[0070] like Figure 4 As shown, Figure 4 This is a block diagram of an IP address allocation device according to an exemplary embodiment of this specification, which is applied to an AP. The device includes:

[0071] A first interception module 410 is configured to intercept a first Dynamic Host Configuration Protocol DHCP request message sent by a first terminal device;

[0072] A first sending module 420 is configured to send a first DHCP request message to the DHCP server in unicast form according to the recorded server unicast address;

[0073] The allocation message forwarding module 430 is configured to send the IP address to the first terminal device if a first DHCP allocation message sent by the DHCP server in unicast form is received, where the first DHCP allocation message includes the IP address allocated to the first terminal device.

[0074] Optionally, the device further comprises:

[0075] A first receiving module is configured to receive a second DHCP request message sent by a second terminal device before intercepting the first DHCP request message sent by the first terminal device;

[0076] A first request message broadcast module, configured to broadcast a second DHCP request message;

[0077] A first allocation message receiving module is configured to receive a second DHCP allocation message broadcast by a DHCP server, where the second DHCP allocation message includes a server unicast address of the DHCP server;

[0078] The first recording module is configured to record the server unicast address in the second DHCP allocation message.

[0079] Optionally, the device further comprises:

[0080] A second receiving module is configured to receive a second DHCP request message sent by a second terminal device before intercepting the first DHCP request message sent by the first terminal device;

[0081] An adding module, configured to add the AP unicast address of the AP in the second DHCP request message;

[0082] A second request message broadcast module, configured to broadcast a second DHCP request message;

[0083] A second allocation message receiving module is configured to receive a second DHCP allocation message sent by the DHCP server in unicast form, where the second DHCP allocation message includes a server unicast address of the DHCP server;

[0084] The second recording module is configured to record the server unicast address in the second DHCP allocation message.

[0085] Optionally, the device further comprises:

[0086] a first deleting module configured to, if it is determined that the operation of sending the first DHCP request message to the DHCP server in unicast form fails, delete the recorded server unicast address and broadcast the first DHCP request message;

[0087] A third allocation message receiving module, configured to receive a third DHCP allocation message broadcast by the DHCP server, where the third DHCP allocation message includes a server unicast address of the DHCP server;

[0088] The third recording module is configured to record the server unicast address in the third DHCP allocation message.

[0089] Optionally, the device further comprises:

[0090] a second deleting module configured to, if it is determined that the operation of sending the first DHCP request message to the DHCP server in unicast form fails, delete the recorded server unicast address, add the AP unicast address of the AP to the first DHCP request message, and broadcast the first DHCP request message;

[0091] a fourth allocation message receiving module, configured to receive a third DHCP allocation message sent by the DHCP server in unicast form, wherein the third DHCP allocation message includes a server unicast address of the DHCP server;

[0092] The fourth recording module is configured to record the server unicast address in the third DHCP allocation message.

[0093] Optionally, the device further comprises:

[0094] The first determining module is configured to determine that the operation of sending the first DHCP request message to the DHCP server in unicast mode has failed if no corresponding first DHCP allocation message is received within a preset time period after the first DHCP request message is sent.

[0095] Optionally, the device further comprises:

[0096] Detection module, used to test the reachability of the server unicast address;

[0097] The second determining module is configured to determine that the operation of sending the first DHCP request message to the DHCP server in a unicast manner has failed if it is detected that the server unicast address is unreachable.

[0098] Accordingly, this specification also provides an electronic device, which includes a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to: intercept a first Dynamic Host Configuration Protocol DHCP request message sent by a first terminal device; send the first DHCP request message to the DHCP server in unicast form according to a recorded server unicast address; if a first DHCP allocation message sent by the DHCP server in unicast form is received, and the first DHCP allocation message includes an IP address allocated to the first terminal device, then send the IP address to the first terminal device.

[0099] like Figure 5 As shown, Figure 5 This is a block diagram of another IP address allocation device according to an exemplary embodiment of this specification, which is applied to a DHCP server. The device includes:

[0100] The first receiving module 510 is configured to receive a first DHCP request message sent by the AP in unicast form, where the first DHCP request message is used to request allocation of an IP address for the first terminal device;

[0101] An address allocation module 520 is configured to allocate an IP address to the first terminal device according to the first DHCP request message;

[0102] The allocation message sending module 530 is configured to send a first DHCP allocation message to the AP in a unicast manner, where the first DHCP allocation message includes an IP address allocated to the first terminal device.

[0103] Optionally, the device further comprises:

[0104] The second receiving module is configured to receive a second DHCP request message broadcast by the AP before receiving the first DHCP request message sent by the AP in unicast form;

[0105] The allocation message broadcasting module is used to broadcast a second DHCP allocation message, where the second DHCP allocation message includes a server unicast address of the DHCP server.

[0106] Optionally, the device further comprises:

[0107] A third receiving module is configured to receive a second DHCP request message broadcast by the AP before receiving the first DHCP request message sent by the AP in unicast form, where the second DHCP request message includes the AP unicast address of the AP;

[0108] The allocation message unicast module is configured to send a second DHCP allocation message to the AP in a unicast manner according to the AP unicast address, where the second DHCP allocation message includes a server unicast address of the DHCP server.

[0109] Accordingly, this specification also provides an electronic device, which includes a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to: receive a first DHCP request message sent by an AP in unicast form, the first DHCP request message being used to request allocation of an IP address for a first terminal device; allocate an IP address to the first terminal device based on the first DHCP request message; and send a first DHCP allocation message to the AP in unicast form, the first DHCP allocation message including the IP address allocated to the first terminal device.

[0110] According to the embodiments of the present specification, the AP intercepts the DHCP request message and sends the DHCP request message of the terminal device to the DHCP server in unicast form according to the recorded server unicast address, so that the DHCP request message is no longer broadcast to all devices in the wireless network, avoiding the impact of frequent broadcasts on the network during the process of the terminal device obtaining an IP address, reducing the impact on normal traffic in the wireless network, and also improving the speed at which the terminal device obtains an IP address.

[0111] The implementation process of the functions and effects of each module in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.

[0112] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to the partial description of the method embodiments. The device embodiments described above are merely illustrative, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this specification. A person of ordinary skill in the art can understand and implement it without paying any creative work.

[0113] The foregoing description of this specification describes specific embodiments. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or the sequential order to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0114] Other embodiments of the present invention will readily occur to those skilled in the art upon consideration of the present invention and practice of the invention claimed herein. This specification is intended to cover any variations, uses, or adaptations of the present invention that follow the general principles of this specification and include common knowledge or customary techniques in the art not claimed herein. The description and examples are to be considered as exemplary only, with the true scope and spirit of the present invention being indicated by the following claims.

[0115] It should be understood that the present description is not limited to the exact structure that has been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present description is limited only by the appended claims.

[0116] The above description is only a preferred embodiment of this specification and is not intended to limit this specification. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of this specification should be included in the scope of protection of this specification.

Claims

1. An IP address allocation method, applied to an access point AP, characterized in that: The method comprises: intercepting a first Dynamic Host Configuration Protocol DHCP request message sent by the first terminal device; Sending the first DHCP request message to the DHCP server in unicast form according to the recorded server unicast address; If a first DHCP allocation message sent by the DHCP server in unicast form is received, and the first DHCP allocation message includes an IP address allocated to the first terminal device, the IP address is sent to the first terminal device.

2. The method according to claim 1, characterized in that Before intercepting the first DHCP request message sent by the first terminal device, the method further includes: Receive a second DHCP request message sent by a second terminal device; Broadcasting the second DHCP request message; receiving a second DHCP allocation message broadcast by a DHCP server, where the second DHCP allocation message includes a server unicast address of the DHCP server; Record the server unicast address in the second DHCP allocation message.

3. The method according to claim 1, characterized in that Before intercepting the first DHCP request message sent by the first terminal device, the method further includes: Receive a second DHCP request message sent by a second terminal device; Adding the AP unicast address of the AP to the second DHCP request message; Broadcasting the second DHCP request message; receiving a second DHCP allocation message sent by the DHCP server in unicast form, where the second DHCP allocation message includes a server unicast address of the DHCP server; Record the server unicast address in the second DHCP allocation message.

4. The method according to claim 1, wherein The method further comprises: If it is determined that the operation of sending the first DHCP request message to the DHCP server in unicast form fails, deleting the recorded server unicast address and broadcasting the first DHCP request message; receiving a third DHCP allocation message broadcast by the DHCP server, wherein the third DHCP allocation message includes a server unicast address of the DHCP server; Record the server unicast address in the third DHCP allocation message.

5. The method according to claim 1, characterized in that The method further comprises: If it is determined that the operation of sending the first DHCP request message to the DHCP server in unicast form fails, deleting the recorded server unicast address, adding the AP unicast address of the AP to the first DHCP request message, and broadcasting the first DHCP request message; receiving a third DHCP allocation message sent by the DHCP server in unicast form, wherein the third DHCP allocation message includes a server unicast address of the DHCP server; Record the server unicast address in the third DHCP allocation message.

6. The method according to claim 4 or 5, characterized in that The method further comprises: If the corresponding first DHCP allocation message is not received within a preset time period after the first DHCP request message is sent, it is determined that the operation of sending the first DHCP request message to the DHCP server in unicast mode has failed.

7. The method according to claim 4 or 5, characterized in that The method further comprises: Detecting the reachability of the server unicast address; If it is detected that the server unicast address is unreachable, it is determined that the operation of sending the first DHCP request message to the DHCP server in unicast form has failed.

8. An address allocation method, applied to a Dynamic Host Configuration Protocol (DHCP) server, characterized in that: The method comprises: A first DHCP request message is sent by a receiving AP in unicast form, where the first DHCP request message is used to request allocation of an IP address for the first terminal device; Allocate an IP address to the first terminal device according to the first DHCP request message; A first DHCP allocation message is sent to the AP in unicast form, where the first DHCP allocation message includes the IP address allocated to the first terminal device.

9. The method according to claim 8, characterized in that Before the receiving AP sends the first DHCP request message in unicast form, the method further includes: receiving a second DHCP request message broadcast by the AP; A second DHCP allocation message is broadcast, where the second DHCP allocation message includes the server unicast address of the DHCP server.

10. The method according to claim 8, characterized in that Before the receiving AP sends the first DHCP request message in unicast form, the method further includes: receiving a second DHCP request message broadcast by the AP, where the second DHCP request message includes an AP unicast address of the AP; A second DHCP allocation message is sent to the AP in a unicast manner according to the AP unicast address, where the second DHCP allocation message includes the server unicast address of the DHCP server.

11. An IP address allocation device, applied to an AP, characterized in that: The device comprises: A first interception module, configured to intercept a first Dynamic Host Configuration Protocol DHCP request message sent by a first terminal device; A first sending module, configured to send the first DHCP request message to the DHCP server in unicast form according to the recorded server unicast address; The allocation message forwarding module is configured to, upon receiving a first DHCP allocation message sent by the DHCP server in unicast form, send the IP address allocated to the first terminal device to the first terminal device.

12. An IP address allocation device, applied to a DHCP server, characterized in that: The device comprises: A first receiving module is configured to receive a first DHCP request message sent by the AP in unicast form, where the first DHCP request message is used to request allocation of an IP address for the first terminal device; An address allocation module, configured to allocate an IP address to the first terminal device according to the first DHCP request message; The allocation message sending module is configured to send a first DHCP allocation message to the AP in a unicast manner, where the first DHCP allocation message includes an IP address allocated to the first terminal device.

13. An electronic device comprising: processor; a memory for storing processor-executable instructions; The processor is configured to execute the method according to any one of claims 1 to 7.

14. An electronic device comprising: processor; a memory for storing processor-executable instructions; The processor is configured to execute the method according to any one of claims 8 to 10.

15. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method according to any one of claims 1 to 7.

16. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method according to any one of claims 8 to 10.