CN106507446B - A kind of Wireless Fidelity Wi-Fi connection method and mobile terminal - Google Patents
A kind of Wireless Fidelity Wi-Fi connection method and mobile terminal Download PDFInfo
- Publication number
- CN106507446B CN106507446B CN201611117240.5A CN201611117240A CN106507446B CN 106507446 B CN106507446 B CN 106507446B CN 201611117240 A CN201611117240 A CN 201611117240A CN 106507446 B CN106507446 B CN 106507446B
- Authority
- CN
- China
- Prior art keywords
- address
- mobile terminal
- new
- routed path
- static
- 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
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W48/00—Access restriction; Network selection; Access point selection
- H04W48/16—Discovering, processing access restriction or access information
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W84/00—Network topologies
- H04W84/02—Hierarchically pre-organised networks, e.g. paging networks, cellular networks, WLAN [Wireless Local Area Network] or WLL [Wireless Local Loop]
- H04W84/10—Small scale networks; Flat hierarchical networks
- H04W84/12—WLAN [Wireless Local Area Networks]
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The embodiment of the invention provides a kind of Wireless Fidelity Wi-Fi connection method and mobile terminals, which comprises when the IP address of mobile terminal has changed, obtains the new IP address of the mobile terminal;Obtain the IP address of current gateway;Establish the target routed path between the new IP address and the IP address of the current gateway;By the target routed path, the communication connection between the mobile terminal and the router is realized.Through the embodiment of the present invention Wi-Fi network can also be quickly accessed in the case where the IP address of mobile terminal changes.
Description
Technical field
The present invention relates to Internet technical fields, and in particular to a kind of Wireless Fidelity Wi-Fi connection method and mobile terminal.
Background technique
With the fast development of information technology, mobile terminal (such as mobile phone, tablet computer) uses more more and more universal, use
Requirement of the family to mobile terminal is also higher and higher, higher processing speed is not only needed, also to access Wireless Fidelity (Wireless
Fidelity, Wi-Fi) propose requirement.
In the prior art, mobile terminal is after connecting upper Wi-Fi, if Wi-Fi is not disconnected, but the IP address hair of mobile terminal
Changing, mobile terminal can then dispose the default route information (including routed path) of Wi-Fi network, lead to mobile terminal
Network can not be accessed.
Summary of the invention
The embodiment of the invention provides a kind of Wireless Fidelity Wi-Fi connection method and mobile terminals, to move eventually
In the case that the IP address at end changes, Wi-Fi network is accessed.
First aspect of the embodiment of the present invention provides a kind of Wireless Fidelity Wi-Fi connection method, comprising:
When the IP address of mobile terminal has changed, the new IP address of the mobile terminal is obtained;
Obtain the IP address of gateway, wherein the IP address of the gateway is by the dynamic host configuration protocol in router
Dynamic Host Configuration Protocol server configuration;
According to the IP address of the new IP address and the gateway, target routed path is established;
By the target routed path, the communication connection between the mobile terminal and the router is established.
Second aspect of the embodiment of the present invention provides a kind of mobile terminal, comprising:
First acquisition unit, for when the IP address of mobile terminal has changed, obtaining the new IP of the mobile terminal
Location;
Second acquisition unit, for obtaining the IP address of gateway, wherein the IP address of the gateway is by dynamic in router
The configuration of state host configuration Dynamic Host Configuration Protocol server;
Unit is established, for the IP address according to the new IP address and the gateway, establishes target routed path;
Communication unit, for establishing between the mobile terminal and the router by the target routed path
Communication connection.
The third aspect of the embodiment of the present invention provides a kind of mobile terminal, comprising:
Processor and memory;Wherein, the processor is by calling the code in the memory or instructing to execute
The some or all of step of method described in first aspect.
The implementation of the embodiments of the present invention has the following beneficial effects:
Through the embodiment of the present invention, when the IP address of mobile terminal has changed, the new IP address of mobile terminal is obtained, is obtained
Take the IP address of gateway, wherein the IP address of gateway is configured by the dynamic host configuration protocol DHCP server in router, root
According to the IP address of new IP address and gateway, target routed path is established, by target routed path, establishes mobile terminal and routing
Communication connection between device.To even if Wi-Fi net can also be quickly accessed in the case where the IP address of mobile terminal changes
Network.
Detailed description of the invention
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment
Attached drawing is briefly described, it should be apparent that, drawings in the following description are some embodiments of the invention, for ability
For the those of ordinary skill of domain, without creative efforts, it can also be obtained according to these attached drawings other attached
Figure.
Fig. 1 is a kind of first embodiment process signal of Wireless Fidelity Wi-Fi connection method provided in an embodiment of the present invention
Figure;
Fig. 2 is a kind of second embodiment process signal of Wireless Fidelity Wi-Fi connection method provided in an embodiment of the present invention
Figure;
Fig. 3 is a kind of 3rd embodiment process signal of Wireless Fidelity Wi-Fi connection method provided in an embodiment of the present invention
Figure;
Fig. 4 a is a kind of schematic structural diagram of the first embodiment of mobile terminal provided in an embodiment of the present invention;
Fig. 4 b is the structural representation of the second acquisition unit of mobile terminal described in Fig. 4 a provided in an embodiment of the present invention
Figure;
Fig. 4 c is the another structure of the second acquisition unit of mobile terminal described in Fig. 4 a provided in an embodiment of the present invention
Schematic diagram;
Fig. 4 d is the another structural schematic diagram of mobile terminal described in Fig. 4 a provided in an embodiment of the present invention;
Fig. 4 e is the another structural schematic diagram of mobile terminal described in Fig. 4 a provided in an embodiment of the present invention;
Fig. 5 is a kind of schematic structural diagram of the second embodiment of mobile terminal provided in an embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are some of the embodiments of the present invention, instead of all the embodiments.Based on this hair
Embodiment in bright, every other implementation obtained by those of ordinary skill in the art without making creative efforts
Example, shall fall within the protection scope of the present invention.
Description and claims of this specification and term " first ", " second ", " third " and " in the attached drawing
Four " etc. are not use to describe a particular order for distinguishing different objects.In addition, term " includes " and " having " and it
Any deformation, it is intended that cover and non-exclusive include.Such as it contains the process, method of a series of steps or units, be
System, product or equipment are not limited to listed step or unit, but optionally further comprising the step of not listing or list
Member, or optionally further comprising other step or units intrinsic for these process, methods, product or equipment.
Referenced herein " embodiment " is it is meant that a particular feature, structure, or characteristic described can wrap in conjunction with the embodiments
Containing at least one embodiment of the present invention.It is identical that each position in the description shows that the phrase might not be each meant
Embodiment, nor the independent or alternative embodiment with other embodiments mutual exclusion.Those skilled in the art explicitly and
Implicitly understand, embodiment described herein can be combined with other embodiments.
Mobile terminal described by the embodiment of the present invention may include smart phone (such as Android phone, iOS mobile phone,
Windows Phone mobile phone etc.), tablet computer, mobile unit, palm PC, laptop, mobile internet device
(MID, Mobile Internet Devices) or wearable device etc., above-mentioned is only citing, and non exhaustive, includes but unlimited
In above-mentioned mobile terminal.
Under normal conditions, dynamic host configuration protocol (Dynamic Host Configuration is built-in in router
Protocol, DHCP) server, which can distribute an IP address, the i.e. IP of mobile terminal to mobile terminal
Location.A routed path is formed between the IP address of mobile terminal and the IP address of gateway, is based on the routed path, mobile terminal
It can be communicatively coupled, i.e., can carry out data transmission between router between mobile terminal and router.
It should be noted that the system monitoring Wi-Fi network of mobile terminal changes, for example, mobile terminal finds the movement
Although terminal is in Wi-Fi connection status, the IP address of the mobile terminal itself have occurred variation (such as: from
192.168.1.100 become 192.168.1.123), then mobile terminal can not carry out data transmission.
Thus, the embodiment of the present invention provides a kind of Wireless Fidelity Wi-Fi connection method, includes the following steps:
When the IP address of mobile terminal has changed, the new IP address of the mobile terminal is obtained;
Obtain the IP address of current gateway;
Establish the target routed path between the new IP address and the IP address of the current gateway;
By the target routed path, the communication connection between the mobile terminal and the router is realized.
In this way, also can establish the new IP address of mobile terminal even if the IP address of mobile terminal itself has changed
Routed path between the IP address of network, is based on the routed path, and mobile terminal can be established between router logical again
Letter connection, it can carry out data transmission between router.
Referring to Fig. 1, being a kind of first embodiment stream of Wireless Fidelity Wi-Fi connection method provided in an embodiment of the present invention
Journey schematic diagram.Wireless Fidelity Wi-Fi connection method as described in this embodiment, comprising the following steps:
101, when the IP address of mobile terminal has changed, the new IP address of the mobile terminal is obtained.
Under normal conditions, it in the case where mobile terminal is in Wi-Fi connection status, if the IP address of mobile terminal changes, moves
Dynamic terminal may will disconnect Wi-Fi network, and be in non-access state.It, can in the case where the IP address of mobile terminal changes
Obtain the new IP address of the mobile terminal.Wherein, the IP address that the IP address of mobile terminal can be randomly assigned by Dynamic Host Configuration Protocol server.
For example, when the IP address of mobile terminal is static ip address, if by being tied up between the IP address and router
It is fixed, then there was only that the IP address is correct and password is correct, can just access the router, even if other mobile terminal be aware of it is close
Code, but the IP address of its mobile terminal is not above-mentioned IP address, can not access the router yet.
102, the IP address of current gateway is obtained.
Wherein, the IP address of mobile terminal is varied, and still, the IP address of gateway does not change, thus, it can obtain current
The IP address of the IP address of gateway, the gateway can be distributed as the Dynamic Host Configuration Protocol server built in router.Certainly, the IP address of gateway by
Router distribution, mobile terminal then need in the coverage area of the router, and router can distribute the IP of gateway just for it
Address, otherwise, if mobile terminal is not in the coverage area of the router, mobile terminal can be carried out covering for other routers
Lid range, then gateway at this time also changes, and the IP address of gateway also changes.
Optionally, mobile terminal can get the IP address of middle gateway from routing table.Under normal conditions, even if it is mobile whole
The IP address at end is varied, and routing table also needs a period of time to update, thus, routing table, the road Bing Conggai can be directly acquired
The IP address of gateway is obtained by table.
Optionally, the IP address of above-mentioned acquisition gateway, it may include following steps:
21) the first routed path before, the IP address of the acquisition mobile terminal has changed;
22) IP address of the gateway, is obtained from first routed path.
Wherein, in step 21, the IP address of above-mentioned mobile terminal changed before the first routed path, i.e., current road
By path, although IP address has changed, routed path is not yet modified, thus, first routed path can be directly acquired,
First routed path includes the IP address of the IP address and gateway before the IP address of the mobile terminal has changed, thus, it can
The IP address of gateway is obtained from the first routed path.
Optionally, the IP address of above-mentioned acquisition gateway, it may include following steps:
23) data packet sent by the router, is obtained, the data packet carries the IP address of the gateway;
24), the data packet is parsed, obtains the IP address of the gateway.
Wherein, can be reserved in mobile terminal has more data packet.Router to mobile terminal send data packet when
It waits, mobile terminal can receive the data packet sent by router, and be stored in the mobile terminal.Each data packet can carry net
The IP address of pass, then, mobile terminal can parse data packet, thus, obtain the IP address of gateway.Specifically, gateway
IP address be mobile terminal when obtaining IP address to Dynamic Host Configuration Protocol server, the Offer message or ACK replied by Dynamic Host Configuration Protocol server
It is carried in message (i.e. data packet), it is only necessary to Offer message or ACK message (data packet) be parsed, can be obtained
To the IP address of gateway.
103, the target routed path between the new IP address and the IP address of the current gateway is established.
Wherein, in the case where the IP address of the new IP address and gateway of mobile terminal all determines, then mobile terminal can
Quickly generate target routed path between the two.The target routed path may include the new IP address of the mobile terminal and current
The IP address of gateway.
104, by the target routed path, the communication connection between the mobile terminal and the router is realized.
Wherein, after target routed path determines, then by the target routed path, mobile terminal can be passed to router
Transmission of data, alternatively, router can also transmit data to the mobile terminal.
As can be seen that through the embodiment of the present invention, when the IP address of mobile terminal has changed, obtaining the new of mobile terminal
IP address obtains the IP address of current gateway, according to the IP address of new IP address and current gateway, establishes target routed path,
By target routed path, the communication connection between mobile terminal and router is established.To even if in the IP of mobile terminal
In the case that location changes, Wi-Fi network can also be quickly accessed, so, it can be achieved that mobile terminal does not perceive Wi-Fi network disconnection
In the case where, Wi-Fi network is quickly accessed, is had using promotion user experience, especially user in transmission file or game
When, it not will cause network interruption.
Consistent with the abovely, referring to Fig. 2, being a kind of Wireless Fidelity Wi-Fi connection method provided in an embodiment of the present invention
Second embodiment flow diagram.Wireless Fidelity Wi-Fi connection method as described in this embodiment, comprising the following steps:
201, whether detection mobile terminal, which has occurred, is re-rented IP address event.
Wherein, mobile terminal is during re-renting IP address event, it is likely that can change the IP of the mobile terminal
Address, thus, it can be by detecting whether to have occurred IP address event of re-renting, and whether the IP address for detecting mobile terminal changes.
It should be noted that under normal conditions, router is provided with Dynamic Host Configuration Protocol server, Dynamic Host Configuration Protocol server is used for movement
Terminal distribution IP address (i.e. the IP address of mobile terminal), the IP address have a validity period, before the deadline, mobile terminal
Wi-Fi connection status can be kept with router, at the end of the validity period, then mobile terminal will disconnect between router
Wi-Fi connection.Before IP address validity period terminates, IP address can be sent to Dynamic Host Configuration Protocol server and re-rent request, Dynamic Host Configuration Protocol server
It is that mobile terminal distributes IP address that the IP address, which can be responded, and re-rent request.I.e. in the IP address of gateway before validity period,
It then carries out re-renting IP address, at this point, mobile terminal, which just has occurred, re-rents IP address event.In this process, mobile terminal
IP address may be reallocated.
202, when re-renting IP address event described in having occurred in the mobile terminal, the mobile terminal after re-renting is obtained
IP address.
Wherein, when mobile terminal has occurred and re-rents IP address event, the IP address of the mobile terminal after re-renting can be obtained.
203, the IP address of the mobile terminal after being re-rented described in detection and the mobile terminal before described re-rent
IP address it is whether consistent.
Wherein, IP address of the mobile terminal before the IP address after re-renting is re-rented with mobile terminal can be compared,
To determine whether the two is consistent.
204, the IP address of the mobile terminal after described re-rent and the mobile terminal before described re-rent
When IP address is inconsistent, the new IP address of the mobile terminal is obtained.
Wherein, when IP address of the mobile terminal in the IP address after re-renting and before re-renting is inconsistent, this can be directly acquired
The new IP address of mobile terminal, i.e. IP address re-rent after IP address.The IP address of mobile terminal changes, then mobile terminal
Its IP address can be comparatively fast perceived to change, thus, the new IP address of mobile terminal can be read.
205, the IP address of current gateway is obtained.
206, the target routed path between the new IP address and the IP address of the current gateway is established.
207, by the target routed path, the communication connection between the mobile terminal and the router is realized.
Wherein, above-mentioned steps 204- step 207 can refer to the corresponding of Wireless Fidelity Wi-Fi connection method described in Fig. 1
Step, details are not described herein.
As can be seen that through the embodiment of the present invention, IP address event of re-renting has occurred in mobile terminal, and mobile terminal is continuous
When IP address after rent is inconsistent with IP address before re-renting, the new IP address of mobile terminal can be obtained, new IP address is established
Target routed path between the IP address of current gateway realizes mobile terminal and router by the target routed path
Between communication connection.To even if Wi-Fi network can also be quickly accessed in the case where the IP address of mobile terminal changes.
So, it can be achieved that quickly accessing Wi-Fi network in the case that mobile terminal does not perceive Wi-Fi network disconnection, there is utilization to mention
User experience, especially user are risen when transmitting file or game, not will cause network interruption.
Consistent with the abovely, referring to Fig. 3, being a kind of Wireless Fidelity Wi-Fi connection method provided in an embodiment of the present invention
3rd embodiment flow diagram.Wireless Fidelity Wi-Fi connection method as described in this embodiment, comprising the following steps:
301, whether detection mobile terminal is provided with static ip address.
Wherein, although the IP address of mobile terminal can be randomly assigned by Dynamic Host Configuration Protocol server, the IP of mobile terminal
Address also can be set to static ip address.Since IP address is by dynamic IP addressing to static ip address, the IP of mobile terminal
Address changes to static ip address by dynamic IP addressing, and the IP address of the mobile terminal may change.If current dynamic IP
Address is as static ip address, then the IP address of mobile terminal has not been changed.
302, when the mobile terminal is provided with the static ip address, the static ip address and the setting are detected
Whether IP address before is consistent.
Wherein, when mobile terminal is provided with static ip address, detection static ip address is with the IP address before setting
It is no consistent.For example, static ip address is 192.168.1.123, and the IP address before static ip address is arranged is
192.168.1.100, then, illustrate that static ip address and the IP address before static ip address is arranged are inconsistent.In another example quiet
State IP address is 192.168.1.123, and the IP address before static ip address is arranged is 192.168.1.123, then, explanation
Static ip address is consistent with the IP address before setting static ip address.
303, when the IP address before the static ip address and the setting is inconsistent, the mobile terminal is obtained
New IP address.
Wherein, it when the IP address before static ip address and setting static ip address is inconsistent, then can obtain mobile whole
The new IP address at end.The new IP address is static ip address.
304, the IP address of current gateway is obtained.
305, the target routed path between the new IP address and the IP address of the current gateway is established.
306, by the target routed path, the communication connection between the mobile terminal and the router is realized.
Wherein, above-mentioned steps 303- step 306 can refer to the corresponding of Wireless Fidelity Wi-Fi connection method described in Fig. 1
Step, details are not described herein.
As can be seen that through the embodiment of the present invention, after mobile terminal is provided with static ip address, if the static IP
Location and the IP before being provided with static ip address are inconsistent, then can obtain current net using the static ip address as new IP address
The IP address of pass establishes the target routed path between new IP address and the IP address of current gateway, routes road by the target
Diameter realizes the communication connection between mobile terminal and router.To even if the case where the IP address of mobile terminal changes
Under, Wi-Fi network can also be quickly accessed.So, it can be achieved that in the case that mobile terminal does not perceive Wi-Fi network disconnection, fastly
Speed is linked into Wi-Fi network, has using promotion user experience, especially user when transmitting file or game, Bu Huizao
At network interruption.
Consistent with the abovely, specific as follows the following are the device for implementing above-mentioned Wireless Fidelity Wi-Fi connection method:
Fig. 4 a is please referred to, is a kind of schematic structural diagram of the first embodiment of mobile terminal provided in an embodiment of the present invention.This
Mobile terminal described in embodiment, comprising: first acquisition unit 401, second acquisition unit 402 are established unit 403 and led to
Believe unit 404, specific as follows:
First acquisition unit 401, for when the IP address of mobile terminal has changed, obtaining the new IP of the mobile terminal
Address;
Second acquisition unit 402, for obtaining the IP address of current gateway;
Unit 403 is established, the target routing for establishing between the new IP address and the IP address of the current gateway
Path;
Communication unit 404, for realizing between the mobile terminal and the router by the target routed path
Communication connection.
Optionally, the specific refinement if Fig. 4 b, Fig. 4 b are the second acquisition unit 402 of mobile terminal described by Fig. 4 a is tied
Structure, the second acquisition unit 402 can include: first obtains module 4021 and the second acquisition module 4022, specific as follows:
First obtain module 4021, the IP address for obtaining the mobile terminal changed before the first via by road
Diameter;
Second obtains module 4022, for obtaining the IP address of the current gateway from first routed path.
Optionally, the specific refinement if Fig. 4 c, Fig. 4 c are the second acquisition unit 402 of mobile terminal described by Fig. 4 a is tied
Structure, the second acquisition unit 402 can include: third obtains module 4023 and parsing module 4024, specific as follows:
Third obtains module 4023, for obtaining the data packet sent by the router, described in the data packet carrying
The IP address of current gateway;
Parsing module 4024 obtains the IP address of the current gateway for parsing to the data packet.
Optionally, such as Fig. 4 d, Fig. 4 d is the another modification structures of mobile terminal described in Fig. 4 a, and described in Fig. 4 a
Mobile terminal compares, further include: first detection unit 405, third acquiring unit 406 and second detection unit 407, specifically
It is as follows:
First detection unit 405, in the first acquisition unit 401 when the IP address of mobile terminal has changed,
Before the new IP address for obtaining the mobile terminal, detects the mobile terminal and whether have occurred and re-rent IP address event;
Third acquiring unit 406 is mobile terminal generation for the testing result in the first detection unit 405
It is described when re-renting IP address event, obtain the IP address of the mobile terminal after re-renting;
Second detection unit 407, for detecting the IP address of the mobile terminal after described re-rent and described re-renting it
Whether the IP address of the preceding mobile terminal is consistent, after the testing result of the second detection unit 407 is re-rented for described in
The mobile terminal IP address and it is described re-rent before the mobile terminal IP address it is inconsistent when, confirm the shifting
The IP address of dynamic terminal has changed.
Optionally, such as Fig. 4 e, Fig. 4 e is the another modification structures of mobile terminal described in Fig. 4 a, and described in Fig. 4 a
Mobile terminal compares, further include: third detection unit 408 and the 4th detection unit 409, specific as follows:
Third detection unit 408, in the first acquisition unit 401 when the IP address of mobile terminal has changed,
Before the new IP address for obtaining the mobile terminal, detect whether the mobile terminal is provided with static ip address;
4th detection unit 409 is mobile terminal setting for the testing result in the third detection unit 408
When the static ip address, detects the static ip address and whether the IP address before the setting is consistent, described
When the testing result of four detection units 409 is inconsistent for the IP address before the static ip address and the setting, institute is confirmed
The IP address for stating mobile terminal has changed.
As can be seen that mobile terminal described in through the embodiment of the present invention, can change in the IP address of mobile terminal
When, the new IP address of mobile terminal is obtained, the IP address of current gateway is obtained, establishes the IP address of new IP address and current gateway
Between target routed path the communication connection between mobile terminal and router is realized by the target routed path.From
And even if Wi-Fi network can also be quickly accessed in the case where the IP address of mobile terminal changes, it is so, it can be achieved that mobile whole
In the case that end does not perceive Wi-Fi network disconnection, Wi-Fi network is quickly accessed, is had using user experience is promoted, especially
User not will cause network interruption when transmitting file or game.
Consistent with the abovely, referring to Fig. 5, being a kind of second embodiment knot of mobile terminal provided in an embodiment of the present invention
Structure schematic diagram.Mobile terminal as described in this embodiment, comprising: at least one input equipment 1000;At least one output is set
Standby 2000;At least one processor 3000, such as CPU;With memory 4000, above-mentioned input equipment 1000, output equipment 2000,
Processor 3000 and memory 4000 are connected by bus 5000.
Wherein, above-mentioned input equipment 1000 concretely touch panel, physical button or mouse.
Above-mentioned output equipment 2000 concretely display screen.
Above-mentioned memory 4000 can be high speed RAM memory, can also be nonvolatile storage (non-volatile
), such as magnetic disk storage memory.Above-mentioned memory 4000 is used to store a set of program code, above-mentioned input equipment 1000, defeated
Equipment 2000 and processor 3000 are used to call the program code stored in memory 4000 out, perform the following operations:
Above-mentioned processor 3000, is used for:
When the IP address of mobile terminal has changed, the new IP address of the mobile terminal is obtained;
Obtain the IP address of current gateway;
Establish the target routed path between the new IP address and the IP address of the current gateway;
By the target routed path, the communication connection between the mobile terminal and the router is realized.
Optionally, above-mentioned processor 3000 obtains the IP address of current gateway, comprising:
Obtain the mobile terminal IP address changed before the first routed path;
The IP address of the current gateway is obtained from first routed path.
Optionally, above-mentioned processor 3000 obtains the IP address of current gateway, comprising:
The data packet sent by the router is obtained, the data packet carries the IP address of the current gateway;
The data packet is parsed, the IP address of the current gateway is obtained.
Optionally, above-mentioned processor 3000 obtains described mobile whole described when the IP address of mobile terminal has changed
Before the new IP address at end, also particularly useful for:
It detects the mobile terminal and whether has occurred and re-rent IP address event;
When re-renting IP address event described in having occurred in the mobile terminal, the IP address after re-renting is obtained;
Whether the IP address after re-renting described in detection and the IP address before described re-rent are consistent;
After described re-rent IP address and it is described re-rent before IP address it is inconsistent when, confirm the mobile terminal
IP address has changed.
Optionally, above-mentioned processor 3000 obtains described mobile whole described when the IP address of mobile terminal has changed
Before the new IP address at end, also particularly useful for:
Detect whether the mobile terminal is provided with static ip address;
When the mobile terminal is provided with the static ip address, before detecting the static ip address and the setting
IP address it is whether consistent;
When IP address before the static ip address and the setting is inconsistent, with confirming the IP of the mobile terminal
Location has changed.
The embodiment of the present invention also provides a kind of computer storage medium, wherein the computer storage medium can be stored with journey
Sequence, the program include the part for any Wireless Fidelity Wi-Fi connection method recorded in above method embodiment when executing
Or Overall Steps.
Although combining each embodiment herein, invention has been described, however, implementing the claimed invention
In the process, those skilled in the art are by checking the attached drawing, disclosure and the appended claims, it will be appreciated that and it is real
Other variations of the existing open embodiment.In the claims, " comprising " (comprising) word is not excluded for other compositions
Part or step, "a" or "an" are not excluded for multiple situations.Claim may be implemented in single processor or other units
In several functions enumerating.Mutually different has been recited in mutually different dependent certain measures, it is not intended that these are arranged
It applies to combine and generates good effect.
It will be understood by those skilled in the art that the embodiment of the present invention can provide as method, apparatus (equipment) or computer journey
Sequence product.Therefore, complete hardware embodiment, complete software embodiment or combining software and hardware aspects can be used in the present invention
The form of embodiment.Moreover, it wherein includes the calculating of computer usable program code that the present invention, which can be used in one or more,
The computer program implemented in machine usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.)
The form of product.Computer program is stored/distributed in suitable medium, is provided together with other hardware or as the one of hardware
Part can also use other distribution forms, such as pass through the wired or wireless telecommunication system of Internet or other.
The present invention be referring to the embodiment of the present invention method, apparatus (equipment) and computer program product flow chart with/
Or block diagram describes.It should be understood that each process that can be realized by computer program instructions in flowchart and/or the block diagram and/
Or the combination of the process and/or box in box and flowchart and/or the block diagram.It can provide these computer program instructions
To general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices processor to generate one
A machine so that by the instruction that the processor of computer or other programmable data processing devices executes generate for realizing
The device for the function of being specified in one or more flows of the flowchart and/or one or more blocks of the block diagram.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates,
Enable the manufacture of device, the command device realize in one box of one or more flows of the flowchart and/or block diagram or
The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting
Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or
The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one
The step of function of being specified in a box or multiple boxes.
Although in conjunction with specific features and embodiment, invention has been described, it is clear that, do not departing from this hair
In the case where bright spirit and scope, it can be carry out various modifications and is combined.Correspondingly, the specification and drawings are only institute
The exemplary illustration of the invention that attached claim is defined, and be considered as covered in the scope of the invention any and all and repair
Change, change, combining or equivalent.Obviously, those skilled in the art various changes and modifications can be made to the invention without
It is detached from the spirit and scope of the present invention.If in this way, these modifications and changes of the present invention belong to the claims in the present invention and its
Within the scope of equivalent technologies, then the present invention is also intended to include these modifications and variations.
Claims (12)
1. a kind of Wireless Fidelity Wi-Fi connection method characterized by comprising
When the IP address of mobile terminal has changed, the new IP address of the mobile terminal is obtained;
Obtain the IP address of current gateway;
Establish the target routed path between the new IP address and the IP address of the current gateway;
By the target routed path, the communication connection between the mobile terminal and router is realized.
2. the method according to claim 1, wherein the IP address for obtaining current gateway, comprising:
Obtain the mobile terminal IP address changed before the first routed path;
The IP address of the current gateway is obtained from first routed path.
3. the method according to claim 1, wherein the IP address for obtaining current gateway, comprising:
The data packet sent by the router is obtained, the data packet carries the IP address of the current gateway;
The data packet is parsed, the IP address of the current gateway is obtained.
4. method according to any one of claims 1 to 3, which is characterized in that the IP address in mobile terminal
When variation, before the new IP address for obtaining the mobile terminal, the method also includes:
It detects the mobile terminal and whether has occurred and re-rent IP address event;
When re-renting IP address event described in having occurred in the mobile terminal, the IP address for re-renting the rear mobile terminal is obtained;
The IP address of the IP address of the mobile terminal after being re-rented described in detection and the mobile terminal before described re-rent
It is whether consistent;
The IP address of the mobile terminal after described re-rent and it is described re-rent before the mobile terminal IP address not
When consistent, confirm that the IP address of the mobile terminal has changed.
5. method according to any one of claims 1 to 3, which is characterized in that the IP address in mobile terminal
When variation, before the new IP address for obtaining the mobile terminal, the method also includes:
Detect whether the mobile terminal is provided with static ip address;
When the mobile terminal is provided with the static ip address, the IP before the static ip address and the setting is detected
Whether address is consistent;
When IP address before the static ip address and the setting is inconsistent, the IP address of the mobile terminal has been confirmed
Variation.
6. a kind of mobile terminal characterized by comprising
First acquisition unit, for obtaining the new IP address of the mobile terminal when the IP address of mobile terminal has changed;
Second acquisition unit, for obtaining the IP address of current gateway;
Unit is established, the target routed path for establishing between the new IP address and the IP address of the current gateway;
Communication unit, for realizing the communication connection between the mobile terminal and router by the target routed path.
7. mobile terminal according to claim 6, which is characterized in that the second acquisition unit includes:
First obtain module, the IP address for obtaining the mobile terminal changed before the first routed path;
Second obtains module, for obtaining the IP address of the current gateway from first routed path.
8. mobile terminal according to claim 6, which is characterized in that the second acquisition unit includes:
Third obtains module, and for obtaining the data packet sent by the router, the data packet carries the current gateway
IP address;
Parsing module obtains the IP address of the current gateway for parsing to the data packet.
9. according to the described in any item mobile terminals of claim 6 to 8, which is characterized in that the mobile terminal changes further include:
First detection unit, for, when the IP address of mobile terminal has changed, obtaining the shifting in the first acquisition unit
Before the new IP address of dynamic terminal, detects the mobile terminal and whether have occurred and re-rent IP address event;
Third acquiring unit is that described re-rent has occurred in the mobile terminal for the testing result in the first detection unit
When IP address event, the IP address of the mobile terminal after re-renting is obtained;
Second detection unit, for detect the mobile terminal after described re-rent IP address and it is described re-rent before described in
Whether the IP address of mobile terminal is consistent, is described mobile whole after described re-rent in the testing result of the second detection unit
When the IP address at end and the inconsistent IP address of the mobile terminal before described re-rent, with confirming the IP of the mobile terminal
Location has changed.
10. according to the described in any item mobile terminals of claim 6 to 8, which is characterized in that the mobile terminal further include:
Third detection unit, for, when the IP address of mobile terminal has changed, obtaining the shifting in the first acquisition unit
Before the new IP address of dynamic terminal, detect whether the mobile terminal is provided with static ip address;
4th detection unit is that the mobile terminal is provided with the static state for the testing result in the third detection unit
When IP address, detects the static ip address and whether the IP address before the setting is consistent, in the 4th detection unit
Testing result be the static ip address and the setting before IP address it is inconsistent when, confirm the IP of the mobile terminal
Address has changed.
11. a kind of mobile terminal characterized by comprising
Processor and memory;Wherein, the processor is by calling the code in the memory or instructing to execute such as power
Benefit requires method described in 1 to 5 any one.
12. a kind of computer readable storage medium, which is characterized in that the computer-readable recording medium storage has computer journey
Sequence when the computer program is executed by computer equipment, completes the method as described in claim 1 to 5 any one.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611117240.5A CN106507446B (en) | 2016-12-07 | 2016-12-07 | A kind of Wireless Fidelity Wi-Fi connection method and mobile terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611117240.5A CN106507446B (en) | 2016-12-07 | 2016-12-07 | A kind of Wireless Fidelity Wi-Fi connection method and mobile terminal |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106507446A CN106507446A (en) | 2017-03-15 |
CN106507446B true CN106507446B (en) | 2019-08-27 |
Family
ID=58329767
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201611117240.5A Active CN106507446B (en) | 2016-12-07 | 2016-12-07 | A kind of Wireless Fidelity Wi-Fi connection method and mobile terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106507446B (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101119312A (en) * | 2007-09-13 | 2008-02-06 | 北京交通大学 | Method for implementing integrated network mobile switch management |
CN102170628A (en) * | 2010-02-25 | 2011-08-31 | 中兴通讯股份有限公司 | Worldwide interoperability for microwave access (Wimax) system realizing fixed anchor point-free switching and switching method thereof |
CN103338482A (en) * | 2013-07-24 | 2013-10-02 | 成都西加云杉科技有限公司 | Distributing data transmission method, distributing data transmission equipment and user terminal |
CN104660683A (en) * | 2015-01-27 | 2015-05-27 | 广州视源电子科技股份有限公司 | Data transmission control method, device and system |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9294920B2 (en) * | 2013-09-21 | 2016-03-22 | Avaya Inc. | Captive portal systems, methods, and devices |
JP6500214B2 (en) * | 2014-03-20 | 2019-04-17 | パナソニックIpマネジメント株式会社 | Data distribution device and imaging device |
-
2016
- 2016-12-07 CN CN201611117240.5A patent/CN106507446B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101119312A (en) * | 2007-09-13 | 2008-02-06 | 北京交通大学 | Method for implementing integrated network mobile switch management |
CN102170628A (en) * | 2010-02-25 | 2011-08-31 | 中兴通讯股份有限公司 | Worldwide interoperability for microwave access (Wimax) system realizing fixed anchor point-free switching and switching method thereof |
CN103338482A (en) * | 2013-07-24 | 2013-10-02 | 成都西加云杉科技有限公司 | Distributing data transmission method, distributing data transmission equipment and user terminal |
CN104660683A (en) * | 2015-01-27 | 2015-05-27 | 广州视源电子科技股份有限公司 | Data transmission control method, device and system |
Also Published As
Publication number | Publication date |
---|---|
CN106507446A (en) | 2017-03-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104333863B (en) | Connection management method and device, electronic equipment | |
CN105376107B (en) | Terminal testing method and proxy server | |
EP3490304B1 (en) | Method for identifying access point and hotspot, and related products | |
EP3562257B1 (en) | Wireless fidelity (wi-fi) connection method and related product | |
CN104767713B (en) | Account binding method, server and system | |
CN104869043B (en) | A kind of method and terminal for establishing VPN connection | |
CN108512870A (en) | Access method, platform of internet of things and the internet of things equipment of platform of internet of things | |
CN104317648B (en) | A kind of method and apparatus of monitoring advertisement | |
CN104636664A (en) | Cross-site scripting vulnerability detection method and device based on file object model | |
CN104993961A (en) | Equipment control methods, devices and system | |
CN106034302B (en) | Security monitoring method and device for wireless local area network hotspot and communication system | |
CN103699481A (en) | Code debugging method and code debugging system | |
CN107423099B (en) | Key code programming method, server, terminal, key code programming system and storage medium | |
CN106209918A (en) | The method of a kind of internet security management and terminal | |
CN105338550A (en) | Method and device for managing connection of wireless network | |
CN107370685A (en) | A kind of internet-of-things terminal cut-in method and device | |
CN104735657A (en) | Security terminal verification method, device and system and wireless access point binding method | |
CN108052407A (en) | A kind of application crash means of defence, device, equipment and storage medium | |
CN106302519A (en) | The method of a kind of internet security management and terminal | |
CN106992893A (en) | The management method and device of router | |
CN106604363B (en) | A kind of Wireless Fidelity Wi-Fi scan method, mobile terminal and storage medium | |
CN105392083B (en) | A kind of MPP speakers switching method and access controller | |
CN104657445A (en) | Method for obtaining prompt information | |
CN105451367A (en) | Wireless network connection method, device and system | |
CN104539794A (en) | Terminal |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | 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 | ||
CB02 | Change of applicant information |
Address after: 523860 No. 18, Wu Sha Beach Road, Changan Town, Dongguan, Guangdong Applicant after: OPPO Guangdong Mobile Communications Co., Ltd. Address before: 523860 No. 18, Wu Sha Beach Road, Changan Town, Dongguan, Guangdong Applicant before: Guangdong OPPO Mobile Communications Co., Ltd. |
|
GR01 | Patent grant | ||
GR01 | Patent grant |