Channel switching method, electronic device and storage medium

By setting multiple network channels in electronic devices and calculating message parameters using preset cycles, quickly evaluating and switching network channels, the business lag caused by insufficient wireless network quality is solved and the user experience is improved.

CN115484649BActive Publication Date: 2025-08-08HONOR DEVICE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211034773.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2021-06-16
Filing Date
2021-09-27
Publication Date
2025-08-08
Estimated Expiration
2041-09-27

AI Technical Summary

Technical Problem

In some scenarios, the current wireless network quality is not enough to meet business needs, resulting in lag in business operations and reducing user experience.

Method used

By setting the first and second network channels in the electronic device, calculating the message parameters of the data flow using preset periods, setting multiple thresholds according to different network quality, and quickly evaluating and switching network channels to meet the switching speed requirements under different network quality.

Benefits of technology

It improves the switching speed of network channels, reduces the possibility of business operation lag, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115484649B_ABST
    Figure CN115484649B_ABST
Patent Text Reader

Abstract

The present application provides a channel switching method, electronic device, and storage medium. The electronic device includes a first network channel and a second network channel. The method includes: starting a first application, the first application including a first data stream, the first data stream being carried on the first network channel, and the first data stream including a message; creating a second network channel, the first data stream continuing to be carried on the first network channel; calculating preset parameters of the message of the first data stream according to the preset period; if the preset parameters meet preset conditions, switching the first data stream to the second network channel; if the preset parameters do not meet the preset conditions, continuing to carry the first data stream on the first network channel and destroying the second network channel. The present application can reduce the problem of service operation lag and improve the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application. The application number of the original application is 202111137131.0, and the original application date is September 27, 2021. The entire content of the original application is incorporated into this application by reference. Technical Field

[0002] The present application relates to the field of communication technology, and in particular to a channel switching method, electronic equipment, and storage medium. Background Art

[0003] With the rapid development of electronic and internet technologies, mobile devices such as mobile phones are becoming increasingly common in our daily lives. For example, mobile payments and gaming are now possible. To ensure the normal operation of common services (such as games, calls, and social media apps), users typically connect their phones to wireless networks. However, in some scenarios, the current wireless network is insufficient to meet service requirements (for example, due to poor mobile signal conditions), resulting in service interruptions and a potentially degraded user experience. Summary of the Invention

[0004] The present application provides a channel switching method, electronic device and storage medium, which can reduce the lag problem of business operation and improve the user experience.

[0005] In a first aspect, an embodiment of the present application provides a channel switching method, applied to an electronic device, the electronic device including a first network channel and a second network channel, the method comprising: starting a first application, the first application including a first data stream, the first data stream being carried on the first network channel; the first data stream including a message; calculating a preset parameter of the message of the first data stream according to a preset period; when it is determined that the preset parameter is greater than a first threshold in m2 cycles out of m1 consecutive cycles, or when it is determined that the preset parameter is greater than a second threshold in m4 cycles out of m3 consecutive cycles, switching the network channel carrying the first data stream to the second network channel; wherein the first threshold is less than the second threshold, m2≤m1, m4≤m3, m1≥m3, and m2>m4. In this method, two thresholds are set for the preset parameters, so that different network quality assessment delays can be provided under different network qualities of the network channel according to the relative quality of the network quality, thereby providing different network channel switching speeds, thereby meeting the network channel switching speed requirements of the electronic device under different network qualities of the network channel, improving the network channel switching speed, thereby reducing the possibility of service operation lag, and improving user experience.

[0006] In one possible implementation, the method further includes: determining that a preset parameter is greater than a third threshold value in m6 cycles out of m5 consecutive cycles, and switching the network channel carrying the first data stream to a second network channel; wherein the second threshold value is less than the third threshold value, m6≤m5, m3≥m5, and m4>m6. In this method, three or more thresholds can be set for the preset parameters, each threshold value corresponding to a different network quality assessment delay, thereby meeting the network channel switching speed requirements of electronic devices under different network channel qualities, improving the network channel switching speed, and thereby reducing the possibility of service operation lag and improving the user experience.

[0007] In one possible implementation, a first application includes a second data stream, which is carried on a first network channel. The method further includes: upon determining that a preset parameter is greater than a first threshold value in m2 cycles out of m1 consecutive cycles, or upon determining that a preset parameter is greater than a second threshold value in m4 cycles out of m3 consecutive cycles, switching the network channel carrying the second data stream to a second network channel. In this method, when the network quality of the first data stream deteriorates, the second data stream on the same network channel can also be switched to the second network channel, thereby reducing service operation delays caused by poor network quality of the second data stream and improving user experience.

[0008] In a possible implementation, the first data stream and the second data stream are data streams that are sensitive to preset parameters, where the preset parameters include: delay and / or packet loss rate.

[0009] In one possible implementation, calculating preset parameters of a message of the first data stream according to a preset period includes: obtaining a message of the first data stream carried on a first network channel; and calculating preset parameters of the message of the first data stream according to a preset period based on the message of the first data stream.

[0010] In a possible implementation, obtaining a message of the first data stream carried on the first network channel includes: obtaining a message of the first application carried on the first network channel; and obtaining a message of the first data stream from the message of the first application.

[0011] In a possible implementation, obtaining the message of the first data stream from the message of the first application includes: obtaining the heartbeat stream message of the first data stream from the message of the first application.

[0012] In one possible implementation, before switching the network channel carrying the first data stream to the second network channel, the method further includes: when an environmental change is detected or the quality of the first network channel is predicted to deteriorate, obtaining network channels in the electronic device that are available other than the first network channel; performing quality evaluation on the available network channels respectively; selecting the second network channel with the best quality as a backup network channel based on the evaluation results of the quality evaluation; and activating the backup network channel.

[0013] In a possible implementation, switching the network channel carrying the first data stream to the second network channel includes: upon determining that there is an enabled second network channel serving as a backup network channel, switching the network channel carrying the first data stream to the second network channel.

[0014] In one possible implementation, switching the network channel carrying the first data stream to the second network channel further includes: when it is determined that there is no enabled backup network channel, obtaining a network channel in an available state other than the first network channel; performing quality evaluation on the network channels in the available state respectively; selecting the second network channel with the best quality as the backup network channel based on the evaluation result of the quality evaluation; enabling the second network channel as the backup network channel; and switching the network channel carrying the first data stream to the second network channel.

[0015] In a possible implementation, before calculating the preset parameters of the message of the first data flow according to the preset period, the method further includes: determining that the first application is an application in a preset whitelist.

[0016] In a possible implementation, the first network channel is a WIFI channel or a cellular channel, and the second network channel is a WIFI channel or a cellular channel.

[0017] In a possible implementation, the first application is a game application or a video playback application, and the first data stream is a voice stream.

[0018] In a second aspect, an embodiment of the present application provides an electronic device, including:

[0019] A memory, wherein the memory is used to store computer program code, the computer program code includes instructions, the electronic device has multiple network channels, a first application runs on the electronic device, the first application is carried on the first network channel, and the first application includes multiple message streams. When the electronic device reads the instructions from the memory, the electronic device executes the method described in any one of the first aspects.

[0020] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer-readable storage medium is run on a computer, the computer executes the method described in the first aspect.

[0021] In a fourth aspect, an embodiment of the present application provides a computer program, which, when executed by a computer, is used to execute the method described in the first aspect.

[0022] In one possible design, the program in the fourth aspect may be stored in whole or in part on a storage medium packaged with the processor, or may be stored in whole or in part on a memory not packaged with the processor. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1a This is a schematic diagram of a heartbeat flow message with an interval of 1s in an embodiment of the present application;

[0024] Figure 1b Schematic diagram of the round-trip delay calculation method for heartbeat flow messages;

[0025] Figure 1c A schematic diagram of a network quality assessment method based on the RTT of a heartbeat flow message according to an embodiment of the present application;

[0026] Figure 1d This is a schematic diagram of another network quality assessment method based on the RTT of heartbeat flow messages in an embodiment of the present application;

[0027] Figure 2a A schematic diagram of network channel switching for a flow provided in an embodiment of the present application;

[0028] Figure 2b A schematic diagram of network channel switching for another flow provided in an embodiment of the present application;

[0029] Figure 3a A schematic diagram of the mobile phone desktop display provided in an embodiment of the present application;

[0030] Figure 3b A schematic diagram of the application interface provided in an embodiment of the present application;

[0031] Figure 3c A schematic diagram of the application interface of a mobile phone using a primary network channel provided in an embodiment of the present application;

[0032] Figure 3d A schematic diagram of an application interface for a mobile phone using a backup network channel provided in an embodiment of the present application;

[0033] Figure 4 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;

[0034] Figure 5 A schematic diagram of the software architecture of an electronic device provided in an embodiment of the present application;

[0035] Figure 6 A schematic diagram of another software architecture of an electronic device provided in an embodiment of the present application;

[0036] Figure 7 A flow chart of an embodiment of the channel switching method provided by the present application;

[0037] Figure 8 A schematic diagram of the heartbeat flow message structure provided in an embodiment of the present application;

[0038] Figure 9 A statistical diagram of battle flow packets provided in an embodiment of the present application;

[0039] Figure 10 A schematic diagram of the battle flow message structure provided in an embodiment of the present application;

[0040] Figure 11a-Figure 11c A schematic diagram of flow switching provided in an embodiment of the present application;

[0041] Figure 11d A schematic diagram of the sensitive service switching process interaction provided in an embodiment of the present application;

[0042] Figure 11e A schematic diagram of the interaction process for switching non-sensitive services provided in an embodiment of the present application;

[0043] Figure 12 This is a timing diagram of interaction between components of an electronic device according to an embodiment of the present application;

[0044] Figure 13 This is another interaction sequence diagram between components of an electronic device according to an embodiment of the present application;

[0045] Figure 14 This is another interaction sequence diagram between components of an electronic device according to an embodiment of the present application;

[0046] Figure 15 This is a schematic diagram of the implementation principle of the traffic reporting component of the embodiment of the present application;

[0047] Figure 16 A schematic diagram of the code implementation of the registration hook function in the embodiment of the present application;

[0048] Figure 17 A schematic diagram of the code implementation of the registration hook function in the embodiment of the present application;

[0049] Figure 18 This is a schematic diagram of the code implementation of the characteristic information of the embodiment of this application;

[0050] Figure 19This is a schematic diagram of the code implementation of the message filtering embodiment of the present application;

[0051] Figure 20 A schematic diagram of code implementation for sending a target flow and a network quality assessment result of the target flow according to an embodiment of the present application;

[0052] Figure 21 A schematic diagram of code implementation for obtaining the stream to be switched in an embodiment of the present application. DETAILED DESCRIPTION

[0053] The following describes the technical solutions in the embodiments of the present application in conjunction with the accompanying drawings. In the description of the embodiments of the present application, unless otherwise specified, " / " represents "or." For example, A / B can represent A or B. "And / or" in this document is merely a description of the association relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, or B exists alone.

[0054] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of this application, unless otherwise specified, "plurality" means two or more.

[0055] First, the nouns involved in the embodiments of the present application are described in an illustrative but non-limiting manner.

[0056] A WIFI network card is a device that supports Internet access via a Wireless Local Area Network (WLAN).

[0057] The data service network card is a device that supports Internet access through mobile communication technologies such as General Packet Radio Service (GPRS), Enhanced Data Rate for GSM Evolution (EDGE), Time Division-Synchronous Code Division Multiple Access (TD-SCDMA), High Speed Downlink Packet Access (HSDPA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), and Fifth Generation Mobile Communication Technology (5G).

[0058] A network channel refers to any route between two or more nodes in a network, or a route from a source address to a destination address in a network.

[0059] In the embodiments of the present application, the network channel of the electronic device refers to the route established between the device that accesses the Internet using the above-mentioned WIFI network card or data service network card and other electronic devices such as a server. In the embodiments of the present application, the network channel established using the WIFI network card is called the WIFI channel, and the network channel established using the data service network card is called the cellular channel.

[0060] Multiple network channels can be pre-configured in the electronic device. Exemplarily, the multiple network channels may include a primary WIFI channel, a secondary WIFI channel, a primary cellular channel, and a secondary cellular channel, wherein the primary WIFI channel and the secondary WIFI channel can operate in the 2.4 GHz frequency band or the 5 GHz frequency band. Exemplarily, if the primary WIFI channel operates in the 2.4 GHz frequency band, the secondary WIFI channel operates in the 5 GHz frequency band; if the primary WIFI channel operates in the 5 GHz frequency band, the secondary WIFI channel operates in the 2.4 GHz frequency band. In addition, the primary cellular channel and the secondary cellular channel can correspond to the operator network. For example, the primary cellular channel can use SIM card 1 (the SIM card 1 belongs to operator A), and the secondary cellular channel can use SIM card 2 (the SIM card 2 belongs to operator B). Under normal circumstances, the priority of the primary WIFI channel is higher than that of the other three channels. Therefore, the primary network channel is usually the primary WIFI channel. Under normal circumstances, considering the data traffic consumption of the electronic device, the priority of the WIFI channel is higher than the priority of the cellular channel. It is understood that the above-mentioned preset channels are merely exemplary and do not constitute a limitation on the embodiments of the present application. In some embodiments, more or fewer channels may be included. In addition, using the primary Wi-Fi channel as the primary network channel is merely a preferred solution and does not constitute a limitation on the embodiments of the present application. In some embodiments, other network channels may also be selected as the primary network channel.

[0061] With the rapid development of electronic and internet technologies, mobile devices such as mobile phones are becoming increasingly common in people's daily lives. For example, mobile payments and gaming are now possible through mobile phones. To ensure the normal operation of common services (such as games, calls, and social media apps), users typically connect their phones to wireless networks. However, in some scenarios, the current wireless network is insufficient to meet service needs (for example, due to poor mobile signal conditions), resulting in service interruptions and a potentially degraded user experience.

[0062] To address the above issues, electronic devices can open an accelerated channel to meet business needs. The accelerated channel can be a backup network channel. In one example provided in this application, when the network channel quality of a stream of a currently running application deteriorates, the electronic device can switch the stream or multiple streams including the stream to the backup network channel.

[0063] In the above example, before switching a certain flow (hereinafter referred to as flow S for ease of description) or multiple flows including flow S from the currently used network channel to the backup network channel, it is necessary to evaluate the network quality of the network channel currently used by flow S. Based on the network quality evaluation result obtained by the evaluation, a decision is made as to whether to perform the network channel switching. Only when the decision result is to perform the network channel switching, flow S or multiple flows including flow S are switched from the currently used network channel to the backup network channel. For ease of description, the network quality evaluation result of the network channel used by a flow is referred to as the network quality evaluation result of the flow in the following description. For example, the network quality evaluation result of flow S is also the network quality evaluation result of the network channel used by flow S.

[0064] In one embodiment provided in the present application, the preset parameters (such as delay) of the messages of flow S can be periodically calculated based on the messages of flow S, and the network quality of flow S can be evaluated based on whether the preset parameters meet the preset conditions to obtain the network quality evaluation result of flow S.

[0065] In one possible implementation, a threshold 1 can be set for the preset parameter. In each cycle, the preset parameter of the message of flow S is calculated, and the preset parameter is compared with the threshold 1. The network quality of flow S is evaluated based on the comparison result, thereby obtaining the network quality evaluation result of flow S in each cycle (for example, the quality evaluation result may include: good quality or poor quality), and then the network quality evaluation result of flow S is finally determined based on the network quality evaluation results of flow S in several consecutive cycles. For example, when the quality evaluation results of k2 cycles out of k1 consecutive cycles are poor quality, the network quality evaluation result of flow S is determined to be poor, and the above k2 is less than or equal to k1.

[0066] For example, the current application includes a voice stream, and the voice stream includes a heartbeat stream message. The heartbeat stream message is a message that appears at a certain time interval in the stream S (such as the above voice stream). Figure 1a The figure shows a schematic diagram of a heartbeat flow message at a time interval of 1s.

[0067] Round-trip time (RTT) is an important network performance indicator, which represents the total delay from the start of sending data to the time when the sender receives the confirmation from the receiver (the receiver sends the confirmation immediately after receiving the data). Figure 1b , which is a schematic diagram of the round-trip delay calculation method for heartbeat flow messages. Taking the heartbeat flow message transmitted between a user's mobile phone and the server as an example, the round-trip delay of a heartbeat flow message is: the total delay from the user's mobile phone sending a heartbeat request message to the server to the user's mobile phone receiving the heartbeat response message fed back by the server.

[0068] The network quality of the network channel used by the voice stream in the current application can be evaluated based on the RTT of the above heartbeat stream message. Assuming that the time interval of the heartbeat stream message is 1s and the calculation period of the RTT of the heartbeat stream message is 1s, Figure 1c It is a schematic diagram of the RTT of several cycles of the network channel currently used by the application, based on Figure 1c The corresponding relationship table between relative time and RTT can be obtained as shown in Table 1 below.

[0069] Relative time t(s) 1 2 3 4 5 6 7 8 9 Heartbeat round trip delay rtt (ms) 40 40 40 500 500 500 500 500 500

[0070] Table 1

[0071] Assuming that the preset RTT threshold of the heartbeat flow message is 150ms, then if the RTT of the heartbeat flow message calculated in a cycle is greater than 150ms, then the network quality assessment result of the voice flow in the cycle is poor quality; otherwise, the network quality assessment result of the voice flow in the cycle is good quality; based on Table 1, if the network quality assessment result of the voice flow is poor quality in 3 cycles out of 5 consecutive cycles, then the network quality assessment result of the voice flow is poor quality, then the fastest 3 cycles and the slowest 5 cycles are required to determine the network quality assessment result of the voice flow, and then decide whether to switch the network channel based on the network quality assessment result. When the decision result is to switch the network channel, the network channel switching is completed. The network quality assessment process of the voice flow takes too long, affecting the switching efficiency of the network channel, which may cause service operation to be stuck and reduce the user experience.

[0072] In another embodiment provided in the present application, compared with the previous embodiment, the preset condition corresponding to the preset parameter can be expanded from one preset condition to multiple preset conditions.

[0073] Taking the expansion of two preset conditions, preset condition 1 and preset condition 2, as an example, the network quality assessment delays corresponding to the two preset conditions are different. The better the network quality corresponding to the preset condition, the longer the network quality assessment delay is. Otherwise, the network quality assessment delay is relatively shorter. For example, the network quality assessment delay of preset condition 1 is greater than the network quality assessment delay of preset condition 2. Specifically,

[0074] After calculating the preset parameters of the message of flow S according to the preset period, it can be determined whether the preset parameters meet preset conditions 1 and preset conditions 2 respectively. As long as one of the preset conditions is met, flow S or multiple flows including flow S will be switched from the currently used network channel to the backup network channel.

[0075] Continuing with the previous example of heartbeat stream messages, two thresholds, 150ms and 300ms, can be set for the RTT of heartbeat stream messages. The network quality assessment policy corresponding to 150ms is: if the network quality assessment result of stream S is poor in three of five consecutive cycles, the network quality assessment result of stream S is poor. The network quality assessment policy corresponding to 300ms is: if the network quality assessment result of stream S is poor in one cycle, the network quality assessment result of stream S is poor. The network quality corresponding to 150ms is relatively better than the network quality corresponding to 300ms. Based on the above network quality assessment policies, it can be seen that the network quality assessment policy corresponding to 300ms has a delay of one cycle, while the network quality assessment policy corresponding to 150ms has a delay of at least three cycles. The network quality assessment delay corresponding to 300ms is less than the network quality assessment delay corresponding to 150ms, and thus the network channel switching delay corresponding to 300ms is generally less than the network channel switching delay corresponding to 150ms.

[0076] See also Figure 1d As shown, the RTT curve is Figure 1c Same, based on Figure 1d The corresponding relationship table between relative time and RTT can also be obtained as shown in Table 1 above. Figure 1d It can be seen that for this embodiment, in the period corresponding to the 4th second of the relative time, since the RTT value is 500ms, which is greater than 300ms, the network quality assessment strategy corresponding to 300ms can be used to determine that the network quality assessment result of the voice stream is poor, so that the voice stream or multiple streams including the voice stream can be switched to a backup network channel.

[0077] In this method, since at least two preset conditions are set for the preset parameters, different network quality evaluation delays can be provided according to the relative quality of the network under different actual network qualities of the network channel, and thus different network channel switching speeds can be provided. This satisfies the switching speed requirements of electronic devices for the network channel under different network qualities of the network channel, improves the switching speed of the network channel, and thus reduces the possibility of service operation being stuck, thereby improving the user experience.

[0078] The following examples illustrate the scenarios in which the channel switching method in the embodiments of the present application is used.

[0079] In an example provided by an embodiment of the present application, the network quality of each flow of the currently running application is monitored, and when the network quality of a certain flow deteriorates, the flow is switched to a backup network channel for transmission to improve the network quality of the flow. Figure 2aAs shown, taking the first device as a mobile phone as an example, an application on the mobile phone includes stream A and stream B. Stream A and stream B are initially transmitted on the Wi-Fi channel, and no stream of the application is transmitted on the cellular channel. When the network quality of stream B deteriorates, the mobile phone switches stream B to the cellular channel for transmission; after the switch, stream A is transmitted on the Wi-Fi channel, and stream B is transmitted on the cellular channel. In this example, when evaluating the network channel quality of the above streams, the message identification method of the embodiment of the present application can be used to quickly evaluate whether the network channel quality of the stream has deteriorated, thereby quickly implementing network channel switching.

[0080] In another example provided by the embodiment of the present application, when an application has more than one stream, if the network quality of one stream deteriorates, multiple streams including the stream on the same network channel can be switched to a backup network channel, so that the quality assessment result of a single stream can be applied to multiple streams including the single stream, thereby achieving network channel switching for multiple streams, thereby reducing the possibility of application service freezes and improving user experience. Figure 2b , which is a schematic diagram of channel switching for the stream of the current application in an embodiment of the present application. Figure 2b In the example, stream A and stream B are delay-sensitive streams of the application. Stream A and stream B are initially transmitted on the WIFI channel. If it is detected that the quality of stream B has deteriorated (for example, the network delay state of stream B has deteriorated), stream A and stream B on the same WIFI channel are switched to the cellular channel together, so that the network quality evaluation result of stream B is applied to stream A and stream B on the same network channel. By quickly perceiving the network quality of stream B, the network quality of all streams of the same type (for example, delay-sensitive streams) on the same network channel is quickly perceived and the network channel is quickly switched. In this example, when performing network channel quality evaluation on a certain stream, the message identification method of the embodiment of the present application can also be used to quickly evaluate whether the network channel quality of the stream has deteriorated, and then quickly complete the network channel switching.

[0081] An application usually includes multiple streams. Due to the different transmission characteristics of different streams, it is difficult to monitor whether the network quality of some streams has deteriorated. Therefore, even if the electronic device monitors the network quality of all streams of the application in real time, it may not be able to monitor all streams with deteriorated network quality in time. In the embodiment of the present application, when the network quality of a single stream deteriorates, multiple streams including the stream on the same network channel are switched to a backup network channel. The multiple streams can include the stream whose network quality cannot be monitored in time, thereby solving the problem of business operation jams caused by the inability to monitor the deterioration of network quality in time. Still with the above Figure 2bFor example, streams A and B are transmitted on a WIFI channel. If there is a problem with the transmission of the WIFI channel, the network quality of streams A and B will deteriorate, which will in turn cause the application's business operation to be stuck. However, the mobile phone only monitors the deterioration of the network quality of stream B in time, but fails to monitor the deterioration of the network quality of stream A in time. By switching streams A and B to a backup network channel (for example, a cellular channel) together, the problem of business operation stuck caused by the deterioration of the network quality of stream B and the problem of business operation stuck caused by the deterioration of the network quality of stream A are solved, thereby reducing the problem of business operation stuck and improving the user experience.

[0082] Hereinafter, the channel switching method of the present application will be exemplified by taking the above another example.

[0083] pass Figure 3a to Figure 3d The applicable scenarios of the channel switching method in the embodiment of the present application are illustrated with examples.

[0084] Take the example where the first device is a mobile phone. Figure 3a This is a schematic diagram of the mobile phone desktop. Figure 3a As shown, the user can click the video application icon on the mobile phone desktop to open a video application, thereby obtaining the following Figure 3b The video display diagram shown.

[0085] Figure 3c Schematic diagram of the effect after using the main network channel (for example, WIFI channel) for the mobile phone. Figure 3c As shown, after the mobile phone obtains the path of the main network channel, it can use the main network channel to watch the video.

[0086] It is understandable that current network applications (e.g. Figure 3c The video application in the video application may include multiple streams (for example, video streams and audio streams), which can be carried on the above-mentioned main network channel.

[0087] See also Figure 2b If the quality of one stream (for example, a video stream) among multiple streams (for example, a video stream and an audio stream) deteriorates, the multiple streams are switched to a backup network channel together.

[0088] Figure 3d Schematic diagram of using an alternative network channel (e.g., cellular channel) for mobile phones. Figure 3d As shown, when the mobile phone receives the channel switching instruction, the voice stream and video stream can be switched from the current main network channel to the backup network channel, and the backup network channel can be used to watch the video to avoid video jamming.

[0089] The channel switching method provided in this application can be applied to a first device, wherein the first device can be a mobile terminal, terminal device, user equipment (UE), access terminal, subscriber unit, subscriber station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication device, user agent, or user equipment. The first device may be a station (STAION, ST) in a WLAN, a cellular phone, a cordless phone, a Session Initiation Protocol (SIP) phone, a Wireless Local Loop (WLL) station, a Personal Digital Assistant (PDA) device, a handheld device with wireless communication capabilities, a computing device or other processing device connected to a wireless modem, an in-vehicle device, an Internet of Vehicles terminal, a computer, a laptop computer, a handheld communication device, a handheld computing device, a satellite wireless device, a wireless modem card, a TV set-top box (STB), a customer premises equipment (CPE) and / or other devices for communicating on a wireless system and a next-generation communication system, such as a mobile terminal in a 5G network or a mobile terminal in a future evolved Public Land Mobile Network (PLMN) network, etc. The first device 10 may also be a wearable device. Wearable devices, also known as wearable smart devices, are a general term for wearable devices developed by applying wearable technology to intelligently design everyday wearables, such as glasses, gloves, watches, clothing, and shoes. A wearable device is a portable device that is worn directly on the body or integrated into the user's clothing or accessories. Wearable devices are not just hardware devices; they achieve powerful functions through software support, data interaction, and cloud interaction. Broadly speaking, wearable smart devices include those that are full-featured, large in size, and can achieve full or partial functions independently of smartphones, such as smart watches or smart glasses, as well as those that focus on a specific type of application function and need to be used in conjunction with other devices such as smartphones, such as various smart bracelets and smart jewelry for vital sign monitoring.

[0090] The following first introduces the exemplary electronic devices provided in the following embodiments of the present application. Figure 4 A structural diagram of an electronic device 100 is shown, and the electronic device 100 may be the first device mentioned above.

[0091] The electronic device 100 may include a processor 110, an external memory interface 120B, an internal memory 120A, a universal serial bus (USB) interface 130, a charging management module 140A, a power management module 140B, a battery 140C, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0092] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0093] The processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units can be independent devices or integrated into one or more processors. Among them, the controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals based on instruction opcodes and timing signals to complete the control of instruction fetching and execution.

[0094] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.

[0095] The execution of the screenshot method provided in the embodiment of the present application can be controlled by the processor 110 or completed by calling other components, such as calling the processing program of the embodiment of the present application stored in the internal memory 120A to realize the user's screenshot operation and enhance the user experience.

[0096] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.

[0097] The USB interface 130 is an interface that complies with USB standards and may be a Mini USB interface, a Micro USB interface, a USB Type-C interface, or the like. The USB interface 130 can be used to connect a charger to charge the electronic device 100, or to transfer data between the electronic device 100 and peripheral devices. It can also be used to connect headphones to play audio. This interface can also be used to connect other electronic devices, such as augmented reality devices.

[0098] It is understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is merely an illustrative illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.

[0099] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0100] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.

[0101] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0102] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video through the display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.

[0103] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0104] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with a network and other devices through wireless communication technologies. The wireless communication technologies may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).

[0105] Electronic device 100 implements display functionality through a GPU, display screen 194, and an application processor. A GPU is a microprocessor for image processing that connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.

[0106] Display screen 194 is used to display images, videos, and the like. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, or a quantum dot light-emitting diode (QLED). In some embodiments, electronic device 100 may include one or N display screens 194, where N is a positive integer greater than one.

[0107] The electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.

[0108] The ISP processes data fed back by camera 193. For example, when taking a photo, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, which is then passed to the ISP for processing and converted into a visible image. The ISP can also perform algorithmic optimization on image noise, brightness, and skin tone. It can also optimize parameters such as exposure and color temperature of the captured scene. In some embodiments, the ISP can be located within camera 193.

[0109] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then passes the electrical signal to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0110] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0111] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. This allows electronic device 100 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.

[0112] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU can enable intelligent cognitive applications in electronic device 100, such as image recognition, face recognition, speech recognition, and text comprehension.

[0113] The external memory interface 120B can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 via the external memory interface 120B to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.

[0114] The internal memory 120A can be used to store computer executable program codes, which include instructions. The internal memory 120A may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 120A may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the internal memory 120A, and / or instructions stored in a memory provided in the processor.

[0115] The electronic device 100 can implement audio functions such as music playback and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0116] The touch sensor 180K is also called a "touch panel." The touch sensor 180K can be disposed on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen." The touch sensor 180K is used to detect touch operations applied thereto or in the vicinity thereof. The touch sensor can transmit the detected touch operations to the application processor to determine the type of touch event. Visual output related to the touch operations can be provided via the display screen 194. In other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device 100, in a location different from that of the display screen 194.

[0117] In the embodiment of the present application, the user's touch screen data can be obtained through the touch sensor 180K, and the touch screen data can be sent to the processor 110 for processing.

[0118] The buttons 190 include a power button, a volume button, and the like. The buttons 190 may be mechanical buttons or touch buttons. The electronic device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100.

[0119] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.

[0120] The indicator 192 may be an indicator light, which may be used to indicate the charging status, power level changes, messages, missed calls, notifications, etc.

[0121] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to or disconnected from the electronic device 100 by inserting it into or removing it from the SIM card interface 195. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.

[0122] Next, the system framework diagram of the first device is described. Figure 5 As shown, the first device 10 includes an application layer 11, a service layer 12, a policy layer 13 and a kernel layer 14.

[0123] The application layer 11 can be used to provide a variety of network applications. These network applications can be third-party applications or system applications, such as games, music, videos, and other network applications. This application does not specifically limit the types of network applications provided by the application layer 11. Network applications here refer to applications that need to use the network channel of the first device 10 to obtain resources from the network.

[0124] The service layer 12 may include an environment detection component 121, a network detection component 122, a channel-level path management component 123, an application-level policy management component 124, and a channel and application quality assessment component 125. The environment detection component 121 may be used to detect the status of an application. For example, the status of an application may include statuses such as application exit, application opening, application running, application installation, and application uninstallation. It is understood that the above statuses are merely exemplary and may include more statuses, which are not described in detail here. The network detection component 122 may be used to detect the open status of a network channel. The channel-level path management component 123 may be responsible for requesting / closing network channels, sensing changes in network channel status, updating network channel selection policies, and storing paths for multiple network channels. The application-level policy management component 124 may generate different execution policies based on input information. For example, such policies may include enabling acceleration for a network channel or enabling traffic sensing (for example, detecting traffic on a network channel). The channel and application quality assessment component 125 may be used to assess the quality of a network channel. The service layer 12 may further include a network connection management component 126 for enabling a network channel, ie, converting the network channel from a dormant state to an awake state, in which the network channel can be directly used.

[0125] The policy layer 13 may include a flow-level path management component 131, a flow-level policy management component 132, and a traffic perception component 133. Among them, the flow-level path management component 131 can be used to update the selection of network channels according to the policy changes of the upper layer, trigger network channel quality detection, and dynamically select the optimal channel. It can also be used to store the paths of different network channels. For example, it can store the paths of the network channels currently used by the application (for example, the main network channels) and the backup network channels. The flow-level policy management component 132 can be used to indicate the switching of network channels, and can also be used to store the network channel switching policies of the flows in the network application. The traffic perception component 133 can be used to count the reported traffic and evaluate the network quality of each flow.

[0126] The kernel layer 14 may include a traffic reporting component 141 and a policy execution component 142. The traffic reporting component 141 may be used to collect and report traffic information, and the policy execution component 142 may be used to switch network channels.

[0127] It is understood that the interface connection relationship between the components illustrated in the embodiments of the present application is merely a schematic illustration and does not constitute a structural limitation on the first device. In other embodiments of the present application, the first device may also adopt a different interface connection method from the above embodiments, or a combination of multiple interface connection methods.

[0128] above Figure 5The system framework shown is only used to illustrate the implementation of the layered architecture of the first device. Figure 5 The system architecture shown can also be implemented as part of an existing layered software architecture. Taking the Android system as an example, Figure 6 The following is a software structure diagram of an electronic device with an Android system provided by an embodiment of the present application. The layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. Figure 6 In the embodiment of the present application shown, the Android system is divided into five layers, from top to bottom: application layer, application framework layer (also called: system framework layer), system library and Android runtime layer, hardware abstraction layer (HAL) and kernel layer.

[0129] The application layer includes several applications (hereinafter referred to as applications), such as camera, gallery, calendar, WLAN, etc. In one possible example, Figure 5 The application layer in the illustrated system architecture may correspond to this application layer. Figure 6 The application layer of the electronic device shown may include the network applications described in the embodiments of the present application, such as video playback applications, game applications, etc.

[0130] The application framework layer provides application programming interfaces (APIs) and programming frameworks for applications in the application layer, including various components and services to support developers' Android development. The application framework layer also includes some predefined functions. For example, the application framework layer may include a window manager, content provider, resource manager, camera service, etc. In one possible example, Figure 5 The service layer and the policy layer in the system architecture shown can be located in the application framework layer.

[0131] The system library and Android runtime layer include the system library and the Android runtime. The system library can include multiple functional modules, such as the surface manager, 2D graphics engine, 3D graphics processing library (such as OpenGL ES), media library, font library, etc.

[0132] The HAL layer is the interface layer between the operating system kernel and the hardware circuit. The HAL layer includes but is not limited to: Audio Hardware Abstraction Layer (Audio HAL) and Camera Hardware Abstraction Layer (Camera HAL).

[0133] The kernel layer is the layer between hardware and software. The kernel layer may include: display driver, camera driver, audio driver, sensor driver, etc. In one possible example, Figure 5 The kernel layer in the system architecture shown can correspond to Figure 6 In the kernel layer of the software architecture shown, Figure 6 As shown, the kernel layer may include: a traffic reporting component and a policy execution component.

[0134] The following is combined with the above Figures 4 to 6 The first device shown exemplifies the channel switching method of the embodiment of the present application.

[0135] Figure 7 A flow chart of an embodiment of a channel switching method provided in an embodiment of the present application includes:

[0136] Step 301: In response to a user operation, start a network application.

[0137] Specifically, the user can perform an open operation in the first device to open a network application. For example, the user can click on the icon of the network application in the first device. In response to the user's operation, the application layer 11 in the first device starts the network application. It will be understood that the above example only illustrates the scenario of starting the network application by clicking, and does not constitute a limitation of the embodiments of the present application. In some embodiments, the network application can also be started by other operations (for example, double-clicking, sliding, etc.). The above-mentioned network application can be a network-type application such as online games, online videos, and online music.

[0138] Figure 3a This is a schematic diagram of the mobile phone desktop. Figure 3a As shown, the user can click the video application icon on the mobile phone desktop to open a video application, thereby obtaining the following Figure 3b The video display diagram shown.

[0139] In step 302 , the environment detection component 121 detects that a network application has been switched to the foreground or that a network change has occurred, and notifies the application-level policy management component 124 .

[0140] Specifically, the environment detection component 121 in the service layer 12 in the first device can continuously detect the status of the above-mentioned network application or the network environment. When the environment detection component 121 detects that any network application has switched to the foreground or the network environment has changed, it can send a first notification message to the application-level policy management component 124. The first notification message can be used to notify the application-level policy management component 124 that the network application has switched to the foreground or the network environment has changed. It is understandable that the above-mentioned first notification message can also include the identity of the network application (for example, the identity of the network application can be a UID), which can be used to identify the unique identity of the network application.

[0141] For example, the identity of the above network application can be implemented by the following code:

[0142]

[0143] EXPORT_SYMBOL(sock_i_uid).

[0144] Step 303 : The application-level policy management component 124 receives the first notification message sent by the environment detection component 121 and determines whether the current network application meets the conditions for enabling acceleration.

[0145] Specifically, after the application-level policy management component 124 receives the first notification message sent by the environment detection component 121, it can determine from the first notification message that the network application has been switched to the foreground. Then, the application-level policy management component 124 can further determine whether the network application is included in the preset application whitelist.

[0146] In a specific implementation, an application whitelist can be preset in the application-level policy management component 124. The application whitelist can include multiple network applications, each of which can be identified by the above-mentioned identity identifier. The application whitelist can be used to characterize network applications for which acceleration can be enabled. The network applications in the above-mentioned preset application whitelist can include service types. For example, the service types of the network applications in the above-mentioned preset application whitelist can all be sensitive. The sensitive services can include delay-sensitive services, packet loss rate-sensitive services, etc. By comparing the identity identifier of the network application in the first notification message with the identity identifier of the network application in the preset application whitelist, it can be determined whether the network application in the first notification message is included in the preset application whitelist. If the network application in the first notification message is included in the preset application whitelist, it can be determined that the network application meets the conditions for enabling acceleration. If the network application in the first notification message is not included in the preset application whitelist, it can be determined that the network application does not meet the conditions for enabling acceleration.

[0147] For example, Table 2 is a whitelist of network applications.

[0148] Application Name Feature flow type Channel quality parameters Baidu Netdisk Download Stream rate WeChat Video Stream Delay / packet loss game Battle Stream Delay / packet loss

[0149] Table 2

[0150] It can be understood that if the current network application is not in the above-mentioned preset application whitelist, that is, the service type of the current network application is non-sensitive service, then when the first device detects that the main network channel has deteriorated, it can further detect other network channels with better quality, thereby directly switching the above-mentioned non-sensitive service to the network channel with better quality.

[0151] In step 304 , the application-level policy management component 124 sends a channel activation message to the flow-level path management component 131 to activate a network channel.

[0152] Specifically, if the application-level policy management component 124 determines that the current network application meets the conditions for enabling acceleration, it can send a channel enablement message to the flow-level path management component 131, where the channel enablement message is used to indicate that the flow-level path management component 131 can enable a network channel (for example, the main network channel).

[0153] Step 305 : The stream-level path management component 131 requests the path of the primary network channel from the channel-level path management component 123 .

[0154] Specifically, after receiving the channel activation message sent by the application-level policy management component 124, the flow-level path management component 131 can send a primary network channel request to the channel-level path management component 123, wherein the primary network channel request is used to request the path of the primary network channel. Exemplarily, the primary network channel can be a primary Wi-Fi channel.

[0155] In step 306 , the channel-level path management component 123 sends the path of the primary network channel to the flow-level path management component 131 .

[0156] Specifically, the channel-level path management component 123 can pre-configure the paths of multiple network channels. Exemplarily, the multiple network channels may include a primary WIFI channel, a secondary WIFI channel, a primary cellular channel, and a secondary cellular channel, wherein the primary WIFI channel and the secondary WIFI channel can operate in the 2.4 GHz frequency band or the 5 GHz frequency band. Exemplarily, if the primary WIFI channel operates in the 2.4 GHz frequency band, the secondary WIFI channel operates in the 5 GHz frequency band; if the primary WIFI channel operates in the 5 GHz frequency band, the secondary WIFI channel operates in the 2.4 GHz frequency band. In addition, the primary cellular channel and the secondary cellular channel can correspond to the operator network. For example, the primary cellular channel can use SIM card 1 (the SIM card 1 belongs to operator A), and the secondary cellular channel can use SIM card 2 (the SIM card 2 belongs to operator B). Under normal circumstances, the priority of the primary WIFI channel is higher than the other three channels. Therefore, the primary network channel is usually the primary WIFI channel. It will be understood that the above-mentioned preset channels are only exemplary and do not constitute a limitation of the embodiments of the present application. In some embodiments, more channels may be included. In addition, using the main WIFI channel as the main network channel is only a preferred solution and does not constitute a limitation on the embodiments of the present application. In some embodiments, other network channels can also be selected as the main network channel.

[0157] When the channel-level path management component 123 receives the main network channel request sent by the flow-level path management component 131, it can select a network channel from the above-mentioned multiple network channels as the main network channel (for example, the main network channel is the main WIFI channel) and send the path of the main network channel to the flow-level path management component 131.

[0158] Step 307: The stream-level path management component 131 stores the received path of the primary network channel.

[0159] Specifically, after the flow-level path management component 131 receives the path of the primary network channel sent by the channel-level path management component 123, the path of the primary network channel can be stored. For example, the path of the primary network channel can be represented by WIFI1.

[0160] Figure 3c Schematic diagram of the effect after using the main network channel for mobile phones. Figure 3c As shown, after the mobile phone obtains the path of the main network channel, it can use the main network channel to watch the video.

[0161] It is understandable that current network applications (e.g. Figure 3c The video application in the video application may include multiple streams (for example, video streams and audio streams), which can be carried on the above-mentioned main network channel.

[0162] In step 308 , the application-level policy management component 124 sends a traffic detection request to the traffic sensing component 133 .

[0163] Specifically, the traffic detection request can be used to instruct the traffic sensing component 133 to start the packet statistics of the network application on the main network channel. The traffic detection request can include the identity identifier (such as UID) of the network application currently to be detected, and is used to request the detection of the flow of the network application corresponding to the above-mentioned identity identifier UID on the main network channel. It is understandable that the flow of the above-mentioned network application can be in the form of a message.

[0164] It should be noted that step 308 may be performed simultaneously with step 304 or at any time after step 304, and this application does not impose any special limitation on this.

[0165] In step 309 , the traffic sensing component 133 sends a traffic reporting request to the traffic reporting component 141 .

[0166] Specifically, when the traffic sensing component 133 receives the traffic detection request sent by the application-level policy management component 124, it can send a traffic reporting request to the traffic reporting component 141, wherein the traffic reporting request can be used to instruct the traffic reporting component 141 to detect the messages of the network application on the current primary network channel and report the detected messages. It is understandable that the above-mentioned traffic detection request can include the identity of the network application (such as UID).

[0167] In step 310 , the traffic reporting component 141 performs traffic detection and reports the detected message to the traffic sensing component 133 .

[0168] Specifically, when the traffic reporting component 141 receives the traffic reporting request sent by the above-mentioned traffic perception component 133, it can detect the message of the network application corresponding to the identity identifier of the network application based on the identity identifier of the network application (such as UID) in the above-mentioned traffic reporting request, thereby obtaining the message of the network application on the main network channel, and reporting the above-mentioned detected network application message to the traffic perception component 133.

[0169] In a specific implementation, the traffic reporting component 141 may call a component (e.g., the Netfilter component of the Android system) to obtain network application messages on the primary network channel. It should be understood that the Netfilter component is merely illustrative and does not limit the embodiments of the present application. In some embodiments, other components may be used to detect the messages.

[0170] For example, the parameters of the above network channel can be implemented by the following code:

[0171] typedef struct{

[0172] bool available;

[0173] bool slowDevForbbiden;

[0174] uint64_t qoeBadTimeStamp;

[0175] uint64_t chQoeBadStartTime;

[0176] uint32_t rcvRate;

[0177] }

[0178] It is understood that the detected packets may be packets of one or more characteristic flows in the current network application, wherein the characteristic flows may be the most sensitive flows in the network application, i.e., flows that have a greater impact on the current network application. Furthermore, the network channel parameters may be used to assess the quality of the network channel.

[0179] In step 311 , the traffic sensing component 133 collects statistics on the network application messages on the primary network channel, makes predictions based on the statistical results, obtains prediction results, and sends the prediction results to the flow-level path management component 131 .

[0180] Specifically, when the traffic sensing component 133 receives the message of the network application detected by the traffic reporting component 141, it can count the above message, thereby obtaining the message statistics. Then, it can be analyzed based on the above message statistics, thereby predicting the network status, that is, it can be predicted whether the network status will get better or worse based on the message statistics. In a specific implementation, the packet loss rate and / or delay of the message of the above network application can be counted, thereby predicting the network status. For example, the packet loss rate and / or delay of the message within the preset N periods can be counted. If the statistical packet loss rate and / or delay meet the preset requirements, it can be predicted that the network status is good. If the statistical packet loss rate and / or delay do not meet the preset requirements, it can be predicted that the network status is poor.

[0181] It is understandable that the quality of the network channel in step 311 is a coarse-grained assessment, that is, statistics are collected on the packets of the characteristic flow within a short period to quickly predict the network status, thereby selecting a backup network channel in advance and saving channel switching delay.

[0182] The above-mentioned messages may be messages of various streams of network applications on the main network channel. After the traffic perception component 133 receives the above-mentioned messages, it may analyze the above-mentioned messages. Among them, the above-mentioned message analysis may be based on the characteristics of the messages to identify the characteristic flows. For example, taking the Peace Elite game as an example, the characteristic flow of the game may be a voice flow, that is, the voice flow has a relatively large impact on the game and is the most sensitive. When the voice flow quality is not good (for example, the delay and packet loss rate do not meet the requirements), it will seriously affect the user's gaming experience. Therefore, it is necessary to identify the voice flow and further count the voice flow messages in the message. The identification of the voice flow message can be achieved through heartbeat packet statistics. Exemplarily, taking the UDP protocol as an example, the data message characteristics of the voice flow can be characterized by the following characteristics:

[0183] Uplink: udp.payload[6] = 0x64;

[0184] Downlink: udp.payload[6] = 0x65.

[0185] Figure 8 Figure 1 is a diagram of a heartbeat message for a UDP voice stream.

[0186] That is, by reading the preset field in the payload of the uplink and downlink messages, it is possible to identify whether the message is a voice stream data packet.

[0187] Then, the messages of the voice stream can be counted, thereby obtaining the time delay and / or packet loss rate of the messages of the above voice stream. In a specific implementation, the messages of the voice stream within a preset time length can be counted. Preferably, the above preset time length can be 1s, thereby determining whether the quality of the voice stream has deteriorated as soon as possible, and then switching the voice stream to the backup network channel as soon as possible to provide a higher gaming experience. Exemplarily, if the time delay and / or packet loss rate of the messages of the above voice stream do not meet the requirements, it can be determined that the quality of the voice stream is poor. At this time, a switch can be triggered to switch the voice stream to the backup network channel. It should be noted that the above example is only illustrated by taking games as an example. In specific applications, other network applications can also be included, such as Baidu Netdisk. The characteristic stream of this network application is a download stream, that is, the messages of the download stream can be found in the above messages, and the influencing factor of the messages of the download stream can be the rate. In addition, the above-mentioned network applications may also include social network applications such as WeChat, and the characteristic stream of the network application is a video stream, that is, the video stream message can be found in the above-mentioned messages, and the influencing factor of the video stream message may be delay / or packet loss rate.

[0188] It is understandable that the above-mentioned characteristic streams may also include battle streams in the game in addition to the above-mentioned voice streams. Taking Game for Peace as an example, by periodically counting the number of UDP packets, it is possible to determine whether the current packet stream is a battle stream. Currently, the period used by Game for Peace is 500ms. Therefore, the total number of packets within the period can be counted to determine whether it is a battle stream. For example, if the total number of packets in the above 500ms period is greater than 10, then the packet stream is a battle stream. Figure 9 The following is a statistical diagram of the packets of the UDP protocol battle flow. Figure 9 As shown, the horizontal axis is time and the vertical axis is the total number of packets. Since the number of packets per second is basically maintained at 30, it can be determined by calculation that there are 15 packets every 500ms, thereby determining that the packet flow is a battle flow.

[0189] Next, take Honor of Kings as an example, in which Honor of Kings filters the battle messages by filtering the UDP protocol number and the message header feature payload=0x00010000. Figure 10 This is a diagram of the heartbeat message of the UDP protocol battle flow.

[0190] In step 312 , the stream-level path management component 131 requests a backup network channel from the channel-level path management component 123 based on the received prediction result.

[0191] Specifically, after receiving the prediction result, the flow-level path management component 131 may select a backup network channel in advance based on the prediction result. For example, it may send a backup network channel request to the channel-level path management component 123 to request a backup network channel.

[0192] Optionally, the backup network channel request may further carry a label, and the label may be used to indicate a prediction of switching of the primary network channel, rather than actual switching.

[0193] Now combined Figures 11a-11c , taking a mobile phone as an example, the selection of the above backup network channel is explained. Figure 11a As shown, the mobile phone has the capability of four network channels: a primary Wi-Fi channel (e.g., Wi-Fi 1), a secondary Wi-Fi channel (e.g., Wi-Fi 2), a primary cellular channel (e.g., Mobile 1), and a secondary cellular channel (e.g., Mobile 2). Assume that the mobile phone is currently running a network application (e.g., WeChat) on the Wi-Fi 1 channel (the primary network channel). This network application includes stream A (e.g., a video stream) and stream B (e.g., an audio stream). When the mobile phone receives a prediction result that the network is about to deteriorate, it can select a backup network channel in advance. This backup network channel can be the one with the best channel quality among the secondary Wi-Fi channel (e.g., Wi-Fi 2), the primary cellular channel (e.g., Mobile 1), and the secondary cellular channel (e.g., Mobile 2). After selecting one of the secondary Wi-Fi channel (e.g., Wi-Fi 2), the primary cellular channel (e.g., Mobile 1), and the secondary cellular channel (e.g., Mobile 2) as the backup network channel (e.g., the Mobile 1 channel), the path of the Mobile 1 channel can be stored.

[0194] When the mobile phone finds that the quality of stream A no longer meets the requirements through further message detection, it can switch only stream A to the backup network channel, that is, Mobile1 channel. Figure 11b As shown, at this time, the above-mentioned flow B can continue to be carried on the primary network channel, that is, the WIFI channel, and the flow A can be carried on the backup network channel, that is, the Mobile1 channel.

[0195] It should be noted that the above example only illustrates a scenario in which one stream is switched, and does not constitute a limitation on the embodiments of the present application. In some embodiments, scenarios in which multiple streams are switched may also be included.

[0196] Optionally, when the mobile phone finds that the quality of stream A no longer meets the requirements through further message detection, both stream A and stream B can be switched to the backup network channel, that is, the Mobile1 channel. Figure 11c As shown, at this time, the above-mentioned stream A and stream B are both carried on the Mobile1 channel.

[0197] Next, combine Figure 11d and Figure 11e , taking a mobile phone as an example, the triggering conditions for channel switching are explained. Figure 11d This is the channel switching triggering process for non-sensitive services. Figure 11d As shown, the traffic perception component 133 in the mobile phone receives the heartbeat flow message of the characteristic flow detected by the traffic reporting component 141 within the preset first time period, and through statistical analysis of the heartbeat flow message of the characteristic flow within the above-mentioned preset first time period, it can be determined whether the quality of the network channel has deteriorated. Among them, since the current service is a non-sensitive service, the above-mentioned preset first time period can be set to be longer, for example, 5s. When the traffic perception component 133 determines that the current network channel quality has deteriorated, it can send a switching notification to the policy management component 132 to trigger the switching of the network channel. For example, it can evaluate the quality of other network channels and switch the current non-sensitive service to other network channels with the best quality.

[0198] Figure 11e This is the channel switching triggering process for sensitive services. Figure 11e As shown, the traffic sensing component 133 in the mobile phone receives the heartbeat flow message of the characteristic flow detected by the traffic reporting component 141 within the preset second time period. By statistically analyzing the heartbeat flow message of the characteristic flow within the above-mentioned preset second time period, it is possible to predict whether the quality of the network channel has deteriorated. Among them, the above-mentioned preset second time period can be set to be shorter, for example, 1 second, so that the status of the network channel can be quickly predicted, and then the backup network channel can be quickly selected to save the evaluation time of the backup network channel when the actual switching of the network channel is performed in the future. Then, the traffic sensing component 133 in the mobile phone continues to receive the heartbeat flow message of the characteristic flow detected by the traffic reporting component 141 within the preset third time period. By statistically analyzing the heartbeat flow message of the characteristic flow within the above-mentioned preset third time period, it is possible to determine the service quality of the characteristic flow in the current network application. Among them, the above-mentioned preset third time period can be the same length as the preset first time period, for example, 5 seconds, or it can be set shorter than the preset first time period, for example, 3 seconds. When it is determined that the service quality of the feature flow deteriorates, a switching notification may be sent to the stream-level policy management component 132 to trigger the switching of the network channel. For example, the feature flow of the current network application may be switched to the above-mentioned backup network channel.

[0199] In step 313 , the channel-level path management component 123 receives a request for a backup network channel, requesting the activation status of each optional network channel.

[0200] Specifically, after the channel-level path management component 123 receives the backup network channel request sent by the flow-level path management component 131, it can send a channel status request to the network detection component 122, wherein the channel status request can be used to request the activation status of each optional network channel. It is understandable that the activation status can include available and unavailable. The available status can be used to indicate that the optional network channel can be activated, and the unavailable status can be used to indicate that the optional network channel is prohibited from being activated. The optional network channels can include auxiliary WIFI channels, primary cellular channels, and auxiliary cellular channels.

[0201] In step 314 , the network detection component 122 detects the activation status of each optional network channel and sends the activation status of each optional network channel to the channel-level path management component 123 .

[0202] Specifically, after the network detection component 122 receives the channel status request sent by the channel-level path management component 123, it can detect the activation status of each optional network channel. In a specific implementation, the network detection component 122 can be used to manage the switching of each optional network channel. When any optional network channel is turned on, the optional network channel is in an available state, and when any optional network channel is turned off, the optional network channel is in an unavailable state. Therefore, after the network detection component 122 detects the activation status of all optional network channels requested by the channel-level path management component 123, it can send the activation status of all the optional network channels to the channel-level path management component 123.

[0203] In step 315 , the channel-level path management component 123 requests the channel quality of each available network channel.

[0204] Specifically, after the channel-level path management component 123 receives the enabled status of each optional network channel, it can select an available network channel (that is, an optional network channel that is in an available state) and can further send a channel evaluation request to the channel and application quality evaluation component 125, wherein the channel evaluation request can be used to request an evaluation of the quality of the available network channel.

[0205] In step 316 , the channel and application quality assessment component 125 assesses the quality of each available network channel and sends the assessment result to the channel-level path management component 123 .

[0206] Specifically, after the channel and application quality assessment component 125 receives the channel assessment request sent by the channel-level path management component 123, it can evaluate the quality of each available network channel according to the channel assessment request. Exemplarily, the channel quality may include the channel's latency, packet loss rate, bandwidth, and rate. The above assessment may be an assessment of the round-trip time (RTT) of the available network channel, with the network channel with the smallest round-trip time being the best. Optionally, when the available network channel has a historical selection record, that is, the above available network channel has been selected as a network channel, the channel quality can be evaluated in combination with the above RTT and historical records, wherein the historical records may include historical receiving rates, the number of historical times when the channel quality was poor, etc. The embodiment of the present application does not specifically limit the method for evaluating the above channel quality. After the channel and application quality assessment component 125 completes the quality assessment of all available network channels in the channel assessment request, it can send the above assessment results to the channel-level path management component 123.

[0207] In step 317 , the channel-level path management component 123 determines a backup network channel based on the evaluation result, and sends the path of the backup network channel to the flow-level path management component 131 .

[0208] Specifically, after receiving the evaluation result, the channel-level path management component 123 may select the best available network channel as the backup network channel based on the evaluation result, and may send the path of the backup network channel to the channel-level path management component 123 .

[0209] In step 318 , the stream-level path management component 131 receives and stores the path of the backup network channel sent by the channel-level path management component 123 .

[0210] Specifically, after the stream-level path management component 131 receives the path of the backup network channel sent by the channel-level path management component 123, it can pre-store the path of the backup network channel. It is understandable that since only the network status is predicted in step 312, that is, the current network is poor and may cause service lag, but the switching conditions have not yet been met, the first device does not switch to the backup network channel at this time. In other words, the first device is still using the primary network channel.

[0211] For example, after the stream-level path management component 131 receives the backup network channel path from the channel-level path management component 123 at time t1, it can pre-store the backup network channel path. At this point, the first device does not switch to the backup network channel; in other words, the first device continues to use the primary network channel. Then, at time t2, if the quality of the feature stream of the current network application is detected to have deteriorated and the switching conditions have been met, the first device can switch the feature stream from the primary network channel to the backup network channel.

[0212] In step 319 , the traffic reporting component 141 reports the message to the traffic sensing component 133 .

[0213] Specifically, the traffic reporting component 141 can continuously detect the messages of the current main network channel and report the detected messages to the traffic perception component 133.

[0214] In step 320 , the traffic sensing component 133 receives the message reported by the traffic reporting component 141 , analyzes the message, obtains the message analysis result, and sends the message analysis result to the flow-level policy management component 132 .

[0215] Specifically, after the traffic sensing component 133 receives the message reported by the traffic reporting component 141, it can identify the characteristic flow from the above message. The method of identifying the characteristic flow can refer to step 311 and will not be repeated here. Then, the message in the above characteristic flow can be analyzed to obtain the message analysis result. The message analysis result can be used to characterize whether the characteristic flow meets the business requirements, for example, whether it meets the delay requirement or whether it meets the packet loss rate requirement. The above message analysis result can also be sent to the flow-level policy management component 132.

[0216] It is understood that this step 320 is different from the coarse-grained quality assessment of the network channel in step 311. That is, the received packets of the feature flow are analyzed in a shorter period to obtain network quality and predict handover. In contrast, this step 320 analyzes the received packets of the feature flow in a longer period to determine whether to actually handover. In other words, step 320 is a fine-grained quality assessment, which can achieve handover of the network channel for the feature flow and save latency.

[0217] In the prior art, for the parameters used in network quality assessment (for example, delay or packet loss rate), only a threshold is set for the parameter, and the evaluation strategy corresponding to the threshold is used to evaluate the network quality. In the method provided in the embodiment of the present application, at least two thresholds with different values can be set for the parameters, and each threshold corresponds to a set of evaluation strategies. The larger the threshold, the smaller the delay of the evaluation strategy. For example, if threshold 1 and threshold 2 are set for delay, and threshold 2 is greater than threshold 1, the evaluation strategy corresponding to threshold 1 can be: if the delay of 3 cycles out of 5 consecutive cycles is greater than threshold 1, the message analysis result is poor quality, otherwise the message analysis result is good quality; the evaluation strategy corresponding to threshold 2 can be: if the delay of 1 cycle is greater than threshold 2, the message analysis result is poor quality, otherwise the message analysis result is good quality. Based on the above evaluation strategy, it can be seen that the delay of the evaluation strategy corresponding to threshold 1 is 3 cycles, and the delay of the evaluation strategy corresponding to threshold 2 is 1 cycle.

[0218] For example:

[0219] The characteristic flow is a voice flow, and the messages reported by the traffic reporting component are heartbeat flow messages in the voice flow. The quality of the network channel is evaluated based on the RTT of the heartbeat flow messages. Two thresholds, threshold 1 and threshold 2, are preset for the RTT of the heartbeat flow messages. The evaluation strategy corresponding to the thresholds continues the previous example.

[0220] The traffic sensing component 133 determines whether the RTT of the current cycle is greater than the threshold 2;

[0221] If yes, then determining that the packet analysis result of the voice stream is: poor quality, and sending the packet analysis result of the voice stream to the stream-level policy management component 132;

[0222] If not, the traffic sensing component 133 determines whether there are three cycles in the window of the current cycle with RTT greater than the threshold 1; the window of the current cycle is composed of five consecutive cycles with the current cycle as the end cycle;

[0223] If yes, the message analysis result of the voice stream is determined to be: poor quality, and the message analysis result of the voice stream is sent to the stream-level policy management component 132; if not, the message analysis result of the voice stream is determined to be: good quality, and the message analysis result of the voice stream is sent to the stream-level policy management component 132.

[0224] Optionally, the traffic sensing component 133 may send the packet analysis result of the voice stream to the stream-level policy management component 132 only when the packet analysis result of the voice stream is poor quality.

[0225] based on Figure 1d We can get the corresponding relationship table of relative time and RTT as shown in Table 1 above. Assume that threshold 1 is 150 and threshold 2 is 300; then,

[0226] In the period of relative time 4s, the traffic perception component 133 can determine that the packet analysis result of the voice stream is: poor quality, and send the packet analysis result of the voice stream to the stream-level policy management component 132. Subsequently, the stream-level policy management component 132 can switch the voice stream or multiple streams including the voice stream to a backup network channel.

[0227] It should be noted that the above description takes the example of presetting 2 thresholds for parameters, which can also be extended to presetting 3 thresholds or more thresholds, and is not limited in the embodiments of the present application.

[0228] In step 321 , the flow-level policy management component 132 determines switching based on the packet analysis result and requests to obtain the path of the backup network channel.

[0229] Specifically, when the flow-level policy management component 132 receives the message analysis results reported by the traffic perception component 133, it can determine whether to perform channel switching based on the message analysis results. In specific implementation, if the characteristic flow of the current network application (for example, the voice flow in the game, the video flow in WeChat, or the download flow of Baidu Netdisk) does not meet the requirements (for example, delay and / or packet loss rate), it can be determined that channel switching is required. At this time, the flow-level policy management component 132 can send a backup network channel path acquisition request to the flow-level path management component 131 to obtain the path of the backup network channel. For example, if the backup network channel is the main cell, the path of the backup network channel can be, for example, Mobile1.

[0230] Exemplarily, the above path of requesting a backup network channel can be implemented by the following code:

[0231]

[0232]

[0233] In addition, in a specific implementation, the path of the network channel (for example, the path can be represented by the device number of the network card or SIM card) can be defined in a data structure. The code example is as follows:

[0234]

[0235] As shown in the above code, sk_bound_dev_if is the device number of the target network card or target SIM card to be switched. It can be understood that the message can be received through the above network card or SIM card. The code for receiving the message can refer to the following example:

[0236] pktinfo.msg.flow_msg.dev_if=sk->sk_bound_dev_if;

[0237] Among them, pktinfo is the received message, and msg.flow_msg is the name of the message flow.

[0238] It is understandable that if, through message analysis, it is determined that the characteristic flow of the current network application meets the requirements, that is, no switching is required, then the first device can delete the path of the above-mentioned backup network channel, thereby releasing resources and saving the power consumption of the first device. Optionally, the first device can also delete the path of the above-mentioned backup network channel after a preset time (for example, a preset fourth time), thereby ensuring that within the preset fourth time, if the quality of the characteristic flow deteriorates, it can be switched to the backup network channel in a timely manner, avoiding the inability to switch due to deletion of the path of the above-mentioned backup network channel.

[0239] In step 322 , the flow-level path management component 131 sends the path of the backup network channel to the flow-level policy management component 132 .

[0240] In step 323 , the stream-level policy management component 132 sends a channel switching instruction to the policy execution component 142 .

[0241] Specifically, when the stream-level policy management component 132 receives the path of the backup network channel sent by the stream-level path management component 131, it can send a channel switching indication to the policy execution component 142, wherein the channel switching indication can be used to instruct the policy execution component 142 to switch the above-mentioned feature flow from the current main network channel to the backup network channel, thereby completing the channel switching faster, reducing the delay caused by the channel switching, and improving the user experience.

[0242] In step 324 , the policy execution component 142 executes channel switching.

[0243] Specifically, when the policy execution component 142 receives the channel switching indication sent by the flow-level policy management component 132, the above-mentioned feature flow can be switched from the current main network channel to the backup network channel. That is to say, other flows of the above-mentioned network application can continue to be carried on the main network channel and run, and the above-mentioned feature flow can be carried on the backup network channel. In this way, the switching can be completed quickly, thereby ensuring the quality of the service and the user experience.

[0244] Optionally, the entire network application may be switched to the backup network channel, that is, the primary network channel may be disabled, and all flows of the network application are carried and run on the backup network channel.

[0245] Figure 3d Diagram of using an alternative network channel for mobile phones. Figure 3dAs shown, when the mobile phone receives the channel switching instruction, the video stream can be switched from the current main network channel to the backup network channel, and the backup network channel can be used to watch the video to avoid video jamming.

[0246] The following combination Figure 5 The system framework diagram of the first device shown in FIG. Figures 12 to 14 The timing diagram of the interaction between the components in the first device is shown to provide a detailed description of the channel switching method in the embodiment of the present application.

[0247] Figure 12 This is a timing diagram of the interaction between the components in the first device of the embodiment of the present application, such as Figure 12 As shown, the method may include:

[0248] Step 1201: In response to a user operation, start a network application.

[0249] The implementation of this step can refer to step 301 and will not be described in detail here.

[0250] Step 1202: Stream transmission is performed between the network application and the server.

[0251] The user selects a service in the network application, and the network application transmits the streams required by the service between the server and the service. The network application can use a network channel (e.g., a primary network channel) to transmit the streams between the server and the service. For example, if the network application is a video application and the user selects to play a video, the streams required by the service may include a video stream and an audio stream, which can be carried on the primary network channel. Accordingly, the mobile phone can use the primary network channel to interact with the server, obtain the video stream and audio stream from the server, and thus play the video.

[0252] It should be noted that the embodiments of the present application focus on how to implement network channel switching after the network application starts to use the primary network channel to interact with the server. The embodiments of the present application do not limit how the network application starts to interact with the server using the primary network channel after the initial startup.

[0253] Step 1203 : The environment detection component 121 detects that the network application has switched to the foreground, and notifies the application-level policy management component 124 .

[0254] The implementation of this step can refer to the description in step 302 and will not be repeated here.

[0255] Step 1204: The application-level policy management component 124 determines whether the network application meets the conditions for enabling acceleration.

[0256] The implementation of this step can refer to the description in step 303 and will not be repeated here.

[0257] The implementation of the network application whitelist is further explained.

[0258] In the embodiment of the present application, the data of network applications is divided into flows according to types as an example, and one type corresponds to one flow of network applications. As shown in Table 3 below, in addition to recording the network applications that need to be accelerated, the network application whitelist can also record:

[0259] The type of target flow that needs to be monitored in each network application; for example, as shown in the target flow type field in Table 3;

[0260] The flow model corresponding to each target flow type is shown in the flow model field in Table 3 below;

[0261] Network quality assessment parameters used to assess the network quality of the target flow, such as those shown in the Channel Quality Parameter field in Table 3 below;

[0262] The strategy for switching the channel of the network application flow after evaluating the network quality of the target flow deteriorates is hereinafter referred to as the flow switching strategy; for example, the flow switching strategy field is shown in Table 3 below.

[0263]

[0264] Table 3

[0265] Optionally, the target flow may be a flow that can be quickly reflected in one or more network quality evaluation parameters when the quality of the network channel carrying the target flow deteriorates, for example, may be one or more characteristic flows of a network application.

[0266] Optionally, the network quality evaluation parameter of the target flow may be a parameter that can quickly reflect the deterioration of the network quality of the target flow.

[0267] The above-mentioned stream switching strategy records the streams that need to switch network channels together with the target stream. Optionally, the streams recorded in the stream switching strategy are generally streams that have a greater impact on business processing in network applications, such as the characteristic streams of network applications in the aforementioned description, such as video streams and audio streams in video playback applications, game battle streams and voice streams in game applications, etc.

[0268] Optionally, the flows recorded in the flow switching policy that need to switch network channels along with the target flow can be flows that are sensitive to the same network evaluation parameters as the target flow. For example, if the target flow is delay-sensitive (hereinafter referred to as delay-sensitive flows), the flows in the flow switching policy are some or all delay-sensitive flows in the network application, including the target flow; if the target flow is packet loss-sensitive (hereinafter referred to as packet loss-sensitive flows), the flows in the flow switching policy are some or all packet loss-sensitive flows in the network application, including the target flow. As a result, the network quality of the target flow deteriorates, and a class of flows in the network application that are sensitive to the same network evaluation parameters are switched to a new network channel.

[0269] Optionally, the flow model corresponding to the above target flow type is used to record the characteristic information of the message that needs to be monitored in the target flow. For example, the characteristic information can be at least one of the following characteristic information: a quadruple, a quintuple, a protocol number, a character string in the payload, etc.

[0270] It should be noted that in the stream switching strategy of the embodiment of the present application, when the quality of a certain stream of the network application deteriorates, the network channel switching can be performed on multiple streams of the network application including the stream on the same network channel, thereby switching the above-mentioned multiple streams from the current network channel to other network channels with relatively better quality, thereby preventing the network application business from being stuck. For example, in Table 3, if the video stream of WeChat deteriorates, and the video stream and voice stream of WeChat are on the same network channel, the network channel switching is performed on both the video stream and the voice stream of WeChat, thereby switching the video stream and the voice stream from the current network channel to the network channel with relatively better quality, thereby reducing the possibility of stuck problems in WeChat's video and voice playback.

[0271] Step 1205 : The application-level policy management component 124 sends an acceleration start message to the flow-level path management component 131 .

[0272] Specifically, if the application-level policy management component 124 determines that the current network application meets the conditions for starting acceleration, it can start the acceleration service for the network application, and send an acceleration start message to the flow-level path management component 131. The acceleration start message is used to indicate that the flow-level path management component 131 can start the acceleration service for the network application.

[0273] The above-mentioned acceleration services may include but are not limited to:

[0274] When the environment in which the electronic device is located or the system environment of the electronic device changes, enabling a backup network channel so that the backup network channel is converted from a dormant state to an awake state; and / or,

[0275] Monitor the network quality of several streams in the network application. When the electronic device detects that the quality of a stream of the network application has deteriorated, switch the multiple streams of the network application, including the stream with deteriorated quality, to a backup network channel. This ensures that the multiple streams of the network application are always carried on a network channel with relatively good quality, thereby ensuring the transmission quality of the streams, reducing the possibility of service jams in the network application, and improving the user experience. It should be noted that if the electronic device has already enabled the backup network channel when the decision is made to switch multiple streams to the backup network channel, the multiple streams will be switched to the already enabled backup network channel. If the electronic device has not enabled the backup network channel when the decision is made to switch multiple streams to the backup network channel, the electronic device needs to first enable a backup network channel and then switch to the enabled backup network channel.

[0276] Optionally, the acceleration start message may include information corresponding to the identity of the current network application in the network application whitelist, such as the identity of the current network application, the target flow type, the flow model corresponding to the target flow type, network quality assessment parameter information, and flow switching policy information. For details, please refer to the aforementioned related description and will not be repeated here.

[0277] Optionally, the flow-level path management component 131 may store the path of the currently used network channel, which is also the path of the network channel used by the network application; or, if the flow-level path management component 131 does not store the path of the currently used network channel, that is, the flow-level path management component 131 does not store the path of the network channel used by the network application, then the flow-level path management component 131 may request the path of the network channel used by the network application from the channel-level path management component 123, and the channel-level path management component 123 may send the path of the network channel used by the network application to the flow-level path management component 131.

[0278] Step 1206: the flow-level path management component 131 sends the network application's identity and flow switching policy information to the flow-level policy management component 132, sends a flow detection request to the flow perception component 133, and the flow perception component 133 sends a flow reporting request to the flow reporting component.

[0279] Optionally, the traffic detection request may include a first configuration file for the network application, and the first configuration file may include: an identity identifier of the network application, a target flow type, a flow model corresponding to the target flow type, network quality assessment parameter information, etc.

[0280] Optionally, the traffic reporting request may include a second configuration file for the network application, and the second configuration file may include: an identity identifier of the network application, a target flow type, and a flow model corresponding to the target flow type.

[0281] It should be noted that the purpose of executing this step is to initialize various relevant information for the current network application to the flow-level policy management component 132, the traffic perception component 133 and the traffic reporting component 141. Therefore, in other possible implementation methods, the flow-level path management component 131 can also send the second configuration file for the network application directly to the traffic reporting component 141, which is not limited here.

[0282] Through the processing of this step, the traffic reporting component can be triggered to start monitoring the flow in the network application, thereby triggering the subsequent network channel switching process for the flow.

[0283] The following are respectively Figure 13 and Figure 14 The process of enabling a backup network channel for an electronic device and switching the flow channel is described.

[0284] Figure 13 This is another timing diagram of the interaction between the components in the first device of the embodiment of the present application, such as Figure 13 As shown, the method may include:

[0285] Step 1301: The environment detection component 121 performs environment detection.

[0286] Specifically, the environment detected by the environment detection component may include the physical environment of the first device, or the system environment of the first device. For example, the physical environment may include scenarios with poor network connectivity, such as elevators, high-speed trains, and garages; the system environment may include device temperature, etc.

[0287] For example, when a user enters an elevator, the elevator ascends or descends, causing a change in the user's gravity. For example, an ascending elevator causes overweight, while a descending elevator causes weightlessness. Therefore, the accelerometer in the first device can detect this. When the accelerometer detects that the user is weightless or overweight, that is, it detects the vertical acceleration of the first device, it can determine that the user is in an elevator environment.

[0288] In addition, since the elevator will stop according to the needs of different users (for example, different users can click on different floors) during the ascent or descent process, the elevator will appear to run continuously in the vertical direction or stop and go. Since the first device does not detect horizontal movement during the above-mentioned elevator ascent and descent process, it can still be determined that the first device is in the elevator, wherein the above-mentioned horizontal movement can be detected by the acceleration sensor in the first device. For example, if the above-mentioned acceleration sensor detects horizontal acceleration, it can be determined that there is horizontal movement.

[0289] When the first device detects horizontal acceleration, that is, horizontal movement, it can be determined that the user has exited the elevator. In other words, the first device has exited the elevator. In this case, there is no need to detect the backup network channel in advance, and there is no need to send a scene change notification message to the application-level policy management component 124. This can save power consumption of the electronic device caused by detecting the backup network channel.

[0290] Optionally, the electronic device can also determine whether the scene the user is in has changed by detecting the strength of the mobile network signal. For example, when the signal strength of the mobile network becomes weak, it can be determined that the user has entered a poor network environment. At this time, the first device can determine that the scene has changed, and can send a scene change notification message to the application-level policy management component 124 for early detection of backup network channels. When the signal strength of the mobile network becomes stronger, it can be determined that the user has entered a better network environment. At this time, there is no need to detect the backup network channel in advance, and there is no need to send a scene change notification message to the application-level policy management component 124, thereby saving the power consumption of the electronic device due to the detection of the backup network channel.

[0291] Step 1302 : The environment detection component 121 sends an environment change notification message to the application-level policy management component 124 .

[0292] Specifically, if the environment detection component 121 detects that the environment of the first device has changed (for example, the user has entered an elevator), it can send an environment change notification message to the application-level policy management component 124, where the environment change notification message is used to notify the application-level policy management component 124 that the user's environment has changed, thereby triggering the application-level policy management component 124 to perform subsequent processing.

[0293] Step 1303 : The application-level policy management component 124 forwards the environment change notification message to the flow-level path management component 131 .

[0294] Step 1304: The stream-level path management component 131 requests a backup network channel from the channel-level path management component 123 .

[0295] Specifically, because the signal in elevators is typically poor, selecting, activating, and switching network channels after entering the elevator can cause significant service delays, resulting in a poor user experience. Therefore, when the user enters the elevator, a backup network channel can be pre-selected. This speeds up channel switching and reduces service delays.

[0296] Step 1305: The channel-level path management component 123 receives a request for a backup network channel, requesting the activation status of each optional network channel.

[0297] Specifically, after the channel-level path management component 123 receives the backup network channel request sent by the flow-level path management component 131, it can send a channel status request to the network detection component 122, wherein the channel status request can be used to request the activation status of each optional network channel. It is understandable that the activation status can include available and unavailable. The available status can be used to indicate that the optional network channel can be activated, and the unavailable status can be used to indicate that the optional network channel is prohibited from being activated. The optional network channels can include auxiliary WIFI channels, primary cellular channels, and auxiliary cellular channels.

[0298] Step 1306 : The network detection component 122 detects the activation status of each optional network channel and sends the activation status of each optional network channel to the channel-level path management component 123 .

[0299] Specifically, after the network detection component 122 receives the channel status request sent by the channel-level path management component 123, it can detect the activation status of each optional network channel. In a specific implementation, the network detection component 122 can be used to manage the switching of each optional network channel. When any optional network channel is turned on, the optional network channel is in an available state, and when any optional network channel is turned off, the optional network channel is in an unavailable state. Therefore, after the network detection component 122 detects the activation status of all optional network channels requested by the channel-level path management component 123, it can send the activation status of all the optional network channels to the channel-level path management component 123.

[0300] Step 1307: The channel-level path management component 123 requests the channel quality of each available network channel.

[0301] Specifically, after the channel-level path management component 123 receives the enabled status of each optional network channel, it can select an available network channel (that is, an optional network channel that is in an available state) and can further send a channel evaluation request to the channel and application quality evaluation component 125, wherein the channel evaluation request can be used to request an evaluation of the quality of the available network channel.

[0302] Step 1308 : The channel and application quality assessment component 125 assesses the quality of each available network channel and sends the assessment result to the channel-level path management component 123 .

[0303] Specifically, after the channel and application quality evaluation component 125 receives the channel evaluation request sent by the channel-level path management component 123 , it can evaluate the quality of each available network channel according to the channel evaluation request.

[0304] For example, the quality of the network channel can be evaluated based on at least one of the following parameters of the network channel: channel latency, packet loss rate, bandwidth, and rate. For example, the quality evaluation can be based on the round-trip time (RTT) of the available network channels, with the network channel with the smallest RTT being the best.

[0305] Optionally, when the available network channel has a historical selection record, that is, the above-mentioned available network channel has been selected as the network channel, at this time, the channel quality can be evaluated in combination with the above-mentioned RTT and historical records, wherein the historical records may include historical receiving rate, historical number of times the channel quality is poor, etc. The embodiment of the present application does not specifically limit the evaluation method of the above-mentioned channel quality.

[0306] After the channel and application quality assessment component 125 completes the quality assessment of all available network channels in the channel assessment request, it may send the assessment result to the channel-level path management component 123 .

[0307] Step 1309: The channel-level path management component 123 determines a backup network channel based on the evaluation result.

[0308] Specifically, after receiving the above evaluation result, the channel-level path management component 123 may select the best available network channel as the backup network channel based on the above evaluation result.

[0309] Step 1310: The channel-level path management component 123 requests the network connection management component 126 to enable a backup network channel.

[0310] Step 1311: the network connection management component 126 starts the backup network channel and feeds back a notification message that the backup network channel has been enabled to the channel-level path management component 123.

[0311] The network connection management component 126 enables the backup network channel in response to the request of the channel-level path management component 123. Enabling the backup network channel here means switching the backup network channel from a sleep state to a wake-up state, so that when a network channel switching is required later, it can quickly switch from the current network channel to the backup network channel.

[0312] It is understandable that since only a scene change is detected in step 1301, that is, the current scene change may cause the network quality to deteriorate, thereby causing service jams, but the switching conditions have not yet been met, at this time, the electronic device does not switch to the backup network channel, that is, the electronic device is still using the original network channel.

[0313] Step 1312 : The channel-level path management component 123 sends the path of the backup network channel to the flow-level path management component 131 .

[0314] Thus, the stream-level path management component 131 can receive and store the path of the backup network channel sent by the channel-level path management component 123 .

[0315] Through the above processing, the electronic device can enable the backup network channel after detecting the environmental change, so that when it is determined to switch the network channel later, the network channel switching can be completed quickly, reducing the possibility of service jams in the network application.

[0316] It should be noted that Figure 13 In the example above, the electronic device activates the backup network channel after detecting the environmental change. In other possible implementations, the traffic sensing component can also activate the backup network channel after predicting the network deterioration based on the received message. For details, please refer to Figure 7 The corresponding description in is not repeated here.

[0317] Figure 14 This is another timing diagram of the interaction between the components in the first device of the embodiment of the present application, such as Figure 14 As shown, the method may include:

[0318] Step 1401: The traffic reporting component 141 performs traffic detection and reports the detected message to the traffic perception component 133.

[0319] Specifically, based on the aforementioned step 1206, after receiving the traffic reporting request, the traffic reporting component 141 can detect the packets of the target flow of the network application according to the traffic reporting request and report the detection results to the traffic sensing component 133. The above detection results may include: the packets of the target flow, or the packets of the target flow and the packet statistics of the target flow, etc.

[0320] In a specific implementation, the traffic reporting component 141 may obtain packets of the target flow of the network application on the current network channel (e.g., the primary network channel) by calling a component (e.g., the Netfilter component of the Android system). It should be understood that the Netfilter component is merely illustrative and does not constitute a limitation of the embodiments of the present application. In some embodiments, other components may also be used to complete the detection of the packets.

[0321] For example, the parameters of the above network channel can be implemented by the following code:

[0322] typedef struct{

[0323] bool available;

[0324] bool slowDevForbbiden;

[0325] uint64_t qoeBadTimeStamp;

[0326] uint64_t chQoeBadStartTime;

[0327] uint32_t rcvRate;

[0328] }

[0329] It is understood that the detected packets may be packets of one or more characteristic flows in the current network application, wherein the characteristic flows may be the most sensitive flows in the network application, i.e., flows that have a greater impact on the current network application. Furthermore, the network channel parameters may be used to assess the quality of the network channel.

[0330] Optionally, when the traffic reporting component 141 performs traffic detection, it can register a hook function in the kernel netfilter framework to obtain the target flow message. Figure 15 As shown, Netfilter hooks the packet to the nf_hook hook function of the traffic reporting component, and the message carried on the current network channel enters the traffic reporting component 141. The traffic reporting component stores the message of the target flow in the SKB queue after processes such as message parsing, flow table creation, and message content analysis. For the messages in the SKB queue, according to the reporting strategy of the target flow to which the message belongs, the data (message, or message and statistical information) that needs to be reported regularly is triggered by the timer and reported to the traffic perception component 133. The message that needs to be reported immediately is immediately reported to the traffic perception component 133 by the NetLink thread.

[0331] It should be noted that the target flow can be one or more; when the traffic reporting component detects the message of the target flow, all or part of the message of the target flow can be reported to the traffic perception component, which is not limited in the embodiment of this application.

[0332] Taking the detection and reporting of the heartbeat flow message in the target flow as an example, combined with Figure 15 Describe the specific implementation process of the message reporting component.

[0333] The heartbeat flow message referred to here may be a message that appears in the target flow at a certain time interval, and there is preset characteristic information in a fixed position of the payload of the heartbeat flow message. Optionally, the five-tuple of the heartbeat flow message may be the same as or different from the five-tuple of other messages in the same flow. The time interval of the heartbeat flow message in the embodiment of the present application is not limited in the embodiment of the present application, for example, it is 1s. See Figure 1aAs shown, it is a schematic diagram of a heartbeat flow message with an interval of 1s. Accordingly, the subsequent traffic perception component 133 can calculate the round-trip delay based on the heartbeat flow message, and use the round-trip delay as a network quality evaluation parameter of the target flow to judge the network quality of the target flow. For example, the RTT calculation method of the heartbeat flow message can be found in Figure 1b As shown, for specific instructions, please refer to the above related instructions, which will not be repeated here.

[0334] For example, the heartbeat flow message provided in the embodiment of the present application may have the following characteristics:

[0335] (ip.src==100.100.3.90&&udp.srcport==60539&&ip.dst==58.217.244.144&&udp.dstport==10126)&&(data[6]==64). Where data[6] represents the sixth byte of the payload of the message.

[0336] See also Figure 15 The specific implementation process of the message reporting component includes:

[0337] Step S1, initialization;

[0338] When the network application starts loading, the traffic reporting component 141 will receive the app launch message to register the nf_hook hook function. The code example is as follows Figure 16 and Figure 17 shown.

[0339] Step S2, message processing;

[0340] This step specifically includes three steps: message parsing, flow table lookup, and message analysis. The flow table records the flow identification information for each network application, as well as statistical information for each flow. This flow statistics may include the number of messages received for that flow, the total number of bytes received for that flow, and the number of error packets. The flow identification information can be calculated based on the quintuple or quadruple of messages in the flow. This calculation can specifically use a hash algorithm, so the flow identification information can be a hash value calculated from the quintuple or quadruple of messages.

[0341] During message parsing, the traffic reporting component 141 obtains the message and can parse whether the UID of the network application is present in the message. If so, it indicates that the message is a message of the network application, and the four-tuple (or five-tuple) of the message is parsed, and the subsequent flow table query step is performed. If not, it indicates that the message is not a message of the network application, and the process ends.

[0342] The above four-tuple may include: source IP, destination IP, source port, destination port; the five-tuple may include: source IP, destination IP, source port, destination port and protocol number.

[0343] When looking up the flow table, the identification information of the flow can be calculated based on the quadruple (or quintuple) of the message, and the calculated identification information can be used to find out whether the identification information has been recorded in the flow table. If so, the statistical information corresponding to the identification information in the flow table is updated; if not, a flow node is created in the flow table based on the identification information of the flow, and the statistical information of the flow in the flow node is updated.

[0344] During message analysis, the traffic reporting component 141 can filter the received messages through a preset flow model to obtain all or part of the target flow messages. For example, if the flow model of the aforementioned heartbeat flow message is used, the heartbeat flow message of the target flow can be obtained.

[0345] The above flow model can be configured to the traffic reporting component through a configuration file, and the above configuration file can be carried in the traffic reporting request sent by the traffic sensing component in step 1206. The flow model records the features that the message needs to match. For example, Figure 18 As shown, the above-mentioned heartbeat flow message can have fixed characteristic information in the 6th byte of the message payload. For example, the characteristic information in the upstream heartbeat flow message is 0x64, and the characteristic information in the downstream heartbeat flow message is 0x65. Then, the matching feature filterStr can be preset in the flow model, matching 0x64 in the upstream flow and 0x65 in the downstream flow, and the matching position is 6 bytes offset from the UDP payload.

[0346] like Figure 19 As shown in the figure, the code logic can use memcmp to compare the packet content with the configured matching feature filterStr to see if it is consistent. The specific code is: if(memcmp(rpt_cfg->filter_str[i], payload+filter_str_offset, rpt_cfg->filter_str_len[i]) == 0). Memcmp compares the packets that match the matching feature filterStr and filters out the packets of the target flow.

[0347] Step S3: Report the matched target flow and the statistical information of the target flow according to the flow reporting policy.

[0348] Specifically, the filtered target flow messages may be stored in the SKB queue and reported periodically or immediately according to the reporting policy of the target flow.

[0349] If reporting is performed periodically, part or all of the packets received by the target flow during the current period (for example, the last packet of the target flow received during the current period) can be reported to the traffic perception component at the end of each period. Optionally, the packet statistics information of the target flow during the current period (for example, the number of packets, the number of bytes, etc.) can also be reported to the traffic perception component.

[0350] If reporting is immediate, the matched messages can be reported directly to the traffic perception component.

[0351] Through the above processing, the target flow packets can be accurately matched and filtered out in the traffic reporting component, and the reported packets can be used in the traffic perception component to perform network quality assessment.

[0352] Step 1402: The traffic sensing component 133 analyzes the message reported by the traffic reporting component 141 to obtain a message analysis result.

[0353] In this step, the traffic sensing component 133 can perform a flow-level network quality assessment. The network quality assessment parameters used for each target flow can be referenced in Table 3. The network quality assessment parameters for each target flow can be sent to the traffic sensing component 133 in step 1206.

[0354] In this step, the obtained message analysis result may be a flow-level analysis result, for example, whether the quality of the target flow is good or bad.

[0355] In this step, the network quality evaluation method of the flow provided in the above embodiment can be used to evaluate the network quality of the target flow to obtain the network quality evaluation result of the target flow. The above-mentioned message analysis result may include: the above-mentioned network quality evaluation result of the target flow. Optionally, the above-mentioned network quality evaluation result of the target flow can be used to describe whether the quality of the target flow is good or bad.

[0356] Step 1403: The traffic sensing component 133 sends the message analysis result to the flow-level path management component 131.

[0357] Specifically, the above-mentioned message analysis result may include: identification information of the target flow and a network quality evaluation result of the target flow.

[0358] like Figure 20 As shown, taking a network application being a game application as an example, a possible code implementation of sending the target flow and the network quality evaluation result of the target flow to the stream-level path management component 131 for multi-flow path scheduling switching is shown.

[0359] Step 1404: The flow-level path management component 131 determines to switch channels based on the message analysis result and determines whether a backup network channel exists. If so, step 1414 is executed; if not, step 1405 is executed.

[0360] The implementation of steps 1405 to 1413 may refer to steps 1304 to 1312 and will not be repeated here.

[0361] Step 1414 : the stream-level path management component 131 sends the identification information of the target stream with poor quality and the path of the backup network channel to the stream-level policy management component 132 .

[0362] Specifically, when the flow-level path management component 131 determines that the quality of a target flow is poor based on the message analysis results of each target flow, it sends the identification information of the target flow with poor quality and the path of the backup network channel to the flow-level policy management component 132.

[0363] Step 1415 : The stream-level policy management component 132 sends a channel switching instruction to the policy execution component 142 .

[0364] Specifically, when the stream-level policy management component 132 receives the identification information of the target stream with poor quality and the path of the backup network channel sent by the stream-level path management component 131, it can determine the stream switching policy corresponding to the above-mentioned target stream with poor quality, and determine the stream to be switched of the network application from the stream carried on the same network channel as the above-mentioned target stream with poor quality according to the stream switching policy, and send a channel switching indication to the policy execution component 142, wherein the channel switching indication can be used to instruct the policy execution component 142 to switch the above-mentioned stream to be switched from the current network channel (for example, the main network channel) to the backup network channel (for example, the data network channel), thereby completing the channel switching faster, reducing the delay caused by the channel switching, and improving the user experience.

[0365] For example, see Figure 11a As shown, the network application flows A, B, and C are all carried on the WIFI1 channel. Flow A is the target flow, and the flow switching strategy corresponding to flow A is: flow A and flow B. Then, if the network quality of flow A is poor, then according to the flow switching strategy corresponding to flow A, it can be determined that the network application flows A and flow B are the flows to be switched, so as to refer to Figure 11b As shown, the flow-level policy management component 132 can instruct the policy execution component 142 to switch flows A and B to the backup network channel through the channel switching instruction, that is, Figure 11bContinuing with this example, assume that the flow switching strategy corresponding to flow A is: flow A, flow B and flow C; then, if the network quality of flow A is poor, then according to the flow switching strategy corresponding to flow A, it can be determined that flow A, flow B and flow C of the network application are the flows to be switched, so as to refer to Figure 11c As shown, the flow-level policy management component 132 can instruct the policy execution component 142 to switch flows A, B, and C to the backup network channel through the channel switching instruction, that is, Figure 11c Mobile1 channel in.

[0366] like Figure 21 As shown, taking the network application being a game application as an example, it is shown that the flow-level policy management component 132 is implemented by traversing all flow types on the service and obtaining possible codes of the flow to be switched in the network application.

[0367] In step 1416 , the policy execution component 142 executes channel switching.

[0368] Specifically, when the policy execution component 142 receives the channel switching indication sent by the flow-level policy management component 132, it can switch multiple flows of the network application to be switched from the current network channel to the backup network channel. That is to say, other flows of the above-mentioned network application can continue to be carried and run on the current network channel, and the above-mentioned multiple flows to be switched can be carried and run on the backup network channel, thereby completing the switching quickly and ensuring the quality of the service and the user experience.

[0369] above Figures 12 to 14 In the channel switching method shown, the flow-level channel switching scheduling is extended, and the scheduling of a single flow is extended to the scheduling of multiple flows; in some embodiments, the network quality evaluation result of a flow of a network application can be quickly perceived, and the evaluation result can be applied to a type of flow of the network application (such as delay-sensitive flow), thereby reducing the possibility of such flow causing business operation jams and improving user experience.

[0370] For example:

[0371] There is a heartbeat stream message with a 1s period in the voice stream of Peace Elite. This voice stream can be used as the target stream of the game application. The traffic reporting component can detect the heartbeat stream message of the voice stream. The traffic perception component can calculate the network round-trip delay of the voice stream based on the heartbeat stream message of the voice stream to evaluate the network quality of the voice stream. When the network quality deteriorates, the evaluation result can be applied to all delay-sensitive streams of the entire game (for example, battle stream and voice stream), and all delay-sensitive streams of the game switch network channels together.

[0372] By using the channel switching method of the embodiment of the present application, there is no need to accurately obtain the messages of each flow in the network application and perform network quality assessment on each flow, which can reduce the flows that need to be monitored and evaluated by electronic devices and reduce the data processing capacity of electronic devices; moreover, when the quality of the network channel deteriorates, multiple flows (such as a class of flows) can be switched in a timely manner, thereby reducing the possibility of business operation jams caused by the deterioration of the network quality of multiple flows, thereby reducing the occurrence rate of business operation jams and improving user experience.

[0373] Moreover, in the channel switching method of the embodiment of the present application, when the traffic perception component analyzes the message (such as the heartbeat flow message) of a certain stream (for example, the voice stream), it can set one or more preset conditions for the preset parameters of the message (for example, RTT), and each preset condition includes a network quality assessment strategy. The network quality assessment delay is different for different preset conditions, so that when the quality of the network channel is relatively good, the network quality assessment delay is relatively long, and when the quality of the network channel is relatively poor, the network quality assessment delay is relatively short. Therefore, different network quality assessment delays can correspond to different actual network qualities of the network channels, thereby meeting the switching speed requirements of electronic devices for the network channels under different network qualities of the network channels, improving the switching speed of the network channels, and thereby reducing the possibility of jamming in business operations and improving user experience.

[0374] The embodiment of the present application further provides an electronic device, the device comprising a storage medium and a central processing unit, the storage medium may be a non-volatile storage medium, the storage medium stores a computer executable program, the central processing unit is connected to the non-volatile storage medium, and executes the computer executable program to implement the present application Figures 7 to 15 The method provided in any embodiment.

[0375] The present application also provides an electronic device, comprising: one or more processors; a memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory, and the one or more computer programs include instructions, which, when executed by the device, cause the device to execute Figures 7 to 15 The method provided in any embodiment.

[0376] The embodiment of the present application also provides a computer-readable storage medium, which stores a computer program, which, when executed on a computer, enables the computer to execute the present application. Figures 7 to 15 The method provided in any embodiment.

[0377] The present invention also provides a computer program product, which includes a computer program that, when executed on a computer, enables the computer to execute the present invention. Figures 7 to 15The method provided in any embodiment.

[0378] It is understandable that, in order to realize the above functions, the above-mentioned electronic devices and the like include hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a 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. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the embodiments of the present application.

[0379] The embodiment of the present application can divide the functional modules of the above-mentioned electronic device etc. according to the above-mentioned method example. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one processing module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0380] Through the description of the above embodiments, those skilled in the art will clearly understand that for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working processes of the above-described systems, devices, and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0381] The functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0382] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as flash memory, mobile hard disk, read-only memory, random access memory, magnetic disk or optical disk.

[0383] The above is only a specific embodiment of the present application, but the scope of protection of this application is not limited to this. Any changes or substitutions within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

Claims

1. A channel switching method, applied to an electronic device, wherein the electronic device includes a first network channel, characterized in that: The method comprises: Starting a first application, where the first application includes a first data stream, which is carried on the first network channel and includes a message; the first application includes a second data stream, which is carried on the first network channel and is different from the first data stream and the second data stream; Creating a second network channel, where the first data stream continues to be carried on the first network channel; Calculating preset parameters of the packets of the first data stream according to a preset period; When the preset parameters meet the preset conditions, the first data stream is switched to the second network channel, and the second data stream remains on the first network channel; If the preset parameters do not meet the preset conditions, continue to carry the first data stream on the first network channel and destroy the second network channel; Before calculating the preset parameters of the packets of the first data flow according to the preset period, the method further includes: It is determined that the first application is an application in a preset whitelist.

2. The method according to claim 1, characterized in that The creating of the second network channel comprises: When an environmental change is detected or the quality of the first network channel is predicted to deteriorate, acquiring a network channel in the electronic device that is available except the first network channel; Performing quality assessment on each of the available network channels; The network channel with the best quality is selected as the second network channel according to the evaluation result of the quality evaluation.

3. The method according to claim 2, characterized in that When an environmental change is detected or the quality of the first network channel is predicted to deteriorate, obtaining available network channels other than the first network channel in the electronic device includes: When it is detected that the preset parameter exceeds a first threshold, an available network channel other than the first network channel in the electronic device is acquired.

4. The method according to claim 1, wherein The preset conditions include: The preset parameter exceeds the first threshold for m2 consecutive cycles within m1 consecutive cycles within the preset time; or The preset parameters of m4 cycles within m3 consecutive cycles within the preset time exceed the second threshold; wherein, the first threshold is less than the second threshold, m2≤m1, m4≤m3, m1≥m3, m2>m4.

5. The method according to claim 1, wherein The calculating, according to a preset period, the preset parameters of the message of the first data flow includes: Obtaining a message of the first data flow carried on the first network channel; The preset parameters of the messages of the first data flow are calculated according to the preset period based on the messages of the first data flow.

6. The method according to claim 5, characterized in that The obtaining of the message of the first data flow carried on the first network channel includes: Obtaining a message of the first application carried on the first network channel; Obtain the message of the first data stream from the message of the first application.

7. The method according to claim 6, characterized in that The obtaining the message of the first data flow from the message of the first application includes: Obtain the heartbeat stream message of the first data stream from the message of the first application.

8. The method according to claim 4, characterized in that Before creating the second network channel, the method further includes: When it is detected that the preset parameter exceeds a second threshold, the first data stream is directly switched to the second network channel.

9. The method according to claim 8, characterized in that Directly switching the first data stream to the second network channel includes: Determining that there is no enabled backup network channel, and acquiring an available network channel other than the first network channel; Performing quality assessment on each of the available network channels; selecting the network channel with the best quality as the second network channel according to the evaluation result of the quality evaluation; activating the second network channel as the backup network channel; Switch the network channel carrying the first data stream to the second network channel.

10. The method according to claim 1, characterized in that The first network channel is a WIFI channel or a cellular channel, and the second network channel is a WIFI channel or a cellular channel.

11. The method according to claim 1, wherein The first application is a game application or a video playback application, and the first data stream is a voice stream.

12. An electronic device, characterized in that: The electronic device comprises a memory for storing computer program codes, wherein the computer program codes include instructions. When the electronic device reads the instructions from the memory, the electronic device executes the method according to any one of claims 1 to 11.

13. A computer-readable storage medium, characterized in that The method comprises computer instructions, which, when executed on the electronic device, cause the electronic device to execute the method according to any one of claims 1 to 11.

Citation Information

Patent Citations

  • Network switching method and device, storage medium and electronic equipment

    CN112333800A