Network switching method and apparatus, terminal device, and storage medium
By detecting network quality before application launch and switching networks when it falls below requirements, the problem of inappropriate network switching timing is solved, thus improving the internet experience of terminal devices.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-16
- Publication Date
- 2026-03-20
AI Technical Summary
In existing technologies, improper timing of network switching by terminal devices leads to a poor network user experience, especially when the Wi-Fi network is unstable, as network switching affects the internet browsing experience.
After detecting the launch command of the first application, the terminal device checks the network quality during the time period before the first application completes its launch, and switches the current network to the second network when the network quality is lower than the first quality requirement, so as to avoid the network switching too early or too late.
By choosing the right time to switch networks, the internet experience is improved, lag and instability caused by network switching are avoided, and network quality is ensured to meet requirements when applications start.
Smart Images

Figure CN115811769B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of communication, in particular to a network switching method and device, a terminal device and a storage medium. BACKGROUND
[0002] At present, in the use process of a terminal device, in order to ensure the use experience of network use, a user generally simultaneously starts WIFI and mobile data of the terminal device, uses WIFI network by default when searching for WIFI network, and uses cellular network when no WIFI network is searched. As long as there is a WIFI signal, WIFI network is preferentially connected, and only when the WIFI signal is dropped, the cellular network is switched to. However, in actual life, the WIFI network is often unstable, and the selection of the network switching time will affect the online experience. SUMMARY
[0003] The embodiments of the present application provide a network switching method, device, terminal device and storage medium, which can improve the online experience.
[0004] The first aspect of the embodiments of the present application provides a network switching method, comprising:
[0005] In the case that a starting instruction for a first application is detected, detecting the network quality of a first network;
[0006] In the case that the first network is a network currently used by the terminal device, and the network quality of the first network is lower than a first quality requirement, switching the network currently used by the terminal device from the first network to a second network before the first application is started; the first quality requirement comprises a network quality requirement of the first application or a network quality of the second network.
[0007] The second aspect of the embodiments of the present application provides a network switching device, comprising:
[0008] A detection unit, configured to detect the network quality of a first network in the case that a starting instruction for a first application is detected;
[0009] A switching unit, configured to switch the network currently used by the terminal device from the first network to a second network before the first application is started in the case that the first network is a network currently used by the terminal device, and the network quality of the first network is lower than a first quality requirement; the first quality requirement comprises a network quality requirement of the first application or a network quality of the second network.
[0010] A third aspect of the embodiments of the present application provides a terminal device, comprising a processor and a memory, the memory is used to store a computer program, the computer program comprises program instructions, the processor is configured to invoke the program instructions to execute the step instructions in the first aspect of the embodiments of the present application.
[0011] A fourth aspect of the embodiments of the present application provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program for electronic data exchange, the computer program comprises program instructions, the program instructions, when executed by a processor, cause the processor to execute the step instructions in the first aspect of the embodiments of the present application.
[0012] A fifth aspect of the embodiments of the present application provides a computer program product, wherein the computer program product comprises a computer program, the computer program comprises program instructions, the program instructions, when executed by a processor, cause the processor to execute the step instructions in the first aspect of the embodiments of the present application.
[0013] The network switching method of the embodiments of the present application, in the case of detecting a starting instruction for a first application, detecting the network quality of a first network; in the case that the first network is the network currently used by the terminal device, and the network quality of the first network is lower than a first quality requirement, switching the network currently used by the terminal device from the first network to a second network before the first application is started; the first quality requirement comprises the network quality requirement of the first application or the network quality of the second network. In the embodiments of the present application, the network quality of the first network is detected in the time period from the detection of the starting instruction of the first application to the completion of the starting of the first application, and in the case that the network quality of the first network is lower than the first quality requirement, the network currently used by the terminal device is switched from the first network to the second network. Since a starting time is needed after the starting instruction of the first application is received, the first application will not be started immediately, and the network is switched in the time period from the reception of the starting instruction of the first application to the completion of the starting of the first application, which avoids the premature switching or the late switching of the network, and can select a suitable time for network switching, thereby improving the online experience. BRIEF DESCRIPTION OF DRAWINGS
[0014] In order to more clearly illustrate the technical solutions of the embodiments of the present application or the prior art, the drawings needed in the embodiments or the prior art description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative labor.
[0015] Figure 1is a flowchart of a network switching method provided by an embodiment of the present application;
[0016] Figure 2 is a flowchart of another network switching method provided by an embodiment of the present application;
[0017] Figure 3 is a flowchart of another network switching method provided by an embodiment of the present application;
[0018] Figure 4 is a flowchart of another network switching method provided by an embodiment of the present application;
[0019] Figure 5 is a network selection strategy diagram of a network switching method from a WIFI network to a cellular network provided by an embodiment of the present application;
[0020] Figure 6 is a specific flowchart of a network switching method from a WIFI network to a cellular network provided by an embodiment of the present application;
[0021] Figure 7 is a network selection strategy diagram of a network switching method from a cellular network to a WIFI network provided by an embodiment of the present application;
[0022] Figure 8 is a specific flowchart of a network switching method from a cellular network to a WIFI network provided by an embodiment of the present application;
[0023] Figure 9 is a network selection strategy diagram of another network switching method from a cellular network to a WIFI network provided by an embodiment of the present application;
[0024] Figure 10 is a specific flowchart of another network switching method from a cellular network to a WIFI network provided by an embodiment of the present application;
[0025] Figure 11 is a network selection strategy diagram of another network switching method from a WIFI network to a cellular network provided by an embodiment of the present application;
[0026] Figure 12 is a specific flowchart of another network switching method from a WIFI network to a cellular network provided by an embodiment of the present application;
[0027] Figure 13 is a network selection strategy diagram of another network switching method from a cellular network to a WIFI network provided by an embodiment of the present application;
[0028] Figure 14 is a network selection strategy diagram of another network switching method from a WIFI network to a cellular network provided by an embodiment of the present application;
[0029] Figure 15 is a specific flow diagram of another network switching method from a cellular network to a WIFI network provided by an embodiment of the present application;
[0030] Figure 16 is a specific flow diagram of another network switching method from a WIFI network to a cellular network provided by an embodiment of the present application;
[0031] Figure 17 is a structure diagram of a network switching device provided by an embodiment of the present application;
[0032] Figure 18 is a structure diagram of a terminal device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0033] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.
[0034] The terms "first", "second", and the like in the specification and claims of the present application and the above drawings are used to distinguish different objects, and are not used to describe a specific order. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but can optionally include other steps or units not listed or can optionally include other steps or units inherent to the process, method, product or device.
[0035] In the present application, "embodiment" means that the specific features, structures or characteristics described in conjunction with the embodiment can be included in at least one embodiment of the present application. The phrase appears at various places in the specification does not necessarily refer to the same embodiment, nor is it independent or alternative to other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described in the present application can be combined with other embodiments.
[0036] The terminal device involved in the embodiments of the present application is a device with communication capability. It can be a mobile phone, a tablet computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), an on board unit (OBU), a wearable device (for example, a watch, a bracelet, a smart helmet, etc.), a smart home device (a rice cooker, a sound box, a home butler device, etc.), an augmented reality (AR) / virtual reality (VR) device, etc.
[0037] The network switching method of the embodiments of the present application detects the network quality of the first network in the time period after detecting the starting instruction for the first application and before the first application is started, and switches the network currently used by the terminal device from the first network to a second network in the case where the network quality of the first network is lower than the first quality requirement. Since a starting time is needed after receiving the starting instruction of the first application, the first application will not be started immediately, and the network is switched in the time period after receiving the starting instruction of the first application and before the first application is started, which avoids early network switching (if the network is switched before receiving the starting instruction of the first application, the network quality of the first network and the network quality of the second network can have changed greatly after detecting the starting instruction of the first application, and the network may not need to be switched) or late network switching (if the network is switched after the first application is started, it will cause lag, and affect the online experience of the first application), the timing of network switching can be selected, and thus the online experience is improved. The following will be specifically explained.
[0038] Please refer to Figure 1 , Figure 1 is a flowchart of a network switching method provided by the embodiments of the present application. As shown in Figure 1 , the method can include the following steps.
[0039] 101, in the case where the starting instruction for the first application is detected, the terminal device detects the network quality of the first network.
[0040] In the embodiments of the present application, the starting instruction of the first application can be an instruction for starting the first application. The starting instruction can be a touch operation. For example, the terminal device can detect a touch operation (for example, a user clicks the icon of the first application) on the icon of the first application. The starting instruction can also be a shortcut starting operation of a combination of keys, for example, a shortcut starting operation corresponding to a commonly used application can be set. The shortcut starting operation can be a combination of a volume + key, a volume - key, a power key, a long press, and a short press. If the shortcut starting operation corresponding to the first application is "long press of the power key and the volume + key", when the shortcut starting operation "long press of the power key and the volume + key" is detected, it is determined that the starting instruction for the first application is detected.
[0041] The network currently used by the terminal device can be the first network or the second network. If the first network is the network currently used by the terminal device. For example, if the network currently used by the terminal device is a WIFI network, the first network is a WIFI network; if the network currently used by the terminal device is a mobile data network, the first network is a mobile data network. The mobile data network can also be referred to as a cellular network or a mobile network.
[0042] The cellular network (cellular network) is also called a mobile network (mobile network) or a mobile data network. The cellular network is a mobile communication hardware architecture, which is divided into analog cellular network and digital cellular network. Because the signal coverage of each communication base station constituting the network coverage is hexagonal, the entire network looks like a cell, hence the name.
[0043] The WIFI network can also be referred to as a WiFi network, a wifi network, or a Wi-Fi network. Wireless network access can be simply understood as wireless access. Almost all smartphones, tablets, and laptops support Wi-Fi access, which is the most widely used wireless network transmission technology today.
[0044] The network quality of the first network can be determined based on a quality parameter, and the quality parameter can include at least one of a delay time, a throughput, a packet loss rate, a received signal strength indication (RSSI), and a signal to interference plus noise ratio (SINR).
[0045] The delay time can include a round-trip time (RTT). The round-trip time is an important performance indicator in a computer network. The round-trip time represents the time experienced from the sending end sending data to the sending end receiving an acknowledgement from the receiving end (the receiving end sends the acknowledgement immediately after receiving the data, and does not include the data transmission time).
[0046] The throughput refers to the sum of the amount of data transmitted on the network during one network test. The amount of data transmitted can include at least one of the amount of data uploaded and the amount of data downloaded. The throughput can be simply understood as a parameter related to the rate of downloading and uploading. The faster the rate of downloading, the higher the throughput, and the higher the rate of uploading, the higher the throughput.
[0047] The loss tolerance or packet loss rate refers to the ratio of the number of lost data packets to the number of transmitted data packets during one network test. The calculation method is: “[(input message-output message) / input message]*100%”.
[0048] The RSSI can be used to determine the link quality. Generally, the terminal device is closer to the base station or the wireless access point (AP), and the value of the RSSI is larger, and the signal quality is higher. The wireless AP can be a WIFI hotspot. The RSSI is a basic prerequisite for network quality, and if the value of the RSSI is small, other quality parameters do not need to be considered. In the case where the value of the RSSI is large, other quality parameters are further considered.
[0049] The SINR refers to the ratio of the strength of the received useful signal to the strength of the received interference signal (noise and interference); it can be understood as “signal-to-noise ratio”.
[0050] In one embodiment, detecting the network quality of the first network can be directly detecting the quality parameters of the first network multiple times, and obtaining the average of the multiple quality parameters as the network quality of the first network. For example, the quality parameters can include: delay time, throughput, and loss tolerance, N network tests can be performed, N delay times, N throughputs, and N loss tolerances are measured, and the average of the N delay times, the average of the N throughputs, and the average of the N loss tolerances are obtained as the network quality of the first network. When the quality parameter includes the delay time, the network quality of the first network includes the average of the N delay times; when the quality parameter includes the throughput, the network quality of the first network includes the average of the N throughputs; and when the quality parameter includes the loss tolerance, the network quality of the first network includes the average of the N loss tolerances.
[0051] It should be noted that the duration of each of the N network tests is the same. For example, the duration of each network test can be a set duration. The set duration can be any value between 30 milliseconds (ms) and 30 seconds (s). For example, the set duration can be 100 ms. Within the set duration, one network test can be completed.
[0052] The procedure of one network test can be that the sending end sends a test data packet, and the procedure of the sending end receiving an acknowledgement data packet sent by the sending end. The round-trip time is the time recorded in one network test from the sending of the test data packet by the sending end (terminal device) to the reception of the acknowledgement data packet sent by the sending end. The throughput is the sum of the amount of data transmitted by the terminal device on the network within the duration of one network test (set duration). The packet loss rate is the ratio of the number of lost data packets to the number of sent data packets in one network test.
[0053] In one embodiment, detecting the network quality of the first network can be directly detecting the quality parameters of the first network in multiple network tests, obtaining the average values of the quality parameters, and performing weighted summation according to the average values of the quality parameters to obtain the network quality of the first network. The network quality of the first network can be quantified as a specific numerical value. For example, the detection parameters can include delay time, throughput, and packet loss rate, N network tests can be performed to measure N delay times, N throughputs, and N packet loss rates, and the average values of the N delay times, the N throughputs, and the N packet loss rates obtained are taken as the network quality of the first network.
[0054] Q=A1*X+B1*Y+C1*Z;
[0055] Wherein, Q is the network quality of the first network, X is the average value of the N delay times, Y is the average value of the N throughputs, and Z is the average value of the N packet loss rates; A1, B1, and C1 are the weighted coefficients corresponding to the delay time, the throughput, and the packet loss rate, respectively.
[0056] Optionally, for different applications, the coefficients of the weighted summation can be different. For example, the first application can be a game application or a video application. The weighted coefficient corresponding to the delay time of the game application can be greater than the weighted coefficient corresponding to the delay time of the video application, and the weighted coefficient corresponding to the throughput of the game application can be greater than the weighted coefficient corresponding to the throughput of the video application. Since the game application is more sensitive to delay, increasing the weighted coefficient corresponding to the delay time, the network quality of the first network calculated can more accurately reflect the network quality in the game application scenario. Since the video application is more sensitive to throughput, increasing the weighted coefficient corresponding to the throughput, the network quality of the first network calculated can more accurately reflect the network quality in the video application scenario.
[0057] In an embodiment, the detecting the network quality of the first network can include: performing multiple network tests to detect quality parameters of the first network, determining, according to a rule, a number of times that each quality parameter in the multiple network tests meets a quality requirement, and measuring the network quality of the first network according to the number of times that each quality parameter meets the quality requirement. For example, the detection parameters can include: delay time, throughput, and packet loss rate, N network tests can be performed to measure N delay times, N throughputs, and N packet loss rates, the number of times that the N delay times meet a delay requirement is determined, the number of times that the N throughputs meet a throughput requirement is determined, and the number of times that the N packet loss rates meet a packet loss rate requirement is determined. The number of times that the N delay times meet the delay requirement, the number of times that the N throughputs meet the throughput requirement, and the number of times that the N packet loss rates meet the packet loss rate requirement are taken as the network quality of the first network.
[0058] Optionally, the network quality is determined based on a quality parameter, and the quality parameter includes at least one of: delay time, throughput, and packet loss rate.
[0059] In an embodiment of the present application, the quality parameter includes at least one of: delay time, throughput, and packet loss rate. Compared with considering only RSSI, the network quality of the first network can be more accurately detected. If the RSSI signal is good, it does not mean that the network is good. For example, the terminal device is very close to the base station or the WIFI hotspot, and the RSSI is not bad. However, if there are many terminal devices accessing the base station or the WIFI at the same time, the network card of each terminal device is likely to be jammed and the throughput is poor. The RSSI is a basic value, but for some scenarios, the network quality cannot be accurately measured only by using the RSSI. For example, when the AP is congested, the RSSI is good, but the network is very jammed. Therefore, if only the RSSI is used as the quality parameter, the accuracy of the network quality detection cannot be guaranteed.
[0060] Optionally, the detecting the network quality of the first network can further include the following steps:
[0061] In a case where the value of the RSSI is greater than a set threshold, the network quality of the first network is detected; and the quality parameter includes at least one of: delay time, throughput, and packet loss rate.
[0062] In an embodiment of the present application, if the value of the RSSI under the first network is poor (the value of the RSSI is less than a set threshold), the first network can be directly switched to the second network.
[0063] 102, in a case where the first network is a network currently used by the terminal device, and the network quality of the first network is lower than a first quality requirement, the terminal device switches the network currently used by the terminal device from the first network to the second network before the first application is started and completed; and the first quality requirement includes a network quality requirement of the first application or a network quality of the second network.
[0064] In the embodiments of the present application, the first application can include any one of a game application, a video application, an audio application, a shopping application, and a social application.
[0065] The time period before the first application is started after the starting instruction for the first application is detected and before the first application is started can be a loading time period of the first application. The network switching can be performed in the loading time period of the first application, so that the network is not switched too early or too late, and the network switching opportunity can be selected, thereby improving the online experience.
[0066] For the game application, the loading time period of the game application can be a buffering time period of the game application. For example, when a game application is opened (for example, the icon of the game application is clicked, and the starting instruction for the game application is detected), there is a network buffering process, and the time is generally greater than 5 seconds. This time period can be called a loading time period. After the buffering is completed, the game starts, and the game application is started at this time.
[0067] For example, when a video application is opened (for example, the icon of the video application is clicked, and the starting instruction for the video application is detected), there is an application loading process, and this time period can be called a loading time period (for example, an advertisement can be displayed in the loading time period). After the loading is completed, the video application is entered, and the video application is started at this time.
[0068] In the embodiments of the present application, the first quality requirement can be a quality requirement of the first application, a network quality of the second network, or a minimum value of the quality requirement of the first application and the network quality of the second network.
[0069] In one embodiment, the network quality of the first network is lower than the network quality requirement of the first application, that is, each quality parameter in the network quality of the first network is worse than the corresponding quality parameter in the network quality requirement of the first application. For example, the network quality requirement of the first application can be the minimum network quality required by the first application. For example, if the network quality of the first network includes an average value of N delay times, an average value of N throughputs, and an average value of N packet loss rates, and the minimum network quality required by the first application includes a delay time threshold, a throughput threshold, and a packet loss rate threshold, if the average value of the N delay times is higher than the delay time threshold, the average value of the N throughputs is lower than the throughput threshold, and the average value of the N packet loss rates is greater than the packet loss rate threshold, it is indicated that the network quality of the first network is lower than the network quality requirement of the first application.
[0070] In another embodiment, the network quality of the first network is lower than the network quality requirement of the first application, and each quality parameter in the network quality of the first network is lower than the corresponding quality parameter in the network quality requirement of the first application. For example, the network quality requirement of the first application can be the minimum network quality required by the first application. For example, if the network quality of the first network includes: the number of N delay times meeting the delay requirement, the number of N throughputs meeting the throughput requirement, and the number of N packet loss rates meeting the packet loss rate requirement. The minimum network quality required by the first application includes: the number of N delay times meeting the delay requirement threshold, the number of N throughputs meeting the throughput requirement threshold, and the number of N packet loss rates meeting the packet loss rate requirement threshold. If the number of N delay times meeting the delay requirement is less than the number of N delay times meeting the delay requirement threshold, and the number of N throughputs meeting the throughput requirement is less than the number of N throughputs meeting the throughput requirement threshold, and the number of N packet loss rates meeting the packet loss rate requirement is less than the number of N packet loss rates meeting the packet loss rate requirement threshold, it indicates that the network quality of the first network is lower than the network quality requirement of the first application.
[0071] In the embodiment, the network quality of the second network can be detected before step 101. For example, before step 101 is performed, the terminal device can periodically detect the network quality of the second network.
[0072] Optionally, after step 102 is performed, the following step can be further performed:
[0073] In the case that the first network is the network currently used by the terminal device, and the network quality of the first network is higher than the first quality requirement, the terminal device maintains the network currently used by the terminal device as the first network.
[0074] In the embodiment, in the time period after the start instruction for the first application is detected and before the first application is started, if the first network is the network currently used by the terminal device, and the network quality of the first network is detected to be higher than the first quality requirement, the network currently used by the terminal device is maintained, and network switching is not performed, thereby avoiding frequent network switching.
[0075] In the embodiment, the first quality requirement can be the quality requirement of the first application, or the network quality of the second network, or the minimum value of the quality requirement of the first application and the network quality of the second network.
[0076] In one embodiment, the network quality of the first network is higher than the network quality requirement of the first application, which can mean that each quality parameter in the network quality of the first network is better than the corresponding quality parameter in the network quality requirement of the first application. For example, the network quality requirement of the first application can be the minimum network quality required by the first application. For example, if the network quality of the first network includes: the average of N delay times, the average of N throughputs, and the average of N packet loss rates. The minimum network quality required by the first application includes: a delay time threshold, a throughput threshold, and a packet loss rate threshold. If the average of N delay times is lower than the delay time threshold, and the average of N throughputs is higher than the throughput threshold, and the average of N packet loss rates is less than the packet loss rate threshold, it means that the network quality of the first network is higher than the network quality requirement of the first application.
[0077] In another embodiment, the network quality of the first network is higher than the network quality requirement of the first application, which can also mean that each quality parameter in the network quality of the first network is greater than the corresponding quality parameter in the network quality requirement of the first application. For example, the network quality requirement of the first application can be the minimum network quality required by the first application. For example, if the network quality of the first network includes: the number of times that N delay times meet the delay requirement, the number of times that N throughputs meet the throughput requirement, and the number of times that N packet loss rates meet the packet loss rate requirement. The minimum network quality required by the first application includes: a threshold of the number of times that N delay times meet the delay requirement, a threshold of the number of times that N throughputs meet the throughput requirement, and a threshold of the number of times that N packet loss rates meet the packet loss rate requirement. If the number of times that N delay times meet the delay requirement is greater than the threshold of the number of times that N delay times meet the delay requirement, and the number of times that N throughputs meet the throughput requirement is greater than the threshold of the number of times that N throughputs meet the throughput requirement, and the number of times that N packet loss rates meet the packet loss rate requirement is greater than the threshold of the number of times that N packet loss rates meet the packet loss rate requirement, it means that the network quality of the first network is higher than the network quality requirement of the first application.
[0078] In the embodiments of the present application, the network quality of the first network is detected in a time period after the starting instruction for the first application is detected and before the first application is started, and in a case where the network quality of the first network is lower than the first quality requirement, the network currently used by the terminal device is switched from the first network to the second network. Since a starting time is required after the starting instruction for the first application is received, the first application will not be started immediately, and the network switching is performed in the time period from after the starting instruction for the first application is received to before the first application is started. If the network switching is performed after the starting instruction for the first application is received, the network quality of the first network and the network quality of the second network can have changed greatly after the starting instruction for the first application is detected, and the network switching can not be required, and if the switching is performed after the first application is started, a lag will be caused, and the online experience of the first application is affected. The embodiments of the present application can avoid the network switching too early or too late, and select a suitable time for the network switching, thereby improving the online experience.
[0079] Optionally, the first quality requirement comprises a network quality requirement of the first application, and the quality parameter comprises a delay time.
[0080] The detection of the network quality of the first network comprises:
[0081] The N network tests are performed, and it is determined that the number of times that the delay time is less than or equal to a first threshold value in the N network tests is j, and N is an integer greater than or equal to 2.
[0082] The network quality requirement of the first application comprises that the number of times that the delay time is less than or equal to the first threshold value in the N network tests is k.
[0083] The network quality of the first network is lower than the first quality requirement, and the first quality requirement comprises that the number j is less than the number k.
[0084] The first application in the embodiments of the present application can be an application that is sensitive to delay, such as a game application.
[0085] In the embodiments of the present application, the duration of each network test in the N network tests is the same. For example, the duration of each network test can be a set duration. The set duration can be any value between 30 milliseconds (ms) and 30 seconds (s). For example, the set duration can be 100 ms. In the set duration, the network test for measuring the delay time can be completed. Taking the round trip time (RTT) as an example, the time required for the terminal device to send a test data packet to a receiving end and to receive an acknowledgement data packet sent by the receiving end, that is, the round trip time (RTT) detected in the network test, can be tested.
[0086] The first threshold value can be set as a fixed value, for example, the first threshold value can be preset and stored in a memory (for example, a non-volatile memory) of the terminal device.
[0087] In the embodiments of the present application, the first quality requirement includes a network quality requirement of the first application, and the network quality requirement of the first application includes that the number of times of delay time less than or equal to the first threshold value in N network tests is k. The value of k can be related to the delay requirement of the first application. If the first application has a higher delay requirement, k can be set to be relatively large. If the first application has a lower delay requirement, k can be set to be relatively small.
[0088] Optionally, the first threshold value can be related to the application. Different applications can have different first threshold values. For example, for an application sensitive to delay, the first threshold value can be set to be relatively small, and for an application not sensitive to delay, the first threshold value can be set to be relatively large.
[0089] The embodiments of the present application provide a method for comparing the network quality of the first network with the first quality requirement (the network quality requirement of the first application), which can determine whether the network quality of the first network meets the first quality requirement by counting the number of times of delay time less than or equal to the first threshold value in N network tests. Without complex calculation, it can be accurately determined whether the network quality of the first network meets the first quality requirement.
[0090] Optionally, the first quality requirement includes the network quality requirement of the first application, and the quality parameter includes throughput.
[0091] The detection of the network quality of the first network includes:
[0092] The N network tests are performed, and it is determined that the number of times of throughput greater than or equal to the second threshold value in the N network tests is m, and N is an integer greater than or equal to 2;
[0093] The network quality requirement of the first application includes that the number of times of throughput greater than or equal to the second threshold value in N network tests is n.
[0094] The network quality of the first network is lower than the first quality requirement, including that m is less than n.
[0095] The first application of the embodiments of the present application can be an application with a higher throughput requirement, such as a video application or a song playing application.
[0096] In the embodiments of the present application, the duration of each network test in the N network tests is the same. For example, the duration of each network test can be a set duration. The set duration can be any value between 30 milliseconds (ms) and 30 seconds (s). For example, the set duration can be 1000 ms. Within the set duration, a network test for measuring throughput can be completed. In an embodiment, the total amount of downlink data of the terminal device within the set duration can be measured, and the total amount of downlink data is taken as the throughput of the network test. In an embodiment, the total amount of uplink data of the terminal device within the set duration can be measured, and the total amount of uplink data is taken as the throughput of the network test. In an embodiment, the total amount of uplink data and the total amount of downlink data of the terminal device within the set duration can be measured, and the total amount of uplink data and the total amount of downlink data are taken as the throughput of the network test.
[0097] In the embodiments of the present application, the total amount of downlink data can be the data flow from the base station or the WIFI hotspot to the terminal device, which can be detected by the terminal device. The duration of each network test in the N network tests can be set in advance.
[0098] The second threshold value can be set as a fixed value. For example, the second threshold value can be set in advance and can be stored in the memory (such as a non-volatile memory) of the terminal device.
[0099] In the embodiments of the present application, the first quality requirement includes the network quality requirement of the first application, and the network quality requirement of the first application includes that the number of times that the throughput is greater than or equal to the second threshold value in the N network tests is n. The size of n can be related to the throughput requirement of the first application. If the first application has a higher requirement for throughput, n can be set to be relatively large. If the first application has a lower requirement for throughput, n can be set to be relatively small.
[0100] Optionally, the second threshold value can be related to the application. For different applications, the second threshold value can be set differently. For example, for an application with a higher requirement for throughput, the second threshold value can be set to be relatively large, and for an application with a lower requirement for throughput, the first threshold value can be set to be relatively small.
[0101] The embodiments of the present application provide a method for comparing the network quality of the first network with the first quality requirement, which can determine whether the network quality of the first network meets the first quality requirement by counting the number of times that the throughput is greater than or equal to the second threshold value in the N network tests. Without complex calculation, it can be accurately determined whether the network quality of the first network meets the first quality requirement.
[0102] Optionally, the first quality requirement includes the network quality requirement of the first application, and the quality parameter includes the delay time and the throughput.
[0103] The detecting the network quality of the first network comprises:
[0104] performing N times of network tests, determining that the number of times of delay time being less than or equal to a first threshold in the N times of network tests is j, and determining that the number of times of throughput being greater than or equal to a second threshold in the N times of network tests is m; N is an integer greater than or equal to 2;
[0105] The network quality requirement of the first application comprises that the number of times of delay time being less than or equal to a first threshold in N times of network tests is k, and the number of times of throughput being greater than or equal to a second threshold in the N times of network tests is n.
[0106] The network quality of the first network is lower than the first quality requirement, comprising that j is less than k, and m is less than n.
[0107] The first application of the embodiment of the present application can be an application which is sensitive to delay and has a high requirement on throughput.
[0108] In the embodiment of the present application, the duration of each network test in the N times of network tests is the same. For example, the duration of each network test can be a set duration. The set duration can be any value between 30 milliseconds (ms) and 30 seconds (s). For example, the set duration can be 100 ms. Within the set duration, a network test for measuring delay time and a network test for measuring throughput can be completed.
[0109] In the embodiment of the present application, the first quality requirement comprises a network quality requirement of the first application, and the network quality requirement of the first application comprises that the number of times of delay time being less than or equal to a first threshold in N times of network tests is k, and the number of times of throughput being greater than or equal to a second threshold in the N times of network tests is n. The size of k can be related to the delay requirement of the first application, and the size of n can be related to the throughput requirement of the first application. If the first application has a high requirement on delay, k can be set to be relatively large. If the first application has a low requirement on delay, k can be set to be relatively small. If the first application has a high requirement on throughput, n can be set to be relatively large. If the first application has a low requirement on throughput, n can be set to be relatively small.
[0110] The embodiment of the present application provides a method for comparing network quality of a first network with a first quality requirement, which can determine whether the network quality of the first network reaches the first quality requirement by counting a number of times that a delay time is less than or equal to a first threshold in N times of network testing and a number of times that a throughput is greater than or equal to a second threshold in the N times of network testing. The network quality of the first network can be accurately determined without complex calculation. If the number of times j that the delay time is less than or equal to the first threshold in the N times of network testing is less than k, and the number of times m that the throughput is greater than or equal to the second threshold in the N times of network testing is less than n, it is considered that the network quality of the first network is lower than the first quality requirement.
[0111] Optionally, the first quality requirement comprises a network quality requirement of the first application, and the quality parameter comprises a delay time and a throughput.
[0112] The detecting the network quality of the first network comprises:
[0113] performing N1 times of network testing, and determining that a number of times that a delay time is less than or equal to a first threshold in the N1 times of network testing is j times; N1 is an integer greater than or equal to 2;
[0114] performing N2 times of network testing, and determining that a number of times that a throughput is greater than or equal to a second threshold in the N2 times of network testing is m times; N2 is an integer greater than or equal to 2;
[0115] The network quality requirement of the first application comprises that a number of times that a delay time is less than or equal to a first threshold in N1 times of network testing is k times, and a number of times that a throughput is greater than or equal to a second threshold in N2 times of network testing is n times.
[0116] The network quality of the first network is lower than the first quality requirement, which comprises that j is less than k, and m is less than n.
[0117] The first application of the embodiment of the present application can be an application which is sensitive to delay time and has a high throughput requirement.
[0118] In the embodiments of the present application, the duration of each network test in the N1 network tests is the same, and the duration of each network test in the N2 network tests is the same. For example, the duration of each network test in the N1 network tests can be a first set duration. The first set duration can be any value between 30 milliseconds (ms) and 30 seconds (s). For example, the first set duration can be 100 ms. Within the first set duration, a network test for measuring the delay time can be completed. The duration of each network test in the N2 network tests can be a second set duration. The second set duration can be any value between 30 milliseconds (ms) and 30 seconds (s). For example, the second set duration can be 1000 ms. Within the second set duration, a network test for measuring the throughput can be completed. The first set duration and the second set duration can be different. The N1 and the N2 can be set to be the same or different. When the time required for measuring the delay time once and the time required for measuring the throughput once are significantly different, the measurement of the delay time and the measurement of the throughput can be completed in two network tests respectively, and do not need to be completed in the same network test, which can improve the efficiency of the network test. For example, if the duration required for testing the delay time once is approximately within 100 ms, and the duration required for testing the throughput once is approximately within 1000 ms, in the case of separate measurement of the delay time and the throughput, 100 times of delay time measurement and 10 times of throughput measurement can be completed within 10 s. In the case of measurement of the delay time and the throughput in the same network test, only 10 times of delay time measurement and 10 times of throughput measurement can be completed within 10 s.
[0119] In the embodiments of the present application, the first quality requirement includes a network quality requirement of the first application, and the network quality requirement of the first application includes that the number of times of delay time less than or equal to a first threshold in the N1 network tests is k times, and the number of times of throughput greater than or equal to a second threshold in the N2 network tests is n times. The size of k can be related to the delay requirement of the first application, and the size of n can be related to the throughput requirement of the first application. If the first application has a higher requirement for the delay, k can be set to be relatively larger. If the first application has a lower requirement for the delay, k can be set to be relatively smaller. If the first application has a higher requirement for the throughput, n can be set to be relatively larger. If the first application has a lower requirement for the throughput, n can be set to be relatively smaller.
[0120] The embodiment of the present application provides a method for comparing network quality of a first network with a first quality requirement, which can determine whether the network quality of the first network reaches the first quality requirement by counting a number of times that a delay time is less than or equal to a first threshold in N1 network tests and a number of times that a throughput is greater than or equal to a second threshold in N2 network tests. Without complex calculation, whether the network quality of the first network reaches the first quality requirement can be accurately determined. If the number of times j that the delay time is less than or equal to the first threshold in the N1 network tests is less than k, and the number of times m that the throughput is greater than or equal to the second threshold in the N2 network tests is less than n, it is considered that the network quality of the first network is lower than the first quality requirement.
[0121] Optionally, the first quality requirement comprises a network quality requirement of the first application, and the quality parameter comprises a delay time, a throughput and a packet loss rate.
[0122] The method further comprises:
[0123] performing N network tests, determining a number of times j that a delay time is less than or equal to a first threshold in the N network tests, determining a number of times m that a throughput is greater than or equal to a second threshold in the N network tests, and determining a number of times p that a packet loss rate is less than or equal to a third threshold in the N network tests; N is an integer greater than or equal to 2;
[0124] Optionally, the network quality requirement of the first application comprises: a number of times k that a delay time is less than or equal to a first threshold in N network tests, a number of times n that a throughput is greater than or equal to a second threshold in the N network tests, and a number of times q that a packet loss rate is less than or equal to a third threshold in the N network tests.
[0125] The network quality of the first network is lower than the first quality requirement, comprising: j is less than k, m is less than n, and p is less than q.
[0126] The first application of the embodiment of the present application can be an application which is sensitive to delay time, has high throughput requirement and has high packet loss rate requirement.
[0127] In the embodiment of the present application, a duration of each network test in the N network tests is the same. For example, the duration of each network test can be a set duration. The set duration can be any value between 30 milliseconds (ms) and 30 seconds (s). For example, the set duration can be 100 ms. Within the set duration, a network test for measuring a delay time, a network test for measuring a throughput and a network test for measuring a packet loss rate can be completed.
[0128] In the embodiments of the present application, the first quality requirement comprises a network quality requirement of the first application, and the network quality requirement of the first application comprises: the number of times that the delay time is less than or equal to the first threshold value in N network tests is k, the number of times that the throughput is greater than or equal to the second threshold value in the N network tests is n, and the number of times that the packet loss rate is less than or equal to the third threshold value in the N network tests is q. The value of k can be related to the delay requirement of the first application, the value of n can be related to the throughput requirement of the first application, and the value of q can be related to the packet loss rate requirement of the first application. If the first application has a higher delay requirement, k can be set to be relatively large. If the first application has a lower delay requirement, k can be set to be relatively small. If the first application has a higher throughput requirement, n can be set to be relatively large. If the first application has a lower throughput requirement, n can be set to be relatively small. If the first application has a higher packet loss rate requirement, q can be set to be relatively large. If the first application has a lower packet loss rate requirement, q can be set to be relatively small.
[0129] The embodiments of the present application provide a method for comparing the network quality of the first network with the first quality requirement, which can determine whether the network quality of the first network meets the first quality requirement by counting the number of times that the delay time is less than or equal to the first threshold value in N network tests, the number of times that the throughput is greater than or equal to the second threshold value in the N network tests, and the number of times that the packet loss rate is less than or equal to the third threshold value in the N network tests. Without complex calculation, it can be accurately determined whether the network quality of the first network meets the first quality requirement. If the number of times that the delay time is less than or equal to the first threshold value in the N network tests j is less than k, the number of times that the throughput is greater than or equal to the second threshold value in the N network tests m is less than n, and the number of times that the packet loss rate is less than or equal to the third threshold value in the N network tests p is less than q, it is considered that the network quality of the first network is lower than the first quality requirement.
[0130] Optionally, the first quality requirement comprises a network quality requirement of the first application, and the quality parameter comprises delay time, throughput and packet loss rate.
[0131] The detecting the network quality of the first network comprises:
[0132] performing N1 network tests to determine the number of times that the delay time is less than or equal to the first threshold value in the N1 network tests is j; N1 is an integer greater than or equal to 2;
[0133] performing N2 network tests to determine the number of times that the throughput is greater than or equal to the second threshold value in the N2 network tests is m; N2 is an integer greater than or equal to 2;
[0134] perform N3 network tests, determine a number of times that a packet loss rate in the N3 network tests is less than or equal to a third threshold value as p; N3 is an integer greater than or equal to 2;
[0135] The network quality requirement of the first application includes: in N1 network tests, a number of times that a delay time is less than or equal to a first threshold value is k, in N2 network tests, a number of times that a throughput is greater than or equal to the second threshold value is n, and in N3 network tests, a number of times that a packet loss rate is less than or equal to a third threshold value is q.
[0136] The network quality of the first network being lower than the first quality requirement includes: j is less than k, m is less than n, and p is less than q.
[0137] The first application of the embodiments of the present application can be an application that is sensitive to delay, has a high throughput requirement, and has a high packet loss rate requirement.
[0138] In this embodiment, the duration of each network test in the N1, N2, and N3 network tests is the same. For example, the duration of each network test in the N1 network tests can be a first preset duration. The first preset duration can be any value between 30 milliseconds (ms) and 30 seconds (s). For example, the first preset duration can be 100 ms. Within the first preset duration, a network test measuring latency can be completed. The duration of each network test in the N2 network tests can be a second preset duration. The second preset duration can be any value between 30 milliseconds (ms) and 30 seconds (s). For example, the second preset duration can be 1000 ms. Within the second preset duration, a network test measuring throughput can be completed. The duration of each network test in the N3 network tests can be a third preset duration. The third preset duration can be any value between 30 milliseconds (ms) and 30 seconds (s). For example, the third preset duration can be 500 ms. Within the third set time period, a network test measuring packet loss rate can be completed. N1, N2, and N3 can be set to the same or different values. When the time required to measure latency, throughput, and packet loss rate differs significantly, these measurements can be performed separately in three network tests, improving efficiency. For example, if the latency test takes approximately 100ms, the throughput test approximately 1000ms, and the packet loss rate test approximately 500ms, then by measuring latency, throughput, and packet loss rate separately, 100 latency measurements, 10 throughput measurements, and 20 packet loss rate measurements can be completed within 10 seconds. If latency, throughput, and packet loss rate are measured in the same network test, only 10 latency measurements, 10 throughput measurements, and 10 packet loss rate measurements can be completed within 10 seconds.
[0139] In the embodiments of the present application, the first quality requirement comprises a network quality requirement of the first application, and the network quality requirement of the first application comprises: the number of times that the delay time is less than or equal to the first threshold value in N network tests is k, the number of times that the throughput is greater than or equal to the second threshold value in N network tests is n, and the number of times that the packet loss rate is less than or equal to the third threshold value in N network tests is q. The value of k can be related to the delay requirement of the first application, the value of n can be related to the throughput requirement of the first application, and the value of q can be related to the packet loss rate requirement of the first application. If the first application has a higher requirement on the delay, k can be set to be relatively large. If the first application has a lower requirement on the delay, k can be set to be relatively small. If the first application has a higher requirement on the throughput, n can be set to be relatively large. If the first application has a lower requirement on the throughput, n can be set to be relatively small. If the first application has a higher requirement on the packet loss rate, q can be set to be relatively large. If the first application has a lower requirement on the packet loss rate, q can be set to be relatively small.
[0140] The embodiments of the present application provide a method for comparing the network quality of the first network with the first quality requirement, which can determine whether the network quality of the first network meets the first quality requirement by counting the number of times that the delay time is less than or equal to the first threshold value in N1 network tests, the number of times that the throughput is greater than or equal to the second threshold value in N2 network tests, and the number of times that the packet loss rate is less than or equal to the third threshold value in N3 network tests. Without complex calculation, it can be accurately determined whether the network quality of the first network meets the first quality requirement. If the number of times that the delay time is less than or equal to the first threshold value in N1 network tests is j, which is less than k, the number of times that the throughput is greater than or equal to the second threshold value in N2 network tests is m, which is less than n, and the number of times that the packet loss rate is less than or equal to the third threshold value in N3 network tests is p, which is less than q, it is considered that the network quality of the first network is lower than the first quality requirement.
[0141] Please refer to Figure 2 , Figure 2 is a flow diagram of another network switching method provided by the embodiments of the present application. As shown in Figure 2 , the method can include the following steps.
[0142] 201, in the case of detecting a starting instruction for the first application, the terminal device detects the network quality of the first network.
[0143] 202, in the case that the first network is the network currently used by the terminal device, and the network quality of the first network is lower than the first quality requirement, the terminal device switches the network currently used by the terminal device from the first network to the second network before the first application is started; the first quality requirement comprises a network quality requirement of the first application or a network quality of the second network.
[0144] The specific implementation of steps 201 to 202 can refer to the description of steps 101 to 102, which will not be repeated here.
[0145] 203, in the case that the second network is the network currently used by the terminal device, and the network quality of the first network is higher than the first quality requirement, the terminal device switches the network currently used by the terminal device from the second network to the first network before the first application is started.
[0146] In the embodiment of the present application, the first quality requirement can be the quality requirement of the first application, or the network quality of the second network, or the highest value of the quality requirement of the first application and the network quality of the second network.
[0147] When the first quality requirement includes the highest value of the quality requirement of the first application and the network quality of the second network, it can be ensured that the network quality of the first network is higher than the quality requirement of the first application, and is higher than the network quality of the second network, thereby ensuring the network reliability after the network currently used by the terminal device is switched from the second network to the first network, and improving the online experience of the first application.
[0148] Please refer to Figure 3 , Figure 3 is a flowchart of another network switching method provided by the embodiment of the present application. As shown in Figure 3 , the method can include the following steps.
[0149] 301, the terminal device detects the network quality of the second network.
[0150] In the embodiment of the present application, step 301 can be performed before step 302.
[0151] Step 301 can be performed periodically. For example, the terminal device can simultaneously open the WIFI switch and the switch of the mobile data network. Taking the first network as the WIFI network and the second network as the cellular network (i.e. the mobile data network) as an example, in the case that the network currently used by the terminal device is the cellular network, the terminal device can periodically detect the network quality of the cellular network. Taking the second network as the WIFI network and the first network as the cellular network (i.e. the mobile data network) as an example, in the case that the network currently used by the terminal device is the WIFI network, the terminal device can periodically detect the network quality of the WIFI network.
[0152] Since the network quality of the second network can be periodically detected before the start instruction for the first application is detected, when the start instruction for the first application is detected, the network quality of the second network does not need to be detected again, and the network quality of the first network is directly detected, and the network quality of the first network and the network quality of the second network are compared. The period from when the start instruction of the first application is received to when the first application is started can quickly determine whether to perform network switching, and network switching can be completed within the loading period of the first application (the period from when the start instruction of the first application is received to when the first application is started) when the loading period of the first application is short, thereby improving the speed of network switching.
[0153] 302, in the case of detecting the start instruction for the first application, the terminal device detects the network quality of the first network.
[0154] 303, in the case that the first network is the network currently used by the terminal device, and the network quality of the first network is lower than the network quality of the first quality requirement, the terminal device switches the network currently used by the terminal device from the first network to the second network before the first application is started; the first quality requirement includes the network quality requirement of the first application or the network quality of the second network.
[0155] 304, in the case that the second network is the network currently used by the terminal device, and the network quality of the first network is higher than the first quality requirement, the terminal device switches the network currently used by the terminal device from the second network to the first network before the first application is started.
[0156] Wherein, the specific implementation of steps 302 to 303 can refer to the description of steps 101 to 102 described above, and the specific implementation of step 304 can refer to the description of step 203 described above, which will not be described again.
[0157] Optionally, the first quality requirement includes the network quality of the second network, and the quality parameter includes a delay time;
[0158] The detection of the network quality of the first network includes:
[0159] Performing N1 network tests, determining that the number of times that the delay time in the N1 network tests is less than or equal to a first threshold value is j1 times; N1 is an integer greater than or equal to 2;
[0160] The detection of the network quality of the second network includes:
[0161] Performing N2 network tests, determining that the number of times that the delay time in the N2 network tests is less than or equal to the first threshold value is k1 times; N2 is an integer greater than or equal to 2;
[0162] The network quality of the first network being higher than the first quality requirement comprises: j1 / N1>k1 / N2.
[0163] The first application of the embodiments of the present application can be an application sensitive to latency, such as a game application.
[0164] In the embodiments of the present application, the duration of each network test in the N1 network tests is the same, and the duration of each network test in the N2 network tests is the same. For example, the duration of each network test in the N1 network tests can be a first set duration. The first set duration can be any value between 30 milliseconds (ms) and 30 seconds (s). For example, the first set duration can be 100 ms. Within the first set duration, a network test for measuring latency can be completed. The duration of each network test in the N2 network tests can be a second set duration. The second set duration can be any value between 30 milliseconds (ms) and 30 seconds (s). For example, the second set duration can be 100 ms. Within the second set duration, a network test for measuring latency can be completed. The first set duration and the second set duration can be equal. Taking round trip time (RTT) as an example, the latency can be tested from the time when the terminal device starts to send a test data packet to the receiving end to the time when an acknowledgement data packet sent by the receiving end is received, i.e., the round trip time (RTT) detected in the network test.
[0165] N1 and N2 can be equal or not equal. In the case where N1 is equal to N2, the network quality of the first network being higher than the first quality requirement comprises: j1>k1. In the case where N1 is not equal to N2, the network quality of the first network being higher than the first quality requirement comprises: j1 / N1>k1 / N2.
[0166] The first threshold value can be set as a fixed value. For example, the first threshold value can be set in advance and can be stored in the memory (such as a non-volatile memory) of the terminal device.
[0167] Optionally, the first threshold value can be related to an application. Different applications can have different first threshold values. For example, for an application sensitive to latency, the first threshold value can be set to be relatively small, and for an application not sensitive to latency, the first threshold value can be set to be relatively large.
[0168] The embodiment of the present application provides a method for comparing network quality of a first network with a first quality requirement (network quality of a second network), which can determine whether the network quality of the first network reaches the first quality requirement by counting a number j1 of times that a delay time is less than or equal to a first threshold in N1 network tests and counting a number k1 of times that a delay time is less than or equal to the first threshold in N2 network tests. Without complex calculation, it can be determined whether the network quality of the first network reaches the first quality requirement.
[0169] Optionally, the first quality requirement comprises network quality of the second network, and the quality parameter comprises throughput.
[0170] The detecting the network quality of the first network comprises:
[0171] performing N1 network tests, determining a number m1 of times that throughput is greater than or equal to a second threshold in the N1 network tests; N1 is an integer greater than or equal to 2;
[0172] The detecting the network quality of the second network comprises:
[0173] performing N2 network tests, determining a number n1 of times that throughput is greater than or equal to the second threshold in the N2 network tests; N2 is an integer greater than or equal to 2;
[0174] The network quality of the first network is higher than the first quality requirement, comprising: m1 / N1 is greater than n1 / N2.
[0175] The first application of the embodiment of the present application can be an application with high throughput requirement, such as a video application or a song playing application.
[0176] In the embodiment of the present application, a time length of each network test in the N1 network tests is the same, and a time length of each network test in the N2 network tests is the same. For example, the time length of each network test in the N1 network tests can be a first set time length. The first set time length can be any value between 30 milliseconds (ms) and 30 seconds (s). For example, the first set time length can be 1000 ms. In the first set time length, a network test for measuring throughput can be completed. The time length of each network test in the N2 network tests can be a second set time length. The second set time length can be any value between 30 milliseconds (ms) and 30 seconds (s). For example, the second set time length can be 1000 ms. In the second set time length, a network test for measuring throughput can be completed. The first set time length can be equal to the second set time length.
[0177] In one embodiment, the total amount of downlink data of the terminal device within a first set time can be measured, and the total amount of downlink data is taken as the throughput of one of the N1 network tests. The total amount of downlink data of the terminal device within a second set time can be measured, and the total amount of downlink data is taken as the throughput of one of the N2 network tests.
[0178] In one embodiment, the total amount of uplink data of the terminal device within a first set time can be measured, and the total amount of uplink data is taken as the throughput of one of the N1 network tests. The total amount of uplink data of the terminal device within a second set time can be measured, and the total amount of uplink data is taken as the throughput of one of the N2 network tests.
[0179] In one embodiment, the total amount of uplink data and the total amount of downlink data of the terminal device within a first set time can be measured, and the total amount of uplink data and the total amount of downlink data is taken as the throughput of one of the N1 network tests. The total amount of uplink data and the total amount of downlink data of the terminal device within a second set time can be measured, and the total amount of uplink data and the total amount of downlink data is taken as the throughput of one of the N2 network tests.
[0180] N1 and N2 can be equal or not equal. In the case of N1 equal to N2, the network quality of the first network is higher than the first quality requirement, including: m1 is greater than n1. In the case of N1 not equal to N2, the network quality of the first network is higher than the first quality requirement, including: m1 / N1 is greater than n1 / N2.
[0181] The second threshold value can be set as a fixed value, for example, the second threshold value can be set in advance, and can be stored in the memory (such as a non-volatile memory) of the terminal device.
[0182] Optionally, the second threshold value can be related to the application. Different applications, the second threshold value can be set differently. For example, for the application with high throughput requirement, the second threshold value can be set relatively large, and for the application with low throughput requirement, the first threshold value can be set relatively small.
[0183] The embodiments of the present application provide a method for comparing the network quality of the first network with the first quality requirement (the network quality of the second network), which can judge whether the network quality of the first network reaches the first quality requirement by counting the number m1 of times that the throughput is greater than or equal to the second threshold value in the N1 network tests and counting the number n1 of times that the throughput is greater than or equal to the second threshold value in the N2 network tests. Without complex calculation, it can accurately judge whether the network quality of the first network reaches the first quality requirement.
[0184] Optionally, the first quality requirement comprises network quality of the second network, and the quality parameter comprises a delay time and a throughput.
[0185] The detecting the network quality of the first network comprises:
[0186] The N1 network tests are performed, j1 times of the N1 network tests are determined to have a delay time less than or equal to a first threshold value, and m1 times of the N1 network tests are determined to have a throughput greater than or equal to a second threshold value; N1 is an integer greater than or equal to 2.
[0187] The detecting the network quality of the second network comprises:
[0188] The N2 network tests are performed, k1 times of the N2 network tests are determined to have a delay time less than or equal to the first threshold value, and n1 times of the N2 network tests are determined to have a throughput greater than or equal to the second threshold value; N2 is an integer greater than or equal to 2.
[0189] The network quality of the first network being higher than the first quality requirement comprises: j1 / N1 is greater than k1 / N2, and m1 / N1 is greater than n1 / N2.
[0190] The first application of the embodiments of the present application can be an application that is sensitive to delay and has a high throughput requirement.
[0191] In the embodiments of the present application, the duration of each of the N1 network tests is the same, and the duration of each of the N2 network tests is the same. For example, the duration of each of the N1 network tests can be a first set duration. The first set duration can be any value between 30 milliseconds (ms) and 30 seconds (s). For example, the first set duration can be 100 ms. Within the first set duration, a network test for measuring a delay time and a throughput can be completed. The duration of each of the N2 network tests can be a second set duration. The second set duration can be any value between 30 milliseconds (ms) and 30 seconds (s). For example, the second set duration can be 100 ms. Within the second set duration, a network test for measuring a delay time and a throughput can be completed. The first set duration and the second set duration can be equal. Taking a round trip time (RTT) as an example of the delay time, the time required for a terminal device to send a test data packet to a receiving end to receive an acknowledgement data packet sent by the receiving end can be tested, i.e., the round trip time (RTT) detected in the network test. The throughput can be an uplink data amount, a downlink data amount, or an uplink data amount and a downlink data amount.
[0192] N1 and N2 can be equal or not equal. In the case of N1 equal to N2, the network quality of the first network is higher than the first quality requirement, including: j1 is greater than k1, and m1 is greater than n1. In the case of N1 not equal to N2, the network quality of the first network is higher than the first quality requirement, including: j1 / N1 is greater than k1 / N2, and m1 / N1 is greater than n1 / N2.
[0193] The first threshold and the second threshold can be set as fixed values, for example, the first threshold and the second threshold can be set in advance, and can be stored in the memory (such as a non-volatile memory) of the terminal device.
[0194] Optionally, the first threshold can be related to the application. Different applications can have different first thresholds. For example, for an application sensitive to delay, the first threshold can be set to be relatively small, and for an application not sensitive to delay, the first threshold can be set to be relatively large. The second threshold can be related to the application. Different applications can have different second thresholds. For example, for an application with high throughput requirement, the second threshold can be set to be relatively large, and for an application with low throughput requirement, the first threshold can be set to be relatively small.
[0195] The embodiment of the present application provides a method for comparing the network quality of the first network with the first quality requirement, which can determine whether the network quality of the first network meets the first quality requirement by counting the number of times that the delay time is less than or equal to the first threshold in N1 network tests, the number of times that the throughput is greater than or equal to the second threshold in N1 network tests, the number of times that the delay time is less than or equal to the first threshold in N2 network tests, and the number of times that the throughput is greater than or equal to the second threshold in N2 network tests. Without complex calculation, it can accurately determine whether the network quality of the first network meets the first quality requirement.
[0196] Optionally, the first quality requirement includes the network quality of the second network, and the quality parameter includes delay time and throughput.
[0197] The detection of the network quality of the first network includes:
[0198] N1 network tests are performed, and it is determined that the number of times that the delay time is less than or equal to the first threshold in the N1 network tests is j1 times; N1 is an integer greater than or equal to 2;
[0199] N2 network tests are performed, and it is determined that the number of times that the throughput is greater than or equal to the second threshold in the N2 network tests is m1 times; N2 is an integer greater than or equal to 2;
[0200] The detection of the network quality of the second network includes:
[0201] performing N3 network tests, determining a number of times of delay time less than or equal to the first threshold value in the N3 network tests as k1; N3 is an integer greater than or equal to 2;
[0202] performing N4 network tests, determining a number of times of throughput greater than or equal to the second threshold value in the N4 network tests as n1; N4 is an integer greater than or equal to 2;
[0203] wherein the network quality of the first network is higher than the first quality requirement, including: j1 / N1 is greater than k1 / N3, and m1 / N2 is greater than n1 / N4.
[0204] The first application of the embodiments of the present application can be an application sensitive to delay and requiring high throughput.
[0205] In the embodiments of the present application, the duration of each network test in the N1 network tests is the same, the duration of each network test in the N2 network tests is the same, the duration of each network test in the N3 network tests is the same, and the duration of each network test in the N4 network tests is the same. For example, the duration of each network test in the N1 network tests can be a first set duration. The first set duration can be any value between 30 milliseconds (ms) and 30 seconds (s). For example, the first set duration can be 100 ms. Within the first set duration, a network test for measuring the delay time can be completed. The duration of each network test in the N2 network tests can be a second set duration. The second set duration can be any value between 30 milliseconds (ms) and 30 seconds (s). For example, the second set duration can be 1000 ms. Within the second set duration, a network test for measuring the throughput can be completed. The duration of each network test in the N3 network tests can be a third set duration. The third set duration can be any value between 30 milliseconds (ms) and 30 seconds (s). For example, the third set duration can be 100 ms. Within the third set duration, a network test for measuring the delay time can be completed. The duration of each network test in the N4 network tests can be a fourth set duration. The fourth set duration can be any value between 30 milliseconds (ms) and 30 seconds (s). For example, the fourth set duration can be 1000 ms. Within the fourth set duration, a network test for measuring the throughput can be completed. The first set duration and the third set duration can be the same, the second set duration and the fourth set duration can be the same, the first set duration and the second set duration can be different, and the third set duration and the fourth set duration can be different. Taking the round-trip time (RTT) as an example of the delay time, the time required by the terminal device from sending a test data packet to the receiving end to receiving an acknowledgement data packet sent by the receiving end, i.e., the round-trip time (RTT) detected in the network test, can be tested. The throughput can be the uplink data volume, the downlink data volume, or the uplink data volume and the downlink data volume.
[0206] N1 and N2 and N3 and N4 can be equal or not equal. In the case that N1 is equal to N2 is equal to N3 is equal to N4, the network quality of the first network is higher than the first quality requirement, including: j1 is greater than k1, and m1 is greater than n1. In the case that N1 is not equal to N2 is not equal to N3 is not equal to N4, the network quality of the first network is higher than the first quality requirement, including: j1 / N1 is greater than k1 / N3, and m1 / N2 is greater than n1 / N4. When the time required for measuring the one-time delay time and the time required for measuring the one-time throughput are greatly different, the measurement of the delay time and the measurement of the throughput can be completed in two network tests respectively, without the need to be completed in the same network test, which can improve the efficiency of the network test. For example, if the time required for testing the one-time delay time is approximately within 100 ms, and the time required for testing the one-time throughput is approximately within 1000 ms, in the case of separate measurement of the delay time and the throughput, 100 times of measurement of the delay time and 10 times of measurement of the throughput can be completed within 10 s. In the case of the measurement of the delay time and the measurement of the throughput in the same network test, only 10 times of measurement of the delay time and 10 times of measurement of the throughput can be completed within 10 s.
[0207] The first threshold value and the second threshold value can be set as fixed values, for example, the first threshold value and the second threshold value can be set in advance and can be stored in the storage (for example, a non-volatile memory) of the terminal device.
[0208] Optionally, the first threshold value can be related to the application. For different applications, the first threshold value can be set differently. For example, for an application sensitive to delay, the first threshold value can be set relatively small, and for an application not sensitive to delay, the first threshold value can be set relatively large. The second threshold value can be related to the application. For different applications, the second threshold value can be set differently. For example, for an application with high throughput requirement, the second threshold value can be set relatively large, and for an application with low throughput requirement, the first threshold value can be set relatively small.
[0209] The embodiment of the present application provides a method for comparing the network quality of the first network with the first quality requirement, which can determine whether the network quality of the first network meets the first quality requirement by counting the number of times that the delay time is less than or equal to the first threshold value in N1 network tests, the number of times that the throughput is greater than or equal to the second threshold value in N2 network tests, the number of times that the delay time is less than or equal to the first threshold value in N3 network tests, and the number of times that the throughput is greater than or equal to the second threshold value in N4 network tests. Without complex calculation, the network quality of the first network can be accurately determined whether it meets the first quality requirement.
[0210] Optionally, the first quality requirement includes the network quality of the second network, and the quality parameter includes the delay time, the throughput and the packet loss rate.
[0211] The detecting the network quality of the first network comprises:
[0212] performing N1 times of network tests, determining that the number of times that the delay time in the N1 times of network tests is less than or equal to a first threshold value is j1, determining that the number of times that the throughput in the N1 times of network tests is greater than or equal to a second threshold value is m1, and determining that the number of times that the packet loss rate in the N1 times of network tests is less than or equal to a third threshold value is p1; N1 is an integer greater than or equal to 2;
[0213] The detecting the network quality of the second network comprises:
[0214] performing N2 times of network tests, determining that the number of times that the delay time in the N2 times of network tests is less than or equal to the first threshold value is k1, determining that the number of times that the throughput in the N2 times of network tests is greater than or equal to the second threshold value is n1, and determining that the number of times that the packet loss rate in the N2 times of network tests is less than or equal to the third threshold value is q1; N2 is an integer greater than or equal to 2;
[0215] The network quality of the first network being higher than a first quality requirement comprises that j1 / N1 is greater than k1 / N2, and m1 / N1 is greater than n1 / N2, and p1 / N1 is greater than q1 / N2.
[0216] The first application of the embodiments of the present application can be an application that is sensitive to delay, and has high requirements for throughput and packet loss rate.
[0217] In the embodiments of the present application, the duration of each network test in the N1 network tests is the same, and the duration of each network test in the N2 network tests is the same. For example, the duration of each network test in the N1 network tests can be a first set duration. The first set duration can be any value between 30 milliseconds (ms) and 30 seconds (s). For example, the first set duration can be 100 ms. Within the first set duration, network tests of measuring delay time, measuring throughput, and measuring packet loss rate can be completed. The duration of each network test in the N2 network tests can be a second set duration. The second set duration can be any value between 30 milliseconds (ms) and 30 seconds (s). For example, the second set duration can be 100 ms. Within the second set duration, network tests of measuring delay time, measuring throughput, and measuring packet loss rate can be completed. The first set duration and the second set duration can be equal. Taking the round-trip time (RTT) as an example of the delay time, the time required for the terminal device to send a test data packet to the receiving end to the time required for receiving an acknowledgement data packet sent by the receiving end, i.e., the round-trip time (RTT) detected in this network test, can be tested. The throughput can be the uplink data volume, or the downlink data volume, or the uplink data volume and the downlink data volume. The throughput can be measured in one network test, and the packet loss rate can also be measured in one network test.
[0218] N1 and N2 can be equal or not equal. In the case of N1 equal to N2, the network quality of the first network being higher than the first quality requirement includes: j1 is greater than k1, and m1 is greater than n1, and p1 is greater than q1. In the case of N1 not equal to N2, the network quality of the first network being higher than the first quality requirement includes: j1 / N1 is greater than k1 / N2, and m1 / N1 is greater than n1 / N2, and p1 / N1 is greater than q1 / N2.
[0219] The first threshold, the second threshold, and the third threshold can be set to fixed values. For example, the first threshold, the second threshold, and the third threshold can all be pre-configured and stored in the memory (such as a non-volatile memory) of the terminal device.
[0220] Optionally, the first threshold value can be related to the application. For different applications, the first threshold value can be set differently. For example, for an application that is sensitive to delay, the first threshold value can be set relatively small, and for an application that is not sensitive to delay, the first threshold value can be set relatively large. The second threshold value can be related to the application. For different applications, the second threshold value can be set differently. For example, for an application that has a high requirement on throughput, the second threshold value can be set relatively large, and for an application that has a low requirement on throughput, the first threshold value can be set relatively small. The third threshold value can be related to the application. For different applications, the third threshold value can be set differently. For example, for an application that has a high requirement on packet loss rate, the third threshold value can be set relatively large, and for an application that has a low requirement on packet loss rate, the third threshold value can be set relatively small.
[0221] The embodiment of the present application provides a method for comparing network quality of a first network with a first quality requirement. Whether the network quality of the first network meets the first quality requirement can be determined by counting a number of times that a delay time is less than or equal to a first threshold value in N1 network tests, a number of times that a throughput is greater than or equal to a second threshold value in the N1 network tests, a number of times that a packet loss rate is less than or equal to a third threshold value in the N1 network tests, a number of times that the delay time is less than or equal to the first threshold value in N2 network tests, a number of times that the throughput is greater than or equal to the second threshold value in the N2 network tests, and a number of times that the packet loss rate is less than or equal to the third threshold value in the N2 network tests. Without complex calculation, whether the network quality of the first network meets the first quality requirement can be determined accurately.
[0222] Optionally, the first quality requirement includes network quality of the second network, and the quality parameter includes the delay time, the throughput and the packet loss rate.
[0223] The detecting the network quality of the first network includes:
[0224] The N1 network tests are performed, and a number of times that the delay time is less than or equal to the first threshold value in the N1 network tests is determined as j1 times; N1 is an integer greater than or equal to 2.
[0225] The N2 network tests are performed, and a number of times that the throughput is greater than or equal to the second threshold value in the N2 network tests is determined as m1 times; N2 is an integer greater than or equal to 2.
[0226] The N3 network tests are performed, and a number of times that the packet loss rate is less than or equal to the third threshold value in the N3 network tests is determined as p1 times; N1 is an integer greater than or equal to 2.
[0227] The detecting the network quality of the second network includes:
[0228] perform N4 network tests, determine the number of times of delay time less than or equal to a first threshold value in the N4 network tests as k1; N4 is an integer greater than or equal to 2;
[0229] perform N5 network tests, determine the number of times of throughput greater than or equal to a second threshold value in the N5 network tests as n1; N5 is an integer greater than or equal to 2;
[0230] perform N6 network tests, determine the number of times of packet loss rate less than or equal to the third threshold value in the N6 network tests as q1; N6 is an integer greater than or equal to 2;
[0231] Wherein, the network quality of the first network is higher than the first quality requirement, including: j1 / N1 is greater than k1 / N4, and m1 / N2 is greater than n1 / N5, and p1 / N3 is greater than q1 / N6.
[0232] The first application of the embodiment of the application can be an application sensitive to delay, and requiring high throughput and high packet loss rate.
[0233] In the embodiments of this application, the duration of each network test in the N1 network tests is the same, the duration of each network test in the N2 network tests is the same, the duration of each network test in the N3 network tests is the same, the duration of each network test in the N4 network tests is the same, the duration of each network test in the N5 network tests is the same, and the duration of each network test in the N6 network tests is the same. For example, the duration of each network test in the N1 network tests can be a first set duration. The first set duration can be any value between 30 milliseconds (ms) and 30 seconds (s). For example, the first set duration can be 100 ms. Within the first set duration, a network test for measuring the delay time can be completed. The duration of each network test in the N2 network tests can be a second set duration. The second set duration can be any value between 30 milliseconds (ms) and 30 seconds (s). For example, the second set duration can be 1000 ms. Within the second set duration, a network test for measuring the throughput can be completed. The duration of each network test in the N3 network tests can be a third set duration. The third set duration can be any value between 30 milliseconds (ms) and 30 seconds (s). For example, the third set duration can be 500 ms. Within the third set duration, a network test for measuring the packet loss rate can be completed. The duration of each network test in the N4 network tests can be a fourth set duration. The fourth set duration can be any value between 30 milliseconds (ms) and 30 seconds (s). For example, the fourth set duration can be 100 ms. Within the fourth set duration, a network test for measuring the delay time can be completed. The duration of each network test in the N5 network tests can be a fifth set duration. The fifth set duration can be any value between 30 milliseconds (ms) and 30 seconds (s). For example, the fifth set duration can be 1000 ms. Within the fifth set duration, a network test for measuring the throughput can be completed. The duration of each network test in the N6 network tests can be a sixth set duration. The sixth set duration can be any value between 30 milliseconds (ms) and 30 seconds (s). For example, the sixth set duration can be 500 ms. Within the sixth set duration, a network test for measuring the packet loss rate can be completed.
[0234] The first set time length and the fourth set time length can be the same, the second set time length and the fifth set time length can be the same, the third set time length and the sixth set time length can be the same, the first set time length, the second set time length and the third set time length can be different from each other, and the fourth set time length, the fifth set time length and the sixth set time length can be different from each other. Taking the round trip time RTT as an example, the delay time can be the time required for the terminal device to start sending a test data packet to the receiving end to receive an acknowledgement data packet sent by the receiving end, that is, the round trip time RTT detected in this network test. The throughput can be the uplink data volume, the downlink data volume, or the uplink data volume and the downlink data volume. The throughput can be measured in one network test, and the packet loss rate can also be measured in one network test.
[0235] N1, N2, N3, N4, N5 and N6 can be equal or not equal. In the case of N1 equal to N2 equal to N3 equal to N4 equal to N5 equal to N6, the network quality of the first network is higher than the first quality requirement, including: j1 is greater than k1, and m1 is greater than n1, and p1 is greater than q1. In the case of N1 not equal to N2, the network quality of the first network is higher than the first quality requirement, including: j1 / N1 is greater than k1 / N4, and m1 / N2 is greater than n1 / N5, and p1 / N3 is greater than q1 / N6. When the time required for measuring the delay time, measuring the throughput and measuring the packet loss rate is greatly different, the measurement of the delay time, the measurement of the throughput and the measurement of the packet loss rate can be completed in three network tests respectively, and do not need to be completed in the same network test, which can improve the efficiency of network test. For example, if the time required for testing the delay time is about 100ms, the time required for testing the throughput is about 1000ms, and the time required for testing the packet loss rate is about 500ms, in the case of separate measurement of the delay time, the throughput and the packet loss rate, 100 times of delay time measurement, 10 times of throughput measurement and 20 times of packet loss rate measurement can be completed within 10s. In the case of the measurement of the delay time, the measurement of the throughput and the measurement of the packet loss rate in the same network test, only 10 times of delay time measurement, 10 times of throughput measurement and 10 times of packet loss rate measurement can be completed within 10s.
[0236] The first threshold, the second threshold and the third threshold can be set as fixed values, for example, the first threshold, the second threshold and the third threshold can be set in advance, and can be stored in the storage (such as a non-volatile memory) of the terminal device.
[0237] Optionally, the first threshold value can be related to the application. For different applications, the first threshold value can be set differently. For example, for an application that is sensitive to delay, the first threshold value can be set relatively small, and for an application that is not sensitive to delay, the first threshold value can be set relatively large. The second threshold value can be related to the application. For different applications, the second threshold value can be set differently. For example, for an application that has a high requirement on throughput, the second threshold value can be set relatively large, and for an application that has a low requirement on throughput, the first threshold value can be set relatively small. The third threshold value can be related to the application. For different applications, the third threshold value can be set differently. For example, for an application that has a high requirement on packet loss rate, the third threshold value can be set relatively large, and for an application that has a low requirement on packet loss rate, the third threshold value can be set relatively small.
[0238] The embodiment of the present application provides a method for comparing network quality of a first network with a first quality requirement. Whether the network quality of the first network meets the first quality requirement can be determined by counting a number of times that a delay time is less than or equal to a first threshold value in N1 network tests, a number of times that a throughput is greater than or equal to a second threshold value in N2 network tests, a number of times that a packet loss rate is less than or equal to a third threshold value in N3 network tests, a number of times that a delay time is less than or equal to the first threshold value in N4 network tests, a number of times that the throughput is greater than or equal to the second threshold value in N5 network tests, and a number of times that the packet loss rate is less than or equal to the third threshold value in N6 network tests. Without complex calculation, whether the network quality of the first network meets the first quality requirement can be determined accurately.
[0239] Optionally, the first network includes a WIFI network, and the second network includes a cellular network; or the first network includes a cellular network, and the second network includes a WIFI network.
[0240] In the embodiment of the present application, the network quality of the WIFI network is detected in a time period after a start instruction for the first application is detected and before the first application is started. In a case where the WIFI network is a network currently used by the terminal device, and the network quality of the WIFI network is lower than the first quality requirement, the network currently used by the terminal device is switched from the WIFI network to a cellular network in the time period.
[0241] The network quality of the cellular network is detected in a time period after a start instruction for the first application is detected and before the first application is started. In a case where the cellular network is a network currently used by the terminal device, and the network quality of the cellular network is lower than the first quality requirement, the network currently used by the terminal device is switched from the cellular network to a WIFI network in the time period.
[0242] In the embodiments of the present application, the network quality of the WIFI network is detected in a time period after the starting instruction for the first application is detected and before the first application is started, the network currently used by the terminal device is the cellular network, and the network quality of the WIFI network is higher than the first quality requirement, the network currently used by the terminal device is switched from the cellular network to the WIFI network in the time period.
[0243] In the embodiments of the present application, the network quality of the cellular network is detected in a time period after the starting instruction for the first application is detected and before the first application is started, the network currently used by the terminal device is the WIFI network, and the network quality of the cellular network is higher than the first quality requirement, the network currently used by the terminal device is switched from the WIFI network to the cellular network in the time period.
[0244] The embodiments of the present application can be applied to the scenario of switching from the WIFI network to the cellular network, and can also be applied to the scenario of switching from the cellular network to the WIFI network.
[0245] Optionally, the first application includes a game application or a video application.
[0246] The time period after the starting instruction for the first application is detected and before the first application is started is a loading time period of the first application.
[0247] In the embodiments of the present application, for the game application, the loading time period of the game application can be a buffering time period of the game application. For example, when a game application is opened (for example, the icon of the game application is clicked, and the starting instruction for the game application is detected), there is a network buffering process, and the time is generally greater than 5 seconds, which can be called a loading time period. After the buffering is completed, the game starts, and the game application is started at this time.
[0248] For example, when a video application is opened (for example, the icon of the video application is clicked, and the starting instruction for the video application is detected), there is a loading process of the application, and the time period can be called a loading time period (for example, an advertisement can be displayed in the loading time period). After the loading is completed, the video application is entered, and the video application is started at this time.
[0249] Please refer to Figure 4 , Figure 4 is a flowchart of another network switching method provided by the embodiments of the present application. As shown in Figure 4 , the method can include the following steps.
[0250] 401, in the case that the starting instruction for the game application is detected, the terminal device detects the network quality of the first network.
[0251] 402, in the case that the first network is the network currently used by the terminal device, and the network quality of the first network is lower than the network quality of the first quality requirement, the terminal device switches the network currently used by the terminal device from the first network to the second network before the game application is started; the first quality requirement comprises the network quality requirement of the game application or the network quality of the second network.
[0252] The specific implementation of steps 401 to 402 can refer to the description of steps 101 to 102 above, which will not be repeated here.
[0253] After step 402 is performed, step 403 or 405 can be further performed.
[0254] 403, in the loading time period of the game application, the terminal device detects the network quality of the second network.
[0255] 404, in the case that the second network is the network currently used by the terminal device, and the network quality of the second network is lower than the second quality requirement, the network currently used by the terminal device is switched from the second network to the first network in the loading time period of the game application; the second quality requirement comprises the network quality requirement of the game application or the network quality of the first network.
[0256] 405, in the loading time period of the game application, the terminal device detects the network quality of the first network.
[0257] After step 405 is performed, step 402 can be performed.
[0258] In the embodiments of the present application, in the game scenario, first, a game application is selected, and then the game loading time period of the game application is entered, which generally lasts for 30-180 seconds. The network switching of the embodiments of the present application is in this game loading time period, and the network mode in the subsequent game process is determined. In the subsequent game process, network switching cannot be performed again. The next network switching should be performed in the loading time period of the game after the current game is finished and the game is started again.
[0259] In the embodiments of the present application, after each game is finished, network switching can be performed in the loading time period of the game application, so that the game application always works in a better network state, and the network experience of the game application is improved.
[0260] The network selection strategy and the specific process of network switching in the case that the first application is a game application will be specifically described below. Figures 5-16
[0261] Please refer to Figure 5 , Figure 5 is a network selection strategy diagram of a network switching method from a WIFI network to a cellular network provided by an embodiment of the present application. As shown in Figure 5 , the method can include the following steps.
[0262] First step: open game mode
[0263] Second step: evaluate WIFI network quality
[0264] Third step: intelligently select network
[0265] Fourth step: enter game
[0266] Fifth step: end
[0267] Among them, the second step and the third step are executed between the game buffer. Opening the game mode can be an operation of clicking the icon of the game application. Entering the game can be that the buffer loading of the game application is completed and the game starts.
[0268] During the "opening game mode" and "entering game", the game loading needs a certain time; the intelligent network selection is to complete the network quality evaluation and output the final network selection strategy in this time period, and when entering the game, the network remains stable and does not change the network mode.
[0269] Please refer to Figure 6 , Figure 6 is a specific flow diagram of a network switching method from a WIFI network to a cellular network provided by an embodiment of the present application. As shown in Figure 6 , the method can include the following steps.
[0270] First step, start
[0271] Second step, network quality evaluation; that is, evaluating WIFI network quality, wherein the WIFI network is the network currently used by the terminal device, which can be equivalent to the first network in Figure 1 ;
[0272] Third step, extract RTT data
[0273] Fourth step, respectively give i and j initial values, i=0, j=0
[0274] Fifth step, judge whether RTT_i is less than △t
[0275] If "yes", j=j+1, go to the next step
[0276] If "no", go to the next step directly
[0277] Sixth step, judge whether i is greater than N
[0278] If "Yes", output j value, go to next step;
[0279] If "No", return to previous step;
[0280] Step 7, judge whether j is greater than k;
[0281] If "Yes", keep WIFI network unchanged;
[0282] If "No", WIFI switches to cellular network; wherein, the cellular network can be equivalent to the second network in Figure 1 ;
[0283] Step 8, end.
[0284] Similarly, the network selection strategy and process of switching from the cellular network to the WIFI network are shown in Figure 7 and Figure 8 , respectively. The specific network selection strategy and process are similar to Figure 5 and Figure 6 , which will not be described here.
[0285] In the embodiments of the present application, based on the optimized network switching process, the network selection strategy as shown in Figure 5 , Figure 7 and the network selection process as shown in Figure 6 , Figure 8 are constructed. Compared with the original process, the new process will make a detailed evaluation and judgment on the current network quality before switching, to determine whether network switching is needed finally, improving the reliability of network switching.
[0286] After evaluating the WIFI network signal quality, it is judged whether to trigger the switching operation to the cellular. However, in this process, only the WIFI network signal quality is evaluated, and the cellular network signal is not evaluated; there is a possibility that the cellular network signal is worse than the WIFI. At this time, the WIFI network signal is analyzed to be poor and switched to the cellular network, which will cause the terminal device to be in a worse network signal environment. Even in the unstable scenario of WIFI or cellular network, there is a "ping-pong effect" of switching between the two network modes. Similarly, the cellular switching WIFI network also has similar problems. Therefore, before the network switching operation, the cellular and WIFI signals need to be evaluated respectively.
[0287] Please refer to Figure 9 , Figure 9 is another network selection strategy diagram of the network switching method provided by the embodiments of the present application for switching from the cellular network to the WIFI network.
[0288] The first step is to evaluate the cellular network quality; wherein the cellular network is a network currently used by the terminal device, which is equivalent to the second network in Figure 3 ;
[0289] The second step is to open the game mode; wherein the game mode is opened, which is equivalent to detecting a starting instruction for the game application;
[0290] The third step is to evaluate the WIFI network quality; wherein the WIFI network is equivalent to the first network in Figure 3 ;
[0291] The fourth step is to compare and analyze the cellular and WIFI network delay times;
[0292] The fifth step is to intelligently select the network;
[0293] The sixth step is to enter the game; wherein entering the game is equivalent to the game application starting being completed;
[0294] The seventh step is to end.
[0295] The third step to the fifth step are performed in the game buffering period. Opening the game mode can be an operation of clicking an icon of the game application. Entering the game can be that buffering loading of the game application is completed, the game application starting is completed, and the game starts.
[0296] During the opening of the game mode and the entering of the game, game loading needs a certain time; the intelligent network selection is to complete network quality evaluation and output the final network selection strategy in the time period, and the network is kept stable and unchanged after entering the game, and the network mode is not switched.
[0297] The comparison and analysis Figure 5 and Figure 9 can be seen, compared with Figure 5 , Figure 9 two steps of "cellular network quality evaluation" and "comparison and analysis of cellular and WIFI network delay times" are added, so that the two networks can be more fully evaluated and compared.
[0298] Please refer to Figure 10 , Figure 10 is a specific flowchart of another network switching method from a cellular network to a WIFI network provided by the embodiment of the present application. As shown in Figure 10 , the method can include the following steps.
[0299] The first part is cellular network detection;
[0300] The first step is to start;
[0301] The second step is to evaluate the cellular network quality; wherein the cellular network is a network currently used by the terminal device, which is equivalent to the second network in Figure 3 ;Figure 3 the second network in the network;
[0302] Third step, extract RTT data;
[0303] Fourth step, give i, j initial value, i=0, j=0;
[0304] Fifth step, judge whether RTT_i is less than △t;
[0305] If "yes", j=j+1, enter next step;
[0306] If "no", directly enter next step;
[0307] Sixth step, output j value;
[0308] Second part: open game mode;
[0309] Third part: WIFI network detection; wherein, WIFI network is equivalent to Figure 3 the first network in the network;
[0310] Seventh step, evaluate WIFI network quality;
[0311] Eighth step, extract RTT data;
[0312] Ninth step, give i, k initial value, i=0, k=0;
[0313] Tenth step, judge whether RTT_i is less than △t;
[0314] If "yes", k=k+1, enter next step;
[0315] If "no", directly enter next step;
[0316] Eleventh step, output k value;
[0317] Fourth part: cellular and WIFI network comparison analysis;
[0318] Twelfth step, judge whether j is greater than k;
[0319] If "yes", keep cellular network unchanged;
[0320] If "no", cellular cuts WIFI network;
[0321] Thirteenth step, end.
[0322] Similarly, WIFI cuts cellular network selection strategy and process, respectively as Figure 11 and Figure 12 shown. The specific network selection strategy and process similar Figure 9 and Figure 10 , not described here.
[0323] by Figure 9 and Figure 11 For example, when considering Wi-Fi and cellular networks, the primary consideration is network latency, selecting networks with lower latency. Factors affecting network signal quality include not only RTT (Round-Trip Time) but also parameters such as throughput. Figure 13 and Figure 14 Add throughput-affecting parameters to the calculation.
[0324] Figure 13 This is a schematic diagram of a network selection strategy for another network switching method from a cellular network to a Wi-Fi network provided in an embodiment of this application. Figure 14 This is a schematic diagram of a network selection strategy for another network switching method from a WIFI network to a cellular network provided in this application embodiment.
[0325] Figure 15 This is a schematic diagram illustrating the specific process of another network switching method from cellular network to WIFI network provided in this application embodiment. Figure 16 This is a schematic diagram illustrating the specific process of another network switching method from a Wi-Fi network to a cellular network provided in this application embodiment.
[0326] from Figure 13 and Figure 15 It can be seen that the network will only switch from cellular to WIFI when both the round-trip latency and throughput of the WIFI network are better than those of the cellular network; otherwise, the cellular network will remain unchanged.
[0327] from Figure 14 and Figure 16 It can be seen that the network will only switch from Wi-Fi to cellular network when both the round-trip latency and throughput of the cellular network are better than those of the Wi-Fi network; otherwise, the Wi-Fi network will remain unchanged.
[0328] It should be noted that factors affecting network quality are not limited to round-trip latency and throughput, but also include other factors. The choice should be based on the specific circumstances.
[0329] Figure 9 , Figure 11 , Figure 13 and Figure 14 It consists of four phases: initial network quality assessment, activating game mode, intelligent network selection (completed within the game buffer time), and entering game mode. The order of these four phases cannot be changed; however, the duration of each phase can be adjusted.
[0330] In the game scene, a game application is first selected, and then a game loading period of the game application is entered. The game loading period generally lasts for 30-180 seconds. The network switching of the embodiment of the application is performed in the game loading period to determine the network mode in the subsequent game process. Network switching cannot be performed in the subsequent game process. Network switching can be performed in the next network switching period based on the game being completed and the game loading period being started.
[0331] The above describes the scheme of the embodiment of the application from the perspective of the execution process of the method. It can be understood that the terminal device includes a hardware structure and / or a software module corresponding to the execution of each function to implement the above functions. Those skilled in the art should easily realize that, in combination with the unit and algorithm steps of each example described in the embodiments provided in the present application, the application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. The skilled person can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the application.
[0332] The embodiment of the application can divide the functional units of the terminal device according to the above method examples. For example, each functional unit can be divided according to each function, or two or more functions can be integrated in one processing unit. The integrated unit can be implemented in the form of hardware or software functional unit. It should be noted that the division of units in the embodiment of the application is illustrative, and is only a logical functional division. Actual implementation can have another division method.
[0333] Please refer to Figure 17 , Figure 17 FIG. 1 is a structural schematic diagram of a network switching device provided by the embodiment of the application. The network switching device 1700 is applied to a terminal device. The network switching device 1700 can include a detection unit 1701 and a switching unit 1702, where:
[0334] The detection unit 1701 is configured to detect the network quality of a first network when a starting instruction for a first application is detected.
[0335] The switching unit 1702 is configured to switch the network currently used by the terminal device from the first network to a second network before the first application is started, when the first network is the network currently used by the terminal device and the network quality of the first network is lower than a first quality requirement. The first quality requirement includes the network quality requirement of the first application or the network quality of the second network.
[0336] Optionally, the network quality is determined based on a quality parameter, the quality parameter comprising at least one of: a delay time, a throughput, a packet loss rate.
[0337] Optionally, the first quality requirement comprises a network quality requirement of the first application, and the quality parameter comprises a delay time.
[0338] The detection unit 1701 detects the network quality of the first network, comprising:
[0339] The N network tests are performed, and it is determined that a number of times that a delay time is less than or equal to a first threshold value in the N network tests is j, N being an integer greater than or equal to 2;
[0340] The network quality requirement of the first application comprises: a number of times that a delay time is less than or equal to the first threshold value in the N network tests is k.
[0341] The network quality of the first network is lower than the first quality requirement, comprising: j is less than k.
[0342] Optionally, the first quality requirement comprises a network quality requirement of the first application, and the quality parameter comprises a throughput.
[0343] The detection unit 1701 detects the network quality of the first network, comprising:
[0344] The N network tests are performed, and it is determined that a number of times that a throughput is greater than or equal to a second threshold value in the N network tests is m, N being an integer greater than or equal to 2;
[0345] The network quality requirement of the first application comprises: a number of times that a throughput is greater than or equal to the second threshold value in the N network tests is n.
[0346] The network quality of the first network is lower than the first quality requirement, comprising: m is less than n.
[0347] Optionally, the first quality requirement comprises a network quality requirement of the first application, and the quality parameter comprises a delay time and a throughput.
[0348] The detection unit 1701 detects the network quality of the first network, comprising:
[0349] The N network tests are performed, and it is determined that a number of times that a delay time is less than or equal to a first threshold value in the N network tests is j, and it is determined that a number of times that a throughput is greater than or equal to a second threshold value in the N network tests is m, N being an integer greater than or equal to 2;
[0350] The network quality requirement of the first application comprises: in the N times of network tests, the number of times of delay time less than or equal to the first threshold value is k, and the number of times of throughput greater than or equal to the second threshold value is n.
[0351] The network quality of the first network is lower than the first quality requirement, comprising: j is less than k, and m is less than n.
[0352] Optionally, the first quality requirement comprises a network quality requirement of the first application, and the quality parameter comprises delay time, throughput and packet loss rate.
[0353] The detection unit 1701 detects the network quality of the first network, comprising:
[0354] The N times of network tests are performed, the number of times of delay time less than or equal to the first threshold value in the N times of network tests is determined as j, the number of times of throughput greater than or equal to the second threshold value in the N times of network tests is determined as m, and the number of times of packet loss rate less than or equal to the third threshold value in the N times of network tests is determined as p; N is an integer greater than or equal to 2.
[0355] The network quality requirement of the first application comprises: in the N times of network tests, the number of times of delay time less than or equal to the first threshold value is k, the number of times of throughput greater than or equal to the second threshold value is n, and the number of times of packet loss rate less than or equal to the third threshold value is q.
[0356] The network quality of the first network is lower than the first quality requirement, comprising: j is less than k, m is less than n, and p is less than q.
[0357] Optionally, the first quality requirement comprises a network quality requirement of the first application, and the quality parameter comprises delay time and throughput.
[0358] The detection unit 1701 detects the network quality of the first network, comprising:
[0359] The N1 times of network tests are performed, and the number of times of delay time less than or equal to the first threshold value in the N1 times of network tests is determined as j; N1 is an integer greater than or equal to 2.
[0360] The N2 times of network tests are performed, and the number of times of throughput greater than or equal to the second threshold value in the N2 times of network tests is determined as m; N2 is an integer greater than or equal to 2.
[0361] The network quality requirement of the first application comprises: in the N1 times of network tests, the number of times of delay time less than or equal to the first threshold value is k; and in the N2 times of network tests, the number of times of throughput greater than or equal to the second threshold value is n.
[0362] The network quality of the first network is lower than the first quality requirement, including: j is less than k, and m is less than n.
[0363] Optionally, the first quality requirement comprises a network quality requirement of the first application, and the quality parameter comprises a delay time, a throughput and a packet loss rate.
[0364] The detection unit 1701 detects the network quality of the first network, including:
[0365] Performing N1 times of network test, determining that the number of times that the delay time is less than or equal to a first threshold in the N1 times of network test is j times; N1 is an integer greater than or equal to 2;
[0366] Performing N2 times of network test, determining that the number of times that the throughput is greater than or equal to a second threshold in the N2 times of network test is m times; N2 is an integer greater than or equal to 2;
[0367] Performing N3 times of network test, determining that the number of times that the packet loss rate is less than or equal to a third threshold in the N3 times of network test is p times; N3 is an integer greater than or equal to 2;
[0368] The network quality requirement of the first application comprises: the number of times that the delay time is less than or equal to the first threshold in the N1 times of network test is k times, the number of times that the throughput is greater than or equal to the second threshold in the N2 times of network test is n times, and the number of times that the packet loss rate is less than or equal to the third threshold in the N3 times of network test is q times.
[0369] The network quality of the first network is lower than the first quality requirement, including: j is less than k, and m is less than n, and p is less than q.
[0370] Optionally, the switching unit 1702 is further configured to, in a case where the second network is a network currently used by the terminal device, and the network quality of the first network is higher than the first quality requirement, switch the network currently used by the terminal device from the second network to the first network before the first application is started.
[0371] Optionally, the detection unit 1701 is further configured to, before detecting the starting instruction of the first application, detect the network quality of the second network.
[0372] The switching unit 1702 switches the network currently used by the terminal device from the second network to the first network before the first application is started, in a case that the second network is the network currently used by the terminal device, and the network quality of the first network is higher than a first quality requirement, including: switching the network currently used by the terminal device from the second network to the first network before the first application is started, in a case that the network quality of the first network is higher than the first quality requirement.
[0373] Optionally, the first quality requirement comprises network quality of the second network, and the quality parameter comprises a delay time.
[0374] The detection unit 1701 detects the network quality of the first network, including:
[0375] Performing N1 times of network test, determining that the number of times that the delay time is less than or equal to a first threshold in the N1 times of network test is j1; N1 is an integer greater than or equal to 2;
[0376] The detection unit 1701 detects the network quality of the second network, including:
[0377] Performing N2 times of network test, determining that the number of times that the delay time is less than or equal to the first threshold in the N2 times of network test is k1; N2 is an integer greater than or equal to 2;
[0378] Wherein, the network quality of the first network is higher than the first quality requirement, including: j1 / N1 is greater than k1 / N2.
[0379] Optionally, the first quality requirement comprises network quality of the second network, and the quality parameter comprises a throughput.
[0380] The detection unit 1701 detects the network quality of the first network, including:
[0381] Performing N1 times of network test, determining that the number of times that the throughput is greater than or equal to a second threshold in the N1 times of network test is m1; N1 is an integer greater than or equal to 2;
[0382] The detection unit 1701 detects the network quality of the second network, including:
[0383] Performing N2 times of network test, determining that the number of times that the throughput is greater than or equal to the second threshold in the N2 times of network test is n1; N2 is an integer greater than or equal to 2;
[0384] Wherein, the network quality of the first network is higher than the first quality requirement, including: m1 / N1 is greater than n1 / N2.
[0385] Optionally, the first quality requirement comprises network quality of the second network, and the quality parameter comprises delay time and throughput.
[0386] The detection unit 1701 detects network quality of the first network, comprising:
[0387] N1 times of network tests are performed, j1 times of which have delay time less than or equal to a first threshold, and m1 times of which have throughput greater than or equal to a second threshold; N1 is an integer greater than or equal to 2.
[0388] The detection unit 1701 detects network quality of the second network, comprising:
[0389] N2 times of network tests are performed, k1 times of which have delay time less than or equal to the first threshold, and n1 times of which have throughput greater than or equal to the second threshold; N2 is an integer greater than or equal to 2.
[0390] The network quality of the first network is higher than the first quality requirement, comprising: j1 / N1 is greater than k1 / N2, and m1 / N1 is greater than n1 / N2.
[0391] Optionally, the first quality requirement comprises network quality of the second network, and the quality parameter comprises delay time, throughput and packet loss rate.
[0392] The detection unit 1701 detects network quality of the first network, comprising:
[0393] N1 times of network tests are performed, j1 times of which have delay time less than or equal to a first threshold, m1 times of which have throughput greater than or equal to a second threshold, and p1 times of which have packet loss rate less than or equal to a third threshold; N1 is an integer greater than or equal to 2.
[0394] The detection unit 1701 detects network quality of the second network, comprising:
[0395] N2 times of network tests are performed, k1 times of which have delay time less than or equal to the first threshold, n1 times of which have throughput greater than or equal to the second threshold, and q1 times of which have packet loss rate less than or equal to the third threshold; N2 is an integer greater than or equal to 2.
[0396] The network quality of the first network is higher than a first quality requirement, including: j1 / N1 is greater than k1 / N3, and m1 / N2 is greater than n1 / N4.
[0397] Optionally, the first quality requirement includes network quality of the second network, and the quality parameter includes a delay time and a throughput.
[0398] The detection unit 1701 detects network quality of a first network, including:
[0399] N1 times of network tests are performed, and it is determined that a number of times of delay time being less than or equal to a first threshold in the N1 times of network tests is j1 times; N1 is an integer greater than or equal to 2.
[0400] N2 times of network tests are performed, and it is determined that a number of times of throughput being greater than or equal to a second threshold in the N2 times of network tests is m1 times; N2 is an integer greater than or equal to 2.
[0401] The detection unit 1701 detects network quality of a second network, including:
[0402] N3 times of network tests are performed, and it is determined that a number of times of delay time being less than or equal to the first threshold in the N3 times of network tests is k1 times; N3 is an integer greater than or equal to 2.
[0403] N4 times of network tests are performed, and it is determined that a number of times of throughput being greater than or equal to the second threshold in the N4 times of network tests is n1 times; N4 is an integer greater than or equal to 2.
[0404] The network quality of the first network is higher than a first quality requirement, including: j1 / N1 is greater than k1 / N3, and m1 / N2 is greater than n1 / N4.
[0405] Optionally, the first quality requirement includes network quality of the second network, and the quality parameter includes a delay time, a throughput and a packet loss rate.
[0406] The detection unit 1701 detects network quality of a first network, including:
[0407] N1 times of network tests are performed, and it is determined that a number of times of delay time being less than or equal to a first threshold in the N1 times of network tests is j1 times; N1 is an integer greater than or equal to 2.
[0408] N2 times of network tests are performed, and it is determined that a number of times of throughput being greater than or equal to a second threshold in the N2 times of network tests is m1 times; N2 is an integer greater than or equal to 2.
[0409] performing N3 network tests, determining a number of times that a packet loss rate in the N3 network tests is less than or equal to a third threshold value as p1; N1 is an integer greater than or equal to 2;
[0410] The detection unit 1701 detects the network quality of the second network, comprising:
[0411] performing N4 network tests, determining a number of times that a delay time in the N4 network tests is less than or equal to a first threshold value as k1; N4 is an integer greater than or equal to 2;
[0412] performing N5 network tests, determining a number of times that a throughput in the N5 network tests is greater than or equal to a second threshold value as n1; N5 is an integer greater than or equal to 2;
[0413] performing N6 network tests, determining a number of times that a packet loss rate in the N6 network tests is less than or equal to the third threshold value as q1; N6 is an integer greater than or equal to 2;
[0414] The network quality of the first network is higher than a first quality requirement, comprising: j1 / N1 is greater than k1 / N4, and m1 / N2 is greater than n1 / N5, and p1 / N3 is greater than q1 / N6.
[0415] Optionally, the network switching apparatus 1700 can further comprise a maintaining unit 1703.
[0416] The maintaining unit 1703 is configured to maintain the network currently used by the terminal device as the first network in a case that the first network is the network currently used by the terminal device, and the network quality of the first network is higher than the first quality requirement.
[0417] Optionally, the maintaining unit 1703 is further configured to maintain the network currently used by the terminal device as the second network in a case that the second network is the network currently used by the terminal device, and the network quality of the first network is lower than the first quality requirement.
[0418] Optionally, the first network comprises a WIFI network, and the second network comprises a cellular network; or, the first network comprises a cellular network, and the second network comprises a WIFI network.
[0419] Optionally, the time period after detecting the starting instruction for the first application and before the first application is started completely is a loading time period of the first application.
[0420] Optionally, the first application comprises a game application or a video application.
[0421] Optionally, the first application comprises a game application, and the detection unit 1701 is further configured to detect the network quality of the first network in a loading time period of the game application after the switching unit 1702 switches the network currently used by the terminal device from the first network to the second network before the first application is started completely.
[0422] Alternatively, the detection unit 1701 is further configured to detect the network quality of the second network in the loading time period of the game application.
[0423] The switching unit 1702 is further configured to switch the network currently used by the terminal device from the second network to the first network in the loading time period of the game application in a case where the second network is the network currently used by the terminal device and the network quality of the second network is lower than a second quality requirement, wherein the second quality requirement comprises a network quality requirement of the game application or a network quality of the first network.
[0424] In the embodiments of the present application, the detection unit 1701 can be a processor or a communication module in the terminal device, and the switching unit 1702 and the maintaining unit 1703 can be a processor in the terminal device.
[0425] Figure 17 The specific implementation of the network switching apparatus 1700 shown can be referred to the method embodiments shown in the present application, which will not be described here in detail. Figures 1-16 The specific implementation of the network switching apparatus 1700 shown can be referred to the method embodiments shown in the present application, which will not be described here in detail.
[0426] In the embodiments of the present application, the network quality of the first network is detected in a time period after the detection of the starting instruction of the first application and before the first application is started completely, and the network currently used by the terminal device is switched from the first network to the second network in a case where the network quality of the first network is lower than a first quality requirement. Since a starting time is needed after the starting instruction of the first application is received, the first application will not be started immediately, and the network is switched in the time period from the reception of the starting instruction of the first application to the completion of the starting of the first application, which avoids the early or late network switching, and thus the appropriate network switching time can be selected, thereby improving the online experience.
[0427] Please refer to Figure 18 , Figure 18 is a structural schematic diagram of a terminal device provided in the embodiments of the present application, as shown in Figure 18As shown, the terminal device 1800 includes a processor 1801 and a memory 1802, which can be connected to each other through a communication bus 1803. The communication bus 1803 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The communication bus 1803 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 18 The memory 1802 is configured to store a computer program, and the computer program includes program instructions. The processor 1801 is configured to invoke the program instructions. The above program includes a program for executing Figures 1-16 Some or all of the steps in the method shown.
[0428] The memory 1802 can be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (RAM) or other type of dynamic storage device that can store information and instructions, an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disk storage, a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to this. The memory can exist independently and be connected to the processor through a bus. The memory can also be integrated with the processor.
[0429] The terminal device 1800 can also include a communication module 1804, which can include a radio frequency module, an antenna, etc.
[0430] In the embodiments of the present application, the network quality of the first network is detected in a time period after the starting instruction for the first application is detected and before the first application is started, and in a case where the network quality of the first network is lower than the first quality requirement, the network currently used by the terminal device is switched from the first network to the second network. Since a starting time is required after the starting instruction for the first application is received, the first application will not be started immediately, and the network is switched in the time period from the time when the starting instruction for the first application is received to the time when the first application is started, so that the network is not switched too early or too late, and the time for network switching can be selected appropriately, thereby improving the online experience.
[0431] The embodiments of the present application also provide a computer readable storage medium, wherein the computer readable storage medium stores a computer program for electronic data exchange, and the computer program causes a computer to execute part or all steps of any one of the network switching methods described in the above method embodiments.
[0432] It should be noted that, for the above method embodiments, in order to simply describe, they are all described as a combination of a series of actions, but those skilled in the art should know that the present application is not limited to the action sequence described, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0433] In the above embodiments, the description of each embodiment is focused on, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.
[0434] In several embodiments provided in the present application, it should be understood that the disclosed apparatus can be implemented by other means. For example, the apparatus embodiments described above are only schematic, and the division of the units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interfaces, apparatuses or units, and can be electrical or other forms.
[0435] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, that is, they can be located in one place, or can be distributed on a plurality of network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the present embodiment scheme.
[0436] In addition, each functional unit in the embodiments of the application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software program module.
[0437] When the integrated unit is realized in the form of a software program module and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the application essentially or the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, a terminal device, or a network device, etc.) to execute all or part of the steps of the methods described in the embodiments of the application. The aforementioned storage medium includes: a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store program codes.
[0438] A person of ordinary skill in the art can understand that all or part of the steps of the various methods of the above embodiments can be completed by a program instructing relevant hardware, and the program can be stored in a computer readable storage medium, which can include a flash disk, a read-only memory, a random access memory, a magnetic disk or an optical disk, etc.
[0439] The embodiments of the application are described in detail above, and the principles and implementation manners of the application are described by applying specific examples. The above description of the embodiments is only used to help understand the method of the application and its core idea; meanwhile, for a person of ordinary skill in the art, according to the idea of the application, the specific implementation manner and application range can be changed, and the above description of the embodiments should not be understood as a limitation of the application.
Claims
1. A network handover method, characterized in that, include: Periodically check the network quality of the second network; Upon detecting a launch command for the first application, launch the first application and check the network quality of the first network; If the first network is the network currently used by the terminal device, and the network quality of the first network is lower than the first quality requirement, the network currently used by the terminal device shall be switched from the first network to the second network before the first application is launched; the first quality requirement includes the network quality requirement of the first application or the network quality of the second network.
2. The method according to claim 1, characterized in that, The network quality is determined based on quality parameters, which include at least one of latency, throughput, and packet loss rate.
3. The method according to claim 2, characterized in that, The first quality requirement includes the network quality requirements of the first application, and the quality parameter includes latency. The detection of the network quality of the first network includes: Perform N network tests and determine the number of times the latency time is less than or equal to the first threshold in the N network tests as j, where N is an integer greater than or equal to 2; The network quality requirements for the first application include: the number of times the latency is less than or equal to the first threshold in N network tests is k. The network quality of the first network is lower than the first quality requirement, including: j is less than k.
4. The method according to claim 2, characterized in that, The first quality requirement includes the network quality requirements of the first application, and the quality parameters include throughput; The detection of the network quality of the first network includes: Perform N network tests and determine the number of times the throughput is greater than or equal to the second threshold in the N network tests as m, where N is an integer greater than or equal to 2; The network quality requirements for the first application include: the number of times the throughput is greater than or equal to the second threshold in N network tests is n. The network quality of the first network is lower than the first quality requirement, including: m is less than n.
5. The method according to claim 2, characterized in that, The first quality requirement includes the network quality requirements of the first application, and the quality parameters include latency and throughput; The detection of the network quality of the first network includes: Perform N network tests, determine j times that the latency is less than or equal to a first threshold in the N network tests, and m times that the throughput is greater than or equal to a second threshold in the N network tests; N is an integer greater than or equal to 2; The network quality requirements for the first application include: in N network tests, the number of times the latency is less than or equal to the first threshold is k, and the number of times the throughput is greater than or equal to the second threshold is n. The network quality of the first network is lower than the first quality requirement, including: j is less than k and m is less than n.
6. The method according to claim 2, characterized in that, The first quality requirement includes the network quality requirements of the first application, and the quality parameters include latency, throughput, and packet loss rate; The detection of the network quality of the first network includes: Perform N network tests, determine the number of times the latency is less than or equal to the first threshold in the N network tests as j, determine the number of times the throughput is greater than or equal to the second threshold in the N network tests as m, and determine the number of times the packet loss rate is less than or equal to the third threshold in the N network tests as p; N is an integer greater than or equal to 2; The network quality requirements for the first application include: in N network tests, the number of times the latency is less than or equal to the first threshold is k, the number of times the throughput is greater than or equal to the second threshold is n, and the number of times the packet loss rate is less than or equal to the third threshold is q. The network quality of the first network is lower than the first quality requirement, including: j is less than k, m is less than n, and p is less than q.
7. The method according to claim 2, characterized in that, The method further includes: If the second network is the network currently used by the terminal device, and the network quality of the first network is higher than the first quality requirement, the network currently used by the terminal device shall be switched from the second network to the first network before the first application is launched.
8. The method according to claim 7, characterized in that, The step of switching the network currently used by the terminal device from the second network to the first network before the first application finishes launching, when the second network is the network currently used by the terminal device and the network quality of the first network is higher than the first quality requirement, includes: If the network quality of the first network is higher than the first quality requirement, the network currently used by the terminal device shall be switched from the second network to the first network before the first application is launched.
9. The method according to claim 8, characterized in that, The first quality requirement includes the network quality of the second network, and the quality parameter includes latency. The detection of the network quality of the first network includes: Perform N1 network tests, and determine j1 times in the N1 network tests that the latency time is less than or equal to the first threshold; N1 is an integer greater than or equal to 2; The detection of the network quality of the second network includes: Perform N2 network tests, and determine k1 times in the N2 network tests where the latency is less than or equal to the first threshold; N2 is an integer greater than or equal to 2. The network quality of the first network is higher than the first quality requirement, including: j1 / N1 is greater than k1 / N2.
10. The method according to claim 8, characterized in that, The first quality requirement includes the network quality of the second network, and the quality parameters include throughput; The detection of the network quality of the first network includes: Perform N1 network tests, and determine m1 times in the N1 network tests that the throughput is greater than or equal to the second threshold; N1 is an integer greater than or equal to 2; The detection of the network quality of the second network includes: Perform N2 network tests, and determine the number of times the throughput is greater than or equal to the second threshold in the N2 network tests as n1; N2 is an integer greater than or equal to 2; Wherein, the network quality of the first network is higher than the first quality requirement, including: m1 / N1 is greater than n1 / N2.
11. The method according to claim 8, characterized in that, The first quality requirement includes the network quality of the second network, and the quality parameters include latency and throughput. The detection of the network quality of the first network includes: Perform N1 network tests, and determine the number of times the latency is less than or equal to the first threshold in the N1 network tests as j1 times, and determine the number of times the throughput is greater than or equal to the second threshold in the N1 network tests as m1 times; N1 is an integer greater than or equal to 2; The detection of the network quality of the second network includes: Perform N2 network tests, and determine k1 times in the N2 network tests when the latency is less than or equal to the first threshold, and n1 times in the N2 network tests when the throughput is greater than or equal to the second threshold; N2 is an integer greater than or equal to 2; The network quality of the first network is higher than the first quality requirement, including: j1 / N1 is greater than k1 / N2, and m1 / N1 is greater than n1 / N2.
12. The method according to claim 8, characterized in that, The first quality requirement includes the network quality of the second network, and the quality parameters include latency, throughput, and packet loss rate; The detection of the network quality of the first network includes: Perform N1 network tests, and determine the number of times the latency is less than or equal to the first threshold in the N1 network tests as j1 times, the number of times the throughput is greater than or equal to the second threshold in the N1 network tests as m1 times, and the number of times the packet loss rate is less than or equal to the third threshold in the N1 network tests as p1 times; N1 is an integer greater than or equal to 2. The detection of the network quality of the second network includes: Perform N2 network tests, and determine the number of times the latency is less than or equal to the first threshold in the N2 network tests as k1 times, the number of times the throughput is greater than or equal to the second threshold in the N2 network tests as n1 times, and the number of times the packet loss rate is less than or equal to the third threshold in the N2 network tests as q1 times; N2 is an integer greater than or equal to 2. The network quality of the first network is higher than the first quality requirement, including: j1 / N1 is greater than k1 / N2, m1 / N1 is greater than n1 / N2, and p1 / N1 is greater than q1 / N2.
13. The method according to claim 1, characterized in that, The method further includes: If the first network is the network currently used by the terminal device, and the network quality of the first network is higher than the first quality requirement, then the network currently used by the terminal device shall remain the first network.
14. The method according to claim 7, characterized in that, The method further includes: If the second network is the network currently used by the terminal device, and the network quality of the first network is lower than the first quality requirement, the network currently used by the terminal device shall remain the second network.
15. The method according to any one of claims 1 to 14, characterized in that, The first network includes a Wi-Fi network, and the second network includes a cellular network; or, the first network includes a cellular network, and the second network includes a Wi-Fi network.
16. The method according to any one of claims 1 to 14, characterized in that, The first application includes game applications or video applications.
17. The method according to claim 16, characterized in that, The first application includes a game application. After switching the network currently used by the terminal device from the first network to the second network before the first application completes startup, the method further includes: During the loading period of the game application, the step of detecting the network quality of the first network is performed; or During the loading period of the game application, the network quality of the second network is detected. If the second network is the network currently used by the terminal device and the network quality of the second network is lower than the second quality requirement, the network currently used by the terminal device is switched from the second network to the first network during the loading period of the game application. The second quality requirement includes the network quality requirement of the game application or the network quality of the first network.
18. A network switching device, characterized in that, include: The detection unit is used to periodically detect the network quality of the second network. The detection unit is also configured to, upon detecting a startup command for the first application, launch the first application and detect the network quality of the first network; The switching unit is configured to switch the network currently used by the terminal device from the first network to the second network before the first application finishes launching, provided that the first network is the network currently used by the terminal device and the network quality of the first network is lower than a first quality requirement; the first quality requirement includes the network quality requirement of the first application or the network quality of the second network.
19. A terminal device, characterized in that, The device includes a processor and a memory, the memory being used to store a computer program, the computer program including program instructions, and the processor being configured to invoke the program instructions to perform the method as described in any one of claims 1 to 17.
20. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, the computer program including program instructions that, when executed by a processor, cause the processor to perform the method as described in any one of claims 1 to 17.
Citation Information
Patent Citations
Network switching method and apparatus, terminal and storage medium
CN108449771A