CN108712513B - Network address setting method and device, terminal equipment and storage medium - Google Patents

Network address setting method and device, terminal equipment and storage medium Download PDF

Info

Publication number
CN108712513B
CN108712513B CN201810258431.6A CN201810258431A CN108712513B CN 108712513 B CN108712513 B CN 108712513B CN 201810258431 A CN201810258431 A CN 201810258431A CN 108712513 B CN108712513 B CN 108712513B
Authority
CN
China
Prior art keywords
network address
address
network
currently allocated
configurator
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810258431.6A
Other languages
Chinese (zh)
Other versions
CN108712513A (en
Inventor
黄园
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201810258431.6A priority Critical patent/CN108712513B/en
Publication of CN108712513A publication Critical patent/CN108712513A/en
Application granted granted Critical
Publication of CN108712513B publication Critical patent/CN108712513B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • H04L61/5014Internet protocol [IP] addresses using dynamic host configuration protocol [DHCP] or bootstrap protocol [BOOTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5046Resolving address allocation conflicts; Testing of addresses

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Small-Scale Networks (AREA)

Abstract

The embodiment of the application discloses a network address setting method, a network address setting device, terminal equipment and a storage medium, wherein the method comprises the steps of receiving a data broadcast packet sent by a configurator, generating the data broadcast packet by the configurator according to a dynamic host configuration protocol, analyzing the data broadcast packet, determining network address information carried in the data broadcast packet, determining whether a currently allocated network address is available according to the network address information, if not, sending a rejection message, and re-determining the network address, so that the problem that the network address is unavailable when the terminal equipment allocates the network address, and further the network is abnormal is avoided, and the network address allocation efficiency is improved.

Description

Network address setting method and device, terminal equipment and storage medium
Technical Field
The present disclosure relates to computer technologies, and in particular, to a method and an apparatus for setting a network address, a terminal device, and a storage medium.
Background
When the terminal device performs network connection, it firstly applies for a network address from a DHCP (Dynamic Host Configuration Protocol) server, and the DHCP server sends the allocated network address to the terminal device, and the terminal device returns a confirmation message after receiving the network address and starts to use the terminal device.
In the process of allocating network addresses by the DHCP server, the network addresses allocated to the terminal device are unavailable, and the detection and processing mechanism in the prior art has defects, so that the efficiency of determining the available network addresses by the terminal device is low, and improvement is needed.
Disclosure of Invention
The invention provides a network address setting method and device, terminal equipment and a storage medium, which avoid the problem of network abnormity caused by unavailable network address allocated to the terminal equipment and improve the allocation efficiency of network addresses.
In a first aspect, an embodiment of the present application provides a method for setting a network address, including:
receiving a data broadcast packet sent by a configurator, wherein the data broadcast packet is generated by the configurator according to a dynamic host configuration protocol;
analyzing the data broadcast packet, and determining network address information carried in the data broadcast packet;
and determining whether the currently allocated network address is available according to the network address information, if not, sending a rejection message, and re-determining the network address.
In a second aspect, an embodiment of the present application further provides a network address setting apparatus, including:
the receiving module is used for receiving a data broadcast packet sent by a configurator, and the data broadcast packet is generated by the configurator according to a dynamic host configuration protocol;
the analysis module is used for analyzing the data broadcast packet and determining network address information carried in the data broadcast packet;
and the configuration module is used for determining whether the currently allocated network address is available according to the network address information, and if not, sending a rejection message and re-determining the network address.
In a third aspect, an embodiment of the present application further provides a terminal device, including: the network address setting method comprises a processor, a memory and a computer program stored on the memory and capable of running on the processor, wherein the processor executes the computer program to realize the network address setting method according to the embodiment of the application.
In a fourth aspect, the present application further provides a storage medium containing terminal device executable instructions, where the terminal device executable instructions are executed by a terminal device processor to perform the network address setting method according to the present application.
In the scheme, a data broadcast packet sent by a configurator is received, the data broadcast packet is generated by the configurator according to a dynamic host configuration protocol, the data broadcast packet is analyzed, network address information carried in the data broadcast packet is determined, whether a currently allocated network address is available is determined according to the network address information, if not, a rejection message is sent, and the network address is re-determined, so that the problem that the network address is unavailable when the terminal equipment is allocated to the network address, and further the network abnormality is caused is solved, and the network address allocation efficiency is improved.
Drawings
Other features, objects and advantages of the invention will become more apparent upon reading of the detailed description of non-limiting embodiments made with reference to the following drawings:
fig. 1 is a flowchart of a network address setting method according to an embodiment of the present application;
fig. 2 is a flowchart of another network address setting method according to an embodiment of the present invention;
fig. 3 is a flowchart of another network address setting method provided in an embodiment of the present application;
fig. 4 is a flowchart of another network address setting method provided in an embodiment of the present application;
fig. 5 is a block diagram illustrating a network address setting apparatus according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are for purposes of illustration and not limitation. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of them.
Fig. 1 is a flowchart of a network address setting method provided in an embodiment of the present application, which is applicable to a case of configuring a network address of a terminal device, where the method may be executed by the terminal device provided in the embodiment of the present application, and a network address setting apparatus of the terminal device may be implemented in a software and/or hardware manner, as shown in fig. 1, a specific scheme provided in this embodiment is as follows:
and step S101, receiving the data broadcast packet sent by the configurator.
The configurator has a DHCP function, and may be a specially configured DHCP (Dynamic Host configuration Protocol) server, or may be a routing device integrated with the DHCP function.
In the prior art, a terminal device needs to have its own network address during communication with other terminal devices or servers when accessing the internet, and a configurator allocates the network address to the accessed terminal device. Specifically, the terminal device performs TCP/IP initialization, sends a DHCP Discover broadcast packet to the network through a UDP port, and a corresponding configurator having a function of providing a network address responds to the DHCP Discover broadcast packet, and sends a DHCP REQUEST message packet, and the configurator confirms the network address assigned to the terminal device and sends a DHCP ACK message packet. This existing mode is prone to cause the configurator to assign to network addresses that are not available to the terminal device, resulting in abnormal network access by the terminal device.
In this step, a data broadcast packet sent by the configurator is received, the data broadcast packet is generated by the configurator according to the dynamic host configuration protocol, and correspondingly, before the configurator sends the data broadcast packet, a Discover broadcast packet sent by the terminal device is received to respond to the data broadcast packet. The dynamic host configuration protocol is a standard protocol defined to allow dynamic assignment of IP addresses and configuration information to terminal devices.
Step S102, analyzing the data broadcast packet, and determining network address information carried in the data broadcast packet.
The data broadcast packet may be a DHCP Offer broadcast packet, and after being analyzed, the data broadcast packet determines network address information carried by the broadcast packet according to the analysis data, where the network address information includes a currently allocated network address, a gateway address, and a subnet mask, and for example, an analysis result of the network address information part is:
Your client IP address:x.x.x.x
Subnet Mask:x.x.x.x
Gateway:x.x.x.x
step S103, determining whether the currently allocated network address is available according to the network address information, if not, sending a rejection message, and re-determining the network address.
In this step, it is directly determined whether the currently allocated network address is available according to the network address information determined by parsing in step S102, in an embodiment, the determined network address information includes the currently allocated network address, a gateway address, and a subnet mask, and correspondingly, determining whether the currently allocated network address is available includes: determining a broadcast address of a local area network according to the gateway address and the subnet mask, wherein the specific determination mode is as follows: bitwise negating the subnet mask in the determined network address information, and bitwise OR operation is carried out on the obtained result and the gateway address; and judging whether the currently allocated network address is the same as the broadcast address or not, and if so, sending a rejection message. The broadcast address is an address specially used for sending data packets to all access points in the network at the same time, and the reject message may be a DHCP Decline broadcast packet. The rejection message carries the currently allocated network address which cannot be used, so that the configurator records the network address and does not distribute the unavailable network address for the second time, and after the rejection message is sent out, the network address is correspondingly and immediately determined again.
As can be seen from the above, whether the current network address is available is determined according to the analyzed network address information by analyzing the received data broadcast packet sent by the configurator, and if not, the new network address is immediately re-determined.
Fig. 2 is a flowchart of another network address setting method provided in an embodiment of the present application, where optionally, the network address information includes a currently allocated network address and a gateway address, and correspondingly, determining whether the currently allocated network address is available according to the network address information, and if not, sending a rejection message includes: and judging whether the currently allocated network address is the same as the gateway address or not, and if so, sending a rejection message. As shown in fig. 2, the technical solution is as follows:
step S201, receiving a data broadcast packet sent by the configurator.
Step S202, analyzing the data broadcast packet, and determining a currently allocated network address and a gateway address carried in the data broadcast packet.
The network address information obtained by analysis comprises the currently allocated network address and the gateway address.
Step S203, determining whether the currently allocated network address is the same as the gateway address, if so, executing step S204, and if not, executing step S205.
If the network address is the same as the gateway address, the terminal device is abnormal in surfing the internet and cannot communicate with the network.
Step S204, sending a rejection message, and re-determining the network address.
And step S205, sending a response message to receive the currently allocated network address.
The configurator may send an acknowledgement message (DHCP Ack broadcast packet) after receiving the response message, and use the network address allocated to the terminal device.
According to the method, the received data broadcast packet sent by the configurator is analyzed, whether the currently allocated network address is consistent with the gateway address is judged according to the analyzed network address information, if so, the new network address is immediately determined again, the problems that the network cannot be accessed and the network connection is abnormal due to unavailable network addresses are avoided, and the network address allocation flow is optimized.
Fig. 3 is a flowchart of another network address setting method provided in an embodiment of the present application, and optionally, the determining whether a currently allocated network address is available according to the network address information, and if not, sending a rejection message further includes: and judging whether the currently allocated network address conflicts with the network addresses of other equipment or not, and if so, sending a rejection message. As shown in fig. 3, the technical solution is as follows:
step S301, receiving the data broadcast packet sent by the configurator.
Step S302, the data broadcast packet is analyzed, and the currently allocated network address, the gateway address and the subnet mask carried in the data broadcast packet are determined.
Step S303, determining a broadcast address according to the gateway address and the subnet mask.
Step S304, judging whether the broadcast address is the same as the currently allocated network address, if so, executing step S306, and if not, executing step S305.
Step S305, judging whether the currently allocated network address conflicts with the network addresses of other devices, if so, executing step S306, and if not, executing step S307.
Optionally, when performing network address conflict detection, the terminal device may send an ARP packet to the currently allocated network address, and determine whether the currently allocated network address conflicts with network addresses of other devices according to the feedback result, for example, if the feedback result is detected, it is proved that other hosts use the currently classified network address, and the network address conflicts are determined, otherwise, it is determined that the network address does not conflict with other devices.
Step S306, sending a rejection message, and re-determining the network address.
Step S307, sending a response message to receive the currently allocated network address.
Therefore, under the condition that the broadcast address is determined to be inconsistent with the currently allocated network address according to the received network address information, whether the currently allocated network address is occupied by other equipment is further detected, and if the currently allocated network address is occupied, a rejection message is sent to re-determine the network address, so that the terminal equipment can avoid the problem of network address conflict.
Fig. 4 is a flowchart of another network address setting method provided in an embodiment of the present application, where optionally, the re-determining a network address includes: generating a network correction address according to the currently allocated network address and a preset rule; and sending the network correction address to the configurator for configuration. As shown in fig. 4, the technical solution is as follows:
step S401, receiving the data broadcast packet sent by the configurator.
Step S402, analyzing the data broadcast packet, and determining a currently allocated network address, a gateway address and a subnet mask carried in the data broadcast packet.
Step S403, determining a broadcast address according to the gateway address and the subnet mask.
Step S404, judging whether the broadcast address is the same as the currently allocated network address, if so, executing step S406, and if not, executing step S405.
Step S405, judging whether the currently allocated network address conflicts with the network addresses of other devices, if so, executing step S406, and if not, executing step S407.
Step S406, sending a rejection message, generating a network correction address according to the currently allocated network address and a preset rule, and sending the network correction address to the configurator for configuration.
The preset rule may be that 1 is added or 1 is subtracted at the end of the determined currently allocated unavailable network address to serve as a network correction address, and after the network correction address is sent to the configurator, the configurator determines the network correction address correspondingly.
In one embodiment, after determining the network correction address, the terminal device performs conflict detection on the network correction address, sends the network correction address to the configurator if no address conflict is detected, and continues to perform correction until no conflict exists if an address conflict is detected.
Step S407, sending a response message to receive the currently allocated network address.
Therefore, when the currently allocated network address is unavailable, the terminal device can correct and update the network address by itself and send the corrected network address to the configurator for confirmation, and if the corrected network address is available, the terminal device determines the corrected network address as the final network address, so that the problem of low efficiency caused by repeated application is solved.
Fig. 5 is a block diagram of a network address setting device according to an embodiment of the present application, where the device is configured to execute the network address setting method according to the foregoing embodiment, and has functional modules and beneficial effects corresponding to the execution method. As shown in fig. 5, the apparatus specifically includes: a receiving module 101, a parsing module 102 and a configuration module 103, wherein,
the receiving module 101 is configured to receive a data broadcast packet sent by a configurator, where the data broadcast packet is generated by the configurator according to a dynamic host configuration protocol.
The configurator has a DHCP function, and may be a specially configured DHCP (Dynamic Host configuration Protocol) server, or may be a routing device integrated with the DHCP function.
In this step, a data broadcast packet sent by the configurator is received, the data broadcast packet is generated by the configurator according to the dynamic host configuration protocol, and correspondingly, before the configurator sends the data broadcast packet, a Discover broadcast packet sent by the terminal device is received to respond to the data broadcast packet. The dynamic host configuration protocol is a standard protocol defined to allow dynamic assignment of IP addresses and configuration information to terminal devices.
And the analysis module 102 is configured to analyze the data broadcast packet and determine network address information carried in the data broadcast packet.
The data broadcast packet may be a DHCP Offer broadcast packet, and after being analyzed, the data broadcast packet determines network address information carried by the broadcast packet according to the analysis data, where the network address information includes a currently allocated network address, a gateway address, and a subnet mask, and for example, an analysis result of the network address information part is:
Your client IP address:x.x.x.x
Subnet Mask:x.x.x.x
Gateway:x.x.x.x
a configuration module 103, configured to determine whether the currently allocated network address is available according to the network address information, and if not, send a rejection message and re-determine the network address.
Determining whether the currently allocated network address is available directly according to the determined network address information analyzed by the analyzing module 102, in an embodiment, the determined network address information includes the currently allocated network address, a gateway address, and a subnet mask, and accordingly, determining whether the currently allocated network address is available includes: determining a broadcast address of a local area network according to the gateway address and the subnet mask, wherein the specific determination mode is as follows: bitwise negating the subnet mask in the determined network address information, and bitwise OR operation is carried out on the obtained result and the gateway address; and judging whether the currently allocated network address is the same as the broadcast address or not, and if so, sending a rejection message. The broadcast address refers to an address specially used for sending data packets to all access points in the network at the same time, and the reject message may be a DHCP Decline broadcast packet. The reject message carries the currently allocated unusable network address, so that the configurator records the unusable network address and does not distribute the unusable network address for the second time, and the network address is re-determined immediately after the reject message is sent out.
As can be seen from the above, whether the current network address is available is determined according to the analyzed network address information by analyzing the received data broadcast packet sent by the configurator, and if not, the new network address is immediately re-determined.
In a possible embodiment, the network address information includes a currently allocated network address and a gateway address, and the configuration module 103 is specifically configured to:
and judging whether the currently allocated network address is the same as the gateway address or not, and if so, sending a rejection message.
In a possible embodiment, the network address information includes a currently allocated network address, a gateway address, and a subnet mask, and the configuration module 103 is specifically configured to:
determining a broadcast address of a local area network according to the gateway address and the subnet mask;
and judging whether the currently allocated network address is the same as the broadcast address or not, and if so, sending a rejection message.
In a possible embodiment, the configuration module 103 is specifically configured to:
and judging whether the currently allocated network address conflicts with the network addresses of other equipment or not, and if so, sending a rejection message.
In a possible embodiment, the configuration module 103 is specifically configured to:
and sending an ARP data packet to the currently allocated network address, and judging whether the currently allocated network address conflicts with the network addresses of other equipment or not according to the feedback result.
In a possible embodiment, the configuration module 103 is specifically configured to:
generating a network correction address according to the currently allocated network address and a preset rule;
and sending the network correction address to the configurator for configuration.
In a possible embodiment, the reject message includes a network address for rejecting configuration, and the configuration module 103 is specifically configured to:
and sending a configuration request to the configurator to apply for a new network address.
The present embodiment provides a terminal device on the basis of the foregoing embodiments, and fig. 6 is a schematic structural diagram of a terminal device provided in the embodiments of the present application, and as shown in fig. 6, the terminal device 200 includes: memory 201, processor (CPU) 202, peripheral interfaces 203, RF (Radio Frequency) circuitry 205, audio circuitry 206, speaker 211, power management chip 208, input/output (I/O) subsystem 209, touch screen 212, Wifi module 213, other input/control devices 210, and external port 204, which communicate via one or more communication buses or signal lines 207.
It should be understood that the illustrated terminal device 200 is only one example of a terminal device, and that the terminal device 200 may have more or fewer components than shown in the figures, may combine two or more components, or may have a different configuration of components. The various components shown in the figures may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.
The following describes in detail a terminal device for rights management of multiple applications provided in this embodiment, where the terminal device is a smart phone as an example.
A memory 201, the memory 201 being accessible by the CPU202, the peripheral interface 203, and the like, the memory 201 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic disk storage devices, flash memory devices, or other volatile solid state storage devices.
A peripheral interface 203, said peripheral interface 203 may connect input and output peripherals of the device to the CPU202 and the memory 201.
An I/O subsystem 209, the I/O subsystem 209 may connect input and output peripherals on the device, such as a touch screen 212 and other input/control devices 210, to the peripheral interface 203. The I/O subsystem 209 may include a display controller 2091 and one or more input controllers 2092 for controlling the other input/control devices 210. Where one or more input controllers 2092 receive electrical signals from or transmit electrical signals to other input/control devices 210, the other input/control devices 210 may include physical buttons (push buttons, rocker buttons, etc.), dials, slide switches, joysticks, click wheels. It is noted that the input controller 2092 may be coupled to any one of: a keyboard, an infrared port, a USB interface, and a pointing device such as a mouse.
A touch screen 212, which touch screen 212 is an input interface and an output interface between the user terminal and the user, displays visual output to the user, which may include graphics, text, icons, video, and the like.
The display controller 2091 within the I/O subsystem 209 receives electrical signals from the touch screen 212 or transmits electrical signals to the touch screen 212. The touch screen 212 detects a contact on the touch screen, and the display controller 2091 converts the detected contact into an interaction with a user interface object displayed on the touch screen 212, i.e., a human-machine interaction is implemented, and the user interface object displayed on the touch screen 212 may be an icon for running a game, an icon networked to a corresponding network, or the like. It is worth mentioning that the device may also comprise a light mouse, which is a touch sensitive surface that does not show visual output, or an extension of the touch sensitive surface formed by the touch screen.
The RF circuit 205 is mainly used to establish communication between the mobile phone and the wireless network (i.e., the network side), and implement data reception and transmission between the mobile phone and the wireless network. Such as sending and receiving short messages, e-mails, etc. In particular, the RF circuitry 205 receives and transmits RF signals, also referred to as electromagnetic signals, through which the RF circuitry 205 converts electrical signals to or from electromagnetic signals and communicates with communication networks and other devices. RF circuitry 205 may include known circuitry for performing these functions including, but not limited to, an antenna system, an RF transceiver, one or more amplifiers, a tuner, one or more oscillators, a digital signal processor, a CODEC (CODEC) chipset, a Subscriber Identity Module (SIM), and so forth.
The audio circuit 206 is mainly used to receive audio data from the peripheral interface 203, convert the audio data into an electrical signal, and transmit the electrical signal to the speaker 211.
And a speaker 211 for converting the voice signal received from the wireless network by the handset through the RF circuit 205 into sound and playing the sound to the user.
And the power management chip 208 is used for supplying power and managing power to the hardware connected with the CPU202, the I/O subsystem and the peripheral interface.
The network address setting device of the terminal device and the terminal device provided in the above embodiments may execute the network address setting method of the terminal device provided in any embodiment of the present invention, and have corresponding functional modules and beneficial effects for executing the method. For details of the technology not described in detail in the above embodiments, reference may be made to a network address setting method of a terminal device provided in any embodiment of the present invention.
An embodiment of the present application further provides a storage medium containing terminal device executable instructions, where the terminal device executable instructions are executed by a terminal device processor to perform a network address setting method, and the method includes:
receiving a data broadcast packet sent by a configurator, wherein the data broadcast packet is generated by the configurator according to a dynamic host configuration protocol;
analyzing the data broadcast packet, and determining network address information carried in the data broadcast packet;
and determining whether the currently allocated network address is available according to the network address information, if not, sending a rejection message, and re-determining the network address.
In a possible embodiment, the network address information includes a currently allocated network address and a gateway address, and correspondingly, the determining whether the currently allocated network address is available according to the network address information, and if not, sending a rejection message includes:
and judging whether the currently allocated network address is the same as the gateway address or not, and if so, sending a rejection message.
In a possible embodiment, the network address information includes a currently allocated network address, a gateway address, and a subnet mask, and correspondingly, the determining whether the currently allocated network address is available according to the network address information, and if not, sending a rejection message includes:
determining a broadcast address of a local area network according to the gateway address and the subnet mask;
and judging whether the currently allocated network address is the same as the broadcast address or not, and if so, sending a rejection message.
In a possible embodiment, the determining whether the currently allocated network address is available according to the network address information, and if not, sending the rejection message further includes:
and judging whether the currently allocated network address conflicts with the network addresses of other equipment or not, and if so, sending a rejection message.
In one possible embodiment, the determining whether the currently allocated network address conflicts with the network addresses of the other devices includes:
and sending an ARP data packet to the currently allocated network address, and judging whether the currently allocated network address conflicts with the network addresses of other equipment or not according to the feedback result.
In one possible embodiment, said re-determining the network address comprises:
generating a network correction address according to the currently allocated network address and a preset rule;
and sending the network correction address to the configurator for configuration.
In one possible embodiment, the reject message includes a network address that rejects the configuration, and accordingly, the re-determining the network address includes:
and sending a configuration request to the configurator to apply for a new network address.
Storage medium-any of various types of memory devices or storage devices. The term "storage medium" is intended to include: mounting media such as CD-ROM, floppy disk, or tape devices; computer system memory or random access memory such as DRAM, DDR RAM, SRAM, EDO RAM, Lanbas (Rambus) RAM, etc.; non-volatile memory such as flash memory, magnetic media (e.g., hard disk or optical storage); registers or other similar types of memory elements, etc. The storage medium may also include other types of storage devices or combinations thereof. In addition, the storage medium may be located in a first computer system in which the program is executed, or may be located in a different second computer system connected to the first computer system through a network (such as the internet). The second computer system may provide program instructions to the first computer for execution. The term "storage medium" may include two or more storage media that may reside in different locations, such as in different computer systems that are connected by a network. The storage medium may store program instructions (e.g., embodied as a computer program) that are executable by one or more processors.
Of course, the storage medium provided in the embodiments of the present application contains computer-executable instructions, and the computer-executable instructions are not limited to the operations of the network address setting method described above, and may also perform related operations in the network address setting method provided in any embodiment of the present invention.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions without departing from the scope of the invention. Therefore, although the present invention has been described in more detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (8)

1. The network address setting method is characterized by comprising the following steps:
receiving a data broadcast packet sent by a configurator, wherein the data broadcast packet is generated by the configurator according to a dynamic host configuration protocol;
analyzing the data broadcast packet, and determining network address information carried in the data broadcast packet;
determining whether a currently allocated network address is available according to the network address information, if not, sending a rejection message, and generating a network correction address according to the currently allocated network address and a preset rule, wherein the rejection message comprises the currently allocated network address, and the configurator records the currently allocated network address after receiving the rejection message; and after the network correction address is determined, performing conflict detection on the network correction address, and if address conflict is not detected, sending the network correction address to the configurator for configuration so that the configurator determines the network correction address.
2. The method of claim 1, wherein the network address information comprises a currently assigned network address and a gateway address, and wherein determining whether the currently assigned network address is available according to the network address information comprises, if not, sending a rejection message:
and judging whether the currently allocated network address is the same as the gateway address or not, and if so, sending a rejection message.
3. The method of claim 1, wherein the network address information comprises a currently assigned network address, a gateway address, and a subnet mask, and wherein determining whether the currently assigned network address is available according to the network address information comprises, if not, sending a rejection message:
determining a broadcast address of a local area network according to the gateway address and the subnet mask;
and judging whether the currently allocated network address is the same as the broadcast address or not, and if so, sending a rejection message.
4. The method of claim 2 or 3, wherein determining whether a currently assigned network address is available based on the network address information, and if not, sending a rejection message further comprises:
and judging whether the currently allocated network address conflicts with the network addresses of other equipment or not, and if so, sending a rejection message.
5. The method of claim 4, wherein determining whether the currently allocated network address conflicts with the network addresses of other devices comprises:
and sending an ARP data packet to the currently allocated network address, and judging whether the currently allocated network address conflicts with the network addresses of other equipment or not according to the feedback result.
6. A network address setting apparatus, comprising:
the receiving module is used for receiving a data broadcast packet sent by a configurator, and the data broadcast packet is generated by the configurator according to a dynamic host configuration protocol;
the analysis module is used for analyzing the data broadcast packet and determining network address information carried in the data broadcast packet;
the configuration module is used for determining whether the currently allocated network address is available according to the network address information, if not, sending a rejection message, and generating a network correction address according to the currently allocated network address and a preset rule, wherein the rejection message comprises the currently allocated network address, and the configurator records the currently allocated network address after receiving the rejection message; and after the network correction address is determined, performing conflict detection on the network correction address, and if address conflict is not detected, sending the network correction address to the configurator for configuration so that the configurator determines the network correction address.
7. A terminal device, comprising: processor, memory and computer program stored on the memory and executable on the processor, characterized in that the processor implements the network address setting method according to any of claims 1-5 when executing the computer program.
8. A storage medium containing terminal device-executable instructions, which when executed by a terminal device processor, are configured to perform the network address setting method of any of claims 1-5.
CN201810258431.6A 2018-03-27 2018-03-27 Network address setting method and device, terminal equipment and storage medium Active CN108712513B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810258431.6A CN108712513B (en) 2018-03-27 2018-03-27 Network address setting method and device, terminal equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810258431.6A CN108712513B (en) 2018-03-27 2018-03-27 Network address setting method and device, terminal equipment and storage medium

Publications (2)

Publication Number Publication Date
CN108712513A CN108712513A (en) 2018-10-26
CN108712513B true CN108712513B (en) 2021-09-17

Family

ID=63866316

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810258431.6A Active CN108712513B (en) 2018-03-27 2018-03-27 Network address setting method and device, terminal equipment and storage medium

Country Status (1)

Country Link
CN (1) CN108712513B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109448351A (en) * 2018-12-03 2019-03-08 中国水利水电科学研究院 The method and device of cable network and wireless network mixed communication
JP7243544B2 (en) * 2019-09-20 2023-03-22 トヨタ自動車株式会社 Control device and communication method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102439949A (en) * 2011-10-17 2012-05-02 华为技术有限公司 Method for solving internet protocol address assignment conflict and related device and system
CN104410727A (en) * 2014-11-20 2015-03-11 中国联合网络通信集团有限公司 Address distributing method, client terminal, server and address distributing system
CN104935684A (en) * 2015-06-30 2015-09-23 四川效率源信息安全技术有限责任公司 Method for automatically configuring IP address
CN107819894A (en) * 2017-11-01 2018-03-20 福建新大陆支付技术有限公司 A kind of POS based on DHCP and router exchange method

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101951417B (en) * 2010-09-21 2013-01-30 北京星网锐捷网络技术有限公司 Method, system and trunk equipment for assigning multiple server addresses
CN102571996B (en) * 2010-12-13 2014-11-05 联想(北京)有限公司 IP (Internet Protocol) address assignment method, IP address assignment device and network system
CN104869026B (en) * 2014-02-24 2019-08-23 大唐软件技术股份有限公司 Method, access device and gateway for the detection of local area network background traffic
US9813358B2 (en) * 2015-07-08 2017-11-07 Infinera Corporation Systems, methods, and apparatus for ARP mediation
CN105933465B (en) * 2016-04-20 2019-04-30 北京小米移动软件有限公司 Access the method and device of wireless network

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102439949A (en) * 2011-10-17 2012-05-02 华为技术有限公司 Method for solving internet protocol address assignment conflict and related device and system
CN104410727A (en) * 2014-11-20 2015-03-11 中国联合网络通信集团有限公司 Address distributing method, client terminal, server and address distributing system
CN104935684A (en) * 2015-06-30 2015-09-23 四川效率源信息安全技术有限责任公司 Method for automatically configuring IP address
CN107819894A (en) * 2017-11-01 2018-03-20 福建新大陆支付技术有限公司 A kind of POS based on DHCP and router exchange method

Also Published As

Publication number Publication date
CN108712513A (en) 2018-10-26

Similar Documents

Publication Publication Date Title
US9100303B2 (en) Methods, devices, and systems for allocating IP address
TWI712295B (en) Method, device and system for binding user terminal and equipment
CN108064071B (en) Network connection method, device, storage medium and electronic equipment
CN108924274B (en) Domain name system DNS processing method and device, storage medium and electronic equipment
CN105684520B (en) Method for establishing wireless local area network communication connection and electronic equipment thereof
CN109314723B (en) Method, device and terminal for realizing data service
KR20120123211A (en) Apparatus and method for transmitting/receiving ip information in a radio communication network
KR102060434B1 (en) Apparatus and method for providing a wireless communication in a portable terminal
US11903062B2 (en) Method for operating application requiring communication with external device, and electronic device therefor
WO2021197375A1 (en) Roaming networking processing method, apparatus, mobile terminal and readable storage medium
CN111294416A (en) Method for obtaining IP address and related product
WO2018103400A1 (en) Wireless fidelity wifi connection method and related product
CN108712513B (en) Network address setting method and device, terminal equipment and storage medium
WO2006023731A2 (en) Integration of a wireless wide-area network (wan) data terminal with a network processor for interfacing with local-area network (lan) nodes
CN116491110A (en) Electronic device for performing edge computing service and operating method of electronic device
US11706301B2 (en) Server node selection method and terminal device
CN109819064B (en) Method for communication between modules, operating system module and conference panel
EP2490408A1 (en) Method and system for managing internet address based on terminal
US20200162419A1 (en) Address assignment method and related device
CN109347994B (en) Internet protocol IP address obtaining method and device, storage medium and electronic equipment
WO2023221708A1 (en) Pdn dialing method, system and apparatus, multi-pdn dialing configuration method, system and apparatus, and device and storage medium
CN113473493A (en) Communication method and device
US11622263B2 (en) Wireless repeater device and configuration method for the same
KR100884665B1 (en) VoIP TERMINAL AND METHOD FOR REGISTERING UPDATED IP ADDRESS TO SIP SERVER
CN106851582B (en) Service switching method and device of mobile terminal and mobile terminal

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant