CN108449771A - Method for switching network, device, terminal and storage medium - Google Patents

Method for switching network, device, terminal and storage medium Download PDF

Info

Publication number
CN108449771A
CN108449771A CN201810698043.XA CN201810698043A CN108449771A CN 108449771 A CN108449771 A CN 108449771A CN 201810698043 A CN201810698043 A CN 201810698043A CN 108449771 A CN108449771 A CN 108449771A
Authority
CN
China
Prior art keywords
network
network connection
connection
data
application program
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
Application number
CN201810698043.XA
Other languages
Chinese (zh)
Other versions
CN108449771B (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.)
Oppo Chongqing Intelligent Technology Co Ltd
Original Assignee
Oppo Chongqing Intelligent Technology Co 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 Oppo Chongqing Intelligent Technology Co Ltd filed Critical Oppo Chongqing Intelligent Technology Co Ltd
Priority to CN201810698043.XA priority Critical patent/CN108449771B/en
Publication of CN108449771A publication Critical patent/CN108449771A/en
Application granted granted Critical
Publication of CN108449771B publication Critical patent/CN108449771B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W36/00Hand-off or reselection arrangements
    • H04W36/0005Control or signalling for completing the hand-off
    • H04W36/0083Determination of parameters used for hand-off, e.g. generation or modification of neighbour cell lists
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W36/00Hand-off or reselection arrangements
    • H04W36/16Performing reselection for specific purposes
    • H04W36/18Performing reselection for specific purposes for allowing seamless reselection, e.g. soft reselection
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W36/00Hand-off or reselection arrangements
    • H04W36/24Reselection being triggered by specific parameters
    • H04W36/30Reselection being triggered by specific parameters by measured or perceived connection quality data
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W36/00Hand-off or reselection arrangements
    • H04W36/14Reselecting a network or an air interface

Landscapes

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

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:First network connection and the second network connection are established, first network connection is different with the internetwork connection mode of the second network connection;The network data of transmission game class application program is connected by first network;Network quality test is carried out to first network connection and the second network connection, obtains network quality test result;If network quality test result indicates that the quality of the second network connection is better than the quality of first network connection, switch the network data that game class application program is transmitted using the second network connection.Whole network handoff procedure is executed automatically by terminal, simplifies network handover routines;Network switching process will not impact network data transmission, avoid occurring Caton phenomenon in handoff procedure, realize internetwork seamless switching.

Description

Method for switching network, device, terminal and storage medium
Technical field
The invention relates to field of network connections, more particularly to a kind of method for switching network, device, terminal and storage Medium.
Background technology
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 terminal is in WiFi network coverage area, user can open the WiFi linkage functions of terminal, and pass through It accesses WiFi network and carries out network access;If the Network status for being currently accessed WiFi network is bad, user can be turned off manually WiFi linkage functions make terminal switching carry out network access using mobile data network.
Invention content
The embodiment of the present application provides a kind of method for switching network, device, terminal and storage medium, can be used for solving using When the manual switching internetwork connection mode of family, handoff procedure is cumbersome, and the problem of can cause data-transmission interruptions in handoff procedure.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:
Establish first network connection and the second network connection, the net of the first network connection and second network connection Network connection type is different;
The network data of transmission game class application program is connected by the first network;
Network quality test is carried out to first network connection and second network connection, obtains network quality test As a result;
If the network quality test result indicates that the quality of second network connection is connected better than the first network Quality, then switch the network data that the game class application program is transmitted using second network connection.
On the other hand, a kind of network switching device is provided, described device includes:
Module is established, for establishing first network connection and the second network connection, first network connection and described the The internetwork connection mode of two network connections is different;
Transmission module, the network data for connecting transmission game class application program by the first network;
Test module is obtained for carrying out network quality test to first network connection and second network connection To network quality test result;
Handover module, for indicating the quality of second network connection better than described when the network quality test result When the quality of first network connection, the network number of the game class application program is transmitted in switching using second network connection According to.
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 by the processor and are executed to realize the 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 load by processor and executed the method for switching network as described in terms of above-mentioned with realization.
The advantageous effect that technical solution provided by the embodiments of the present application is brought includes at least:
Binary channel network connection is established by using heterogeneous networks connection type, and is transmitted using a wherein network connection The network data of game class application program, and then it is not so good as the network of another network connection in the network quality of current network connection When quality, the network data of another network connection transmission game class application program is automatically switched to use;Whole network switched Journey is executed automatically by terminal, is not necessarily to user's manual switching, is simplified network handover routines;Simultaneously as having pre-established two kinds Network connection access, therefore network switching process will not impact network data transmission, to avoid going out in handoff procedure Existing Caton phenomenon, realizes internetwork seamless switching.
Description of the drawings
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 accompanying drawings in the following description is only some embodiments of the present application, for For those of ordinary skill in the art, without creative efforts, other are can also be obtained according to these attached drawings Attached drawing.
Fig. 1 shows the environment schematic for the implementation environment that one exemplary embodiment of the application provides;
Fig. 2 shows the flow charts for the method for switching network that one exemplary embodiment of the application provides;
Fig. 3 shows the flow chart for the method for switching network that another exemplary embodiment of the application provides;
Fig. 4 is the interface schematic diagram for prompting user to open mobile data network;
Fig. 5 shows the flow chart for the method for switching network that another exemplary embodiment of the application provides;
Fig. 6 is the interface schematic diagram for prompting the currently used mobile data network of user;
Fig. 7 shows the structure diagram for the network switching device that one exemplary embodiment of the application provides;
Fig. 8 shows the structure diagram for the terminal that one exemplary embodiment of the application provides.
Specific implementation mode
To keep the purpose, technical scheme and advantage 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.It is a kind of relationship of "or" that character "/", which typicallys represent forward-backward correlation object,.
Referring to FIG. 1, the environment schematic of the implementation environment provided it illustrates one exemplary embodiment of the application, it should Implementation environment includes terminal 110 and server 120.
Terminal 110 is the electronic equipment for having 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, at least one application program is also equipped in terminal 110, and at least one application program is interconnected Net accesses, which can be instant messaging application program, mail class application program, social networking application program, video playing Application program, browser application, game class application program, news read application program etc..
It is connected by WiFi network or mobile data network between terminal 110 and server 120.
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 game class application program in terminal 110.Game class application program was run Cheng Zhong, i.e., send the game data of local terminal to server 110, and receives other game class application programs of the transmission of server 110 The game data of transmission, to realize multiplayer online games.Wherein, game class application program can be:The large-scale more people of policy class Game on line application MMOSLG, adventure Massively Multiplayer Online Games application MMOAVG, simulation class Massively Multiplayer Online Games are answered With MMOSG, movement class Massively Multiplayer Online Games application MMOSPT, racing car class Massively Multiplayer Online Games application MMORCG and angle Color plays the part of at least one of class Massively Multiplayer Online Games application MMORPG.
Under a kind of possible application scenarios, as shown in Figure 1, after terminal 110 opens game class application program, establish simultaneously WiFi network connection connects binary channel with mobile data network, and carries out game number with server 120 by a wherein access According to transmission.In game class application program operational process, terminal 110 tests two accesses, and is determined according to test result The quality of two accesses, and then determine and be continuing with current network or progress network switching.
Optionally, it in the implementation environment can also include destination server, terminal 110 is to pass through established network connection The destination server is accessed, to obtain the quality of each network connection, and then determines 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 illustrated applied to the terminal 110 in Fig. 1 in this way.The method includes:
Step 201, first network connection and the second network connection, the net of first network connection and the second network connection are established Network connection type is different.
Optionally, internetwork connection mode is one kind during WiFi network connection is connected with mobile data network, i.e., when first When network connection is that WiFi network connects, the second network connection connects for mobile data network;It is connected as moving when first network When dynamic data network connection, the second network connection connects for WiFi network.
Wherein, when establishing WiFi network connection, terminal needs to open WiFi network linkage function, and terminal is in WiFi network In signal cover;When establishing mobile data network connection, terminal needs to open mobile data network linkage function, and in base It stands in signal cover.
In a kind of possible embodiment, when detecting startup game class application program, terminal is while establishing WiFi network connection connects binary channel with mobile data network;When detecting that terminal is then only when starting non-gaming class application program Establish WiFi network connection or mobile data network connection.
In other possible embodiments, when arbitrarily needing to connect the application program launching of network, terminal establishes the One network connection and the second network connection.
Step 202, the network data of transmission game class application program is connected by first network.
Set up WiFi network connection connect binary channels with mobile data network after, terminal be pass through one of network It connects and sends the network data generated in game class application program operational process to server, and received and taken by the network connection The network data that business device is sent to game class application program.Wherein, which is in front stage operation state.
In a kind of possible embodiment, there is WiFi network connection to be connected with mobile data network when establishing simultaneously, and When (can access internet) can be used in WiFi network connection, terminal acquiescence connects transmitting network data by WiFi network.
Step 203, network quality test is carried out to first network connection and the second network connection, obtains network quality test As a result.
In game class application program operational process (i.e. during being carried out data transmission using first network connection), terminal Network quality test is carried out to first network connection and the second network connection, the network quality to obtain instruction network quality is surveyed Test result.
In a kind of possible embodiment, terminal periodically accesses specified services using each network connection of foundation Device, to obtain the corresponding network quality test result of each network connection.
Optionally, which includes at least one of delay and packet loss, the embodiment of the present application The design parameter for including in network quality test result is not defined.
Step 204, if network quality test result indicates that the quality of the second network connection is better than the matter of first network connection Amount then switches the network data that game class application program is transmitted using the second network connection.
According to network quality test result, whether terminal detects the quality of first network connection better than the second network connection Quality, if being better than, it is determined that be not necessarily to handover network, continue through first network connection transmitting network data, and continue net Network quality test;If the quality of the second network connection is better than the quality of first network connection, terminal determines current network conditions It is bad, and network switching is carried out, the network data of game class application program is transmitted thereby using the second network connection, it is ensured that game The running quality of class application program.
It should be noted that after completing network switching, terminal remains on first network connection, and at the beginning of network switching Phase, the network data sent by first network Connection Service device;SS later is by the second network connection to server network After data, server also will by the second network connection to terminal transmission network data (first network connect and the second network connect The IP address connect is different).
Optionally, after completing network switching, terminal continues network quality test, and according to network quality test result Real-time network switching is carried out, ensures the preferable network of terminal cut-in quality.
It, can be according to not when the terminal operating game class application program more demanding to network quality using the above method With the quality of network connection, dynamic carries out network switching, it is ensured that game class application program is transported under the preferable network connection of quality Row improves the running quality of game class application program.
In conclusion in the embodiment of the present application, binary channel network connection is established by using heterogeneous networks connection type, and The network data of game class application program is transmitted using a wherein network connection, and then in the network quality of current network connection Not as good as another network connection network quality when, automatically switch to use another network connection transmission game class application program Network data;Whole network handoff procedure is executed automatically by terminal, is not necessarily to user's manual switching, is simplified network handover routines; Simultaneously as two kinds of network connection accesses have been pre-established, therefore network switching process will not cause shadow to network data transmission It rings, to avoid occurring Caton phenomenon in handoff procedure, realizes internetwork seamless switching.
The network data transmitted between game class application program and server generally comprises User Datagram Protocol (User Datagram Protocol, UDP) data and transmission control protocol (Transmission Control Protocol, TCP) number The control instruction in the data more demanding to propagation delay time, such as game is generally included according to, wherein UDP message, and TCP numbers According to by including data more demanding to transmission reliability, such as the logon information in game.Due to TCP data transmission according to Rely the TCP connection established between terminal and server, and re-establish TCP connection can cause connection disconnect, therefore, in order into One step carries out reduction network switching to be influenced caused by game class application program, and it is preferable that UDP message is only switched to quality by terminal Network connection be transmitted, illustrated below using schematical embodiment.
Referring to FIG. 3, it illustrates the flow charts of the method for switching network of the application another exemplary embodiment offer. The present embodiment is illustrated applied to the terminal 110 in Fig. 1 in this way.The method includes:
Step 301, determine whether foreground application belongs to game class application using packet name according to foreground application Program.
In the embodiment of the present application, terminal is starting (for example requiring low delay, low packet loss ratio) more demanding to network quality Game class application program when, enable intelligent network handoff functionality.Therefore, the foreground application run for current foreground, Terminal obtains it and applies packet name (packagename), to determine whether foreground application belongs to game according to using packet name Class application program.Wherein, which refers to the application program by switching to front stage operation from the background, alternatively, directly preceding The application program that platform starts.
In a kind of possible embodiment, terminal obtains the target trip for needing to enable intelligent network switching of user setting Play class application program, and the intended application packet name of target game class application program is stored.Subsequent detection is to there are foregrounds When application program, whether the i.e. detection foreground application of terminal belongs to intended application packet name using packet name, and when belonging to, really Determine foreground application and belong to game class application program, and executes step 302;Conversely, determining that foreground application is not belonging to swim Play class application program.
Optionally, in order to ensure that can realize that intelligent network switches when running game class application program, if foreground application journey Sequence belongs to game class application program, and does not open first network linkage function, and terminal shows the second prompt message, second prompt Information opens first network linkage function for prompting;If foreground application belongs to game class application program, and does not open Two network connecting functions then show that third prompt message, third prompt message open the second network connecting function for prompting.
Schematically, as shown in figure 4, terminal, which detects, has turned on WiFi network linkage function, but mobile data is not opened When network connecting function, pass through 41 display reminding information of Toast message boxs.Setting in Toast message boxs 41 when the user clicks When button 42, terminal redirects display mobile data network setting interface, so that user opens mobile data network linkage function.
Step 302, if foreground application belongs to game class application program, first network connection and the second network are established Connection.
Wherein, terminal, which establishes first network connection and the mode of the second network connection, can refer to above-mentioned steps 201, this reality Applying example, details are not described herein.
Step 303, the network data of transmission game class application program is connected by first network.
The embodiment of this step can refer to above-mentioned steps 202, and details are not described herein for the present embodiment.
In a kind of possible embodiment, for game class application program during front stage operation, terminal is simultaneously to first Network connection and the second network connection carry out network quality test, and are connected better than first network in the quality of the second network connection Quality when, carry out network switching.
In alternatively possible embodiment, in order to avoid frequently carrying out network switching, and network quality test is reduced When the resource that expends, terminal passes through following step 304 to 306 and carries out network quality test.
Step 304, first network quality test results are obtained by first network connected reference destination server, first Network quality test result includes at least one of delay and packet loss.
While terminal connects the network data of transmission game class application program by first network, periodically by the One network connection access target server, to obtain including the first network quality test results postponed with packet loss.Wherein, Delay is lower, and/or, packet loss is lower, shows that the quality of network connection is better.
In a kind of possible embodiment, terminal periodic ground ping targets domain name (corresponding destination server), to 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 is not to measuring The mode of delay and packet loss is defined.
Optionally, for different types of network connection, the period of terminal access destination server is also different.When the first net When network connection is WiFi network connection, terminal, by first network connected reference destination server, is obtained every first time interval To first network quality test results;When first network is connected as mobile data network connection, terminal is every between the second time Every by first network connected reference destination server, first network quality test results are obtained.Wherein, since WiFi network connects The probability for picking out existing network fluctuation is higher, and therefore, first time interval is less than the second time interval, i.e., currently used WiFi network When connecting transmitting network data, the frequency that terminal carries out network quality test is higher.For example, first time interval is 1s, second Time interval is 2s.
Step 305, it if first network quality test results miss the mark test result, is visited by the second network connection It asks destination server, obtains the second network quality test result, the second network quality test result includes in delay and packet loss At least one.
It is previously provided with target detection in a kind of possible embodiment, terminal as a result, being wrapped in the target detection result Containing at least one of target delay and target packet loss, the target delay and target packet loss are that game class application program is normal The minimum index of required satisfaction when operation.For example, the target delay is 100ms, target packet loss is 10%.
Since the requirement that different type is played to network quality may be different, optionally, for different types of trip It plays class application program, the parameter for including in the target detection result is different.For example, when the first person shoots ((First-Person Shooting, FPS) in the corresponding target detection result of game, target delay 50ms, target packet loss is 10%, and more people Online tactics sports (Multiplayer Online Battle Arena, MOBA) are played in corresponding target detection result, mesh Mark delay is 100ms, and target packet loss is 10%.
After obtaining first network quality test results, terminal detects whether first network quality test results reach target Test result, if reaching, it is determined that without carrying out network switching, and continue through above-mentioned steps 304 and carry out network quality test; If not up to, terminal is further by the second network connection access target server, to obtain the test of the second network quality As a result.
Optionally, when delay be higher than target delay, or/and, packet loss be higher than target packet loss when, terminal determines the first net Network quality test results miss the mark test result.
Wherein, the process tested the second network connection can refer to above-mentioned steps 304, and the present embodiment is no longer superfluous herein It states.
Step 306, if the second network quality test result is better than first network quality test results, it is determined that the second network The quality of connection is better than the quality of first network connection.
Further, terminal is determined by comparing the second network quality test result and first network quality test results The quality of second network connection whether due to first network connection quality.If the quality of the second network connection is better than first network The quality of connection, terminal execute following step 307, if the quality of first network connection is better than the quality of the second network connection, eventually End is determined without carrying out network switching, and is continued through above-mentioned steps 304 and carried out network quality test.
In a kind of possible embodiment, when the delay less than first network connection that postpones of the second network connection, and/ Or, when the packet loss of the second network connection is less than the packet loss that first network connects, terminal determines the quality of the second network connection Better than the quality of first network connection.
When carrying out network connection test using above-mentioned steps 304 to 306, by the way that target detection is arranged as a result, avoiding two Kind of network connection quality preferably in the case of, frequently carry out network switching;Meanwhile terminal only first network quality of connection not In the case of good, quality test is carried out to the second network connection, further reduced the resource expended when network quality test.
Step 307, if network quality test result indicates that the quality of the second network connection is better than the matter of first network connection Amount identifies the network data of game class application program then according to the UID of game class application program.
Since in game class application program operational process, other background applications may also need transmission network in terminal Network data, therefore, the second network in order to which the corresponding network data of game class application program accurately to be switched to better quality connect It connects, terminal needs the unique identifier (Unique Identity, UID) according to game class application program, identifies that game class is answered With the network data of program.The embodiment of the present application simultaneously limits the concrete mode of identification specified application corresponding network data It is fixed.
Step 308, the UDP message and TCP data in network data are identified.
May include UDP message and TCP data in the network data of game class application transfer.Wherein, UDP is a kind of Based on connectionless transport protocol, therefore handover network connection can't impact the transmission of UDP message;TCP is a kind of Transport protocol based on connection, when handover network, it is necessary first to disconnect and have TCP connection, then re-establish new TCP and connect It connects, therefore handover network connection can impact the transmission of TCP data, and then game picture in network switching process is caused to go out Existing interim card disconnects the problems such as reconnection.
In order to avoid there is the above problem when network switching, after the network data for identifying game class application program, terminal It needs further to identify UDP message therein and TCP data.
In a kind of possible embodiment, terminal (identifies the association of agreement after header according to protocol identifier field View number) identify UDP message and TCP data, wherein and the protocol number of UDP message is 17, and the protocol number of TCP data is 6.
Step 309, the TCP data in transmitting network data is connected by first network.
For the TCP data in network data, it is transmitted in order to avoid TCP data is switched to the second network connection When, re-establishing TCP connection leads to problems such as interim card occur, disconnects reconnection, and terminal still connects transmission TCP by first network Data.
Correspondingly, terminal, which continues through first network connection, receives the TCP data that server is sent.
Step 310, switching uses the UDP message in the second network connection transmitting network data.
For the UDP message in network data, in order to improve the running quality of game class application program, terminal is by UDP numbers It is transmitted according to the second network connection is switched to, to reduce the transmission delay and packet loss of game class application program UDP message Rate.
Correspondingly, SS later is to receive the UDP message that server is sent by the second network connection.It needs to illustrate It is that, at network switching initial stage, since server is still connected by first network to terminal transmission UDP message, terminal exists Network switching initial stage receives UDP message by first network connection and the second network connection simultaneously, and is connect by the second network When connection receives UDP message, stop connecting reception UDP message by first network.
In the present embodiment, when the quality of the second network connection is due to currently used first network connection, terminal passes through UID identifies the network data of game class application, and switches the UDP message in the second network connection transmitting network data, still makes The TCP data in transmitting network data is connected with first network, interim card of playing caused by avoid TCP reconnections disconnects reconnection The problems such as, reduce the influence that network switching generates game class application program.
In addition, in the present embodiment, terminal only in the case where first network quality of connection is bad, to the second network connection into Row quality test further reduced the resource expended when network quality test;Meanwhile terminal is by being arranged target detection knot Fruit, avoid in the case that two kinds of network connection qualities preferably, frequently carry out network switching.
In addition, in the present embodiment, terminal is only to the higher game class application of network quality demand in foreground application When program, while dual link access is established, to realize that intelligent network switches, avoids establishing dual link for low network quality demand The wasting of resources caused by access.
Under a kind of possible application scenarios, terminal currently by WiFi network connect transmitting network data, but due to WiFi network fluctuates, the mobile data network transmitting network data of terminal handover network better quality, and passes through mobile number Flow is will produce when according to network transmission network data.Flow is generated when user's running game class application program in order to remind, one In the possible embodiment of kind, when first network is connected as WiFi network connection, the second network connection is that mobile data network connects When connecing, on the basis of Fig. 3, as shown in figure 5, further including following steps after step 310.
Step 311, data volume of the game class application program by the second network connection transmission data is obtained.
When switching to mobile data network transmitting network data (UDP message), terminal real-time statistics game class application journey Sequence connects the data volume of transmission data by mobile data network.
Step 312, if data volume is more than threshold value, show that the first prompt message, the first prompt message are played for prompting Class application program consumes mobile data network flow.
Optionally, the threshold value is by user setting, alternatively, the threshold value is determined by terminal according to residual flow.For example, the threshold value For 10MB, alternatively, the threshold value is the 10% of residual flow.
Whether terminal detection data amount reaches threshold value, and when reaching, and shows the first prompt message, to provide user's game Class application program is currently consuming mobile data network flow.
Schematically, as shown in fig. 6, when data volume is more than threshold value, terminal display the prompt box 43 is prompting user currently just Using mobile data network.
Optionally, when data volume is more than threshold value, terminal automatically switches to use WiFi data network connection transmission network number According to, and show corresponding 4th prompt message, ask the user whether that switching uses mobile data network, and refer to receiving confirmation Showing is, automatically switches mobile data network connection.
In the present embodiment, when intelligently switching is using mobile data network, terminal is disappeared by detecting game class application program The flow of consumption, and prompted when consumed flow is more, avoid game class application program from consuming excessive mobile data network stream It measures and generates additional campus network.
Following is the application device embodiment, 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. 7, the structure diagram of the network switching device provided it illustrates one exemplary embodiment of the application. The device includes:
Module 710 is established, for establishing first network connection and the second network connection, first network connection and described The internetwork connection mode of second network connection is different;
Transmission module 720, the network data for connecting transmission game class application program by the first network;
Test module 730, for carrying out network quality test to first network connection and second network connection, Obtain network quality test result;
Handover module 740, for indicating that the quality of second network connection is better than when the network quality test result When the quality of the first network connection, the network of the game class application program is transmitted in switching using second network connection Data.
Optionally, the handover module 740, including:
First recognition unit identifies the game class application program for the UID according to the game class application program Network data;
Second recognition unit, for identification the User Datagram Protocol UDP message in the network data and transmission control Agreement TCP data;
Transmission unit, for transmitting the TCP data in the network data by first network connection;
Switch unit, for switching the UDP message transmitted using second network connection in the network data.
Optionally, the first network is connected as WiFi network connection, and second network connection is mobile data network Connection;
Described device further includes:
Acquisition module, the data for obtaining the game class application program by the second network connection transmission data Amount;
First display module shows the first prompt message, first prompt if being more than threshold value for the data volume Information is for prompting the game class application program consumption mobile data network flow.
Optionally, the test module 730, including:
First access unit, for by the first network connected reference destination server, obtaining first network quality Test result, the first network quality test results include at least one of delay and packet loss;
Second access unit passes through if being used for the first network quality test results miss the mark test result Second network connection accesses the destination server, obtains the second network quality test result, second network quality Test result includes at least one of delay and packet loss;
First determination unit, if being better than the first network quality test knot for the second network quality test result Fruit, it is determined that the quality of second network connection is better than the quality of first network connection.
Optionally, the internetwork connection mode be WiFi network connection connected with mobile data network in one kind, first Access unit is used for:
If the first network is connected as the WiFi network connection, pass through first net every first time interval Destination server described in network connected reference obtains the first network quality test results;
If the first network is connected as mobile data network connection, pass through described the every the second time interval One network connection accesses the destination server, obtains the first network quality test results;
Wherein, the first time interval is less than second time interval.
Optionally, described to establish module 710, including:
Second determination unit, for determining whether the foreground application belongs to using packet name according to foreground application In the game class application program;
Unit is established, if belonging to the game class application program for the foreground application, establishes described first Network connection and second network connection.
Optionally, described device further includes:
Second display module if belonging to the game class application program for the foreground application, and does not open One network connecting function then shows that the second prompt message, second prompt message open the first network company for prompting Connection function;
Third display module if belonging to the game class application program for the foreground application, and does not open Two network connecting functions then show that third prompt message, the third prompt message open the second network company for prompting Connection function.
In conclusion in the embodiment of the present application, binary channel network connection is established by using heterogeneous networks connection type, and The network data of game class application program is transmitted using a wherein network connection, and then in the network quality of current network connection Not as good as another network connection network quality when, automatically switch to use another network connection transmission game class application program Network data;Whole network handoff procedure is executed automatically by terminal, is not necessarily to user's manual switching, is simplified network handover routines; Simultaneously as two kinds of network connection accesses have been pre-established, therefore network switching process will not cause shadow to network data transmission It rings, to avoid occurring Caton phenomenon in handoff procedure, realizes internetwork seamless switching.
It should be noted that the device that above-described embodiment provides, when realizing its function, only with above-mentioned each function module It divides and for example, in practical application, can be completed as needed and by above-mentioned function distribution by different function modules, The internal structure of terminal is divided into different function modules, to complete all or part of the functions described above.In addition, The apparatus and method embodiment that above-described embodiment provides belongs to same design, and specific implementation process refers to embodiment of the method, this In repeat no more.
Referring to FIG. 8, the structure 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 application-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 its arbitrary combination.
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 by processor 1010 and is executed to realize the method for displaying user interface described in as above each embodiment.Memory 1020 Can be volatile memory (English:Volatile memory), nonvolatile memory (English:non-volatile ) or combination thereof memory.Volatile memory can be random access memory (English:random-access Memory, RAM), such as static RAM (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 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 by the processor 1010 and are executed to realize the 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 by the processor and are executed to realize the 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 by the processor and are executed to realize the network switching described in as above each embodiment Method.
Above-mentioned the embodiment of the present application serial number is for illustration only, can not represent the quality of embodiment.
One of ordinary skill in the art will appreciate that realizing that all or part of step of above-described embodiment can pass through hardware It completes, relevant hardware can also be instructed to complete by program, the program can be stored 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 should be included within the protection domain of the application.

Claims (10)

1. a kind of method for switching network, which is characterized in that the method includes:
Establish first network connection and the second network connection, the network company of the first network connection and second network connection Connect mode difference;
The network data of transmission game class application program is connected by the first network;
Network quality test is carried out to first network connection and second network connection, obtains network quality test knot Fruit;
If the network quality test result indicates that the quality of second network connection is better than the matter of first network connection Amount, then switch the network data that the game class application program is transmitted using second network connection.
2. according to the method described in claim 1, it is characterized in that, the switching uses described in second network connection transmission The network data of game class application program, including:
According to the unique identifier UID of the game class application program, the network data of the game class application program is identified;
Identify the User Datagram Protocol UDP message and transmission control protocol TCP data in the network data;
The TCP data in the network data is transmitted by first network connection;
The UDP message in the network data is transmitted in switching using second network connection.
3. according to the method described in claim 2, it is characterized in that, the first network is connected as Wireless Fidelity WiFi network company It connects, second network connection connects for mobile data network;
After the switching transmits the UDP message in the network data using second network connection, the method is also wrapped It includes:
Obtain data volume of the game class application program by the second network connection transmission data;
If the data volume is more than threshold value, the first prompt message is shown, first prompt message is for prompting the game Class application program consumes mobile data network flow.
4. method according to any one of claims 1 to 3, which is characterized in that described to first network connection and described Second network connection carries out network quality test, obtains network quality test result, including:
By the first network connected reference destination server, first network quality test results, the first network are obtained Quality test results include at least one of delay and packet loss;
If the first network quality test results miss the mark test result, institute is accessed by second network connection Destination server is stated, the second network quality test result is obtained, the second network quality test result includes delay and packet loss At least one of rate;
If the second network quality test result is better than the first network quality test results, it is determined that second network The quality of connection is better than the quality of first network connection.
5. according to the method described in claim 4, it is characterized in that, the internetwork connection mode is WiFi network connection and movement One kind in data network connection;
It is described that first network quality test results are obtained by the first network connected reference destination server, including:
If the first network is connected as the WiFi network connection, connected by the first network every first time interval The destination server is asked in receiving, obtains the first network quality test results;
If the first network is connected as the mobile data network connection, pass through first net every the second time interval Destination server described in network connected reference obtains the first network quality test results;
Wherein, the first time interval is less than second time interval.
6. method according to any one of claims 1 to 3, which is characterized in that described to establish first network connection and the second net Network connects:
Determine whether the foreground application belongs to the game class application program using packet name according to foreground application;
If the foreground application belongs to the game class application program, the first network connection and described second are established Network connection.
7. according to the method described in claim 4, it is characterized in that, described determine the foreground application according to the application packet name Whether program belongs to after the game class application program, and the method further includes:
If the foreground application belongs to the game class application program, and does not open first network linkage function, then show Second prompt message, second prompt message open the first network linkage function for prompting;
If the foreground application belongs to the game class application program, and does not open the second network connecting function, then show Third prompt message, the third prompt message open second network connecting function for prompting.
8. a kind of network switching device, which is characterized in that described device includes:
Module is established, for establishing first network connection and the second network connection, the first network connection and second net The internetwork connection mode of network connection is different;
Transmission module, the network data for connecting transmission game class application program by the first network;
Test module obtains net for carrying out network quality test to first network connection and second network connection Network quality test results;
Handover module, for indicating that the quality of second network connection is better than described first when the network quality test result When the quality of network connection, the network data of the game class application program is transmitted in switching using second 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 instructs, and described instruction is loaded by the processor and 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.
CN201810698043.XA 2018-06-29 2018-06-29 Network switching method, device, terminal and storage medium Active CN108449771B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810698043.XA CN108449771B (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
CN201810698043.XA CN108449771B (en) 2018-06-29 2018-06-29 Network switching method, device, terminal and storage medium

Publications (2)

Publication Number Publication Date
CN108449771A true CN108449771A (en) 2018-08-24
CN108449771B CN108449771B (en) 2020-08-11

Family

ID=63206976

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810698043.XA Active CN108449771B (en) 2018-06-29 2018-06-29 Network switching method, device, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN108449771B (en)

Cited By (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109362111A (en) * 2018-12-24 2019-02-19 上海连尚网络科技有限公司 Information cuing method
CN109474528A (en) * 2018-09-28 2019-03-15 Oppo广东移动通信有限公司 Communication connecting method, device, terminal device and computer-readable storage medium
CN109743456A (en) * 2018-12-29 2019-05-10 Oppo广东移动通信有限公司 Data transmission method and relevant apparatus
CN110087270A (en) * 2019-05-15 2019-08-02 深圳市沃特沃德股份有限公司 A kind of method, apparatus of reading, storage medium and computer equipment
CN110267315A (en) * 2019-06-28 2019-09-20 南昌黑鲨科技有限公司 Network connection control method, system, intelligent terminal and computer readable storage medium
CN110474683A (en) * 2019-08-08 2019-11-19 Oppo(重庆)智能科技有限公司 Communication means and device, electronic equipment, computer readable storage medium
CN110602739A (en) * 2019-09-08 2019-12-20 北京智明星通科技股份有限公司 Method and device for reducing mobile phone game pause and mobile terminal
CN110768903A (en) * 2019-10-28 2020-02-07 北京字节跳动网络技术有限公司 Method, device, terminal and storage medium for optimizing network connection
CN111050366A (en) * 2019-12-04 2020-04-21 路邦科技授权有限公司 Intelligent network automatic switching system and network switching method thereof
CN111083763A (en) * 2019-12-17 2020-04-28 Oppo广东移动通信有限公司 Network control method, network control device, storage medium and electronic equipment
CN111182595A (en) * 2019-12-30 2020-05-19 Oppo广东移动通信有限公司 Network switching method and device, storage medium and electronic equipment
CN111265852A (en) * 2020-01-08 2020-06-12 广东小天才科技有限公司 Low-delay information transmission method and device based on UDP (user Datagram protocol)
CN111414208A (en) * 2020-03-13 2020-07-14 百度在线网络技术(北京)有限公司 Application program starting method, device and equipment
CN112206507A (en) * 2020-10-19 2021-01-12 珠海金山网络游戏科技有限公司 Protocol processing method and device
CN112333690A (en) * 2020-11-13 2021-02-05 Oppo广东移动通信有限公司 Data transmission method, device, storage medium, terminal and network access point equipment
CN112717380A (en) * 2019-03-19 2021-04-30 Oppo广东移动通信有限公司 Network detection method and related device
CN112888048A (en) * 2019-11-29 2021-06-01 北京小米移动软件有限公司 Communication method and device, storage medium
CN113890905A (en) * 2021-06-16 2022-01-04 荣耀终端有限公司 Channel switching method, electronic device and storage medium
CN114827692A (en) * 2022-04-29 2022-07-29 深圳市瑞云科技有限公司 System for operating cloud desktop based on smart television
CN115002797A (en) * 2021-11-18 2022-09-02 荣耀终端有限公司 Network quality detection method and related electronic equipment
CN115250481A (en) * 2021-04-25 2022-10-28 中国联合网络通信集团有限公司 Method, terminal and storage medium for automatically adapting network according to business requirement
WO2022262398A1 (en) * 2021-06-16 2022-12-22 荣耀终端有限公司 Channel switching method, and electronic device and storage medium
WO2023087853A1 (en) * 2021-11-18 2023-05-25 荣耀终端有限公司 Network acceleration method, electronic device, chip system, and storage medium
RU2802678C1 (en) * 2021-06-16 2023-08-30 Хонор Девайс Ко., Лтд. Channel switching method, electronic device and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103916485A (en) * 2012-12-31 2014-07-09 北京新媒传信科技有限公司 Nat traversal method and server
CN105101316A (en) * 2015-07-10 2015-11-25 努比亚技术有限公司 Data transmission method and device for multi-data channel
CN105554831A (en) * 2016-01-28 2016-05-04 努比亚技术有限公司 Network switching device and method
CN105828455A (en) * 2016-01-28 2016-08-03 努比亚技术有限公司 Network connection device and method
EP3322217A1 (en) * 2015-07-07 2018-05-16 ZTE Corporation Wireless hotspot switching method, mobile terminal and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103916485A (en) * 2012-12-31 2014-07-09 北京新媒传信科技有限公司 Nat traversal method and server
EP3322217A1 (en) * 2015-07-07 2018-05-16 ZTE Corporation Wireless hotspot switching method, mobile terminal and storage medium
CN105101316A (en) * 2015-07-10 2015-11-25 努比亚技术有限公司 Data transmission method and device for multi-data channel
CN105554831A (en) * 2016-01-28 2016-05-04 努比亚技术有限公司 Network switching device and method
CN105828455A (en) * 2016-01-28 2016-08-03 努比亚技术有限公司 Network connection device and method

Cited By (31)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109474528A (en) * 2018-09-28 2019-03-15 Oppo广东移动通信有限公司 Communication connecting method, device, terminal device and computer-readable storage medium
CN109474528B (en) * 2018-09-28 2021-11-16 Oppo广东移动通信有限公司 Communication connection method, device, terminal equipment and computer readable storage medium
CN109362111A (en) * 2018-12-24 2019-02-19 上海连尚网络科技有限公司 Information cuing method
CN109743456A (en) * 2018-12-29 2019-05-10 Oppo广东移动通信有限公司 Data transmission method and relevant apparatus
CN112717380A (en) * 2019-03-19 2021-04-30 Oppo广东移动通信有限公司 Network detection method and related device
CN112717380B (en) * 2019-03-19 2023-04-07 Oppo广东移动通信有限公司 Network detection method and related device
CN110087270A (en) * 2019-05-15 2019-08-02 深圳市沃特沃德股份有限公司 A kind of method, apparatus of reading, storage medium and computer equipment
CN110087270B (en) * 2019-05-15 2021-09-17 深圳市沃特沃德信息有限公司 Reading method and device, storage medium and computer equipment
CN110267315A (en) * 2019-06-28 2019-09-20 南昌黑鲨科技有限公司 Network connection control method, system, intelligent terminal and computer readable storage medium
CN110474683A (en) * 2019-08-08 2019-11-19 Oppo(重庆)智能科技有限公司 Communication means and device, electronic equipment, computer readable storage medium
CN110474683B (en) * 2019-08-08 2021-06-25 Oppo(重庆)智能科技有限公司 Communication method and device, electronic equipment and computer readable storage medium
CN110602739A (en) * 2019-09-08 2019-12-20 北京智明星通科技股份有限公司 Method and device for reducing mobile phone game pause and mobile terminal
CN110768903A (en) * 2019-10-28 2020-02-07 北京字节跳动网络技术有限公司 Method, device, terminal and storage medium for optimizing network connection
CN112888048A (en) * 2019-11-29 2021-06-01 北京小米移动软件有限公司 Communication method and device, storage medium
CN111050366A (en) * 2019-12-04 2020-04-21 路邦科技授权有限公司 Intelligent network automatic switching system and network switching method thereof
CN111083763A (en) * 2019-12-17 2020-04-28 Oppo广东移动通信有限公司 Network control method, network control device, storage medium and electronic equipment
CN111083763B (en) * 2019-12-17 2021-05-25 Oppo广东移动通信有限公司 Network control method, network control device, storage medium and electronic equipment
CN111182595B (en) * 2019-12-30 2021-08-24 Oppo广东移动通信有限公司 Network switching method and device, storage medium and electronic equipment
CN111182595A (en) * 2019-12-30 2020-05-19 Oppo广东移动通信有限公司 Network switching method and device, storage medium and electronic equipment
CN111265852A (en) * 2020-01-08 2020-06-12 广东小天才科技有限公司 Low-delay information transmission method and device based on UDP (user Datagram protocol)
CN111414208A (en) * 2020-03-13 2020-07-14 百度在线网络技术(北京)有限公司 Application program starting method, device and equipment
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
CN112333690A (en) * 2020-11-13 2021-02-05 Oppo广东移动通信有限公司 Data transmission method, device, storage medium, terminal and network access point equipment
CN115250481A (en) * 2021-04-25 2022-10-28 中国联合网络通信集团有限公司 Method, terminal and storage medium for automatically adapting network according to business requirement
WO2022262398A1 (en) * 2021-06-16 2022-12-22 荣耀终端有限公司 Channel switching method, and electronic device and storage medium
CN113890905A (en) * 2021-06-16 2022-01-04 荣耀终端有限公司 Channel switching method, electronic device and storage medium
RU2802678C1 (en) * 2021-06-16 2023-08-30 Хонор Девайс Ко., Лтд. Channel switching method, electronic device and storage medium
CN115002797A (en) * 2021-11-18 2022-09-02 荣耀终端有限公司 Network quality detection method and related electronic equipment
WO2023087853A1 (en) * 2021-11-18 2023-05-25 荣耀终端有限公司 Network acceleration method, electronic device, chip system, and storage medium
CN114827692A (en) * 2022-04-29 2022-07-29 深圳市瑞云科技有限公司 System for operating cloud desktop based on smart television

Also Published As

Publication number Publication date
CN108449771B (en) 2020-08-11

Similar Documents

Publication Publication Date Title
CN108449771A (en) Method for switching network, device, terminal and storage medium
CN108834203A (en) Method for switching network, device, terminal and storage medium
CN110798869B (en) Network switching method, electronic equipment and chip subsystem
CN112291816B (en) Data transmission method, device, storage medium and electronic equipment
US20220150130A1 (en) Training method for application mos model, device, and system
CN103685356B (en) Game running implementation method based on cloud computing
CN108632945A (en) A kind of network slice selection method, user equipment and the network equipment
CN103685355B (en) A kind of online game operation implementation method based on cloud computing
CN107920122A (en) Game player's matching process, device, match server and readable storage medium storing program for executing
CN110049505A (en) Data transmission method and relevant apparatus
CN109474528A (en) Communication connecting method, device, terminal device and computer-readable storage medium
US20230412456A1 (en) Data communication method and apparatus, electronic device, and storage medium
CN105873122A (en) Wireless router WiFi signal strength display method and device, and wireless router
CN109831490A (en) Business access method and system
CN111527767B (en) Method and equipment for improving network performance
CN111586809B (en) Heterogeneous wireless network access selection method and system based on SDN
CN106020643A (en) Method and system for dynamically displaying user interface of mobile terminal network game
CN109847340B (en) Information processing method, device, equipment and medium
CN112999651B (en) Data processing method based on cloud game and related equipment
CN107786557B (en) Team game acceleration method and related product
CN112400350B (en) User interface UI display control method and device
CN109304035B (en) Game time length obtaining method and device, terminal equipment and storage medium
CN109529332A (en) A kind of scene of game motion state switching method, device, server and terminal
CN104935571B (en) A kind of exchange method of video game server-side and client
CN116846771A (en) Service operation method, device, terminal and readable storage medium

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