WO2022262399A1 - 通道切换方法、电子设备及存储介质 - Google Patents

通道切换方法、电子设备及存储介质 Download PDF

Info

Publication number
WO2022262399A1
WO2022262399A1 PCT/CN2022/086641 CN2022086641W WO2022262399A1 WO 2022262399 A1 WO2022262399 A1 WO 2022262399A1 CN 2022086641 W CN2022086641 W CN 2022086641W WO 2022262399 A1 WO2022262399 A1 WO 2022262399A1
Authority
WO
WIPO (PCT)
Prior art keywords
channel
network
network channel
flow
application
Prior art date
Application number
PCT/CN2022/086641
Other languages
English (en)
French (fr)
Inventor
吴东昂
Original Assignee
荣耀终端有限公司
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 荣耀终端有限公司 filed Critical 荣耀终端有限公司
Priority to EP22823886.1A priority Critical patent/EP4216501A4/en
Priority to US18/034,998 priority patent/US20240022518A1/en
Publication of WO2022262399A1 publication Critical patent/WO2022262399A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/24Traffic characterised by specific attributes, e.g. priority or QoS
    • H04L47/2475Traffic characterised by specific attributes, e.g. priority or QoS for supporting traffic characterised by the type of applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/22Arrangements for detecting or preventing errors in the information received using redundant apparatus to increase reliability
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72448User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions
    • H04M1/72454User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions according to context-related or environment-related conditions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/20Arrangements for detecting or preventing errors in the information received using signal quality detector
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • H04M1/72406User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality by software upgrading or downloading
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W28/00Network traffic management; Network resource management
    • H04W28/02Traffic management, e.g. flow control or congestion control
    • H04W28/0231Traffic management, e.g. flow control or congestion control based on communication conditions
    • H04W28/0236Traffic management, e.g. flow control or congestion control based on communication conditions radio quality, e.g. interference, losses or delay
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W36/00Hand-off or reselection arrangements
    • H04W36/0005Control or signalling for completing the hand-off
    • H04W36/0083Determination of parameters used for hand-off, e.g. generation or modification of neighbour cell lists
    • H04W36/0085Hand-off measurements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W36/00Hand-off or reselection arrangements
    • H04W36/14Reselecting a network or an air interface
    • H04W36/144Reselecting a network or an air interface over a different radio air interface technology
    • H04W36/1446Reselecting a network or an air interface over a different radio air interface technology wherein at least one of the networks is unlicensed
    • 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
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W84/00Network topologies
    • H04W84/02Hierarchically pre-organised networks, e.g. paging networks, cellular networks, WLAN [Wireless Local Area Network] or WLL [Wireless Local Loop]
    • H04W84/10Small scale networks; Flat hierarchical networks
    • H04W84/12WLAN [Wireless Local Area Networks]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Definitions

  • the present application relates to the technical field of communications, and in particular to a channel switching method, electronic equipment and storage media.
  • mobile devices such as mobile phones are more and more widely used in people's daily life.
  • mobile payment and games can be performed through mobile phones.
  • common services such as games, calls, social software, etc.
  • the user's mobile phone will be connected to the wireless network.
  • the flow of the application is switched between different network channels. If the switching speed of the network channel is slow, the switching process will cause business interruption and reduce user experience.
  • the present application provides a channel switching method, an electronic device and a storage medium, which can reduce the jam problem of service operation caused by network channel switching and improve user experience.
  • an embodiment of the present application provides a channel switching method, which is applied to an electronic device, and the electronic device includes a first network channel and a second network channel, and the use priority of the second network channel is higher than that of the first network channel.
  • the first data stream is kept carried on the first network channel No change, instead of switching the first data stream to the second network channel with higher priority, thereby reducing the network channel switching of the first data stream, thereby reducing the possible business operation caused by the network channel switching of the first data stream To solve the lagging problem and improve the user experience.
  • the method further includes: when it is detected that the second network channel is enabled and the first data flow is not a preset type of data flow, carrying the first data flow switch the network channel to the second network channel.
  • before the keeping the first data stream carried on the first network channel unchanged further includes: determining that the network quality of the first network channel meets the requirements of the first data flow streaming needs.
  • the first data stream is kept unchanged on the first network channel, and the second A data flow is switched to a second network channel with a higher priority, thereby reducing the network channel switching of the first data flow while ensuring that the first data flow does not switch the network channel and will not affect the business operation, thereby reducing the network channel switching caused by the second data flow.
  • a data flow network channel switch may cause the problem of business running stalls, improving user experience.
  • the method further includes: determining that the network quality of the enabled first network channel does not meet the transmission requirements of the first data flow, and switching the network channel carrying the first data flow to The second network channel. In this method, it is determined that the network quality of the enabled first network channel does not meet the transmission requirements of the first data stream, and the network channel carrying the first data stream is switched to the second network channel, thereby Reduce the problem of service running stalls caused by the deterioration of the network channel quality of the first data stream, and improve user experience.
  • the network channel carrying the first data stream to the second network channel before switching the network channel carrying the first data stream to the second network channel, it further includes: determining that the network quality of the enabled second network channel satisfies the first A data flow transmission requirement.
  • the first data volume is switched to The second network channel is used to switch the network channel while ensuring the network quality after the first data stream is switched, thereby improving user experience.
  • the method further includes: determining that the network quality of the enabled second network channel does not meet the transmission requirements of the first data flow, and keeping the first data flow carried on the first Unchanged on network channels.
  • it is determined that the network quality of the enabled second network channel does not meet the transmission requirements of the first data stream, and the first data stream is kept unchanged on the first network channel, thereby ensuring
  • the network quality of the first data stream that is not a preset type prevents the network quality from deteriorating after the first data stream is switched to the second network channel, thereby improving user experience.
  • whether the first data stream is a preset type of data stream is detected according to at least one of the following parameters: protocol type, port number, message transmission characteristics, and a specific character string in the message;
  • the packet transmission characteristics include at least one of the following characteristics: packet size, number of packets within a preset time period, and packet transmission speed.
  • the preset type is a delay-sensitive flow
  • a data flow whose type is the delay-sensitive flow is sensitive to delay
  • the method further includes: obtaining the message of the first application from the message carried by the first network channel; and obtaining the message of the first data flow from the message of the first application.
  • the method before detecting that the second network channel is enabled, the method further includes: determining that the first application is an application in a preset whitelist.
  • the first network channel is a cellular channel
  • the second network channel is a WIFI channel
  • the first network channel is an auxiliary WIFI channel
  • the second network channel is a primary WIFI channel
  • an electronic device including:
  • the memory is used to store computer program codes
  • the computer program codes include instructions
  • the electronic device has multiple network channels
  • the electronic device runs a first application
  • the first application is carried on the first network channel
  • the first An application includes multiple message streams, when the electronic device reads the instruction from the memory, so that the electronic device executes the method described in any one of the first aspect.
  • an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored, and when it is run on a computer, the computer is made to execute the method described in any one of the first aspect .
  • an embodiment of the present application provides a computer program, which is used to execute the method described in any one of the first aspect when the above computer program is executed by a computer.
  • all or part of the program in the fourth aspect may be stored on a storage medium packaged with the processor, or part or all may be stored on a memory not packaged with the processor.
  • FIG. 1a is a schematic diagram of a mobile phone desktop display provided by an embodiment of the present application.
  • Figure 1b is a schematic diagram of the application interface provided by the embodiment of the present application.
  • Figure 1c is a schematic diagram of the application interface of the mobile phone using the main network channel provided by the embodiment of the present application;
  • Figure 1d is a schematic diagram of the application interface of the mobile phone using the backup network channel provided by the embodiment of the present application;
  • Figure 1e is a schematic diagram of the application interface of the mobile phone that enables the WIFI channel but still uses the cellular channel provided by the embodiment of the present application;
  • FIG. 1 Figure 2 and Figure 3 are schematic diagrams of the game interface
  • FIG. 4 is a schematic diagram of a hardware structure of an electronic device provided in an embodiment of the present application.
  • FIG. 5 is a schematic diagram of the software architecture of the electronic device provided by the embodiment of the present application.
  • FIG. 6 is a schematic diagram of another software architecture of the electronic device provided by the embodiment of the present application.
  • FIG. 7 is a schematic flowchart of an embodiment of a channel switching method provided by the present application.
  • FIG. 8 is a schematic structural diagram of a heartbeat flow message provided by an embodiment of the present application.
  • FIG. 9 is a schematic diagram of the statistics of battle flow messages provided by the embodiment of the present application.
  • FIG. 10 is a schematic diagram of the structure of the battle flow message provided by the embodiment of the present application.
  • Figure 11a- Figure 11c are schematic diagrams of stream switching provided by the embodiment of the present application.
  • Fig. 11d is an interactive schematic diagram of the switching process of sensitive services provided by the embodiment of the present application.
  • Fig. 11e is an interactive schematic diagram of the non-sensitive service switching process provided by the embodiment of the present application.
  • FIG. 12 is a sequence diagram of interaction between electronic device components according to an embodiment of the present application.
  • FIG. 13 is another sequence diagram of interaction between electronic device components according to the embodiment of the present application.
  • FIG. 14 is a schematic diagram of the implementation principle of the traffic reporting component of the embodiment of the present application.
  • Fig. 15 is a schematic diagram of a heartbeat flow message whose interval is 1s according to an embodiment of the present application.
  • Fig. 16 is a schematic diagram of a round-trip delay calculation method of a heartbeat flow message
  • Fig. 17a is a schematic diagram of the code implementation of the registration hook function of the embodiment of the present application.
  • Figure 17b is a schematic diagram of code implementation of the registration hook function of the embodiment of the present application.
  • Fig. 18 is a schematic diagram of the code implementation of the matching feature in the embodiment of the present application.
  • FIG. 19 is a schematic diagram of code implementation for message filtering in the embodiment of the present application.
  • FIG. 20 is a schematic diagram of code implementation of a delay-sensitive flow detection method according to an embodiment of the present application.
  • Fig. 21 is a schematic diagram of the code implementation of the game battle flow in the embodiment of the present application.
  • first and second are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance or implicitly specifying the quantity of indicated technical features. Thus, a feature defined as “first” and “second” may explicitly or implicitly include one or more of these features. In the description of the embodiments of the present application, unless otherwise specified, "plurality” means two or more.
  • a WIFI network card is a device that supports Internet access through a wireless local area network (Wireless Local Area Network, WLAN).
  • WLAN Wireless Local Area Network
  • the data service network card supports general packet radio service (General packet radio service, GPRS), enhanced data rate GSM evolution technology (Enhanced Data Rate for GSM Evolution, EDGE), time division synchronous code division multiple access (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), 5th Generation Mobile Communication Technology (5th Generation Mobile Communication Technology, 5G) and other mobile communication technology Internet access devices.
  • General packet radio service General packet radio service, GPRS
  • enhanced data rate GSM evolution technology Enhanced Data Rate for GSM Evolution, EDGE
  • time division synchronous code division multiple access Time Division-Synchronous Code Division Multiple Access, TD-SCDMA
  • High Speed Downlink Packet Access HSDPA
  • WCDMA Wideband Code Division Multiple Access
  • LTE Long Term Evolution
  • 5G 5th Generation Mobile Communication Technology
  • a network channel refers to any route between two or more nodes in the network, or a route from a source address to a destination address in the network.
  • the network channel of the electronic device in the embodiment of the present application refers to the route established between the above-mentioned WIFI network card or data service network card and other devices connected to the Internet and other electronic devices such as servers.
  • the network channel established by using the WIFI network card is called the WIFI channel
  • the network channel established by using the data service network card is called the cellular channel.
  • the multiple network channels can include a main WIFI channel, an auxiliary WIFI channel, a main cellular channel, and an auxiliary cellular channel, wherein the above-mentioned main WIFI channel and auxiliary WIFI channel can work In the 2.4GHz frequency band or the 5GHz frequency band, for example, if the main WIFI channel works in the 2.4GHz frequency band, the auxiliary WIFI channel works in the 5GHz frequency band; if the main WIFI channel works in the 5GHz frequency band, then the auxiliary WIFI channel works in the 2.4GHz frequency band.
  • the main cellular channel and the auxiliary cellular channel can correspond to the operator's network.
  • the main cellular channel can use sim card 1 (the sim card 1 belongs to operator A), and the auxiliary cellular channel can use sim card 2 (the sim card 2 Attributable to operator B).
  • the priority of the main WIFI channel is higher than that of the other three channels. Therefore, the main network channel is usually the main WIFI channel. Under normal circumstances, considering the data traffic consumption of electronic devices, the priority of WIFI channels is higher than that of cellular channels.
  • the above-mentioned preset channels are only illustrative, and do not constitute a limitation to the embodiment of the present application, and in some embodiments, more or fewer channels may be included.
  • using the main WIFI channel as the main network channel is only a preferred solution, and does not constitute a limitation to the embodiment of the present application.
  • other network channels may also be selected as the main network channel.
  • mobile devices such as mobile phones are more and more widely used in people's daily life.
  • mobile payment and games can be performed through mobile phones.
  • common services such as games, calls, social software, etc.
  • the user's mobile phone will be connected to the wireless network.
  • the current wireless network is not enough to meet the needs of the business (for example, the signal of the mobile phone becomes poor, etc.), which will cause the business to run stuck, which may reduce the user experience.
  • the mobile phone does not enable the WIFI channel, and uses the cellular channel to transmit the network application in the foreground (that is, The data stream of the web application the user is currently using).
  • the mobile phone enters the WIFI network with historical usage information, the mobile phone will automatically connect to the WIFI network and enable the WIFI channel.
  • the priority of the WIFI channel is higher than that of the cellular channel.
  • the default network channel changes from the cellular channel to the WIFI channel.
  • Switching the flow of the above-mentioned network application from the currently used cellular channel to the WIFI channel may cause the business operation of the network application to freeze and reduce the user experience.
  • network channel switching is more likely to cause business freezes, and the freezes are more likely to affect user experience.
  • the embodiment of the present application provides a channel switching method, which can reduce the stalling problem of service running in the scene of network environment change, and improve user experience.
  • the electronic device when the electronic device detects a change in the network environment and automatically enables a new network channel (for example, a WIFI channel), if the priority of the newly enabled network channel is higher than that of the currently used network channel (for example, the priority of the cellular channel), for each flow carried by the current network application on the currently used network channel (such as the cellular channel), the network channel of each flow is not directly switched to the newly enabled network channel, but Consider the network quality of the currently used network channel and the newly enabled network channel, and/or, consider the impact of each flow of the current network application on the service operation of the network application, and decide whether to switch the network channel for each flow.
  • a new network channel for example, a WIFI channel
  • each flow of the network application can be divided into a flow that has a relatively large impact on the business operation of the network application and a flow that has a relatively small impact on the business operation of the network application. flow.
  • the game battle stream generally has a relatively large impact on the business operation of the game application, while the interface data stream such as the game lobby generally has a relatively small impact on the business operation of the game application;
  • video streams and audio streams generally have a relatively large impact on the business operation of the video playback application, while interface data streams such as the video list interface generally have relatively little impact on the business operation of the video playback application.
  • the flow in the network application that has a relatively large impact on the service operation of the network application may be a flow that is sensitive to network quality parameters such as delay and/or packet loss rate.
  • the impact of each flow of the current network application on service operation in the network application is considered to determine whether to switch the network channel for each flow. Specifically, for flows that have a relatively large impact on the business operation of network applications, they can continue to be carried on the currently used network channel without switching to the newly enabled network channel; for flows that have relatively little impact on the business operation of network applications , which can be switched to the newly enabled network channel.
  • the above implementation manner may further combine the network quality of the currently used network channel and the newly enabled network channel to determine whether to switch the network channel for each flow.
  • the network quality of the currently used network channel meets the transmission requirements of the flow, it can continue to be carried on the currently used network channel without switching to the new one.
  • the enabled network channel if the network quality of the currently used network channel does not meet the transmission requirements of the flow, switch it to the newly enabled network channel; for the flow that has relatively little impact on the business operation of the network application, if the newly enabled network
  • the network quality of the channel meets the transmission requirements of the stream, and it can be switched to the newly enabled network channel. If the network quality of the newly enabled network channel does not meet the transmission requirements of the stream, it can continue to be carried on the currently used network channel , without switching to the newly enabled network channel.
  • Figure 1a is a schematic diagram of a mobile phone desktop. As shown in Figure 1a, the user can click a video application icon on the desktop of the mobile phone to open a video application, thereby obtaining a schematic diagram of video display as shown in Figure 1b.
  • Fig. 1c is a schematic diagram of the effect after the mobile phone uses the main network channel (for example, the cellular channel 1). As shown in Figure 1c, there is no WIFI network in the environment where the mobile phone is located. The mobile phone enables the cellular channel for the video application. After the mobile phone obtains the path of the cellular channel, it can use the cellular channel to watch the video.
  • the main network channel for example, the cellular channel 1).
  • the current network application may include multiple streams (for example, video stream and audio stream), and the multiple streams may be carried on the aforementioned cellular channel.
  • Fig. 1d is a schematic diagram of a mobile phone using a backup network channel (for example, cellular channel 2).
  • a backup network channel for example, cellular channel 2.
  • Fig. 1e is a schematic diagram of a mobile phone using a WIFI channel.
  • the mobile phone detects the historical login record of the WIFI network, logs in to the WIFI network, enables the WIFI channel, and the default network channel is converted to a WIFI channel.
  • the mobile phone detects that the video stream and audio stream of the video application are delay-sensitive streams, and does not switch the video stream and audio stream to the WIFI channel until the transmission of the video stream and audio stream is completed to avoid video freezes;
  • the delay-sensitive stream is carried on the WIFI channel.
  • the user chooses to play another video, and the video stream of the video can be and the audio stream is carried on the WIFI channel.
  • FIGS. 2 and Figure 3 are schematic diagrams of the game interface.
  • the game interface of the mobile phone is the game battle interface.
  • the WIFI channel is not enabled on the mobile phone, only the cellular channel is enabled.
  • the default network channel is the cellular channel, and the game battle stream is carried on the cellular channel of the mobile phone; Change occurs, enter the WIFI network coverage area, the mobile phone detects that there is a historical login record of the WIFI network, log in to the WIFI network, enable the WIFI channel, the default network channel is converted to a WIFI channel, but the mobile phone detects that the game battle stream is a delay-sensitive stream , although the default network channel is converted to a WIFI channel, the game battle stream is still carried on the cellular channel to avoid lag during game team battles.
  • the game interface of the mobile phone is the game hall.
  • the WIFI channel is not enabled on the mobile phone, only the cellular channel is enabled.
  • the default network channel is the cellular channel.
  • the stream that the game application needs to transmit is the interface data stream, which is carried in the On the cellular channel of the mobile phone; the environment of the mobile phone changes and enters the coverage of the WIFI network.
  • the interface data flow is not time-delay-sensitive. Considering the status of the WIFI channel, the interface data flow is switched to the WIFI channel to save the data traffic consumption of the mobile phone.
  • the first device may be a mobile terminal, a terminal device, a user equipment (User Equipment, UE), an access terminal, a subscriber unit, a user station, a mobile station, a mobile station, a remote station, a remote terminal, a mobile device, a user terminal, Terminal, wireless communication device, user agent or user device.
  • UE User Equipment
  • the first device can be a station (STAION, ST) in the WLAN, can be a cellular phone, a cordless phone, a Session Initiation Protocol (Session Initiation Protocol, SIP) phone, a wireless local loop (Wireless Local Loop, WLL) station, a personal digital Processing (Personal Digital Assistant, PDA) devices, handheld devices with wireless communication functions, computing devices or other processing devices connected to wireless modems, vehicle-mounted devices, Internet of Vehicles terminals, computers, laptop computers, handheld communication devices, handheld Mobile computing equipment, satellite radio equipment, wireless modem cards, television set top boxes (Set Top Box, STB), customer premises equipment (Customer Premise Equipment, CPE) and/or other equipment used to communicate over wireless systems and next-generation communications system, for example, a mobile terminal in a 5G network or a mobile terminal in a public land mobile network (Public Land Mobile Network, PLMN) network that will evolve in the future.
  • PLMN Public Land Mobile Network
  • the first device may also be a wearable device.
  • Wearable devices can also be called wearable smart devices, which is a general term for the application of wearable technology to intelligently design daily wear and develop wearable devices, such as glasses, gloves, watches, clothing and shoes.
  • a wearable device is a portable device that is worn directly on the body or integrated into the user's clothing or accessories. Wearable devices are not only a hardware device, but also achieve powerful functions through software support, data interaction, and cloud interaction.
  • Generalized wearable smart devices include full-featured, large-sized, complete or partial functions without relying on smart phones, such as smart watches or smart glasses, etc., and only focus on a certain type of application functions, and need to be used in conjunction with other devices such as smart phones , such as various smart bracelets and smart jewelry for physical sign monitoring.
  • the above-mentioned scenario of using the first device to play online games is only an example, and is not enough to limit the embodiments of the present application.
  • it may also include using the first device to listen to online music and watch videos. Wait for the scene.
  • Fig. 4 shows a schematic structural diagram of an electronic device 100, which may be the above-mentioned first device.
  • the electronic device 100 may include a processor 110, an external memory interface 120B, an internal memory 120A, a universal serial bus (universal serial bus, USB) interface 130, a charging management module 140A, a power management module 140B, a battery 140C, an antenna 1, and an antenna 2 , mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone jack 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, display screen 194, and A subscriber identification module (subscriber identification module, SIM) card interface 195 and the like.
  • SIM subscriber identification module
  • 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, bone conduction sensor 180M, etc.
  • the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100 .
  • the electronic device 100 may include more or fewer components than shown in the figure, or combine certain components, or separate certain components, or arrange different components.
  • the illustrated components can be realized in hardware, software or a combination of software and hardware.
  • the processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), controller, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural network processor (neural-network processing unit, NPU), etc. Wherein, different processing units may be independent devices, or may be integrated in one or more processors. Wherein, the controller may be the nerve center and command center of the electronic device 100 . The controller can generate an operation control signal according to the instruction opcode and timing signal, and complete the control of fetching and executing the instruction.
  • a memory may also be provided in the processor 110 for storing instructions and data.
  • the memory in processor 110 is a cache memory.
  • the memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can be called directly from the memory. Repeated access is avoided, and the waiting time of the processor 110 is reduced, thereby improving the efficiency of the system.
  • the execution of the screen capture method provided by the embodiment of the present application can be completed by controlling the processor 110 or calling other components, such as calling the processing program of the embodiment of the present application stored in the internal memory 120A, so as to realize the user's screen capture operation and improve the user's performance. experience.
  • processor 110 may include one or more interfaces.
  • the interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous transmitter (universal asynchronous receiver/transmitter, UART) interface, mobile industry processor interface (mobile industry processor interface, MIPI), general-purpose input and output (general-purpose input/output, GPIO) interface, subscriber identity module (subscriber identity module, SIM) interface, and /or universal serial bus (universal serial bus, USB) interface, etc.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • PCM pulse code modulation
  • UART universal asynchronous transmitter
  • MIPI mobile industry processor interface
  • GPIO general-purpose input and output
  • subscriber identity module subscriber identity module
  • SIM subscriber identity module
  • USB universal serial bus
  • the USB interface 130 is an interface conforming to the USB standard specification, specifically, it can be a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like.
  • the USB interface 130 can be used to connect a charger to charge the electronic device 100 , and can also be used to transmit data between the electronic device 100 and peripheral devices. It can also be used to connect headphones and play audio through them. This interface can also be used to connect other electronic devices, such as AR devices.
  • the interface connection relationship between the modules shown in the embodiment of the present application is only a schematic illustration, and does not constitute a structural limitation of the electronic device 100 .
  • the electronic device 100 may also adopt different interface connection manners in the foregoing embodiments, or a combination of multiple interface connection manners.
  • the wireless communication function of the electronic device 100 can be realized 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.
  • Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in electronic device 100 may be used to cover single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization of the antennas.
  • Antenna 1 can be multiplexed as a diversity antenna of a wireless local area network.
  • the antenna may be used in conjunction with a tuning switch.
  • the mobile communication module 150 can provide wireless communication solutions including 2G/3G/4G/5G applied on the electronic device 100 .
  • the mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA) and the like.
  • the mobile communication module 150 can receive electromagnetic waves through the antenna 1, filter and amplify the received electromagnetic waves, and send them to the modem processor for demodulation.
  • the mobile communication module 150 can also amplify the signals modulated by the modem processor, and convert them into electromagnetic waves through the antenna 1 for radiation.
  • at least part of the functional modules of the mobile communication module 150 may be set in the processor 110 .
  • at least part of the functional modules of the mobile communication module 150 and at least part of the modules of the processor 110 may be set in the same device.
  • a modem processor may include a modulator and a demodulator.
  • the modulator is used for modulating the low-frequency baseband signal to be transmitted into a medium-high frequency signal.
  • the demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator sends the demodulated low-frequency baseband signal to the baseband processor for processing.
  • the low-frequency baseband signal is passed to the application processor after being processed by the baseband processor.
  • the application processor outputs sound signals through audio equipment (not limited to speaker 170A, receiver 170B, etc.), or displays images or videos through display screen 194 .
  • the modem processor may be a stand-alone device.
  • the modem processor may be independent of the processor 110, and be set in the same device as the mobile communication module 150 or other functional modules.
  • the wireless communication module 160 can provide wireless local area networks (wireless local area networks, WLAN) (such as wireless fidelity (Wireless Fidelity, Wi-Fi) network), bluetooth (bluetooth, BT), global navigation satellite, etc. applied on the electronic device 100.
  • System global navigation satellite system, GNSS
  • frequency modulation frequency modulation, FM
  • near field communication technology near field communication, NFC
  • infrared technology infrared, IR
  • 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 , frequency-modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 .
  • the wireless communication module 160 can also receive the signal to be sent from the processor 110 , frequency-modulate it, amplify it, and convert it into electromagnetic waves through the antenna 2 for radiation.
  • the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology.
  • the wireless communication technology may include global system for mobile communications (GSM), general packet radio service (general packet radio service, GPRS), code division multiple access (code division multiple access, CDMA), broadband Code division multiple access (wideband code division multiple access, WCDMA), time division code division multiple access (time-division code division multiple access, TD-SCDMA), long term evolution (long term evolution, LTE), BT, GNSS, WLAN, NFC , FM, and/or IR techniques, etc.
  • GSM global system for mobile communications
  • GPRS general packet radio service
  • code division multiple access code division multiple access
  • CDMA broadband Code division multiple access
  • WCDMA wideband code division multiple access
  • time division code division multiple access time-division code division multiple access
  • TD-SCDMA time-division code division multiple access
  • the GNSS may include a global positioning system (global positioning system, GPS), a global navigation satellite system (global navigation satellite system, GLONASS), a Beidou navigation satellite system (beidou navigation satellite system, BDS), a quasi-zenith satellite system (quasi -zenith satellite system (QZSS) and/or satellite based augmentation systems (SBAS).
  • GPS global positioning system
  • GLONASS global navigation satellite system
  • Beidou navigation satellite system beidou navigation satellite system
  • BDS Beidou navigation satellite system
  • QZSS quasi-zenith satellite system
  • SBAS satellite based augmentation systems
  • the electronic device 100 realizes the display function through 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 the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering.
  • Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
  • the display screen 194 is used to display images, videos and the like.
  • the display screen 194 includes a display panel.
  • the display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active matrix organic light emitting diode or an active matrix organic light emitting diode (active-matrix organic light emitting diode, AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light emitting diodes (quantum dot light emitting diodes, QLED), etc.
  • the electronic device 100 may include 1 or N display screens 194 , where N is a positive integer greater than 1.
  • the electronic device 100 can realize the shooting function through the ISP, the camera 193 , the video codec, the GPU, the display screen 194 and the application processor.
  • the ISP is used for processing the data fed back by the camera 193 .
  • the light is transmitted to the photosensitive element of the camera through the lens, and the light signal is converted into an electrical signal, and the photosensitive element of the camera transmits the electrical signal to the ISP for processing, and converts it into an image visible to the naked eye.
  • ISP can also perform algorithm optimization on image noise, brightness, and skin color.
  • ISP can also optimize the exposure, color temperature and other parameters of the shooting scene.
  • the ISP may be located in the camera 193 .
  • Camera 193 is used to capture still images or video.
  • the object generates an optical image through the lens and projects it to the photosensitive element.
  • the photosensitive element can be a charge coupled device (charge coupled device, CCD) or a complementary metal-oxide-semiconductor (complementary metal-oxide-semiconductor, CMOS) phototransistor.
  • CCD charge coupled device
  • CMOS complementary metal-oxide-semiconductor
  • the photosensitive element converts the light signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal.
  • the ISP outputs the digital image signal to the DSP for processing.
  • DSP converts digital image signals into standard RGB, YUV and other image signals.
  • the electronic device 100 may include 1 or N cameras 193 , where N is a positive integer greater than 1.
  • Digital signal processors are used to process digital signals, not only digital image signals, but also other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the energy of the frequency point.
  • Video codecs are used to compress or decompress digital video.
  • the electronic device 100 may support one or more video codecs.
  • the electronic device 100 can play or record videos in various encoding formats, for example: moving picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4 and so on.
  • MPEG moving picture experts group
  • the NPU is a neural-network (NN) computing processor.
  • NN neural-network
  • Applications such as intelligent cognition of the electronic device 100 can be realized through the NPU, such as image recognition, face recognition, speech recognition, text understanding, and the like.
  • the external memory interface 120B can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100.
  • the external memory card communicates with the processor 110 through the external memory interface 120B to implement a data storage function. Such as saving music, video and other files in the external memory card.
  • Internal memory 120A may be used to store computer-executable program code, which includes instructions.
  • the internal memory 120A may include an area for storing programs and an area for storing data.
  • the stored program area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.) and the like.
  • the storage data area can store data created during the use of the electronic device 100 (such as audio data, phonebook, etc.) and the like.
  • the internal memory 120A may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (universal flash storage, UFS) and the like.
  • the processor 110 executes various functional applications and data processing of the electronic device 100 by executing instructions stored in the internal memory 120A and/or instructions stored in a memory provided in the processor.
  • the electronic device 100 can implement audio functions through the audio module 170 , the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor. Such as music playback, recording, etc.
  • Touch sensor 180K also known as "touch panel”.
  • the touch sensor 180K can be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a “touch screen”.
  • the touch sensor 180K is used to detect a touch operation on or near it.
  • the touch sensor can pass the detected touch operation to the application processor to determine the type of touch event.
  • Visual output related to the touch operation can be provided through the display screen 194 .
  • the touch sensor 180K may also be disposed on the surface of the electronic device 100 , which is different from the position of the display screen 194 .
  • the user's touch screen data can be obtained through the touch sensor 180K, and the touch screen data can be sent to the processor 110 for processing.
  • the keys 190 include a power key, a volume key and the like.
  • the key 190 may be a mechanical key. It can also be a touch button.
  • the electronic device 100 can receive key input and generate key signal input related to user settings and function control of the electronic device 100 .
  • the motor 191 can generate a vibrating reminder.
  • the motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback.
  • touch operations applied to different applications may correspond to different vibration feedback effects.
  • the motor 191 may also correspond to different vibration feedback effects for touch operations acting on different areas of the display screen 194 .
  • Different application scenarios for example: time reminder, receiving information, alarm clock, games, etc.
  • the touch vibration feedback effect can also support customization.
  • the indicator 192 can be an indicator light, and can be used to indicate charging status, power change, and can also be used to indicate messages, missed calls, notifications, and the like.
  • the SIM card interface 195 is used for connecting a SIM card.
  • the SIM card can be connected and separated from the electronic device 100 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195 .
  • the electronic device 100 may support 1 or N SIM card interfaces, where N is a positive integer greater than 1.
  • SIM card interface 195 can support Nano SIM card, Micro SIM card, SIM card etc. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards may be the same or different.
  • the SIM card interface 195 is also compatible with different types of SIM cards.
  • the SIM card interface 195 is also compatible with external memory cards.
  • the electronic device 100 interacts with the network through the SIM card to implement functions such as calling and data communication.
  • the electronic device 100 adopts an eSIM, that is, an embedded SIM card.
  • the eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100 .
  • the first device 10 includes an application layer 11 , a service layer 12 , a policy layer 13 and a kernel layer 14 .
  • the first device 10 includes an application layer 11 , a service layer 12 , a policy layer 13 and a kernel layer 14 .
  • the application layer 11 may be used to provide various network applications, and the above network applications may be third-party applications or system applications, for example, network applications such as games, music, and video. This application does not specifically limit the types of network applications provided by the above application layer 11 .
  • the network application here refers to an application that needs to use the network channel of the first device 10 to obtain resources from the 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 evaluation component 125 .
  • the environment detection component 121 can be used to detect the status of the application, for example, the status of the above application can include the status of application exit, application opening, application running, application installation and application uninstallation, etc. It can be understood that the above status is only an example It can also include more states, which will not be repeated here.
  • the network detection component 122 can be used to detect the opening state of the network channel.
  • the channel-level path management component 123 may be responsible for requesting/closing network channels, sensing network channel status changes, updating network channel selection strategies, and storing multiple network channel paths.
  • the application-level policy management component 124 can generate different execution policies based on input information. Exemplarily, the policy can be to enable the acceleration function of the network channel, or to enable traffic awareness (for example, to detect the traffic of the network channel), etc.
  • Channel and application quality assessment component 125 can be used to assess the quality of network channels.
  • the service layer 12 may also include: a network connection management component 126, configured to enable a network channel, that is, to convert the network channel from a dormant state to an awakened state, and the network channel can be used directly in the awakened state.
  • the 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 can be used to update the selection of network channels according to the policy change of the upper layer, trigger network channel quality detection, dynamically select the optimal channel, and can also be used to store the paths of different network channels.
  • Paths of the network channel currently used by the application for example, the primary network channel
  • the flow-level policy management component 132 can be used to instruct switching of network channels, and can also be used to store network channel switching policies of flows in network applications.
  • the traffic perception component 133 can be used to collect statistics on 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 used for collecting and reporting traffic information.
  • the policy enforcement component 142 can be used to perform network channel switching.
  • the interface connection relationship among the components shown in the embodiment of the present application is only a schematic illustration, and does not constitute a structural limitation of the first device.
  • the first device may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
  • FIG. 5 is only used to illustrate the implementation of the layered architecture of the first device.
  • the system architecture shown in Figure 5 can also be implemented as part of an existing layered software architecture.
  • FIG. 6 is a block diagram showing a software structure of an electronic device with the Android system provided by an embodiment of the present application.
  • the layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate through software interfaces.
  • the Android system is divided into five layers, which are respectively the application program layer, the application program framework layer (also called: the system framework layer), the system library and the Android runtime layer from top to bottom. , hardware abstraction layer (hardware abstraction layer, HAL) and kernel layer.
  • HAL hardware abstraction layer
  • the application program layer includes several application programs (hereinafter referred to as applications), such as camera, gallery, calendar, WLAN and so on.
  • applications such as camera, gallery, calendar, WLAN and so on.
  • the application layer in the system architecture shown in FIG. 5 may correspond to the application program layer.
  • the application program layer of the electronic device shown in FIG. 6 may include the network application described in the embodiment 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 (Application Programming Interface, API) and a programming framework for the application of the application layer, including various components and services to support the developer's Android development.
  • the application framework layer also includes some predefined functions.
  • the application framework layer may include a window manager, a content provider, a resource manager, a camera service, and the like.
  • the service layer and the policy layer in the system architecture shown in FIG. 5 may be located at the application framework layer.
  • System library and Android runtime layer includes system library and Android runtime (Android Runtime).
  • a system library can include multiple function modules. For example: surface manager, 2D graphics engine, 3D graphics processing library (eg: OpenGL ES), media library, font library, etc.
  • the HAL layer is an interface layer between the operating system kernel and the hardware circuit.
  • the HAL layer includes but is not limited to: Audio Hardware Abstraction Layer (Audio HAL) and Camera Hardware Abstraction Layer (Camera HAL).
  • the kernel layer is the layer between hardware and software.
  • the kernel layer can include: display driver, camera driver, audio driver, sensor driver, etc.
  • 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.
  • the kernel layer may include: traffic reporting components and policies Executive component.
  • FIG. 7 is a schematic flowchart of an embodiment of a channel switching method provided in an embodiment of the present application, including:
  • Step 301 Start a network application in response to a user's operation.
  • the user may perform an opening operation on the first device to open a network application.
  • the user may click the icon of the network application on the first device.
  • the application layer 11 in the first device starts the network application.
  • the aforementioned network applications may be network-type applications such as online games, online videos, and online music.
  • Figure 1a is a schematic diagram of a mobile phone desktop. As shown in Figure 1a, the user can click a video application icon on the desktop of the mobile phone to open a video application, thereby obtaining a schematic diagram of video display as shown in Figure 1b.
  • 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 .
  • the environment detection component 121 in the service layer 12 of the first device can continuously detect the state of the above-mentioned network application or the network environment.
  • a first notification message may be sent to the application-level policy management component 124, and the first notification message may be used to notify the application-level policy management component 124 that the network application has switched to the foreground or the network environment has changed.
  • the first notification message may also include the identity of the network application (for example, the identity of the network application may be a UID), and the identity may be used to identify the unique identity of the network application.
  • the identity identification of the above network application can be realized by the following code:
  • Step 303 the application-level policy management component 124 receives the first notification message sent by the environment detection component 121, and judges whether the current network application meets the condition for enabling acceleration.
  • the application-level policy management component 124 may determine from the first notification message that the network application has switched to the foreground. Next, the application-level policy management component 124 can further determine whether the network application is included in the preset application whitelist.
  • the application-level policy management component 124 can preset an application whitelist, which can include multiple network applications, each network application can be identified by the above-mentioned identity, and this application whitelist can be used to represent Accelerated web applications can be turned on.
  • the network applications in the preset application whitelist may include service types, for example, the service types of the network applications in the above preset application whitelist may all be sensitive, and the sensitive services may include delay-sensitive services, Packet loss rate-sensitive services, etc.
  • the network application in the first notification message is included in the preset application whitelist, it can be determined that the network application meets the conditions for enabling acceleration; if the network application in the first notification message is not included in the preset application whitelist, then It can be determined that the network application does not meet the condition for enabling acceleration.
  • Table 1 is a white list of network applications.
  • the current network application is not in the preset application whitelist, that is to say, the service type of the current network application is non-sensitive service
  • the first device detects that the main network channel is degraded
  • Other network channels with better quality can be further detected, so that the above-mentioned non-sensitive services can be directly switched to the network channel with better quality.
  • step 304 the application-level policy management component 124 sends a channel enabling message to the flow-level path management component 131 for enabling a network channel.
  • the application-level policy management component 124 may send a channel enabling message to the flow-level path management component 131, wherein the channel enabling message is used to indicate that the flow-level path management component 131 can Enable a network channel (for example, the main network channel).
  • Step 305 the flow-level path management component 131 requests the path of the main network channel from the channel-level path management component 123 .
  • the flow-level path management component 131 can send a main network channel request to the channel-level path management component 123, wherein the main network channel request is used to request the main The path of the network channel.
  • the main network channel may be a main WIFI channel.
  • 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 .
  • the channel-level path management component 123 can pre-configure the paths of multiple network channels.
  • the multiple network channels can include a primary WIFI channel, a secondary WIFI channel, a primary cellular channel, and a secondary cellular channel, wherein the primary The WIFI channel and the auxiliary WIFI channel can work in the 2.4GHz frequency band or 5GHz frequency band.
  • the main WIFI channel works in the 2.4GHz frequency band
  • the auxiliary WIFI channel works in the 5GHz frequency band
  • the main WIFI channel works in the 5GHz frequency band
  • the auxiliary WIFI channel works in the 5GHz frequency band.
  • the WIFI channel works in the 2.4GHz frequency band.
  • the main cellular channel and the auxiliary cellular channel can correspond to the operator's network.
  • the main cellular channel can use sim card 1 (the sim card 1 belongs to operator A), and the auxiliary cellular channel can use sim card 2 (the sim card 2 Attributable to operator B).
  • the priority of the main WIFI channel is higher than that of the other three channels. Therefore, the main network channel is usually the main WIFI channel.
  • the above-mentioned preset channels are only illustrative, and do not constitute a limitation to the embodiment of the present application, and in some embodiments, more channels may be included.
  • using the main WIFI channel as the main network channel is only a preferred solution, and does not constitute a limitation to the embodiment of the present application.
  • other network channels may also be selected as the main network channel.
  • the channel-level path management component 123 After the channel-level path management component 123 receives the main network channel request sent by the flow-level path management component 131, it can select a network channel from the above-mentioned multiple network channels as the main network channel (for example, the main network channel is the main WIFI channel) ), and send the path of the main network channel to the flow-level path management component 131.
  • the main network channel for example, the main network channel is the main WIFI channel
  • Step 307 the flow-level path management component 131 stores the received path of the main network channel.
  • the flow-level path management component 131 may store the path of the main network channel.
  • the path of the main network channel may be represented by WIFI1.
  • Fig. 1c is a schematic diagram of the effect after the mobile phone uses the main network channel. As shown in Figure 1c, after the mobile phone obtains the path of the main network channel, it can use the main network channel to watch videos.
  • the current network application may include multiple streams (for example, video stream and audio stream), and the multiple streams may be carried on the above-mentioned main network channel.
  • Step 308 the application-level policy management component 124 sends a traffic detection request to the traffic perception component 133 .
  • the traffic detection request may be used to instruct the traffic sensing component 133 to start packet statistics of the network application on the main network channel.
  • the traffic detection request may include the identity (eg, UID) of the network application currently to be detected, and is used to request detection of the flow of the network application corresponding to the above-mentioned identity UID on the main network channel. It can be understood that the flow of the above network application may be in the form of a message.
  • step 308 may be executed simultaneously with step 304, or may be executed at any time after step 304, which is not specifically limited in this application.
  • Step 309 the traffic sensing component 133 sends a traffic reporting request to the traffic reporting component 141 .
  • the traffic sensing component 133 can send a traffic reporting request to the traffic reporting component 141, wherein the traffic reporting request can be used to instruct the traffic reporting component 141 on the current
  • the packet of the network application on the main network channel is detected, and the detected packet is reported.
  • the above traffic detection request may include the identity (eg UID) of the network application.
  • Step 310 the traffic reporting component 141 performs traffic detection, and reports the detected packets to the traffic sensing component 133 .
  • the traffic reporting component 141 may, according to the identity (such as UID) of the network application in the traffic reporting request, check the network information corresponding to the identity of the network application.
  • the packet of the application is detected, so that the packet of the network application on the main network channel can be obtained, and the packet of the detected network application can be reported to the traffic sensing component 133 .
  • the traffic reporting component 141 may call a component (for example, the Netfilter component of the Android system) to obtain the packets of the network application on the main network channel.
  • a component for example, the Netfilter component of the Android system
  • the above-mentioned Netfilter component is only an example, and does not constitute a limitation to the embodiment of the present application.
  • the detection of the above-mentioned packets can also be completed by other components.
  • the parameters of the above network channel can be implemented by the following code:
  • the above detected packets may be packets of one or more characteristic flows in the current network application, where the characteristic flow may be the most sensitive flow in the network application, that is, the flow that has a greater impact on the current network application big flow.
  • the quality of the network channel can be evaluated through the parameters of the above network channel.
  • Step 311 the traffic sensing component 133 counts the packets of the network application on the main network channel, predicts according to the statistical results, obtains the prediction result, and sends the prediction result to the flow-level path management component 131 .
  • the flow sensing component 133 may perform statistics on the above packets, thereby obtaining a packet statistics result. Then, the analysis can be performed according to the statistical results of the packets, so that the network status can be predicted, that is, it can be predicted whether the network status will become better or worse according to the statistical results of the packets. During specific implementation, the packet loss rate and/or time delay of the above-mentioned network application packets can be counted, so that the network status can be predicted.
  • the packet loss rate and/or delay of packets within the preset N periods can be counted, and if the statistical packet loss rate and/or delay meet the preset requirements, it can be predicted that the network condition is good, if If the statistical packet loss rate and/or delay do not meet the preset requirements, it can be predicted that the network condition is poor.
  • the quality of the network channel in step 311 is a coarse-grained evaluation, that is to say, the statistics of the packets of the characteristic flow are carried out in a short period, which is used to quickly predict the status of the network, so that it can be selected in advance
  • the backup network channel can save the delay of channel switching.
  • the foregoing packets may be packets of various flows of network applications on the main network channel.
  • the traffic sensing component 133 may analyze the above packet.
  • the foregoing packet analysis may be based on packet characteristics, so as to identify characteristic flows.
  • take the Peace Elite game as an example.
  • the feature stream of the game can be a voice stream. That is to say, the voice stream has a relatively large impact on the game and is the most sensitive.
  • the quality of the voice stream is not good (for example, When the delay and packet loss rate do not meet the requirements), it will seriously affect the user's game experience. Therefore, it is necessary to identify the voice stream, and further count the voice stream packets in the packets.
  • the identification of the packets of the voice stream can be realized by counting the heartbeat packets.
  • UDP User Datagram Protocol
  • the data packet characteristics of the voice stream can be represented by the following characteristics:
  • FIG. 8 is a schematic diagram of a heartbeat message of a voice flow of the UDP protocol.
  • the packets of the voice stream can be counted, so that the time delay and/or packet loss rate of the packets of the voice stream can be obtained.
  • the packets of the voice stream within a preset time period may be counted.
  • the above-mentioned preset duration can be 1s, so that it can be determined as soon as possible whether the quality of the voice stream is degraded, and then the voice stream can be switched to the backup network channel as soon as possible, so as to provide a higher game experience.
  • the packet delay and/or packet loss rate of the above-mentioned voice stream does not meet the requirements, it can be determined that the quality of the voice stream is poor, and at this time, a switch can be triggered to switch the above-mentioned voice stream to Switch to an alternate network channel.
  • a switch can be triggered to switch the above-mentioned voice stream to Switch to an alternate network channel.
  • the feature stream of this network application is a download stream, that is, it can The packet of the download stream is found in the above packets, and the influencing factor of the packet of the download stream may be rate.
  • the above-mentioned network applications may also include social network applications such as WeChat, and the feature stream of the network application is a video stream, that is to say, the message of the video stream can be found in the above-mentioned message, and the impact of the message of the video stream Factors can be latency and/or packet loss.
  • social network applications such as WeChat
  • the feature stream may also include a battle stream in a game.
  • Peace Elite by periodically counting the number of UDP packets, it can be judged whether the current packet flow is a battle flow.
  • the period used by Peace Elite is 500ms. Therefore, the total number of messages in the period can be counted to determine whether it is a battle flow. For example, if the total number of messages in the above-mentioned 500ms period is greater than 10, the message flow is a battle flow.
  • FIG. 9 is a schematic diagram of packet statistics of the battle flow of the UDP protocol. As shown in Figure 9, the horizontal axis is time, and the vertical axis is the total number of messages. Since the number of messages per second is basically maintained at 30, it can be determined by calculation that there are 15 messages every 500ms, and thus the message can be determined Streams are versus streams.
  • FIG. 10 is a schematic diagram of a heartbeat message of a battle flow of the UDP protocol.
  • step 312 the flow-level path management component 131 requests a backup network channel from the channel-level path management component 123 based on the received prediction result.
  • the flow-level path management component 131 may select a backup network channel in advance based on the prediction result, for example, may send a backup network channel request to the channel-level path management component 123 for requesting a backup network channel.
  • the above standby network channel request may also carry a label, which may be used to indicate the prediction of switching of the main network channel, and the switch is not actually performed.
  • the mobile phone has the capability of 4 network channels including main WIFI channel (eg WIFI1), auxiliary WIFI channel (eg WIFI2), main cellular channel (eg Mobile1) and auxiliary cellular channel (eg Mobile2).
  • main WIFI channel eg WIFI1
  • auxiliary WIFI channel eg WIFI2
  • main cellular channel eg Mobile1
  • auxiliary cellular channel eg Mobile2
  • stream A such as video stream
  • stream B such as audio stream
  • the mobile phone After the mobile phone receives the prediction result that the network is about to deteriorate, it can select a backup network channel in advance, wherein the backup network channel can be the above-mentioned auxiliary WIFI channel (such as WIFI2), the main cellular channel (such as Mobile1) and the secondary cellular channel (such as The channel with the best quality in Mobile2).
  • the backup network channel can be the above-mentioned auxiliary WIFI channel (such as WIFI2), the main cellular channel (such as Mobile1) and the secondary cellular channel (such as The channel with the best quality in Mobile2).
  • the path of the Mobile1 channel can be to store.
  • the mobile phone finds that the quality of stream A does not meet the requirements through further message detection, it can only switch the above stream A to the standby network channel, that is, the Mobile1 channel.
  • the above-mentioned flow B can continue to be carried on the main network channel, that is, the WIFI channel, and the flow A can be carried on the backup network channel, that is, the Mobile1 channel.
  • the mobile phone when the mobile phone finds that the quality of stream A does not meet the requirements through further message detection, it can switch both stream A and stream B to the standby network channel, that is, the Mobile1 channel. As shown in FIG. 11c, at this time, the above-mentioned stream A and stream B are both carried on the Mobile1 channel.
  • a mobile phone is taken as an example to describe the trigger condition of channel switching.
  • Fig. 11d is a channel switch triggering process for non-sensitive services.
  • the traffic sensing component 133 in the mobile phone receives the heartbeat flow message of the characteristic flow detected by the traffic reporting component 141 within the preset first time period, and through the heartbeat flow message of the characteristic flow within the preset first time period Statistical analysis of flow packets can determine whether the quality of the network channel has deteriorated. Wherein, since the current service is a non-sensitive service, the above-mentioned preset first duration may be set longer, for example, 5s.
  • the traffic sensing component 133 determines that the quality of the current network channel is deteriorating, it can send a switching notification to the policy management component 132 to trigger the switching of the network channel. Sensitive services are switched to other network channels with the best quality.
  • Fig. 11e is a channel switch triggering process for sensitive services.
  • the traffic sensing component 133 in the mobile phone receives the heartbeat flow message of the characteristic flow detected by the traffic reporting component 141 within the preset second time period.
  • the statistical analysis of flow packets can predict whether the quality of the network channel will deteriorate.
  • the above-mentioned preset second duration can be set shorter, such as 1s, so that the status of the network channel can be quickly predicted, and then the backup network channel can be quickly selected, so as to save the time spent on the backup during the actual switching of the network channel in the future.
  • the evaluation time of the network channel can be set shorter, such as 1s, so that the status of the network channel can be quickly predicted, and then the backup network channel can be quickly selected, so as to save the time spent on the backup during the actual switching of the network channel in the future.
  • the traffic sensing component 133 in the mobile phone continues to receive the heartbeat flow packets of the characteristic flows detected by the traffic reporting component 141 within the preset third time period, and through the heartbeat flow packets of the characteristic flows within the preset third time period Statistical analysis can determine the quality of service of the characteristic flow in the current network application.
  • the above-mentioned preset third duration can be equal to the preset first duration, such as 5s, or shorter than the preset first duration, such as 3s.
  • a switching notification can 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 can be switched to the above-mentioned standby network channel.
  • step 313 the channel-level path management component 123 receives the backup network channel request, and requests the enabling status of each optional network channel.
  • the channel-level path management component 123 can send a channel status request to the network detection component 122, wherein the channel status request can be used to request to obtain each The enabled state of the optional network channel.
  • the above enabling status may include available and unavailable.
  • the above available state may be used to indicate that the optional network channel can be enabled, and the above unavailable state may be used to indicate that the optional network channel cannot be enabled.
  • the optional network channel may include a secondary WIFI channel, a primary cellular channel, a secondary cellular channel, and the like.
  • Step 314 the network detection component 122 detects the activation status of each optional network channel, and sends the activation status of each optional network channel to the channel-level path management component 123 .
  • the network detection component 122 may detect the activation status of each optional network channel.
  • the network detection component 122 can be used to manage the switches of each optional network channel. When any optional network channel is opened, the optional network channel is in an available state, and when any optional network channel is closed , the optional network channel is unavailable. Therefore, after the network detection component 122 detects the activation status of all optional network channels requested by the channel-level path management component 123 , it may send the activation status of all optional network channels to the channel-level path management component 123 .
  • Step 315 the channel-level path management component 123 requests the channel quality of each available network channel.
  • the channel-level path management component 123 when the channel-level path management component 123 receives the enabling status of each optional network channel, it can select an available network channel (that is, an optional network channel in an available state), and can further send information to the channel and the application quality evaluation component. 125 Send a channel evaluation request, where the channel evaluation request may be used to request to evaluate the quality of available network channels.
  • Step 316 the channel and application quality evaluation component 125 evaluates the quality of each available network channel, and sends the evaluation result to the channel-level path management component 123 .
  • the channel and application quality evaluation component 125 may evaluate the quality of each available network channel according to the channel evaluation request.
  • the channel quality may include the channel delay, packet loss rate, bandwidth, rate, and the like.
  • the above evaluation may be an evaluation of the round-trip time delay (Round-Trip Time, RTT) of the available network channels, and the network channel with the smallest round-trip time delay is the best.
  • the channel quality can be evaluated in combination with the above-mentioned RTT and historical records, wherein the historical The records may include the historical receiving rate, the historical number of times when the channel quality is poor, etc., and the embodiment of the present application does not specifically limit the evaluation method of the above-mentioned channel quality.
  • the assessment result may be sent to the first path management component 123 .
  • Step 317 the channel-level path management component 123 determines the 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.
  • the channel-level path management component 123 After the channel-level path management component 123 receives the above-mentioned evaluation result, it can select the best available network channel as the backup network channel based on the above-mentioned evaluation result, and can send the path of the above-mentioned backup network channel to the channel-level path management component. 123.
  • 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 .
  • the flow-level path management component 131 may pre-store the path of the backup network channel. It can be understood that, in step 312, only the network status is predicted, that is to say, the current network is poor, which may cause stalls in the business, but the handover condition has not yet been met. At this time, the first device The standby network channel is not switched, that is, the first device is still using the primary network channel.
  • the flow-level path management component 131 may pre-store the path of the backup network channel.
  • the first device does not switch to the standby network channel, that is, the first device is still using the main network channel.
  • the first device may switch the above feature stream from the main network channel to the standby network channel.
  • Step 319 the traffic reporting component 141 reports the packet to the traffic sensing component 133 .
  • the traffic reporting component 141 can continuously detect packets of the current main network channel, and report the detected packets to the traffic sensing component 133 .
  • Step 320 the traffic sensing component 133 receives the packet reported by the traffic reporting component 141 , analyzes the packet, obtains the packet analysis result, and sends the packet analysis result to the flow-level policy management component 132 .
  • the flow sensing component 133 may identify the characteristic flow from the packet. Wherein, for the manner of identifying the feature stream described above, reference may be made to step 311 , which will not be repeated here. Then, the packets in the characteristic flow above can be analyzed, and the packet analysis result can be obtained, which can be used to characterize whether the characteristic flow satisfies the business requirements, for example, whether it meets the delay requirement or whether it meets the loss Package rate requirements, etc. And the packet analysis result may be sent to the flow-level policy management component 132 .
  • this step 320 is different from the coarse-grained quality assessment of the network channel in step 311, that is, the packet of the characteristic flow received is analyzed in a short period, so that the network quality can be obtained , and make switching predictions. And this step 320 is to analyze the message of the characteristic flow received in a relatively long period, thus it can be determined whether to perform an actual handover, that is to say, the step 320 is a fine-grained quality assessment, which can be implemented for The switching of the network channel of the feature stream saves time delay.
  • a parameter used for network quality assessment for a parameter used for network quality assessment (for example, delay or packet loss rate)
  • only one threshold is set for the parameter, and the network quality is evaluated using an assessment strategy corresponding to the threshold.
  • at least two thresholds with different values can be set for the parameters, and each threshold corresponds to a set of evaluation strategies. The larger the threshold, the smaller the delay of the evaluation strategy.
  • the evaluation strategy corresponding to threshold 1 can be: if the delay of 3 cycles in 5 consecutive cycles is greater than threshold 1, the packet The analysis result is poor quality, otherwise the packet analysis result is good quality; the evaluation strategy corresponding to the threshold 2 can be: the delay of one cycle is greater than the threshold 2, then the packet analysis result is poor quality, otherwise the packet analysis result is quality it is good.
  • 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.
  • the feature stream is a voice stream
  • the message reported by the traffic reporting component is a heartbeat stream message in the voice stream.
  • the RTT of the heartbeat stream message is used to evaluate the quality of the network channel
  • the RTT threshold of the heartbeat stream message is 1 and Threshold 2 Two thresholds, the evaluation strategy corresponding to the threshold continues the previous example.
  • the traffic sensing component 133 judges whether the RTT of the current period is greater than threshold 2;
  • the traffic sensing component 133 judges whether the RTT of the current period window has 3 periods greater than the threshold value 1; the current period window consists of 5 consecutive periods with the current period as the end period;
  • the traffic sensing component 133 may send the packet analysis result of the voice stream to the flow-level policy management component 132 only when the packet analysis result of the voice stream is of poor quality.
  • two thresholds are preset as an example, which can also be extended to preset three or more thresholds, which is not limited in this embodiment of the present application.
  • step 321 the flow-level policy management component 132 determines the switchover based on the message analysis result, and requests to obtain the path of the backup network channel.
  • the flow-level policy management component 132 may determine whether to perform channel switching according to the packet analysis result. In the specific implementation, if the characteristic stream of the current network application (for example, the voice stream in the game, the video stream in WeChat or the download stream of Baidu Netdisk) does not meet the requirements (for example, delay and/or packet loss rate) , it can be determined that channel switching is required. At this point, the flow-level policy management component 132 can send a backup network channel path acquisition request to the flow-level path management component 131 to obtain the path of the backup network channel. For example, if the backup network channel is the main cell, the backup network channel The path of can be, for example, Mobile1.
  • the above path for requesting a backup network channel can be implemented by the following code:
  • the path of the above network channel (for example, the path can be represented by the device number of the network card or sim card) can be defined in the data structure, the code example is as follows:
  • sk_bound_dev_if is the device number of the switching target network card or target sim card. It can be understood that the message can be received through the above-mentioned network card or sim card, and the code for receiving the message can refer to the following example:
  • pktinfo is the received message
  • msg.flow_msg is the name of the message flow.
  • the first device can delete the path of the backup network channel, thereby releasing resources , and also can save the power consumption of the first device.
  • the first device may also delete the path of the backup network channel after a preset time period (for example, a preset fourth time period), so as to ensure that within the preset fourth time period, if the quality of the feature stream changes If it is poor, it can switch to the backup network channel in time to avoid the inability to switch due to the deletion of the path of the above backup network channel.
  • Step 322 the flow-level path management component 131 sends the path of the standby network channel to the flow-level policy management component 132 .
  • Step 323 the flow-level policy management component 132 sends a channel switching instruction to the policy enforcement component 142 .
  • the flow-level policy management component 132 can send a channel switching instruction to the policy enforcement component 142, wherein the channel switching instruction can be used to instruct policy execution
  • the component 142 switches the feature stream from the current main network channel to the standby network channel, so that the channel switching can be completed faster, the time delay caused by the channel switching can be reduced, and the user experience can be improved.
  • step 324 the policy enforcement component 142 performs channel switching.
  • the policy enforcement component 142 when the policy enforcement component 142 receives the channel switching instruction sent by the flow-level policy management component 132, it can switch the above-mentioned characteristic flow from the current main network channel to the standby network channel, that is, other flows of the above-mentioned network application It can continue to be carried and run on the main network channel, and the above feature stream can be carried and run on the backup network channel, so that the switching can be completed quickly, and the quality of services and user experience can be guaranteed.
  • the entire network application can be switched to the standby network channel, that is, the main network channel can be deactivated, and all streams of the network application can be carried on the standby network channel.
  • Fig. 1d is a schematic diagram of a mobile phone using a backup network channel. As shown in Figure 1d, when the mobile phone receives the channel switching instruction, it can switch the video stream from the current main network channel to the backup network channel, and can use the backup network channel to watch the video to avoid video jamming.
  • FIG. 12 is a sequence diagram of the interaction of components in the first device of the embodiment of the present application. As shown in FIG. 12, the method may include:
  • Step 1201 Start a network application in response to a user's operation.
  • step 301 For the implementation of this step, reference may be made to step 301, which will not be repeated here.
  • Step 1202 Perform stream transmission between the web application and the server.
  • the user selects a service in the network application, and the network application transmits the required flow between the service and the server according to the service.
  • the network application may use a network channel (for example, a main network channel) to transmit streams with the server.
  • a network channel for example, a main network channel
  • the streams required by this service may include video streams and audio streams, which can be carried on the above-mentioned main network channel.
  • the mobile phone can use the main network The channel interacts with the server, and obtains the video stream and audio stream from the server to play the video.
  • the embodiment of this application focuses on how to switch the network channel after the network application starts to use the main network channel to interact with the server, and how to start interacting with the server based on the use of the main network channel after the network application is initially started. Not limited.
  • Step 1203 The environment detection component 121 detects that the network application is switched to the foreground, and notifies the application-level policy management component 124 .
  • step 302 For the implementation of this step, reference may be made to the description in step 302, which will not be repeated here.
  • Step 1204 The application-level policy management component 124 judges whether the network application satisfies the condition for enabling acceleration.
  • step 303 For the implementation of this step, reference may be made to the description in step 303, and details are not repeated here.
  • data streams of network applications are classified according to types as an example, and one type corresponds to one stream of network applications.
  • one type corresponds to one stream of network applications.
  • Table 3 in addition to recording the network applications that need to be accelerated, the network application whitelist can also record:
  • the type of the target flow that needs to be monitored in each network application for example, as shown in the type field of the target flow in Table 3;
  • Network quality evaluation parameters used to evaluate the network quality of the target stream such as shown in the channel quality parameter field in Table 3 below;
  • the channel switching strategy for the flow of the network application after evaluating the network quality of the target flow is degraded, hereinafter referred to as the flow switching strategy; for example, as shown in the flow switching strategy field in Table 3 below.
  • the above-mentioned target flow may be a flow that can quickly be expressed on one or some network quality evaluation parameters when the quality of the network channel carrying the target flow deteriorates, for example, it may be a network application or a Multiple feature streams.
  • the network quality evaluation parameter of the target flow may be a parameter that can quickly reflect the deterioration of the network quality of the target flow.
  • the above flow switching policy records the flow that needs to switch the network channel together with the target flow.
  • the flow recorded in the flow switching policy is generally a flow that has a greater impact on business processing in the network application, such as the characteristics of the network application in the preceding description Streams, such as video streams and audio streams in video playback applications, game battle streams and voice streams in game applications.
  • the flow recorded in the flow switching policy that needs to switch network channels together with the target flow may be a flow that is sensitive to the same network evaluation parameters as the target flow, for example, the target flow is a delay-sensitive flow (hereinafter referred to as delay Sensitive flow), then the flow in the flow switching strategy is part or all of the delay-sensitive flow including the target flow in the network application; the target flow is a flow sensitive to the packet loss rate (hereinafter referred to as the packet loss rate sensitive flow), then The flow in the flow switching strategy is part or all of the packet loss rate-sensitive flow including the target flow in the network application.
  • delay Sensitive flow the target flow is a delay-sensitive flow
  • the target flow is a flow sensitive to the packet loss rate (hereinafter referred to as the packet loss rate sensitive flow)
  • the flow in the flow switching strategy is part or all of the packet loss rate-sensitive flow including the target flow in the network application.
  • the flow model corresponding to the above-mentioned target flow type is used to record the feature information of the message to be monitored in the target flow
  • the feature information may be at least one of the following feature information: the four-tuple of the message, Five-tuple, protocol number, string in payload, etc.
  • the network channel can be performed on multiple flows of the network application including this flow on the same network channel. Switching, so as to switch the above-mentioned multiple streams from the current network channel to other network channels with relatively better quality, so as to prevent the business of network applications from being stuck.
  • the network channel switching is performed on both the video stream and voice stream of WeChat, so that the video stream and voice stream are changed from the current
  • the network channel is switched to a network channel with relatively better quality to reduce the possibility of video and voice playback on WeChat.
  • Step 1205 The application-level policy management component 124 sends an acceleration start message to the flow-level path management component 131 .
  • the application-level policy management component 124 determines that the current network application meets the conditions for enabling acceleration, it can start the acceleration service for the network application, and send an acceleration start message to the flow-level path management component 131, and the acceleration start message uses In order to instruct the flow-level path management component 131 to start the acceleration service for the network application.
  • the above accelerated services may include but not limited to:
  • Monitor the network quality of several streams in the network application and when the electronic device monitors that the quality of a certain stream of the network application deteriorates, switch multiple streams of the network application, including the above-mentioned stream with degraded quality, to the backup network Channels, so that the above-mentioned multiple streams of network applications are always carried on network channels with relatively good quality, ensuring the transmission quality of streams, reducing the possibility of business freezes in network applications, and improving user experience.
  • the electronic device has enabled the standby network channel when the decision is made to switch multiple streams to the standby network channel, the multiple streams will be switched to the standby When the network channel is selected, if the electronic device does not enable the backup network channel, the electronic device needs to enable a backup network channel first, and then switch to the enabled backup network channel.
  • the acceleration start message may include information corresponding to the identity of the current network application in the network application whitelist, for example, it may include: the identity of the current network application, the target flow type, the flow model corresponding to the target flow type, and the network quality Evaluate parameter information, and stream switching policy information.
  • the identity of the current network application may include: the identity of the current network application, the target flow type, the flow model corresponding to the target flow type, and the network quality Evaluate parameter information, and stream switching policy information.
  • the path of the currently used network channel may be stored in the stream-level path management component 131, which is also the path of the network channel used by the network application; or, if the stream-level path management component 131 does not store the current The path of the network channel used, that is, the path of the network channel used by the network application is not stored in the flow-level path management component 131, then the flow-level path management component 131 can request the network channel used by the network application to the channel-level path management component 123 path, 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 stream-level path management component 131 sends the identity of the network application and the stream switching policy information to the stream-level policy management component 132, sends a traffic detection request to the traffic sensing component 133, and the traffic sensing component 133 sends a traffic report to the traffic reporting component ask.
  • the traffic detection request may include the first configuration file for the network application, and the first configuration file may include: the identity of the network application, the target flow type, the flow model corresponding to the target flow type, and network quality assessment parameters information etc.
  • the traffic report request may include a second configuration file for the network application, and the second configuration file may include: an identity of the network application, a target flow type, and a flow model corresponding to the target flow type.
  • the execution purpose of this step is 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. 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 here.
  • the traffic reporting component can be triggered to start monitoring the flow in the network application, and then trigger the subsequent network channel switching process for the flow.
  • Fig. 13 is another sequence diagram of the interaction of components in the first device of the embodiment of the present application. As shown in Fig. 13, the method may include:
  • Step 1301 The network status sensing component 122 detects that the WIFI channel is enabled.
  • the first device enters the WIFI network coverage area, successfully logs in WIFI through the historical login data, enables the WIFI channel, and the state of the WIFI channel is converted from the sleep state to the wake-up state; the network state perception component 122 monitors the state of the WIFI channel from the sleep state to the wake-up state , thus detecting that the WIFI channel is enabled.
  • Step 1302 The network state awareness component 122 sends a WIFI channel activation notification message to the channel-level path management component 123 .
  • the network state awareness component 122 After the network state awareness component 122 detects that the WIFI channel is enabled, it sends a WIFI channel activation notification message to the channel-level path management component 123.
  • the notification message may include: identification information and status information (for example, wake-up status) of the WIFI channel.
  • Step 1303 the channel-level path management component 123 sends a channel evaluation request to the channel and application quality evaluation component 125 .
  • the channel quality evaluation request is used to request the channel and quality evaluation component 125 to evaluate the quality of the newly enabled WIFI channel and the quality of the currently used cellular channel.
  • Step 1304 The channel and application quality evaluation component 125 evaluates the quality of the WIFI channel and the cellular channel, and sends the evaluation result to the channel-level path management component 123 .
  • the channel and application quality evaluation component 125 receives the channel evaluation request sent by the channel-level path management component 123, it can evaluate the quality of the WIFI channel and the cellular channel according to the channel evaluation request.
  • the quality of the network channel may be evaluated according to at least one of the following parameters of the network channel: channel delay, packet loss rate, bandwidth, and rate.
  • the above quality evaluation may be to evaluate the round-trip time delay (Round-Trip Time, RTT) of the available network channels, and the network channel with the smallest round-trip time delay is the best.
  • the WIFI channel and/or the cellular channel have a historical selection record, that is to say, the above-mentioned WIFI channel and/or the cellular channel have been selected as a network channel, at this time, the above-mentioned RTT and historical records can be used in conjunction with the WIFI
  • the channel quality of the channel and the cellular channel is evaluated, wherein the historical record may include the historical receiving rate, the historical number of times the channel quality is poor, etc.
  • the embodiment of the present application does not specifically limit the above channel quality evaluation method.
  • the assessment result may be sent to the channel-level path management component 123 .
  • step 316 For the implementation of this step, reference may also be made to the corresponding description in step 316, which will not be repeated here.
  • Step 1305 The channel-level path management component 123 sends a notification message to the stream-level path management component 131 .
  • the notification message is used to notify the stream-level path management component 131 that the WIFI channel has been enabled; the notification message may include: identification information of the WIFI channel, channel quality evaluation results of the WIFI channel, and channel quality evaluation results of the currently used cellular channel.
  • Step 1306 The flow-level path management component 131 sends a notification message to the traffic awareness component.
  • the notification message is used to instruct the flow sensing component to detect whether the packet is a delay sensitive flow.
  • a delay-sensitive flow means that the flow is sensitive to delay, that is, changes in delay have a greater impact on services using the flow.
  • Step 1307 The traffic reporting component 141 performs traffic detection, and reports the detected packets to the traffic sensing component 133 .
  • the traffic reporting component 141 can detect packets of the target flow of the network application according to the traffic reporting request, and report the detection result to the traffic sensing component 133 .
  • the foregoing detection results may include: packets of the target flow, or packets of the target flow and statistical information of packets of the target flow, and the like.
  • the above-mentioned traffic reporting component 141 can obtain the message of the target flow of the network application on the current network channel (eg, the main network channel) by calling a component (eg, the Netfilter component of the Android system).
  • a component eg, the Netfilter component of the Android system.
  • the above-mentioned Netfilter component is only an example, and does not constitute a limitation to the embodiment of the present application.
  • the detection of the above-mentioned packets can also be completed by other components.
  • the parameters of the above network channel can be implemented by the following code:
  • the above detected packets may be packets of one or more characteristic flows in the current network application, where the characteristic flow may be the most sensitive flow in the network application, that is, the flow that has a greater impact on the current network application big flow.
  • the quality of the network channel can be evaluated through the parameters of the above network channel.
  • the traffic reporting component 141 when it performs traffic detection, it may register a hook function in the kernel netfilter framework to obtain packets of the target flow.
  • the overall implementation block diagram is shown in Figure 14, for example. Netfilter hooks packets to the nf_hook hook function of the traffic reporting component, and the packets carried on the current network channel enter the traffic reporting component 141. According to the process of file content analysis and other processes, the packets of the target flow are stored in the SKB queue.
  • the data that needs to be reported regularly (packages, or packets and Statistical information) is triggered by a timer and reported to the flow-aware control 133, and the message that needs to be reported immediately is reported to the flow-aware control 133 by the thread of NetLink.
  • the traffic reporting component when the traffic reporting component detects the packets of the target stream, it may report all or part of the packets of the target stream to the traffic sensing component, which is not limited in this embodiment of the present application.
  • the so-called heartbeat flow message here may be a message that appears in the target flow according to a certain time interval, and preset feature information exists in a fixed position of the load of the heartbeat flow message.
  • the quintuple of the heartbeat flow packet may be the same as or different from the quintuple of other packets in the same flow.
  • the time interval of the heartbeat flow message in the embodiment of the present application is not limited in the embodiment of the present application, for example, it is 1s. Refer to FIG. 15, which is a schematic diagram of a heartbeat flow message with an interval of 1s.
  • the subsequent traffic sensing component 133 can calculate the round-trip delay according to the heartbeat flow message, and use the round-trip delay as a network quality evaluation parameter of the target flow to judge the network quality of the target flow.
  • the RTT calculation method of the heartbeat flow message is shown in FIG. 16 , and the specific description can be found in the above-mentioned related description, which will not be repeated here.
  • the specific implementation process of the message reporting component includes:
  • Step S1 initialization
  • the traffic reporting component 141 When the network application is started and loaded, the traffic reporting component 141 will receive the app launch message to register the nf_hook hook function. Code examples are shown in Figure 17a and Figure 17b.
  • Step S2 message processing
  • This step specifically includes three steps: packet parsing, flow table checking, and packet analysis.
  • the flow table records the identification information of the flow in each network application and the statistical information of each flow.
  • the statistical information of each flow may include: the number of received packets of the flow, the number of received packets of the flow The total number of bytes in the message, the number of error packets, etc.
  • the identification information of the flow can be calculated according to the five-tuple or four-tuple of the message in the flow. The above calculation can specifically use the hash algorithm, so that the identification information of the flow can be the hash calculated by the five-tuple or four-tuple of the message. value.
  • the traffic reporting component 141 obtains the message, and can analyze whether there is a UID of the network application in the message; quintuple), execute the follow-up step of checking the flow table; if it does not exist, it means that the message is not a network application message, and the process ends;
  • the above four-tuple may include: source IP, destination IP, source port, destination port; the five-tuple may include: source IP, destination IP, source port, destination port and protocol number.
  • the traffic reporting component 141 can filter the received packets through the preset flow model, so as to obtain all or part of the packets of the target flow. For example, if the flow model of the aforementioned heartbeat flow packets is used, the The heartbeat flow packet of the target flow.
  • the aforementioned flow model can be configured to the traffic reporting component through a configuration file, and the aforementioned configuration file can be carried in the traffic reporting request sent by the traffic sensing component in step 1206 .
  • the characteristics that packets need to match are recorded in the flow model.
  • the above-mentioned heartbeat stream message may have fixed characteristic information in the sixth byte of the message load, for example, the characteristic information in the uplink heartbeat stream message is 0x64, and the downlink heartbeat stream message If the characteristic information in is 0x65, the matching characteristic filterStr can be preset in the flow model, matching 0x64 in the upstream flow, matching 0x65 in the downstream flow, and the matching position is 6 bytes offset from the UDP payload.
  • the code logic can compare whether the message content is consistent with the configured matching feature filterStr through memcmp.
  • Step S3 report the matched target flow and the statistical information of the target flow according to the flow reporting policy.
  • the filtered packets of the target flow can be stored in the SKB queue, and reported periodically or immediately according to the reporting policy of the target flow.
  • packet statistical information for example, the number of packets, the number of bytes, etc.
  • packet statistical information for example, the number of packets, the number of bytes, etc.
  • the matched packets can be directly reported to the flow sensing component.
  • the packets of the target flow can be precisely matched and filtered in the traffic reporting component, and the reported packets can be used in the traffic sensing component to evaluate the network quality.
  • Step 1308 The traffic sensing component 133 detects the delay sensitive flow, if yes, execute step 1309, if not, execute step 1314.
  • the characteristic information of packets of different delay-sensitive flows of different applications can be summarized in advance, including but not limited to: protocol type (TCP/UDP), port number, data packet transmission characteristics (size, number, transmission rate, etc. ), specific strings in packets, etc.
  • the feature information of the delay-sensitive flow of the current application may be delivered to the traffic sensing component 133 .
  • the traffic sensing component can perform feature information matching or statistical verification on the packets reported by the traffic reporting component 141 according to the packet feature information of the currently applied delay-sensitive flow, so as to determine the current traffic carried on the currently used cellular channel.
  • the several streams of the application are delay-sensitive streams or delay-insensitive streams.
  • the message of a delay-sensitive flow includes the following feature information: the protocol type of the message, the port number, the data packet containing a specific character string, and the data packet transmission characteristics;
  • the packet is followed by protocol type matching, port number matching, whether the data packet contains a specific string, specific string matching, and data packet transmission characteristics matching.
  • the flow to which the message belongs is Delay-sensitive flow, otherwise non-delay-sensitive flow.
  • the code example is shown in Figure 21.
  • the traffic sensing component 133 may detect the delay-sensitive flow according to the protocol type of the packet and the number of packets.
  • the Game battle flow in the Peace Elite transmits more than 10 UDP packets in each 500ms cycle, and the traffic perception component 133 can count the UDP of each flow received in each cycle in several cycles The number of packets. If the number of UDP packets in a stream is greater than the preset number threshold (for example, 10), it is judged that the stream is a game battle stream, otherwise it is not a game battle stream.
  • the preset number threshold for example, 10
  • the above-mentioned delay-sensitive streams take game battle streams as an example, and may also be video call streams, audio call streams, etc. in communication applications; non-delay-sensitive streams may be download streams, browsing streams, etc., for example.
  • Step 1309 The traffic awareness component 133 indicates to the flow-level path management component 131 that the flow type of flow A is a delay-sensitive flow.
  • Step 1310 The stream-level path management component 131 judges whether the currently used cellular channel meets the transmission requirements of stream A. If so, stream A continues to be carried on the cellular channel, and this branch process ends; if not, execute step 1311.
  • the channel-level path management component 123 has sent the evaluation result of the cellular channel to the flow-level path management component 131 through a notification message, and the flow-level path management component 131 can judge whether the cellular channel is Meet the transmission requirements of stream A.
  • the flow-level path management component 131 can determine whether the delay of the cellular channel is less than a preset threshold, and if it is less, then determine that the cellular channel meets the transmission requirements of flow A; otherwise, determine that the cellular channel does not meet The transmission requirements of stream A.
  • the stream-level path management component decides that stream A continues to be carried on the cellular channel, so as to ensure the transmission quality of stream A and prevent the channel switching of stream A from cellular channel to WIFI channel
  • the delay affects the transmission quality of stream A, thereby preventing service execution from stalling and improving user experience.
  • Step 1311 the flow-level path management component 131 sends a channel switching instruction to the flow-level policy management component 132 .
  • the flow-level path management component judges that the currently used cellular channel does not meet the transmission requirements of flow A, and then sends a channel switching instruction to the flow-level policy management component 132, which is used to instruct the flow-level policy management component 132 to transfer the flow ASwitch to the WIFI channel.
  • Step 1312 the flow-level policy management component 132 sends a channel switching instruction to the policy enforcement component 142.
  • the channel switching instruction sent by the flow-level policy management component 132 is used to instruct the policy execution component 142 to switch the network channel of flow A to the WIFI channel.
  • Step 1313 The policy enforcement component 142 performs channel switching.
  • the policy execution component 142 switches the network channel of flow A to the WIFI channel in response to the received channel switching instruction.
  • Step 1314 The flow perception component 133 indicates to the flow level path management component 131 that the flow type of flow A is a non-delay sensitive flow.
  • Step 1315 The stream-level path management component 131 judges whether the WIFI channel meets the transmission requirements of stream A. If not, stream A continues to be carried on the cellular channel, and this branch process ends; if so, execute step 1316.
  • Step 1316 The flow-level path management component 131 sends a channel switching instruction to the flow-level policy management component 132 .
  • the flow-level path management component determines that the WIFI channel meets the transmission requirements of flow A, and sends a channel switching instruction to the flow-level policy management component 132, and the channel switching instruction is used to instruct the flow-level policy management component 132 to switch flow A to the WIFI channel .
  • Step 1317 the flow-level policy management component 132 sends a channel switching instruction to the policy enforcement component 142.
  • the channel switching instruction sent by the flow-level policy management component 132 is used to instruct the policy execution component 142 to switch the network channel of flow A to the WIFI channel.
  • the flow-level policy management component 132 may also switch other non-delay-sensitive flows of the current network application carried on the network channel to the WIFI channel.
  • Step 1318 The policy enforcement component 142 performs channel switching.
  • the policy execution component 142 switches the network channel of flow A to the WIFI channel in response to the received channel switching instruction.
  • the above-mentioned scene of using the first device to conduct game battles is only an example and does not constitute a limitation to the embodiment of the present application.
  • it may also include using the first device to conduct audio and video calls, live broadcast Business scenarios that are less tolerant to freezes and more sensitive to latency.
  • the flow that has a greater impact on the business operation of the network application will not be switched to the newly enabled network channel, thereby reducing the network traffic of the above-mentioned flow.
  • Channel switching thereby reducing the problem of business running stalls caused by the network channel switching of the above-mentioned streams, and improving user experience.
  • the embodiment of the present application also provides an electronic device, 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 The device is connected to the non-volatile storage medium, and executes the computer-executable program to implement the method provided in any one of the embodiments shown in FIG. 7 to FIG. 14 of the present application.
  • An embodiment of the present application also provides an electronic device, including: one or more processors; memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory, and the one One or more computer programs include instructions, and when the instructions are executed by the device, the device is made to execute the method provided by any one of the embodiments in FIG. 7 to FIG. 14 .
  • the embodiment of the present application also provides a computer-readable storage medium, the computer-readable storage medium stores a computer program, and when it is run on a computer, the computer executes the program provided by any one of the embodiments in Fig. 7 to Fig. 14 of the present application. method.
  • the embodiment of the present application also provides a computer program product, the computer program product includes a computer program, and when it is run on a computer, it causes the computer to execute the method provided in any one of the embodiments in FIG. 7 to FIG. 14 of the present application.
  • the above-mentioned electronic devices include corresponding hardware structures and/or software modules for performing each function.
  • the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software in combination with the example units and algorithm steps described in the embodiments disclosed herein. Whether a certain function is executed by hardware or computer software drives hardware depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the embodiments of the present application.
  • the embodiment of the present application may divide the above-mentioned electronic equipment into functional modules according to the above-mentioned method examples.
  • each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module.
  • the above-mentioned integrated modules can be implemented in the form of hardware or in the form of software function modules. It should be noted that the division of modules in the embodiment of the present application is schematic, and is only a logical function division, and there may be other division methods in actual implementation.
  • Each functional unit in each embodiment of the embodiment of the present application may be integrated into one processing unit, or each unit may physically exist separately, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
  • the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium.
  • the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage
  • the medium includes several instructions to enable a computer device (which may be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage medium includes: flash memory, mobile hard disk, read-only memory, random access memory, magnetic disk or optical disk, and other various media capable of storing program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Human Computer Interaction (AREA)
  • Quality & Reliability (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Telephone Function (AREA)

Abstract

一种通道切换方法、电子设备及存储介质,电子设备包括第一网络通道和第二网络通道,第二网络通道的使用优先级高于第一网络通道的使用优先级;方法包括:启动第一应用,第一应用包括第一数据流,第一数据流承载在第一网络通道上;在检测到第二网络通道被启用时,且检测到第一数据流是预设类型的数据流时,保持第一数据流承载在第一网络通道上不变;在检测到第二网络通道被启用、且检测到第一数据流不是预设类型的数据流时,将承载第一数据流的网络通道切换为第二网络通道。本申请能够减少因为网络通道切换导致的业务运行的卡顿问题,提高用户的体验。

Description

通道切换方法、电子设备及存储介质 技术领域
本申请涉及通信技术领域,尤其涉及一种通道切换方法、电子设备及存储介质。
背景技术
随着电子技术及互联网技术的快速发展,手机等移动设备在人们日常生活中的应用越来越广,例如,可以通过手机进行移动支付及游戏等。为了保证常用业务(例如,游戏,通话、社交软件等业务)的正常运行,通常用户的手机都会连接无线网络。然而,在网络环境发生变化时,应用的流在不同网络通道之间切换,如果网络通道的切换速度较慢,切换过程中会导致业务运行的卡顿,降低用户的体验。
发明内容
本申请提供了一种通道切换方法、电子设备及存储介质,能够减少因为网络通道切换导致的业务运行的卡顿问题,提高用户的体验。
第一方面,本申请实施例提供一种通道切换方法,应用于电子设备,所述电子设备包括第一网络通道和第二网络通道,所述第二网络通道的使用优先级高于所述第一网络通道的使用优先级;所述方法包括:启动第一应用,所述第一应用包括第一数据流,所述第一数据流承载在所述第一网络通道上;在检测到所述第二网络通道被启用,且检测到所述第一数据流是预设类型的数据流时,保持所述第一数据流承载在所述第一网络通道上不变。该方法中,在检测到所述第二网络通道被启用,且检测到所述第一数据流是预设类型的数据流时,保持所述第一数据流承载在所述第一网络通道上不变,而不将第一数据流切换至使用优先级更高的第二网络通道,从而减少了第一数据流的网络通道切换,进而减少由于第一数据流网络通道切换可能引起的业务运行的卡顿问题,提升用户体验。
在一种可能的实现方式中,还包括:在检测到所述第二网络通道被启用、且检测到所述第一数据流不是预设类型的数据流时,将承载所述第一数据流的网络通道切换为所述第二网络通道。
在一种可能的实现方式中,所述保持所述第一数据流承载在所述第一网络通道上不变之前,还包括:确定所述第一网络通道的网络质量满足所述第一数据流的传输需求。该方法中,在确定所述第一网络通道的网络质量满足所述第一数据流的传输需求时,保持所述第一数据流承载在所述第一网络通道上不变,而不将第一数据流切换至使用优先级更高的第二网络通道,从而在保证第一数据流不切换网络通道 不会影响业务运行的情况下,减少第一数据流的网络通道切换,进而减少由于第一数据流网络通道切换可能引起的业务运行的卡顿问题,提升用户体验。
在一种可能的实现方式中,还包括:确定被启用的所述第一网络通道的网络质量不满足所述第一数据流的传输需求,将承载所述第一数据流的网络通道切换为所述第二网络通道。该方法中,确定被启用的所述第一网络通道的网络质量不满足所述第一数据流的传输需求,将承载所述第一数据流的网络通道切换为所述第二网络通道,从而减少由于第一数据流的网络通道质量变差导致的业务运行卡顿问题,提升用户体验。
在一种可能的实现方式中,将承载所述第一数据流的网络通道切换为所述第二网络通道之前,还包括:确定被启用的所述第二网络通道的网络质量满足所述第一数据流的传输需求。该方法中,确定被启用的所述第二网络通道的网络质量满足所述第一数据流的传输需求,而且第一数据流不是预设类型的数据流时,才将第一数据量切换至第二网络通道,从而在保证第一数据流切换后的网络质量的情况下,进行网络通道的切换,提升用户体验。
在一种可能的实现方式中,还包括:确定被启用的所述第二网络通道的网络质量不满足所述第一数据流的传输需求,保持所述第一数据流承载在所述第一网络通道上不变。该方法中,确定被启用的所述第二网络通道的网络质量不满足所述第一数据流的传输需求,保持所述第一数据流承载在所述第一网络通道上不变,从而保证不是预设类型的第一数据流的网络质量,防止第一数据流切换至第二网络通道后网络质量变差,从而提升用户体验。
在一种可能的实现方式中,根据以下至少一个参数检测所述第一数据流是否是预设类型的数据流:协议类型、端口号、报文传输特征、报文中特定字符串;所述报文传输特征包括以下至少一个特征:报文大小、预设时长内报文个数、报文的传输速度。
在一种可能的实现方式中,所述预设类型是时延敏感流,类型为所述时延敏感流的数据流对时延敏感。
在一种可能的实现方式中,所述启动第一应用之后,检测到所述第一数据流是预设类型的数据流或者检测到所述第一数据流不是预设类型的数据流之前,还包括:从所述第一网络通道承载的报文中获取所述第一应用的报文;从所述第一应用的报文中获取所述第一数据流的报文。
在一种可能的实现方式中,保持所述第一数据流承载在所述第一网络通道上不变之后,还包括:检测到所述第一网络通道上承载的所述第一数据流传输结束,且所述第一网络通道上未承载数据流,关闭所述第一网络通道。
在一种可能的实现方式中,检测到所述第二网络通道被启用之前,还包括:确定所述第一应用是预设白名单中的应用。
在一种可能的实现方式中,所述第一网络通道是蜂窝通道,所述第二网络通道是WIFI通道;或者,所述第一网络通道是辅WIFI通道,所述第二网络通道是主WIFI通道。
第二方面,本申请实施例提供一种电子设备,包括:
存储器,上述存储器用于存储计算机程序代码,上述计算机程序代码包括指令,上述电子设备具有多个网络通道,上述电子设备上运行有第一应用,上述第一应用承载于第一网络通道,上述第一应用包括多个报文流,当上述电子设备从上述存储器中读取上述指令,以使得上述电子设备执行第一方面任一项所述的方法。
第三方面,本申请实施例提供一种计算机可读存储介质,该计算机可读存储介质中存储有计算机程序,当其在计算机上运行时,使得计算机执行第一方面任一项所述的方法。
第四方面,本申请实施例提供一种计算机程序,当上述计算机程序被计算机执行时,用于执行第一方面任一项所述的方法。
在一种可能的设计中,第四方面中的程序可以全部或者部分存储在与处理器封装在一起的存储介质上,也可以部分或者全部存储在不与处理器封装在一起的存储器上。
附图说明
为了更清楚地说明本发明实施例的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。
图1a为本申请实施例提供的手机桌面显示示意图;
图1b为本申请实施例提供的应用界面示意图;
图1c为本申请实施例提供的手机使用主网络通道的应用界面示意图;
图1d为本申请实施例提供的手机使用备用网络通道的应用界面示意图;
图1e为本申请实施例提供的手机启用WIFI通道但仍然使用蜂窝通道的应用界面示意图;
图2和图3为游戏界面示意图;
图4为本申请实施例提供的电子设备的硬件结构示意图;
图5为本申请实施例提供的电子设备的软件架构示意图;
图6为本申请实施例提供的电子设备的另一种软件架构示意图;
图7为本申请提供的通道切换方法一个实施例的流程示意图;
图8为本申请实施例提供的心跳流报文结构示意图;
图9为本申请实施例提供的对战流报文统计示意图;
图10为本申请实施例提供的对战流报文结构示意图;
图11a-图11c为本申请实施例提供的流切换示意图;
图11d为本申请实施例提供的敏感类业务切换流程交互示意图;
图11e为本申请实施例提供的非敏感类业务切换流程交互示意图;
图12为本申请实施例电子设备组件之间的一种交互时序图;
图13为本申请实施例电子设备组件之间的另一种交互时序图;
图14为本申请实施例流量上报组件的实现原理示意图;
图15为本申请实施例间隔为1s的心跳流报文示意图;
图16为心跳流报文的往返时延计算方法示意图;
图17a为本申请实施例注册钩子函数的代码实现示意图;
图17b为本申请实施例注册钩子函数的代码实现示意图;
图18为本申请实施例匹配特征的代码实现示意图;
图19为本申请实施例报文过滤的代码实现示意图;
图20为本申请实施例时延敏感流的检测方法的代码实现示意图;
图21为本申请实施例游戏对战流的代码实现示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。其中,在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。
以下,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本申请实施例的描述中,除非另有说明,“多个”的含义是两个或两个以上。
首先对本申请实施例涉及的名词进行示例性而非限定性的说明。
WIFI网卡是支持通过无线局域网(Wireless Local Area Network,WLAN)方式上网的装置。
数据业务网卡是支持通过通用分组无线服务(General packet radio service,GPRS)、增强型数据速率GSM演进技术(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)、第五代移动通信技术(5th Generation Mobile Communication Technology,5G)等移动通信技术上网的装置。
网络通道是指网络中两个或两个以上节点间的任何路由,或网络中一个源地址到一个目的地址的路由。
本申请实施例中电子设备的网络通道是指通过使用上述WIFI网卡或者数据业务网卡等上网的装置与其他电子设备例如服务器之间建立的路由。本申请实施例中,将使用WIFI网卡建立的网络通道,称为WIFI通道,将使用数据业务网卡建立的网络通道称为蜂窝通道。
电子设备中可以预先配置多条网络通道,示例性的,该多条网络通道可以包括主WIFI通道、辅WIFI通道、主蜂窝通道及辅蜂窝通道,其中,上述主WIFI通道 和辅WIFI通道可以工作在2.4GHz频段或5GHz频段,示例性的,若主WIFI通道工作在2.4GHz频段,则辅WIFI通道工作在5GHz频段;若主WIFI通道工作在5GHz频段,则辅WIFI通道工作在2.4GHz频段。此外,主蜂窝通道和辅蜂窝通道可以和运营商网络对应,例如,主蜂窝通道可以使用sim卡1(该sim卡1归属于运营商A),辅蜂窝通道可以使用sim卡2(该sim卡2归属于运营商B)。在通常情况下,主WIFI通道的优先级高于其余三条通道,因此,主网络通道通常为主WIFI通道。在通常情况下,考虑电子设备的数据流量消耗,WIFI通道的优先级高于蜂窝通道的优先级。可以理解的是,上述预置通道仅是示例性说明,并不构成对本申请实施例的限定,在一些实施例中,还可以包括更多或更少的通道。此外,将主WIFI通道作为主网络通道也只是优选方案,并不构成对本申请实施例的限定,在一些实施例中,也可以选取其他网络通道作为主网络通道。
随着电子技术及互联网技术的快速发展,手机等移动设备在人们的日常生活中的应用越来越广,例如,可以通过手机进行移动支付及游戏等。为了保证常用业务(例如,游戏,通话、社交软件等业务)的正常运行,通常用户的手机都会连接无线网络。然而,在某些场景下,当前的无线网络不足以满足业务的需求(例如,手机信号变差等情况),会导致业务运行的卡顿,由此可能降低用户的体验。
一种可能的原因是:在网络环境发生变化时,应用的流在不同网络通道之间切换。以手机为例,假设手机中无线局域网的开关开启,蜂窝移动网络的开关开启,手机未处于已知的WIFI网络中,则手机未启用WIFI通道,使用蜂窝通道传输位于前台的网络应用(也即用户当前正在使用的网络应用)的数据流。此时,如果手机进入具有历史使用信息的WIFI网络中,手机会自动连接WIFI网络,启用WIFI通道,WIFI通道的优先级高于蜂窝通道的优先级,默认网络通道从蜂窝通道变为WIFI通道,将上述网络应用的流从当前使用的蜂窝通道切换为WIFI通道,这一切换过程如果速度较慢可能会引起网络应用的业务运行的卡顿,降低用户的体验。尤其是对时延敏感的业务,例如游戏对战、视频通话、观看直播等,网络通道的切换更容易引起业务运行的卡顿,且该卡顿更容易影响用户的体验。
为此,本申请实施例提供一种通道切换方法,能够减少网络环境变化场景下业务运行的卡顿问题,提升用户体验。
本申请实施例通道切换方法,电子设备在检测到网络环境变化、自动启用新的网络通道(例如,WIFI通道)的情况下,如果新启用的网络通道的优先级高于当前使用的网络通道(例如,蜂窝通道)的优先级,对于当前网络应用在当前使用的网络通道(例如蜂窝通道)上承载的各条流,不直接将各条流的网络通道切换至新启用的网络通道,而是考虑当前使用的网络通道和新启用的网络通道的网络质量,和/或,考虑当前网络应用的各条流对网络应用中业务运行的影响,来决定各条流是否进行网络通道的切换。
可选地,可以依照对网络应用中业务运行的影响大小,将网络应用的各条流划分 为对于网络应用的业务运行影响相对较大的流、和对于网络应用的业务运行影响相对较小的流。对于不同的网络应用可能有不同的具体划分方法,本申请实施例不限定。举例来说,对于游戏应用,游戏对战流一般是对于游戏应用的业务运行影响相对较大的流,而游戏大厅等界面数据流一般是对于游戏应用的业务运行影响相对较小的流;对于视频播放应用,视频流和音频流一般是对于视频播放应用的业务运行影响相对较大的流,而视频列表界面等界面数据流一般是对于视频播放应用的业务运行影响相对较小的流。
可选地,网络应用中对于网络应用的业务运行影响相对较大的流可以是对时延和/或丢包率等网络质量参数敏感的流。
在一种可能的实现方式中,考虑当前网络应用的各条流对网络应用中业务运行的影响,来决定各条流是否进行网络通道的切换。具体的,对于网络应用的业务运行影响相对较大的流,可以保持其继续承载在当前使用的网络通道上,不切换至新启用的网络通道;对于网络应用的业务运行影响相对较小的流,可以将其切换至新启用的网络通道。
在另一种可能的实现方式中,上述实现方式还可以进一步结合当前使用的网络通道和新启用的网络通道的网络质量来决定各条流是否进行网络通道的切换。可选地,对于网络应用的业务运行影响相对较大的流,如果当前使用的网络通道的网络质量满足该流的传输需求,可以保持其继续承载在当前使用的网络通道上,不切换至新启用的网络通道,如果当前使用的网络通道的网络质量不满足该流的传输需求,将其切换至新启用的网络通道;对于网络应用的业务运行影响相对较小的流,如果新启用的网络通道的网络质量满足该流的传输需求,可以将其切换至新启用的网络通道,如果新启用的网络通道的网络质量不满足该流的传输需求,可以保持其继续承载在当前使用的网络通道上,不切换至新启用的网络通道。
通过以上方法,可以减少对于网络应用的业务运行影响相对较大的流的网络通道切换,进而可以减少由于网络通道切换引起的业务运行的卡顿问题,提升用户体验。
通过图1a~图3对本申请实施例通道切换方法的适用场景进行举例说明。
以第一设备是手机、预设类型的流是时延敏感流为例。图1a为手机桌面示意图。如图1a所示,用户可以在手机桌面点击视频应用图标,以打开一个视频应用,由此可以得到如图1b所示的视频显示示意图。
图1c为手机使用主网络通道(例如蜂窝通道1)后的效果示意图。如图1c所示,手机所在环境中不存在WIFI网络,手机为视频应用启用蜂窝通道,当手机获取到蜂窝通道的路径后,可以使用蜂窝通道进行视频的观看。
可以理解的是,当前的网络应用(例如,图1c中的视频应用)可以包括多个流(例如,视频流及音频流),该多个流可以承载在上述蜂窝通道上。
图1d为手机使用备用网络通道(例如,蜂窝通道2)的示意图。当手机接收到通道切换指示后,可以将语音流和视频流由当前的主网络通道切换至备用网络通道,并可以使用备用网络通道进行视频的观看,以避免视频的卡顿。
图1e为手机使用WIFI通道的示意图。如图1e所示,当手机所处环境发生变化, 进入WIFI网络覆盖范围,手机检测到具有该WIFI网络的历史登录记录,登录WIFI网络,启用WIFI通道,默认网络通道转换为WIFI通道,但是,手机检测到视频应用的视频流及音频流为时延敏感流,不将视频流及音频流切换至WIFI通道,直到视频流及音频流的传输结束,以避免视频的卡顿;
在启用WIFI通道后,如果需要开始传输新的时延敏感流,将时延敏感流承载在WIFI通道上,例如,在启用WIFI通道后,用户选择播放另一个视频,可以将该视频的视频流和音频流承载在WIFI通道上。
图2和图3为游戏界面示意图。如图2所示,手机的游戏界面为游戏对战界面,手机未启用WIFI通道,仅启用蜂窝通道,此时默认网络通道是蜂窝通道,游戏对战流承载在手机的蜂窝通道上;手机所处环境发生变化,进入WIFI网络覆盖范围,手机检测到具有该WIFI网络的历史登录记录,登录WIFI网络,启用WIFI通道,默认网络通道转换为WIFI通道,但是,手机检测到游戏对战流为时延敏感流,虽然默认网络通道转换为WIFI通道,仍然将游戏对战流承载在蜂窝通道上,避免游戏团战时,发生卡顿。
如图3所示,手机的游戏界面为游戏大厅,手机未启用WIFI通道,仅启用蜂窝通道,此时默认网络通道是蜂窝通道,游戏应用需要传输的流为界面数据流,界面数据流承载在手机的蜂窝通道上;手机所处环境发生变化,进入WIFI网络覆盖范围,手机检测到具有该WIFI网络的历史登录记录,登录WIFI网络,启用WIFI通道,默认网络通道转换为WIFI通道,手机检测到界面数据流为非时延敏感流,考虑WIFI通道的状态,将界面数据流切换到WIFI通道上,以节省手机的数据流量消耗。
上述通道切换方法可以应用于第一设备。其中,第一设备可以是移动终端、终端设备、用户设备(User Equipment,UE)、接入终端、用户单元、用户站、移动站、移动台、远方站、远程终端、移动设备、用户终端、终端、无线通信设备、用户代理或用户装置。第一设备可以是WLAN中的站点(STAION,ST),可以是蜂窝电话、无绳电话、会话启动协议(Session Initiation Protocol,SIP)电话、无线本地环路(Wireless Local Loop,WLL)站、个人数字处理(Personal Digital Assistant,PDA)设备、具有无线通信功能的手持设备、计算设备或连接到无线调制解调器的其它处理设备、车载设备、车联网终端、电脑、膝上型计算机、手持式通信设备、手持式计算设备、卫星无线设备、无线调制解调器卡、电视机顶盒(Set Top Box,STB)、用户驻地设备(Customer Premise Equipment,CPE)和/或用于在无线系统上进行通信的其它设备以及下一代通信系统,例如,5G网络中的移动终端或者未来演进的公共陆地移动网络(Public Land Mobile Network,PLMN)网络中的移动终端等。该第一设备还可以是可穿戴设备。可穿戴设备也可以称为穿戴式智能设备,是应用穿戴式技术对日常穿戴进行智能化设计、开发出可以穿戴的设备的总称,如眼镜、手套、手表、服饰及鞋等。可穿戴设备即直接穿在身上,或是整合到用户的衣服或配件的一种便携式设备。可穿戴设备不仅仅是一种硬件设备,更是通过软件支持以及数据交互、云端交互来实现强大的功能。广义穿戴式智能设备包括功能全、尺寸大、可 不依赖智能手机实现完整或者部分的功能,如智能手表或智能眼镜等,以及只专注于某一类应用功能,需要和其它设备如智能手机配合使用,如各类进行体征监测的智能手环、智能首饰等。
可以理解的是,上述使用第一设备打联网游戏的场景仅为示例性说明,并不够成对本申请实施例的限定,在一些实施例中,还可以包括使用第一设备听网络音乐、观看视频等场景。
下面首先介绍本申请以下实施例中提供的示例性电子设备。图4示出了电子设备100的结构示意图,该电子设备100可以是上述第一设备。
电子设备100可以包括处理器110,外部存储器接口120B,内部存储器120A,通用串行总线(universal serial bus,USB)接口130,充电管理模块140A,电源管理模块140B,电池140C,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。
可以理解的是,本申请实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。其中,控制器可以是电子设备100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。
本申请实施例提供的截屏方法的执行可以由处理器110来控制或调用其他部件来完成,比如调用内部存储器120A中存储的本申请实施例的处理程序,以实现用户的截屏操作,提升用户的体验。
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。
USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为电子设备100充电,也可以用于电子设备100与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其它电子设备,例如AR设备等。
可以理解的是,本申请实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备100的结构限定。在本申请另一些实施例中,电子设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。
天线1和天线2用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块150或其它功能模块设置在同一个器件中。
无线通信模块160可以提供应用在电子设备100上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency  modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。
在一些实施例中,电子设备100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得电子设备100可以通过无线通信技术与网络以及其它设备通信。所述无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(code division multiple access,CDMA),宽带码分多址(wideband code division multiple access,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),BT,GNSS,WLAN,NFC,FM,和/或IR技术等。所述GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidou navigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellite system,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。
电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的正整数。
电子设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物 半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,电子设备100可以包括1个或N个摄像头193,N为大于1的正整数。
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其它数字信号。例如,当电子设备100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。
视频编解码器用于对数字视频压缩或解压缩。电子设备100可以支持一种或多种视频编解码器。这样,电子设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备100的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。
外部存储器接口120B可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120B与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。
内部存储器120A可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。内部存储器120A可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器120A可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。处理器110通过运行存储在内部存储器120A的指令,和/或存储在设置于处理器中的存储器的指令,执行电子设备100的各种功能应用以及数据处理。
电子设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。
触摸传感器180K,也称“触控面板”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于电子设备100的表面,与显示屏194所处的位置不同。
本申请实施例中,通过该触摸传感器180K可以获取用户的触屏数据,并可以将该触屏数据发送至处理器110进行处理。
按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。电子设备100可以接收按键输入,产生与电子设备100的用户设置以及功能控制有关的键信号输入。
马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振动反馈。例如,作用于不同应用(例如拍照,音频播放等)的触摸操作,可以对应不同的振动反馈效果。作用于显示屏194不同区域的触摸操作,马达191也可对应不同的振动反馈效果。不同的应用场景(例如:时间提醒,接收信息,闹钟,游戏等)也可以对应不同的振动反馈效果。触摸振动反馈效果还可以支持自定义。
指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。
SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和电子设备100的接触和分离。电子设备100可以支持1个或N个SIM卡接口,N为大于1的正整数。SIM卡接口195可以支持Nano SIM卡,Micro SIM卡,SIM卡等。同一个SIM卡接口195可以同时插入多张卡。所述多张卡的类型可以相同,也可以不同。SIM卡接口195也可以兼容不同类型的SIM卡。SIM卡接口195也可以兼容外部存储卡。电子设备100通过SIM卡和网络交互,实现通话以及数据通信等功能。在一些实施例中,电子设备100采用eSIM,即:嵌入式SIM卡。eSIM卡可以嵌在电子设备100中,不能和电子设备100分离。
接着,对上述第一设备的系统框架图进行说明。如图5所示,第一设备10包括应用层11、服务层12、策略层13及内核层14。其中,
应用层11可以用于提供多种网络应用,上述网络应用可以是第三方应用,也可以是系统应用,例如,游戏、音乐、视频等网络应用。本申请对上述应用层11提供的网络应用的类型不做特殊限定。这里的网络应用是指需要使用第一设备10的网络通道从网络上获取资源的应用。
服务层12可以包括环境探测组件121、网络探测组件122、通道级路径管理组件123、应用级策略管理组件124及通道及应用质量评估组件125。其中,环境探测组件121可以用于对应用的状态进行探测,例如上述应用的状态可以包括应用退出、应用打开、应用运行、应用安装及应用卸载等状态,可以理解的是,上述状态仅为示例性说明,还可以包括更多的状态,在此不再赘述。网络探测组件122可以用于探测网络通道的开启状态。通道级路径管理组件123可以用于负责请求/关闭网络通道,感知网络通道的状态变化,更新网络通道的选取策略,还可以用于存储多条网络通道的路径。应用级策略管理组件124可以基于输入信息生成不同的执行策略,示例性的,该策略可以是启用网络通道的加速功能,也可以是启动流量感知(例如,对网络通道的流量进行探测)等。通道及应用质量评估组件125可以用于评估网络通道的质量。服务层12还可以包括:网络连接管理组件126,用于启用网络通道,也即将网络通道从休眠状态转换为唤醒状态,在唤醒状态下网络通道可以直接被使用。
策略层13可以包括流级路径管理组件131、流级策略管理组件132及流量感知组件133。其中,流级路径管理组件131可以用于根据上层的策略变化更新网络通道的选取,触发网络通道质量探测,动态选取最优通道,还可以用于存储不同的网络通道的路径,示例性的,可以存储应用当前使用的网络通道(例如,主网络通道)及备用网络通道的路径。流级策略管理组件132可以用于指示网络通道的切换,还可以用于存储网络应用中流的网络通道切换策略。流量感知组件133可以用于对上报的流量进行统计,评估各条流的网络质量。
内核层14可以包括流量上报组件141及策略执行组件142。其中,流量上报组件141可以用于对流量信息的收集及上报。策略执行组件142可以用于执行网络通道的切换。
可以理解的是,本申请实施例示意的各组件间的接口连接关系,只是示意性说明,并不构成对第一设备的结构限定。在本申请另一些实施例中,第一设备也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
以上图5所示的系统框架仅用于说明第一设备的分层架构的实现。图5所示系统架构还可以作为已有的分层软件架构的一部分实现。以安卓(Android)系统为例,图6所示为本申请实施例提供的一种Android系统的电子设备的软件结构框图。分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在图6所示的本申请实施例中,将Android系统分为五层,从上至下分别为应用程序层、应用程序框架层(也称:系统框架层)、系统库和安卓运行时层、硬件抽象层(hardware abstraction layer,HAL)和内核层。
应用程序层包括若干个应用程序(下文简称为应用),例如相机,图库,日历,WLAN等。在一种可能的实例中,图5所示系统架构中的应用层可以与该应用程序层对应。图6所示电子设备的应用程序层可以包括本申请实施例所述的网络应用,例如视频播放应用、游戏应用等。
应用程序框架层为应用程序层的应用提供应用编程接口(Application Programming Interface,API)和编程框架,包括各种组件和服务来支持开发者的安卓开发。应用程序框架层还包括一些预先定义的函数。例如应用程序框架层可包括窗口管理器、内容提供器、资源管理器、摄像头服务等。在一种可能的实例中,图5所示系统架构中的服务层和策略层可以位于应用程序框架层。
系统库和安卓运行时层包括系统库和安卓运行时(Android Runtime)。系统库可以包括多个功能模块。例如:表面管理器、二维图形引擎、三维图形处理库(例如:OpenGL ES),媒体库、字体库等。
HAL层为位于操作系统内核与硬件电路之间的接口层。HAL层包括但不限于:音频硬件抽象层(Audio HAL)和摄像头硬件抽象层(Camera HAL)。
内核层是硬件和软件之间的层。内核层可以包括:显示驱动,摄像头驱动,音频驱动,传感器驱动等。在一种可能的实例中,图5所示系统架构中的内核层可以对应图6所示软件架构中的内核层,此时,如图6所示,内核层可以包括:流量上 报组件及策略执行组件。
以下结合上述图4~图6所示的第一设备对本申请实施例通道切换方法进行示例性说明。
图7为本申请实施例提供的通道切换方法一个实施例的流程示意图,包括:
步骤301,响应于用户的操作,启动网络应用。
具体地,用户可以在第一设备中进行打开操作,以打开一个网络应用。示例性的,用户可以在第一设备中点击网络应用的图标。响应于用户的操作,第一设备中的应用层11启动网络应用。可以理解的是,上述示例仅示例性的示出了通过点击方式启动网络应用的场景,并不构成对本申请实施例的限定,在一些实施例中,也可以通过其他操作(例如,双击、滑动等操作)启动网络应用。上述网络应用可以是联机游戏、在线视频及在线音乐等网络类型的应用。
图1a为手机桌面示意图。如图1a所示,用户可以在手机桌面点击视频应用图标,以打开一个视频应用,由此可以得到如图1b所示的视频显示示意图。
步骤302,环境探测组件121探测到网络应用切换到前台或网络发生变化,通知应用级策略管理组件124。
具体地,第一设备中的服务层12中的环境探测组件121可以持续对上述网络应用的状态或网络的环境进行探测,当环境探测组件121探测到任一网络应用切换到前台或网络的环境发生变化后,可以发送第一通知消息给应用级策略管理组件124,该第一通知消息可以用于通知应用级策略管理组件124网络应用已切换到前台或网络的环境已发生变化。可以理解的是,上述第一通知消息中还可以包括该网络应用的身份标识(例如,该网络应用的身份标识可以是UID),该身份标识可以用于标识网络应用的唯一身份。
示例性的,上述网络应用的身份标识可以通过如下代码实现:
Figure PCTCN2022086641-appb-000001
步骤303,应用级策略管理组件124接收环境探测组件121发送的第一通知消息,判断当前网络应用是否满足开启加速的条件。
具体地,当应用级策略管理组件124接收环境探测组件121发送的第一通知消息后,可以从第一通知消息中确定该网络应用已切换到前台。接着,应用级策略管理组件124可以进一步确定该网络应用是否包含在预设应用白名单内。
在具体实现时,应用级策略管理组件124中可以预设应用白名单,该应用白名单可以包括多个网络应用,每个网络应用可以通过上述身份标识进行标识,该应用白名单可以用于表征可以开启加速的网络应用。其中,上述预设应用白名单中的网络应用可以包括业务类型,例如,上述预设应用白名单中的网络应用的业务类型都可以是敏感类,该敏感类业务可以包括时延敏感类业务、丢包率敏感类业务等。当通过对第一通知消息中的网络应用的身份标识与预设应用白名单中的网络应用的身份标识的比对,可以确定第一通知消息中的网络应用是否包含在预设应用白名单中。若第一通知消息中的网络应用包含在预设应用白名单中,则可以确定该网络应用满足开启加速的条件,若第一通知消息中的网络应用不包含在预设应用白名单中,则可以确定该网络应用不满足开启加速的条件。
示例性的,表1为网络应用的白名单。
应用名称 特征流类型 通道质量参数
百度网盘 下载流 速率
微信 视频流 时延/丢包
游戏 对战流 时延/丢包
表1
可以理解的是,若当前的网络应用不在上述预设应用白名单中,也就是说,当前的网络应用的业务类型为非敏感类务,则第一设备在探测到主网络通道变差时,可以进一步探测其他质量较好的网络通道,由此可以直接将上述非敏感类业务切换到质量较好的网络通道上。
步骤304,应用级策略管理组件124向流级路径管理组件131发送通道启用消息,用于启用一条网络通道。
具体地,若应用级策略管理组件124确定当前网络应用满足开启加速的条件,则可以向流级路径管理组件131发送通道启用消息,其中,该通道启用消息用于指示流级路径管理组件131可以启用一条网络通道(例如,主网络通道)。
步骤305,流级路径管理组件131向通道级路径管理组件123请求主网络通道的路径。
具体地,当流级路径管理组件131接收到应用级策略管理组件124发送的通道启用消息后,可以向通道级路径管理组件123发送主网络通道请求,其中,该主网络通道请求用于请求主网络通道的路径。示例性的,该主网络通道可以是主WIFI通道。
步骤306,通道级路径管理组件123将主网络通道的路径发送给流级路径管理组件131。
具体地,通道级路径管理组件123可以预先配置多条网络通道的路径,示例性的,该多条网络通道可以包括主WIFI通道、辅WIFI通道、主蜂窝通道及辅蜂窝通道,其中,上述主WIFI通道和辅WIFI通道可以工作在2.4GHz频段或5GHz频段,示例性的,若主WIFI通道工作在2.4GHz频段,则辅WIFI通道工作在5GHz 频段;若主WIFI通道工作在5GHz频段,则辅WIFI通道工作在2.4GHz频段。此外,主蜂窝通道和辅蜂窝通道可以和运营商网络对应,例如,主蜂窝通道可以使用sim卡1(该sim卡1归属于运营商A),辅蜂窝通道可以使用sim卡2(该sim卡2归属于运营商B)。在通常情况下,主WIFI通道的优先级高于其余三条通道,因此,主网络通道通常为主WIFI通道。可以理解的是,上述预置通道仅是示例性说明,并不构成对本申请实施例的限定,在一些实施例中,还可以包括更多的通道。此外,将主WIFI通道作为主网络通道也只是优选方案,并不构成对本申请实施例的限定,在一些实施例中,也可以选取其他网络通道作为主网络通道。
当通道级路径管理组件123接收到流级路径管理组件131发送的主网络通道请求后,可以在上述多条网络通道中选取一条网络通道作为主网络通道(例如,该主网络通道为主WIFI通道),并将该主网络通道的路径发送给流级路径管理组件131。
步骤307,流级路径管理组件131存储接收到的主网络通道的路径。
具体地,当流级路径管理组件131接收到通道级路径管理组件123发送的主网络通道的路径后,可以将该主网络通道的路径进行存储。示例性的,该主网络通道的路径可以用WIFI1表征。
图1c为手机使用主网络通道后的效果示意图。如图1c所示,当手机获取到主网络通道的路径后,可以使用主网络通道进行视频的观看。
可以理解的是,当前的网络应用(例如,图1c中的视频应用)可以包括多个流(例如,视频流及音频流),该多个流可以承载在上述主网络通道上。
步骤308,应用级策略管理组件124向流量感知组件133发送流量探测请求。
具体地,该流量探测请求可以用于指示流量感知组件133启动主网络通道上的网络应用的报文统计。其中,该流量探测请求可以包括当前待探测的网络应用的身份标识(例如UID),用于请求对该主网络通道上的与上述身份标识UID对应的网络应用的流进行探测。可以理解的是,上述网络应用的流可以是报文的形式。
需要说明的是,本步骤308可以与步骤304同时执行,也可以在步骤304之后的任一时刻执行,本申请对此不做特殊限定。
步骤309,流量感知组件133向流量上报组件141发送流量上报请求。
具体地,当流量感知组件133收到应用级策略管理组件124发送的流量探测请求后,可以向流量上报组件141发送流量上报请求,其中,该流量上报请求可以用于指示流量上报组件141对当前主网络通道上的网络应用的报文进行探测,并将探测到的报文进行上报。可以理解的是,上述流量探测请求可以包含网络应用的身份标识(例如UID)。
步骤310,流量上报组件141进行流量探测,并将探测到的报文上报给流量感知组件133。
具体地,当流量上报组件141接收到上述流量感知组件133发送的流量上报请求后,可以根据上述流量上报请求中的网络应用的身份标识(例如UID),对 与网络应用的身份标识对应的网络应用的报文进行探测,由此可以得到主网络通道上网络应用的报文,并可以将上述探测到的网络应用的报文上报给流量感知组件133。
在具体实现时,上述流量上报组件141可以调用组件(例如,安卓系统的Netfilter组件)获取上述主网络通道上的网络应用的报文。可以理解的是,上述Netfilter组件仅为示例性说明,并不构成对本申请实施例的限定,在一些实施例中,也可以通过其他组件完成上述报文的探测。
示例性的,上述网络通道的参数可以通过如下代码实现:
typedef struct{
bool available;
bool slowDevForbbiden;
uint64_t qoeBadTimeStamp;
uint64_t chQoeBadStartTime;
uint32_t rcvRate;
}
可以理解的是,上述探测的报文可以是当前网络应用中一个或多个特征流的报文,其中,该特征流可以是网络应用中敏感性最高的流,也就是对当前网络应用影响较大的流。此外,通过上述网络通道的参数可以对网络通道的质量进行评估。
步骤311,流量感知组件133对主网络通道上的网络应用的报文进行统计,根据统计结果进行预测,得到预测结果,并将预测结果发送给流级路径管理组件131。
具体地,当流量感知组件133接收到流量上报组件141探测到的网络应用的报文后,可以对上述报文进行统计,由此可以得到报文统计结果。接着,可以根据上述报文统计结果进行分析,由此可以对网络状况进行预测,也就是说,可以根据报文统计结果预测网络状况会变好还是变坏。在具体实现时,可以统计上述网络应用的报文的丢包率和/或时延,由此可以预测网络状况。示例性的,可以统计预设N个周期内的报文的丢包率和/或时延,若统计的丢包率和/或时延满足预设要求,则可以预测网络状况为好,若统计的丢包率和/或时延不满足预设要求,则可以预测网络状况为差。
可以理解的是。本步骤311的网络通道的质量为粗粒度的评估,也就是说,是在一个较短的周期内对特征流的报文进行统计,用于对网络的状况进行快速预测,由此可以提前选取备用网络通道,进而可以节省通道切换的时延。
上述报文可以是主网络通道上的网络应用的各个流的报文。当流量感知组件133接收到上述报文后,可以对上述报文进行分析。其中,上述报文分析可以是基于报文的特征,以此来识别特征流。举例来说,以和平精英游戏为例,该游戏的特征流可以是语音流,也就是说,语音流对该游戏的影响是比较大的,敏感性最高,当语音流质量不好(例如,时延和丢包率都不满足要求)时,会严重影响 用户的游戏体验。因此,需要识别语音流,并进一步统计报文中的语音流报文。而该语音流的报文的识别可以通过心跳包统计实现。示例性的,以用户数据报协议(User Datagram Protocol,UDP)协议为例,该语音流的数据报文特征可以通过如下特征表征:
上行:udp.payload[6]=0x64;
下行:udp.payload[6]=0x65。
图8为UDP协议的语音流的心跳报文示意图。
也就是说,对上述上下行报文中的载荷中的预设字段的读取,可以识别该报文是否是语音流数据包。
接着,可以对语音流的报文进行统计,由此可以获得上述语音流的报文的时延和/或丢包率。在具体实现时,可以统计预设时长内的语音流的报文。优选地,上述预设时长可以为1s,由此可以尽快的确定语音流的质量是否变差,进而可以尽快的将该语音流切换到备用网络通道上,以提供较高的游戏体验。示例性的,若上述语音流的报文的时延和/或丢包率达不到要求时,则可以确定该语音流的质量为差,此时,可以触发切换,用于将上述语音流切换到备用网络通道上。需要说明的是,上述示例仅以游戏为例进行示例性说明,在具体应用中,还可以包括其他网络应用,例如,百度网盘,该网络应用的特征流是下载流,也就是说,可以在上述报文中找到下载流的报文,而该下载流的报文的影响因素可以是速率。此外,上述网络应用还可以包括微信等社交网络应用,该网络应用的特征流是视频流,也就是说,可以在上述报文中找到视频流的报文,而该视频流的报文的影响因素可以是时延/或丢包率。
可以理解的是,上述特征流除上述语音流之外,还可以包括游戏中的对战流。以和平精英为例,通过周期统计UDP报文个数可以判断当前的报文流是否是对战流。目前,和平精英采用的周期是500ms,因此,可以统计周期内的报文总数判断是否是对战流,例如,上述500ms周期的报文总数大于10个,则该报文流为对战流。图9为UDP协议的对战流的报文统计示意图。如图9所示,横轴为时间,纵轴为报文总数,由于每秒基本保持在30个报文,因此,可以通过计算确定每500ms有15个报文,由此可以确定该报文流是对战流。
接着,以王者荣耀为例,其中,王者荣耀采用过滤UDP协议号和报文头特征payload=0x00010000来过滤对战报文。图10为UDP协议的对战流的心跳报文示意图。
步骤312,流级路径管理组件131基于接收到的预测结果向通道级路径管理组件123请求备用网络通道。
具体地,当流级路径管理组件131接收到预测结果后,可以基于预测结果提前选取备用网络通道,例如,可以向通道级路径管理组件123发送备用网络通道请求,用于请求一条备用网络通道。
可选地,上述备用网络通道请求还可以携带标签,该标签可以用于指示对主网络通道的切换的预测,并不真正进行切换。
现结合图11a-11c,以手机为例对上述备用网络通道的选取进行说明。如图11a所示,手机具有主WIFI通道(例如WIFI1)、辅WIFI通道(例如WIFI2)、主蜂窝通道(例如Mobile1)及辅蜂窝通道(例如Mobile2)等4条网络通道的能力。假设手机当前在WIFI1通道(主网络通道)运行一个网络应用(例如微信),该网络应用包括流A(例如视频流)和流B(例如音频流)。当手机接收到网络即将变差的预测结果后,可以提前选取备用网络通道,其中,该备用网络通道可以是上述辅WIFI通道(例如WIFI2)、主蜂窝通道(例如Mobile1)及辅蜂窝通道(例如Mobile2)中的通道质量最好的一条。当选取上述辅WIFI通道(例如WIFI2)、主蜂窝通道(例如Mobile1)及辅蜂窝通道(例如Mobile2)中的一条网络通道作为备用网络通道(例如,Mobile1通道)后,可以将该Mobile1通道的路径进行存储。
当手机通过进一步报文探测,发现流A的质量已经不满足需求,此时,可以仅将上述流A切换到备用网络通道,也就是Mobile1通道上。如图11b所示,此时,上述流B可以继续承载在主网络通道,也就是WIFI通道上,而流A可以承载在备用网络通道,也就是Mobile1通道上。
需要说明的是,上述示例仅示例性的示出了一条流进行切换的场景,并不构成对本申请实施例的限定,在一些实施例中,也可以包含多条流进行切换的场景。
可选地,当手机通过进一步报文探测,发现流A的质量已经不满足需求,此时,可以将上述流A及流B都切换到备用网络通道,也就是Mobile1通道上。如图11c所示,此时,上述流A及流B都承载在Mobile1通道上。
接着,结合图11d和图11e,以手机为例对通道切换的触发条件进行说明。图11d为非敏感类业务的通道切换触发过程。如图11d所示,手机中的流量感知组件133在预设第一时长内接收流量上报组件141探测到的特征流的心跳流报文,通过对上述预设第一时长内的特征流的心跳流报文的统计分析,可以确定网络通道质量的是否变差。其中,由于当前业务是非敏感类业务,因此,上述预设第一时长可以设置的较长,例如5s。当流量感知组件133确定当前的网络通道质量变差后,可以发送切换通知给策略管理组件132,以触发网络通道的切换,例如,可以通过对其他网络通道的质量进行评估,并将当前的非敏感类业务切换到质量最优的其他网络通道上。
图11e为敏感类业务的通道切换触发过程。如图11e所示,手机中的流量感知组件133在预设第二时长内接收流量上报组件141探测到的特征流的心跳流报文,通过对上述预设第二时长内的特征流的心跳流报文的统计分析,可以预测网络通道质量的是否变差。其中,上述预设第二时长可以设置的较短,例如1s,由此可以快速的对网络通道的状况进行预测,进而可以快速选取备用网络通道,以节省将来进行网络通道的实际切换时对备用网络通道的评估时间。接着,手机中的流量感知组件133在预设第三时长内继续接收流量上报组件141探测到的特征流的心跳流报文,通过对上述预设第三时长内的特征流的心跳流报文的统计分析,可以确定当前网络应用中特征流的业务质量。其中,上述预设第三时长可以和预 设第一时长等长,例如5s,也可以比预设第一时长设置的短,例如3s。当确定特征流的业务质量变差时,可以发送切换通知给流级策略管理组件132,以触发网络通道的切换,例如,可以将当前网络应用的特征流切换到上述备用网络通道上。
步骤313,通道级路径管理组件123接收备用网络通道请求,请求各可选网络通道的启用状态。
具体地,当通道级路径管理组件123接收到上述流级路径管理组件131发送的备用网络通道请求后,可以向网络探测组件122发送通道状态请求,其中,该通道状态请求可以用于请求获得各可选网络通道的启用状态。可以理解的是,上述启用状态可以包括可用及不可用。上述可用状态可以用于表征该可选网络通道可以启用,上述不可用状态可以用于表征该可选网络通道禁止启用。该可选网络通道可以包括辅WIFI通道、主蜂窝通道及辅蜂窝通道等。
步骤314,网络探测组件122检测各可选网络通道的启用状态,并向通道级路径管理组件123发送各可选网络通道的启用状态。
具体地,当网络探测组件122接收到通道级路径管理组件123发送的通道状态请求后,可以检测各可选网络通道的启用状态。在具体实现时,该网络探测组件122可以用于管理各可选网络通道的开关,当任一可选网络通道开启后,该可选网络通道处于可用状态,当任一可选网络通道关闭后,该可选网络通道处于不可用状态。因此,当网络探测组件122检测到通道级路径管理组件123请求的所有可选网络通道的启用状态后,可以将上述所有可选网络通道的启用状态发送给通道级路径管理组件123。
步骤315,通道级路径管理组件123请求各可用网络通道的通道质量。
具体地,当通道级路径管理组件123接收到各可选网络通道的启用状态后,可以选取可用网络通道(也就是处于可用状态的可选网络通道),并可以进一步向通道及应用质量评估组件125发送通道评估请求,其中,该通道评估请求可以用于请求评估可用网络通道的质量。
步骤316,通道及应用质量评估组件125对各可用网络通道的质量进行评估,并将评估结果发送给通道级路径管理组件123。
具体地,当通道及应用质量评估组件125接收到第一路径管理组件123发送的通道评估请求后,可以根据该通道评估请求对各可用网络通道的质量进行评估。示例性的,该通道质量可以包括该通道的时延、丢包率、带宽及速率等。上述评估可以是对可用网络通道的往返时延(Round-Trip Time,RTT)进行评估,往返时延最小的网络通道为最佳。可选地,当可用网络通道有历史选用记录时,也就是说,上述可用网络通道曾经被选用为网络通道过,此时,可以结合上述RTT及历史记录对通道质量进行评估,其中,该历史记录可以包括历史接收速率、通道质量为差的历史次数等,本申请实施例对上述通道质量的评估方式不做特殊限定。当通道及应用质量评估组件125对通道评估请求中所有可用网络通道的质量评估完成之后,可以将上述评估结果发送给第一路径管理组件123。
步骤317,通道级路径管理组件123基于评估结果确定备用网络通道,并将 备用网络通道的路径发送给流级路径管理组件131。
具体地,当通道级路径管理组件123接收到上述评估结果后,可以基于上述评估结果选取最佳的可用网络通道作为备用网络通道,并可以将上述备用网络通道的路径发送给通道级路径管理组件123。
步骤318,流级路径管理组件131接收并存储通道级路径管理组件123发送的备用网络通道的路径。
具体地,当流级路径管理组件131接收到通道级路径管理组件123发送的备用网络通道的路径后,可以预先存储该备用网络通道的路径。可以理解的是,由于在步骤312中仅是对网络状况进行预测,也就是说,当前的网络较差,可能会对业务造成卡顿,但是还没有达到切换的条件,此时,第一设备并不切换到该备用网络通道,也就是说,第一设备仍在使用主网络通道。
示例性的,当流级路径管理组件131在t1时刻接收到通道级路径管理组件123发送的备用网络通道的路径后,可以预先存储该备用网络通道的路径。此时,第一设备并不切换到该备用网络通道,也就是说,第一设备仍在使用主网络通道。接着,当在t2时刻检测到当前的网路应用的特征流的质量变差,已经达到切换的条件,此时,第一设备可以将上述特征流由主网络通道切换到备用网络通道。
步骤319,流量上报组件141上报报文至流量感知组件133。
具体地,流量上报组件141可以持续探测当前主网络通道的报文,并将探测到的报文上报给流量感知组件133。
步骤320,流量感知组件133接收流量上报组件141上报的报文,对报文进行分析,得到报文分析结果,并将报文分析结果发送给流级策略管理组件132。
具体地,流量感知组件133接收到流量上报组件141上报的报文后,可以从上述报文中识别出特征流。其中,上述识别特征流的方式可以参考步骤311,在此不再赘述。接着,可以对上述特征流中报文进行分析,由此可以得到报文分析结果,该报文分析结果可以用于表征该特征流是否满足业务需求,例如,是否满足时延需求或是否满足丢包率需求等。并可以将上述报文分析结果发送给流级策略管理组件132。
可以理解的是,本步骤320不同于步骤311中的对网络通道的粗粒度质量评估,也就是说,在较短周期内对接收到的特征流的报文进行分析,由此可以获取网络质量,并进行切换的预测。而本步骤320是在较长周期内对接收到的特征流的报文进行分析,由此可以确定是否要进行实际切换,也就是说,步骤320是细粒度的质量评估,由此可以实现针对特征流的网络通道的切换,节省时延。
现有技术中,针对于网络质量评估使用的参数(例如,时延或者丢包率),仅为该参数设置一个阈值,使用该阈值对应的评估策略评估网络质量。在本申请实施例提供的方法中,可以为参数设置至少2个数值不相同的阈值,每个阈值对应有一套评估策略,阈值越大,评估策略的时延越小。举例来说,如果为时延设置有阈值1、阈值2,阈值2大于阈值1,则阈值1对应的评估策略可以为:连续5个周期中有3个周期时延大于阈值1,则报文分析结果为质量差,否则报文分析 结果为质量好;阈值2对应的评估策略可以为:1个周期的时延大于阈值2,则报文分析结果为质量差,否则报文分析结果为质量好。基于以上评估策略可知,阈值1对应的评估策略的时延为3个周期,阈值2对应的评估策略的时延为1个周期。
举例来说:
特征流是语音流,流量上报组件上报的报文是语音流中的心跳流报文,通过心跳流报文的RTT对网络通道的质量进行评估,为心跳流报文的RTT预设阈值1和阈值2两个阈值,阈值对应的评估策略延续前述举例。
流量感知组件133判断当前周期的RTT是否大于阈值2;
如果是,则确定语音流的报文分析结果为:质量差,将语音流的报文分析结果发送给流级策略管理组件132;
如果否,流量感知组件133判断当前周期所在窗口是否有3个周期的RTT大于阈值1;当前周期所在窗口由以当前周期为结束周期的连续5个周期构成的;
如果是,则确定语音流的报文分析结果为:质量差,将语音流的报文分析结果发送给流级策略管理组件132;如果否,则确定语音流的报文分析结果为:质量好,将语音流的报文分析结果发送给流级策略管理组件132。
可选地,流量感知组件133可以仅在语音流的报文分析结果为质量差时,才将语音流的报文分析结果发送给流级策略管理组件132。
需要说明的是,上述说明中以为参数预设2个阈值为例,其也可以扩展至预设3个阈值或者更多个阈值,本申请实施例不作限定。
步骤321,流级策略管理组件132基于报文分析结果确定切换,并请求获取备用网络通道的路径。
具体地,当流级策略管理组件132接收到流量感知组件133上报的报文分析结果后,可以根据报文分析结果判断是否进行通道切换。在具体实现时,若当前的网络应用的特征流(例如,游戏中的语音流、微信中的视频流或百度网盘的下载流)不满足要求(例如,时延和/或丢包率),则可以确定需要进行通道切换。此时,流级策略管理组件132可以向流级路径管理组件131发送备用网络通道路径获取请求,用于获取备用网络通道的路径,举例来说,若备用网络通道为主蜂窝,则备用网络通道的路径例如可以是Mobile1。
示例性的,上述请求备用网络通道的路径可以通过如下代码实现:
Figure PCTCN2022086641-appb-000002
Figure PCTCN2022086641-appb-000003
此外,在具体实现时,上述网络通道的路径(例如,该路径可以用网卡或sim卡的设备号表征)可以在数据结构中进行定义,代码示例如下:
Figure PCTCN2022086641-appb-000004
Figure PCTCN2022086641-appb-000005
如上述代码所示,其中,sk_bound_dev_if为切换的目标网卡或目标sim卡的设备号。可以理解的是,通过上述网卡或sim卡可以接收报文,该接收报文的代码可以参考如下示例:
pktinfo.msg.flow_msg.dev_if=sk->sk_bound_dev_if;
其中,pktinfo为接收到的报文,msg.flow_msg为报文流的名称。
可以理解的是,若通过报文分析,确定当前的网络应用的特征流满足需求,也就是说,无需进行切换,此时,第一设备可以删除上述备用网络通道的路径,由此可以释放资源,同时也可以节省第一设备的功耗。可选地,第一设备也可以在预设时长(例如,预设第四时长)后删除上述备用网络通道的路径,由此可以保证在该预设第四时长内,如果特征流的质量变差,可以及时的切换至备用网络通道,避免因删除上述备用网络通道的路径导致无法切换。
步骤322,流级路径管理组件131向流级策略管理组件132发送备用网络通道的路径。
步骤323,流级策略管理组件132向策略执行组件142发送通道切换指示。
具体地,当流级策略管理组件132接收到流级路径管理组件131发送的备用网络通道的路径后,可以向策略执行组件142发送通道切换指示,其中,该通道切换指示可以用于指示策略执行组件142将上述特征流由当前的主网络通道切换至备用网络通道,由此可以更快的完成通道切换,减少通道切换带来的时延,提高用户的体验。
步骤324,策略执行组件142执行通道切换。
具体地,当策略执行组件142接收到流级策略管理组件132发送的通道切换指示后,可以将上述特征流由当前的主网络通道切换至备用网络通道,也就是说,上述网络应用的其他流可以继续承载在主网络通道上运行,上述特征流可以承载在备用网络通道上运行,由此可以快速的完成切换,进而可以保证业务的质量以及用户的体验。
可选地,可以将上述网络应用整个切换至备用网络通道,也就是说,可以停用上述主网络通道,上述网络应用的所有流都承载在备用网络通道上运行。
图1d为手机使用备用网络通道的示意图。如图1d所示,当手机接收到通道切换指示后,可以将视频流由当前的主网络通道切换至备用网络通道,并可以使用备用网络通道进行视频的观看,以避免视频的卡顿。
下面结合图5所示的第一设备的系统框架图,通过图12~图14所示第一设备内各组件交互的时序图对本申请实施例通道切换方法进行详细说明。
图12为本申请实施例第一设备内各组件交互的一种时序图,如图12所示,该方法可以包括:
步骤1201:响应于用户的操作,启动网络应用。
本步骤的实现可以参考步骤301,这里不赘述。
步骤1202:网络应用与服务器之间进行流传输。
用户在网络应用中选择业务,网络应用根据业务与服务器之间进行业务需要的流的传输。其中,网络应用可以使用一网络通道(例如,主网络通道)与服务器之间进行流的传输。以网络应用是视频应用,用户选择播放一视频为例,该业务需要的流可以包括视频流及音频流,视频流及音频流可以承载在上述主网络通道上,相应的,手机可以使用主网络通道与服务器之间进行交互,从服务器获取视频流和音频流,从而播放视频。
需要说明的是,本申请实施例关注于网络应用开始使用主网络通道与服务器进行交互后如何实现网络通道的切换,网络应用初始启动后如何根据使用主网络通道开始与服务器进行交互本申请实施例不作限定。
步骤1203:环境探测组件121探测到网络应用切换到前台,通知应用级策略管理组件124。
本步骤的实现可以参考步骤302中的说明,这里不赘述。
步骤1204:应用级策略管理组件124判断网络应用是否满足开启加速的条件。
本步骤的实现可以参考步骤303中的说明,这里不赘述。
进一步对网络应用白名单的实现进行说明。
本申请实施例中以网络应用的数据按照类型划分流为例,一种类型对应网络应用的一条流。如下表3所示,网络应用白名单中除了记录有需要开启加速的网络应用外,还可以记录有:
每个网络应用中的需要被监控的目标流的类型;例如,表3中目标流的类型字段所示;
每种目标流的类型对应的流模型,例如下表3中流模型字段所示;
用于评估目标流的网络质量的网络质量评估参数,例如下表3中通道质量参数字段所示;
评估目标流的网络质量变差后对网络应用的流进行通道切换的策略,以下简称为流切换策略;例如下表3中流切换策略字段所示。
Figure PCTCN2022086641-appb-000006
表3
可选地,上述目标流可以是在承载该目标流的网络通道的质量变差时,能够快速在某个或者某些网络质量评估参数上表现出来的流,例如,可以是网络应用的一条或者多条特征流。
可选地,目标流的网络质量评估参数可以是能够快速反映出目标流的网络质量变差的参数。
上述流切换策略中记录需要与目标流一起切换网络通道的流,可选地,流切换策略中记录的流一般是网络应用中对业务处理影响较大的流,例如前述说明中网络应用的特征流,如视频播放应用中的视频流和音频流,游戏应用中的游戏对战流、语音流等。
可选地,流切换策略中记录的需要与目标流一起切换网络通道的流可以是与目标流对相同的网络评估参数敏感的流,例如目标流是对时延敏感的流(以下简称时延敏感流),则流切换策略中的流是网络应用中包括目标流在内的部分或者全部时延敏感流;目标流是对丢包率敏感的流(以下简称丢包率敏感流),则流切换策略中的流是网络应用中包括目标流在内的部分或者全部丢包率敏感流。从而,目标流的网络质量变差,将网络应用中对相同网络评估参数敏感的一类流切换网络通道。
可选地,上述目标流类型对应的流模型用于记录目标流中需要监控的报文的特征信息,例如特征信息可以是以下特征信息中的至少一种特征信息:报文的四元组、五元组、协议号、载荷中的字符串等。
需要说明的是,本申请实施例中流切换策略中,当网络应用的某一条流的质量变差时,可以对在同一网络通道上包括该条流在内的网络应用的多条流进行网络通道切换,从而将上述多条流从当前所在的网络通道切换到其他质量相对更好的网络通道上,防止网络应用的业务出现卡顿。例如表3中,如果微信的视频流变差,微信的视频流和语音流在同一网络通道上,则对微信的视频流和语音流均进行网络通道切换,从而将视频流和语音流从当前网络通道切换至质量相对更好的网络通道上,降低微信的视频和语音播放出现卡顿问题的可能性。
步骤1205:应用级策略管理组件124向流级路径管理组件131发送加速启动消息。
具体地,若应用级策略管理组件124确定当前网络应用满足开启加速的条件,则 可以启动针对于网络应用的加速业务,并且,向流级路径管理组件131发送加速启动消息,该加速启动消息用于指示流级路径管理组件131可以启动针对于该网络应用的加速业务。
上述加速业务可以包括但不限于:
在电子设备所处环境或者电子设备的系统环境变化时,启用一条备用网络通道,使得该备用网络通道从休眠状态转换为唤醒状态;和/或,
监控该网络应用中若干条流的网络质量,在电子设备监控到该网络应用的某条流质量变差时,将该网络应用包括上述质量变差的流在内的多条流切换至备用网络通道,从而使得网络应用的上述多条流始终承载在质量相对较好的网络通道上,保证流的传输质量,降低网络应用出现业务卡顿的可能性,提升用户体验。需要说明的是,如果决策将多条流切换至备用网络通道时,电子设备已经启用了备用网络通道,则将多条流切换至已经启用的备用网络通道,如果决策将多条流切换至备用网络通道时,电子设备未启用备用网络通道,则,电子设备需要先启用一条备用网络通道,再切换至已启用的备用网络通道。
可选地,加速启动消息中可以包括网络应用白名单中当前网络应用的身份标识对应的信息,例如可以包括:当前网络应用的身份标识,目标流类型,目标流类型对应的流模型、网络质量评估参数信息、以及流切换策略信息。具体可以参考前述相关说明,这里不赘述。
可选地,流级路径管理组件131中可以存储有当前使用的网络通道的路径,该路径也即是网络应用的使用的网络通道的路径;或者,如果流级路径管理组件131中未存储当前使用的网络通道的路径,也即流级路径管理组件131中未存储网络应用使用的网络通道的路径,则,流级路径管理组件131可以向通道级路径管理组件123请求网络应用使用的网络通道的路径,通道级路径管理组件123可以将网络应用使用的网络通道的路径发送给流级路径管理组件131。
步骤1206:流级路径管理组件131将网络应用的身份标识和流切换策略信息发送给流级策略管理组件132,向流量感知组件133发送流量探测请求,流量感知组件133向流量上报组件发送流量上报请求。
可选地,流量探测请求中可以包括针对于网络应用的第一配置文件,第一配置文件中可以包括:网络应用的身份标识,目标流类型,目标流类型对应的流模型、网络质量评估参数信息等。
可选地,流量上报请求中可以包括针对于网络应用的第二配置文件,第二配置文件中可以包括:网络应用的身份标识,目标流类型,目标流类型对应的流模型。
需要说明的是,本步骤的执行目的在于将针对于当前网络应用的各种相关信息初始化至流级策略管理组件132、流量感知组件133以及流量上报组件141,因此,在其他可能的实现方式中,流级路径管理组件131也可以将针对于网络应用的第二配置文件直接发送至流量上报组件141,这里并不限制。
通过本步骤的处理,可以触发流量上报组件开始监控网络应用中的流,进而触发后续针对流的网络通道切换流程。
以下,通过图13对电子设备对当前应用的流的通道切换过程进行说明。
图13为本申请实施例第一设备内各组件交互的另一种时序图,如图13所示,该方法可以包括:
步骤1301:网络状态感知组件122检测到WIFI通道被启用。
第一设备进入WIFI网络覆盖范围,通过历史登录数据登录WIFI成功,启用WIFI通道,WIFI通道的状态从休眠状态转换为唤醒状态;网络状态感知组件122监控WIFI通道的状态从休眠状态转换为唤醒状态,从而检测到WIFI通道被启用。
步骤1302:网络状态感知组件122向通道级路径管理组件123发送WIFI通道启用通知消息。
网络状态感知组件122检测到WIFI通道被启用后,向通道级路径管理组件123发送WIFI通道启用通知消息,通知消息中可以包括:WIFI通道的标识信息、以及状态信息(例如,唤醒状态)。
步骤1303:通道级路径管理组件123向通道及应用质量评估组件125发送通道评估请求。
通道质量评估请求用于请求通道及质量评估组件125评估新启用的WIFI通道的质量以及当前使用的蜂窝通道的质量。
步骤1304:通道及应用质量评估组件125对WIFI通道和蜂窝通道的质量进行评估,并将评估结果发送给通道级路径管理组件123。
具体地,当通道及应用质量评估组件125接收到通道级路径管理组件123发送的通道评估请求后,可以根据该通道评估请求对WIFI通道和蜂窝通道的质量进行评估。
示例性的,可以根据网络通道的以下至少一个参数对网络通道的质量进行评估:通道的时延、丢包率、带宽及速率等。举例来说,上述质量评估可以是对可用网络通道的往返时延(Round-Trip Time,RTT)进行评估,往返时延最小的网络通道为最佳。
可选地,当WIFI通道和/或蜂窝通道有历史选用记录时,也就是说,上述WIFI通道和/或蜂窝通道曾经被选用为网络通道过,此时,可以结合上述RTT及历史记录对WIFI通道和蜂窝通道的通道质量进行评估,其中,该历史记录可以包括历史接收速率、通道质量为差的历史次数等,本申请实施例对上述通道质量的评估方式不做特殊限定。
当通道及应用质量评估组件125对通道评估请求中所有可用网络通道的质量评估完成之后,可以将上述评估结果发送给通道级路径管理组件123。
本步骤的实现还可以参考步骤316中的对应说明,这里不赘述。
步骤1305:通道级路径管理组件123向流级路径管理组件131发送通知消息。
该通知消息用于向流级路径管理组件131通知已经启用WIFI通道;通知消息中可以包括:WIFI通道的标识信息,WIFI通道的通道质量评估结果,当前使用的蜂窝通道的通道质量评估结果。
步骤1306:流级路径管理组件131向流量感知组件发送通知消息。
该通知消息用于指示流量感知组件对报文是否是时延敏感流进行检测。
时延敏感流是指该流对时延敏感,也即时延的变化对使用该流的业务影响较大。
步骤1307:流量上报组件141进行流量探测,并将探测到的报文上报给流量感知组件133。
具体地,基于前述的步骤1206,流量上报组件141接收到流量上报请求后,可以根据流量上报请求对网络应用的目标流的报文进行探测,并将探测结果上报给流量感知组件133。上述探测结果可以包括:目标流的报文,或者,目标流的报文以及目标流的报文统计信息,等。
在具体实现时,上述流量上报组件141可以通过调用组件(例如,安卓系统的Netfilter组件)获取当前网络通道(例如主网络通道)上的网络应用的目标流的报文。可以理解的是,上述Netfilter组件仅为示例性说明,并不构成对本申请实施例的限定,在一些实施例中,也可以通过其他组件完成上述报文的探测。
示例性的,上述网络通道的参数可以通过如下代码实现:
typedef struct{
bool available;
bool slowDevForbbiden;
uint64_t qoeBadTimeStamp;
uint64_t chQoeBadStartTime;
uint32_t rcvRate;
}
可以理解的是,上述探测的报文可以是当前网络应用中一个或多个特征流的报文,其中,该特征流可以是网络应用中敏感性最高的流,也就是对当前网络应用影响较大的流。此外,通过上述网络通道的参数可以对网络通道的质量进行评估。
可选地,流量上报组件141进行流量探测时,可以在内核netfilter框架注册钩子函数,获取目标流的报文。整体实现框图例如图14所示,Netfilter钩包到流量上报组件的nf_hook钩子函数,当前网络通道上承载的报文即进入到流量上报组件141,流量上报组件经过报文解析、流表创建、报文内容分析等流程,将目标流的报文存放到SKB队列中,对于SKB队列中的报文,按照报文所属目标流的上报策略,需要定时上报的数据(报文,或者,报文和统计信息)由定时器触发上报至流量感知控件133,需要立即上报的报文由NetLink的线程即时上报至流量感知控件133。
需要说明的是,目标流可以是一条或者多条;流量上报组件探测目标流的报文时,可以将目标流的全部或者部分报文上报至流量感知组件,本申请实施例不作限定。
以对目标流中的心跳流报文进行探测和上报为例,结合图14对报文上报组件的具体实现流程进行说明。
这里所称之心跳流报文可以是按照一定的时间间隔在目标流中出现的报文,心跳流报文的载荷的固定位置存在预设特征信息。可选地,心跳流报文的五元组与同一流中其他报文的五元组可以相同或者不同。本申请实施例的心跳流报文的时间间隔 本申请实施例不作限定,例如为1s。参见图15所示,为间隔为1s的心跳流报文示意图。相应的,后续流量感知组件133可以根据心跳流报文计算往返时延,将往返时延作为目标流的网络质量评估参数,来判断目标流的网络质量。心跳流报文的RTT计算方法例如参见图16所示,具体说明可以参见前述相关说明,这里不赘述。
举例来说,本申请实施例提供的心跳流报文可以具有以下特征:(ip.src==100.100.3.90&&udp.srcport==60539&&ip.dst==58.217.244.144&&udp.dstport==10126)&&(data[6]==64)。其中,data[6]表示报文的载荷的第6个字节。
参见图15,报文上报组件的具体实现流程包括:
步骤S1,初始化;
在网络应用启动加载时,流量上报组件141会收到app launch消息,去注册nf_hook钩子函数。代码示例如图17a和图17b所示。
步骤S2,报文处理;
本步骤具体包括报文解析、查流表和报文分析三个步骤。流表中记录有各网络应用中的流的标识信息、以及每条流的统计信息,每条流的统计信息可以包括:接收到的该条流的报文数量、接收到的该条流的报文的总字节数、出错的包数等。流的标识信息可以根据流中报文的五元组或者四元组计算得到,上述计算具体可以使用hash算法,从而流的标识信息可以是报文的五元组或者四元组计算得到的hash值。
在报文解析时,流量上报组件141获取到报文,可以解析报文中是否存在网络应用的UID;如果存在,说明该报文是网络应用的报文,解析报文的四元组(或者五元组),执行后续的查流表步骤;如果不存在,说明该报文不是网络应用的报文,流程结束;
上述四元组可以包括:源IP、目的IP、源端口、目的端口;五元组可以包括:源IP、目的IP、源端口、目的端口以及协议号。
在查流表时,可以根据报文的四元组(或者五元组)计算流的标识信息,使用计算得到的标识信息查找流表中是否已经记录有该标识信息,如果是,更新流表中该标识信息对应的统计信息;如果否,在流表中根据该流的标识信息创建流结点,更新流结点中该流的统计信息。
在报文分析时,流量上报组件141可以通过预设流模型,过滤接收到的报文,从而得到目标流的全部或者部分报文,例如如果使用前述心跳流报文的流模型,则可以得到目标流的心跳流报文。
上述流模型可以通过配置文件配置给流量上报组件,上述配置文件可以在步骤1206中流量感知组件发送的流量上报请求中携带。流模型中记录有报文需要匹配的特征。举例来说,如图18所示,上述心跳流报文可以在报文载荷的第6个字节具有固定的特征信息,例如上行心跳流报文中的特征信息为0x64,下行心跳流报文中的特征信息为0x65,则可以在流模型中预设匹配特征filterStr,在上行流中匹配0x64,在下行流中匹配0x65,匹配的位置为偏移UDP载荷6个字节。
如图19所示,代码逻辑可以通过memcmp比较报文内容跟配置的匹配特征 filterStr是否一致。具体代码为:if(memcmp(rpt_cfg->filter_str[i],payload+filter_str_offset,rpt_cfg->filter_str_len[i])==0),memcmp比较得到与匹配特征filterStr一致的报文,从而过滤出目标流的报文,也即过滤出目标流。
步骤S3,根据流上报策略将匹配到的目标流以及目标流的统计信息进行上报。
具体的,过滤出的目标流的报文可以存储于SKB队列,按照目标流的上报策略进行周期性上报或者即时上报。
如果周期性上报,可以在每个周期结束时将目标流在本周期内接收到的部分或者全部报文(例如,本周期接收到的该目标流的最后一个报文)上报至流量感知组件,可选地,还可以将本周期内对目标流的报文统计信息(例如,报文数量,字节数等)上报至流量感知组件。
如果即时上报,可以将匹配得到的报文直接上报至流量感知组件。
通过上述处理,可以在流量上报组件中精确匹配过滤出目标流的报文,在流量感知组件中使用上报的报文做网络质量评估。
步骤1308:流量感知组件133检测时延敏感流,如果是,执行步骤1309,如果否,执行步骤1314。
具体地,可以预先总结不同应用的不同时延敏感流的报文的特征信息,包括但不限于:协议类型(TCP/UDP)、端口号、数据包传输特征(大小、个数、传输速率等)、数据包中特定字符串,等。在步骤1206中可以将当前应用的时延敏感流的特征信息下发至流量感知组件133。相应的,流量感知组件可以依据当前应用的时延敏感流的报文特征信息,对流量上报组件141上报的报文进行特征信息匹配或者统计校验,从而判断当前使用的蜂窝通道上承载的当前应用的若干条流分别是时延敏感流还是非时延敏感流。
以某一时延敏感流的报文包括以下特征信息为例:报文的协议类型、端口号、数据包中包含特定字符串、数据包传输特征;则流量感知组件133可以通过例如图20所示的流程实现该时延敏感流的检测:
将报文依次进行协议类型匹配、端口号匹配、数据包中是否包含特定字符串的匹配、特定字符串的匹配、数据包传输特征的匹配,匹配结果均为成功时,则报文所属流为时延敏感流,否则为非时延敏感流。
在一种可能的实现方式中,流量感知组件133可以根据报文的UDP协议号和特定传来进行时延敏感流的检测。以王者荣耀为例:王者荣耀中游戏对战流的报文中具有特定的udp协议号和报文头特征payload=0x00010000,则流量感知组件133可以根据UDP协议号和上述报文头特征对流量上报组件141上报的报文进行特征信息匹配,以此判断一条流是否是游戏对战流,代码示例如图21所示。
在另一种可能的实现方式中,流量感知组件133可以根据报文的协议类型和报文个数来进行时延敏感流的检测。以和平精英为例:和平精英中游戏对战流在每个500ms的周期中传输大于10个UDP报文,则流量感知组件133可以统计在若干个周期中每个周期接收到的每一条流的UDP报文的个数,如果某一条流的UDP报文的个数大于预设个数阈值(例如10个),则判断该条流是游戏对战流,否则不是游戏 对战流,和平精英游戏中游戏对战流的代码示例例如图10所示。
可选地,上述时延敏感流以游戏对战流为例,还可以是通信应用中的视频通话流、音频通话流等;非时延敏感流例如可以是下载流、浏览流等。
步骤1309:流量感知组件133向流级路径管理组件131指示流A的流类型是时延敏感流。
步骤1310:流级路径管理组件131判断当前使用的蜂窝通道是否满足流A的传输需求,如果满足,流A继续承载在蜂窝通道上,则本分支流程结束;如果不满足,执行步骤1311。
具体地,在步骤1305中通道级路径管理组件123已经通过通知消息将蜂窝通道的评估结果发送给流级路径管理组件131,流级路径管理组件131可以根据上述蜂窝通道的评估结果判断蜂窝通道是否满足流A的传输需求。在一种可能的实现方式中,流级路径管理组件131可以判断蜂窝通道的时延是否小于一预设阈值,如果小于,则判断蜂窝通道满足流A的传输需求,否则,判断蜂窝通道不满足流A的传输需求。
如果蜂窝通道满足流A的传输需求,则流级路径管理组件决策流A继续承载在蜂窝通道上,从而既保证流A的传输质量,又防止流A从蜂窝通道切换至WIFI通道的通道切换时延对流A的传输质量造成影响,进而防止业务执行出现卡顿,提升用户体验。
步骤1311:流级路径管理组件131向流级策略管理组件132发送通道切换指示。
具体地,流级路径管理组件判断当前使用的蜂窝通道不满足流A的传输需求,则向流级策略管理组件132发送通道切换指示,该通道切换指示用于指示流级策略管理组件132将流A切换至WIFI通道。
步骤1312:流级策略管理组件132向策略执行组件142发送通道切换指示。
具体地,流级策略管理组件132发送的上述通道切换指示用于指示策略执行组件142将流A的网络通道切换至WIFI通道。
步骤1313:策略执行组件142执行通道切换。
具体地,策略执行组件142响应于接收到的通道切换指示,将流A的网络通道切换为WIFI通道。
策略执行组件142执行通道切换后,本分支流程结束。
步骤1314:流量感知组件133向流级路径管理组件131指示流A的流类型是非时延敏感流。
步骤1315:流级路径管理组件131判断WIFI通道是否满足流A的传输需求,如果不满足,流A继续承载在蜂窝通道上,则本分支流程结束;如果满足,执行步骤1316。
步骤1316:流级路径管理组件131向流级策略管理组件132发送通道切换指示。
具体地,流级路径管理组件判断WIFI通道满足流A的传输需求,向流级策略管理组件132发送通道切换指示,该通道切换指示用于指示流级策略管理组件132将流A切换至WIFI通道。
步骤1317:流级策略管理组件132向策略执行组件142发送通道切换指示。
具体地,流级策略管理组件132发送的上述通道切换指示用于指示策略执行组件142将流A的网络通道切换至WIFI通道。
可选地,流级策略管理组件132也可以将网络通道上承载的当前网络应用的其他的非时延敏感流均切换至WIFI通道。
步骤1318:策略执行组件142执行通道切换。
具体地,策略执行组件142响应于接收到的通道切换指示,将流A的网络通道切换为WIFI通道。
策略执行组件142执行通道切换后,本分支流程结束。
可以理解的是,上述使用第一设备进行游戏对战的场景仅为示例性说明,并不构成对本申请实施例的限定,在一些实施例中,还可以包括使用第一设备进行音视频通话、直播等对卡顿容忍率较低、时延较敏感的业务场景。
本申请实施例的通道切换方法,在启用优先级更高的网络通道后,对于网络应用的业务运行影响较大的流,不将其切换至新启用的网络通道,从而可以减少上述流的网络通道切换,进而减少上述流的网络通道切换导致的业务运行卡顿的问题,提高用户体验。
本申请实施例还提供一种电子设备,所述设备包括存储介质和中央处理器,所述存储介质可以是非易失性存储介质,所述存储介质中存储有计算机可执行程序,所述中央处理器与所述非易失性存储介质连接,并执行所述计算机可执行程序以实现本申请图7~图14任一实施例提供的方法。
本申请实施例还提供一种电子设备,包括:一个或多个处理器;存储器;以及一个或多个计算机程序,其中所述一个或多个计算机程序被存储在所述存储器中,所述一个或多个计算机程序包括指令,当所述指令被所述设备执行时,使得所述设备执行图7~图14任一实施例提供的方法。
本申请实施例还提供一种计算机可读存储介质,该计算机可读存储介质中存储有计算机程序,当其在计算机上运行时,使得计算机执行本申请图7~图14任一实施例提供的方法。
本申请实施例还提供一种计算机程序产品,该计算机程序产品包括计算机程序,当其在计算机上运行时,使得计算机执行本申请图7~图14任一实施例提供的方法。
可以理解的是,上述电子设备等为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,本申请实施例能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请实施例的范围。
本申请实施例可以根据上述方法示例对上述电子设备等进行功能模块的划分,例如,可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个处理模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件 功能模块的形式实现。需要说明的是,本申请实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请实施例各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:快闪存储器、移动硬盘、只读存储器、随机存取存储器、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。

Claims (15)

  1. 一种通道切换方法,应用于电子设备,所述电子设备包括第一网络通道和第二网络通道,所述第二网络通道的使用优先级高于所述第一网络通道的使用优先级;其特征在于,所述方法包括:
    启动第一应用,所述第一应用包括第一数据流,所述第一数据流承载在所述第一网络通道上;
    在检测到所述第二网络通道被启用,且检测到所述第一数据流是预设类型的数据流时,保持所述第一数据流承载在所述第一网络通道上不变。
  2. 根据权利要求1所述的方法,其特征在于,还包括:
    在检测到所述第二网络通道被启用、且检测到所述第一数据流不是预设类型的数据流时,将承载所述第一数据流的网络通道切换为所述第二网络通道。
  3. 根据权利要求1或2所述的方法,其特征在于,所述保持所述第一数据流承载在所述第一网络通道上不变之前,还包括:
    确定所述第一网络通道的网络质量满足所述第一数据流的传输需求。
  4. 根据权利要求3所述的方法,其特征在于,还包括:
    确定被启用的所述第一网络通道的网络质量不满足所述第一数据流的传输需求,将承载所述第一数据流的网络通道切换为所述第二网络通道。
  5. 根据权利要求2所述的方法,其特征在于,将承载所述第一数据流的网络通道切换为所述第二网络通道之前,还包括:
    确定被启用的所述第二网络通道的网络质量满足所述第一数据流的传输需求。
  6. 根据权利要求5所述的方法,其特征在于,还包括:
    确定被启用的所述第二网络通道的网络质量不满足所述第一数据流的传输需求,保持所述第一数据流承载在所述第一网络通道上不变。
  7. 根据权利要求1至6任一项所述的方法,其特征在于,根据以下至少一个参数检测所述第一数据流是否是预设类型的数据流:协议类型、端口号、报文传输特征、报文中特定字符串;所述报文传输特征包括以下至少一个特征:报文大小、预设时长内报文个数、报文的传输速度。
  8. 根据权利要求1至7任一项所述的方法,其特征在于,所述预设类型是时延敏感流,类型为所述时延敏感流的数据流对时延敏感。
  9. 根据权利要求1至8任一项所述的方法,其特征在于,所述启动第一应用之后,检测到所述第一数据流是预设类型的数据流或者检测到所述第一数据流不是预设类型的数据流之前,还包括:
    从所述第一网络通道承载的报文中获取所述第一应用的报文;
    从所述第一应用的报文中获取所述第一数据流的报文。
  10. 根据权利要求1至9任一项所述的方法,其特征在于,保持所述第一数据流承载在所述第一网络通道上不变之后,还包括:
    检测到所述第一网络通道上承载的所述第一数据流传输结束,且所述第一网络通道上未承载数据流,关闭所述第一网络通道。
  11. 根据权利要求1至10任一项所述的方法,其特征在于,检测到所述第二网络通道被启用之前,还包括:
    确定所述第一应用是预设白名单中的应用。
  12. 根据权利要求1至11任一项所述的方法,其特征在于,所述第一网络通道是蜂窝通道,所述第二网络通道是WIFI通道;或者,
    所述第一网络通道是辅WIFI通道,所述第二网络通道是主WIFI通道。
  13. 一种电子设备,其特征在于,包括:存储器,所述存储器用于存储计算机程序代码,所述计算机程序代码包括指令,当所述电子设备从所述存储器中读取所述指令,以使得所述电子设备执行权利要求1至12中任一项所述的方法。
  14. 一种计算机可读存储介质,其特征在于,包括计算机指令,当所述计算机指令在所述电子设备上运行时,使得所述电子设备执行权利要求1至12中任一项所述的方法。
  15. 一种计算机程序产品,其特征在于,当所述计算机程序产品在计算机上运行时,使得所述计算机执行权利要求1至12中任一项所述的方法。
PCT/CN2022/086641 2021-06-16 2022-04-13 通道切换方法、电子设备及存储介质 WO2022262399A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP22823886.1A EP4216501A4 (en) 2021-06-16 2022-04-13 METHOD FOR SWITCHING CHANNELS, ELECTRONIC DEVICE AND STORAGE MEDIUM
US18/034,998 US20240022518A1 (en) 2021-06-16 2022-04-13 Channel Switching Method, Electronic Device and Storage Medium

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN202110666547 2021-06-16
CN202110666547.5 2021-06-16
CN202111135318.7 2021-09-27
CN202111135318.7A CN114172791B (zh) 2021-06-16 2021-09-27 通道切换方法、电子设备及存储介质

Publications (1)

Publication Number Publication Date
WO2022262399A1 true WO2022262399A1 (zh) 2022-12-22

Family

ID=80476800

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/086641 WO2022262399A1 (zh) 2021-06-16 2022-04-13 通道切换方法、电子设备及存储介质

Country Status (4)

Country Link
US (1) US20240022518A1 (zh)
EP (1) EP4216501A4 (zh)
CN (2) CN114172791B (zh)
WO (1) WO2022262399A1 (zh)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114172791B (zh) * 2021-06-16 2023-06-02 荣耀终端有限公司 通道切换方法、电子设备及存储介质
CN113795040B (zh) * 2021-06-16 2022-10-18 荣耀终端有限公司 通道切换方法、电子设备及存储介质
CN116709368B (zh) * 2022-10-17 2024-04-16 荣耀终端有限公司 一种网络加速方法和装置
CN117835350A (zh) * 2024-03-01 2024-04-05 武汉昊一源科技有限公司 信道切换方法、设备、计算机程序产品及存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110049525A (zh) * 2019-04-08 2019-07-23 Oppo广东移动通信有限公司 网络连接方法、装置、电子设备及介质
US20200413296A1 (en) * 2018-03-27 2020-12-31 Huawei Technologies Co., Ltd. Network switching method, communications apparatus, and communications device
CN114172791A (zh) * 2021-06-16 2022-03-11 荣耀终端有限公司 通道切换方法、电子设备及存储介质

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9160497B2 (en) * 2012-07-02 2015-10-13 Intel Corporation Application continuity with reroute and reset in a wireless communication network
KR102045332B1 (ko) * 2013-03-26 2019-11-18 삼성전자 주식회사 이동통신 시스템에서 무선랜을 이용해서 트래픽을 오프 로드하는 방법 및 장치
WO2015134624A1 (en) * 2014-03-04 2015-09-11 Google Technology Holdings LLC Handover method based on seamless mobility conditions
CN106060884B (zh) * 2016-05-19 2019-08-20 维沃移动通信有限公司 一种网络切换方法和移动终端
CN108337706B (zh) * 2018-02-05 2021-02-26 Oppo广东移动通信有限公司 一种无线网络的切换方法、移动终端及存储介质
CN109316743A (zh) * 2018-07-31 2019-02-12 努比亚技术有限公司 一种游戏控制方法、终端及计算机可读存储介质
CN110944369B (zh) * 2019-09-18 2021-02-23 华为技术有限公司 一种网络切换方法、终端设备、芯片和可读存储介质

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200413296A1 (en) * 2018-03-27 2020-12-31 Huawei Technologies Co., Ltd. Network switching method, communications apparatus, and communications device
CN110049525A (zh) * 2019-04-08 2019-07-23 Oppo广东移动通信有限公司 网络连接方法、装置、电子设备及介质
CN114172791A (zh) * 2021-06-16 2022-03-11 荣耀终端有限公司 通道切换方法、电子设备及存储介质

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
HU, JIANFEI: "Analysis of The Positioning and Development Strategy of WLAN Network in LTE Era", ELECTRONICS WORLD., vol. 22, 1 January 2013 (2013-01-01), pages 146 - 147, XP093015375 *
See also references of EP4216501A4 *

Also Published As

Publication number Publication date
EP4216501A4 (en) 2024-04-17
CN114172791B (zh) 2023-06-02
CN114172791A (zh) 2022-03-11
EP4216501A1 (en) 2023-07-26
US20240022518A1 (en) 2024-01-18
CN116847021A (zh) 2023-10-03

Similar Documents

Publication Publication Date Title
WO2022262398A1 (zh) 通道切换方法、电子设备及存储介质
WO2022262399A1 (zh) 通道切换方法、电子设备及存储介质
CN115484648B (zh) 通道切换方法、电子设备及存储介质
WO2023273317A1 (zh) 通道切换方法、电子设备及存储介质
WO2020143380A1 (zh) 一种数据传输方法及电子设备
WO2021115007A1 (zh) 一种网络切换方法及电子设备
CN113890905B (zh) 通道切换方法、电子设备及存储介质
CN110913424B (zh) 网络连接控制方法和装置、终端、计算机存储介质
WO2020019533A1 (zh) 一种数据传输方法及电子设备
US11997736B2 (en) Connection establishment method and terminal device
CN113810965B (zh) 通道切换方法、电子设备及存储介质
WO2020124447A1 (zh) 面向多卡的网络管理
WO2023087853A1 (zh) 一种网络加速方法、电子设备、芯片系统及存储介质
CN116709442A (zh) 一种无线网络切换方法和电子设备
RU2802678C1 (ru) Способ переключения каналов, электронное устройство и носитель хранения данных
CN115002797B (zh) 一种网络质量的检测方法及相关电子设备
CN116709368B (zh) 一种网络加速方法和装置
RU2811567C1 (ru) Способ переключения каналов, электронное устройство и носитель данных
WO2024082811A1 (zh) 一种网络加速方法和装置
WO2021143921A1 (zh) 一种多路径传输控制的方法及控制装置
CN116155729A (zh) 基于用户流量画像的网络加速方法及相关电子设备
WO2023001044A1 (zh) 数据处理方法及电子设备
CN116744329A (zh) 一种网络加速方法和电子设备
CN117915356A (zh) 一种网络加速方法和装置
CN117354876A (zh) 一种数据迁移方法、电子设备和组网系统

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22823886

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2022823886

Country of ref document: EP

Effective date: 20230419

WWE Wipo information: entry into national phase

Ref document number: 18034998

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE