CN115484649A - Channel switching method, electronic device and storage medium - Google Patents

Channel switching method, electronic device and storage medium Download PDF

Info

Publication number
CN115484649A
CN115484649A CN202211034773.2A CN202211034773A CN115484649A CN 115484649 A CN115484649 A CN 115484649A CN 202211034773 A CN202211034773 A CN 202211034773A CN 115484649 A CN115484649 A CN 115484649A
Authority
CN
China
Prior art keywords
network
channel
network channel
flow
application
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211034773.2A
Other languages
Chinese (zh)
Inventor
杨景淇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Publication of CN115484649A publication Critical patent/CN115484649A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W36/00Hand-off or reselection arrangements
    • H04W36/0005Control or signalling for completing the hand-off
    • H04W36/0011Control or signalling for completing the hand-off for data sessions of end-to-end connection
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04BTRANSMISSION
    • H04B17/00Monitoring; Testing
    • H04B17/30Monitoring; Testing of propagation channels
    • H04B17/382Monitoring; Testing of propagation channels for resource allocation, admission control or handover
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W36/00Hand-off or reselection arrangements
    • H04W36/24Reselection being triggered by specific parameters
    • H04W36/30Reselection being triggered by specific parameters by measured or perceived connection quality data
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W88/00Devices specially adapted for wireless communication networks, e.g. terminals, base stations or access point devices
    • H04W88/02Terminal devices
    • H04W88/06Terminal devices adapted for operation in multiple networks or having at least two operational modes, e.g. multi-mode terminals

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • Electromagnetism (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Telephone Function (AREA)

Abstract

The application provides a channel switching method, electronic equipment and a storage medium, wherein the electronic equipment comprises a first network channel and a second network channel, and the method comprises the following steps: starting a first application, wherein the first application comprises a first data stream, the first data stream is borne on the first network channel, and the first data stream comprises a message; creating a second network channel, wherein the first data flow is continuously carried on the first network channel; calculating a preset parameter of the message of the first data stream according to the preset period; switching the first data stream to the second network channel under the condition that the preset parameter meets a preset condition; and under the condition that the preset parameters do not meet preset conditions, continuously bearing the first data flow on the first network channel, and destroying the second network channel. The method and the device can reduce the blocking problem of the operation of the service and improve the experience of the user.

Description

Channel switching method, electronic device and storage medium
This application is a divisional application, filed as original application with application number 202111137131.0, filed as 9/27/2021, the entire contents of which are incorporated herein by reference.
Technical Field
The present application relates to the field of communications technologies, and in particular, to a channel switching method, an electronic device, and a storage medium.
Background
With the rapid development of electronic technology and internet technology, mobile devices such as mobile phones and the like are increasingly applied in daily life of people, for example, mobile payment and games can be performed through the mobile phones. In order to ensure normal operation of common services (e.g., services such as games, conversations, social software, etc.), a user's mobile phone is usually connected to a wireless network. However, in some scenarios, the current wireless network is not enough to meet the service requirement (e.g., the signal of the mobile phone is degraded), which may cause the service to be stuck, thereby possibly reducing the user experience.
Disclosure of Invention
The application provides a channel switching method, an electronic device and a storage medium, which can reduce the problem of blocking of service operation and improve the user experience.
In a first aspect, an embodiment of the present application provides a channel switching method, which is applied to an electronic device, where the electronic device includes a first network channel and a second network channel, and the method includes: starting a first application, wherein the first application comprises a first data flow, and the first data flow is borne on a first network channel; the first data stream comprises packets; calculating a preset parameter of a message of the first data stream according to a preset period; when determining that a preset parameter in m2 periods of m1 continuous periods is greater than a first threshold value, or when determining that a preset parameter in m4 periods of m3 continuous periods is greater than a second threshold value, switching a network channel carrying a first data stream into a second network channel; wherein the first threshold is smaller than the second threshold, m2 is not less than m1, m4 is not less than m3, m1 is not less than m3, and m2 is greater than m4. In the method, 2 threshold values are set for the preset parameters, so that under different network qualities of the network channel, different network quality evaluation time delays can be provided according to the relative quality of the network quality, and different network channel switching speeds can be provided, thereby meeting the switching speed requirements of the electronic equipment on the network channel under different network qualities of the network channel, improving the switching speed of the network channel, further reducing the possibility of traffic jam during operation, and improving user experience.
In one possible implementation manner, the method further includes: determining that a preset parameter in m6 periods of m5 continuous periods is greater than a third threshold value, and switching a network channel bearing the first data stream into a second network channel; wherein the second threshold is smaller than the third threshold, m6 is less than or equal to m5, m3 is greater than or equal to m5, and m4 is greater than m6. In the method, 3 or more thresholds can be set for the preset parameters, and each threshold corresponds to different network quality evaluation time delays, so that the switching speed requirement of the electronic equipment on the network channel under different network qualities of the network channel is met, the switching speed of the network channel is improved, the possibility of blocking during service operation is reduced, and the user experience is improved.
In one possible implementation, the first application includes a second data stream, and the second data stream is carried on the first network channel; the method further comprises the following steps: and when determining that the preset parameter in m2 periods of m1 continuous periods is larger than a first threshold value, or when determining that the preset parameter in m4 periods of m3 continuous periods is larger than a second threshold value, switching the network channel carrying the second data flow into a second network channel. In the method, when the network quality of the first data stream is poor, the second data stream on the same network channel can be switched to the second network channel, so that the problem of unsmooth service operation caused by poor network quality of the second data stream is reduced, and the user experience is improved.
In one possible implementation, the first data stream and the second data stream are data streams sensitive to preset parameters, where the preset parameters include: delay, and/or packet loss rate.
In a possible implementation manner, calculating a preset parameter of a packet of a first data stream according to a preset period includes: acquiring a message of a first data flow loaded on a first network channel; and calculating the preset parameters of the messages of the first data flow according to the messages of the first data flow and the preset period.
In a possible implementation manner, acquiring a packet of a first data flow carried on a first network channel includes: acquiring a message of a first application loaded on a first network channel; and acquiring the message of the first data flow from the message of the first application.
In a possible implementation manner, acquiring a packet of a first data stream from a packet of a first application includes: and acquiring the heartbeat flow message of the first data flow from the message of the first application.
In a possible implementation manner, before switching the network channel carrying the first data flow to the second network channel, the method further includes: when the environment change is detected or the quality of the first network channel is predicted to be poor, the network channels in the available state except the first network channel in the electronic equipment are obtained; respectively carrying out quality evaluation on the network channels in the available state; selecting a second network channel with the best quality as a standby network channel according to the evaluation result of the quality evaluation; the standby network path is enabled.
In one possible implementation, switching a network channel carrying a first data flow to a second network channel includes: and when the second network channel which is enabled and is used as the standby network channel is determined, switching the network channel carrying the first data stream to the second network channel.
In one possible implementation manner, switching the network channel carrying the first data flow to the second network channel further includes: when determining that the network channel does not have the enabled standby network channel, acquiring the network channels which are in the available state except the first network channel; respectively carrying out quality evaluation on the network channels in the available state; selecting a second network channel with the best quality as a standby network channel according to the evaluation result of the quality evaluation; enabling a second network channel as a standby network channel; and switching the network channel carrying the first data flow to a second network channel.
In a possible implementation manner, before calculating the preset parameter of the packet of the first data stream according to the preset period, the method further includes: determining that the first application is an application in a preset white list.
In one 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.
In one possible implementation, the first application is a game application or a video playback application and the first data stream is a voice stream.
In a second aspect, an embodiment of the present application provides an electronic device, including:
a memory, configured to store a computer program code, where the computer program code includes instructions, where the electronic device has multiple network channels, where the electronic device runs a first application, where the first application is carried in the first network channel, and the first application includes multiple message streams, and when the electronic device reads the instructions from the memory, the electronic device is enabled to execute the method according to any one of the first aspect.
In a third aspect, embodiments of the present application provide a computer-readable storage medium, in which a computer program is stored, which, when run on a computer, causes the computer to perform the method according to the first aspect.
In a fourth aspect, embodiments of the present application provide a computer program, which, when executed by a computer, is configured to perform the method of the first aspect.
In a 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 in part or in whole on a memory not packaged with the processor.
Drawings
Fig. 1a is a schematic diagram of a heartbeat flow packet with an interval of 1s according to an embodiment of the present application;
fig. 1b is a schematic diagram of a round-trip delay calculation method for a heartbeat flow packet;
fig. 1c is a schematic diagram illustrating a network quality evaluation method based on RTT of a heartbeat flow packet according to the embodiment of the present application;
fig. 1d is a schematic diagram illustrating another network quality evaluation method based on RTT of a heartbeat flow packet according to the embodiment of the present application;
fig. 2a is a schematic diagram of network channel switching of a flow according to an embodiment of the present application;
fig. 2b is a schematic diagram of network channel switching of another flow according to the embodiment of the present application;
fig. 3a is a schematic view of a desktop display of a mobile phone according to an embodiment of the present application;
FIG. 3b is a schematic diagram of an application interface provided by an embodiment of the present application;
fig. 3c is a schematic view of an application interface of a mobile phone using a main network channel according to an embodiment of the present application;
fig. 3d is a schematic view of an application interface of a mobile phone using a standby network channel according to an embodiment of the present application;
fig. 4 is a schematic hardware structure diagram of an electronic device according to an embodiment of the present disclosure;
fig. 5 is a schematic diagram of a software architecture of an electronic device according to an embodiment of the present application;
fig. 6 is a schematic diagram of another software architecture of an electronic device according to an embodiment of the present application;
fig. 7 is a schematic flowchart of an embodiment of a channel switching method provided in the present application;
fig. 8 is a schematic diagram of a heartbeat flow message structure provided in the embodiment of the present application;
fig. 9 is a schematic diagram illustrating statistics of a battle flow message according to an embodiment of the present application;
fig. 10 is a schematic view of a battle flow message structure provided in the embodiment of the present application;
11a-11c are schematic diagrams of flow switching provided by embodiments of the present application;
fig. 11d is an interaction diagram of a sensitive service switching process provided in the embodiment of the present application;
fig. 11e is an interaction diagram of a non-sensitive service switching process provided in the embodiment of the present application;
FIG. 12 is a timing diagram illustrating an interaction between components of an electronic device according to an embodiment of the present application;
FIG. 13 is a timing diagram illustrating another interaction between components of an electronic device according to an embodiment of the present application;
FIG. 14 is a timing diagram illustrating another interaction between components of an electronic device according to an embodiment of the present application;
fig. 15 is a schematic diagram illustrating an implementation principle of a traffic reporting component according to an embodiment of the present application;
FIG. 16 is a diagram illustrating a code implementation of a registration hook function according to an embodiment of the present application;
FIG. 17 is a diagram illustrating a code implementation of a registration hook function according to an embodiment of the present application;
FIG. 18 is a schematic code implementation diagram of feature information according to an embodiment of the present application;
fig. 19 is a schematic diagram of a code implementation of message filtering according to an embodiment of the present application;
FIG. 20 is a schematic code implementation diagram of sending a target flow and a network quality evaluation result of the target flow according to an embodiment of the present application;
fig. 21 is a schematic code implementation diagram for acquiring a stream to be switched according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. Wherein in the description of the embodiments of the present application, "/" indicates an inclusive meaning, for example, a/B may indicate a or B; "and/or" herein is merely an association describing an associated object, and means that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone.
In the following, the terms "first", "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the embodiments of the present application, "a plurality" means two or more unless otherwise specified.
The terminology used in the embodiments of the invention herein is for the purpose of description and not of limitation.
The WIFI Network card is a device supporting internet access through a Wireless Local Area Network (WLAN).
The Data service network card is a device supporting 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 (5 g).
A network path 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.
In the embodiment of the present application, the network channel of the electronic device refers to a route established between a device accessing the internet by using the WIFI network card or the data service network card and other electronic devices, for example, a server. In the embodiment of the present application, a network channel established by using the WIFI network card is referred to as a WIFI channel, and a network channel established by using the data service network card is referred to as a cellular channel.
A plurality of network channels may be preconfigured in the electronic device, and may include, for example, a main WIFI channel, an auxiliary WIFI channel, a main cellular channel, and an auxiliary cellular channel, where the main WIFI channel and the auxiliary WIFI channel may operate in a 2.4GHz band or a 5GHz band, and for example, if the main WIFI channel operates in the 2.4GHz band, the auxiliary WIFI channel operates in the 5GHz band; if the main WIFI channel works in the 5GHz frequency band, the auxiliary WIFI channel works in the 2.4GHz frequency band. Further, the primary and secondary cellular pathways may correspond to the operator network, e.g., the primary cellular pathway may use sim card 1 (with sim card 1 being owned by operator a) and the secondary cellular pathway may use sim card 2 (with sim card 2 being owned by operator B). In a general case, the priority of the main WIFI channel is higher than that of the remaining three channels, and thus, the main network channel is usually the main WIFI channel. In a general case, the WIFI channel has a higher priority than the cellular channel in consideration of data traffic consumption of the electronic device. It is to be understood that the preset channels are only exemplary and are not meant to limit the embodiments of the present application, and in some embodiments, more or fewer channels may be included. In addition, taking the main WIFI channel as the main network channel is also only a preferred scheme, and does not constitute a limitation to the embodiments of the present application, and in some embodiments, other network channels may also be selected as the main network channel.
With the rapid development of electronic technology and internet technology, mobile devices such as mobile phones and the like are applied more and more in daily life of people, for example, mobile payment, games and the like can be performed through the mobile phones. In order to ensure normal operation of common services (e.g., services such as games, conversations, social software, etc.), a user's mobile phone is usually connected to a wireless network. However, in some scenarios, the current wireless network is not enough to meet the service requirement (e.g., the signal of the mobile phone is degraded), which may cause the service to be stuck, thereby possibly reducing the user experience.
In order to solve the above problem, the electronic device may open an acceleration channel to meet the service requirement. The acceleration channel may be a standby network channel. In one example provided by the present application, when the network channel quality of a certain flow of a currently running application deteriorates, the electronic device may switch the flow or a plurality of flows including the flow to a standby network channel.
In the above example, before switching a certain flow (hereinafter referred to as flow S for convenience of description) or a plurality of flows including flow S from a currently used network channel to a standby network channel, it is necessary to evaluate the network quality of the network channel currently used by flow S, determine whether to perform network channel switching according to a network quality evaluation result obtained by the evaluation, and switch flow S or a plurality of flows including flow S from the currently used network channel to the standby network channel when the determination result is that the network channel is switched. For convenience of description, in the following description, a network quality evaluation result of a network channel used by one flow is referred to as a network quality evaluation result of one flow, for example, a network quality evaluation result of the flow S is also a network quality evaluation result of a network channel used by the flow S.
In an embodiment provided by the present application, a preset parameter (for example, a time delay) of the packet of the flow S may be periodically calculated according to the packet of the flow S, and the network quality of the flow S may be evaluated according to whether the preset parameter meets a preset condition, so as to obtain a network quality evaluation result of the flow S.
In a possible implementation manner, a threshold 1 may be set for a preset parameter, the preset parameter of the packet of the flow S is calculated in each period, the preset parameter is compared with the threshold 1, the network quality of the flow S is evaluated according to a comparison result, so as to obtain a network quality evaluation result of the flow S in each period (for example, the quality evaluation result may include good quality or poor quality), and then the network quality evaluation result of the flow S is finally determined according to the network quality evaluation results of the flow S in consecutive periods, for example, when the quality evaluation result of k2 periods in consecutive k1 periods is poor quality, the network quality evaluation result of the flow S is determined to be poor, where k2 is less than or equal to k1.
Take the example that the current application includes a voice stream, and the voice stream includes a heartbeat stream message. A heartbeat flow message is a message that appears at certain time intervals in the flow S (e.g., the voice flow described above). Fig. 1a is a schematic diagram of a heartbeat flow message at a time interval of 1s.
Round-Trip Time (RTT) is an important performance indicator of a network, and indicates the total Time delay experienced from the Time when a transmitting end transmits data to the Time when the transmitting end receives an acknowledgement from a receiving end (the receiving end immediately transmits the acknowledgement after receiving the data). Referring to fig. 1b, a schematic diagram of a method for calculating a round-trip delay of a heartbeat flow packet is shown. Taking the heartbeat flow message transmitted between the user mobile phone and the server as an example, the round-trip delay of the heartbeat flow message is as follows: the user mobile phone starts to send the heartbeat request message to the server, and the total time delay is experienced until the user mobile phone receives the heartbeat response message fed back by the server.
The network quality of the network channel used by the voice flow in the current application may be evaluated according to the RTT of the heartbeat flow packet, assuming that the time interval of the heartbeat flow packet is 1s, the computation cycle of the RTT of the heartbeat flow packet is 1s, fig. 1c is a schematic RTT diagram of a plurality of cycles of the network channel used currently, and based on fig. 1c, a table of correspondence between the relative time and the RTT may be obtained as shown in table 1 below.
Relative time t(s) 1 2 3 4 5 6 7 8 9
The heart beats toReturn time delay rtt (ms) 40 40 40 500 500 500 500 500 500
TABLE 1
Assuming that the preset threshold of the RTT of the heartbeat flow packet is 150ms, if the RTT of the heartbeat flow packet calculated in a period is greater than 150ms, the network quality evaluation result of the voice flow in the period is of poor quality, otherwise, the network quality evaluation result of the voice flow in the period is of good quality; based on table 1, if the network quality evaluation result of the voice stream in 3 cycles of 5 consecutive cycles is poor in quality and the network quality evaluation result of the voice stream is poor in quality, 3 cycles are needed at the fastest speed, 5 cycles are needed at the slowest speed to determine the network quality evaluation result of the voice stream, and then whether to perform network channel switching is decided according to the network quality evaluation result, the network channel switching is completed when the decision result is that to perform network channel switching, the time consumed in the network quality evaluation process of the voice stream is too long, the switching efficiency of the network channel is affected, and then the traffic is likely to be stuck, and the user experience is reduced.
In another embodiment provided by the present application, compared to the previous embodiment, the preset condition corresponding to the preset parameter may be expanded from one preset condition to multiple preset conditions.
Taking the extension as two preset conditions, namely a preset condition 1 and a preset condition 2, as an example, the network quality evaluation time delays corresponding to the two preset conditions are different, the better the network quality corresponding to the preset conditions is, the larger the network quality evaluation time delay is, otherwise, the smaller the network quality evaluation time delay is. Take the case that the network quality evaluation delay of the preset condition 1 is greater than the network quality evaluation delay of the preset condition 2. In particular, the method comprises the following steps of,
after the preset parameters of the message of the stream S are calculated according to the preset period, whether the preset parameters satisfy the preset condition 1 and the preset condition 2 may be respectively determined, and as long as one of the preset conditions is satisfied, the stream S or a plurality of streams including the stream S are switched from the currently used network channel to the standby network channel.
Continuing the foregoing example of the heartbeat flow packet, two thresholds of 150ms and 300ms may be set for the RTT of the heartbeat flow packet, where the network quality evaluation policy corresponding to 150ms is: the network quality evaluation result of the flow S in 3 of the continuous 5 periods is poor, the network quality evaluation result of the flow S is poor, and the network quality evaluation policy corresponding to 300ms is: the network quality evaluation result of the flow S in 1 cycle is poor, and the network quality evaluation result of the flow S is poor. The network quality for 150ms is relatively better than the network quality for 300ms, and based on the above network quality assessment strategy it is known that: the time delay of the network quality evaluation strategy corresponding to 300ms is 1 cycle, the time delay of the network quality evaluation strategy corresponding to 150ms is at least 3 cycles, and the network quality evaluation time delay corresponding to 300ms is smaller than the network quality evaluation time delay corresponding to 150ms, so that the network channel switching time delay corresponding to 300ms is generally smaller than the network channel switching time delay corresponding to 150 ms.
Referring to fig. 1d, the RTT curve is the same as that of fig. 1c, and a table of correspondence between relative time and RTT can be obtained based on fig. 1d as shown in table 1 above. As can be known from fig. 1d, for this embodiment, in the period corresponding to the 4 th s relative time, since the RTT value is 500ms, which is greater than 300ms, the network quality evaluation result of the voice flow may be determined to be poor according to the network quality evaluation policy corresponding to 300ms, so that the voice flow or multiple flows including the voice flow may be switched to the standby network channel.
In the method, at least 2 preset conditions are set for the preset parameters, so that different network quality evaluation time delays can be provided according to the relative quality of the network quality under different actual network qualities of the network channels, and different network channel switching speeds can be provided, thereby meeting the switching speed requirements of electronic equipment on the network channels under different network qualities of the network channels, improving the switching speed of the network channels, further reducing the possibility of traffic jam during operation, and improving user experience.
A scenario used in the channel switching method according to the embodiment of the present application is illustrated.
In an example provided by the embodiment of the present application, the network quality of each flow of a currently running application is monitored, and when the network quality of a certain flow becomes poor, the flow is switched to a standby network channel for transmission, so as to improve the network quality of the flow. For example, as shown in fig. 2a, taking the first device as a mobile phone as an example, an application of the mobile phone includes stream a and stream B, where stream a and stream B are both initially transmitted on a WiFI channel, and a stream of the application is not transmitted on a cellular channel, and when the network quality of stream B deteriorates, the mobile phone switches stream B to the cellular channel for transmission; after the handoff, stream a is transmitted over the WiFI channel and stream B is transmitted over the cellular channel. In this example, when the quality of the network channel is evaluated for the above flow, the packet identification method according to the embodiment of the present application may be used, so as to quickly evaluate whether the quality of the network channel of the flow is poor, thereby quickly implementing network channel switching.
In another example provided by the embodiment of the present application, when there is more than one flow in an application, if the network quality of one flow is degraded, multiple flows including the flow on the same network channel may be switched to a standby network channel, so that the quality evaluation result of a single flow may be applied to multiple flows including the single flow together, thereby implementing network channel switching of multiple flows, further reducing the possibility of traffic jam of the application, and improving user experience. Fig. 2b is a schematic diagram of channel switching for a currently applied flow in the embodiment of the present application. Taking the delay-sensitive flows to which the flow a and the flow B are applied as an example in fig. 2B, the flow a and the flow B are initially transmitted on a WIFI channel, and if the quality degradation of the flow B is detected (for example, the network delay state of the flow B is calculated to be degraded), the flow a and the flow B on the same WIFI channel are switched to a cellular channel together, so that the network quality evaluation result of the flow B is applied to the flow a and the flow B on the same network channel together. In this example, when performing network channel quality evaluation on a certain flow, the packet identification method according to the embodiment of the present application may also be used, so as to quickly evaluate whether the network channel quality of the flow is poor, and thus quickly complete network channel switching.
An application usually includes multiple streams, and because of different transmission characteristics of different streams, some streams are difficult to monitor whether their network quality is degraded, so even if the electronic device monitors the network quality of all the streams of the application in real time, it may not be possible to monitor all the streams with degraded network quality in time. According to the embodiment of the application, when the network quality of a single flow is deteriorated, a plurality of flows including the flow on the same network channel are switched to the standby network channel, the plurality of flows can include the flow which cannot monitor the deterioration of the network quality in time, and therefore the problem of blocking of service operation caused by the flow which cannot monitor the deterioration of the network quality in time is solved. Still taking the above fig. 2B as an example, the stream a and the stream B are transmitted on the WIFI channel, if the transmission of the WIFI channel has a problem, the network quality of the stream a and the stream B becomes poor, and further the operation of the application service is stuck, but the mobile phone only monitors the network quality of the stream B in time and does not monitor the network quality of the stream a in time, and by switching the stream a and the stream B to the standby network channel (for example, the cellular channel) together, the problem of stuck service operation caused by the poor network quality of the stream B is solved, and the problem of stuck service operation caused by the poor network quality of the stream a is also solved, so that the stuck service operation problem can be reduced, and the user experience is improved.
Hereinafter, a channel switching method according to the present application is exemplarily described by taking another example as an example.
An applicable scenario of the channel switching method according to the embodiment of the present application is illustrated by fig. 3a to fig. 3 d.
Take the first device as a mobile phone for example. Fig. 3a is a schematic view of a desktop of a mobile phone. As shown in fig. 3a, a user may click on a video application icon on the desktop of the mobile phone to open a video application, so as to obtain the video display diagram shown in fig. 3 b.
Fig. 3c is a schematic diagram illustrating an effect of the mobile phone after using the main network channel (e.g., WIFI channel). As shown in fig. 3c, after the mobile phone obtains the path of the main network channel, the mobile phone can use the main network channel to watch the video.
It will be appreciated that current network applications (e.g., the video application in fig. 3 c) may include multiple streams (e.g., video and audio streams) that may be carried over the primary network channel described above.
Referring to fig. 2b, if one (e.g., video) of the plurality of streams (e.g., video and audio streams) is degraded, the plurality of streams are switched together to the standby network channel.
Fig. 3d is a diagram illustrating a handset using an alternate network channel (e.g., a cellular channel). As shown in fig. 3d, when the mobile phone receives the channel switching instruction, the mobile phone may switch the voice stream and the video stream from the current main network channel to the standby network channel, and may use the standby network channel to watch the video, so as to avoid video jamming.
The channel switching method provided by the application can be applied to the first equipment. The first device may be a mobile terminal, a terminal device, a User Equipment (UE), an access terminal, a subscriber unit, a subscriber station, a mobile station, a remote terminal, a mobile device, a User terminal, a wireless communication device, a User agent, or a User Equipment. The first device may be a Station (ST) in a WLAN, and may be 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 capability, a computing device or other processing device connected to a Wireless modem, a vehicle-mounted device, a vehicle-mounted networking terminal, a computer, a laptop computer, a handheld communication device, a handheld computing device, a satellite Wireless device, a Wireless modem card, a Set Top Box (STB), a Customer Premises Equipment (CPE), and/or other devices for communicating on a Wireless system, as well as a next generation communication system, such as a Mobile terminal in a 5G Network or a Mobile terminal in a future evolution Public Land Mobile Network (PLMN) Network, and the like. The first device 10 may also be a wearable device. Wearable equipment can also be called wearable intelligent equipment, is the general term of applying wearable technique to carry out intelligent design, develop the equipment that can dress to daily wearing, like glasses, gloves, wrist-watch, dress and shoes etc.. A wearable device is a portable device that is worn directly on the body or integrated into the clothing or accessories of the user. The wearable device is not only a hardware device, but also realizes powerful functions through software support, data interaction and cloud interaction. The generalized wearable intelligent device has the advantages that the generalized wearable intelligent device is complete in function and large in size, can realize complete or partial functions without depending on a smart phone, such as a smart watch or smart glasses, and only is concentrated on a certain application function, and needs to be matched with other devices such as the smart phone for use, such as various smart bracelets for monitoring physical signs, smart jewelry and the like.
An exemplary electronic device provided in the following embodiments of the present application is first described below. Fig. 4 shows a schematic structural diagram of the electronic device 100, and the electronic device 100 may be the first device.
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 key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a Subscriber Identification Module (SIM) card interface 195, and the like. 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, and the like.
It is to be understood that the illustrated structure of the embodiment of the present application does not specifically limit the electronic device 100. In other embodiments of the present application, electronic device 100 may include more or fewer components than shown, or some components may be combined, some components may be split, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Processor 110 may include one or more processing units, such as: the processor 110 may include an Application Processor (AP), a modem processor, a Graphics Processor (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), among others. The different processing units may be separate devices or may be integrated into one or more processors. The controller may be, among other things, a neural center and a command center of the electronic device 100. The controller can generate an operation control signal according to the instruction operation code and the timing signal to complete the control of instruction fetching and instruction execution.
A memory may also be provided in processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Avoiding repeated accesses reduces the latency of the processor 110, thereby increasing the efficiency of the system.
The execution of the screen capture method provided by the embodiment of the present application may be controlled by the processor 110 or completed by calling other components, for example, calling the processing program stored in the internal memory 120A in the embodiment of the present application, so as to implement the screen capture operation of the user and improve the experience of the user.
In some embodiments, processor 110 may include one or more interfaces. The interface may include an integrated circuit (I2C) interface, an integrated circuit built-in audio (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, etc.
The USB interface 130 is an interface conforming to the USB standard specification, and may be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 130 may be used to connect a charger to charge the electronic device 100, and may also be used to transmit data between the electronic device 100 and a peripheral device. And the earphone can also be used for connecting an earphone and playing audio through the earphone. The interface may also be used to connect other electronic devices, such as AR devices and the like.
It should be understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is only an illustration, and does not limit the structure of the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection manners or a combination of multiple interface connection manners in the above embodiments.
The wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 100 may be used to cover a single or multiple communication bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed as a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 150 may provide a solution including 2G/3G/4G/5G wireless communication 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), and the like. The mobile communication module 150 may receive the electromagnetic wave from the antenna 1, filter, amplify, etc. the received electromagnetic wave, and transmit the electromagnetic wave to the modem processor for demodulation. The mobile communication module 150 may also amplify the signal modulated by the modem processor, and convert the signal into electromagnetic wave through the antenna 1 to radiate the electromagnetic wave. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the same device as at least some of the modules of the processor 110.
The modem processor may include a modulator and a demodulator. The modulator is used for modulating a low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used for demodulating the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then passes the demodulated low frequency baseband signal to a baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and then transferred 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 a stand-alone device. In other embodiments, the modem processor may be provided in the same device as the mobile communication module 150 or other functional modules, independent of the processor 110.
The wireless communication module 160 may provide a solution for wireless communication applied to the electronic device 100, including Wireless Local Area Networks (WLANs) (e.g., wireless fidelity (Wi-Fi) networks), bluetooth (bluetooth, BT), global Navigation Satellite System (GNSS), frequency Modulation (FM), near Field Communication (NFC), infrared (IR), and the like. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, perform frequency modulation and amplification on the signal, and convert the signal into electromagnetic waves via the antenna 2 to radiate the electromagnetic waves.
In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150 and antenna 2 is coupled to wireless communication module 160 so that electronic device 100 can communicate with networks and other devices through wireless communication techniques. The wireless communication technology 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 (time-division multiple access, TD-SCDMA), long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM, and/or IR technologies, etc. 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).
The electronic device 100 implements display functions via the GPU, the display screen 194, and the application processor. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and an application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
The display screen 194 is used to display images, video, and the like. The display screen 194 includes a display panel. The display panel may adopt a Liquid Crystal Display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (active-matrix organic light-emitting diode, AMOLED), a flexible light-emitting diode (FLED), a miniature, a Micro-oeld, a quantum dot light-emitting diode (QLED), and the like. In some embodiments, the electronic device 100 may include 1 or N display screens 194, N being a positive integer greater than 1.
The electronic device 100 may implement a shooting function through the ISP, the camera 193, the video codec, the GPU, the display 194, the application processor, and the like.
The ISP is used to process the data fed back by the camera 193. For example, when a photo is taken, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converting into an image visible to naked eyes. The ISP can also carry out algorithm optimization on the noise, brightness and skin color of the image. The ISP can also optimize parameters such as exposure, color temperature and the like of a shooting scene. In some embodiments, the ISP may be provided in camera 193.
The camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image to the photosensitive element. The photosensitive element may be a Charge Coupled Device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The light sensing element converts the optical signal into an electrical signal, which is then passed to the ISP where it is converted into a digital image signal. And 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 and other formats. In some embodiments, electronic device 100 may include 1 or N cameras 193, N being a positive integer greater than 1.
The digital signal processor is used for processing digital signals, and can process other digital signals besides digital image signals. For example, when the electronic device 100 selects a frequency bin, the digital signal processor is used to perform fourier transform or the like on the frequency bin energy.
Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 may play or record video in a variety of encoding formats, such as: moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, and the like.
The NPU is a neural-network (NN) computing processor, which processes input information quickly by referring to a biological neural network structure, for example, by referring to a transfer mode between neurons of a human brain, and can also learn by itself continuously. Applications such as intelligent recognition of the electronic device 100 can be implemented by the NPU, for example: image recognition, face recognition, speech recognition, text understanding, and the like.
The external memory interface 120B may be used to connect an external memory card, such as a Micro SD card, to extend the memory capability of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120B to implement a data storage function. For example, files such as music, video, etc. are saved in the external memory card.
The internal memory 120A may be used to store computer-executable program code, which includes instructions. The internal memory 120A may include a program storage area and a data storage area. The storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required by at least one function, and the like. The storage data area may store data (such as audio data, phone book, etc.) created during use of the electronic device 100, and the like. In addition, the internal memory 120A may include a high-speed random access memory, and may further include a nonvolatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (UFS), and the like. The processor 110 executes various functional applications of the electronic device 100 and data processing by executing instructions stored in the internal memory 120A and/or instructions stored in a memory provided in the processor.
The electronic device 100 may implement audio functions via the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone interface 170D, and the application processor. Such as music playing, recording, etc.
The touch sensor 180K is also referred to as a "touch panel". The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, which is also called a "touch screen". The touch sensor 180K is used to detect a touch operation applied thereto or nearby. The touch sensor can communicate the detected touch operation to the application processor to determine the touch event type. Visual output associated with the touch operation may be provided via the display screen 194. In other embodiments, the touch sensor 180K may be disposed on a surface of the electronic device 100, different from the position of the display screen 194.
In this embodiment of the application, the touch sensor 180K may acquire touch screen data of a user, and may send the touch screen data to the processor 110 for processing.
The keys 190 include a power-on key, a volume key, and the like. The keys 190 may be mechanical keys. Or may be touch keys. The electronic apparatus 100 may receive a key input, and generate a key signal input related to user setting and function control of the electronic apparatus 100.
The motor 191 may generate a vibration cue. The motor 191 may be used for incoming call vibration cues, as well as for touch vibration feedback. For example, touch operations applied to different applications (e.g., photographing, audio playing, etc.) may correspond to different vibration feedback effects. The motor 191 may also respond to different vibration feedback effects for touch operations applied to different areas of the display screen 194. Different application scenes (such as time reminding, receiving information, alarm clock, game and the like) can also correspond to different vibration feedback effects. The touch vibration feedback effect may also support customization.
Indicator 192 may be an indicator light that may be used to indicate a state of charge, a change in charge, or a message, missed call, notification, etc.
The SIM card interface 195 is used to connect a SIM card. The SIM card can be brought into and out of contact with the electronic apparatus 100 by being inserted into the SIM card interface 195 or being pulled out of the SIM card interface 195. The electronic device 100 may support 1 or N SIM card interfaces, N being a positive integer greater than 1. The SIM card interface 195 may support a Nano SIM card, a Micro SIM card, a SIM card, etc. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the plurality of cards can be the same or different. The SIM card interface 195 may also be compatible with different types of SIM cards. The SIM card interface 195 may also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as communication and data communication. In some embodiments, the electronic device 100 employs esims, namely: an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
Next, a system block diagram of the first device will be described. As shown in fig. 5, the first device 10 includes an application layer 11, a service layer 12, a policy layer 13, and a kernel layer 14. Wherein, the first and the second end of the pipe are connected with each other,
the application layer 11 may be used to provide various network applications, which may be third-party applications or system applications, such as network applications of games, music, videos, and the like. The application layer 11 provides a network application of a type not specifically limited. A network application here refers to an application that needs to use a network channel of the first device 10 to obtain resources from a network.
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 configured to detect an application state, for example, the application state may include states of application exit, application open, application running, application installation, and application uninstallation, and it is understood that the above states are merely exemplary descriptions, and may also include more states, which are not described herein again. The network probing component 122 can be configured to probe an open state of a network channel. The channel-level path management component 123 may be responsible for requesting/closing a network channel, sensing a state change of the network channel, updating a selection policy of the network channel, and may also be used for storing paths of multiple network channels. The application-level policy management component 124 may generate different enforcement policies based on the input information, such as enabling acceleration functionality of the network channel, initiating traffic awareness (e.g., probing traffic of the network channel), and the like. The channel and application quality assessment component 125 can be used to assess the quality of a network channel. The service layer 12 may also include: the network connection management component 126 is configured to enable the network channel, i.e., convert the network channel from a sleep state to an awake state, in which the network channel can be directly used.
Policy layer 13 may include a flow level path management component 131, a flow level policy management component 132, and a traffic awareness component 133. The flow level path management component 131 may be configured to update selection of a network channel according to a policy change of an upper layer, trigger quality detection of the network channel, and dynamically select an optimal channel, and may also be configured to store paths of different network channels, for example, paths of a network channel currently used by an application (e.g., a main network channel) and a standby network channel may be stored. The flow level policy management component 132 may be used to instruct switching of network channels and may also be used to store network channel switching policies for flows in a network application. The traffic sensing component 133 may be configured to count the reported traffic and evaluate the network quality of each flow.
The kernel layer 14 may include a traffic reporting component 141 and a policy enforcement component 142. The traffic reporting component 141 may be configured to collect and report traffic information. Policy enforcement component 142 may be used to perform a handover of a network channel.
It should be understood that the interface connection relationship between the components illustrated in the embodiments of the present application is only an exemplary illustration, and does not constitute a limitation on the structure of the first device. In other embodiments of the present application, the first device may also adopt different interface connection manners or a combination of multiple interface connection manners in the above embodiments.
The system framework shown in fig. 5 above is only used to illustrate the implementation of the hierarchical architecture of the first device. The system architecture shown in fig. 5 may also be implemented as part of an existing layered software architecture. Taking an Android (Android) system as an example, fig. 6 is a block diagram illustrating a software structure of an electronic device with an Android system according to an embodiment of the present application. The layered architecture divides the software into several layers, each layer having a clear role and division of labor. The layers communicate with each other through a software interface. In the embodiment of the present application shown in fig. 6, the Android system is divided into five layers, which are, from top to bottom, an application layer, an application framework layer (also referred to as a system framework layer), a system library, an Android runtime layer, a Hardware Abstraction Layer (HAL), and a kernel layer.
The application layer includes several applications (hereinafter simply referred to as applications), such as a camera, gallery, calendar, WLAN, etc. In one possible example, the application layer in the system architecture shown in fig. 5 may correspond to the application layer. The application layer of the electronic device shown in fig. 6 may include the network applications described in the embodiments of the present application, such as a video playing application, a game application, and the like.
The Application framework layer provides an Application Programming Interface (API) and a Programming framework for applications of the Application layer, including various components and services to support android development by developers. The application framework layer also includes a number of predefined functions. For example, the application framework layer may include a window manager, content provider, resource manager, camera service, and the like. In one possible example, the service layer and policy layer in the system architecture shown in FIG. 5 may be located at the application framework layer.
The system library and Android Runtime layer comprises a system library and an Android Runtime (Android Runtime). The system library may include a plurality of functional modules. For example: surface managers, two-dimensional graphics engines, three-dimensional graphics processing libraries (e.g., openGL ES), media libraries, font libraries, and the like.
The HAL layer is an interface layer between the operating system kernel and the hardware circuitry. HAL layers include, but are not limited to: an Audio hardware abstraction layer (Audio HAL) and a Camera hardware abstraction layer (Camera HAL).
The kernel layer is a layer between hardware and software. The inner core layer may include: display drive, camera drive, audio drive, sensor drive, and the like. In one possible example, the kernel layer in the system architecture shown in fig. 5 may correspond to the kernel layer in the software architecture shown in fig. 6, and in this case, as shown in fig. 6, the kernel layer may include: a flow reporting component and a strategy executing component.
The following describes an exemplary channel switching method according to an embodiment of the present application with reference to the first device shown in fig. 4 to 6.
Fig. 7 is a flowchart illustrating an embodiment of a channel switching method according to an embodiment of the present application, where the method includes:
step 301, responding to the operation of the user, starting the network application.
Specifically, the user may perform an open operation in the first device to open a web application. For example, a user may click on an icon of a web application in a first device. In response to the user's operation, the application layer 11 in the first device starts a web application. It is to be understood that the foregoing examples merely illustrate a scenario in which the web application is started by clicking, and do not constitute a limitation to the embodiments of the present application, and in some embodiments, the web application may also be started by other operations (for example, double-clicking, sliding, and the like). The network application can be network-type applications such as online games, online videos, online music and the like.
Fig. 3a is a schematic diagram of a desktop of a mobile phone. As shown in fig. 3a, the user may click on the video application icon on the desktop of the mobile phone to open a video application, so as to obtain the video display diagram shown in fig. 3 b.
In step 302, the environment detection component 121 detects that the network application is switched to the foreground or the network changes, and notifies the application-level policy management component 124.
Specifically, the environment detection component 121 in the service layer 12 in the first device may continuously detect the state of the network application or the environment of the network, and when the environment detection component 121 detects that any network application is switched to the foreground or the environment of the network changes, a first notification message may be sent to the application-level policy management component 124, where the first notification message may be used to notify the application-level policy management component 124 that the network application is switched to the foreground or the environment of the network changes. It is to be understood that the first notification message may further include an identity of the web application (for example, the identity of the web application may be the UID), and the identity may be used to identify a unique identity of the web application.
For example, the identity of the network application may be implemented by the following codes:
Figure BDA0003818491250000141
EXPORT_SYMBOL(sock_i_uid)。
in 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 condition of starting acceleration.
Specifically, after the application-level policy management component 124 receives the first notification message sent by the environment detection component 121, it may be determined from the first notification message that the network application has switched to the foreground. The application-level policy management component 124 may then further determine whether the network application is included in a preset application white list.
In a specific implementation, an application white list may be preset in the application-level policy management component 124, where the application white list may include a plurality of network applications, each network application may be identified by the above-mentioned identity, and the application white list may be used to characterize a network application that may start acceleration. The network application in the preset application white list may include a service type, for example, the service types of the network applications in the preset application white list may all be sensitive types, and the sensitive type service may include a delay sensitive type service, a packet loss rate sensitive type service, and the like. When the identity of the network application in the first notification message is compared with the identity of the network application in the preset application white list, it can be determined whether the network application in the first notification message is included in the preset application white list. If the web application in the first notification message is included in the preset application white list, it may be determined that the web application satisfies the condition of starting acceleration, and if the web application in the first notification message is not included in the preset application white list, it may be determined that the web application does not satisfy the condition of starting acceleration.
Illustratively, table 2 is a white list of web applications.
Application name Characteristic stream type Channel quality parameter
Baidu net disk Down-loading current Rate of speed
WeChat Video streaming Delay/packet loss
Game machine Fight stream Delay/packet loss
TABLE 2
It can be understood that, if the current network application is not in the preset application white list, that is, the service type of the current network application is an insensitive service, when the first device detects that the main network channel is degraded, the first device may further detect other network channels with better quality, so that the insensitive service may be directly switched to the network channel with better quality.
At step 304, the application-level policy management component 124 sends a channel enable message to the flow-level path management component 131 for enabling a network channel.
Specifically, if the application-level policy management component 124 determines that the current network application satisfies the condition for turning on acceleration, a channel enabling message may be sent to the flow-level path management component 131, where the channel enabling message is used to indicate that the flow-level path management component 131 may enable a network channel (e.g., a main network channel).
In 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.
Specifically, after receiving the channel enabling message sent by the application-level policy management component 124, the stream-level path management component 131 may send a main network channel request to the channel-level path management component 123, where the main network channel request is used to request a path of the main network channel. Illustratively, the primary network channel may be a primary WIFI channel.
In step 306, the channel-level path management component 123 sends the path of the main network channel to the stream-level path management component 131.
Specifically, the channel-level path management component 123 may pre-configure paths of a plurality of network channels, for example, the plurality of network channels may include a main WIFI channel, an auxiliary WIFI channel, a main cellular channel, and an auxiliary cellular channel, where the main WIFI channel and the auxiliary WIFI channel may operate in a 2.4GHz frequency band or a 5GHz frequency band, and for example, if the main WIFI channel operates in the 2.4GHz frequency band, the auxiliary WIFI channel operates in the 5GHz frequency band; if the main WIFI channel works in the 5GHz frequency band, the auxiliary WIFI channel works in the 2.4GHz frequency band. Further, the primary and secondary cellular pathways may correspond to an operator network, e.g., the primary cellular pathway may use sim card 1 (with sim card 1 being owned by operator a) and the secondary cellular pathway may use sim card 2 (with sim card 2 being owned by operator B). In a general case, the priority of the main WIFI channel is higher than that of the other three channels, and therefore, the main network channel is generally the main WIFI channel. It is understood that the preset channels are only exemplary and are not meant to limit the embodiments of the present application, and in some embodiments, more channels may be included. In addition, taking the main WIFI channel as the main network channel is also only a preferred scheme, and does not constitute a limitation to the embodiments of the present application, and in some embodiments, other network channels may also be selected as the main network channel.
After the channel-level path management component 123 receives the main network channel request sent by the stream-level path management component 131, one network channel may be selected from the multiple network channels as a main network channel (for example, the main network channel is a main WIFI channel), and a path of the main network channel is sent to the stream-level path management component 131.
In step 307, the flow level path management component 131 stores the received path of the main network channel.
Specifically, when the stream-level path management component 131 receives the path of the main network channel sent by the channel-level path management component 123, the path of the main network channel may be stored. Illustratively, the path of the main network channel may be characterized by WIFI 1.
Fig. 3c is a schematic diagram of the effect of the mobile phone after using the main network channel. As shown in fig. 3c, after the mobile phone acquires the path of the main network channel, the mobile phone can use the main network channel to watch the video.
It will be appreciated that current network applications (e.g., the video application in fig. 3 c) may include multiple streams (e.g., video and audio streams) that may be carried over the primary network channel described above.
At step 308, the application-level policy management component 124 sends a traffic probe request to the traffic-aware component 133.
In particular, the traffic probe request may be used to instruct the traffic awareness component 133 to start message statistics of the network application on the main network channel. The traffic probe request may include an identity (e.g., UID) of a network application to be currently probed, and is used to request to probe a flow of the network application on the main network channel, where the flow corresponds to the identity UID. It will be appreciated that the flow of the network application described above may be in the form of a message.
It should be noted that, this step 308 may be executed simultaneously with the step 304, or may be executed at any time after the step 304, and this application is not limited to this.
In step 309, the traffic sensing component 133 sends a traffic reporting request to the traffic reporting component 141.
Specifically, after receiving the traffic detection request sent by the application-level policy management component 124, the traffic sensing component 133 may send a traffic reporting request to the traffic reporting component 141, where the traffic reporting request may be used to instruct the traffic reporting component 141 to detect a message of a network application in the current main network channel, and report the detected message. It will be appreciated that the traffic probe request may contain an identification (e.g., UID) of the web application.
In step 310, the traffic reporting component 141 performs traffic detection and reports the detected packet to the traffic sensing component 133.
Specifically, after receiving the traffic reporting request sent by the traffic sensing component 133, the traffic reporting component 141 may detect, according to an identifier (e.g., UID) of the network application in the traffic reporting request, a message of the network application corresponding to the identifier of the network application, so as to obtain a message of the network application in the main network channel, and may report the detected message of the network application to the traffic sensing component 133.
In a specific implementation, the traffic reporting component 141 may call a component (e.g., a Netfilter component of an android system) to obtain a message of the network application on the main network channel. It is to be understood that the Netfilter component is merely an exemplary illustration and does not constitute a limitation to the embodiments of the present application, and in some embodiments, the detection of the message may also be completed through other components.
Illustratively, the parameters of the network channel may be implemented by the following codes:
typedef struct{
bool available;
bool slowDevForbbiden;
uint64_t qoeBadTimeStamp;
uint64_t chQoeBadStartTime;
uint32_t rcvRate;
}
it is understood that the detected messages may be messages of one or more feature flows in the current network application, where the feature flow may be the most sensitive flow in the network application, that is, the flow having a larger influence on the current network application. In addition, the quality of the network channel can be evaluated through the parameters of the network channel.
In step 311, the traffic sensing component 133 counts the messages of the network application in the main network channel, predicts the messages according to the statistical result to obtain a prediction result, and sends the prediction result to the flow-level path management component 131.
Specifically, after receiving the message of the network application detected by the traffic reporting component 141, the traffic sensing component 133 may perform statistics on the message, so as to obtain a message statistical result. Then, analysis can be performed according to the above-mentioned packet statistical result, so that the network condition can be predicted, that is, whether the network condition will become good or bad can be predicted according to the packet statistical result. In specific implementation, the packet loss rate and/or the time delay of the packet of the network application may be counted, so that the network condition may be predicted. Illustratively, the packet loss rate and/or the time delay of the packet in the preset N periods may be counted, if the counted packet loss rate and/or the counted time delay meet the preset requirement, the network condition may be predicted to be good, and if the counted packet loss rate and/or the counted time delay do not meet the preset requirement, the network condition may be predicted to be bad.
As can be appreciated. The quality of the network channel in step 311 is coarse-grained evaluation, that is, the packet of the feature stream is counted in a short period to quickly predict the network condition, so that a standby network channel can be selected in advance, and the time delay of channel switching can be further saved.
The messages may be messages of each flow of the network application on the main network channel. When the traffic sensing component 133 receives the message, the message may be analyzed. The message analysis may be based on the features of the message, so as to identify the feature stream. For example, in the case of a peace and elite game, the feature stream of the game may be a voice stream, that is, the voice stream has a relatively large influence on the game, and has the highest sensitivity, and when the voice stream has a poor quality (for example, neither the delay nor the packet loss rate is satisfactory), the game experience of the user is seriously affected. Therefore, it is necessary to identify the voice stream and further count the voice stream packets in the packet. And the identification of the voice stream message can be realized by heartbeat packet statistics. Illustratively, taking the UDP protocol as an example, the data packet characteristics of the voice stream may be characterized by the following characteristics:
ascending: payload [6] =0x64;
descending: payload [6] =0x65.
Fig. 8 is a schematic diagram of heartbeat messages of a voice stream of the UDP protocol.
That is, reading the preset field in the payload in the uplink and downlink packet can identify whether the packet is a voice stream packet.
Then, statistics may be performed on the packets of the voice stream, so as to obtain a time delay and/or a packet loss rate of the packets of the voice stream. In specific implementation, the messages of the voice stream within a preset time length can be counted. Preferably, the preset time period may be 1s, so that whether the quality of the voice stream is degraded or not can be determined as soon as possible, and the voice stream can be switched to the standby network channel as soon as possible, so as to provide a high game experience. For example, if the delay and/or the packet loss rate of the packet of the voice stream do not meet the requirement, it may be determined that the quality of the voice stream is poor, and at this time, a handover may be triggered to handover the voice stream to a standby network channel. It should be noted that, the above example is only exemplified by a game, and in a specific application, other network applications may also be included, for example, a hundred-degree network disk, a feature flow of the network application is a download flow, that is, a message of a download flow may be found in the above message, and an influence factor of the message of the download flow may be a rate. In addition, the network application may also include a social network application such as WeChat, and the feature stream of the network application is a video stream, that is, a packet of the video stream may be found in the packet, and an influencing factor of the packet of the video stream may be a delay and/or a packet loss rate.
It will be appreciated that the feature stream may include, in addition to the voice stream, a play stream in a game. Taking peace elite as an example, whether the current message stream is a fighting stream can be judged by periodically counting the number of UDP messages. At present, the period adopted by peace and elite is 500ms, so the total number of messages in the period can be counted to determine whether the message is a fight stream, for example, if the total number of messages in the 500ms period is greater than 10, the message stream is a fight stream. Fig. 9 is a message statistical diagram of the fight flow of the UDP protocol. As shown in fig. 9, the horizontal axis represents time, the vertical axis represents the total number of packets, and since there are basically 30 packets per second, it can be determined by calculation that there are 15 packets per 500ms, and thus it can be determined that the packet stream is a fight stream.
Then, take the royal glory as an example, wherein the royal glory filters the fight message by using the filtering UDP protocol number and the message header characteristic payload =0x 00010000. Fig. 10 is a schematic diagram of heartbeat messages of a fight stream of the UDP protocol.
In step 312, the flow-level path management component 131 requests the backup network channel from the channel-level path management component 123 based on the received prediction result.
Specifically, after the flow-level path management component 131 receives the prediction result, the standby network channel may be selected in advance based on the prediction result, for example, a standby network channel request may be sent to the channel-level path management component 123 to request a standby network channel.
Optionally, the backup network channel request may further carry a tag, which may be used to indicate a prediction of a handover of the primary network channel, and not actually perform the handover.
Now, the selection of the backup network channel will be described by taking a mobile phone as an example with reference to fig. 11a to 11 c. As shown in fig. 11a, the Mobile phone has the capability of 4 network channels, such as a main WIFI channel (e.g., WIFI 1), an auxiliary WIFI channel (e.g., WIFI 2), a main cellular channel (e.g., mobile 1), and an auxiliary cellular channel (e.g., mobile 2). Assume that the handset currently runs a network application (e.g., weChat) on the WIFI1 channel (the primary network channel), which includes stream A (e.g., video stream) and stream B (e.g., audio stream). After the Mobile phone receives the prediction result of the network to be degraded, a standby network channel may be selected in advance, where the standby network channel may be one of the auxiliary WIFI channels (e.g., WIFI 2), the main cellular channel (e.g., mobile 1), and the auxiliary cellular channel (e.g., mobile 2) that has the best channel quality. After selecting one of the auxiliary WIFI channel (e.g., WIFI 2), the main cellular channel (e.g., mobile 1), and the auxiliary cellular channel (e.g., mobile 2) as a standby network channel (e.g., mobile 1), the path of the Mobile1 channel may be stored.
When the Mobile phone finds that the quality of the flow a does not meet the requirement through further message detection, at this time, the flow a can be switched to a standby network channel, that is, a Mobile1 channel. As shown in fig. 11B, at this time, the stream B may continue to be carried on the main network channel, i.e., WIFI channel, and the stream a may be carried on the standby network channel, i.e., mobile1 channel.
It should be noted that, the above example only illustrates a scenario in which one stream is switched, and does not limit the embodiment of the present application, and in some embodiments, a scenario in which multiple streams are switched may also be included.
Optionally, when the Mobile phone finds that the quality of the flow a does not meet the requirement through further message detection, at this time, both the flow a and the flow B may be switched to a standby network channel, that is, a Mobile1 channel. As shown in FIG. 11c, both flow A and flow B are carried on the Mobile1 channel.
Next, the trigger condition for channel switching will be described by taking a mobile phone as an example, with reference to fig. 11d and 11 e. Fig. 11d is a channel switching triggering process of the non-sensitive traffic. As shown in fig. 11d, the traffic sensing component 133 in the mobile phone receives the heartbeat flow packet of the feature flow detected by the traffic reporting component 141 within the preset first time period, and can determine whether the quality of the network channel is poor through statistical analysis of the heartbeat flow packet of the feature flow within the preset first time period. Since the current service is a non-sensitive service, the preset first duration may be set to be longer, for example, 5s. When the traffic sensing component 133 determines that the quality of the current network channel is poor, a handover notification may be sent to the policy management component 132 to trigger the handover of the network channel, for example, by evaluating the quality of other network channels and handing over the current non-sensitive service to the other network channel with the best quality.
Fig. 11e is a channel switching triggering process of the sensitive traffic. As shown in fig. 11e, the traffic sensing component 133 in the mobile phone receives the heartbeat flow packet of the feature flow detected by the traffic reporting component 141 within the preset second time duration, and through statistical analysis of the heartbeat flow packet of the feature flow within the preset second time duration, it can predict whether the quality of the network channel is degraded. The preset second duration may be set to be shorter, for example, 1s, so that the status of the network channel can be quickly predicted, and then the standby network channel can be quickly selected, so as to save the evaluation time of the standby 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 packet of the feature flow detected by the traffic reporting component 141 within the preset third duration, and may determine the service quality of the feature flow in the current network application through statistical analysis of the heartbeat flow packet of the feature flow within the preset third duration. The preset third time period may be as long as the preset first time period, for example, 5s, or may be shorter than the preset first time period, for example, 3s. When it is determined that the quality of service of the feature flow is degraded, a switching notification may be sent to the flow level policy management component 132 to trigger switching of the network channel, for example, the feature flow of the current network application may be switched to the standby network channel.
At step 313, the channel-level path management component 123 receives a backup network channel request requesting the enablement status of each of the selectable network channels.
Specifically, after receiving the standby network channel request sent by the flow level path management component 131, the channel level path management component 123 may send a channel state request to the network probing component 122, where the channel state request may be used to request to obtain an enabled state of each optional network channel. It will be appreciated that the enabled state may include available and unavailable. The available state may be used to characterize that the alternative network channel is enabled, and the unavailable state may be used to characterize that the alternative network channel is disabled. The selectable network channels may include an auxiliary WIFI channel, a main cellular channel, an auxiliary cellular channel, and the like.
In step 314, the network probing component 122 detects the enabled status of each optional network channel and sends the enabled status of each optional network channel to the channel-level path management component 123.
Specifically, when the network probing component 122 receives the channel status request sent by the channel-level path management component 123, the enabled status of each optional network channel may be detected. In a specific implementation, the network probing component 122 may be configured to manage switches of each selectable network channel, where any selectable network channel is in an available state when the selectable network channel is turned on, and the selectable network channel is in an unavailable state when the selectable network channel is turned off. Therefore, when the network probing component 122 detects the enabled status of all the optional network channels requested by the channel-level path management component 123, the enabled status of all the optional network channels may be sent to the channel-level path management component 123.
In step 315, the channel-level path management component 123 requests a channel quality for each available network channel.
Specifically, after the channel-level path management component 123 receives the enabled status of each optional network channel, it may select an available network channel (i.e., an optional network channel in an available status), and may further send a channel evaluation request to the channel and application quality evaluation component 125, where the channel evaluation request may be used to request to evaluate the quality of the available network channel.
In step 316, the channel and application quality assessment component 125 assesses the quality of each available network channel and sends the assessment results to the channel level path management component 123.
Specifically, when the channel and application quality evaluation component 125 receives a channel evaluation request sent by the channel-level path management component 123, the quality of each available network channel may be evaluated according to the channel evaluation request. Illustratively, the channel quality may include a delay, a packet loss rate, a bandwidth and a rate of the channel. The above evaluation may be to evaluate Round-Trip Time (RTT) of available network channels, and the network channel with the smallest Round-Trip Time is the best. Optionally, when there is a history selection record for the available network channel, that is, the available network channel is selected as a network channel once, at this time, the RTT and the history record may be combined to evaluate the channel quality, where the history record may include a history receiving rate, a history number of times that the channel quality is poor, and the like, and the evaluation manner of the channel quality is not particularly limited in the embodiment of the present application. When the channel and application quality evaluation component 125 completes the quality evaluation of all available network channels in the channel evaluation request, the evaluation result may be sent to the channel-level path management component 123.
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.
Specifically, after the channel-level path management component 123 receives the evaluation result, the best available network channel may be selected as the standby network channel based on the evaluation result, and the path of the standby network channel may be sent to the channel-level path management component 123.
In step 318, the flow-level path management component 131 receives and stores the path of the backup network channel sent by the channel-level path management component 123.
Specifically, after the flow-level path management component 131 receives the path of the standby network channel sent by the channel-level path management component 123, the path of the standby network channel may be stored in advance. It will be appreciated that since only the network condition is predicted in step 312, that is, the current network is poor, traffic may be stuck, but the switching condition has not been reached, and at this time, the first device does not switch to the standby network channel, that is, the first device is still using the main network channel.
Illustratively, after the flow-level path management component 131 receives the path of the standby network channel sent by the channel-level path management component 123 at time t1, the path of the standby network channel may be stored in advance. At this point, the first device does not switch to the backup network channel, i.e., the first device is still using the primary network channel. Then, when it is detected at time t2 that the quality of the feature stream of the current network application is degraded and a switching condition has been reached, the first device may switch the feature stream from the main network channel to the standby network channel.
In step 319, the traffic reporting component 141 reports the message to the traffic sensing component 133.
Specifically, the traffic reporting component 141 may continuously detect a message of the current main network channel, and report the detected message to the traffic sensing component 133.
In step 320, the traffic sensing component 133 receives the message reported by the traffic reporting component 141, analyzes the message to obtain a message analysis result, and sends the message analysis result to the stream level policy management component 132.
Specifically, after receiving the message reported by the traffic reporting component 141, the traffic sensing component 133 can identify the feature stream from the message. The above manner for identifying the feature stream may refer to step 311, and is not described herein again. Then, the message in the feature stream may be analyzed, so that a message analysis result may be obtained, where the message analysis result may be used to represent whether the feature stream meets a service requirement, for example, whether a delay requirement is met or a packet loss rate requirement is met. And may send the message analysis results to the flow-level policy management component 132.
It is understood that this step 320 is different from the coarse-grained quality evaluation of the network channel in step 311, that is, the received packets of the feature stream are analyzed in a short period, so that the network quality can be obtained and the handover prediction can be performed. In this step 320, the received packet of the feature stream is analyzed in a longer period, so as to determine whether to perform actual switching, that is, in step 320, fine-grained quality evaluation is performed, so as to implement switching of a network channel for the feature stream, and save time delay.
In the prior art, for a parameter (for example, delay or packet loss rate) used for network quality evaluation, only one threshold is set for the parameter, and an evaluation policy corresponding to the threshold is used to evaluate the network quality. In the method provided by the embodiment of the application, at least 2 thresholds with different values can be set for the parameters, each threshold corresponds to one set of evaluation strategy, and the larger the threshold is, the smaller the time delay of the evaluation strategy is. For example, if a threshold 1 and a threshold 2 are set for the time delay, and the threshold 2 is greater than the threshold 1, the evaluation policy corresponding to the threshold 1 may be: if 3 periods in the continuous 5 periods have time delay larger than the threshold value 1, the message analysis result is of poor quality, otherwise, the message analysis result is of good quality; the evaluation policy corresponding to threshold 2 may be: if the time delay of 1 period is greater than the threshold value 2, the message analysis result is of poor quality, otherwise, the message analysis result is of good quality. Based on the above evaluation strategies, the time delay of the evaluation strategy corresponding to the threshold 1 is 3 cycles, and the time delay of the evaluation strategy corresponding to the threshold 2 is 1 cycle.
For example:
the characteristic flow is a voice flow, the message reported by the flow reporting component is a heartbeat flow message in the voice flow, the quality of the network channel is evaluated through the RTT of the heartbeat flow message, two thresholds, namely a threshold 1 and a threshold 2, are preset for the RTT of the heartbeat flow message, and the evaluation strategy corresponding to the thresholds continues the example.
The traffic sensing component 133 determines whether the RTT of the current period is greater than a threshold 2;
if yes, determining the message analysis result of the voice flow as follows: if the quality is poor, the message analysis result of the voice flow is sent to the flow-level policy management component 132;
if not, the traffic sensing component 133 determines whether the RTT of the window in which the current period is located is greater than the threshold 1 for 3 periods; the window where the current period is located is formed by continuous 5 periods taking the current period as an end period;
if yes, determining the message analysis result of the voice flow as follows: if the quality is poor, the message analysis result of the voice flow is sent to the flow-level policy management component 132; if not, determining the message analysis result of the voice flow as follows: the voice stream packet analysis result is sent to the stream-level policy management component 132.
Alternatively, the traffic awareness component 133 may send the packet analysis result of the voice flow to the flow-level policy management component 132 only when the packet analysis result of the voice flow is of poor quality.
A table of the correspondence between the relative time and the RTT shown in table 1 above can be obtained based on fig. 1 d. Assume that threshold 1 is 150 and threshold 2 is 300; then it is determined that,
in the period of the relative time 4s, the traffic sensing component 133 may determine that the packet analysis result of the voice flow is: if the quality is poor, the packet analysis result of the voice flow is sent to the flow-level policy management component 132, and the subsequent flow-level policy management component 132 may switch the voice flow or multiple flows including the voice flow to the standby network channel.
It should be noted that, in the above description, 2 thresholds are preset for the parameter as an example, and the method may also be extended to preset 3 thresholds or more, and the embodiment of the present application is not limited.
In step 321, the flow-level policy management component 132 determines switching based on the message analysis result, and requests to obtain a path of the standby network channel.
Specifically, after the flow-level policy management component 132 receives the message analysis result reported by the traffic sensing component 133, it may determine whether to perform channel switching according to the message analysis result. In a specific implementation, if a feature stream of a current network application (e.g., a voice stream in a game, a video stream in a WeChat, or a download stream of a Baidu network disk) does not satisfy a requirement (e.g., a delay and/or a packet loss rate), it may be determined that a channel switch is required. At this time, the flow-level policy management component 132 may send a backup network tunnel path obtaining request to the flow-level path management component 131 for obtaining a path of the backup network tunnel, for example, if the backup network tunnel is a primary cell, the path of the backup network tunnel may be, for example, mobile1.
Illustratively, the path requesting the backup network channel may be implemented by:
Figure BDA0003818491250000221
Figure BDA0003818491250000231
in addition, in a specific implementation, a path of the network channel (for example, the path may be characterized by a device number of a network card or a sim card) may be defined in the data structure, and examples of the code are as follows:
Figure BDA0003818491250000232
as shown in the above code, the sk _ bound _ dev _ if is the device number of the switched target network card or target sim card. It is understood that the message may be received through the network card or the sim card, and the code for receiving the message may refer to the following examples:
pktinfo.msg.flow_msg.dev_if=sk->sk_bound_dev_if;
wherein pktinfo is a received message, and msg.
It can be understood that, if it is determined through the message analysis that the feature flow of the current network application meets the requirement, that is, switching is not required, at this time, the first device may delete the path of the standby network channel, so that resources may be released, and power consumption of the first device may be saved. Optionally, the first device may also delete the path of the standby network channel after a preset time period (for example, a preset fourth time period), so that it is ensured that, within the preset fourth time period, if the quality of the feature stream is degraded, the standby network channel can be switched in time, and it is avoided that the switching cannot be performed due to deletion of the path of the standby network channel.
In step 322, flow level path management component 131 sends the path of the backup network tunnel to flow level policy management component 132.
At step 323, flow-level policy management component 132 sends a channel switch indication to policy enforcement component 142.
Specifically, after receiving the path of the standby network channel sent by the flow-level path management component 131, the flow-level policy management component 132 may send a channel switching instruction to the policy execution component 142, where the channel switching instruction may be used to instruct the policy execution component 142 to switch the feature stream from the current main network channel to the standby network channel, so that channel switching may be completed faster, time delay caused by channel switching may be reduced, and user experience may be improved.
At step 324, the policy enforcement component 142 enforces the channel switch.
Specifically, after the policy executing component 142 receives the channel switching indication sent by the flow-level policy managing component 132, the feature stream may be switched from the current main network channel to the standby network channel, that is, other streams of the network application may continue to be carried on the main network channel to run, and the feature stream may be carried on the standby network channel to run, so that switching may be completed quickly, and quality of service and user experience may be further ensured.
Optionally, the network application may be entirely switched to the standby network channel, that is, the main network channel may be deactivated, and all the streams of the network application are carried on the standby network channel.
Fig. 3d is a schematic diagram of the mobile phone using the standby network channel. As shown in fig. 3d, after the mobile phone receives the channel switching instruction, the mobile phone may switch the video stream from the current main network channel to the standby network channel, and may use the standby network channel to watch the video, so as to avoid video jamming.
The channel switching method according to the embodiment of the present application is described in detail below with reference to the system framework diagram of the first device shown in fig. 5 through the timing diagrams of interaction of components in the first device shown in fig. 12 to 14.
Fig. 12 is a timing diagram illustrating interaction among components in a first device according to an embodiment of the present disclosure, where as shown in fig. 12, the method may include:
step 1201: and responding to the operation of the user, and starting the network application.
Step 301 may be referred to for implementation of this step, and details are not described here.
Step 1202: and carrying out streaming transmission between the network application and the server.
The user selects the service in the network application, and the network application transmits the stream required by the service according to the service and the server. Wherein the network application can use a network channel (e.g., a main network channel) to transmit the stream with the server. Taking the network application as a video application, and taking the case that a user selects to play a video, the stream required by the service may include a video stream and an audio stream, and the video stream and the audio stream may be carried on the main network channel.
It should be noted that, in the embodiments of the present application, how to switch the network channels is implemented after the network application starts to use the main network channel to interact with the server, and how to start to interact with the server according to the use of the main network channel after the network application is initially started is not limited in the embodiments of the present application.
Step 1203: the context detection component 121 detects that the network application switches to the foreground, informing the application level policy management component 124.
The implementation of this step may refer to the description in step 302, which is not described herein again.
Step 1204: the application-level policy management component 124 determines whether the network application satisfies the conditions for turning acceleration on.
The implementation of this step may refer to the description in step 303, which is not described herein again.
Further description is made of implementations of the network application whitelist.
In the embodiment of the application, for example, the data of the network application is divided into streams according to types, and one type corresponds to one stream of the network application. As shown in table 3 below, in addition to the network application that needs to start acceleration, the network application white list may also record:
the type of target flow to be monitored in each network application; for example, the type field of the target stream in table 3;
the flow model corresponding to each type of target flow, for example, as shown in the flow model field in table 3 below;
a network quality evaluation parameter for evaluating the network quality of the target flow, for example, as indicated by a channel quality parameter field in table 3 below;
evaluating the network quality difference of the target flow, and then performing channel switching on the flow applied by the network, wherein the strategy is referred to as a flow switching strategy for short; such as shown in the flow switching policy field in table 3 below.
Figure BDA0003818491250000251
TABLE 3
Alternatively, the target flow may be a flow that can be quickly expressed on some or some network quality evaluation parameters when the quality of the network channel carrying the target flow is degraded, for example, one or more characteristic flows of the network application may be used.
Alternatively, the network quality assessment parameter of the target flow may be a parameter that can quickly reflect the deterioration of the network quality of the target flow.
The stream that needs to be switched with the target stream is recorded in the stream switching policy, and optionally, the stream recorded in the stream switching policy is generally a stream that has a large impact on service processing in a network application, for example, the feature stream of the network application in the foregoing description, such as a video stream and an audio stream in a video playing application, a game fighting stream in a game application, a voice stream, and the like.
Optionally, the stream that is recorded in the stream switching policy and needs to switch the network channel together with the target stream may be a stream that is sensitive to the same network evaluation parameter as the target stream, for example, the target stream is a stream that is sensitive to delay (hereinafter referred to as delay-sensitive stream), and then the stream in the stream switching policy is a part or all of the delay-sensitive stream including the target stream in the network application; if the target flow is a flow sensitive to the packet loss rate (hereinafter referred to as a packet loss rate sensitive flow), the flow in the flow switching policy is a part or all of the packet loss rate sensitive flows including the target flow in the network application. Thus, the network quality of the target stream becomes poor, and a type of stream sensitive to the same network evaluation parameter in the network application is switched to the network channel.
Optionally, the flow model corresponding to the target flow type is used to record feature information of a packet that needs to be monitored in the target flow, for example, the feature information may be at least one of the following feature information: the quadruplets, the quintuple, the protocol number, the character string in the payload, etc. of the message.
It should be noted that, in the flow switching policy in the embodiment of the present application, when the quality of a certain flow of a network application is degraded, network channel switching may be performed on multiple flows of the network application including the flow on the same network channel, so as to switch the multiple flows from the current network channel to another network channel with relatively better quality, thereby preventing traffic congestion of the network application. For example, in table 3, if the video stream of the wechat is degraded and the video stream and the voice stream of the wechat are on the same network channel, the network channel switching is performed on both the video stream and the voice stream of the wechat, so that the video stream and the voice stream are switched from the current network channel to a network channel with relatively better quality, and the possibility of the video and voice playing of the wechat causing the stutter problem is reduced.
Step 1205: the application-level policy management component 124 sends an acceleration start message to the flow-level path management component 131.
Specifically, if the application-level policy management component 124 determines that the current network application satisfies the condition for turning on acceleration, acceleration traffic for the network application may be started, and an acceleration start message indicating that the flow-level path management component 131 may start acceleration traffic for the network application is sent to the flow-level path management component 131.
The acceleration service may include, but is not limited to:
when the environment of the electronic equipment or the system environment of the electronic equipment changes, starting a standby network channel to enable the standby network channel to be converted into an awakening state from a dormant state; and/or the presence of a gas in the atmosphere,
the network quality of a plurality of flows in the network application is monitored, when the electronic equipment monitors that the quality of a certain flow of the network application is poor, a plurality of flows of the network application including the flow with poor quality are switched to a standby network channel, so that the plurality of flows of the network application are always borne on the network channel with relatively good quality, the transmission quality of the flows is ensured, the possibility of traffic jam of the network application is reduced, and the user experience is improved. It should be noted that, if the electronic device already activates the standby network channel when deciding to switch the multiple streams to the standby network channel, the multiple streams are switched to the activated standby network channel, and if the electronic device does not activate the standby network channel when deciding to switch the multiple streams to the standby network channel, the electronic device needs to activate one standby network channel first and then switch to the activated standby network channel.
Optionally, the information corresponding to the identity of the current web application in the white list of web applications may be included in the accelerated initiation message, which may include, for example: the method comprises the steps of identification of current network application, a target flow type, a flow model corresponding to the target flow type, network quality evaluation parameter information and flow switching strategy information. Reference may be made to the foregoing description, which is not repeated herein.
Optionally, the flow level path management component 131 may store a path of a currently used network channel, where the path is a path of a used network channel of the network application; alternatively, if the path of the currently used network channel is not stored in the flow level path management component 131, that is, the path of the network channel used by the network application is not stored in the flow level path management component 131, 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.
Step 1206: the flow level path management component 131 sends the identity of the network application and the flow switching policy information to the flow level policy management component 132, sends a flow detection request to the flow sensing component 133, and the flow sensing component 133 sends a flow reporting request to the flow reporting component.
Optionally, the traffic probe request may include a first configuration file for the network application, and the first configuration file may include: the network application comprises an identity identification of the network application, a target flow type, a flow model corresponding to the target flow type, network quality evaluation parameter information and the like.
Optionally, the traffic reporting request may include a second configuration file for the network application, where the second configuration file may include: the identity of the network application, the target flow type and the flow model corresponding to the target flow type.
It should be noted that this step is performed to initialize various relevant information for the current network application to the flow-level policy management component 132, the traffic awareness component 133 and the traffic reporting component 141, and therefore, in other possible implementations, the flow-level path management component 131 may also directly send the second configuration file for the network application to the traffic reporting component 141, which is not limited herein.
Through the processing of the step, the flow reporting component can be triggered to start monitoring the flow in the network application, and further the subsequent network channel switching process aiming at the flow is triggered.
The electronic device enables the standby network channel and the channel switching process of the flow are described below with reference to fig. 13 and 14, respectively.
Fig. 13 is another timing diagram illustrating interaction among components in the first device according to the embodiment of the present application, and as shown in fig. 13, the method may include:
step 1301: the environment detection component 121 performs environment detection.
Specifically, the environment detected by the environment detection component may include a physical environment in which the first device is located, and may also include a system environment in the first device. For example, the physical environment may include: poor network scenes such as elevators, high-speed rails, garages and the like; the system environment may include: the temperature of the equipment, etc.
Taking an elevator scenario as an example for explanation, when a user enters an elevator, the elevator rises or falls, which may cause the gravity of the user to change, for example, the elevator rises to cause overweight, and the elevator falls to cause weightlessness. Thus, detection can be performed by the acceleration sensor in the first device, when the acceleration sensor detects that the user is weightless or overweight, i.e. detects the acceleration of the first device in the vertical direction, whereby it can be determined that the user is in the elevator environment.
In addition, since the elevator stops according to the demands of different users (for example, different users may click different floors) during ascending or descending, the elevator may run continuously or stop in the vertical direction. Since the first device does not detect a movement in the horizontal direction during the lifting of the elevator, which can be detected by the acceleration sensor in the first device, it can still be determined that the first device is in the elevator. For example, if a horizontal acceleration is detected by the acceleration sensor, a horizontal movement can be determined.
When the first device detects an acceleration of the first device in a horizontal direction, i.e. a horizontal movement of the first device, it can be determined that the user has exited the elevator, in other words that the first device has exited the elevator. At this time, it is not necessary to detect the standby network channel in advance, that is, it is not necessary to send a scene change notification message to the application-level policy management component 124, so that power consumption of the electronic device due to detection of the standby network channel can be saved.
Optionally, the electronic device may also determine whether the scene where the user is located changes by detecting the strength of the signal strength of the mobile network. 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, and at this time, the first device can determine that a scenario change has occurred, and can send a scenario change notification message to the application-level policy management component 124 for advanced detection of a backup network path. When the signal strength of the mobile network becomes strong, it may be determined that the user enters a better network environment, and at this time, it may not be necessary to detect the standby network channel in advance, and it is also not necessary to send a scene change notification message to the application-level policy management component 124, so that power consumption of the electronic device due to detection of the standby network channel may be saved.
Step 1302: the environment probing component 121 sends a context change notification message to the application level policy management component 124.
Specifically, if the environment detection component 121 detects that the environment of the first device changes (e.g., the user enters an elevator), an environment change notification message can be sent to the application-level policy management component 124, wherein the environment change notification message is used to notify the application-level policy management component 124 that the environment of the user has changed, thereby triggering the application-level policy management component 124 to perform subsequent processing.
Step 1303: application-level policy management component 124 forwards the environment change notification message to flow-level path management component 131.
Step 1304: the flow level path management component 131 requests a backup network channel from the channel level path management component 123.
Specifically, since signals are generally poor in an elevator, selecting, enabling, and switching a network channel after entering the elevator may cause a large delay of service, resulting in poor user experience. Therefore, when the user is detected to enter the elevator, a standby network channel can be selected in advance, so that the channel switching speed can be increased, and the time delay brought to the service by the channel switching is reduced.
Step 1305: the channel-level path management component 123 receives a backup network channel request requesting the enablement status of each of the optional network channels.
Specifically, after receiving the standby network channel request sent by the flow level path management component 131, the channel level path management component 123 may send a channel state request to the network probing component 122, where the channel state request may be used to request to obtain the enabled state of each optional network channel. It will be appreciated that the enabled state may include available and unavailable. The available state may be used to characterize that the optional network channel is enabled, and the unavailable state may be used to characterize that the optional network channel is disabled. The selectable network channels may include an auxiliary WIFI channel, a main cellular channel, an auxiliary cellular channel, and the like.
Step 1306: the network detecting component 122 detects the enabled status of each optional network channel and sends the enabled status of each optional network channel to the channel-level path managing component 123.
Specifically, when the network probing component 122 receives the channel status request sent by the channel-level path management component 123, the enabled status of each optional network channel may be detected. In a specific implementation, the network probing component 122 may be configured to manage switches of the selectable network channels, where any of the selectable network channels is in an available state after being turned on, and the any of the selectable network channels is in an unavailable state after being turned off. Therefore, when the network probing component 122 detects the enabled statuses of all the optional network channels requested by the channel-level path management component 123, the enabled statuses of all the optional network channels may be sent to the channel-level path management component 123.
Step 1307: the channel-level path management component 123 requests the channel quality of each available network channel.
Specifically, after the channel-level path management component 123 receives the enabled status of each optional network channel, it may select an available network channel (i.e., an optional network channel in an available status), and may further send a channel evaluation request to the channel and application quality evaluation component 125, where the channel evaluation request may be used to request to evaluate the quality of the available network channel.
Step 1308: the channel and application quality evaluation component 125 evaluates the quality of each available network channel and sends the evaluation results to the channel level path management component 123.
Specifically, after the channel and application quality evaluation component 125 receives the channel evaluation request sent by the channel-level path management component 123, the quality of each available network channel may be evaluated according to the channel evaluation request.
For example, the quality of the network channel may be evaluated based on at least one of the following parameters of the network channel: time delay, packet loss rate, bandwidth and rate of the channel, etc. For example, the quality evaluation may be to evaluate Round-Trip Time (RTT) of available network channels, and the network channel with the smallest Round-Trip Time is the best.
Optionally, when there is a history selection record for the available network channel, that is, the available network channel is selected as a network channel once, at this time, the RTT and the history record may be combined to evaluate the channel quality, where the history record may include a history receiving rate, a history number of times that the channel quality is poor, and the like, and the evaluation manner of the channel quality is not particularly limited in the embodiment of the present application.
When the channel and application quality evaluation component 125 completes the quality evaluation of all available network channels in the channel evaluation request, the evaluation result may be sent to the channel-level path management component 123.
Step 1309: the channel-level path management component 123 determines a backup network channel based on the evaluation result.
Specifically, after the channel-level path management component 123 receives the evaluation result, it may select the best available network channel as the standby network channel based on the evaluation result.
Step 1310: the channel-level path management component 123 requests the network connection management component 126 to enable the standby network channel.
Step 1311: the network connection management component 126 initiates the backup network path and feeds back a notification message to the path-level path management component 123 that the backup network path is enabled.
The network connection management component 126 activates the standby network channel in response to the request of the channel-level path management component 123, where activating the standby network channel refers to making the standby network channel transition from a sleep state to an awake state, so that when a network channel needs to be switched subsequently, the standby network channel can be quickly switched from the current network channel to the standby network channel.
It can be understood that, since only a scene change is detected in step 1301, that is, the current scene change may cause network quality to be degraded, and thus cause traffic congestion, but a handover condition is not reached, at this time, the electronic device does not handover to the standby network channel, that is, the electronic device still uses the original network channel.
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.
Thus, the flow-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.
Through the processing, the electronic equipment can start the standby network channel after detecting the environment change, so that the network channel switching can be quickly completed when the network channel switching is determined to be performed subsequently, and the possibility of traffic jam of the network application is reduced.
It should be noted that, in fig. 13, the electronic device starts the standby network channel after detecting the environmental change is taken as an example, in other possible implementations, the traffic sensing component may also start the standby network channel after predicting the network change according to the received message, which may specifically refer to the corresponding description in fig. 7 and is not described herein again.
Fig. 14 is another timing diagram illustrating interaction among components in the first device according to the embodiment of the present application, and as shown in fig. 14, the method may include:
step 1401: the traffic reporting component 141 performs traffic detection and reports the detected message to the traffic sensing component 133.
Specifically, based on the foregoing step 1206, after receiving the traffic reporting request, the traffic reporting component 141 may perform detection on a packet of a target flow of the network application according to the traffic reporting request, and report a detection result to the traffic sensing component 133. The detection result may include: the message of the target flow, or the message of the target flow and the message statistical information of the target flow, etc.
In a specific implementation, the traffic reporting component 141 may obtain, through a calling component (e.g., a Netfilter component of an android system), a message of a target flow of a network application on a current network channel (e.g., a main network channel). It should be understood that the Netfilter component is only an exemplary component, and does not constitute a limitation to the embodiment of the present application, and in some embodiments, the detection of the message may also be completed through other components.
Illustratively, the parameters of the network channel may be implemented by the following codes:
typedef struct{
bool available;
bool slowDevForbbiden;
uint64_t qoeBadTimeStamp;
uint64_t chQoeBadStartTime;
uint32_t rcvRate;
}
it is to be understood that the detected message may be a message of one or more feature flows in the current network application, where the feature flow may be a most sensitive flow in the network application, that is, a flow having a large influence on the current network application. In addition, the quality of the network channel can be evaluated through the parameters of the network channel.
Optionally, when the traffic reporting component 141 performs traffic probing, a hook function may be registered in the kernel netfilter framework to obtain a message of the target flow. As shown in fig. 15, for example, the Netfilter hooks a packet to the nf _ hook function of the traffic reporting component, a message carried on a current network channel enters the traffic reporting component 141, the traffic reporting component stores a message of a target flow into an SKB queue through flows such as message parsing, flow table creation, message content analysis, and the like, for a message in the SKB queue, according to a reporting policy of the target flow to which the message belongs, data (the message or the message and statistical information) that needs to be reported at a fixed time is triggered and reported to the traffic sensing component 133 by a timer, and a message that needs to be reported immediately is reported to the traffic sensing component 133 by a NetLink thread.
It should be noted that the target flow may be one or more; when the traffic reporting component detects a message of a target flow, all or part of the message of the target flow may be reported to the traffic sensing component, which is not limited in the embodiment of the present application.
Taking the detection and reporting of the heartbeat flow message in the target flow as an example, a specific implementation flow of the message reporting component is described with reference to fig. 15.
The heartbeat flow message referred to herein may be a message appearing in the target flow at certain time intervals, and the fixed position of the payload of the heartbeat flow message has preset characteristic information. Alternatively, the quintuple of the heartbeat flow packet may be the same or different from the quintuple of the other packets in the same flow. The time interval of the heartbeat flow packet in the embodiment of the present application is not limited in the embodiment of the present application, and is, for example, 1s. Referring to fig. 1a, a schematic diagram of a heartbeat flow message with an interval of 1s is shown. Correspondingly, the subsequent traffic sensing component 133 may calculate a round trip delay according to the heartbeat flow packet, and determine the network quality of the target flow by using the round trip delay as a network quality evaluation parameter of the target flow. For example, as shown in fig. 1b, a method for calculating RTT of a heartbeat flow packet may refer to the foregoing related description, which is not described herein again.
For example, the heartbeat flow packet provided in the embodiment of the present application may have the following characteristics:
(ip.src = =100.100.3.90& & udp.src = =60539& & ip.dst = =58.217.244.144& & udp.dstport = = 10126) & (data [6] = = 64). Where data [6] represents the 6 th byte of the payload of the message.
Referring to fig. 15, a specific implementation flow of the message reporting component includes:
step S1, initializing;
when the network application starts to load, the traffic reporting component 141 receives the app launch message, and registers the nf _ hook function. Code examples are shown in fig. 16 and 17.
S2, processing the message;
the method specifically comprises three steps of message analysis, flow table lookup and message analysis. The flow table records identification information of flows in each network application and statistical information of each flow, and the statistical information of each flow may include: the number of received messages of the flow, the total number of bytes of the received messages of the flow, the number of error packets and the like. The flow identification information may be calculated according to a quintuple or a quadruple of a packet in the flow, and the calculation may specifically use a hash algorithm, so that the flow identification information may be a hash value calculated by the quintuple or the quadruple of the packet.
When the message is analyzed, the traffic reporting component 141 obtains the message, and can analyze whether the UID of the network application exists in the message; if the message exists, the message is the message of the network application, the quadruple (or the quintuple) of the message is analyzed, and the subsequent flow table checking step is executed; if the message does not exist, the message is not the message of the network application, and the process is ended;
the quadruple may include: source IP, destination IP, source port, destination port; the quintuple may include: source IP, destination IP, source port, destination port, and protocol number.
When the flow table is searched, the identification information of the flow can be calculated according to the quadruplet (or quintuple) of the message, whether the identification information is recorded in the flow table is searched by using the calculated identification information, and 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 according to the identification information of the flow, and the statistical information of the flow in the flow node is updated.
During message analysis, the traffic reporting component 141 may filter the received message through a preset flow model, so as to obtain all or a part of the message of the target flow, for example, if the flow model of the heartbeat flow message is used, the heartbeat flow message of the target flow may be obtained.
The flow model may be configured to the traffic reporting component through a configuration file, and the configuration file may be carried in the traffic reporting request sent by the traffic sensing component in step 1206. The flow model records the characteristics of the messages to be matched. For example, as shown in fig. 18, the heartbeat stream message may have fixed feature information in the 6 th byte of the message payload, for example, if the feature information in the uplink heartbeat stream message is 0x64, and the feature information in the downlink heartbeat stream message is 0x65, then the matching feature filterStr may be preset in the stream model, the matching feature is 0x64 in the uplink stream, the matching feature is 0x65 in the downlink stream, and the matching position is offset by 6 bytes from the UDP payload.
As shown in fig. 19, the code logic may compare whether the message content is consistent with the configured matching feature filterStr through memcmp. The specific codes are as follows: if (memcmp (rpt _ cfg- > filter _ str [ i ], payload + filter _ str _ offset, rpt _ cfg- > filter _ str _ len [ i ]) = = 0), the memcmp compares to obtain a message consistent with the matching characteristic filter str, so as to filter out the message of the target stream, that is, the target stream.
And S3, reporting the matched target flow and the statistical information of the target flow according to the flow reporting strategy.
Specifically, the filtered message of the target flow may be stored in the SKB queue, and may be periodically reported or reported immediately according to a reporting policy of the target flow.
If the reporting is performed periodically, part or all of the messages received by the target flow in the period (for example, the last message of the target flow received in the period) may be reported to the traffic sensing component at the end of each period, and optionally, the statistical information (for example, the number of messages, the number of bytes, and the like) of the messages of the target flow in the period may also be reported to the traffic sensing component.
If the report is reported immediately, the matched message can be directly reported to the flow sensing component.
Through the processing, the message of the target flow can be accurately matched and filtered in the flow reporting component, and the reported message is used for network quality evaluation in the flow sensing component.
Step 1402: the traffic sensing component 133 analyzes the message reported by the traffic reporting component 141 to obtain a message analysis result.
In this step, the traffic sensing component 133 may perform network quality evaluation at a flow level. The network quality evaluation parameters used for the network quality evaluation of each target flow may refer to the example in table 3. The network quality assessment parameters for each target flow may be sent down to the traffic awareness component 133 in step 1206.
In this step, the obtained message analysis result may be a stream-level analysis result, for example, whether the quality of the target stream is good or bad.
In this step, the network quality evaluation method for the stream provided in the foregoing embodiment may be used to perform network quality evaluation on the target stream, so as to obtain a network quality evaluation result of the target stream, where the message analysis result may include: the above network quality evaluation result of the target flow, optionally, the above network quality evaluation result of the target flow may be used to describe whether the quality of the target flow is good or not good.
Step 1403: the traffic awareness component 133 sends the message analysis result to the flow level path management component 131.
Specifically, the message analysis result may include: identification information of the target flow and a network quality evaluation result of the target flow.
As shown in fig. 20, taking the network application as a game application as an example, a possible code implementation is shown in which the target flow and the network quality evaluation result of the target flow are sent to the flow-level path management component 131 for multi-flow path scheduling switching.
Step 1404: the flow level path management component 131 determines to perform channel switching according to the message analysis result, determines whether a standby network channel exists, if so, performs step 1414, and if not, performs step 1405.
The implementation of steps 1405 to 1413 can refer to steps 1304 to 1312, which are not described herein.
Step 1414: the flow-level path management component 131 sends the identification information of the poor-quality target flow and the path of the standby network channel to the flow-level policy management component 132.
Specifically, when determining that a certain target flow has a poor quality according to a message analysis result of each target flow, the flow-level path management component 131 sends identification information of the target flow having the poor quality and a path of the standby network channel to the flow-level policy management component 132.
Step 1415: the flow level policy management component 132 sends a channel switch indication to the policy enforcement component 142.
Specifically, after the flow-level policy management component 132 receives the identification information of the target stream with poor quality and the path of the standby network channel, which are sent by the flow-level path management component 131, it may determine a flow switching policy corresponding to the target stream with poor quality, determine a to-be-switched flow of the network application from a flow carried on the same network channel as the target stream with poor quality according to the flow switching policy, and send a channel switching instruction to the policy execution component 142, where the channel switching instruction may be used to instruct the policy execution component 142 to switch the to-be-switched flow from the current network channel (e.g., the main network channel) to the standby network channel (e.g., the data network channel), so that channel switching may be completed faster, latency caused by channel switching is reduced, and user experience is improved.
For example, referring to fig. 11a, a stream B, and a stream C of the network application are all carried on the WIFI1 channel, where the stream a is a target stream, and a stream switching policy corresponding to the stream a is as follows: stream A and stream B; then, if the network quality of the flow a is poor, it may be determined that the flow a and the flow B of the network application are to be switched according to the flow switching policy corresponding to the flow a, so as to refer to fig. 11B, the flow-level policy management component 132 may instruct the policy execution component 142 to switch the flow a and the flow B to the standby network channel, that is, the Mobile1 channel in fig. 11B, through the channel switching indication. Continuing with this example, assume that the flow switching policy for flow a is: stream a, stream B and stream C; then, if the network quality of the flow a is poor, it may be determined that the flow a, the flow B, and the flow C of the network application are flows to be switched according to the flow switching policy corresponding to the flow a, so that, referring to fig. 11C, the flow-level policy management component 132 may instruct the policy execution component 142 to switch the flow a, the flow B, and the flow C to the standby network channel, that is, the Mobile1 channel in fig. 11C, through a channel switching indication.
As shown in fig. 21, the stream level policy management component 132 is shown to obtain possible code implementations of streams to be switched in a network application by traversing all stream types on a service, taking the network application as an example of a gaming application.
In step 1416, the policy execution component 142 performs channel switching.
Specifically, after the policy executing component 142 receives the channel switching indication sent by the stream-level policy managing component 132, the multiple streams to be switched of the network application may be switched from the current network channel to the standby network channel, that is, the other streams of the network application may continue to be carried on the current network channel to run, and the multiple streams to be switched may be carried on the standby network channel to run, so that switching may be completed quickly, and quality of service and user experience may be further ensured.
In the channel switching methods shown in fig. 12 to 14, the channel switching schedule at the stream level is expanded, and the schedule of a single stream is expanded to the schedule of multiple streams; in some embodiments, a network quality evaluation result of one flow of the network application can be quickly perceived, and the evaluation result is applied to a class of flows (e.g., a delay-sensitive flow) of the network application, so that the possibility that the class of flows causes traffic to run unsmooth is reduced, and the user experience is improved.
By way of example:
the method comprises the steps that 1 s-period heartbeat flow messages exist in a peace-elite voice flow, the voice flow can be used as a target flow of the game application, a flow reporting component can detect the heartbeat flow messages of the voice flow, a flow sensing component can calculate the network round-trip delay of the voice flow according to the heartbeat flow messages of the voice flow so as to evaluate the network quality of the voice flow, and after the network quality is poor, the evaluation result can be applied to all delay sensitive flows (such as a fight flow and a voice flow) of the whole game, and all delay sensitive flows of the game switch network channels together.
By using the channel switching method of the embodiment of the application, the network quality evaluation of each flow is performed without accurately acquiring the message of each flow in the network application, the flows needing to be monitored and evaluated by the electronic equipment can be reduced, and the data processing capacity of the electronic equipment is reduced; moreover, when the quality of the network channel becomes poor, channel switching can be performed on multiple flows (for example, a class of flows) in time, and the possibility that the service operation is blocked due to the network quality deterioration of the multiple flows is reduced, so that the occurrence rate of the service operation is reduced, and the user experience is improved.
In addition, in the channel switching method according to the embodiment of the present application, when analyzing a message (e.g., a heartbeat flow message) of a certain flow (e.g., a voice flow), a traffic sensing component may set one or more preset conditions for a preset parameter (e.g., RTT) of the message, where each preset condition includes a network quality evaluation policy, and network quality evaluation delays of different preset conditions are different, so that the network quality evaluation delay is relatively long under the condition that the quality of a network channel is relatively good, and the network quality evaluation delay is relatively short under the condition that the quality of the network channel is relatively poor, so that different network quality evaluation delays may be correspondingly provided under actual network qualities of different network channels, thereby meeting a requirement of an electronic device for switching speed of a network channel under different network qualities of the network channels, improving switching speed of the network channel, further reducing possibility of a card occurring during service operation, and improving user experience.
An electronic device is further provided in an embodiment of the present application, where the device includes a storage medium and a central processing unit, the storage medium may be a non-volatile storage medium, a computer executable program is stored in the storage medium, and the central processing unit is connected to the non-volatile storage medium and executes the computer executable program to implement the method provided in any one of fig. 7 to 15 of the present application.
An embodiment of the present application further provides an electronic device, including: one or more processors; a memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory, the one or more computer programs comprising instructions which, when executed by the apparatus, cause the apparatus to perform the method provided by any of the embodiments of fig. 7-15.
Embodiments of the present application further provide a computer-readable storage medium, in which a computer program is stored, and when the computer program runs on a computer, the computer is caused to execute the method provided in any one of fig. 7 to 15 of the present application.
Embodiments of the present application further provide a computer program product, which includes a computer program, when the computer program runs on a computer, causing the computer to execute the method provided in any one of fig. 7 to fig. 15 of the present application.
It is to be understood that the electronic devices and the like described above include hardware structures and/or software modules for performing the respective functions in order to realize the functions described above. Those of skill in the art will readily appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as hardware or combinations of hardware and computer software. Whether a function is performed in hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the embodiments of the present application.
In the embodiment of the present application, the electronic device and the like may be divided into functional modules according to the method example, for example, each functional module may be divided according to each function, or two or more functions may be integrated into one processing module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. It should be noted that, in the embodiment of the present application, the division of the module is schematic, and is only one logic function division, and there may be another division manner in actual implementation.
Through the above description of the embodiments, it is clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the above described functions. For the specific working processes of the system, the apparatus and the unit described above, reference may be made to the corresponding processes in the foregoing method embodiments, and details are not described here again.
Each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application, in essence or part of the technical solutions contributing to the prior art, or all or part of the technical solutions, may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: flash memory, removable hard drive, read only memory, random access memory, magnetic or optical disk, and the like.
The above description is only an embodiment of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions within the technical scope disclosed in the present application should be covered within the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (15)

1. A channel switching method is applied to electronic equipment, the electronic equipment comprises a first network channel, and the method comprises the following steps:
starting a first application, wherein the first application comprises a first data stream, the first data stream is carried on the first network channel, and the first data stream comprises a message;
creating a second network channel, wherein the first data flow is continuously carried on the first network channel;
calculating a preset parameter of a message of the first data stream according to the preset period;
switching the first data stream to the second network channel under the condition that the preset parameter meets a preset condition;
and under the condition that the preset parameters do not meet preset conditions, continuously bearing the first data flow on the first network channel, and destroying the second network channel.
2. The method of claim 1, wherein the creating the second network channel comprises:
when environmental change is detected or quality deterioration of the first network channel is predicted, network channels in an available state except the first network channel in the electronic equipment are obtained;
respectively carrying out quality evaluation on the network channels in the available state;
and selecting the network channel with the best quality as the second network channel according to the evaluation result of the quality evaluation.
3. The method of claim 2, wherein obtaining the network channel available in the electronic device except the first network channel when the environmental change is detected or the quality of the first network channel is predicted to be degraded comprises:
and when detecting that the preset parameter exceeds a first threshold value, acquiring network channels, except the first network channel, in the electronic equipment, which are in an available state.
4. The method according to claim 1, wherein the preset condition comprises:
the preset parameters of m2 periods in m1 continuous periods in the preset time exceed the first threshold; or
The preset parameters of m4 periods in m3 continuous periods in the preset time exceed the second threshold; wherein the first threshold is smaller than the second threshold, m2 is not less than m1, m4 is not less than m3, m1 is not less than m3, and m2 is greater than m4.
5. The method of claim 1, wherein the first application comprises a second data stream, and wherein the second data stream is carried on the first network channel, the method further comprising:
and switching the second data stream to the second network channel under the condition that the preset parameter meets a preset condition.
6. The method according to claim 1, wherein said calculating the preset parameters of the packets of the first data flow according to the preset period comprises:
acquiring a message of the first data stream loaded on the first network channel;
and calculating the preset parameters of the messages of the first data flow according to a preset period.
7. The method of claim 6, wherein the obtaining the packet of the first data flow carried on the first network channel comprises:
acquiring a message of the first application loaded on the first network channel;
and acquiring the message of the first data flow from the message of the first application.
8. The method according to claim 7, wherein the obtaining the packets of the first data flow from the packets of the first application comprises:
and acquiring the heartbeat flow message of the first data flow from the message of the first application.
9. The method of claim 4, wherein prior to creating the second network tunnel, the method further comprises:
and directly switching the first data stream to the second network channel when the preset parameter is detected to exceed a second threshold value.
10. The method of claim 9, wherein the directly switching the first data stream to the second network channel comprises:
determining that no enabled standby network channel exists, and acquiring the network channels which are in an available state except the first network channel;
respectively carrying out quality evaluation on the network channels in the available state;
selecting the network channel with the best quality as the second network channel according to 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.
11. The method according to claim 1, wherein before calculating the preset parameter of the packet of the first data flow according to the preset period, the method further comprises:
determining that the first application is an application in a preset white list.
12. The method of claim 1, wherein the first network channel is a WIFI channel or a cellular channel, and wherein the second network channel is a WIFI channel or a cellular channel.
13. The method of claim 1, wherein the first application is a gaming application or a video playback application, and wherein the first data stream is a voice stream.
14. An electronic device, comprising: a memory for storing computer program code, the computer program code comprising instructions that, when read from the memory by the electronic device, cause the electronic device to perform the method of any of claims 1-13.
15. A computer readable storage medium comprising computer instructions which, when run on the electronic device, cause the electronic device to perform the method of any of claims 1-13.
CN202211034773.2A 2021-06-16 2021-09-27 Channel switching method, electronic device and storage medium Pending CN115484649A (en)

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
CN2021106664684 2021-06-16
CN202110666468 2021-06-16
CN202111137131.0A CN114286402B (en) 2021-06-16 2021-09-27 Channel switching method, electronic device and storage medium

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
CN202111137131.0A Division CN114286402B (en) 2021-06-16 2021-09-27 Channel switching method, electronic device and storage medium

Publications (1)

Publication Number Publication Date
CN115484649A true CN115484649A (en) 2022-12-16

Family

ID=80868620

Family Applications (3)

Application Number Title Priority Date Filing Date
CN202211034773.2A Pending CN115484649A (en) 2021-06-16 2021-09-27 Channel switching method, electronic device and storage medium
CN202211033271.8A Active CN115484648B (en) 2021-06-16 2021-09-27 Channel switching method, electronic device and storage medium
CN202111137131.0A Active CN114286402B (en) 2021-06-16 2021-09-27 Channel switching method, electronic device and storage medium

Family Applications After (2)

Application Number Title Priority Date Filing Date
CN202211033271.8A Active CN115484648B (en) 2021-06-16 2021-09-27 Channel switching method, electronic device and storage medium
CN202111137131.0A Active CN114286402B (en) 2021-06-16 2021-09-27 Channel switching method, electronic device and storage medium

Country Status (1)

Country Link
CN (3) CN115484649A (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113795040B (en) * 2021-06-16 2022-10-18 荣耀终端有限公司 Channel switching method, electronic device and storage medium
CN116137722A (en) * 2021-11-18 2023-05-19 荣耀终端有限公司 Network acceleration method, electronic device, chip system and readable storage medium
WO2024060120A1 (en) * 2022-09-22 2024-03-28 Citrix Systems, Inc. Adaptive network path selection for virtual meeting optimization
CN116744328B (en) * 2022-10-17 2024-04-23 荣耀终端有限公司 Network acceleration method and device

Family Cites Families (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120311173A1 (en) * 2011-05-31 2012-12-06 Broadcom Corporation Dynamic Wireless Channel Selection And Protocol Control For Streaming Media
US9014147B1 (en) * 2014-05-27 2015-04-21 Bandwidth.Com, Inc. Techniques for establishing a communication handoff threshold using user feedback
CN105101316B (en) * 2015-07-10 2020-02-11 山东聚盛联创信息科技有限公司 Data transmission method and device for multiple data channels
CN105162719B (en) * 2015-09-24 2018-11-13 烽火通信科技股份有限公司 The packet loss detection system and method for Packet Transport Network
CN110995773B (en) * 2016-05-24 2021-01-05 华为技术有限公司 QoS control method and device
US20180176841A1 (en) * 2016-12-20 2018-06-21 Microsoft Technology Licensing, Llc Switching between network media based on connection quality
CN109428816A (en) * 2017-08-28 2019-03-05 中国电信股份有限公司 Link protection method, device and storage medium
WO2019153337A1 (en) * 2018-02-12 2019-08-15 深圳前海达闼云端智能科技有限公司 Network quality evaluation method and apparatus, network detection device, and readable storage medium
WO2020014880A1 (en) * 2018-07-17 2020-01-23 华为技术有限公司 Multi-screen interaction method and device
CN110798869B (en) * 2018-08-02 2022-08-09 华为技术有限公司 Network switching method, electronic equipment and chip subsystem
CN109194561A (en) * 2018-08-29 2019-01-11 杭州迪普科技股份有限公司 Select the method, apparatus and storage medium of link
CN109151954A (en) * 2018-10-16 2019-01-04 奇酷互联网络科技(深圳)有限公司 Mobile terminal and its double card method for switching network and storage medium
CN109831328A (en) * 2019-01-30 2019-05-31 杭州迪普科技股份有限公司 Switching method, device, the electronic equipment of intelligent route selection
CN112243218B (en) * 2019-07-19 2022-04-05 华为技术有限公司 Data service transmission method and electronic equipment
CN110944369B (en) * 2019-09-18 2021-02-23 华为技术有限公司 Network switching method, terminal equipment, chip and readable storage medium
CN110913162A (en) * 2019-10-28 2020-03-24 视联动力信息技术股份有限公司 Audio and video stream data processing method and system

Also Published As

Publication number Publication date
CN115484648A (en) 2022-12-16
CN114286402B (en) 2022-11-22
CN114286402A (en) 2022-04-05
CN115484648B (en) 2023-07-21

Similar Documents

Publication Publication Date Title
CN113795040B (en) Channel switching method, electronic device and storage medium
CN114286402B (en) Channel switching method, electronic device and storage medium
CN114172791B (en) Channel switching method, electronic device and storage medium
CN113810938B (en) Channel switching method, electronic device and storage medium
WO2021115007A1 (en) Network switching method and electronic device
CN113890905B (en) Channel switching method, electronic device and storage medium
CN113316199A (en) Connection management method and related equipment
WO2022042264A1 (en) Method, apparatus and system for switching access point
CN113810965B (en) Channel switching method, electronic device and storage medium
WO2020124447A1 (en) Multi-sim facing network management
WO2022016450A1 (en) Logic channel multiplexing method and apparatus, communication device, and storage medium
RU2802678C1 (en) Channel switching method, electronic device and storage medium
CN115002797B (en) Network quality detection method and related electronic equipment
WO2024082811A1 (en) Network acceleration method and apparatus
RU2811567C1 (en) Channel switching method, electronic device and data media
CN116155729A (en) Network acceleration method based on user traffic portrayal and related electronic equipment
CN116661984B (en) Load control method, electronic equipment and storage medium
WO2024001773A1 (en) Data migration method, electronic device and networking system
CN116744329A (en) Network acceleration method and electronic equipment
CN116709367A (en) Network acceleration method and device
CN117915356A (en) Network acceleration method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination