CN108834203A - Method for switching network, device, terminal and storage medium - Google Patents
Method for switching network, device, terminal and storage medium Download PDFInfo
- Publication number
- CN108834203A CN108834203A CN201810698050.XA CN201810698050A CN108834203A CN 108834203 A CN108834203 A CN 108834203A CN 201810698050 A CN201810698050 A CN 201810698050A CN 108834203 A CN108834203 A CN 108834203A
- Authority
- CN
- China
- Prior art keywords
- network
- network connection
- connection
- data
- timer duration
- 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.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W48/00—Access restriction; Network selection; Access point selection
- H04W48/18—Selecting a network or a communication service
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W36/00—Hand-off or reselection arrangements
- H04W36/0005—Control or signalling for completing the hand-off
- H04W36/0011—Control or signalling for completing the hand-off for data sessions of end-to-end connection
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W76/00—Connection management
- H04W76/10—Connection setup
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W76/00—Connection management
- H04W76/30—Connection release
Abstract
The embodiment of the present application discloses a kind of method for switching network, device, terminal and storage medium, belongs to field of network connections, the method includes:Transmitting network data is connected by first network;When receiving network switching request, the second network connection is established in timer duration, network switching request, which is used to indicate, switches to the second network by first network, and first network connection is different with the internetwork connection mode of second network connection;If setting up the second network connection in timer duration, switch using the second network connection transmitting network data;Disconnect first network connection.In the embodiment of the present application, by the way that one section of phase buffer is arranged before disconnecting network connection, and it attempts to establish new network connection in phase buffer, it avoids disconnecting the network terminal caused by current network immediately, influence of the network switching process to network data transmission is reduced, has achieved the effect that unaware handover network.
Description
Technical field
The invention relates to field of network connections, in particular to a kind of method for switching network, device, terminal and storage
Medium.
Background technique
It is normal in terminal that Wireless Fidelity (Wireless Fidelity, WiFi) network connection is connected with mobile data network
Two kinds of internetwork connection modes.
When WiFi network is not present in local environment, terminal can be accessed by mobile data network;Work as entrance
WiFi network coverage area, and when terminal unlatching WiFi linkage function, after terminal disconnects mobile data network connection, pass through foundation
WiFI network connection carries out network access, to realize the switching between mobile data network and WiFi network.
Summary of the invention
The embodiment of the present application provides a kind of method for switching network, device, terminal and storage medium, can be used for solving resolution
During opening current network connection and re-establishing network connection with other networks, it may appear that the problem of network connection interruption.Institute
It is as follows to state technical solution:
On the one hand, a kind of method for switching network is provided, the method includes:
Transmitting network data is connected by first network;
When receiving network switching request, the second network connection is established in timer duration, the network switching is asked
It asks to be used to indicate and the second network, the network company of the first network connection and second network connection is switched to by first network
Connect mode difference;
If setting up second network connection in the timer duration, switches and be connected to the network using described second
Transmit the network data;
Disconnect the first network connection.
On the other hand, a kind of network switching device is provided, described device includes:
Transmission module, for connecting transmitting network data by first network;
Module is established, for when receiving network switching request, establishing the second network connection, institute in timer duration
It states network switching request and is used to indicate and the second network is switched to by first network, the first network connection and second network
The internetwork connection mode of connection is different;
Switching module, if switching for setting up second network connection in the timer duration using institute
It states the second network connection and transmits the network data;
Module is disconnected, for disconnecting the first network connection.
On the other hand, a kind of terminal is provided, the terminal includes processor and memory, is stored in the memory
At least one instruction, described instruction are loaded as the processor and are executed to realize method for switching network described in above-mentioned aspect.
On the other hand, a kind of computer readable storage medium is provided, at least one finger is stored in the storage medium
It enables, described instruction is as the method for switching network as described in processor load and executes with realization such as in terms of above-mentioned.
Technical solution bring beneficial effect provided by the embodiments of the present application includes at least:
During using first network connection transmitting network data, when receiving network switching request, terminal is fixed
When device duration in attempt to establish the second network connection, and after setting up the second network connection in timer duration, switching is used
Second network connection transmitting network data, and then disconnect first network connection;Compared to disconnecting current net immediately in the related technology
Resettle new network connection after network connection, in the embodiment of the present application, by disconnect be connected to the network before one section of phase buffer is set,
And attempt to establish new network connection in phase buffer, it avoids disconnecting the network terminal caused by current network immediately, reduces network
Influence of the handoff procedure to network data transmission, has achieved the effect that unaware handover network.
Detailed description of the invention
In order to more clearly explain the technical solutions in the embodiments of the present application, make required in being described below to embodiment
Attached drawing is briefly described, it should be apparent that, the drawings in the following description are only some examples of the present application, for
For those of ordinary skill in the art, without creative efforts, it can also be obtained according to these attached drawings other
Attached drawing.
Fig. 1 shows the environment schematic of the implementation environment of one exemplary embodiment of the application offer;
Fig. 2 shows the flow charts for the method for switching network that one exemplary embodiment of the application provides;
Fig. 3 is the schematic illustration of method for switching network provided by the embodiments of the present application;
Fig. 4 shows the flow chart of the method for switching network of another exemplary embodiment of the application offer;
Fig. 5 shows the flow chart of the method for switching network of another exemplary embodiment of the application offer;
Fig. 6 shows the structural block diagram of the network switching device of one exemplary embodiment of the application offer;
Fig. 7 shows the structural block diagram of the terminal of one exemplary embodiment of the application offer.
Specific embodiment
To keep the purposes, technical schemes and advantages of the application clearer, below in conjunction with attached drawing to the application embodiment party
Formula is described in further detail.
In the description of the present application, unless otherwise indicated, " multiple " refer to two or more."and/or", description are closed
Join the incidence relation of object, indicates may exist three kinds of relationships, for example, A and/or B, can indicate:Individualism A, is deposited simultaneously
In A and B, these three situations of individualism B.Character "/" typicallys represent the relationship that forward-backward correlation object is a kind of "or".
Referring to FIG. 1, the environment schematic of the implementation environment provided it illustrates one exemplary embodiment of the application, it should
It include terminal 110 and server 120 in implementation environment.
Terminal 110 is the electronic equipment with WiFi network connection and mobile data network linkage function.Wherein, the shifting
Dynamic data network can be 3rd generation mobile communication technology (3rd-Generation, 3G) network, fourth generation mobile communication technology
(4th-Generation, 4G) network, long term evolution (Long Term Evolution, LTE) network, the 5th third-generation mobile communication
Technology (5th-Generation, 5G) network etc..
When terminal 110 opens WiFi network linkage function, terminal 110 can search for neighbouring WiFi network, and by connecing
Enter WiFi network and carries out internet access;When opening mobile data network linkage function, terminal 110 can pass through mobile data
Network carries out internet access.Wherein, WiFi network linkage function and mobile data network linkage function can open simultaneously.
In addition, being also equipped at least one application program in terminal 110, and at least one application program is interconnected
Net access, which can be instant messaging application program, mail class application program, social application program, video playing
Application program, browser application, game class application program, news read application program etc..
It is connected between terminal 110 and server 120 by WiFi network or mobile data network.
Server 120 is a server, the server cluster or cloud computing center that several servers are constituted.The application
In embodiment, server 120 is the background server of application program in terminal 110.In application program operational process, i.e., to service
Device 110 sends the network data of local terminal, and receives the network data of the transmission of server 110.Wherein, terminal 110 can simultaneously with
Multiple servers 120 (different application of foreground or running background in counterpart terminal 110) carry out network data transmission.
Under a kind of possible application scenarios, terminal 110 establishes mobile data network connection, and passes through mobile data network
Connect the network data of transmission application program.When being moved in WiFi network coverage area, and when WiFi network is available, user's touching
Network switching request is sent out, after terminal 110 receives network switching request, mobile data network connection is kept in scheduled duration
Under the premise of, WiFi network connection is established in trial.When setting up WiFi network connection in scheduled duration, terminal is used in switching
WiFi network connects transmitting network data, and disconnects first network connection, to realize network switching.
It optionally, can also include destination server in the implementation environment, terminal 110 passes through established network connection
The destination server is accessed, thus the quality being connected to the network, and then determine the need for carrying out network switching.
Following each embodiments are illustrated by taking the terminal 110 that method for switching network is applied in Fig. 1 as an example.
Referring to FIG. 2, the flow chart of the method for switching network provided it illustrates one exemplary embodiment of the application.This
Embodiment is applied to the terminal 110 in Fig. 1 in this way to illustrate.The method includes:
Step 201, transmitting network data is connected by first network.
Wherein, first network is connected as mobile data network connection or WiFi network connection.
Under a kind of possible application scenarios, when terminal is in outside WiFi network coverage area, alternatively, terminal is in WiFi
In network coverage but WiFi network is unavailable, alternatively, terminal passes through when terminal does not open WiFi network linkage function
Mobile data network connects transmitting network data.
Under alternatively possible application scenarios, when terminal is in WiFi network coverage area, and WiFi network is available,
And when opening WiFi network linkage function, terminal connects transmitting network data by WiFi network.
Optionally, which includes the number of foreground application, background application and/or system service transmission
According to.
Step 202, when receiving network switching request, the second network connection is established in timer duration, network is cut
It changes request and is used to indicate and the second network is switched to by first network, the network connection side of first network connection and the second network connection
Formula is different.
In a kind of possible embodiment, after receiving network switching request, terminal starts timer (Timer), and
In the timer duration as defined in timer, the second network connection is established in trial.If setting up the second net in timer duration
Network connection, thens follow the steps 203,;If not set up the second network connection in timer duration, first network company is disconnected
It connects, and re-establishes the second network connection, avoided occupying first network connection for a long time (especially when first network connection is to move
When dynamic data network connection).
Optionally, which is that WiFi network connection one of is connected with mobile data network, i.e., when the
When one network connection is mobile data network connection, the second network connection is that WiFi network connects;When first network is connected as
When WiFi network connects, the second network connection is that mobile data network connects.
Optionally, which is triggered manually by user, alternatively, by terminal automatic trigger.
When network switching request is triggered manually by user, in a kind of possible embodiment, terminal passes through mobile number
When according to network connection transmitting network data, WiFi network linkage function is in close state.When the manually opened WiFi network of user
Linkage function, and there are when WiFi network, terminal receives network switching request, and request switches to WiFi network.
When network switching request is by terminal automatic trigger, in a kind of possible embodiment, terminal passes through mobile number
When according to network transmission network data, WiFi network linkage function is in the open state, when no WiFi network is (or without available WiFi
Network).When being moved in the presence of the place that can use WiFi network, terminal, that is, automatic trigger network switching request, request is switched to
WiFi network.
In other possible embodiments, during terminal connects transmitting network data by WiFi network, user
Network switching request can be triggered by the way that WiFi network linkage function is turned off manually, and (in this case, terminal is needed in timing
WiFi connection is kept in device duration), the embodiment of the present application is not defined the triggering mode of network switching request.
During terminal is attempted to establish the second network connection in timer duration, is still connected and passed by first network
Defeated network data, to avoid the Transmission occurred in network switching process;Meanwhile by the way that timer is arranged, when avoiding long
Between when can not establish the second network connection, persistently flow caused by first network connection transmitting network data is used to consume.
Optionally, which can be definite value, can also be dynamically determined according to current foreground application program.Than
Such as, which can be 3s.
As shown in figure 3, terminal connects transmitting network data since 0 moment, through first network, received when in t moment
When to network switching request, terminal starts timer, continues through first network connection transmitting network data, and attempts to establish the
Two network connections.
Step 203, if setting up the second network connection in timer duration, switch using the second network connection transmission
Network data.
It is connected to the network when being successfully established second in timer duration, and the second network connection is able to carry out network access
When, network data is then switched to the second network connection and transmitted by terminal.
As shown in figure 3, terminal is when terminal is when setting up the second network connection (t '-t≤timer duration) at the t ' moment
Network data transmission is carried out by the second network connection.
Step 204, first network connection is disconnected.
Correspondingly, terminal disconnects first network connection when successfully setting up the second network connection.
As shown in figure 3, terminal is when terminal is when setting up the second network connection (t '-t≤timer duration) at the t ' moment
Disconnect the second network connection.
Under a kind of possible application scenarios, user's using terminal is swum online under mobile data network connection status
Play can use the place (such as in family) of WiFi network when user is moved to presence, and terminal has turned on WiFi network linkage function
When, terminal is attempted to establish WiFi network connection in 3s while keeping mobile network's connection.If WiFi network connects in 3s
It is successfully established, terminal then switches using WiFi network transmitting network data, and disconnects mobile data network.Whole network switched
Cheng Zhong, network data transmission are not interrupted, ensure that the fluency of game running, are avoided the occurrence of and are disconnected or Caton
Phenomenon.
In conclusion during using first network connection transmitting network data, being received in the embodiment of the present application
When network switching request, terminal is attempted to establish the second network connection in timer duration, and sets up in timer duration
After second network connection, switching disconnects first network connection using the second network connection transmitting network data;Compared to phase
It is disconnected immediately in the technology of pass and resettles new network connection after current network connects, in the embodiment of the present application, by disconnecting net
One section of phase buffer is set before network connection, and attempts to establish new network connection in phase buffer, avoids disconnecting current network immediately
Caused by the network terminal, reduce influence of the network switching process to network data transmission, reached the effect of unaware handover network
Fruit.
In actual application, when the application program of front stage operation is video playing application program, browser application journey
When sequence or news read application program, because there are preload mechanisms in the process of running in such application program, and to network reality
The requirement of when property is lower, so even interrupting in network switching process, user is also not noticeable, can't use user
It impacts.And when the application program of front stage operation is instant messaging application program or game class application program, due to such
The frequency that application program carries out network data transmission is higher, and to the more demanding of networked-induced delay, therefore network switching process
The interruption of middle generation is easily easily noticed by the users and (is usually expressed as disconnecting or occurring Caton), impacts to user's use.
Therefore, in a kind of possible embodiment, terminal only enables the noninductive switching function of network in front stage operation application-specific
Energy.It is illustrated below using illustrative examples.
Step 401, transmitting network data is connected by first network.
The embodiment of this step can refer to above-mentioned steps 201, and details are not described herein for the present embodiment.
Step 402, when receiving network switching request, whether the application program for detecting front stage operation is target application journey
Sequence, destination application include at least one of game class application program and instant messaging class application program.
In a kind of possible embodiment, terminal obtains the target application for needing to enable noninductive network switching function in advance
Program (has been installed) in terminal, and is stored to the target application packet name of destination application.Wherein, destination application is
The application program of threshold value is higher than to networked-induced delay demand (delay, packet loss etc.), for example, the destination application is game
Class application program and/or instant messaging class application program.
When receiving network switching request, terminal acquisition foreground application applies packet name (packagename), and
It detects this and whether belongs to target application packet name using packet name, and when belonging to, determine that foreground application belongs to target application journey
Sequence, and execute step 403;Conversely, determining that foreground application is not belonging to destination application.
Wherein, which refers to the application program by switching to front stage operation from the background, alternatively, directly opening on foreground
Dynamic application program.
Step 403, if the application program of front stage operation is destination application, the corresponding net of destination application is obtained
Network demand levels, network demand grade and networked-induced delay demand correlation.
Due to there is a possibility that failure when terminal establishes the second network connection, in order to guarantee network switching as far as possible
In the process, the problem of higher application program of networked-induced delay demand is not in network interruption, terminal be real-time demand compared with
High application program configures longer timer duration, that is, configures longer phase buffer.
In a kind of possible embodiment, terminal previously according to each destination application networked-induced delay demand,
Network demand grade is set for each destination application, wherein the networked-induced delay demand of destination application is higher, right
The network demand grade answered is also higher.
Schematically, the corresponding relationship of application program and network demand grade is as shown in Table 1.
Table one
When the application program of front stage operation is destination application, it is corresponding that terminal further obtains destination application
Network demand grade.
For example, when terminal determines that it is destination application " xx battle " according to the application packet name of foreground application, into
One step determines that " xx battle " corresponding network demand grade is 3 grades.
Step 404, according to network demand grade, determine timer duration, network demand grade and timer duration in just
Correlativity.
Further, terminal determines its corresponding timer duration, wherein net according to the network demand grade got
Network demand levels are higher, and corresponding timer duration is longer, i.e., terminal attempt establish the second network connection time it is longer.
Schematically, the corresponding relationship between network demand grade and timer duration is as shown in Table 2.
Table two
Network demand grade | Timer duration |
1 | 3s |
2 | 4s |
3 | 5s |
4 | 6s |
In conjunction with the example in above-mentioned steps 403, terminal determines that timer duration is 5s.
It should be noted that above-mentioned steps 403 and 404 are optional steps, i.e., the timer duration can be definite value, terminal
After determining that the application program of front stage operation is destination application, attempt to establish the second network company directly in timer duration
It connects.The embodiment of the present application does not limit this.
Step 405, the second network connection is established in timer duration.
In the timer duration determined, the second network connection is established in terminal trial.
Step 406, if setting up the second network connection in timer duration, switch using the second network connection transmission
Network data.
Since destination application is higher to networked-induced delay demand, if the network quality of the second network is bad, by network
After data switch to the second network connection, the running quality of destination application will affect, especially carry out net automatically in terminal
Network switch in the case where (such as open WiFi network linkage function terminal enter WiFi network overlay area after automatically switch to
WiFi network), user experience is affected greatly.
In order to avoid the above problem, in a kind of possible embodiment, this step includes the following steps.
If one, setting up the second network connection in timer duration, the second network connection is connected with first network
Network connection quality test is carried out, test result is obtained, test result includes at least one of delay and packet loss.
In a kind of possible embodiment, while terminal connects transmitting network data by first network, periodically
Ground is by first network connected reference destination server, so that obtaining includes the first test result postponed with packet loss.Wherein,
Delay is lower, and/or, packet loss is lower, shows that the quality of network connection is better.
For example, terminal connects periodically ping target domain name (corresponding destination server) by first network, thus root
Delay and the packet loss of first network connection are calculated according to the response results of destination server.The embodiment of the present application does not prolong measurement
It is defined late with the mode of packet loss.
Correspondingly, carrying out network using similar mode is connect with first network after terminal sets up the second network connection
Quality of connection measurement, to obtain the second test result.
If two, the quality of the second network connection of test result instruction is better than the quality of first network connection, switch use
Second network connection transmitting network data.
In a kind of possible embodiment, when the delay of the second network connection of test result instruction connects lower than first network
The delay connect, and/or, the packet loss of the second network connection of instruction lower than first network connection packet loss when, terminal determines the
The quality of two network connections is better than the quality of first network connection, to switch using the second network connection transmitting network data.
Optionally, if the quality of test result instruction first network connection is better than the quality of the second network connection, and network
Connection request is by when (non-user carries out network switching manually), terminal continues through first network connection and passes when terminal automatic trigger
Defeated network data, and continue to be monitored the quality of the second network connection.When the quality of the second network connection is better than the first net
The quality of network connection, or, terminal switching uses the second network connection transmission network number when the destination application end lives period
According to.
Step 407, first network connection is disconnected.
The embodiment of this step can refer to step 204, and details are not described herein for the present embodiment.
Step 408, if not set up the second network connection in timer duration, first network connection is disconnected, is laid equal stress on
Newly establish the second network connection.
Optionally, if not set up the second network connection in timer duration, and network switching request is triggered by user
When, terminal then disconnects first network connection, and re-establishes the second network connection.
Optionally, if re-establishing the second network connection failure, or the second unavailable, the terminal of network connection set up
Then display reminding information prompts user that can not currently use WiFi network.
In above-described embodiment, User Datagram Protocol (User may include in the network data of destination application transmission
Datagram Protocol, UDP) data and/or transmission control protocol (Transmission Control Protocol,
TCP) data.Wherein, UDP message generally includes the data more demanding to propagation delay time, such as the control instruction in game, and
TCP data is by including the data more demanding to transmission reliability, such as the logon information in game.Due to TCP data
Transmission re-establishes TCP connection and will cause connection disconnection dependent on the TCP connection established between terminal and server.
Therefore, it is influenced caused by application program in order to which further progress reduces network switching, when the application of front stage operation
Program is destination application, and network switching request is that actively triggering (when non-user carries out network switching manually, shows terminal
The wish of network switching is not strong), and destination application transmission network data in include TCP data and UDP message when,
When destination application is in front stage operation state, switching transmits UDP message using the second network connection, and continues to use first
Network connection transmission TCP data.When the destination application end lives period, or when switching to running background, terminal switching makes
TCP data is transmitted with the second network connection, and disconnects first network connection.
In a kind of possible embodiment, terminal needs the unique identifier (Unique according to destination application
Identity, UID), identify the network data of destination application, and identify in the network data of destination application whether
Comprising TCP data, wherein the protocol number of UDP message is 17, and the protocol number of TCP data is 6.
When in the network data for identifying destination application including TCP data and UDP message, terminal keeps the first net
Network connection, and when destination application is in front stage operation state, switching transmits UDP message using the second network connection, and
Transmission TCP data is connected using first network.When the destination application end lives period, or when switching to running background, eventually
End switches again transmits TCP data using the second network connection, and disconnects first network connection.
In the present embodiment, terminal is only to the higher destination application of networked-induced delay demand in foreground application
When, network connection binary channel is established, to realize noninductive network switching, avoids establishing network connection for low networked-induced delay demand
The wasting of resources caused by binary channel.
In the present embodiment, terminal is determined as the timing of its configuration according to the corresponding network demand grade of destination application
Device duration avoids such using journey so that having longer network switching phase buffer to the application program of networked-induced delay demand
There is data outage in network switching process in sequence, improves the running quality of application program.
In addition, the second network connection that terminal connects first network and establishes carries out network quality survey in the present embodiment
Examination, and in the quality that the quality of the second network connection is connected due to first network, the second network connection of switching carries out data biography
It is defeated, to avoid the problem that application program running quality is bad after handover network.
In a kind of possible situation, terminal fails to set up in timer duration the second network connection, but target
Application program transmitted in timer duration a large amount of network datas (for example, when destination application is game application,
In the group's of progress wartime, need to transmit a large amount of network datas).In this case, if directly disconnecting first network connection, it will make
At network interruption, destination application normal operation is influenced.
In order to guarantee the normal operation of destination application under above situation, on the basis of fig. 4, as shown in figure 5, step
It can also include the following steps after 405.
Step 409, it obtains by the target data amount of first network connection transmission in timer duration, target data amount is
The data volume of destination application corresponding network data.
During attempting to establish the second network connection, terminal statistics passes through the target application that first network connection is transmitted
The data volume of program corresponding network data.
In a kind of possible embodiment, terminal identifies destination application according to the UID of destination application
Network data, and then count the data volume of the network data.
For example, it is 200KB that terminal, which gets target data amount,.
Step 410, if not set up the second network connection in timer duration, and target data amount is greater than data volume threshold
It is worth, then prolonging timer duration.
When not set up the second network connection in timer duration, whether terminal further detects target data amount big
In data-quantity threshold, if more than, it is determined that destination application is in data transmission active state, in order to avoid network switching mistake
Journey influences destination application and operates normally, and terminal prolonging timer duration (continues through first network connection transmission network number
According to, and attempt to establish the second network connection);If being less than, since destination application is in data transmission an inactive state, data
Program application can't be affected greatly by transmitting of short duration terminal, therefore terminal directly disconnects first network connection, and again
Establish the second network connection.For example, the data-quantity threshold can be 150KB.
Optionally, the corresponding data-quantity threshold of different target application program is different, and the embodiment of the present application does not limit this.
Optionally, the extension amount of timer duration can be definite value, for example, extension amount is 5s, or extend one times;Periodically
The extension amount of device duration can also be dynamically determined according to the ratio of target data amount and data-quantity threshold, for example, extension amount=(mesh
Mark data volume/data-quantity threshold) × constant.The embodiment of the present application does not limit the concrete mode of prolonging timer duration
It is fixed.
Optionally, if not setting up the second network connection yet in timer duration after extension, terminal disconnects first
Network connection, and re-establish the second network connection.
In the present embodiment, when the data volume that destination application transmits in timer duration is larger, and in timer
When not set up the second network connection in length, terminal prolonging timer duration, and continue to attempt to establish the second network connection, it avoids
First network connection is directly disconnected to impact destination application operation.
Following is the application Installation practice, can be used for executing the application embodiment of the method.It is real for the application device
Undisclosed details in example is applied, the application embodiment of the method is please referred to.
Referring to FIG. 6, the structural block diagram of the network switching device provided it illustrates one exemplary embodiment of the application.
The device includes:
Transmission module 610, for connecting transmitting network data by first network;
Module 620 is established, is connected for when receiving network switching request, establishing the second network in timer duration
It connects, the network switching request, which is used to indicate, switches to the second network by first network, the first network connection and described the
The internetwork connection mode of two network connections is different;
Switching module 630, if switching use for setting up second network connection in the timer duration
The network data is transmitted in second network connection;
Module 640 is disconnected, for disconnecting the first network connection.
Optionally, described to establish module 620, including:
Detection unit, for when receiving the network switching request, detect front stage operation application program whether be
Destination application, the destination application include at least one in game class application program and instant messaging class application program
Kind;
Unit is established, if the application program for front stage operation is the destination application, in the timer
Second network connection is established in length.
Optionally, described to establish module 620, further include:
Acquiring unit, for obtaining the corresponding network demand grade of the destination application, the network demand grade
With networked-induced delay demand correlation;
Determination unit, for determining the timer duration, the network demand grade according to the network demand grade
With the timer duration correlation.
Optionally, described device further includes:
Data volume obtains module, for obtaining in the timer duration through the number of targets of institute's first network connection transmission
According to amount, the target data amount is the data volume of the destination application corresponding network data;
Extend module, if for not set up second network connection, and the target in the timer duration
Data volume is greater than data-quantity threshold, then extends the timer duration.
Optionally, the internetwork connection mode is that mobile data network connection one of is connected with WiFi network.
Optionally, the switching module 630, including:
Test module, if for setting up second network connection in the timer duration, to described second
Network connection is connected with the first network carries out network connection quality test, obtains test result, the test result includes
At least one of delay and packet loss;
Switch unit, if indicating the quality of second network connection better than the first network for the test result
The quality of connection then switches and transmits the network data using second network connection.
Optionally, described device further includes:
It disconnects and rebuilds module, if being disconnected for not set up second network connection in the timer duration
The first network connection, and re-establish second network connection.
In conclusion during using first network connection transmitting network data, being received in the embodiment of the present application
When network switching request, terminal is attempted to establish the second network connection in timer duration, and sets up in timer duration
After second network connection, switching disconnects first network connection using the second network connection transmitting network data;Compared to phase
It is disconnected immediately in the technology of pass and resettles new network connection after current network connects, in the embodiment of the present application, by disconnecting net
One section of phase buffer is set before network connection, and attempts to establish new network connection in phase buffer, avoids disconnecting current network immediately
Caused by the network terminal, reduce influence of the network switching process to network data transmission, reached the effect of unaware handover network
Fruit.
It should be noted that device provided by the above embodiment, when realizing its function, only with above-mentioned each functional module
It divides and carries out for example, can according to need in practical application and be completed by different functional modules above-mentioned function distribution,
The internal structure of terminal is divided into different functional modules, to complete all or part of the functions described above.In addition,
Apparatus and method embodiment provided by the above embodiment belongs to same design, and specific implementation process is detailed in embodiment of the method, this
In repeat no more.
Referring to FIG. 7, the structural block diagram of the terminal provided it illustrates one exemplary embodiment of the application.The terminal packet
Include processor 1010, memory 1020 and display screen 1030.
Processor 1010 can be central processing unit (English:Central processing unit, CPU), network processes
Device (English:Network processor, NP) or CPU and NP combination.Processor 1010 can further include hardware
Chip.Above-mentioned hardware chip can be specific integrated circuit (English:application-specific integrated
Circuit, ASIC), programmable logic device (English:Programmable logic device, PLD) or combinations thereof.It is above-mentioned
PLD can be Complex Programmable Logic Devices (English:Complex programmable logic device, CPLD), scene
Programmable gate array (English:Field-programmable gate array, FPGA), Universal Array Logic (English:
Generic array logic, GAL) or any combination thereof.
Memory 1020 is connected by bus or other means with processor 1010, and at least one is stored in memory 1020
Item instruction, at least one section of program, code set or instruction set, above-mentioned at least one instruction, at least one section of program, code set or instruction
Collection is loaded as processor 1010 and is executed to realize method for displaying user interface described in as above each embodiment.Memory 1020
It can be volatile memory (English:Volatile memory), nonvolatile memory (English:non-volatile
) or their combination memory.Volatile memory can be random access memory (English:random-access
Memory, RAM), such as static random access memory (English:Static random access memory, SRAM), it moves
State random access memory (English:Dynamic random access memory, DRAM).Nonvolatile memory can be
Read-only memory (English:Read only memory image, ROM), such as programmable read only memory (English:
Programmable read only memory, PROM), Erasable Programmable Read Only Memory EPROM (English:erasable
Programmable read only memory, EPROM), electrically erasable programmable read-only memory (English:
Electrically erasable programmable read-only memory, EEPROM).Nonvolatile memory
It can be flash memory (English:Flash memory), magnetic memory, such as tape (English:Magnetic tape), it is soft
Disk (English:Floppy disk), hard disk.Nonvolatile memory may be CD.
Display screen 1030 is connected by bus or other means with processor 1010.Memory 1020 is stored at least one
Instruction, at least one instruction are loaded as the processor 1010 and are executed to realize network described in as above each embodiment
Switching method.
The embodiment of the present application also provides a kind of computer-readable medium, which has at least one
Instruction, at least one instruction are loaded as the processor and are executed to realize network switching described in as above each embodiment
Method.
The embodiment of the present application also provides a kind of computer program product, which is stored at least one
Instruction, at least one instruction are loaded as the processor and are executed to realize network switching described in as above each embodiment
Method.
Above-mentioned the embodiment of the present application serial number is for illustration only, does not represent the advantages or disadvantages of the embodiments.
Those of ordinary skill in the art will appreciate that realizing that all or part of the steps of above-described embodiment can pass through hardware
It completes, relevant hardware can also be instructed to complete by program, the program can store in a kind of computer-readable
In storage medium, storage medium mentioned above can be read-only memory, disk or CD etc..
The foregoing is merely the preferred embodiments of the application, not to limit the application, it is all in spirit herein and
Within principle, any modification, equivalent replacement, improvement and so on be should be included within the scope of protection of this application.
Claims (10)
1. a kind of method for switching network, which is characterized in that the method includes:
Transmitting network data is connected by first network;
When receiving network switching request, the second network connection is established in timer duration, the network switching request is used
The second network, the network connection side of the first network connection and second network connection are switched to by first network in instruction
Formula is different;
If setting up second network connection in the timer duration, switch using the second network connection transmission
The network data;
Disconnect the first network connection.
2. the method according to claim 1, wherein described when receiving network switching request, in timer
The second network connection is established in duration, including:
When receiving the network switching request, whether the application program for detecting front stage operation is destination application, described
Destination application includes at least one of game class application program and instant messaging class application program;
If the application program of front stage operation is the destination application, second net is established in the timer duration
Network connection.
3. according to the method described in claim 2, it is characterized in that, described establish second net in the timer duration
Before network connection, the method also includes:
The corresponding network demand grade of the destination application is obtained, the network demand grade is in networked-induced delay demand
Positive correlation;
According to the network demand grade, the timer duration, the network demand grade and the timer duration are determined
Correlation.
4. according to the method described in claim 2, it is characterized in that, if the application program of the front stage operation is that the target is answered
With program, then established in the timer duration after second network connection, the method also includes:
It obtains by the target data amount of first network connection transmission in the timer duration, the target data amount is
The data volume of the destination application corresponding network data;
If not set up second network connection in the timer duration, and the target data amount is greater than data volume threshold
Value, then extend the timer duration.
5. method according to any one of claims 1 to 4, which is characterized in that the internetwork connection mode is mobile data network
Network connection one of is connected with Wireless Fidelity WiFi network.
6. method according to any one of claims 1 to 4, which is characterized in that if described establish in the timer duration
Second network connection is played, then switches and transmits the network data using second network connection, including:
If setting up second network connection in the timer duration, to second network connection and described first
Network connection carries out network connection quality test, obtains test result, the test result include in delay and packet loss extremely
Few one kind;
If the test result indicates that the quality of second network connection is better than the quality of first network connection, switch
The network data is transmitted using second network connection.
7. method according to any one of claims 1 to 4, which is characterized in that described to establish the second net in timer duration
After network connection, the method also includes:
If not set up second network connection in the timer duration, the first network connection is disconnected, is laid equal stress on
Newly establish second network connection.
8. a kind of network switching device, which is characterized in that described device includes:
Transmission module, for connecting transmitting network data by first network;
Module is established, for when receiving network switching request, establishing the second network connection, the net in timer duration
Network switching request, which is used to indicate, switches to the second network, the first network connection and second network connection by first network
Internetwork connection mode it is different;
Switching module, if switching for setting up second network connection in the timer duration using described the
The network data is transmitted in two network connections;
Module is disconnected, for disconnecting the first network connection.
9. a kind of terminal, which is characterized in that the terminal includes processor and memory, and at least one is stored in the memory
Item instruction, described instruction are loaded by the processor and are executed to realize the network switching side as described in claim 1 to 7 is any
Method.
10. a kind of computer readable storage medium, which is characterized in that be stored at least one instruction, institute in the storage medium
Instruction is stated to be loaded by processor and executed to realize the method for switching network as described in claim 1 to 7 is any.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810698050.XA CN108834203B (en) | 2018-06-29 | 2018-06-29 | Network switching method, device, terminal and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810698050.XA CN108834203B (en) | 2018-06-29 | 2018-06-29 | Network switching method, device, terminal and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108834203A true CN108834203A (en) | 2018-11-16 |
CN108834203B CN108834203B (en) | 2021-01-26 |
Family
ID=64134902
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810698050.XA Active CN108834203B (en) | 2018-06-29 | 2018-06-29 | Network switching method, device, terminal and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108834203B (en) |
Cited By (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111277667A (en) * | 2020-02-24 | 2020-06-12 | 拉扎斯网络科技(上海)有限公司 | Data caching method and device, storage medium and electronic equipment |
CN111757040A (en) * | 2020-06-24 | 2020-10-09 | 维沃移动通信有限公司 | Communication method and device |
CN112206507A (en) * | 2020-10-19 | 2021-01-12 | 珠海金山网络游戏科技有限公司 | Protocol processing method and device |
CN112243274A (en) * | 2019-07-17 | 2021-01-19 | 大唐移动通信设备有限公司 | Timing switching processing method and device based on time |
CN112312498A (en) * | 2020-10-27 | 2021-02-02 | 北京小米移动软件有限公司 | Method and device for switching network and storage medium |
CN112752319A (en) * | 2019-10-31 | 2021-05-04 | 中兴通讯股份有限公司 | Network switching method, device, terminal and storage medium |
CN113014972A (en) * | 2021-01-28 | 2021-06-22 | 维沃移动通信有限公司 | Screen projection method, device and system |
CN113890905A (en) * | 2021-06-16 | 2022-01-04 | 荣耀终端有限公司 | Channel switching method, electronic device and storage medium |
CN114339869A (en) * | 2022-02-25 | 2022-04-12 | 京东科技信息技术有限公司 | Network management method, device, electronic equipment and storage medium |
WO2022100255A1 (en) * | 2020-11-13 | 2022-05-19 | Oppo广东移动通信有限公司 | Network switching method and apparatus, storage medium, and electronic device |
CN114650573A (en) * | 2020-12-21 | 2022-06-21 | 深圳市万普拉斯科技有限公司 | Network delay processing method and device and mobile terminal |
CN114726818A (en) * | 2020-12-21 | 2022-07-08 | 腾讯科技(深圳)有限公司 | Network social contact method, device, equipment and computer readable storage medium |
CN114828130A (en) * | 2022-04-01 | 2022-07-29 | Oppo广东移动通信有限公司 | Network switching method of terminal equipment, terminal equipment and storage medium |
Citations (16)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102625398A (en) * | 2012-03-07 | 2012-08-01 | 北京三星通信技术研究有限公司 | Method and equipment for recovering data traffics of high-level applications at time of multi-channel data connection switching |
CN102752825A (en) * | 2012-07-19 | 2012-10-24 | 德明通讯(上海)有限公司 | Seamless switch fusion method for mobile terminal in long term evolution (LTE) network and wireless fidelity (Wi-Fi) hot spot network |
CN102905249A (en) * | 2012-07-05 | 2013-01-30 | 安徽中兴继远信息技术股份有限公司 | Terminal parameter setting method based on communication with wireless network |
CN104159231A (en) * | 2014-08-19 | 2014-11-19 | 北京奇虎科技有限公司 | Method for optimizing background flow of client, and client |
CN104202782A (en) * | 2014-09-23 | 2014-12-10 | 酷派软件技术(深圳)有限公司 | Network switching method, network switching device and terminal |
CN104602309A (en) * | 2013-10-30 | 2015-05-06 | 中国电信股份有限公司 | Wireless network switching guiding method and device |
CN104754661A (en) * | 2013-12-31 | 2015-07-01 | 中兴通讯股份有限公司 | Method for achieving seamless switching between cellular network and WiFi network, network device and user equipment |
WO2015164712A1 (en) * | 2014-04-25 | 2015-10-29 | Intel IP Corporation | User equipment and methods for handover initiation |
US20150373574A1 (en) * | 2012-12-13 | 2015-12-24 | Devicescape Software, Inc. | Systems and methods for quality of experience measurement and wireless network recommendation |
EP3016444A1 (en) * | 2014-10-10 | 2016-05-04 | BlackBerry Limited | Utilizing wi-fi country code to assist cellular network selection |
CN105828395A (en) * | 2015-07-28 | 2016-08-03 | 维沃移动通信有限公司 | Method and device of WiFi adaptive selection and connection |
CN105828455A (en) * | 2016-01-28 | 2016-08-03 | 努比亚技术有限公司 | Network connection device and method |
CN106358225A (en) * | 2016-09-20 | 2017-01-25 | 广东欧珀移动通信有限公司 | Network data processing method, network data processing device and mobile terminal |
CN106851759A (en) * | 2017-03-14 | 2017-06-13 | 朱钦 | The cut-in method and device of network |
CN107135525A (en) * | 2017-06-21 | 2017-09-05 | 天津光电通信技术有限公司 | A kind of method that WiFi automatically switches with cellular mo-bile data network |
CN107371208A (en) * | 2016-05-13 | 2017-11-21 | 中兴通讯股份有限公司 | Switching method and device |
-
2018
- 2018-06-29 CN CN201810698050.XA patent/CN108834203B/en active Active
Patent Citations (16)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102625398A (en) * | 2012-03-07 | 2012-08-01 | 北京三星通信技术研究有限公司 | Method and equipment for recovering data traffics of high-level applications at time of multi-channel data connection switching |
CN102905249A (en) * | 2012-07-05 | 2013-01-30 | 安徽中兴继远信息技术股份有限公司 | Terminal parameter setting method based on communication with wireless network |
CN102752825A (en) * | 2012-07-19 | 2012-10-24 | 德明通讯(上海)有限公司 | Seamless switch fusion method for mobile terminal in long term evolution (LTE) network and wireless fidelity (Wi-Fi) hot spot network |
US20150373574A1 (en) * | 2012-12-13 | 2015-12-24 | Devicescape Software, Inc. | Systems and methods for quality of experience measurement and wireless network recommendation |
CN104602309A (en) * | 2013-10-30 | 2015-05-06 | 中国电信股份有限公司 | Wireless network switching guiding method and device |
CN104754661A (en) * | 2013-12-31 | 2015-07-01 | 中兴通讯股份有限公司 | Method for achieving seamless switching between cellular network and WiFi network, network device and user equipment |
WO2015164712A1 (en) * | 2014-04-25 | 2015-10-29 | Intel IP Corporation | User equipment and methods for handover initiation |
CN104159231A (en) * | 2014-08-19 | 2014-11-19 | 北京奇虎科技有限公司 | Method for optimizing background flow of client, and client |
CN104202782A (en) * | 2014-09-23 | 2014-12-10 | 酷派软件技术(深圳)有限公司 | Network switching method, network switching device and terminal |
EP3016444A1 (en) * | 2014-10-10 | 2016-05-04 | BlackBerry Limited | Utilizing wi-fi country code to assist cellular network selection |
CN105828395A (en) * | 2015-07-28 | 2016-08-03 | 维沃移动通信有限公司 | Method and device of WiFi adaptive selection and connection |
CN105828455A (en) * | 2016-01-28 | 2016-08-03 | 努比亚技术有限公司 | Network connection device and method |
CN107371208A (en) * | 2016-05-13 | 2017-11-21 | 中兴通讯股份有限公司 | Switching method and device |
CN106358225A (en) * | 2016-09-20 | 2017-01-25 | 广东欧珀移动通信有限公司 | Network data processing method, network data processing device and mobile terminal |
CN106851759A (en) * | 2017-03-14 | 2017-06-13 | 朱钦 | The cut-in method and device of network |
CN107135525A (en) * | 2017-06-21 | 2017-09-05 | 天津光电通信技术有限公司 | A kind of method that WiFi automatically switches with cellular mo-bile data network |
Cited By (20)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112243274B (en) * | 2019-07-17 | 2021-10-22 | 大唐移动通信设备有限公司 | Timing switching processing method and device based on time |
CN112243274A (en) * | 2019-07-17 | 2021-01-19 | 大唐移动通信设备有限公司 | Timing switching processing method and device based on time |
CN112752319A (en) * | 2019-10-31 | 2021-05-04 | 中兴通讯股份有限公司 | Network switching method, device, terminal and storage medium |
CN111277667A (en) * | 2020-02-24 | 2020-06-12 | 拉扎斯网络科技(上海)有限公司 | Data caching method and device, storage medium and electronic equipment |
CN111757040A (en) * | 2020-06-24 | 2020-10-09 | 维沃移动通信有限公司 | Communication method and device |
CN112206507A (en) * | 2020-10-19 | 2021-01-12 | 珠海金山网络游戏科技有限公司 | Protocol processing method and device |
CN112206507B (en) * | 2020-10-19 | 2023-02-17 | 珠海金山数字网络科技有限公司 | Protocol processing method and device |
CN112312498B (en) * | 2020-10-27 | 2023-04-28 | 北京小米移动软件有限公司 | Method and device for switching network and storage medium |
CN112312498A (en) * | 2020-10-27 | 2021-02-02 | 北京小米移动软件有限公司 | Method and device for switching network and storage medium |
WO2022100255A1 (en) * | 2020-11-13 | 2022-05-19 | Oppo广东移动通信有限公司 | Network switching method and apparatus, storage medium, and electronic device |
CN114650573A (en) * | 2020-12-21 | 2022-06-21 | 深圳市万普拉斯科技有限公司 | Network delay processing method and device and mobile terminal |
CN114726818A (en) * | 2020-12-21 | 2022-07-08 | 腾讯科技(深圳)有限公司 | Network social contact method, device, equipment and computer readable storage medium |
CN114650573B (en) * | 2020-12-21 | 2023-10-27 | 深圳市万普拉斯科技有限公司 | Network delay processing method and device and mobile terminal |
CN114726818B (en) * | 2020-12-21 | 2024-01-23 | 腾讯科技(深圳)有限公司 | Network social method, device, equipment and computer readable storage medium |
CN113014972A (en) * | 2021-01-28 | 2021-06-22 | 维沃移动通信有限公司 | Screen projection method, device and system |
CN113014972B (en) * | 2021-01-28 | 2024-02-27 | 维沃移动通信有限公司 | Screen projection method, device and system |
CN113890905A (en) * | 2021-06-16 | 2022-01-04 | 荣耀终端有限公司 | Channel switching method, electronic device and storage medium |
CN114339869A (en) * | 2022-02-25 | 2022-04-12 | 京东科技信息技术有限公司 | Network management method, device, electronic equipment and storage medium |
CN114339869B (en) * | 2022-02-25 | 2024-04-05 | 京东科技信息技术有限公司 | Network management method, device, electronic equipment and storage medium |
CN114828130A (en) * | 2022-04-01 | 2022-07-29 | Oppo广东移动通信有限公司 | Network switching method of terminal equipment, terminal equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN108834203B (en) | 2021-01-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108834203A (en) | Method for switching network, device, terminal and storage medium | |
CN108449771B (en) | Network switching method, device, terminal and storage medium | |
WO2022143520A1 (en) | Cell switching method and apparatus, and user equipment | |
CN109089261B (en) | Method, apparatus, computer device and storage medium for wireless roaming triggering | |
RU2769399C1 (en) | Reconfiguration method and user equipment | |
CN104365147B (en) | Mobile station and method and computer-readable recording medium for mobile station | |
CN109548037A (en) | A kind of control method, distributed unit, centralized unit and storage medium | |
CN112469096B (en) | Cell switching method and device | |
EP4221308A1 (en) | Communication method and apparatus, and readable storage medium, and system | |
CN112203361B (en) | Method and device for processing radio link failure, terminal and storage medium | |
WO2024017123A1 (en) | Cell selection method and apparatus, and terminal device and readable storage medium | |
CN111050356B (en) | Data transmission processing method and device, storage medium and electronic device | |
Rahmati et al. | Seamless flow migration on smartphones without network support | |
CN114125942A (en) | Network resource management method, device, terminal and storage medium | |
CN102821415B (en) | Fault detecting and processing method and fault detecting and processing device | |
KR20210016803A (en) | Management apparatus and method for controlling handover parameters using handover failure statistics | |
US20230239766A1 (en) | Method and apparatus for terminal to access network, device, and readable storage medium | |
CN109151863A (en) | Android system network management and system based on routing table | |
WO2024032543A1 (en) | Information acquisition method, and terminal and access network device | |
US20230232312A1 (en) | Configuration Method and Apparatus, and Terminal and Network Side Device | |
CN110933697B (en) | Network state detection method and device, storage medium and electronic equipment | |
WO2022057628A1 (en) | Data buffering method and related device | |
CN114143842B (en) | Cell access method and device | |
US20220141911A1 (en) | Wireless backhaul monitoring and wireless link management | |
US20230345340A1 (en) | Network-changing method and apparatus, and terminal |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |