Network configuration method and device, electronic equipment and computer readable storage medium

By intercepting and modifying dynamic host configuration messages, adding custom data and sending them to the server, the problem of inflexible dynamic host configuration implementation is solved, and higher network configuration flexibility and customization possibilities are achieved.

CN119496762APending Publication Date: 2025-02-21SHANGHAI CHANGLIAN ZHIRONG COMM TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411904482.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-02-21

AI Technical Summary

Technical Problem

The implementation of dynamic host configuration is not flexible enough, which limits the customization and expansion of client devices in network configuration.

Method used

By intercepting dynamic host configuration messages generated by the network stack, adding custom data to the messages, and sending the modified messages to the server, so as to realize the transmission of custom data without modifying the network stack.

Benefits of technology

It realizes adding custom data to dynamic host configuration packets for transmission without changing the network stack, which improves the flexibility of network configuration and the possibility of custom configuration, and meets the network configuration needs of different users.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119496762A_ABST
    Figure CN119496762A_ABST
Patent Text Reader

Abstract

The invention provides a network configuration method and device, electronic equipment and a computer readable storage medium, client equipment intercepts a first dynamic host configuration message which is generated in a network stack of the client equipment and is not sent out, does not send the first dynamic host configuration message, adds first data in the first dynamic host configuration message, and sends the first data to the client equipment; and obtaining a second dynamic host configuration message, and sending the second dynamic host configuration message to the server. Therefore, under the condition that a network stack is not changed, the user-defined data is added into the dynamic host configuration message for transmission, a transparent extension function is realized, a client device or a server does not need to be modified to a large extent, the realization is relatively simple, later upgrade and maintenance are facilitated, the problems of compatibility and the like cannot be brought, and the user experience is improved. The network configuration requirements of different users are met, and the flexibility of network management and the possibility of custom configuration are improved. The method provided by the embodiment of the invention can be applied to some closed operating systems, and more flexible application is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of network communication technology, and in particular to a network configuration method, device, electronic device, and computer-readable storage medium. Background Art

[0002] In modern network environments, client devices can obtain the assigned network address and other network configuration parameters from the server through dynamic host configuration. For example, client devices can use Dynamic Host Configuration Protocol (DHCP) to automatically assign Internet Protocol (IP) addresses and other network configuration parameters.

[0003] However, the operating system running in the terminal device often has certain limitations when performing dynamic host configuration, making the implementation of dynamic host configuration not flexible enough. Summary of the invention

[0004] The present disclosure provides a network configuration method, device, electronic device and computer-readable storage medium to solve the problem that the implementation of dynamic host configuration is not flexible enough.

[0005] In a first aspect, the present disclosure provides a network configuration method, the method comprising:

[0006] Intercepting a first dynamic host configuration message generated by a network stack (NetworkStack);

[0007] Adding first data to the first dynamic host configuration message to obtain a second dynamic host configuration message;

[0008] Send the second dynamic host configuration message to the server.

[0009] In some embodiments, adding the first data to the first dynamic host configuration message to obtain the second dynamic host configuration message includes:

[0010] Parsing the first dynamic host configuration message to obtain a parsed dynamic host configuration message;

[0011] The first data is added to the parsed dynamic host configuration message to obtain a second dynamic host configuration message.

[0012] In some embodiments, the method further comprises:

[0013] Determine the type of the first dynamic host configuration message according to the parsed dynamic host configuration message; the type of the first dynamic host configuration message includes: a discovery message type or a request message type;

[0014] Determine first data according to the type of the first dynamic host configuration message.

[0015] In some embodiments, the first data includes: device information and / or request parameter information of the client device; the request parameter information is used to request to obtain a first parameter, and the type of the first parameter includes a configuration parameter type, a security parameter type, and an optimization setting type.

[0016] In some embodiments, after sending the second dynamic host configuration message to the server, the method further includes:

[0017] A third dynamic host configuration message sent by the server is received, where the third dynamic host configuration message is generated by the server in response to the second dynamic host configuration message and according to the first data.

[0018] In a second aspect, an embodiment of the present disclosure provides a network configuration device, the device comprising:

[0019] An interception module, used for intercepting a first dynamic host configuration message generated by a network stack;

[0020] A processing module, configured to add first data to the first dynamic host configuration message to obtain a second dynamic host configuration message;

[0021] A sending module is used to send the second dynamic host configuration message to the server.

[0022] In some embodiments, the processing module is specifically used to:

[0023] Parsing the first dynamic host configuration message to obtain a parsed dynamic host configuration message;

[0024] The first data is added to the parsed dynamic host configuration message to obtain a second dynamic host configuration message; the types of dynamic host configuration messages include: discovery message type and request message type.

[0025] In some embodiments, the processing module is further configured to:

[0026] According to the parsed dynamic host configuration message, the type of the first dynamic host configuration message is determined; the type of the first dynamic host configuration message includes: a discovery message type or a request message type; according to the type of the first dynamic host configuration message, the first data is determined.

[0027] In some embodiments, the first data includes: device information and / or request parameter information of the client device; the request parameter information is used to request to obtain a first parameter, and the type of the first parameter includes a configuration parameter type, a security parameter type, and an optimization setting type.

[0028] In some embodiments, the apparatus further comprises:

[0029] The receiving module is used to receive a third dynamic host configuration message sent by the server, where the third dynamic host configuration message is generated by the server in response to the second dynamic host configuration message and according to the first data.

[0030] In a third aspect, the present disclosure provides an electronic device, including a memory and a processor, wherein the memory stores a computer program executable on the processor, and when the processor executes the program, the steps of the method described in the first aspect are implemented.

[0031] In a fourth aspect, the present disclosure provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in the first aspect.

[0032] In a fifth aspect, the present disclosure provides a computer program product, including a computer program, which implements the steps of the method described in the first aspect when executed by a processor.

[0033] The network configuration method, device, electronic device and computer-readable storage medium provided by the embodiments of the present disclosure are such that the client device intercepts the first dynamic host configuration message generated by its network stack and not yet sent out, does not send the first dynamic host configuration message, adds the first data to the first dynamic host configuration message, obtains the second dynamic host configuration message, and then sends the second dynamic host configuration message to the server. Thus, without changing the network stack, custom data is added to the dynamic host configuration message for transmission, realizing the transparent extension function, without making major modifications to the client device or the server, the implementation is relatively simple, and is convenient for subsequent upgrades and maintenance, and does not cause compatibility problems, so as to meet the configuration requirements of different users for the network, and improve the flexibility of network management and the possibility of custom configuration. In addition, the method of this embodiment can be applied in some closed operating systems to achieve more flexible applications and improve the flexibility of network configuration. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 A schematic diagram of the structure of a network configuration system provided by the present disclosure;

[0035] Figure 2 A flowchart of a network configuration method provided by an embodiment of the present disclosure;

[0036] Figure 3 A schematic diagram of the structure of a network configuration device provided in an embodiment of the present disclosure;

[0037] Figure 4 A schematic diagram of the structure of a network configuration device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0038] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0039] In the present disclosure, "at least one" refers to one or more, and "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a alone, b alone, or c alone can represent: a alone, b alone, c alone, a and b in combination, a and c in combination, b and c in combination, or a, b, and c in combination, where a, b, and c can be single or multiple. In addition, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance.

[0040] The directions or positional relationships indicated by terms such as "center", "longitudinal", "lateral", "up", "down", "left", "right", "front", and "back" are based on the directions or positional relationships shown in the accompanying drawings and are only for the convenience of describing the present disclosure and simplifying the description. They do not indicate or imply that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore should not be understood as a limitation on the present disclosure.

[0041] The terms "connected" and "connected" should be understood in a broad sense. For example, the "connected" or "connected" of a circuit structure may refer to not only a physical connection, but also an electrical connection or a signal connection. For example, it may be a direct connection, i.e. a physical connection, or it may be an indirect connection through at least one intermediate element, as long as the circuit is connected. It may also be the internal connection of two elements. In addition to signal connection through a circuit, signal connection may also refer to signal connection through a media medium, such as radio waves. For those of ordinary skill in the art, the specific meanings of the above terms in this disclosure may be understood according to specific circumstances.

[0042] The network configuration method provided by the present disclosure can be applied in a network configuration system. The following introduces a network configuration system provided by the present disclosure. Figure 1 , Figure 1 The schematic diagram of the structure of a network configuration system provided by the present disclosure. The network configuration system includes a client device 101 and a server 102. The client device 101 can be a terminal device such as a mobile phone, a computer, a personal computer, a tablet device, a smart wearable device or a printer in the network, and needs to use the IP information allocated from the server 102, including the IP address, DNS, etc. The IP network setting information in the network is centrally managed by the server 102, and the DHCP request of the client device 101 is processed.

[0043] The following uses the DHCP protocol as an example to explain the dynamic host allocation process. The DHCP process mainly includes the following four stages:

[0044] The first stage is the discovery stage (Discover).

[0045] The client device 101 sends a DHCP discovery message (Discover) to the network broadcast.

[0046] The second stage is the provision stage.

[0047] After receiving the DHCP discovery message, the server 102 in the network that can provide DHCP services determines a suitable IP address and sends a DHCP offer message (Offer) to the client device, thereby informing the client device 101 that an IP address can be provided for it.

[0048] The third stage is the request stage.

[0049] The client device 101 selects one from the received DHCP offer messages, and sends a DHCP request message (Request) to the server 102 that sent the DHCP offer message.

[0050] The fourth stage is the confirmation stage.

[0051] The server 102 that receives the DHCP request message confirms the lease of the client device 101 and sends a DHCP confirmation message (ACK) to the client device 101 .

[0052] The messages mentioned above are the main messages generated in the DHCP process. It is understandable that there are other types of messages in the DHCP process. The following introduces other types of messages:

[0053] DHCP conflict message (Decline): When the client device 101 finds that the IP address assigned by the server 102 cannot be used (such as when there is an IP address conflict), it will send a DHCP conflict message to notify the server 102 that the IP address is prohibited from being used.

[0054] DHCP Reject (NAK) message: a rejection response message from the server 102 to the DHCP request message from the client device 101. After receiving this message, the client device 101 will restart a new DHCP process.

[0055] DHCP Release message (Release): The client device 101 actively releases the IP address assigned by the server 102. When the server 102 receives this message, it reclaims the IP address and can assign it to other clients.

[0056] DHCP Inform message: After obtaining the IP address, the client device 101 sends a DHCP Inform message to request to obtain other network configuration information of the server 102, such as DNS.

[0057] Typically, the client device 101 sends a message to port 67 of the server 102 , and the server 102 returns a message to port 68 of the client device 101 .

[0058] See also Figure 2 , Figure 2 The following is a flow chart of a DHCP processing method provided by the present disclosure. The DHCP processing method provided by this embodiment is executed by the client device 101. When the client device 101 needs to send a DHCP message, the following steps are executed:

[0059] Step 201: Generate a dynamic host configuration message through the network stack.

[0060] Step 202: Send a dynamic host configuration message to the server.

[0061] It can be seen that in this embodiment, the client device 101 generates a dynamic host configuration message through its own network stack according to the standard protocol and sends the dynamic host configuration message to the server. However, such DHCP implementation lacks flexibility.

[0062] The embodiment of the present disclosure provides a network configuration method, which can add customized data to a DHCP message for transmission by modifying the original DHCP protocol.

[0063] However, modifying the DHCP protocol stack may require extensive modifications to existing network devices and operating systems, leading to compatibility issues and high maintenance costs. Modifications to the protocol stack involve the reconstruction of the underlying code, which is technically difficult to implement, has a long development cycle, and is complex to implement. Modifications to the protocol stack will increase the complexity of the system, making future updates and maintenance difficult.

[0064] In addition, in some scenarios, in some closed operating systems, such as the Android operating system, the DHCP protocol stack is implemented in the network stack. The current implementation of the Android network stack is closed source and only provides binary installation. This means:

[0065] The DHCP protocol cannot be modified. Android's network stack is closed and cannot be modified by manufacturers. This includes the implementation of the DHCP protocol stack, which means that manufacturers and developers cannot directly adjust or extend the DHCP protocol.

[0066] This limits the functional expansion of the DHCP protocol. The closed network stack limits the customization and expansion of the DHCP protocol for different scenarios and different needs. For example, some enterprises may need to insert custom configuration parameters or special data into DHCP messages to meet network management needs.

[0067] The present disclosure provides a network configuration method, in which a client device intercepts a first dynamic host configuration message generated by its network stack and not yet sent out, does not send the first dynamic host configuration message, adds first data to the first dynamic host configuration message, obtains a second dynamic host configuration message, and then sends the second dynamic host configuration message to a server. Thus, without changing the network stack, custom data is added to the dynamic host configuration message for transmission, meeting the network configuration requirements of different users and improving the flexibility of network configuration.

[0068] The technical solution provided by the present disclosure is described in detail below.

[0069] See also Figure 3 , Figure 3 The flowchart of a network configuration method provided by the embodiment of the present disclosure is as follows. Figure 3 As shown, the method provided in this embodiment is executed by a terminal device, which may be the above-mentioned Figure 1 The client device 101 in the network configuration system is shown. The method provided in this embodiment may include the following steps 301 to 303.

[0070] Step 301: intercept a first dynamic host configuration message generated by a network stack.

[0071] The network stack may also be referred to as a network protocol stack. The network stack refers to the software part of a computer operating system that implements a network protocol. The network stack of a terminal device may include a dynamic host configuration-related protocol stack.

[0072] The network stack in the terminal device can generate a first dynamic host configuration message, and the terminal device sends it to the server through the corresponding port. In this embodiment, after the network stack generates the first dynamic host configuration message, but before sending it to the server, the terminal device intercepts the first dynamic host configuration message in the sending channel of the first dynamic host configuration message.

[0073] Step 302: Add the first data to the first dynamic host configuration message to obtain a second dynamic host configuration message.

[0074] The first data is preset data, and the first data can be set by user customization.

[0075] Exemplarily, the first data may include, but is not limited to: device information of the client device and / or request parameter information.

[0076] The device information of the client device is used to indicate the relevant attribute information of the client device. For example, the device information of the client device may be the manufacturer category identification of the client device.

[0077] The request parameter information is used to request to obtain the first parameter, and the types of the first parameter include configuration parameter type, security parameter type and optimization setting type. The request parameter information can be in the form of a request parameter list (request parameter list), for example, the first parameter can be an activation code, clock server information.

[0078] In this embodiment, for the intercepted first dynamic host configuration message, the first data is added to the first dynamic host configuration message to obtain a second dynamic host configuration message to which the first data is added. It can be understood that in the process of adding the first data, the original content in the first dynamic host configuration message is not changed, and the message format, type, etc. of the first dynamic host configuration message are not changed, and only the first data is added.

[0079] Furthermore, the first data may be added to an option field in the dynamic host configuration protocol, for example, an Option 43 field or an Option 60 field.

[0080] Step 303: Send a second dynamic host configuration message to the server.

[0081] The server may be the above Figure 1 The server in the network configuration system shown in FIG. 303 refers to the receiving server address in the first dynamic host configuration message, that is, in step 303, the message is sent according to the address in the first dynamic host configuration message.

[0082] Furthermore, a data packet driver may be added to the terminal device, and the above steps 301 to 303 may be implemented through the data packet driver.

[0083] In this embodiment, the client device intercepts the first dynamic host configuration message generated by its network stack and not yet sent out, does not send the first dynamic host configuration message, adds the first data to the first dynamic host configuration message, obtains the second dynamic host configuration message, and then sends the second dynamic host configuration message to the server. Thus, without changing the network stack, the custom data is added to the dynamic host configuration message for transmission, and the transparent extension function is realized. There is no need to make major modifications to the client device or the server. The implementation is relatively simple, which is convenient for subsequent upgrades and maintenance, and will not cause compatibility problems. It meets the configuration requirements of different users for the network, and improves the flexibility of network management and the possibility of custom configuration. In addition, the method of this embodiment can be applied in some closed operating systems to achieve more flexible applications and improve the flexibility of network configuration.

[0084] In some embodiments, step 302 may be implemented by steps 3021 and 3022 as follows.

[0085] Step 3021: parse the first dynamic host configuration message to obtain a parsed dynamic host configuration message.

[0086] In this embodiment, the first dynamic host configuration message is parsed to extract information content in the first dynamic host configuration message.

[0087] Exemplarily, the first dynamic host configuration message may be parsed to obtain the first dynamic host configuration message to obtain the type of the first dynamic host configuration message, the client device media access control address (Media Access Control Address, MAC for short), the requested IP address, etc.

[0088] Furthermore, in step 3021, the first dynamic host configuration message can be parsed by a parsing library to obtain a parsed dynamic host configuration message. The parsing library can be a capture framework library (scapy) of a programming language (Python) or a data packet capture function package (libpcap) of a programming language (C++).

[0089] Step 3022: Add the first data to the parsed dynamic host configuration message to obtain a second dynamic host configuration message.

[0090] In this embodiment, the client device intercepts the first dynamic host configuration message generated by its network stack and not yet sent out, does not send the first dynamic host configuration message, parses the first dynamic host configuration message to obtain a parsed dynamic host configuration message, adds the first data to the parsed dynamic host configuration message, and obtains a second dynamic host configuration message. Thus, without changing the network stack, the custom data is added to the dynamic host configuration message for transmission, and a transparent extension function is realized. There is no need to make major modifications to the client device or the server, and the implementation is relatively simple, which is convenient for subsequent upgrades and maintenance, and will not cause compatibility problems. It meets the configuration requirements of different users for the network, and improves the flexibility of network management and the possibility of custom configuration. In addition, the method of this embodiment can be applied in some closed operating systems to achieve more flexible applications and improve the flexibility of network configuration.

[0091] In some embodiments, step 3021 may be followed by steps 304 and 305 .

[0092] Step 304: Determine the type of the first dynamic host configuration message according to the parsed dynamic host configuration message.

[0093] Among them, the type of dynamic host configuration message includes multiple message types, which may include but are not limited to: discovery message type, provision message type, request message type, confirmation message type, conflict message type, rejection message type, release message type and notification message type.

[0094] The first dynamic host configuration message that needs to be intercepted is generated by the client device and is about to be sent to the server. Therefore, the types of the first dynamic host configuration message may include but are not limited to: a discovery message type and a request message type. The discovery message type message is usually used for the client device to broadcast the message to the network when it needs to obtain an IP address, so that the server in the network provides it with an IP address. For example, the discovery message type includes the DHCP discovery message in the above embodiment. The request message type message usually refers to a message that the client device selects from the messages of the provide message type sent by the server during the request phase, and sends it to the server that sends the message of the provide message type. For example, the request message type includes the DHCP request message in the above embodiment.

[0095] Step 305: Determine first data according to the type of the first dynamic host configuration message.

[0096] In this embodiment, different data may be added to different types of dynamic host configuration messages. Therefore, the client device may determine the first data to be added according to the type of the first dynamic host configuration message.

[0097] After step 305 , step 3022 may be continued.

[0098] In this embodiment, the client device intercepts the first dynamic host configuration message generated by its network stack and not yet sent out, does not send the first dynamic host configuration message, parses the first dynamic host configuration message, and obtains the parsed dynamic host configuration message. The type of the first dynamic host configuration message can be determined according to the parsed dynamic host configuration message. According to the type of the first dynamic host configuration message, the first data is determined. The first data is added to the parsed dynamic host configuration message to obtain the second dynamic host configuration message. Thus, without changing the network stack, the custom data is added to the dynamic host configuration message for transmission, and the transparent extension function is realized. There is no need to make a large degree of modification to the client device or the server, the implementation is relatively simple, and it is convenient for later upgrades and maintenance. It will not bring compatibility and other problems, meet the configuration requirements of different users for the network, and improve the flexibility of network management and the possibility of custom configuration. In addition, the method of this embodiment can be applied in some closed operating systems to achieve more flexible applications and improve the flexibility of network configuration.

[0099] In some embodiments, step 303 may be followed by step 306 .

[0100] Step 306: Receive the third dynamic host configuration message sent by the server.

[0101] The third dynamic host configuration message is generated by the server in response to the second dynamic host configuration message and according to the first data.

[0102] In this embodiment, in response to the received second dynamic host configuration message carrying the first data, the server performs corresponding processing according to the second dynamic host configuration message, generates a third dynamic host configuration message, and sends the third dynamic host configuration message to the client device.

[0103] See also Figure 4 , Figure 4 This is a schematic diagram of the structure of a network configuration device provided in an embodiment of the present disclosure. The device provided in this embodiment may include:

[0104] An interception module 401, configured to intercept a first dynamic host configuration message generated by a network stack;

[0105] A processing module 402 is used to add first data to the first dynamic host configuration message to obtain a second dynamic host configuration message;

[0106] The sending module 403 is used to send a second dynamic host configuration message to the server.

[0107] In some embodiments, the processing module 402 is specifically configured to:

[0108] Parsing the first dynamic host configuration message to obtain a parsed dynamic host configuration message;

[0109] The first data is added to the parsed dynamic host configuration message to obtain a second dynamic host configuration message; the types of dynamic host configuration messages include: a discovery message type and a request message type.

[0110] In some embodiments, the processing module 402 is further configured to:

[0111] According to the parsed dynamic host configuration message, the type of the first dynamic host configuration message is determined; the type of the first dynamic host configuration message includes: a discovery message type or a request message type; according to the type of the first dynamic host configuration message, the first data is determined.

[0112] In some embodiments, the first data includes: device information and / or request parameter information of the client device; the request parameter information is used to request to obtain the first parameter, and the type of the first parameter includes a configuration parameter type, a security parameter type, and an optimization setting type.

[0113] In some embodiments, the apparatus further comprises:

[0114] The receiving module is used to receive a third dynamic host configuration message sent by the server, where the third dynamic host configuration message is generated by the server in response to the second dynamic host configuration message and according to the first data.

[0115] The implementation principle and beneficial effects of the device provided in this embodiment are similar to those of the method provided in the above embodiment, and will not be repeated here.

[0116] The present disclosure provides an electronic device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, the steps of the method of any of the above embodiments are implemented.

[0117] The present disclosure provides a computer program product, including a computer program, which implements the steps of the method of any of the above embodiments when executed by a processor.

[0118] Based on the network configuration method described in any of the above embodiments, the embodiment of the present disclosure further provides a computer-readable storage medium, for example, the non-temporary computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device, etc. The storage medium stores computer instructions for executing the network configuration method described in any of the above embodiments, which will not be described in detail here.

[0119] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware, or by a program to instruct the relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0120] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

Claims

1. A network configuration method, characterized in that: The method comprises: intercepting a first dynamic host configuration message generated by a network stack; Adding first data to the first dynamic host configuration message to obtain a second dynamic host configuration message; Send the second dynamic host configuration message to the server.

2. The method according to claim 1, characterized in that: The adding the first data to the first dynamic host configuration message to obtain the second dynamic host configuration message includes: Parsing the first dynamic host configuration message to obtain a parsed dynamic host configuration message; The first data is added to the parsed dynamic host configuration message to obtain a second dynamic host configuration message.

3. The method according to claim 2, characterized in that The method further comprises: Determine the type of the first dynamic host configuration message according to the parsed dynamic host configuration message; the type of the first dynamic host configuration message includes: a discovery message type or a request message type; Determine first data according to the type of the first dynamic host configuration message.

4. The method according to any one of claims 1 to 3, characterized in that: The first data includes: device information and / or request parameter information of the client device; the request parameter information is used to request to obtain a first parameter, and the type of the first parameter includes a configuration parameter type, a security parameter type and an optimization setting type.

5. The method according to claim 4, characterized in that After sending the second dynamic host configuration message to the server, the method further includes: A third dynamic host configuration message sent by the server is received, where the third dynamic host configuration message is generated by the server in response to the second dynamic host configuration message and according to the first data.

6. A network configuration device, characterized in that: The device comprises: An interception module, used for intercepting a first dynamic host configuration message generated by a network stack; A processing module, configured to add first data to the first dynamic host configuration message to obtain a second dynamic host configuration message; A sending module is used to send the second dynamic host configuration message to the server.

7. The device according to claim 6, characterized in that The processing module is specifically used for: Parsing the first dynamic host configuration message to obtain a parsed dynamic host configuration message; Adding the first data to the parsed dynamic host configuration message to obtain a second dynamic host configuration message; The types of dynamic host configuration messages include: discovery message type and request message type.

8. An electronic device comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, characterized in that: When the processor executes the program, the steps of the method according to any one of claims 1 to 5 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.