CN108449771B - Network switching method, device, terminal and storage medium - Google Patents

Network switching method, device, terminal and storage medium Download PDF

Info

Publication number
CN108449771B
CN108449771B CN201810698043.XA CN201810698043A CN108449771B CN 108449771 B CN108449771 B CN 108449771B CN 201810698043 A CN201810698043 A CN 201810698043A CN 108449771 B CN108449771 B CN 108449771B
Authority
CN
China
Prior art keywords
network
network connection
data
application program
test result
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810698043.XA
Other languages
Chinese (zh)
Other versions
CN108449771A (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

Images

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

Abstract

The embodiment of the application discloses a network switching method, a device, a terminal and a storage medium, belonging to the field of network connection, wherein the method comprises the following steps: establishing a first network connection and a second network connection, wherein the network connection modes of the first network connection and the second network connection are different; transmitting network data of the game application program through a first network connection; performing network quality test on the first network connection and the second network connection to obtain a network quality test result; and if the network quality test result indicates that the quality of the second network connection is better than that of the first network connection, switching to use the second network connection to transmit the network data of the game application program. The whole network switching process is automatically executed by the terminal, so that the network switching process is simplified; the network data transmission is not influenced in the network switching process, the phenomenon of pause in the switching process is avoided, and seamless switching between networks is realized.

Description

Network switching method, device, terminal and storage medium
Technical Field
The present disclosure relates to the field of network connection, and in particular, to a network switching method, an apparatus, a terminal, and a storage medium.
Background
Wireless Fidelity (WiFi) network connection and mobile data network connection are two common network connection methods used in a terminal.
When the terminal is in the coverage range of the WiFi network, a user can start the WiFi connection function of the terminal and access the WiFi network to perform network access; if the current network accessing the WiFi network is not good, the user can manually close the WiFi connection function, so that the terminal can switch to use the mobile data network for network access.
Disclosure of Invention
The embodiment of the application provides a network switching method, a network switching device, a terminal and a storage medium, which can be used for solving the problems that when a user manually switches a network connection mode, the switching process is complicated, and data transmission is interrupted in the switching process. The technical scheme is as follows:
in one aspect, a network handover method is provided, where the method includes:
establishing a first network connection and a second network connection, wherein the network connection modes of the first network connection and the second network connection are different;
transmitting network data of the game application program through the first network connection;
performing network quality test on the first network connection and the second network connection to obtain a network quality test result;
and if the network quality test result indicates that the quality of the second network connection is better than that of the first network connection, switching to use the second network connection to transmit the network data of the game application program.
In another aspect, a network switching apparatus is provided, the apparatus including:
the device comprises an establishing module, a judging module and a judging module, wherein the establishing module is used for establishing a first network connection and a second network connection, and the network connection modes of the first network connection and the second network connection are different;
the transmission module is used for connecting and transmitting network data of the game application program through the first network;
the test module is used for carrying out network quality test on the first network connection and the second network connection to obtain a network quality test result;
and the switching module is used for switching to transmit the network data of the game application program by using the second network connection when the network quality test result indicates that the quality of the second network connection is better than that of the first network connection.
In another aspect, a terminal is provided, where the terminal includes a processor and a memory, where the memory stores at least one instruction, and the instruction is loaded and executed by the processor to implement the network handover method according to the above aspect.
In another aspect, a computer-readable storage medium is provided, in which at least one instruction is stored, the instruction being loaded and executed by a processor to implement the network switching method according to the above aspect.
The beneficial effects brought by the technical scheme provided by the embodiment of the application at least comprise:
establishing dual-channel network connection by adopting different network connection modes, transmitting network data of the game application program by utilizing one network connection, and further automatically switching to transmit the network data of the game application program by using the other network connection when the network quality of the current network connection is not better than that of the other network connection; the whole network switching process is automatically executed by the terminal, manual switching by a user is not needed, and the network switching process is simplified; meanwhile, two network connection paths are pre-established, so that the network data transmission is not influenced in the network switching process, the phenomenon of pause in the switching process is avoided, and the seamless switching between networks is realized.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 illustrates an environmental schematic of an implementation environment provided by an exemplary embodiment of the present application;
fig. 2 is a flowchart illustrating a network handover method according to an exemplary embodiment of the present application;
fig. 3 is a flowchart illustrating a network handover method according to another exemplary embodiment of the present application;
FIG. 4 is a schematic diagram of an interface for prompting a user to open a mobile data network;
fig. 5 is a flowchart illustrating a network handover method according to another exemplary embodiment of the present application;
FIG. 6 is a schematic diagram of an interface for prompting a user to currently use a mobile data network;
fig. 7 is a block diagram illustrating a network switching apparatus according to an exemplary embodiment of the present application;
fig. 8 shows a block diagram of a terminal according to an exemplary embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
In the description of the present application, "plurality" means two or more unless otherwise specified. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
Referring to fig. 1, an environment diagram of an implementation environment provided by an exemplary embodiment of the present application is shown, where the implementation environment includes a terminal 110 and a server 120.
The terminal 110 is an electronic device having a WiFi network connection and a mobile data network connection function. The mobile data network may be a third Generation mobile communication technology (3rd-Generation, 3G) network, a fourth Generation mobile communication technology (4th-Generation, 4G) network, a Long Term Evolution (LTE) network, a fifth Generation mobile communication technology (5th-Generation, 5G) network, or the like.
When the terminal 110 starts the WiFi network connection function, the terminal 110 may search for a nearby WiFi network and perform internet access by accessing the WiFi network; when the mobile data network connection function is turned on, the terminal 110 can perform internet access through the mobile data network. The WiFi network connection function and the mobile data network connection function can be started simultaneously.
In addition, at least one application is installed in the terminal 110, and the at least one application requires internet access, and the application may be an instant messaging application, an email application, a social application, a video playing application, a browser application, a game application, a news reading application, and the like.
The terminal 110 is connected to the server 120 through a WiFi network or a mobile data network.
The server 120 is a server, a server cluster formed by a plurality of servers, or a cloud computing center. In this embodiment, the server 120 is a background server of the game application program in the terminal 110. In the running process of the game application program, the game data of the local terminal is sent to the server 110, and the game data sent by other game application programs sent by the server 110 is received, so that the multiplayer online game is realized. The game application program can be: at least one of a policy-like massively multiplayer online game application MMOSLG, an adventure-like massively multiplayer online game application MMOAVG, a simulation-like massively multiplayer online game application MMOSG, a sports-like massively multiplayer online game application MMOSPT, a racing-like massively multiplayer online game application MMORCG, and a role-playing massively multiplayer online game application MMORPG.
In a possible application scenario, as shown in fig. 1, after the terminal 110 starts the game application, two paths of the WiFi network connection and the mobile data network connection are simultaneously established, and game data transmission is performed with the server 120 through one of the paths. In the running process of the game application program, the terminal 110 tests the two paths, and determines the quality of the two paths according to the test result, thereby determining to continue using the current network or switching the network.
Optionally, the implementation environment may further include a target server, and the terminal 110 accesses the target server through the established network connection, so as to obtain the quality of each network connection, and further determine whether network handover is required.
The following embodiments are described by taking an example in which the network handover method is applied to the terminal 110 in fig. 1.
Referring to fig. 2, a flowchart of a network handover method according to an exemplary embodiment of the present application is shown. The present embodiment is illustrated by applying the method to the terminal 110 in fig. 1. The method comprises the following steps:
step 201, a first network connection and a second network connection are established, and the network connection modes of the first network connection and the second network connection are different.
Optionally, the network connection mode is one of a WiFi network connection and a mobile data network connection, that is, when the first network connection is a WiFi network connection, the second network connection is a mobile data network connection; when the first network connection is a mobile data network connection, the second network connection is a WiFi network connection.
When the WiFi network connection is established, the terminal needs to start the WiFi network connection function and is within the WiFi network signal coverage range; when the mobile data network connection is established, the terminal needs to start the mobile data network connection function and is within the coverage range of the base station signal.
In a possible implementation mode, when the game application program is detected to be started, the terminal establishes a WiFi network connection and a mobile data network connection dual-channel at the same time; when the starting of the non-game application program is detected, the terminal only establishes WiFi network connection or mobile data network connection.
In other possible embodiments, the terminal establishes the first network connection and the second network connection when any application program needing to be connected to the network is started.
Step 202, network data of the game application program is transmitted through the first network connection.
After establishing a WiFi network connection and a mobile data network connection double channel, the terminal sends network data generated in the running process of the game application program to the server through one of the network connections, and receives the network data sent to the game application program by the server through the network connection. Wherein, the game application program is in a foreground running state.
In one possible implementation, when a WiFi network connection and a mobile data network connection are established simultaneously and the WiFi network connection is available (internet access is available), the terminal defaults to transmitting network data over the WiFi network connection.
Step 203, performing network quality test on the first network connection and the second network connection to obtain a network quality test result.
In the running process of the game application program (namely in the process of using the first network connection for data transmission), the terminal performs network quality test on the first network connection and the second network connection, so as to obtain a network quality test result indicating the network quality.
In a possible implementation manner, the terminal periodically accesses the specified server by using each established network connection, so as to obtain a network quality test result corresponding to each network connection.
Optionally, the network quality test result includes at least one of delay and packet loss rate, and the embodiment of the present application does not limit specific parameters included in the network quality test result.
And step 204, if the network quality test result indicates that the quality of the second network connection is better than that of the first network connection, switching to use the second network connection to transmit the network data of the game application program.
According to the network quality test result, the terminal detects whether the quality of the first network connection is superior to that of the second network connection, if so, the terminal determines that the network does not need to be switched, continues to transmit network data through the first network connection, and continues to perform the network quality test; if the quality of the second network connection is better than that of the first network connection, the terminal determines that the current network condition is not good and performs network switching, so that the second network connection is used for transmitting the network data of the game application program, and the running quality of the game application program is ensured.
It should be noted that, after the network switching is completed, the terminal still maintains the first network connection, and at the initial stage of the network switching, the terminal connects the network data sent by the server through the first network; after the terminal subsequently transmits network data to the server via the second network connection, the server will also transmit network data to the terminal via the second network connection (the IP addresses of the first network connection and the second network connection are different).
Optionally, after the network switching is completed, the terminal continues to perform the network quality test, and performs real-time network switching according to the network quality test result, so as to ensure that the terminal accesses a network with better quality.
By adopting the method, when the terminal runs the game application program with higher network quality requirement, the network can be dynamically switched according to the quality of different network connections, so that the game application program can be ensured to run under the network connection with better quality, and the running quality of the game application program can be improved.
To sum up, in the embodiment of the present application, a dual-channel network connection is established by using different network connection modes, and one of the network connections is used to transmit network data of a game application program, so that when the network quality of the current network connection is inferior to that of the other network connection, the other network connection is automatically switched to transmit the network data of the game application program; the whole network switching process is automatically executed by the terminal, manual switching by a user is not needed, and the network switching process is simplified; meanwhile, two network connection paths are pre-established, so that the network data transmission is not influenced in the network switching process, the phenomenon of pause in the switching process is avoided, and the seamless switching between networks is realized.
The network data transmitted between the game-like application and the server usually includes User Datagram Protocol (UDP) data and Transmission Control Protocol (TCP) data, where the UDP data usually includes data with a high requirement on Transmission delay, such as Control instructions in the game, and the TCP data usually includes data with a high requirement on Transmission reliability, such as login information in the game. Since the transmission of the TCP data depends on the TCP connection established between the terminal and the server, and the connection is disconnected due to the re-establishment of the TCP connection, in order to further reduce the influence of the network switch on the game application, the terminal only switches the UDP data to the network connection with better quality for transmission, and the following description uses an exemplary embodiment.
Referring to fig. 3, a flowchart of a network handover method according to another exemplary embodiment of the present application is shown. The present embodiment is illustrated by applying the method to the terminal 110 in fig. 1. The method comprises the following steps:
step 301, determining whether the foreground application program belongs to the game application program according to the application package name of the foreground application program.
In the embodiment of the application, when the terminal starts a game application program with higher requirements on network quality (for example, low delay and low packet loss rate are required), the terminal starts an intelligent network switching function. Therefore, for the foreground application currently running in the foreground, the terminal acquires the application package name (packagemame) of the foreground application, so that whether the foreground application belongs to the game application or not is determined according to the application package name. The foreground application program refers to an application program which is switched from a background to a foreground for running, or an application program which is directly started in the foreground.
In a possible implementation mode, the terminal acquires a target game application program which is set by a user and needs to enable intelligent network switching, and stores a target application package name of the target game application program. When detecting that the foreground application program exists subsequently, the terminal detects whether the application package name of the foreground application program belongs to the target application package name, and if so, determines that the foreground application program belongs to the game application program, and executes step 302; otherwise, the foreground application is determined not to belong to the game application.
Optionally, in order to ensure that intelligent network switching can be realized when the game application program is run, if the foreground application program belongs to the game application program and the first network connection function is not started, the terminal displays second prompt information, where the second prompt information is used for prompting the start of the first network connection function; and if the foreground application program belongs to the game application program and the second network connection function is not started, displaying third prompt information, wherein the third prompt information is used for prompting the start of the second network connection function.
Illustratively, as shown in fig. 4, when the terminal detects that the WiFi network connection function is turned on but the mobile data network connection function is not turned on, a prompt message is displayed through the Toast message box 41. When the user clicks the setting button 42 in the Toast message box 41, the terminal jumps to display the mobile data network setting interface, so that the user can start the mobile data network connection function.
Step 302, if the foreground application program belongs to the game application program, establishing a first network connection and a second network connection.
The method for establishing the first network connection and the second network connection by the terminal may refer to step 201, which is not described herein again in this embodiment.
Step 303, transmitting the network data of the game application program through the first network connection.
The step 202 may be referred to in the implementation manner of this step, and this embodiment is not described herein again.
In a possible implementation manner, during the operation of the game application program in the foreground, the terminal simultaneously performs network quality test on the first network connection and the second network connection, and performs network switching when the quality of the second network connection is better than that of the first network connection.
In another possible implementation, in order to avoid frequent network handover and reduce the resources consumed in the network quality test, the terminal performs the network quality test through steps 304 to 306 described below.
Step 304, accessing the target server through the first network connection to obtain a first network quality test result, where the first network quality test result includes at least one of delay and packet loss rate.
The terminal periodically accesses the target server through the first network connection while transmitting the network data of the game application program through the first network connection, so that a first network quality test result including delay and packet loss rate is obtained. Wherein a lower delay and/or a lower packet loss rate indicates a better quality of the network connection.
In one possible embodiment, the terminal periodically pings the target domain name (corresponding to the target server) to calculate the delay and packet loss rate of the first network connection based on the response result of the target server. The embodiment of the present application does not limit the manner of measuring the delay and the packet loss rate.
Optionally, for different types of network connections, the period of the terminal accessing the target server is also different. When the first network connection is WiFi network connection, the terminal accesses the target server through the first network connection at intervals of a first time interval to obtain a first network quality test result; and when the first network connection is the mobile data network connection, the terminal accesses the target server through the first network connection at intervals of a second time interval to obtain a first network quality test result. The probability of network fluctuation of the WiFi network connection is higher, so the first time interval is smaller than the second time interval, that is, when the WiFi network connection is used to transmit network data, the frequency of the terminal performing the network quality test is higher. For example, the first time interval is 1s, and the second time interval is 2 s.
Step 305, if the first network quality test result does not reach the target test result, accessing the target server through the second network connection to obtain a second network quality test result, where the second network quality test result includes at least one of delay and packet loss rate.
In a possible implementation manner, a target test result is preset in the terminal, and the target test result includes at least one of a target delay and a target packet loss rate, where the target delay and the target packet loss rate are minimum indexes that the game application program needs to meet when running normally. For example, the target delay is 100ms, and the target packet loss rate is 10%.
Since the requirements of different types of games on the network quality may be different, optionally, the parameters included in the target test result are different for different types of game applications. For example, in a target test result corresponding to a First-person shooter (FPS) game, the target delay is 50ms, and the target packet loss rate is 10%, whereas in a target test result corresponding to a Multiplayer Online Battle Arena (MOBA) game, the target delay is 100ms, and the target packet loss rate is 10%.
After obtaining the first network quality test result, the terminal detects whether the first network quality test result reaches the target test result, if so, it is determined that network switching is not needed, and the network quality test is continued through the step 304; if not, the terminal further accesses the target server through the second network connection, so that a second network quality test result is obtained.
Optionally, when the delay is higher than the target delay, or/and the packet loss rate is higher than the target packet loss rate, the terminal determines that the first network quality test result does not reach the target test result.
The step 304 may be referred to in the process of testing the second network connection, and this embodiment is not described herein again.
Step 306, if the second network quality test result is better than the first network quality test result, determining that the quality of the second network connection is better than the quality of the first network connection.
Further, the terminal determines whether the quality of the second network connection is due to the quality of the first network connection by comparing the second network quality test result with the first network quality test result. If the quality of the second network connection is better than the quality of the first network connection, the terminal performs step 307, where if the quality of the first network connection is better than the quality of the second network connection, the terminal determines that network handover is not required and continues to perform the network quality test through step 304.
In one possible embodiment, the terminal determines that the quality of the second network connection is better than the quality of the first network connection when the delay of the second network connection is lower than the delay of the first network connection and/or the packet loss rate of the second network connection is lower than the packet loss rate of the first network connection.
When the network connection test is carried out by adopting the steps 304 to 306, the frequent network switching is avoided by setting a target test result under the condition that the connection quality of the two networks is better; meanwhile, the terminal performs quality test on the second network connection only under the condition that the quality of the first network connection is poor, so that resources consumed during network quality test are further reduced.
Step 307, if the network quality test result indicates that the quality of the second network connection is better than the quality of the first network connection, identifying the network data of the game application according to the UID of the game application.
In order to accurately switch the network data corresponding to the game application program to the second network connection with better quality, the terminal needs to identify the network data of the game application program according to the Unique Identifier (UID) of the game application program. The embodiment of the application also limits the specific mode of identifying the network data corresponding to the specified application program.
In step 308, UDP data and TCP data in the network data are identified.
The network data transmitted by the game application program may include UDP data and TCP data. The UDP is a connectionless transport protocol, so switching network connections does not affect the transmission of UDP data; TCP is a transmission protocol based on connection, when a network is switched, the existing TCP connection needs to be disconnected firstly, and then a new TCP connection is reestablished, so that the switching of the network connection can affect the transmission of TCP data, and further the problems of pause, disconnection and reconnection of game pictures and the like in the network switching process are caused.
In order to avoid the above problem during network switching, after the network data of the game application program is identified, the terminal needs to further identify UDP data and TCP data therein.
In one possible embodiment, the terminal identifies UDP data and TCP data according to a protocol identifier field (identifying the protocol number of the protocol following the header), where the protocol number of UDP data is 17 and the protocol number of TCP data is 6.
Step 309, transmitting the TCP data in the network data through the first network connection.
For TCP data in network data, in order to avoid the problems of jamming, disconnection, reconnection and the like caused by reestablishing the TCP connection when the TCP data is switched to a second network connection for transmission, the terminal still transmits the TCP data through the first network connection.
Accordingly, the terminal continues to receive the TCP data transmitted by the server through the first network connection.
In step 310, the second network connection is switched to be used for transmitting UDP data in the network data.
For the UDP data in the network data, in order to improve the running quality of the game application program, the terminal switches the UDP data to the second network connection for transmission, so that the transmission delay and the packet loss rate of the UDP data of the game application program are reduced.
Accordingly, the terminal subsequently receives the UDP data sent by the server via the second network connection. It should be noted that, in the initial stage of network switching, since the server still transmits UDP data to the terminal through the first network connection, the terminal receives UDP data through the first network connection and the second network connection at the same time in the initial stage of network switching, and stops receiving UDP data through the first network connection when UDP data is successively received through the second network.
In this embodiment, when the quality of the second network connection is the quality of the currently used first network connection, the terminal identifies the network data of the game application through the UID, switches the UDP data in the second network connection transmission network data, and still uses the TCP data in the first network connection transmission network data, thereby avoiding the problems of game stutter, disconnection reconnection, and the like caused by TCP reconnection, and reducing the influence of network switching on the game application program.
In addition, in the embodiment, the terminal performs quality test on the second network connection only under the condition that the quality of the first network connection is poor, so that resources consumed during network quality test are further reduced; meanwhile, the terminal avoids frequently switching the network under the condition that the connection quality of the two networks is better by setting a target test result.
In addition, in the embodiment, the terminal establishes the dual connection path only when the foreground application is a game application with a high network quality requirement, so that intelligent network switching is realized, and resource waste caused by establishing the dual connection path for a low network quality requirement is avoided.
In a possible application scenario, the terminal transmits network data through the WiFi network connection currently, but due to fluctuation of the WiFi network, the terminal switches the mobile data network with better network quality to transmit the network data, and traffic is generated when the network data is transmitted through the mobile data network. In order to remind the user of traffic generated when the game application is running, in a possible embodiment, when the first network connection is a WiFi network connection and the second network connection is a mobile data network connection, on the basis of fig. 3, as shown in fig. 5, the following step is further included after step 310.
Step 311, obtaining the data volume of the data transmitted by the game application program through the second network connection.
When switching to the mobile data network to transmit network data (UDP data), the terminal counts the data volume of the game application program transmitting data through the mobile data network connection in real time.
In step 312, if the data amount is greater than the threshold, a first prompt message is displayed, where the first prompt message is used to prompt the game application program to consume the mobile data network traffic.
Optionally, the threshold is set by a user, or the threshold is determined by the terminal according to the remaining flow. For example, the threshold is 10MB, or the threshold is 10% of the remaining flow.
The terminal detects whether the data volume reaches a threshold value or not, and displays first prompt information when the data volume reaches the threshold value so as to provide that the user game application program is consuming the mobile data network flow at present.
Illustratively, as shown in fig. 6, when the data amount is larger than the threshold, the terminal displays a prompt box 43 to prompt the user that the mobile data network is currently being used.
Optionally, when the data amount is greater than the threshold, the terminal automatically switches to use the WiFi data network for connecting and transmitting the network data, displays corresponding fourth prompt information, queries the user whether to switch to use the mobile data network, and automatically switches to connect the mobile data network when receiving a confirmation instruction.
In this embodiment, when the mobile data network is intelligently switched to use, the terminal detects the traffic consumed by the game application program and prompts the user when the consumed traffic is large, so as to avoid extra traffic cost caused by too much mobile data network traffic consumed by the game application program.
The following are embodiments of the apparatus of the present application that may be used to perform embodiments of the method of the present application. For details which are not disclosed in the embodiments of the apparatus of the present application, reference is made to the embodiments of the method of the present application.
Referring to fig. 7, a block diagram of a network switching device according to an exemplary embodiment of the present application is shown. The device includes:
an establishing module 710, configured to establish a first network connection and a second network connection, where network connection manners of the first network connection and the second network connection are different;
a transmission module 720, configured to transmit network data of the game application through the first network connection;
a testing module 730, configured to perform a network quality test on the first network connection and the second network connection to obtain a network quality test result;
the switching module 740 is configured to switch to transmit the network data of the game application using the second network connection when the network quality test result indicates that the quality of the second network connection is better than the quality of the first network connection.
Optionally, the switching module 740 includes:
the first identification unit is used for identifying the network data of the game application program according to the UID of the game application program;
the second identification unit is used for identifying User Datagram Protocol (UDP) data and Transmission Control Protocol (TCP) data in the network data;
a transmission unit, configured to transmit TCP data in the network data through the first network connection;
and the switching unit is used for switching to transmit the UDP data in the network data by using the second network connection.
Optionally, the first network connection is a WiFi network connection, and the second network connection is a mobile data network connection;
the device further comprises:
the acquisition module is used for acquiring the data volume of the data transmitted by the game application program through the second network connection;
and the first display module is used for displaying first prompt information if the data volume is larger than a threshold value, wherein the first prompt information is used for prompting the game application program to consume the mobile data network flow.
Optionally, the testing module 730 includes:
a first access unit, configured to access a target server through the first network connection to obtain a first network quality test result, where the first network quality test result includes at least one of delay and packet loss rate;
a second access unit, configured to access the target server through the second network connection to obtain a second network quality test result if the first network quality test result does not reach the target test result, where the second network quality test result includes at least one of delay and packet loss rate;
a first determining unit, configured to determine that the quality of the second network connection is better than the quality of the first network connection if the second network quality test result is better than the first network quality test result.
Optionally, the network connection mode is one of a WiFi network connection and a mobile data network connection, and the first access unit is configured to:
if the first network connection is the WiFi network connection, accessing the target server through the first network connection at intervals of a first time interval to obtain a first network quality test result;
if the first network connection is the mobile data network connection, accessing the target server through the first network connection at intervals of a second time interval to obtain a first network quality test result;
wherein the first time interval is less than the second time interval.
Optionally, the establishing module 710 includes:
the second determining unit is used for determining whether the foreground application program belongs to the game application program according to the application package name of the foreground application program;
and the establishing unit is used for establishing the first network connection and the second network connection if the foreground application program belongs to the game application program.
Optionally, the apparatus further comprises:
the second display module is used for displaying second prompt information if the foreground application program belongs to the game application program and the first network connection function is not started, wherein the second prompt information is used for prompting the starting of the first network connection function;
and the third display module is used for displaying third prompt information if the foreground application program belongs to the game application program and a second network connection function is not started, wherein the third prompt information is used for prompting the start of the second network connection function.
To sum up, in the embodiment of the present application, a dual-channel network connection is established by using different network connection modes, and one of the network connections is used to transmit network data of a game application program, so that when the network quality of the current network connection is inferior to that of the other network connection, the other network connection is automatically switched to transmit the network data of the game application program; the whole network switching process is automatically executed by the terminal, manual switching by a user is not needed, and the network switching process is simplified; meanwhile, two network connection paths are pre-established, so that the network data transmission is not influenced in the network switching process, the phenomenon of pause in the switching process is avoided, and the seamless switching between networks is realized.
It should be noted that, when the device provided in the foregoing embodiment implements the functions thereof, only the division of the functional modules is illustrated, and in practical applications, the functions may be distributed by different functional modules according to needs, that is, the internal structure of the terminal may be divided into different functional modules to implement all or part of the functions described above. In addition, the apparatus and method embodiments provided by the above embodiments belong to the same concept, and specific implementation processes thereof are described in the method embodiments for details, which are not described herein again.
Referring to fig. 8, a block diagram of a terminal according to an exemplary embodiment of the present application is shown. The terminal includes a processor 1010, a memory 1020, and a display 1030.
Processor 1010 may be a Central Processing Unit (CPU), a Network Processor (NP), or a combination of a CPU and an NP. The processor 1010 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a Programmable Logic Device (PLD), or a combination thereof. The PLD may be a Complex Programmable Logic Device (CPLD), a field-programmable gate array (FPGA), a General Array Logic (GAL), or any combination thereof.
The memory 1020 is connected to the processor 1010 through a bus or other means, and at least one instruction, at least one program, a set of codes, or a set of instructions is stored in the memory 1020, and is loaded and executed by the processor 1010 to implement the user interface display method according to the above embodiments. The memory 1020 may be a volatile memory (volatile memory), a non-volatile memory (non-volatile memory), or a combination thereof. The volatile memory may be a random-access memory (RAM), such as a Static Random Access Memory (SRAM) or a Dynamic Random Access Memory (DRAM). The non-volatile memory may be a Read Only Memory (ROM), such as a Programmable Read Only Memory (PROM), an Erasable Programmable Read Only Memory (EPROM), an Electrically Erasable Programmable Read Only Memory (EEPROM). The non-volatile memory may also be a flash memory, a magnetic memory, such as a magnetic tape, a floppy disk, or a hard disk. The non-volatile memory may also be an optical disc.
The display screen 1030 is coupled to the processor 1010 via a bus or other means. The memory 1020 stores at least one instruction that is loaded and executed by the processor 1010 to implement the network switching method as described in the various embodiments above.
The embodiment of the present application further provides a computer-readable medium, where at least one instruction is stored, and the at least one instruction is loaded and executed by the processor to implement the network handover method according to the above embodiments.
The embodiment of the present application further provides a computer program product, where at least one instruction is stored, and the at least one instruction is loaded and executed by the processor to implement the network handover method according to the above embodiments.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (9)

1. A method for network handover, the method comprising:
establishing a first network connection and a second network connection, wherein the network connection modes of the first network connection and the second network connection are different;
transmitting network data of the game application program through the first network connection;
performing network quality test on the first network connection and the second network connection to obtain a network quality test result;
if the network quality test result indicates that the quality of the second network connection is better than the quality of the first network connection, identifying network data of the game application according to the unique identifier UID of the game application;
identifying User Datagram Protocol (UDP) data and Transmission Control Protocol (TCP) data in the network data;
transmitting TCP data in the network data over the first network connection;
switching to use the second network connection to transmit UDP data in the network data.
2. The method of claim 1, wherein the first network connection is a WiFi network connection and the second network connection is a mobile data network connection;
after the switching uses the second network connection to transmit the UDP data in the network data, the method further includes:
acquiring the data volume of the data transmitted by the game application program through the second network connection;
and if the data volume is larger than a threshold value, displaying first prompt information, wherein the first prompt information is used for prompting the game application program to consume the mobile data network flow.
3. The method according to claim 1 or 2, wherein the performing network quality testing on the first network connection and the second network connection to obtain a network quality testing result comprises:
accessing a target server through the first network connection to obtain a first network quality test result, wherein the first network quality test result comprises at least one of delay and packet loss rate;
if the first network quality test result does not reach a target test result, accessing the target server through the second network connection to obtain a second network quality test result, wherein the second network quality test result comprises at least one of delay and packet loss rate;
and if the second network quality test result is better than the first network quality test result, determining that the quality of the second network connection is better than the quality of the first network connection.
4. The method of claim 3, wherein the network connection is one of a WiFi network connection and a mobile data network connection;
the accessing a target server through the first network connection to obtain a first network quality test result includes:
if the first network connection is the WiFi network connection, accessing the target server through the first network connection at intervals of a first time interval to obtain a first network quality test result;
if the first network connection is the mobile data network connection, accessing the target server through the first network connection at intervals of a second time interval to obtain a first network quality test result;
wherein the first time interval is less than the second time interval.
5. The method of claim 1 or 2, wherein establishing the first network connection and the second network connection comprises:
determining whether a foreground application program belongs to the game application program or not according to the application package name of the foreground application program;
and if the foreground application program belongs to the game application program, establishing the first network connection and the second network connection.
6. The method of claim 3, wherein after determining whether the foreground application belongs to the game class application according to the application package name, the method further comprises:
if the foreground application program belongs to the game application program and the first network connection function is not started, displaying second prompt information, wherein the second prompt information is used for prompting the starting of the first network connection function;
and if the foreground application program belongs to the game application program and the second network connection function is not started, displaying third prompt information, wherein the third prompt information is used for prompting the start of the second network connection function.
7. A network switching device is characterized by comprising an establishing module, a transmission module, a test module and a switching module, wherein the switching module comprises a first identification unit, a second identification unit, a transmission unit and a switching unit;
the establishing module is used for establishing a first network connection and a second network connection, and the network connection modes of the first network connection and the second network connection are different;
the transmission module is used for connecting and transmitting network data of the game application program through the first network;
the test module is used for carrying out network quality test on the first network connection and the second network connection to obtain a network quality test result;
the first identification unit is used for identifying the network data of the game application program according to the UID of the game application program when the network quality test result indicates that the quality of the second network connection is better than that of the first network connection;
the second identification unit is configured to identify user datagram protocol UDP data and transmission control protocol TCP data in the network data;
the transmission unit is used for transmitting TCP data in the network data through the first network connection;
the switching unit is configured to switch to transmit UDP data in the network data using the second network connection.
8. A terminal, characterized in that the terminal comprises a processor and a memory, the memory having stored therein at least one instruction, the instruction being loaded and executed by the processor to implement the network switching method according to any one of claims 1 to 6.
9. A computer-readable storage medium having stored thereon at least one instruction which is loaded and executed by a processor to implement the network handover method of any one of claims 1 to 6.
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 CN108449771A (en) 2018-08-24
CN108449771B true 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)

Families Citing this family (23)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
CN109743456B (en) * 2018-12-29 2021-03-12 Oppo广东移动通信有限公司 Data transmission method and related device
CN112717380B (en) * 2019-03-19 2023-04-07 Oppo广东移动通信有限公司 Network detection method and related device
CN110087270B (en) * 2019-05-15 2021-09-17 深圳市沃特沃德信息有限公司 Reading method and device, storage medium and computer equipment
CN110267315B (en) * 2019-06-28 2021-03-09 南昌黑鲨科技有限公司 Network connection control method, system, intelligent terminal and 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
CN112888048B (en) * 2019-11-29 2023-04-28 北京小米移动软件有限公司 Communication method and device and storage medium
CN111050366A (en) * 2019-12-04 2020-04-21 路邦科技授权有限公司 Intelligent network automatic switching system and network switching method thereof
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
CN111265852A (en) * 2020-01-08 2020-06-12 广东小天才科技有限公司 Low-delay information transmission method and device based on UDP (user Datagram protocol)
CN111414208B (en) * 2020-03-13 2023-08-01 百度在线网络技术(北京)有限公司 Application program starting method, device and equipment
CN112206507B (en) * 2020-10-19 2023-02-17 珠海金山数字网络科技有限公司 Protocol processing method and device
CN112333690B (en) * 2020-11-13 2022-08-16 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
CN113890905B (en) * 2021-06-16 2022-11-22 荣耀终端有限公司 Channel switching method, electronic device and storage medium
CN113795040B (en) * 2021-06-16 2022-10-18 荣耀终端有限公司 Channel switching method, electronic device and storage medium
CN116405960B (en) * 2021-11-18 2024-03-29 荣耀终端有限公司 Network quality detection method and related electronic equipment
CN116137676B (en) * 2021-11-18 2023-10-20 荣耀终端有限公司 Network acceleration method, electronic equipment, chip system and storage medium
CN114827692A (en) * 2022-04-29 2022-07-29 深圳市瑞云科技有限公司 System for operating cloud desktop based on smart television

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

Also Published As

Publication number Publication date
CN108449771A (en) 2018-08-24

Similar Documents

Publication Publication Date Title
CN108449771B (en) Network switching method, device, terminal and storage medium
CN108834203B (en) Network switching method, device, terminal and storage medium
CN112291816B (en) Data transmission method, device, storage medium and electronic equipment
US20220360645A1 (en) Dynamic Service Discovery and Offloading Framework for Edge Computing Based Cellular Network Systems
CN110333947B (en) Method, device, equipment and medium for loading subcontracting resources of game application
CN107534930B (en) Recommendation method of Wi-Fi hot spot, terminal and graphical user interface
WO2018058636A1 (en) Method and device for transmitting response message
EP3099111A1 (en) Data processing method, device and system
CN104584490A (en) Data transmitting method and device
EP3783957B1 (en) Transmission path switching method, computer-readable storage medium and device
CN108966331B (en) Cell registration method, cell registration device, wireless routing equipment, terminal and storage medium
US20150373126A1 (en) Method, apparatus and system for interactive data exchange
CN111093182B (en) Network optimal resource selection system for CPE (customer premises equipment)
CN107249136A (en) Method for connecting network and device
US20160119242A1 (en) Method and Device for Processing a Call, and Terminal
CN111884875A (en) Offline device determination method and device
CN112999651B (en) Data processing method based on cloud game and related equipment
CN111093238B (en) Wireless network control method and device, storage medium and electronic equipment
CN114125942A (en) Network resource management method, device, terminal and storage medium
CN107566215B (en) Wireless network cutout detection method, device, storage medium and mobile terminal
CN109304035B (en) Game time length obtaining method and device, terminal equipment and storage medium
CN110251943B (en) Game player matching method, device, equipment and storage medium
CN110177105B (en) Media file monitoring method, device and system, storage medium and processor
CN108990039B (en) Data transmission method and related device
CN114765603A (en) Screen sharing method of mobile terminal, mobile terminal and 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