CN106789530B - A kind of method for connecting network, device and mobile terminal - Google Patents

A kind of method for connecting network, device and mobile terminal Download PDF

Info

Publication number
CN106789530B
CN106789530B CN201611170280.6A CN201611170280A CN106789530B CN 106789530 B CN106789530 B CN 106789530B CN 201611170280 A CN201611170280 A CN 201611170280A CN 106789530 B CN106789530 B CN 106789530B
Authority
CN
China
Prior art keywords
vpn
server
exception
networked data
vpn connection
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
CN201611170280.6A
Other languages
Chinese (zh)
Other versions
CN106789530A (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 CN201611170280.6A priority Critical patent/CN106789530B/en
Publication of CN106789530A publication Critical patent/CN106789530A/en
Application granted granted Critical
Publication of CN106789530B publication Critical patent/CN106789530B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • H04L12/4641Virtual LANs, VLANs, e.g. virtual private networks [VPN]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0811Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking connectivity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/16Threshold monitoring
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions

Abstract

The embodiment of the invention discloses a kind of method for connecting network, device and mobile terminals.This method comprises: when monitoring current application by VPN connection transmission networked data, it determines that the current application connect whether exception application matches at least one preset VPN, or determines that the destination server of the networked data connect whether exception server matches at least one preset VPN;If matching is unsuccessful, the networked data is sent to vpn server, the vpn server is made to forward the networked data to the destination server;If successful match, the networked data is sent to the destination server.Through the above technical solutions, solve when being connected to the network by VPN, all networked datas all via vpn server be forwarded to destination server and caused by network connection it is slow or the problem of can not connect, improve the efficiency of network connection.

Description

A kind of method for connecting network, device and mobile terminal
Technical field
The present invention relates to field of communication technology, especially a kind of method for connecting network, device and mobile terminal.
Background technique
Virtual Private Network (Virtual Private Network, VPN) is the private network established in common network Network realizes long-range connection by the conversion of encryption and data packet destination address to data packet, because having at low cost, communication peace The advantages that complete and easy to use and be widely used in enterprise network.
In the prior art, after the mobile intelligent terminals such as smart phone, tablet computer connect VPN, all networked datas It is all forwarded by vpn server, to achieve the purpose that connect corporate intranet or external network.But it is constrained to vpn server Network-connectivity, when whole networked datas are via vpn server transfer, the probability that networked data is lost is got higher, time delay It is elongated.And if connection is corporate intranet VPN, it is also possible to internet can not be connected.These all may cause certain network address Connection response is relatively slow or without response.
Summary of the invention
In view of this, the embodiment of the present invention provides a kind of method for connecting network, device and mobile terminal, to improve network company Connect efficiency.
In a first aspect, the embodiment of the invention provides a kind of method for connecting network, comprising:
Monitor current application by VPN connection send networked data when, determine the current application and it is preset extremely Whether few VPN connection exception application matches, or determines the destination server and preset at least one of the networked data Whether a VPN connection exception server matches;
If matching is unsuccessful, the networked data is sent to vpn server, makes the vpn server to the target Server forwards the networked data;
If successful match, the networked data is sent to the destination server.
Second aspect, the embodiment of the invention also provides a kind of network connection device, which includes:
Make an exception item matching module, described in determining when monitoring current application by VPN connection transmission networked data Current application connect whether exception application matches at least one preset VPN, or determines the target clothes of the networked data Business device connect whether exception server matches at least one preset VPN;
First networked data sending module sends the networked data to vpn server if unsuccessful for matching, The vpn server is set to forward the networked data to the destination server;
Second networked data sending module sends the networking number to the destination server if being used for successful match According to.
The third aspect the embodiment of the invention also provides a kind of mobile terminal, including memory, processor and is stored in On reservoir and the computer program that can run on a processor, wherein the processor is realized when executing the computer program Following steps:
Monitor current application by VPN connection send networked data when, determine the current application and it is preset extremely Whether few VPN connection exception application matches, or determines the destination server and preset at least one of the networked data Whether a VPN connection exception server matches;
If matching is unsuccessful, the networked data is sent to vpn server, makes the vpn server to the target Server forwards the networked data;
If successful match, the networked data is sent to the destination server.
The embodiment of the present invention by by current application by VPN connection send networked data when current application with it is preset At least one VPN connection exception application is matched, or by the destination server of networked data therein and preset at least one A VPN connection exception server is matched, and when above-mentioned matching is unsuccessful, then sends above-mentioned networked data to vpn server, The vpn server is set to forward above-mentioned networked data to above-mentioned destination server;When above-mentioned successful match, then taken to above-mentioned target Business device sends above-mentioned networked data.When which solve being connected to the network by VPN, all networked datas are all taken via VPN Business device be forwarded to destination server and caused by network connection it is slow or the problem of can not connect, improve the efficiency of network connection.
Detailed description of the invention
Fig. 1 is a kind of flow diagram of the method for connecting network provided in the embodiment of the present invention;
Fig. 2 is the flow diagram of another method for connecting network provided in the embodiment of the present invention;
Fig. 3 is the displaying schematic diagram for skipping VPN network prompt information provided in the embodiment of the present invention;
Fig. 4 is the flow diagram of another method for connecting network provided in the embodiment of the present invention;
Fig. 5 is the flow diagram of another method for connecting network provided in the embodiment of the present invention;
Fig. 6 is a kind of structural schematic diagram of the network connection device provided in the embodiment of the present invention;
Fig. 7 is the structural schematic diagram of another network connection device provided in the embodiment of the present invention;
Fig. 8 is a kind of structural schematic diagram of the mobile terminal provided in the embodiment of the present invention.
Specific embodiment
The present invention is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched The specific embodiment stated is used only for explaining the present invention rather than limiting the invention.It also should be noted that in order to just Only the parts related to the present invention are shown in description, attached drawing rather than entire infrastructure.
It should be mentioned that some exemplary embodiments are described as before exemplary embodiment is discussed in greater detail The processing or method described as flow chart.Although each step is described as the processing of sequence by flow chart, many of these Step can be implemented concurrently, concomitantly or simultaneously.In addition, the sequence of each step can be rearranged.When its operation The processing can be terminated when completion, it is also possible to have the additional step being not included in attached drawing.The processing can be with Corresponding to method, function, regulation, subroutine, subprogram etc..
Fig. 1 is a kind of flow chart of the method for connecting network provided in the embodiment of the present invention, and the present embodiment is applicable to institute There is the case where being connected to the network by VPN connection, this method can be executed by network connection device, and wherein the device can be by Software and or hardware realization can be generally integrated in the equipment with network access functions, such as typically mobile terminal, Such as smart phone, palm PC, tablet computer or portable computer etc..As shown in Figure 1, this method comprises the following steps:
Step 110, monitor current application by VPN connection send networked data when, determine the current application with Whether preset at least one VPN connection exception application matches, or determines the destination server of the networked data and preset At least one VPN connection exception server whether match.
Wherein, the application of VPN connection exception is to forward networked data, and its network to destination server by vpn server Connect the application that slow or network can not connect.VPN connection exception server is networked data by vpn server forwarding, and net Network connects the destination server that slow or network can not connect.Due to the application of VPN connection exception or the net of VPN connection exception server Network connection is slow or network can not connect, so the application of VPN connection exception or VPN connection exception server in the present embodiment are corresponding Networked data be no longer pass through vpn server forwarding, but directly by application be sent to its destination server.To destination server The mode for sending networked data can be the wireless network data by user equipment, be also possible to through its cellular data, this In be not limited.Preset at least one VPN connection exception application or at least one preset VPN connection exception server are Refer to predetermined VPN connection exception application or VPN connection exception server, corresponding VPN connection example would generally be stored in Outer list of application or VPN connection exception server list in, in these lists in addition to storage VPN connection make an exception Apply Names or VPN connection makes an exception except server address, can also store the other information about application or server, such as the VPN connection Exception application or VPN connection exception server are added into the concrete reason etc. of the list.
Under normal circumstances, if user equipment opens VPN connection, the application in the mobile terminal carries out network company When connecing, the networked data issued all can be forwarded to destination server via vpn server.In the present embodiment, when user sets Standby when opening VPN connection, application therein is still by VPN connection transmission networked data, but using by networked data It is sent to before vpn server, needs to carry out the destination server of the application or the networked data if appropriate for by VPN connection The judgement for sending networked data needs to judge it after VPN connection forwards networked data, network connection can or can not be slack-off Or it can not connect.If it is determined that the destination server of the application or the networked data, which does not fit through VPN connection, sends networking number According to then its networked data just will not be using vpn server.
Specifically, whether monitoring mobile terminal first connects VPN, i.e., whether monitoring current application is sent out by VPN connection Send networked data.If monitor current application by VPN connection transmission networked data, then deserving for networked data will be initiated Preceding application connect exception application at least one preset VPN and is matched, or the networked data that current application is sent Destination server connect exception server at least one preset VPN and is matched, to judge the company according to matching result Whether network data needs by vpn server.Matching way therein can be to connect to make an exception with VPN by current application title and answer Title carries out similarity analysis or correlation analysis, or destination server address is connect with making an exception server with VPN Location carries out similarity analysis or correlation analysis, here without limitation.
If step 120, matching are unsuccessful, send the networked data to vpn server, make the vpn server to The destination server forwards the networked data.
Specifically, if the matching result in step 110 is unsuccessful, i.e., current application be not VPN connection exception application or The destination server for the networked data that current application is sent is not VPN connection exception server, then the networking of the current application Data must be forwarded via vpn server, i.e., the networked data that current application is sent is sent to vpn server, is serviced by the VPN Device forwards the networked data to its destination server.
If step 130, successful match, the networked data is sent to the destination server.
Specifically, if the matching result in step 110 is successful, i.e., current application is VPN connection exception application or current Destination server using the networked data of transmission is VPN connection exception server, then the networked data of the current application is just It is no longer pass through vpn server, but directly sends it to its destination server by current application.
The technical solution of the present embodiment, by the way that current application to be sent to current application when networked data by VPN connection It connect exception application at least one preset VPN to be matched, or by the destination server of networked data therein and presets At least one VPN connection exception server matched, when above-mentioned matching is unsuccessful, then to vpn server send it is above-mentioned Networked data makes the vpn server forward above-mentioned networked data to above-mentioned destination server;When above-mentioned successful match, then to Above-mentioned destination server sends above-mentioned networked data.When which solve being connected to the network by VPN, all networked datas are whole Via vpn server be forwarded to destination server and caused by network connection it is slack-off or the problem of can not connect, improve network The efficiency of connection.
On the basis of the above embodiments, as shown in Fig. 2, sending the networked data to vpn server, make described Vpn server is forwarded to the destination server after the networked data further include:
Step 140 determines the corresponding VPN connecting detection result of the current application.
Wherein, VPN connecting detection result refers to be connected to the network by VPN connection after, to the network connection process In information detected after packet loss, network delay and mesh during the testing result that obtains, such as detection network connection Mark server whether up to etc. information.
Specifically, after current application forwards networked data to be connected to the network by VPN connection, in the TCP of network Whether layer or Socket layers of packet loss, network delay and the destination server detected during this time network connection are up in At least one information, as the corresponding VPN connecting detection result of current application.
Step 150 determines whether the VPN connecting detection result meets preset VPN connection exceptional condition.
Wherein, preset VPN connection exceptional condition refers to the threshold value of preset VPN connecting detection result, is used for Whether be VPN connection exception application or whether destination server is VPN connection exception server if judging to apply.
Specifically, after step 150 obtains the corresponding VPN testing result of current application, it is connect example with preset VPN Outer condition is compared, to determine if to meet preset VPN connection exceptional condition.
Illustratively, step 150 can determine in the following manner: if the corresponding packet loss of the current application is greater than in advance If packet loss threshold value, network delay be greater than preset delay threshold and the networked data destination server it is unreachable in At least one meets, it is determined that the VPN connecting detection result meets the VPN connection exceptional condition;If being not satisfied, really The fixed VPN connecting detection result is unsatisfactory for the VPN connection exceptional condition.
Wherein, preset packet loss threshold value, preset delay threshold and destination server it is unreachable be all a kind of specific Any combination of preset VPN connection exceptional condition, any of three or three are used equally for judging whether apply is VPN Whether the application of connection exception or destination server are VPN connection exception server.Preset packet loss threshold value is preset Packet loss, for example preset packet loss can be set as 1%, it is more than the preset packet loss threshold value, network connection will become Slowly it or can not connect.Preset delay threshold is preset network delay value, for example preset delay threshold can be set It is set to 100 milliseconds, is more than the network delay value, network connection will be slack-off or can not be connected.Destination server is unreachable to be referred to The destination server of networked data cannot be connected.
Specifically, if in the VPN connecting detection result that step 140 determines including packet loss, then it is determined that detection is lost Whether packet rate is greater than preset packet loss threshold value;If in VPN connecting detection result including network delay, then it is determined that detection Whether network delay is greater than preset delay threshold;If whether reachable comprising destination server in VPN connecting detection result Detection, then it is determined that whether the destination server of detection is unreachable.If in above-mentioned three kinds of VPN connecting detection result at least A kind of definitive result is "Yes", then the VPN connecting detection result being assured that in step 140 meets VPN connection exception item Part., whereas if definitive result all in above-mentioned three kinds of VPN connecting detection result is all "No", then step can be determined VPN connecting detection result in 140 is unsatisfactory for VPN connection exceptional condition.Selection connect exceptional condition one with preset VPN in this way It is preset more directly and more accurately can to determine whether VPN connecting detection result meets for one corresponding VPN connecting detection item VPN connection exceptional condition, so that the application of subsequent VPN connection exception or the data update of VPN connection exception server are more quasi- Really.
If step 160 meets the VPN connection exceptional condition, the current application is determined as VPN connection exception and is answered With, or by the destination server of the networked data be determined as VPN connection exception server.
Specifically, according to the above technical scheme in the application of VPN connection exception, VPN connection make an exception server and VPN connection example The explanation of outer condition, if the VPN connecting detection result that step 140 determines meets VPN connection exceptional condition, it means that The network connection of the destination server for the networked data that current application issues is slow or can not connect, this just meets VPN connection example Outer application or the definition of VPN connection exception server, so above-mentioned current application is determined as VPN connection exception application, or The destination server of its networked data is determined as VPN connection exception server, completes the application of VPN connection exception or VPN connection The data of exception server update, and enable VPN connection procedure later more quick.
Illustratively, step 160 can implement in the following way: if meeting the VPN connection exceptional condition, It then shows and preset skips VPN network prompt information;According to user to the response results of the prompt information, currently answered described It is applied with VPN connection exception is determined as, or the destination server of the networked data is determined as VPN connection exception service Device.
Wherein, preset VPN network prompt information of skipping is to meet VPN connection exceptional condition in VPN connecting detection result In the case where, it is preset for user selection the prompt information for skipping VPN network, be used for it is subsequent according to the user's choice To determine whether current application can be determined as the application of VPN connection exception or the destination server of its networked data whether may be used Be determined as VPN connection exception server, such as can be set to " current network connection it is slower, if skip VPN net Network? " or " current network connection is slower, if is connected to the network using wireless network or cellular data? ".
Specifically, if the VPN connecting detection result that step 140 determines meets VPN connection exceptional condition, in movement The display interface displaying of terminal is preset to skip VPN network prompt information, so that user is made whether to skip the choosing of VPN connection It selects.As shown in figure 3, by taking smart phone as an example, the Pop-up message prompting frame 330 on the display interface 320 of smart phone 310 disappears Displaying is preset in breath prompting frame 330 skips VPN network prompt information, i.e., " current network connection is slower, if skips VPN net Network? ", and 340 "Yes" of confirming button and negative 350 "No" of button for user's selection are shown simultaneously.If user has selected really Determine 340 "Yes" of button, makes an exception then current application is just determined as VPN connection using or by the destination service of its networked data Device is determined as VPN connection exception server, and the application or the destination server can be said in network connection later according to step 130 Bright mode carries out, without using vpn server.If user has selected 350 "No" of negative button, current application Or the destination server of its networked data would not be confirmed as the application of VPN connection exception or VPN connection exception server, this is answered With or the destination server later network connection can by step 120 illustrate in the way of carry out, i.e., networked data can pass through Vpn server forwarding.In this way user be just able to participate VPN connection exception application or VPN connection make an exception server data more In new, so that user independently determines whether the networked data of device therefor needs by vpn server, to avoid by user The application that must be connected to the network via VPN connection or destination server shielding, so that user can not normal use VPN company The case where connecing.
Illustratively, step 160 can also implement in the following way: if meeting the VPN connection exception item Part then sends the networked data to the destination server, and determines the corresponding internet connecting detection of the current application As a result;According to the internet connecting detection as a result, the current application is determined as VPN connection exception application, or by institute The destination server for stating networked data is determined as VPN connection exception server.
Wherein, connecting detection result in internet is corresponding with VPN connecting detection result, refers to and is not carried out by VPN connection Network connection, but after networked data is directly sent to its destination server, to the information during the network connection into Packet loss, network delay and destination server during the testing result obtained after row detection, such as detection network connection are It is no up to etc. information.
Specifically, after determining above-mentioned VPN connecting detection result, current application is determined except through the selection of user It whether be the destination server of the application of VPN connection exception or networked data whether is that VPN connection makes an exception except server, it can be with Whether the network connection by detecting the destination server itself normally determines.For example determining that VPN connecting detection result is full Sufficient VPN connection exceptional condition, that is, after determining that the network connection of VPN connection is slow or can not connecting, if it is possible to determine and not pass through The connection state when connection state of destination server is better than by VPN connection when VPN connection, so that it may which determination is VPN connection It results in network connection slowly or can not connect, at this moment can also determine that current application is the application of VPN connection exception or networked data Destination server be VPN connection exception server., whereas if not passing through the connection state of destination server when VPN connection Connection state when not better than by VPN connection, that just illustrates the network connection of destination server of the networked data itself It is problematic, rather than the problem of VPN connection, at this moment current application cannot be determined as to the application of VPN connection exception or will networked The destination server of data is determined as VPN connection exception server.
The specific implementation of the technical solution are as follows: if step 150 determines that VPN connecting detection result meets VPN connection exception Condition, then the networked data of current application is sent directly to its destination server again carries out internet connection, and in network TCP layer or Socket layers detect this time be connected to the network during packet loss, network delay and destination servers whether may be used Up at least one of information, as the corresponding internet connecting detection result of current application.If the internet connecting detection As a result it is better than above-mentioned VPN connecting detection as a result, the packet loss of i.e. internet connecting detection result is less than VPN connecting detection result Packet loss perhaps network delay of the network delay less than VPN connecting detection result of internet connecting detection result or interconnection The destination server of net connecting detection result is reachable, then being assured that is that network connection is slow caused by VPN or can not connect, At this moment above-mentioned current application can be determined as to VPN connection exception application, or the destination server of its networked data is true It is set to VPN connection exception server, the data for completing the application of VPN connection exception or VPN connection exception server update.In this way may be used To automatically update the application of VPN connection exception or VPN connection exception server data according to Network status, and does not have to user and carried out Multioperation, so that network connection process is more quick.
The benefit being arranged in this way is can be timely updated according to the testing result of VPN the connection application of VPN connection exception or VPN Connection exception server, enable later by VPN connection be connected to the network using or destination server it is more stable And it is rapidly connected to the network.
Fig. 4 is the flow diagram of another method for connecting network provided in an embodiment of the present invention, the operation of the present embodiment Object is current application, and is described in detail based on above-described embodiment, wherein same as the previously described embodiments or corresponding Term explain details are not described herein.As shown in figure 4, the method for the present embodiment includes the following steps:
Step 410, monitor current application pass through VPN connection send networked data.
After user equipment issues networked data 400 by current application, the method for connecting network of the present embodiment can be supervised Whether control current application is to send the networked data by VPN connection.It sends, that is, monitors current if it is by VPN connection Networked data is sent using by VPN connection, then executing step 420;Otherwise, step 440 is executed.
Step 420, current application connect whether exception application matches at least one preset VPN.
After monitoring current application by VPN connection transmission networked data, current application is connect to exception application with VPN In list 430 at least one VPN connection exception application is matched, with judge current application whether with it is preset at least one VPN connection exception application matches, if result matches, executes step 440, no to then follow the steps 450.
Step 440, Xiang Suoshu destination server send the networked data.
When the networked data of current application does not need to send by VPN connection, directly pass through user equipment to the networking The destination server of data sends the networked data 400.User equipment can be with to the mode that destination server sends networked data It is to be sent by the wireless interface of equipment, is also possible to send by the cellular data interface of equipment.Here do not need to pass through It is VPN connection exception using two kinds that VPN connection, which sends networked data and at least should not connect VPN and current application not comprising equipment, Situation.Terminate process later.
Step 450 sends the networked data to vpn server, turns the vpn server to the destination server Send out networked data described.
When the networked data of current application needs to send by VPN connection, networked data 400 is directly sent to VPN Server executes step 460 so that the networked data is forwarded to its destination server by the vpn server later.
Step 460 determines the corresponding VPN connecting detection result of current application.
After the networked data of current application is forwarded to its destination server by vpn server, in the network connection The networks such as whether network TCP layer or the Socket layers of packet loss, network delay and destination server to the secondary network connection are reachable Link information is detected, and obtains the corresponding VPN connecting detection of current application as a result, executing step 470.
Whether step 470, VPN connecting detection result meet preset VPN connection exceptional condition.
Above-mentioned VPN connecting detection result is compared with preset VPN connection exceptional condition, to determine if to meet Preset VPN connection exceptional condition.If it is determined that it meets preset VPN connection exceptional condition, then executing step 480 or step Rapid 4100.Otherwise, terminate process.
Step 480 shows and preset skips VPN network prompt information.
It, can be in user equipment after determining that above-mentioned VPN connecting detection result meets preset VPN connection exceptional condition Display interface on show it is preset skip VPN network prompt information, so that whether user by VPN connection network to being selected It selects, executes step 490 later.
Step 490 receives user to the response feedback of prompt information.
Show it is preset skip VPN network prompt information to user after, receive response of the user to the prompt information Feedback, i.e. reception user select the response knot for being connected to the network or not being connected to the network by VPN connection by VPN connection Fruit.If the response feedback of user is to execute step 4110 by VPN connection network, otherwise terminate process.
Step 4100 sends networked data to destination server, and determines the corresponding internet connecting detection of current application As a result.
It, can be again by the networking after determining that above-mentioned VPN connecting detection result meets preset VPN connection exceptional condition Data are sent to its destination server, and carry out the secondary network connection in the TCP layer of network or Socket layers of acquisition current application Internet connecting detection result.If the internet connecting detection result is better than VPN connecting detection as a result, so executing step 4110, otherwise terminate process.
It should be noted that here without limitation to the execution of step 480 and step 4100 sequence.For example, can only hold Row step 480 and its subsequent step, without executing step 4100 and its subsequent step.Step 4100 and its subsequent can also be executed Step, without executing step 480 and its subsequent step.It is of course also possible to be performed simultaneously step 480 and its subsequent step and step 4100 and its subsequent step, the information in subsequent VPN connection exception list of application can be further improved in this way.
Current application is determined as VPN connection exception application by step 4110.
The current application for the condition that meets is determined as VPN connection exception application, and VPN is added in its title and relevant information In connection exception list of application 430, complete to update the data of VPN connection exception application.
The embodiment of the present invention by by current application by VPN connection send networked data when current application with it is preset At least one VPN connection exception application is matched, and sends above-mentioned networking number to above-mentioned destination server when its successful match According to, and above-mentioned networked data is sent to vpn server when it matches unsuccessful, make the vpn server to above-mentioned destination service Device forwards above-mentioned networked data, and obtains the networking testing result of the VPN in networking process, with VPN networking testing result and in advance If VPN connection exceptional condition comparison result be foundation, by current application be determined as VPN connection exception apply.It solves logical When crossing VPN and being connected to the network, all networked datas all via vpn server be forwarded to destination server and caused by apply The problem of network connection is slow or application can not connect network, and VPN connection exception is constantly updated using data, so that VPN connects Termination process is quicker, improves the efficiency of network connection.
Fig. 5 is the flow diagram of another method for connecting network provided in an embodiment of the present invention, the operation of the present embodiment Object is the destination server of networked data, and is described in detail based on above-described embodiment, wherein with above-mentioned implementation Example is identical or corresponding term explains that details are not described herein.As shown in figure 5, the method for the present embodiment includes the following steps:
Step 410, monitor current application pass through VPN connection send networked data.
After user equipment issues networked data 400 by current application, the method for connecting network of the present embodiment can be supervised Whether control current application is to send the networked data by VPN connection.Connect if monitoring current application and being sent by VPN connection Network data, then execution step 420 ';Otherwise, step 440 is executed.
Step 420 ', the destination server of networked data connect at least one preset VPN exception server whether Match.
After monitoring current application by VPN connection transmission networked data, by the networked data of current application transmission At least one VPN connection exception server that destination server is connect in exception server list 430 ' with VPN is matched, with Judge whether the destination server connect exception server at least one preset VPN and match, if result matches, Step 440 is executed, it is no to then follow the steps 450.
Step 440, Xiang Suoshu destination server send the networked data, terminate process.
Step 450 sends the networked data to vpn server, turns the vpn server to the destination server It sends out networked data described, executes step 460.
Step 460 determines the corresponding VPN connecting detection of current application as a result, executing step 470.
Whether step 470, VPN connecting detection result meet preset VPN connection exceptional condition.If it is determined that it meets in advance If VPN connection exceptional condition, then executing step 480 or step 4100.Otherwise, terminate process.
Step 480, show it is preset skip VPN network prompt information, execute step 490.
Step 490 receives user to the response feedback of prompt information.If the response feedback of user is connected by VPN Network, then execution step 4110 ', otherwise terminate process.
Step 4100 sends networked data to destination server, and determines the corresponding internet connecting detection of current application As a result.If the internet connecting detection result be better than VPN connecting detection as a result, so execute step 4110 ', otherwise terminate to flow Journey.Similarly, here to the execution of step 480 and step 4100 sequence without limitation.
Step 4110 ', the destination server of networked data is determined as to VPN connection exception server.
The destination server of the networked data for the condition that meets is determined as VPN connection exception server, and by its address and Relevant information is added in VPN connection exception server list 430 ', completes to update the data of VPN connection exception server.
The embodiment of the present invention passes through the destination server of networked data that sends current application by VPN connection and default At least one VPN connection exception server matched, send above-mentioned company to above-mentioned destination server when its successful match Network data, and above-mentioned networked data is sent to vpn server when it matches unsuccessful, make the vpn server to above-mentioned target Server forwards above-mentioned networked data, and obtains the networking testing result of the VPN in networking process, with VPN networking testing result And the comparison result of preset VPN connection exceptional condition is foundation, and the destination server of networked data is determined as VPN connection example Outer server.Solve that when being connected to the network by VPN, all networked datas are all forwarded to target via vpn server Server and caused by server network connection it is slow or the problem of can not connect, and constantly update VPN connection and make an exception server Data improve the efficiency of network connection so that VPN connection procedure is quicker.
Fig. 6 is a kind of structural schematic diagram of network connection device provided in an embodiment of the present invention, in the present embodiment with it is above-mentioned Any embodiment is identical or corresponding term explains that details are not described herein, which includes:
Make an exception item matching module 610, for determining when monitoring current application by VPN connection transmission networked data The current application connect whether exception application matches at least one preset VPN, or determines the mesh of the networked data Mark server connect whether exception server matches at least one preset VPN;
First networked data sending module 620, for when make an exception item matching module 610 in matching it is unsuccessful when, to VPN Server sends the networked data, and the vpn server is made to forward the networked data to the destination server;
Second networked data sending module 630, for when make an exception item matching module 610 in successful match when, Xiang Suoshu Destination server sends the networked data.
Network connection device provided in an embodiment of the present invention solves when being connected to the network by VPN, all networking numbers According to all via vpn server be forwarded to destination server and caused by network connection it is slack-off or the problem of can not connect, improve The efficiency of network connection.
On the basis of the above embodiments, as shown in fig. 7, the device further include:
VPN connecting detection result determining module 640 makes described for sending the networked data to vpn server After vpn server forwards the networked data to the destination server, the corresponding VPN connection inspection of the current application is determined Survey result;
VPN connecting detection result judgment module 650, for determining it is preset whether the VPN connecting detection result meets VPN connection exceptional condition;
VPN connection exception item determining module 660, if currently being answered for meeting the VPN connection exceptional condition by described It is applied with VPN connection exception is determined as, or the destination server of the networked data is determined as VPN connection exception service Device.
On the basis of the above embodiments, above-mentioned VPN connecting detection result judgment module 650 is specifically used for: if described work as Preceding that corresponding packet loss is applied to be greater than preset packet loss threshold value, network delay is greater than preset delay threshold and the networking number According to destination server at least one of unreachable meet, it is determined that the VPN connecting detection result meets the VPN connection Exceptional condition;If being not satisfied, it is determined that the VPN connecting detection result is unsatisfactory for the VPN connection exceptional condition.
On the basis of the above embodiments, above-mentioned VPN connection exception item determining module 660 is specifically used for: if described in meeting VPN connection exceptional condition then shows and preset skips VPN network prompt information;Response according to user to the prompt information As a result, the current application is determined as VPN connection exception application, or the destination server of the networked data is determined as VPN connection exception server.
On the basis of the above embodiments, above-mentioned VPN connection exception item determining module 660 also particularly useful for: if meeting institute VPN connection exceptional condition is stated, then sends the networked data to the destination server, and determines that the current application is corresponding Internet connecting detection result;According to the internet connecting detection as a result, the current application is determined as VPN connection exception Using, or by the destination server of the networked data be determined as VPN connection exception server.
Network connection device provided by the embodiment of the present invention can be performed network provided by any embodiment of the invention and connect Method is connect, has the corresponding functional module of execution method and beneficial effect.
The embodiment of the invention provides a kind of mobile terminal, which may include memory, processor and storage On a memory and the computer program that can run on a processor.
Fig. 8 is a kind of structural schematic diagram of the mobile terminal provided in the embodiment of the present invention, as shown in figure 8, diagram intelligence Mobile phone 800 may include: memory 801, central processing unit (Central Processing Unit, hereinafter referred to as CPU) 802, Peripheral Interface 803, RF circuit 805, voicefrequency circuit 806, loudspeaker 811, power management chip 808, input/output (I/O) System 809, other input/control devicess 810 and outside port 804, these components pass through one or more communication bus or Signal wire 807 communicates.
It should be understood that an example of diagram smart phone 800 only mobile terminal, and smart phone 800 can To have than shown in the drawings more or less component, two or more components can be combined, or can have There is different component configurations.Various parts shown in the drawings can include one or more signal processings and/or dedicated collection It is realized in combination at hardware, software or hardware and software including circuit.
Just smart phone for network connection provided in this embodiment is described in detail below.
Memory 801: the memory 801 can be accessed by CPU802, Peripheral Interface 803 etc., and the memory 801 can It can also include nonvolatile memory to include high-speed random access memory, such as one or more disk memory, Flush memory device or other volatile solid-state parts.
The peripheral hardware that outputs and inputs of equipment can be connected to CPU802 and storage by Peripheral Interface 803, the Peripheral Interface Device 801.
I/O subsystem 809: the I/O subsystem 809 can be by the input/output peripheral in equipment, such as touch screen 802 With other input/control devicess 810, it is connected to Peripheral Interface 803.I/O subsystem 809 may include 8091 He of display controller For controlling one or more input controllers 8092 of other input/control devicess 810.Wherein, one or more input controls Device 8092 processed receives electric signal from other input/control devicess 810 or sends electric signal to other input/control devicess 810, Other input/control devicess 810 may include physical button (push button, rocker buttons etc.), dial, slide switch, behaviour Vertical pole clicks idler wheel.It is worth noting that input controller 8092 can with it is following any one connect: keyboard, infrared port, The indicating equipment of USB interface and such as mouse.
Touch screen 812: the touch screen 812 is the input interface and output interface between user terminal and user, can It is shown to user depending on output, visual output may include figure, text, icon or video etc..
Display controller 8091 in I/O subsystem 809 receives electric signal from touch screen 812 or sends out to touch screen 812 Electric signals.Touch screen 812 detects the contact on touch screen, and the contact that display controller 8091 will test is converted to and is shown The interaction of user interface object on touch screen 812, i.e. realization human-computer interaction, the user interface being shown on touch screen 812 Object can be the icon of running game, the icon for being networked to corresponding network etc..It is worth noting that equipment can also include light Mouse, light mouse are the extensions for the touch sensitive surface for not showing the touch sensitive surface visually exported, or formed by touch screen.
RF circuit 805 is mainly used for establishing the communication of mobile phone Yu wireless network (i.e. network side), realizes mobile phone and wireless network The data receiver of network and transmission.Such as transmitting-receiving short message, Email etc..Specifically, RF circuit 805 receives and sends RF letter Number, RF signal is also referred to as electromagnetic signal, and RF circuit 805 converts electrical signals to electromagnetic signal or electromagnetic signal is converted to telecommunications Number, and communicated by the electromagnetic signal with communication network and other equipment.RF circuit 805 may include for executing The known circuit of these functions comprising but it is not limited to antenna system, RF transceiver, one or more amplifiers, tuner, one A or multiple oscillators, digital signal processor, CODEC chipset, Subscriber Identity Module (Subscriber Identity Module, SIM) etc..
Voicefrequency circuit 806 is mainly used for receiving audio data from Peripheral Interface 803, which is converted to telecommunications Number, and the electric signal is sent to loudspeaker 811.
Loudspeaker 811 is reduced to sound for mobile phone to be passed through RF circuit 805 from the received voice signal of wireless network And the sound is played to user.
Power management chip 808, the hardware for being connected by CPU802, I/O subsystem and Peripheral Interface are powered And power management.
CPU802 provided in an embodiment of the present invention is performed the steps of when executing the computer program
Monitor current application by VPN connection send networked data when, determine the current application and it is preset extremely Whether few VPN connection exception application matches, or determines the destination server and preset at least one of the networked data Whether a VPN connection exception server matches;
If matching is unsuccessful, the networked data is sent to vpn server, makes the vpn server to the target Server forwards the networked data;
If successful match, the networked data is sent to the destination server.
Method provided by any embodiment of the invention can be performed in the said goods, has the corresponding functional module of execution method And beneficial effect.
Note that the above is only a better embodiment of the present invention and the applied technical principle.It will be appreciated by those skilled in the art that The invention is not limited to the specific embodiments described herein, be able to carry out for a person skilled in the art it is various it is apparent variation, It readjusts and substitutes without departing from protection scope of the present invention.Therefore, although being carried out by above embodiments to the present invention It is described in further detail, but the present invention is not limited to the above embodiments only, without departing from the inventive concept, also It may include more other equivalent embodiments, and the scope of the invention is determined by the scope of the appended claims.

Claims (9)

1. a kind of method for connecting network characterized by comprising
When monitoring current application by VPN connection transmission networked data, the current application and preset at least one are determined Whether a VPN connection exception application matches, or determines the destination server and at least one preset VPN of the networked data Whether connection exception server matches;
If the current application connect exception application at least one preset VPN and matches the unsuccessful or determining networking number According to destination server to connect at least one preset VPN exception server matches unsuccessful, then send institute to vpn server Networked data is stated, the vpn server is made to forward the networked data to the destination server;
If the current application connect exception at least one preset VPN using successful match or determines the networked data Destination server connect at least one preset VPN exception server matches success, then to the destination server send The networked data;
Wherein, the application of VPN connection exception be networked data is forwarded to destination server by vpn server, and network without The application of method connection;The VPN connection exception server is that networked data is forwarded by vpn server, and network can not connect Destination server;
The networked data is being sent to vpn server, the vpn server is made to forward the networking to the destination server After data, further includes:
Determine the corresponding VPN connecting detection result of the current application;
Determine whether the VPN connecting detection result meets preset VPN connection exceptional condition;
If meeting the VPN connection exceptional condition, the current application is determined as VPN connection exception application, or by institute The destination server for stating networked data is determined as VPN connection exception server.
2. the method according to claim 1, wherein it is default to determine whether the VPN connecting detection result meets VPN connection exceptional condition, comprising:
If the corresponding packet loss of the current application is greater than preset packet loss threshold value, network delay is greater than preset delay threshold With the destination server of the networked data is at least one of unreachable meets, it is determined that the VPN connecting detection result is full The foot VPN connection exceptional condition;
If being not satisfied, it is determined that the VPN connecting detection result is unsatisfactory for the VPN connection exceptional condition.
3. the method according to claim 1, wherein working as by described in if meeting the VPN connection exceptional condition Preceding application is determined as VPN connection exception application, or the destination server of the networked data is determined as VPN connection exception clothes Business device, comprising:
If meeting the VPN connection exceptional condition, shows and preset skip VPN network prompt information;
According to user to the response results of the prompt information, the current application is determined as VPN connection exception application, or The destination server of the networked data is determined as VPN connection exception server.
4. the method according to claim 1, wherein working as by described in if meeting the VPN connection exceptional condition Preceding application is determined as VPN connection exception application, or the destination server of the networked data is determined as VPN connection exception clothes Business device, comprising:
If meeting the VPN connection exceptional condition, the networked data is sent to the destination server, and work as described in determination It is preceding to apply corresponding internet connecting detection result;
According to the internet connecting detection as a result, the current application is determined as VPN connection exception application, or will be described The destination server of networked data is determined as VPN connection exception server.
5. a kind of network connection device characterized by comprising
Make an exception item matching module, for determining described current when monitoring current application by VPN connection transmission networked data Whether matched using connecting to make an exception to apply at least one preset VPN, or the destination server of the determining networked data It connect whether exception server matches at least one preset VPN;
First networked data sending module, if connecting exception application at least one preset VPN for the current application With unsuccessful, or determine that the destination server of the networked data connect the server that makes an exception at least one preset VPN With unsuccessful, then the networked data is sent to vpn server, the vpn server is made to forward institute to the destination server State networked data;
Second networked data sending module, if connecting exception application at least one preset VPN for the current application With success, or determine that the destination server of the networked data connect exception server matches at least one preset VPN Success then sends the networked data to the destination server;
Wherein, the application of VPN connection exception be networked data is forwarded to destination server by vpn server, and network without The application of method connection;The VPN connection exception server is that networked data is forwarded by vpn server, and network can not connect Destination server;VPN connecting detection result determining module makes described for sending the networked data to vpn server After vpn server forwards the networked data to the destination server, the corresponding VPN connection inspection of the current application is determined Survey result;
VPN connecting detection result judgment module, for determining whether the VPN connecting detection result meets preset VPN connection Exceptional condition;
VPN connection exception item determining module, if determining the current application for meeting the VPN connection exceptional condition It makes an exception and applies for VPN connection, or the destination server of the networked data is determined as VPN connection exception server.
6. device according to claim 5, which is characterized in that the VPN connecting detection result judgment module is specifically used for:
If the corresponding packet loss of the current application is greater than preset packet loss threshold value, network delay is greater than preset delay threshold With the destination server of the networked data is at least one of unreachable meets, it is determined that the VPN connecting detection result is full The foot VPN connection exceptional condition;
If being not satisfied, it is determined that the VPN connecting detection result is unsatisfactory for the VPN connection exceptional condition.
7. device according to claim 5, which is characterized in that the VPN connection exception item determining module is specifically used for:
If meeting the VPN connection exceptional condition, shows and preset skip VPN network prompt information;
According to user to the response results of the prompt information, the current application is determined as VPN connection exception application, or The destination server of the networked data is determined as VPN connection exception server.
8. device according to claim 5, which is characterized in that VPN connection exception item determining module also particularly useful for:
If meeting the VPN connection exceptional condition, the networked data is sent to the destination server, and work as described in determination It is preceding to apply corresponding internet connecting detection result;
According to the internet connecting detection as a result, the current application is determined as VPN connection exception application, or will be described The destination server of networked data is determined as VPN connection exception server.
9. a kind of mobile terminal including memory, processor and stores the calculating that can be run on a memory and on a processor Machine program, which is characterized in that the processor performs the steps of when executing the computer program
When monitoring current application by VPN connection transmission networked data, the current application and preset at least one are determined Whether a VPN connection exception application matches, or determines the destination server and at least one preset VPN of the networked data Whether connection exception server matches;
If the current application connect exception application at least one preset VPN and matches the unsuccessful or determining networking number According to destination server to connect at least one preset VPN exception server matches unsuccessful, then send institute to vpn server Networked data is stated, the vpn server is made to forward the networked data to the destination server;
If the current application connect exception at least one preset VPN using successful match or determines the networked data Destination server connect at least one preset VPN exception server matches success, then to the destination server send The networked data;
Wherein, the application of VPN connection exception be networked data is forwarded to destination server by vpn server, and network without The application of method connection;The VPN connection exception server is that networked data is forwarded by vpn server, and network can not connect Destination server;
The networked data is being sent to vpn server, the vpn server is made to forward the networking to the destination server After data, further includes:
Determine the corresponding VPN connecting detection result of the current application;
Determine whether the VPN connecting detection result meets preset VPN connection exceptional condition;
If meeting the VPN connection exceptional condition, the current application is determined as VPN connection exception application, or by institute The destination server for stating networked data is determined as VPN connection exception server.
CN201611170280.6A 2016-12-16 2016-12-16 A kind of method for connecting network, device and mobile terminal Active CN106789530B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611170280.6A CN106789530B (en) 2016-12-16 2016-12-16 A kind of method for connecting network, device and mobile terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611170280.6A CN106789530B (en) 2016-12-16 2016-12-16 A kind of method for connecting network, device and mobile terminal

Publications (2)

Publication Number Publication Date
CN106789530A CN106789530A (en) 2017-05-31
CN106789530B true CN106789530B (en) 2019-07-16

Family

ID=58892093

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611170280.6A Active CN106789530B (en) 2016-12-16 2016-12-16 A kind of method for connecting network, device and mobile terminal

Country Status (1)

Country Link
CN (1) CN106789530B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109076005B (en) * 2018-04-28 2021-02-09 深圳前海达闼云端智能科技有限公司 VPN line switching method and device and electronic equipment
CN111934972B (en) * 2020-08-12 2022-09-30 北京指掌易科技有限公司 Application VPN (virtual private network) management method and device and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010116643A1 (en) * 2009-03-30 2010-10-14 セコム株式会社 Communication control device and monitoring device
CN104869043A (en) * 2015-06-04 2015-08-26 魅族科技(中国)有限公司 Method for establishing VPN (Virtual Private Network) connection and terminal
CN104967572A (en) * 2015-06-05 2015-10-07 小米科技有限责任公司 Network access method, apparatus and equipment
CN105491098A (en) * 2015-06-09 2016-04-13 哈尔滨安天科技股份有限公司 Virtual private network (VPN) data distribution method and system based on peer-to-peer (P2P) technology

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010116643A1 (en) * 2009-03-30 2010-10-14 セコム株式会社 Communication control device and monitoring device
CN104869043A (en) * 2015-06-04 2015-08-26 魅族科技(中国)有限公司 Method for establishing VPN (Virtual Private Network) connection and terminal
CN104967572A (en) * 2015-06-05 2015-10-07 小米科技有限责任公司 Network access method, apparatus and equipment
CN105491098A (en) * 2015-06-09 2016-04-13 哈尔滨安天科技股份有限公司 Virtual private network (VPN) data distribution method and system based on peer-to-peer (P2P) technology

Also Published As

Publication number Publication date
CN106789530A (en) 2017-05-31

Similar Documents

Publication Publication Date Title
US10834237B2 (en) Method, apparatus, and storage medium for controlling cooperation of multiple intelligent devices with social application platform
CN108430101B (en) Antenna closing method and device, storage medium and electronic equipment
CN109117361B (en) Remote debugging method, related equipment and system for small program
CN106059894B (en) Message processing method and device
CN106973330B (en) Screen live broadcasting method, device and system
CN105471704B (en) A kind of method, apparatus and system for realizing more people's calls
US9363300B2 (en) Systems and methods for voice communication
CN107465841B (en) Fault information reporting method and terminal
WO2015043403A1 (en) Method, apparatus, and terminal for obtaining video data
CN107147450B (en) Radio frequency interference processing method, device, storage medium and terminal
CN103399705A (en) Method, device and equipment for remotely controlling terminal equipment
CN104135728A (en) Network connection method and device
CN108932094A (en) Split screen application switching method, device, storage medium and electronic equipment
CN109669662A (en) A kind of pronunciation inputting method, device, storage medium and mobile terminal
CN110677842B (en) Network searching method, device, terminal equipment and storage medium
CN106789530B (en) A kind of method for connecting network, device and mobile terminal
CN112749074A (en) Test case recommendation method and device
CN112579264A (en) Application program jumping method, terminal and computer storage medium
WO2014183439A1 (en) Method, apparatus and system for switching function mode
US9592442B2 (en) Communication method, system, server and client device for user-interactive system
CN106101361B (en) Display methods, device and the mobile phone of cell phone address book
CN105897567B (en) A kind of method and device of information sharing
WO2015043239A1 (en) Method and device for playing media data on a terminal
CN110891262A (en) Bluetooth pairing method, system and terminal equipment
CN105635379B (en) Noise suppression method and device

Legal Events

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

Address after: 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.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant