CN106713522B - Wireless fidelity Wi-Fi connection method and mobile terminal - Google Patents

Wireless fidelity Wi-Fi connection method and mobile terminal Download PDF

Info

Publication number
CN106713522B
CN106713522B CN201611117289.0A CN201611117289A CN106713522B CN 106713522 B CN106713522 B CN 106713522B CN 201611117289 A CN201611117289 A CN 201611117289A CN 106713522 B CN106713522 B CN 106713522B
Authority
CN
China
Prior art keywords
address
mobile terminal
dhcp server
receiving
dhcp
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
CN201611117289.0A
Other languages
Chinese (zh)
Other versions
CN106713522A (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 CN201611117289.0A priority Critical patent/CN106713522B/en
Publication of CN106713522A publication Critical patent/CN106713522A/en
Priority to PCT/CN2017/101462 priority patent/WO2018103400A1/en
Application granted granted Critical
Publication of CN106713522B publication Critical patent/CN106713522B/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/5053Lease time; Renewal aspects
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/20Manipulation of established connections
    • H04W76/25Maintenance of established connections
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W84/00Network topologies
    • H04W84/02Hierarchically pre-organised networks, e.g. paging networks, cellular networks, WLAN [Wireless Local Area Network] or WLL [Wireless Local Loop]
    • H04W84/10Small scale networks; Flat hierarchical networks
    • H04W84/12WLAN [Wireless Local Area Networks]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The embodiment of the invention provides a wireless fidelity Wi-Fi connection method and a mobile terminal, wherein the method comprises the following steps: when the valid period distance ending time of the IP address of the mobile terminal is smaller than a preset threshold value, sending an IP address lease renewal request to a first DHCP server within a preset time length; when the mobile terminal fails to renew the lease of the IP address, an IP address renewing failure message is not reported to a system of the mobile terminal, and an IP address obtaining request is broadcasted; at least one IP address assigned by at least one DHCP server is received and one of the IP addresses is selected. The embodiment of the invention can keep the Wi-Fi network from being disconnected in the process of carrying out the IP address lease renewal of the mobile terminal.

Description

Wireless fidelity Wi-Fi connection method and mobile terminal
Technical Field
The invention relates to the technical field of internet, in particular to a wireless fidelity Wi-Fi connection method and a mobile terminal.
Background
With the rapid development of information technology, mobile terminals (such as mobile phones, tablet computers, and the like) are increasingly used, and users have higher requirements on the mobile terminals, so that the users need higher processing speed and also have requirements on wireless fidelity (Wi-Fi).
In the prior art, although a Dynamic Host Configuration Protocol (DHCP) has a clear Protocol specification, a mobile terminal user still encounters a situation of failure of Internet Protocol (IP) Address renewal when actually using a device. For example, some network DHCP servers do not respond to an IP address lease renewal Request (DHCP Request), or may not renew an IP address when the mobile terminal is connected to a different subnet, resulting in disconnection of the currently connected Wi-Fi network or inability to continue access to the Wi-Fi network.
Disclosure of Invention
The embodiment of the invention provides a wireless fidelity Wi-Fi connection method and a mobile terminal, aiming to keep a Wi-Fi network from being disconnected in the process of carrying out IP address lease renewal on the mobile terminal.
The first aspect of the embodiments of the present invention provides a wireless fidelity Wi-Fi connection method, including:
when the valid period distance ending time of the IP address of the mobile terminal is smaller than a preset threshold value, sending an IP address lease renewal request to a first DHCP server within a preset time length;
when the mobile terminal fails to renew the lease of the IP address, an IP address renewing failure message is not reported to a system of the mobile terminal, and an IP address obtaining request is broadcasted;
at least one IP address assigned by at least one DHCP server is received and one of the IP addresses is selected.
A second aspect of an embodiment of the present invention provides a mobile terminal, including:
the sending unit is used for sending an IP address lease renewal request to the first DHCP server within a preset time length when the valid period distance ending time of the IP address of the mobile terminal is less than a preset threshold value;
a broadcasting unit, configured to broadcast an IP address acquisition request without reporting a lease renewal IP address failure message to a system of the mobile terminal when the lease renewal IP address of the mobile terminal fails;
a receiving unit, configured to receive at least one IP address allocated by at least one DHCP server, and select one of the IP addresses.
A third aspect of the embodiments of the present invention provides a mobile terminal, including:
a processor and a memory; wherein the processor performs some or all of the steps of the method described in the first aspect by calling code or instructions in the memory.
The embodiment of the invention has the following beneficial effects:
through the embodiment of the invention, when the validity period distance ending time of the IP address of the mobile terminal is less than the preset threshold value, the IP address lease renewal request is sent to the first DHCP server within the preset time length, when the lease renewal IP address of the mobile terminal fails, the lease renewal IP address failure message is not reported to the system of the mobile terminal, but the IP address acquisition request is broadcasted, at least one IP address distributed by at least one DHCP server is received, and one IP address is selected. Because the lease renewing IP address failure message is not reported to the system of the mobile terminal after the lease renewing IP address of the mobile terminal fails, the mobile terminal is still in a connection state, and the Wi-Fi network can be kept not to be disconnected in the process of carrying out lease renewing IP addresses by the mobile terminal.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart illustrating a first embodiment of a Wi-Fi connection method according to an embodiment of the present invention;
FIG. 1a is a schematic view of a Wi-Fi list demonstration provided by an embodiment of the present invention;
fig. 2 is a flowchart illustrating a Wi-Fi connection method according to a second embodiment of the present invention;
fig. 3a is a schematic structural diagram of a mobile terminal according to a first embodiment of the present invention;
fig. 3b is a schematic diagram of another structure of the mobile terminal depicted in fig. 3a according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a mobile terminal according to a second embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms "first," "second," "third," and "fourth," etc. in the description and claims of the invention and in the accompanying drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the invention. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
The Mobile terminal described in the embodiment of the present invention may include a smart Phone (such as an Android Phone, an iOS Phone, a Windows Phone, etc.), a tablet computer, a vehicle-mounted device, a palm computer, a notebook computer, a Mobile Internet device (MID, Mobile Internet Devices), or a wearable device, which are merely examples, but not exhaustive, and include but are not limited to the above Mobile terminal.
It should be noted that, in general, all routers are provided with a DHCP server, and the DHCP server is configured to allocate an IP address to a mobile terminal, where the IP address has a validity period, and during the validity period, the mobile terminal may maintain a Wi-Fi connection state with the router, and at the end of the validity period, the mobile terminal may disconnect the Wi-Fi connection with the router. Before the validity period of the IP address is over, an IP address renewal request can be sent to the DHCP server, and the DHCP server can respond to the IP address renewal request to allocate the IP address for the mobile terminal.
It should be noted that the interaction flow between the mobile terminal and the DHCP server may include the following 4 steps:
1. the mobile terminal broadcasts an IP address acquisition request outwards;
2. at least one DHCP server provides an IP address to respond to the IP address acquisition request;
3. the mobile terminal selects an IP address and sends a confirmation message to a target DHCP server corresponding to the IP address;
4. the target DHCP server sends an ACK message to the mobile terminal.
Further, in the case that the mobile terminal fails to renew the lease on the IP address (the lease is overtime or receives a no-acknowledgement (NAK) from the DHCP server), steps 3 to 4 are mainly performed in the lease renewal process, and the lease renewal process may generally last for a system-specified time length (the system-specified time length is default by the system of the mobile terminal and is a fixed value). And (3) continuously executing the steps (3) to (4) by the mobile terminal within the specified time span of the system, after the specified time span of the system is ended, if an ACK message sent by the DHCP server is not received, reporting a DHCP _ FAILURE message by the mobile terminal, breaking the current network connection when the system of the mobile terminal processes the message, and then reestablishing the connection and reselecting the DHCP server (executing the steps (1) to (4)). If the user perceives that the network is disconnected during the lease renewal of the IP address, the user may not use the network for a while, and thus the user may feel the experience poor.
Therefore, the embodiment of the invention provides a wireless fidelity Wi-Fi connection method, which comprises the following steps:
when the valid period distance ending time of the IP address of the mobile terminal is smaller than a preset threshold value, sending an IP address lease renewal request to a first DHCP server within a preset time length;
when the mobile terminal fails to renew the lease of the IP address, an IP address renewing failure message is not reported to a system of the mobile terminal, and an IP address obtaining request is broadcasted;
at least one IP address assigned by at least one DHCP server is received and one of the IP addresses is selected.
Therefore, when the IP address relegation fails, the IP address relegation failure message is not reported to the system of the mobile terminal, the mobile terminal does not disconnect the current Wi-Fi network and broadcasts the IP address acquisition request, and therefore the IP address distributed by the DHCP server can be conveniently received, and the Wi-Fi connection state can be kept when the IP address relegation fails.
Fig. 1 is a flowchart illustrating a Wi-Fi connection method according to a first embodiment of the present invention. The Wi-Fi connection method described in this embodiment includes the following steps:
101. and when the validity period distance ending time of the IP address of the mobile terminal is less than a preset threshold value, sending an IP address lease renewal request to the first DHCP server within a preset time length.
In the step 101, the mobile terminal is in a Wi-Fi connection state. The preset threshold value can be set by the user or the default of the system. The preset time length is set by the user. The first DHCP server may be a DHCP server built in a router to which the mobile terminal is currently connected.
Specifically, when the mobile terminal is in the Wi-Fi connection state, a route is mainly formed between the gateway IP address and an IP address assigned by the DHCP server (i.e., the IP address of the mobile terminal), and the mobile terminal establishes a communication connection with the router according to the route. However, since the IP address assigned by the DHCP server has a certain validity period, the mobile terminal needs to renew the lease for the IP address to the DHCP server before the validity period of the IP address assigned by the DHCP server is not completed. And when the valid period distance ending time of the IP address of the mobile terminal is less than a preset threshold value, the mobile terminal can send an IP address lease renewal request to the first DHCP server within a preset time length.
For example, when the mobile terminal disconnects the Wi-Fi connection state, and the mobile terminal enters the coverage of the router again, an IP address (i.e., the IP address of the mobile terminal) may be allocated by a DHCP server built in the router, a route may be formed between the IP address of the mobile terminal and the IP address of the gateway, and the mobile terminal establishes a communication connection with the router according to the route. Similarly, since the IP address assigned by the DHCP server has a certain validity period, the mobile terminal needs to renew the lease for the IP address to the DHCP server before the validity period of the IP address assigned by the DHCP server is not completed. And when the valid period distance ending time of the IP address of the mobile terminal is less than a preset threshold value, the mobile terminal can send an IP address lease renewal request to the first DHCP server within a preset time length.
Optionally, the preset time length is less than a time length specified by a system of the mobile terminal. Wherein the system-specified time duration of the mobile terminal may be a fixed value, for example, 30 s. The preset time duration may be a fixed value or a range of values, for example, 15s, that is, the mobile terminal may send the IP address acquisition request to the first DHCP server within 15 s. When the preset time length is less than the system-specified time length of the mobile terminal, whether the IP address renewal fails or not can be known in a short time. In general, when the IP address lease renewal is not successful once, the probability of the IP address lease renewal is not high, and thus, the assignment time (i.e., the system assignment time length) of the IP address lease renewal can be shortened, and further, the step 102 can be executed relatively quickly, which is advantageous in optimizing the efficiency of the access network.
Optionally, when the mobile terminal succeeds in renewing the lease of the IP address, the validity period of the IP address of the gateway may be extended. For example, the valid period of the current IP address is 10 minutes left from the end time, and if the lease renewal of the IP address succeeds, the valid period of the IP address is 1 hour, so that the valid use time of the current IP address can be prolonged.
102. And when the mobile terminal fails to renew the IP address, broadcasting the IP address acquisition request without reporting a renewal IP address failure message to a system of the mobile terminal.
When the lease renewal IP address fails, the mobile terminal reports a lease renewal IP address FAILURE message (i.e., a DHCP _ FAILURE message) to the system of the mobile terminal under normal conditions, and after the system of the mobile terminal receives the DHCP _ FAILURE message, the current Wi-Fi network is disconnected. In the embodiment of the present invention, when the mobile terminal fails to renew the lease IP address, the DHCP _ FAILURE message is not reported to the system of the mobile terminal (for example, in an android operating system, the DHCP _ FAILURE message is not reported to a system framework layer in the system of the mobile terminal).
Optionally, the broadcast IP address obtaining request may be implemented as follows:
and broadcasting an IP address acquisition request to a preset range taking the mobile terminal as a center according to the Wi-Fi list scanned last time.
The Wi-Fi list scanned last time is the Wi-Fi list scanned last time from the Wi-Fi scanning closest to the current time, as shown in fig. 1a, which is a schematic illustration of a demonstration of the Wi-Fi list. The "last time" can be understood as the Wi-Fi scan that is closest to the current time. The preset range can be set by a user or default by a system, in general, Wi-Fi chips of the mobile terminal have a maximum search range, that is, a router or a hot spot exceeding the maximum search range cannot be searched, the maximum search range is realized under an ideal condition, and in a specific environment, if an obstacle (such as a door, a window, a wall, and the like) is encountered, the maximum search range cannot be reached. In general, the farther the router is from the mobile terminal, the weaker the signal of the router may be detected by the mobile terminal, and thus, the search range of the mobile terminal for searching for the router may be reduced. When the mobile terminal broadcasts an IP address acquisition request to a preset range with the mobile terminal as the center according to the Wi-Fi list scanned last time, access points (each access point is internally provided with a DHCP server) with stronger signal intensity or close to the mobile terminal can be searched. After receiving the IP address acquisition request, any DHCP server may assign an IP address to the mobile terminal and send the IP address to the mobile terminal, and of course, the IP address may have a specific validity period.
Optionally, the broadcast IP address obtaining request may include the following steps:
21) acquiring a plurality of DHCP servers of a local area network where the mobile terminal is located;
22) and broadcasting an IP address acquisition request to the plurality of DHCP servers.
The mobile terminal is in a Wi-Fi connection state, and in fact, the mobile terminal is also in a local area network, so that the local area network where the mobile terminal is located can be acquired, and of course, the local area network may include more than one DHCP server (there are several access points, and thus, the mobile terminal may include several DHCP servers), and thus, the mobile terminal may broadcast an IP address acquisition request to all the DHCP servers. For example, if the local area network of the mobile terminal includes N DHCP servers, where N is an integer greater than 1, the N DHCP servers of the local area network where the mobile terminal is located may be obtained, and the IP address obtaining request is broadcast to the N DHCP servers.
103. At least one IP address assigned by at least one DHCP server is received and one of the IP addresses is selected.
Wherein the mobile terminal may receive at least one IP address allocated by the at least one DHCP server and select one of the IP addresses as the IP address of the mobile terminal. After the mobile terminal has the IP address of the mobile terminal, the mobile terminal can access the Wi-Fi network, namely a routing path between the IP address of the gateway and the IP address of the mobile terminal can be formed.
Optionally, in step 103, receiving at least one IP address allocated by at least one DHCP server, and selecting one of the IP addresses may include the following steps:
receiving an IP address assigned by the first DHCP server.
Specifically, even after the mobile terminal fails to renew its lease to the first DHCP server, the mobile terminal may further broadcast an IP address acquisition request, receive an IP address allocated by the first DHCP server, where the IP address is used as a new IP address of the mobile terminal, and re-access the first DHCP server, that is, establish a communication connection with the first DHCP server. The new IP address of the mobile terminal may not be the same as the IP address of the mobile terminal in step 101, because the DHCP server randomly allocates the IP address, a new routing path may be formed between the IP address of the gateway and the new IP address of the mobile terminal, and thus, the mobile terminal may perform a communication connection with the first DHCP server through the routing path, and the mobile terminal may not disconnect the current Wi-Fi network in the whole process.
Optionally, the at least one DHCP server at least includes a first DHCP server and a second DHCP server, and the step 103 of receiving at least one IP address allocated by the at least one DHCP server and selecting one of the IP addresses may include the following steps:
receiving an IP address assigned by the second DHCP server.
Alternatively, the second DHCP server may be a different DHCP server than the first DHCP server. Then, even after the mobile terminal fails to renew the lease to the first DHCP server, the mobile terminal may broadcast the IP address acquisition request, receive the IP address allocated by the second DHCP server, where the IP address is used as the new IP address of the mobile terminal, and access the second DHCP server, that is, establish a communication connection with the second DHCP server. Namely, after the IP address renewal fails, the IP address allocated by the second DHCP server may be received, so that a communication connection is established with the second DHCP server. The IP address of the mobile terminal may be the same as the IP address of the mobile terminal in step 101, because the process of allocating IP addresses by different DHCP servers is random, a new routing path may be formed between the IP address of the gateway corresponding to the second DHCP server and the IP address of the mobile terminal, so that the mobile terminal may communicate with the second DHCP server through the routing path, and the mobile terminal may not disconnect the current Wi-Fi network in the whole process.
Further optionally, after receiving the IP address acquisition request, any DHCP server may respond to the IP address acquisition request, allocate an IP address to the mobile terminal, and send the IP address to the mobile terminal. It is assumed that N DHCP servers are provided, where N is an integer greater than or equal to 1, and therefore, the mobile terminal may receive a maximum of N IP addresses, and of course, each IP address corresponds to one DHCP server, and the mobile terminal may not access the N DHCP servers, and only one IP address of the N IP addresses may be selected. The second DHCP server may be a built-in DHCP server of a router to which the mobile terminal has been connected, because the mobile terminal usually stores a password of the built-in DHCP server of the router to which the mobile terminal has been connected, and thus, as long as the second DHCP server is scanned, the password may be automatically input and the second DHCP server may be accessed.
It can be seen that, through the embodiment of the present invention, when the validity period distance end time of the IP address of the mobile terminal is less than the preset threshold, the IP address lease renewal request is sent to the first DHCP server within the preset time length, and when the lease renewal IP address of the mobile terminal fails, the lease renewal IP address failure message is not reported to the system of the mobile terminal, but the IP address acquisition request is broadcasted, and at least one IP address allocated by at least one DHCP server is received, and one of the IP addresses is selected. Therefore, when the IP address relegation fails, the IP address relegation failure message is not reported to the system of the mobile terminal, the mobile terminal does not disconnect the current Wi-Fi network and broadcasts the IP address acquisition request, and therefore the IP address distributed by the DHCP server can be conveniently received, and the Wi-Fi connection state can be kept when the IP address relegation fails.
In accordance with the above, please refer to fig. 2, which is a flowchart illustrating a Wi-Fi connection method according to a second embodiment of the present invention. The Wi-Fi connection method described in this embodiment includes the following steps:
201. and when the validity period distance ending time of the IP address of the mobile terminal is less than a preset threshold value, sending an IP address lease renewal request to the first DHCP server within a preset time length.
202. And when the mobile terminal fails to renew the IP address, broadcasting the IP address acquisition request without reporting a renewal IP address failure message to a system of the mobile terminal.
203. At least one IP address assigned by at least one DHCP server is received and one of the IP addresses is selected.
The above steps 201 to 203 may refer to corresponding steps of the wifi connection method described with reference to fig. 1.
204. And acquiring the IP address of the gateway.
Wherein, the mobile terminal can obtain the IP address of the mobile terminal.
Alternatively, when the second DHCP server and the first DHCP server are the same server, a routing path before the mobile terminal performs IP address lease renewal may be acquired, the routing path may include the IP address of the mobile terminal and the IP address of the gateway before the mobile terminal performs IP address lease renewal, and the IP address of the gateway may be directly read from the routing path.
Optionally, when the second DHCP server and the first DHCP server are different servers, and the IP address of the gateway is carried in an Offer message or an ACK message replied by the DHCP server when the mobile terminal acquires the IP address from the second DHCP server, the IP address of the gateway can be obtained only by parsing the Offer message or the ACK message.
205. Establishing a routing path between the IP address of the gateway and the one of the IP addresses.
When the mobile terminal receives at least one IP address distributed by at least one DHCP server and selects one IP address, the IP address is used as a new IP address of the mobile terminal, the mobile terminal can establish communication connection with the DHCP server corresponding to the new IP address, but the current route is not updated, so that a route path between the IP address of the gateway and the new IP address can be established and can be displayed on a display screen of the mobile terminal.
It can be seen that, through the embodiments of the present invention, when the validity period distance end time of the IP address of the mobile terminal is less than the preset threshold, an IP address lease renewal request is sent to the first DHCP server within the preset time length, when the lease renewal IP address of the mobile terminal fails, a lease renewal IP address failure message is not reported to the system of the mobile terminal, but an IP address acquisition request is broadcasted, at least one IP address allocated by at least one DHCP server is received, one of the IP addresses is selected, and the IP address of the gateway can be acquired, and a routing path between the IP address of the gateway and the one of the IP addresses is established. Because the lease renewing IP address failure message is not reported to the system of the mobile terminal after the lease renewing IP address of the mobile terminal fails, the mobile terminal is still in a connection state, the Wi-Fi network can be kept not to be disconnected in the process of carrying out lease renewing IP address of the mobile terminal, and the routing information can be updated after the mobile terminal accesses the Wi-Fi network.
In accordance with the foregoing, an apparatus for implementing the Wi-Fi connectivity method described above is as follows:
please refer to fig. 3a, which is a schematic structural diagram of a mobile terminal according to a first embodiment of the present invention. The mobile terminal described in this embodiment includes: the transmitting unit 301, the broadcasting unit 302 and the receiving unit 303 are specifically as follows:
a sending unit 301, configured to send an IP address lease renewal request to the first DHCP server within a preset time length when the validity period distance end time of the IP address of the mobile terminal is smaller than a preset threshold;
a broadcasting unit 302, configured to broadcast an IP address acquisition request without reporting a lease renewal IP address failure message to a system of the mobile terminal when the lease renewal IP address of the mobile terminal fails;
a receiving unit 303, configured to receive at least one IP address allocated by at least one DHCP server, and select one of the IP addresses.
Optionally, the preset time length is less than a time length specified by a system of the mobile terminal.
Optionally, the broadcast unit 302 is specifically configured to:
and broadcasting an IP address acquisition request to a preset range taking the mobile terminal as a center according to the Wi-Fi list scanned last time.
Optionally, the receiving unit 303 is specifically configured to:
receiving an IP address assigned by the first DHCP server.
Optionally, the at least one DHCP server at least includes a first DHCP server and a second DHCP server, and the receiving unit 303 is specifically configured to:
receiving an IP address assigned by the second DHCP server.
Optionally, as shown in fig. 3b, fig. 3b is a modified structure of the mobile terminal depicted in fig. 3a, which further includes: the obtaining unit 304 and the establishing unit 305 are specifically as follows:
an obtaining unit 304, configured to obtain an IP address of the gateway after the receiving unit 303 receives at least one IP address allocated by at least one DHCP server and selects one of the IP addresses;
an establishing unit 305, configured to establish a routing path between the IP address of the gateway and the one IP address.
It can be seen that, with the mobile terminal described in the embodiment of the present invention, when the validity period distance end time of the IP address of the mobile terminal is less than the preset threshold, the IP address lease renewal request is sent to the first DHCP server within the preset time length, and when the lease renewal IP address of the mobile terminal fails, the lease renewal IP address failure message is not reported to the system of the mobile terminal, but the IP address acquisition request is broadcasted, and at least one IP address allocated by at least one DHCP server is received, and one of the IP addresses is selected. Therefore, when the IP address relegation fails, the IP address relegation failure message is not reported to the system of the mobile terminal, the mobile terminal does not disconnect the current Wi-Fi network and broadcasts the IP address acquisition request, and therefore the IP address distributed by the DHCP server can be conveniently received, and the Wi-Fi connection state can be kept when the IP address relegation fails.
In accordance with the above, please refer to fig. 4, which is a schematic structural diagram of a mobile terminal according to a second embodiment of the present invention. The mobile terminal described in this embodiment includes: at least one input device 1000; at least one output device 2000; at least one processor 3000, e.g., a CPU; and a memory 4000, the input device 1000, the output device 2000, the processor 3000, and the memory 4000 being connected by a bus 5000.
The input device 1000 may be a touch panel, a physical button, or a mouse.
The output device 2000 may be a display screen.
The memory 4000 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 4000 is used for storing a set of program codes, and the input device 1000, the output device 2000 and the processor 3000 are used for calling the program codes stored in the memory 4000 to execute the following operations:
the processor 3000 is configured to:
when the valid period distance ending time of the IP address of the mobile terminal is smaller than a preset threshold value, sending an IP address lease renewal request to a first DHCP server within a preset time length;
when the mobile terminal fails to renew the lease of the IP address, an IP address renewing failure message is not reported to a system of the mobile terminal, and an IP address obtaining request is broadcasted;
at least one IP address assigned by at least one DHCP server is received and one of the IP addresses is selected.
Optionally, the preset time length is less than a time length specified by a system of the mobile terminal.
Optionally, the processor 3000 broadcasts an IP address obtaining request, including:
and broadcasting an IP address acquisition request to a preset range taking the mobile terminal as a center according to the Wi-Fi list scanned last time.
Optionally, the processor 3000 receives at least one IP address assigned by at least one DHCP server, and selects one of the IP addresses, including:
optionally, the processor 3000 receives at least one IP address assigned by at least one DHCP server, and selects one of the IP addresses, including:
receiving an IP address assigned by the first DHCP server.
Optionally, the at least one DHCP server includes at least a first DHCP server and a second DHCP server, and the processor 3000 receives at least one IP address assigned by the at least one DHCP server and selects one of the IP addresses, including:
receiving an IP address assigned by the second DHCP server.
Optionally, the processor 3000 is further specifically configured to, after receiving at least one IP address allocated by at least one DHCP server and selecting one of the IP addresses:
acquiring an IP address of a gateway;
establishing a routing path between the IP address of the gateway and the one of the IP addresses.
An embodiment of the present invention further provides a computer storage medium, where the computer storage medium may store a program, and the program includes some or all of the steps of any one of the wireless fidelity Wi-Fi connection methods described in the above method embodiments when executed.
While the invention has been described in connection with various embodiments, other variations to the disclosed embodiments can be understood and effected by those skilled in the art in practicing the claimed invention, from a review of the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other elements or steps, and the word "a" or "an" does not exclude a plurality. A single processor or other unit may fulfill the functions of several items recited in the claims. The mere fact that certain measures are recited in mutually different dependent claims does not indicate that a combination of these measures cannot be used to advantage.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus (device), or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein. A computer program stored/distributed on a suitable medium supplied together with or as part of other hardware, may also take other distributed forms, such as via the Internet or other wired or wireless telecommunication systems.
The present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (devices) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While the invention has been described in conjunction with specific features and embodiments thereof, it will be evident that various modifications and combinations can be made thereto without departing from the spirit and scope of the invention. Accordingly, the specification and figures are merely exemplary of the invention as defined in the appended claims and are intended to cover any and all modifications, variations, combinations, or equivalents within the scope of the invention. It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (13)

1. A wireless fidelity (Wi-Fi) connection method, comprising:
when the valid period distance ending time of the IP address of the mobile terminal is smaller than a preset threshold value, sending an IP address lease renewal request to a first DHCP server within a preset time length;
when the mobile terminal fails to renew the lease of the IP address, reporting no lease renewal IP address failure message to a system of the mobile terminal so that the current Wi-Fi network cannot be disconnected and an IP address acquisition request is broadcasted;
receiving at least one IP address assigned by at least one DHCP server and selecting one of the IP addresses;
wherein, the broadcast IP address obtaining request includes:
acquiring a plurality of DHCP servers of a local area network where the mobile terminal is located;
broadcasting an IP address acquisition request to the plurality of DHCP servers.
2. The method of claim 1, wherein the preset length of time is less than a system-specified length of time for the mobile terminal.
3. The method of claim 1, wherein broadcasting the IP address acquisition request comprises:
and broadcasting an IP address acquisition request to a preset range taking the mobile terminal as a center according to the Wi-Fi list scanned last time.
4. The method according to any of claims 1 to 3, wherein said receiving at least one IP address assigned by at least one DHCP server and selecting one of the IP addresses comprises:
receiving an IP address assigned by the first DHCP server.
5. The method according to any of claims 1 to 3, wherein the at least one DHCP server comprises at least a first DHCP server and a second DHCP server, and wherein the receiving at least one IP address assigned by the at least one DHCP server and selecting one of the IP addresses comprises:
receiving an IP address assigned by the second DHCP server.
6. A method according to any of claims 1 to 3, wherein after receiving at least one IP address assigned by at least one DHCP server and selecting one of the IP addresses, the method further comprises:
acquiring an IP address of a gateway;
establishing a routing path between the IP address of the gateway and the one of the IP addresses.
7. A mobile terminal, comprising:
the sending unit is used for sending an IP address lease renewal request to the first DHCP server within a preset time length when the valid period distance ending time of the IP address of the mobile terminal is less than a preset threshold value;
the broadcasting unit is used for not reporting a lease renewal IP address failure message to a system of the mobile terminal when the lease renewal IP address of the mobile terminal fails so as to prevent the current Wi-Fi network from being disconnected and broadcasting an IP address acquisition request;
a receiving unit for receiving at least one IP address allocated by at least one DHCP server and selecting one of the IP addresses;
wherein, the broadcast IP address obtaining request includes:
acquiring a plurality of DHCP servers of a local area network where the mobile terminal is located;
broadcasting an IP address acquisition request to the plurality of DHCP servers.
8. The mobile terminal of claim 7, wherein the preset length of time is less than a system-specified length of time specified by the mobile terminal.
9. The mobile terminal of claim 7, wherein the broadcasting unit is specifically configured to:
and broadcasting an IP address acquisition request to a preset range taking the mobile terminal as a center according to the Wi-Fi list scanned last time.
10. The mobile terminal according to any of claims 7 to 9, wherein the receiving unit is specifically configured to:
receiving an IP address assigned by the first DHCP server.
11. The mobile terminal according to any of claims 7 to 9, wherein the at least one DHCP server includes at least a first DHCP server and a second DHCP server, and the receiving unit is specifically configured to:
receiving an IP address assigned by the second DHCP server.
12. The mobile terminal according to any of claims 7 to 9, characterized in that the mobile terminal further comprises:
the acquiring unit is used for acquiring the IP address of the gateway after the receiving unit receives at least one IP address distributed by at least one DHCP server and selects one of the IP addresses;
and the establishing unit is used for establishing a routing path between the IP address of the gateway and the one IP address.
13. A mobile terminal, comprising:
a processor and a memory; wherein the processor performs the method of any one of claims 1 to 6 by calling code or instructions in the memory.
CN201611117289.0A 2016-12-07 2016-12-07 Wireless fidelity Wi-Fi connection method and mobile terminal Active CN106713522B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201611117289.0A CN106713522B (en) 2016-12-07 2016-12-07 Wireless fidelity Wi-Fi connection method and mobile terminal
PCT/CN2017/101462 WO2018103400A1 (en) 2016-12-07 2017-09-12 Wireless fidelity wifi connection method and related product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611117289.0A CN106713522B (en) 2016-12-07 2016-12-07 Wireless fidelity Wi-Fi connection method and mobile terminal

Publications (2)

Publication Number Publication Date
CN106713522A CN106713522A (en) 2017-05-24
CN106713522B true CN106713522B (en) 2020-01-14

Family

ID=58936234

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611117289.0A Active CN106713522B (en) 2016-12-07 2016-12-07 Wireless fidelity Wi-Fi connection method and mobile terminal

Country Status (2)

Country Link
CN (1) CN106713522B (en)
WO (1) WO2018103400A1 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106713522B (en) * 2016-12-07 2020-01-14 Oppo广东移动通信有限公司 Wireless fidelity Wi-Fi connection method and mobile terminal
CN110870289B (en) * 2017-07-07 2021-06-01 华为技术有限公司 Method and device for restoring surfing Internet of local area network equipment
CN108566669B (en) * 2017-12-07 2021-05-04 惠州Tcl移动通信有限公司 Intelligent power saving method for terminal, terminal and device with storage function
CN108063840A (en) * 2018-01-23 2018-05-22 广东欧珀移动通信有限公司 Access the method and Related product of network
CN108064071B (en) * 2018-02-13 2020-06-16 Oppo广东移动通信有限公司 Network connection method, device, storage medium and electronic equipment
CN109660411B (en) * 2019-02-25 2022-03-01 北京云中融信网络科技有限公司 Method and device for optimizing link connection of instant messaging network

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101202767A (en) * 2006-12-29 2008-06-18 深圳市同洲电子股份有限公司 Method and device for hiring IP address
CN101227356A (en) * 2007-12-12 2008-07-23 深圳市同洲电子股份有限公司 Equipment, system and method for network access based on dynamic state host computer collocation protocol
KR20110070444A (en) * 2009-12-18 2011-06-24 주식회사 케이티 A triple dhcp system and dhcp message processing method
CN103312708A (en) * 2013-06-07 2013-09-18 福建联迪商用设备有限公司 Lease file based IP (internet protocol) setting method and system
CN105813056A (en) * 2016-05-06 2016-07-27 广东欧珀移动通信有限公司 Network access method and terminal

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101098346B (en) * 2006-06-28 2010-10-27 华为技术有限公司 Method for initiating lease period renewal process of protocol address network
CN101729610A (en) * 2009-12-15 2010-06-09 中兴通讯股份有限公司 Method and system for backing up DHCP SERVER
CN102685265A (en) * 2012-05-14 2012-09-19 中国科学院计算机网络信息中心 IP (Internet Protocol) address managing method, equipment and system
CN105812505A (en) * 2016-05-06 2016-07-27 上海斐讯数据通信技术有限公司 Method and device for renewing lease of IP address of terminal equipment
CN106713522B (en) * 2016-12-07 2020-01-14 Oppo广东移动通信有限公司 Wireless fidelity Wi-Fi connection method and mobile terminal

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101202767A (en) * 2006-12-29 2008-06-18 深圳市同洲电子股份有限公司 Method and device for hiring IP address
CN101227356A (en) * 2007-12-12 2008-07-23 深圳市同洲电子股份有限公司 Equipment, system and method for network access based on dynamic state host computer collocation protocol
KR20110070444A (en) * 2009-12-18 2011-06-24 주식회사 케이티 A triple dhcp system and dhcp message processing method
CN103312708A (en) * 2013-06-07 2013-09-18 福建联迪商用设备有限公司 Lease file based IP (internet protocol) setting method and system
CN105813056A (en) * 2016-05-06 2016-07-27 广东欧珀移动通信有限公司 Network access method and terminal

Also Published As

Publication number Publication date
WO2018103400A1 (en) 2018-06-14
CN106713522A (en) 2017-05-24

Similar Documents

Publication Publication Date Title
CN106713522B (en) Wireless fidelity Wi-Fi connection method and mobile terminal
US9749324B2 (en) System, device and method for network authorization based on no password or random password
US10104700B2 (en) Message processing method, MME selection method, and apparatuses
CN108933948B (en) Video playing progress synchronization method and device
CN107113892B (en) Method and device for automatically networking gateway equipment
US20120076072A1 (en) System and method for maintaining privacy in a wireless network
KR20160138055A (en) Method and apparatus for fast ip address assignment
JP6602475B2 (en) Method, device and system for authenticating to mobile network, and server for authenticating device to mobile network
CN107026813B (en) Access authentication method and system of WiFi network and portal server
KR102060434B1 (en) Apparatus and method for providing a wireless communication in a portable terminal
US20160234307A1 (en) Data transmission method, device, and system
KR20130093953A (en) Method and apparatus for supporting device to device communications
CN111263338A (en) Network distribution method of Bluetooth Mesh network and related network distribution equipment and system
WO2017092588A1 (en) Mac address allocation method, device and system
CN106453370B (en) Method and device for registering IPC (inter-programmable logic controller) to NVR (network video recorder)
CN111294416A (en) Method for obtaining IP address and related product
CN111865731A (en) Intelligent equipment adding method and device, intelligent household control panel and storage medium
CN109451518B (en) Method and equipment for distinguishing WLAN access mode of terminal
CN104519551B (en) WiFi network DHCP negotiation method and client
KR20220048484A (en) A system for providing accurate communication delay guarantee of request response for distributed services
CN106375489B (en) Method and device for processing Media Access Control (MAC) address
CN111935726A (en) Communication processing method, master node, slave node, storage medium and system
CN103873431A (en) Method and device for identifying dynamic host configuration protocol server
CN110572829B (en) Network connection control method and related product
CN114007276A (en) Network access processing method, device, equipment and system of ZigBee network

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
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: OPPO Guangdong Mobile Communications Co., Ltd.

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

Applicant before: Guangdong Opel Mobile Communications Co., Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant