WO2023087850A1 - 网络加速方法、电子设备、芯片系统及可读存储介质 - Google Patents

网络加速方法、电子设备、芯片系统及可读存储介质 Download PDF

Info

Publication number
WO2023087850A1
WO2023087850A1 PCT/CN2022/117085 CN2022117085W WO2023087850A1 WO 2023087850 A1 WO2023087850 A1 WO 2023087850A1 CN 2022117085 W CN2022117085 W CN 2022117085W WO 2023087850 A1 WO2023087850 A1 WO 2023087850A1
Authority
WO
WIPO (PCT)
Prior art keywords
network
electronic device
data stream
quality
application
Prior art date
Application number
PCT/CN2022/117085
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 EP22894390.8A priority Critical patent/EP4344171A1/en
Publication of WO2023087850A1 publication Critical patent/WO2023087850A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/24Multipath
    • 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
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/22Alternate routing
    • 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/2483Traffic characterised by specific attributes, e.g. priority or QoS involving identification of individual flows
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • H04L67/63Routing a service request depending on the request content or context
    • 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/0268Traffic management, e.g. flow control or congestion control using specific QoS parameters for wireless networks, e.g. QoS class identifier [QCI] or guaranteed bit rate [GBR]
    • 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/10Flow control between communication endpoints
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W36/00Hand-off or reselection arrangements
    • H04W36/24Reselection being triggered by specific parameters
    • H04W36/26Reselection being triggered by specific parameters by agreed or negotiated communication parameters
    • H04W36/28Reselection being triggered by specific parameters by agreed or negotiated communication parameters involving a plurality of connections, e.g. multi-call or multi-bearer connections
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers
    • 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/24Reselection being triggered by specific parameters
    • H04W36/30Reselection being triggered by specific parameters by measured or perceived connection quality data
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W88/00Devices specially adapted for wireless communication networks, e.g. terminals, base stations or access point devices
    • H04W88/02Terminal devices
    • H04W88/06Terminal devices adapted for operation in multiple networks or having at least two operational modes, e.g. multi-mode terminals

Definitions

  • the present application relates to the field of network communication, in particular to a network acceleration method, an electronic device, a chip system and a readable storage medium.
  • the quality of the network used by the application software to communicate with the corresponding server is poor, there will be a freeze phenomenon, which will affect the user experience.
  • the quality of the currently used network can be evaluated based on the signal strength of the currently used network, and a network with better quality is used when the quality of the currently used network is poor.
  • this method of improving network quality still has lagging phenomenon in some application software usage scenarios.
  • the present application provides a network acceleration method, an electronic device, a chip system and a readable storage medium, so as to reduce the stuck phenomenon of the electronic device.
  • the present application provides a network acceleration method, the method comprising:
  • the electronic device runs the first application, and the electronic device transmits the first data stream and the second data stream of the first application through the first network card, the first network card is a wireless LAN network card, and the first network card is used to connect to a wireless router;
  • the electronic device transmits the first data stream through the second network card, and transmits the first data stream through the first network card Transmitting the second data stream, the stream quality parameters include at least one of the following parameters: delay, rate, packet loss rate, retransmission rate, and message response timeout;
  • the electronic device transmits the first data stream and the second data stream through the second network card, and the first condition of the stream quality parameter is better than The second condition for the stream quality parameter.
  • the first data stream for example, the data stream during a video call
  • the first application for example, communication software
  • the second data stream for example, the data stream during page browsing
  • a first condition may be set for the stream quality parameter of the first data stream
  • a second condition may be set for the stream quality parameter of the second data stream, and when the stream quality parameter of the first data stream satisfies the first condition, the first data stream is transferred from The original network card is switched to the new network card for transmission, and when the stream quality parameter of the second data stream meets the second condition, the second data stream is switched from the original network card to the new network card for transmission.
  • the flow quality parameter adopts the method of evaluating the transmission quality at the flow level. Compared with the method of evaluating the transmission quality at the channel level through the network signal strength, it can evaluate the transmission quality of the data stream in a more refined manner.
  • the flow sets different evaluation conditions (for example, the first condition, the second condition), which can provide opportunities for different data flows to meet the data flow for network acceleration (for example, switching to other network cards), thereby reducing the application card. Dayton phenomenon.
  • the first data stream is a data stream composed of data packets with the first characteristic
  • the second data stream is a data stream composed of data packets with the second characteristic
  • the first At least one of the following parameters in the characteristic and the second characteristic is different: the transmission protocol, the transmission port and the header characteristic of the data message.
  • different data streams can be distinguished by the relevant information (transmission protocol, transmission port, and header characteristics) carried in the data message, so that stream-level identification, stream-level quality assessment, and stream-level network switching can be realized.
  • the method further includes:
  • the electronic device acquires a first condition corresponding to the first feature and a second condition corresponding to the second feature;
  • the electronic device judges whether the stream quality parameter of the first data stream satisfies the first condition, and judges whether the stream quality parameter of the second data stream satisfies the second condition.
  • different conditions can be set in advance for different characteristics.
  • the first condition can be obtained , and then determine whether the stream quality parameter of the data stream satisfying the first characteristic satisfies the first condition.
  • the method further includes:
  • the electronic device transmits the first data stream through the first network card
  • the electronic device When the stream quality parameter of the first data stream satisfies the first condition, the electronic device transmits the first data stream through the second network card;
  • the electronic device transmits the second data stream through the first network card
  • the electronic device When the stream quality parameter of the second data stream satisfies the second condition, the electronic device transmits the second data stream through the second network card.
  • the stream quality parameter of the first data stream when the stream quality parameter of the first data stream satisfies the second condition, the stream quality parameter of the first data stream satisfies the first condition.
  • the transmission of the first data stream by the electronic device through the second network card includes:
  • the electronic device checks whether the electronic device stores a backup network
  • the electronic device If the electronic device stores the backup network, the electronic device transmits the first data stream through the backup network, where the backup network includes a second network corresponding to the second network card.
  • the backup network in order to timely switch the data flow that satisfies the corresponding flow quality evaluation condition to another network, the backup network can be obtained and stored in advance, so that when the flow quality parameter of the data flow meets the corresponding condition, the corresponding The data flow for the evaluated condition is switched to the alternate network.
  • the method further includes:
  • the electronic device acquires the network quality parameters of the network corresponding to the third network card of the electronic device, where the third network card is a network card other than the first network card in the electronic device, and the network quality parameters include the following At least one item: bandwidth, delay and air interface rate;
  • the electronic device stores the second network corresponding to the second network card as a backup network, and the network quality is determined by a network quality parameter.
  • the backup network can be obtained first, and then the data stream can be switched to the backup network for transmission when it is determined that the flow quality parameter of the data stream satisfies the corresponding evaluation condition next time.
  • the method before the electronic device stores the second network corresponding to the second network card as a backup network, the method further includes:
  • the electronic device wakes up the second network corresponding to the second network card.
  • the method before the electronic device stores the second network corresponding to the second network card as a backup network, the method further includes:
  • the electronic device acquires a network quality parameter of the first network corresponding to the first network card
  • the electronic device stores the second network corresponding to the second network card as a backup network including:
  • the electronic device stores the second network corresponding to the second network card as a backup network.
  • the network quality of the network with the best quality among other networks other than the active network is better than that of the active network.
  • the network quality of the primary network is better than that of the primary network, it will be used as a backup network to avoid switching the data flow from the primary network whose network quality does not meet the requirements of the current data flow to a network with worse network quality.
  • running the first application on the electronic device includes:
  • the electronic device runs the first application in the foreground
  • the method also includes:
  • the electronic device After the electronic device detects that the first application is running in the foreground, the electronic device sequentially executes the step of determining the primary network according to the priority order of the network cards of the electronic device until the primary network of the electronic device is obtained;
  • the steps of determining the active network include:
  • the electronic device acquires the network status of the network corresponding to the fourth network card, where the fourth network card is a network card of the electronic device;
  • the electronic device When the network state of the fourth network card is available, the electronic device obtains the network quality parameter of the fourth network card; when the network state of the fourth network card is unavailable, end the step of determining the primary network;
  • the network card priority when the network card priority is set for the electronic device, the network card that is available and whose network quality meets the preset requirements (for example, the network quality parameter is within the preset range) will be selected according to the priority order of the network card as the main network card for transmission.
  • the data flow of an application running in the foreground of an electronic device Therefore, after the application is switched to the foreground, the main network card of the electronic device can be obtained according to the same logic, and the main network card is the network card that transmits the data stream of the first application.
  • obtaining the network quality parameters of the first network corresponding to the first network card by the electronic device includes:
  • the electronic device After obtaining the active network of the electronic device, the electronic device monitors the network quality parameters of the active network in a first period.
  • obtaining the network quality parameters of the first network corresponding to the first network card by the electronic device includes:
  • the electronic device acquires a network for transmitting the first data stream and the second data stream, and the network for transmitting the first data stream and the second data stream is the first network corresponding to the first network card;
  • the electronic device monitors a network quality parameter of the first network in a first period.
  • the present application may also determine the primary network through the network transmitting the data flow of the current foreground application. Thereby, a variety of ways are provided to obtain the network quality parameters of the active network, so as to compare the quality (or high and low) of the network quality when determining the standby network.
  • the method further includes:
  • the electronic device runs the second application, and the electronic device transmits the data stream of the second application through the first network card;
  • the electronic device transmits the first sub-data stream through the first network card, and transmits the second sub-data stream through the second network card, the third data stream is a data stream having a third characteristic, The first sub-data stream and the second sub-data stream belong to the third data stream.
  • each sub-data stream in the data stream satisfying a specific feature is distributed to multiple network cards of the electronic device for transmission, so as to increase the transmission speed of the data stream with the specific feature.
  • the method when the data stream of the second application includes the third data stream, the method further includes:
  • the electronic device acquires a third condition corresponding to the third feature
  • the method further includes:
  • the electronic device When the first sub-data stream satisfies the third condition and the second sub-data stream does not satisfy the third condition, the electronic device transmits the first sub-data stream and the second sub-data stream through the second network card.
  • the method further includes:
  • the electronic device transmits the first sub-data stream and the second sub-data stream through the first network card.
  • the stream quality parameters of the sub-data streams on each network card can also be checked, so that when the stream quality parameters of the sub-data streams transmitted by a certain network card meet the corresponding conditions , switch to another network card with better quality for transmission.
  • an electronic device including a processor, and the processor is configured to run a computer program stored in a memory to implement the method of any one of the first aspects of the present application.
  • a chip system including a processor, the processor is coupled to a memory, and the processor executes a computer program stored in the memory, so as to implement the method in any one of the first aspects of the present application.
  • a computer-readable storage medium stores a computer program.
  • the computer program is executed by one or more processors, the method in any one of the first aspects of the present application is implemented.
  • the present application provides a computer program product that, when the computer program product is run on a device, causes the device to execute any one of the methods in the first aspect of the present application.
  • FIG. 1 is a schematic diagram of a hardware structure of an electronic device provided in an embodiment of the present application
  • FIG. 2 is a schematic diagram of an application scenario provided by an embodiment of the present application.
  • FIG. 3 is a schematic diagram of a network acceleration method provided by an embodiment of the present application.
  • FIG. 4 is a schematic diagram of another application scenario provided by the embodiment of the present application.
  • FIG. 5 is a schematic diagram of another network acceleration method provided by the embodiment of the present application.
  • FIG. 6 is a schematic flowchart of a network acceleration method provided in an embodiment of the present application.
  • FIG. 7 is a technical architecture diagram provided by an embodiment of the present application.
  • FIG. 8 is a sequence diagram of a network acceleration method provided in an embodiment of the present application.
  • FIG. 9 is a sequence diagram of another network acceleration method provided by an embodiment of the present application.
  • FIG. 10 is a sequence diagram of another network acceleration method provided by the embodiment of the present application.
  • FIG. 11 is a sequence diagram of another network acceleration method provided by the embodiment of the present application.
  • FIG. 12 is a sequence diagram of another network acceleration method provided by the embodiment of the present application.
  • FIG. 13 is a schematic diagram of a data flow reported by a traffic reporting component to a traffic sensing component according to an embodiment of the present application.
  • one or more refers to one, two or more than two; "and/or” describes the association relationship of associated objects, indicating that there may be three types of relationships; for example, A and/or B may mean: A exists alone, A and B exist simultaneously, and B exists alone, wherein A and B may be singular or plural.
  • the character "/" generally indicates that the contextual objects are an "or" relationship.
  • references to "one embodiment” or “some embodiments” or the like in the specification of the present application means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application.
  • appearances of the phrases “in one embodiment,” “in some embodiments,” “in other embodiments,” “in other embodiments,” etc. in various places in this specification are not necessarily All refer to the same embodiment, but mean “one or more but not all embodiments” unless specifically stated otherwise.
  • the terms “including”, “comprising”, “having” and variations thereof mean “including but not limited to”, unless specifically stated otherwise.
  • a network acceleration method provided in an embodiment of the present application may be applicable to electronic devices.
  • the electronic device may be a tablet computer, a mobile phone, a wearable device, a notebook computer, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook, a personal digital assistant (personal digital assistant, PDA) and other electronic devices.
  • the embodiment of the present application does not limit the specific type of the electronic device.
  • Fig. 1 shows a schematic structural diagram of an electronic device.
  • the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, a charging management module 140, a power management module 141, a battery 142, 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, camera 193, display screen 194, and user identification module ( subscriber identification module, SIM) card interface 195 etc.
  • the sensor module 180 may include a pressure sensor 180A, a touch sensor 180K and the like.
  • 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, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural network processor (neural-network processing unit, NPU) wait. Wherein, different processing units may be independent devices, or may be integrated in one or more processors. For example, the processor 110 is configured to execute the network acceleration method in the embodiment of the present application.
  • 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 directly called 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 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.
  • the external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, so as to expand the storage capacity of the electronic device 100.
  • the external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. Such as saving music, video and other files in the external memory card.
  • the internal memory 121 may be used to store computer-executable program codes including instructions.
  • the processor 110 executes various functional applications and data processing of the electronic device 100 by executing instructions stored in the internal memory 121 .
  • the internal memory 121 may include an area for storing programs and an area for storing data. Wherein, the stored program area can store an operating system and at least one application program required by a function (such as a sound playing function, an image playing function, etc.).
  • the internal memory 121 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.
  • 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 charging management module 140 is configured to receive a charging input from a charger.
  • the charger can be a wireless charger or a wired charger.
  • the charging management module 140 can receive charging input from the wired charger through the USB interface 130 .
  • the power management module 141 is used for connecting the battery 142 , the charging management module 140 and the processor 110 .
  • the power management module 141 receives the input from the battery 142 and/or the charging management module 140 to provide power for the processor 110 , the internal memory 121 , the external memory, the display screen 194 , the camera 193 , and the wireless communication module 160 .
  • the power management module 141 may also be disposed in the processor 110 . In some other embodiments, the power management module 141 and the charging management module 140 may also be set in the same device.
  • 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 and radiate them through the antenna 1 .
  • 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 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.
  • the audio module 170 is used for converting digital audio signals into analog audio signals for output, and also for converting analog audio input into digital audio signals.
  • the audio module 170 may also be used to encode and decode audio signals.
  • the audio module 170 may be set in the processor 110 , or some functional modules of the audio module 170 may be set in the processor 110 .
  • Speaker 170A also referred to as a "horn" is used to convert audio electrical signals into sound signals.
  • Electronic device 100 can listen to music through speaker 170A, or listen to hands-free calls.
  • Receiver 170B also called “earpiece” is used to convert audio electrical signals into sound signals.
  • the receiver 170B can be placed close to the human ear to receive the voice.
  • the microphone 170C also called “microphone” or “microphone” is used to convert sound signals into electrical signals.
  • the user can make a sound by approaching the microphone 170C with his mouth, and input the sound signal to the microphone 170C.
  • the electronic device 100 may be provided with at least one microphone 170C.
  • the electronic device 100 can be provided with two microphones 170C, which can also implement a noise reduction function in addition to listening to voice information.
  • the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, and realize directional recording functions, etc.
  • the earphone interface 170D is used for connecting wired earphones.
  • the earphone interface 170D can be a USB interface 130, or a 3.5mm open mobile terminal platform (OMTP) standard interface, or a cellular telecommunications industry association of the USA (CTIA) standard interface.
  • OMTP open mobile terminal platform
  • CTIA cellular telecommunications industry association of the USA
  • the pressure sensor 180A is used to sense the pressure signal and convert the pressure signal into an electrical signal.
  • pressure sensor 180A may be disposed on display screen 194 .
  • pressure sensors 180A such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors.
  • a capacitive pressure sensor may be comprised of at least two parallel plates with conductive material.
  • the electronic device 100 determines the intensity of pressure according to the change in capacitance.
  • the electronic device 100 detects the intensity of the touch operation according to the pressure sensor 180A.
  • the electronic device 100 may also calculate the touched position according to the detection signal of the pressure sensor 180A.
  • 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 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 may 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.
  • 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 electronic device 100 may include 1 or N display screens 194 , where N is a positive integer greater than 1.
  • Camera 193 is used to capture still images or video.
  • the electronic device 100 may include 1 or N cameras 193 , where N is a positive integer greater than 1.
  • 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.
  • the embodiment of the present application does not specifically limit the specific structure of the execution subject of a network acceleration method, as long as the code of the network acceleration method in the embodiment of the application can be recorded by running the network acceleration method provided in the embodiment of the application
  • the accelerated method can be processed.
  • the execution subject of a network acceleration method provided in the embodiment of the present application may be a functional module in an electronic device capable of invoking and executing a program, or a processing device applied in an electronic device, such as a chip.
  • Multiple applications can be installed and run in the electronic device shown in FIG. 1 , for example: social communication applications, game applications, audio and video applications, and news applications. These applications can establish network connections with other electronic devices (for example, servers corresponding to the applications) through the electronic devices.
  • application A can establish a network connection with the server corresponding to application A through a wireless network card (also referred to as a Wi-Fi network card) in the electronic device; application A can also communicate with the server through the data service network card in the electronic device.
  • the server corresponding to application A establishes a network connection.
  • the wireless network card is a device that supports wireless local area network (Wireless Local Area Network, WLAN) Internet access;
  • the data service network card is a device that supports packet wireless 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 (TD-SCDMA), High Speed Downlink Packet Access (HSDPA), Wideband Code Division Multiple Access (Wideband Code Division Multiple Access, WCDMA), long term evolution (Long Term Evolution, LTE), fifth generation mobile communication technology (5th Generation Mobile Communication Technology, 5G) and other mobile communication technology Internet access devices.
  • GPRS General packet radio service
  • EDGE Enhanced Data Rate for GSM Evolution, EDGE
  • TD-SCDMA Time Division-Synchronous Code Division Multiple Access
  • HSDPA High Speed Downlink Packet Access
  • WCDMA Wideband Code Division Multiple Access
  • LTE Long Term Evolution
  • 5G fifth generation mobile communication technology
  • 5G Fifth Generation
  • a network channel established between an electronic device through a wireless network card and other electronic devices can be recorded as a Wi-Fi network; a network channel established between an electronic device through a data service network card and other electronic devices can be recorded as a cellular network network.
  • the user uses application A (game application) in the mobile phone to play games, wherein, application A in the mobile phone establishes a network connection with server A of application A through the wireless network card in the mobile phone, and the connection between application A and server A is generated.
  • the data stream A (for example, the data stream generated during the game battle) is transmitted through the Wi-Fi network between the wireless network card on the mobile phone and the wireless router.
  • the user uses the application B (chat application) in the mobile phone to chat, wherein the application B in the mobile phone establishes a network connection with the server B of the application B through the wireless network card of the mobile phone, and the data stream B generated between the application B and the server B (for example, , the data flow generated during chatting) is transmitted through the Wi-Fi network between the wireless network card on the mobile phone and the wireless router.
  • the application B chat application
  • the data sequence transmitted between two electronic devices is recorded as a data stream.
  • the data stream may be a video stream, an audio stream, a download stream, a session stream, and the like.
  • the data flow A since the data flow A generates a larger amount of data per unit time than the data flow B, the data flow A has higher requirements on the quality of the Wi-Fi network than the data flow B. It is relatively smooth for the user to use application B. However, there may be a freeze phenomenon when the user uses application A, resulting in a poor user experience.
  • different applications have different requirements on the quality of the network channel.
  • different network quality assessment algorithms may be set for different applications (or different types of applications).
  • set a transmission quality improvement strategy to accelerate data flow transmission.
  • data stream A can be switched from the current Wi-Fi network to other network channels.
  • the mobile phone can switch the data stream A to the cellular network between the data service network card of the mobile phone and the base station, so as to transmit the data stream A with the server A through the cellular network.
  • the requirements for the quality of the network channel used by the application may be different.
  • the user is still viewing and browsing other information (for example, browsing the circle of friends) while making a video call using application B (chat communication application) in the mobile phone, wherein application B in the mobile phone communicates with the application through the wireless network card in the mobile phone
  • application B chat communication application
  • the server B of B establishes a network connection, and the data stream B1 (for example, the data stream generated by the video call) and the data stream B2 (for example, the data stream generated by browsing the circle of friends) generated between the application B and the server B pass through the wireless network on the mobile phone.
  • the data flow B1 Since the data flow B1 generates a larger amount of data per unit time than the data flow B2, the data flow B1 has higher requirements on the quality of the Wi-Fi network than the data flow B2.
  • the transmission of data stream B1 is relatively smooth (it can be reflected by the stream quality parameters of data stream B1, for example, the stream quality parameters of data stream B1 do not meet the first condition set for data stream B1)
  • the transmission of data stream B2 is also relatively smooth (it can be reflected by the stream quality parameters of data stream B2, for example, the stream quality parameters of data stream B2 do not meet the second condition set for data stream B2), both data stream B1 and data stream B2 Transmission via wireless network card.
  • the transmission of data stream B1 may be stuck (this can be reflected by the stream quality parameters of data stream B1, for example, the stream quality parameters of data stream B1 meet the first condition set for data stream B1) , the transmission of data stream B2 is still relatively smooth (it can be reflected by the stream quality parameters of data stream B2, for example, the stream quality parameters of data stream B2 do not meet the second condition set for data stream B2, it may meet the first condition, or it may does not satisfy the first condition), the data flow B1 is switched to the data service network card for transmission, and the data flow B2 is still transmitted through the wireless network card.
  • the transmission of data stream B1 may freeze (it can be reflected by the stream quality parameters of data stream B1, for example, the stream quality parameters of data stream B1 meet the first condition set for data stream B1, The second condition may or may not be met), and the transmission of data stream B2 may also freeze (it can be reflected by the stream quality parameters of data stream B2, for example, the stream quality parameters of data stream B2 meet the requirements set for data stream B2 The second condition), the data flow B1 and the data flow B2 are both switched to the data service network card for transmission.
  • the first condition of the flow quality parameter is better than the second condition.
  • the process of network quality gradually deteriorating.
  • the network quality may also change directly from the top scene (good Wi-Fi network) in Figure 3 to the bottom scene (poor Wi-Fi network).
  • application B can be used as an example of the first application
  • data stream B1 can be used as an example of the first data stream of the first application
  • data stream B2 can be used as an example of the second data stream of the first application example.
  • the wireless local area network card can be used as an example of the first network card
  • the data service network card can be used as an example of the second network card.
  • a download flow A1 is generated, and when the user uses application A to conduct a session, a session flow A2 is generated. Both the download stream A1 and the session stream A2 can be transmitted through the Wi-Fi network between the wireless network card and the 2.4GHz wireless router.
  • the difference in network channel quality is not the same. big.
  • the data flow A1 since the data flow A1 generates a larger amount of data per unit time than the data flow A2, the data flow A1 has higher requirements on the quality of the network channel than the data flow B. It is relatively smooth for the user to use application A for conversation. However, when the user uses application A for download, the user may feel that the download rate is too slow, resulting in poor user experience.
  • different network quality assessment algorithms may be set for different service scenarios of the same application.
  • set a transmission quality improvement policy to accelerate data flow transmission.
  • the data stream A1 may be allocated to multiple network channels for parallel transmission.
  • the mobile phone is provided with a wireless network card 1 supporting 2.4GHz transmission and reception; a wireless network card 2 is also provided with a 5.0GHz transmission and reception; and a data service network card is also provided.
  • Data stream A1 may include multiple sub-data streams, and the multiple sub-data streams may be divided into three groups of data streams: data stream A1-1, data stream A1-2, and data stream A1-3. The three data streams are respectively distributed to three network channels for transmission.
  • the wireless router in FIG. 5 may be one wireless router that supports both 2.4GHz transceiver and 5.0GHz transceiver, or two routers that support 2.4GHz transceiver and 5.0GHz transceiver respectively.
  • application A can be recorded as a second application, and the second application can generate a third data stream (such as a download stream), the third data stream includes at least two sub-data streams, and the download stream A1-1 can be recorded as As the second sub-data stream, the download stream A1-3 may be recorded as the first sub-data stream.
  • the second application may be the same application as the first application, or may be other applications than the first application.
  • the first network card is wireless network card 1.
  • the second network card is a data service network card, and the wireless network card 2 will not be described in detail.
  • the download stream is switched to the data service network card.
  • a special stream a data stream with the third feature, for example, a download stream
  • the network quality of any network card (for example, the first network card) of the flow can no longer meet the requirements of the sub-data flow located on the network card (that is, satisfy the evaluation condition set for the third data flow, and the evaluation condition is recorded as the third condition) , it is necessary to switch the sub-data flow on the network card that does not meet the requirements to other network cards with better network quality for transmission.
  • switch the download flow A1-3 satisfying the third condition on the first network card to the data service network card (the download flow A1-1 does not meet the third condition at this time), and the data service network card will transmit the download flow A1-1 and Streams A1-3 are downloaded.
  • switch A1-1 downloaded from the second network card to the wireless network card (the download stream A1-3 does not meet the third condition at this time), and the download stream A1-1 and A1-3 will be transmitted on the wireless network card.
  • the sub-data streams that do not meet the third condition can also be switched to other network cards that meet the requirements.
  • different data streams have different characteristics.
  • the first data stream is a data stream with the first feature
  • the second data stream is a data stream with the second feature
  • the third data stream is a data stream with the third feature.
  • characteristic data flow the network quality requirements of each data stream can be judged by their corresponding evaluation conditions.
  • the transmission quality evaluation condition corresponding to the first data stream is the first condition
  • the transmission quality evaluation condition corresponding to the second data stream is the second condition.
  • the second condition, the transmission quality evaluation condition corresponding to the third data stream is the third condition.
  • the first, second, third, etc. in the embodiments of the present application are only used to represent different targets in different examples. In practical applications, different targets in different examples may be the same target or different targets. Target.
  • the third data stream and the first data stream may be the same type of data stream (with the same characteristics) of the same application, but they are named differently in different embodiments due to different schemes. Different data streams for different applications are also possible.
  • whether the network quality of a certain network channel is good (excellent) or bad (bad) or the transmission quality of a certain data flow on a certain network channel is good (good) or bad (poor) can be determined by some parameters ( can be recorded as the flow quality parameter) for evaluation.
  • some conditions can be set, for example, when condition 1 is met, the evaluation result is considered to be good (excellent), and when condition 1 is not satisfied, the evaluation result is considered to be bad (poor); or when condition 2 is met (for example, When the first condition, the second condition, and the third condition) in the above example), the evaluation result is regarded as bad (bad), and when the condition 2 is not met, the evaluation result is regarded as good (excellent).
  • the criteria for judging the network quality and the transmission quality in the embodiments of the present application are not limited.
  • the stream quality parameters include at least one of the following: delay, rate, packet loss rate, retransmission rate, and message response timeout.
  • delay incurred in the following Table 2 and Table 3.
  • the second network card in the above scenario can also be understood as a backup network other than the primary network currently used by the electronic device.
  • this embodiment of the present application provides a network acceleration method.
  • developers can pre-set different network quality evaluation algorithms and different transmission quality improvement strategies for different applications (or different types of applications).
  • a network acceleration method as shown in Table 1 can be obtained.
  • this network acceleration method it may be considered to set a network acceleration policy for different application categories and/or different business scenarios.
  • different network quality evaluation algorithms and/or different transmission quality improvement strategies may be used.
  • FIG. 6 it is a schematic flowchart of a network acceleration method provided by an embodiment of the present application.
  • the flowchart corresponds to the network acceleration method 9 in Table 1 above.
  • step A1 the electronic device detects that application A is running in the foreground.
  • the application A may be any application program in the electronic device that can be connected to the network.
  • the electronic device detects that the application A is running in the foreground may be that the electronic device detects that the application A is running in the foreground after it is started, or it may detect that the application A switches from the background to the foreground.
  • step A2 the electronic device determines whether application A supports network acceleration.
  • an application configuration library is stored in the electronic device, and the application configuration library may be preset by a developer, or may be set or added by a user during use of the electronic device.
  • the application configuration library stores identifiers of applications supporting network acceleration.
  • the electronic device After the electronic device detects that the application A is switched to the foreground, it can obtain the application ID of the application A, and check whether the application ID of the application A exists in the application configuration library. If the application ID of the application A exists, it means that the application A supports network acceleration.
  • the application configuration library can also store multiple application identifiers, and each application identifier uses different characters to indicate whether the application represented by the application identifier supports network acceleration. As an example, "1" may be used to indicate that network acceleration is supported, and "0" may be used to indicate that network acceleration is not supported. Other methods for determining whether an application supports network acceleration are not given one by one.
  • Step A3 in the case that application A supports network acceleration, the electronic device queries the data flow characteristics of application A to obtain a network quality assessment algorithm corresponding to the data flow characteristics of application A.
  • setting different service scenarios facilitates the understanding of the functions of setting different network quality assessment algorithms; on the other hand, it can also determine which network quality assessment algorithm to use based on different service scenarios.
  • the characteristics of data streams generated by different business scenarios may be different. Therefore, it is not necessary to determine the current service scenario of the application A, and the network quality assessment algorithm that should be currently adopted can be determined according to the characteristics of the current data flow of the application A.
  • Various information about the data flow of application A may be stored in the flow feature library of application A.
  • Netfilter component in the system of the electronic device, through which the data stream of the application corresponding to the specific application identifier can be obtained.
  • the Netfilter component may acquire the packets of the data flow of application A on network channel 1. If the network channels carrying the data flow of application A are network channel 1 and network channel 2, the Netfilter component can obtain the packets of the data streams of application A on network channel 1 and network channel 2.
  • packets of the data stream may also be acquired in other ways.
  • the collection of packets of the obtained data flow is a flow feature library.
  • the network quality assessment algorithm may be determined using the protocol, port and packet characteristics of the applied data flow as the characteristics.
  • the protocol is the protocol type when the application transmits the data stream
  • the port is the port used when transmitting the data stream
  • the packet feature is the header feature of the data packet when the application transmits the data stream.
  • the network quality evaluation algorithm that matches this characteristic can be obtained: If the delay exceeds 300ms, or the packet loss rate exceeds 20%, the evaluation result is: stuck.
  • the network quality assessment algorithm may also be determined by other features other than protocol, port, and packet features.
  • multiple data streams may be generated. If the network quality assessment algorithm is determined for the characteristics of multiple data streams, the corresponding network quality assessment algorithm is used to evaluate the transmission of the corresponding data stream. quality.
  • an application when it implements a certain function, it may generate data stream 1 , data stream 2 and data stream 3 .
  • step A4 the electronic device judges whether the relevant parameters of the data stream of the application A meet the transmission quality improvement condition set by the algorithm.
  • the transmission quality assessment result of the data stream of application A (for example, the quality score or quality level can be obtained) can be obtained according to the algorithm model and the relevant parameters of the data stream of application A, and it can be determined according to the transmission quality assessment result whether The transmission quality of this data stream needs to be improved.
  • the algorithm can pre-set a condition for determining that the transmission quality of the data stream needs to be improved, and when the condition is met, acquire a transmission quality improvement strategy and execute the transmission quality improvement strategy.
  • step A3 it is necessary to obtain the time delay and packet loss rate of each data flow of application A.
  • the application A’s stream feature library stores various information about the data stream of the application A, for example, the protocol features of the protocol adopted by the application when using the current network, and the header features of the data packets transmitted when the application uses the current network wait. Of course, it may also include traffic characteristics when the application uses the current network.
  • the traffic characteristics of the application may include: uplink rate, downlink rate, flow interval time, packet interval time, packet size, traffic distribution and other information. Of course, it may also include part of the above-mentioned information, or other information other than the above-mentioned information.
  • the delay, packet loss, downlink rate, and uplink rate can be obtained through traffic characteristics. Therefore, these traffic characteristics can be used as evaluation parameters for network quality assessment algorithms.
  • different network quality assessment algorithms may obtain different parameters for evaluating network quality, for example, may include one or more of the above parameters, and may also include other parameters other than the above parameters. Therefore, the category of parameters included in the traffic characteristics of the application can be determined according to the evaluation parameters of the network quality evaluation algorithm.
  • Step A5 when the relevant parameters of the data flow of application A meet the conditions set by the algorithm, determine the transmission quality improvement strategy according to the characteristics of the data flow of application A.
  • different transmission quality improvement strategies can be set in advance for different business scenarios of different applications (determined by the characteristics of the data flow), and multiple transmission quality improvement strategies are stored in the improvement strategy library.
  • the corresponding relationship between the characteristics of the data flow and the transmission quality improvement strategy can also be set.
  • the transmission quality improvement strategy corresponding to the characteristics of the data flow can be obtained.
  • the transmission quality improvement strategy matching the characteristics can be queried from the improvement strategy library.
  • Step A6 execute the transmission quality improvement strategy.
  • an application may generate multiple data streams in a certain business scenario.
  • the data streams that meet the preset conditions for improving the transmission quality can be switched to other network channels; of course , it is also possible to switch the data streams that meet the preset conditions for improving the transmission quality and the data streams related to the data streams that meet the preset conditions for improving the transmission quality to other network channels.
  • multiple download streams with the same source address and destination address in download applications can be set as related data streams, and video streams and audio streams with the same source address and destination address in chat applications can also be set as related data streams.
  • the stream is set to the relevant data stream; it is also possible to switch the entire data stream of the application to other network channels.
  • the data streams that meet the preset conditions for improving the transmission quality can also be allocated to the electronic Multiple network channels supported by the device; it is also possible to assign the data streams that meet the preset conditions for improving the transmission quality and the data streams related to the data streams that meet the preset conditions for improving the transmission quality to multiple network channels superior.
  • all data streams of the application can also be allocated to multiple network channels supported by the electronic device.
  • the data streams that meet the concurrency condition may be allocated to multiple network channels first.
  • the characteristics of a certain data stream meet the preset conditions for improving the transmission quality, then switch the data stream that meets the preset conditions for improving the transmission quality to a better quality network channel.
  • a corresponding network quality assessment algorithm and a corresponding transmission quality improvement strategy may be determined based on the characteristics of the data stream in Table 2.
  • Table 2 Flow characteristics, network quality assessment algorithms and transmission quality improvement strategies for multiple applications and multiple business scenarios
  • com.tencent.mm in Table 2 can be the WeChat package name
  • com.tencent.tmgp.sgame can be the King of Glory package name.
  • the characteristics of the data flow can be protocol, port and packet characteristics.
  • An entry in Table 2 can set the characteristic conditions of the data flow, the network quality evaluation algorithm and the network quality improvement strategy for a business scenario of an application.
  • Table 2 only lists the protocols, ports, and message characteristics corresponding to some business scenarios of some applications, and it is only for example.
  • Switch in the transmission quality improvement policy may refer to any form of handover in the foregoing embodiments;
  • concurrency may refer to any form of concurrency in the foregoing embodiments.
  • the mobile phone Taobao application can only switch the streams with poor quality evaluation network to other networks, or can switch the number (or proportion) of streams with poor quality to other networks. ) is greater than the preset value (or preset ratio), all streams under the application are switched to other networks.
  • the application may generate 10 streams in a certain business scenario. If only 1 stream or 2 streams are of poor quality, switch the poor-quality stream to another network. If there are 3 or more streams If the quality of the stream is poor, all the streams (10 streams) under the application are all switched to the backup network.
  • different application identifiers can be set for different applications, and when the characteristics of the data flow meet the characteristic conditions, the conditions for improving the transmission quality set by the network quality assessment algorithm can be obtained, and the relevant parameters of the data flow meet the improvement When the condition of the transmission quality is satisfied, the transmission quality improvement strategy is obtained and the transmission quality improvement strategy is executed.
  • Table 2 only lists the characteristics of some data streams of some applications, as well as the corresponding network quality assessment algorithms and transmission quality improvement strategies. In practical applications, other network quality evaluation algorithms and transmission quality improvement strategies can also be used. As an example, the network quality assessment algorithm exemplified in Table 3 may also be used.
  • the network quality transmission algorithm in Table 3 is only used as an example. In practical application, other algorithms than the network quality transmission algorithm shown in Table 3 can also be used, which is not limited in this embodiment of the present application.
  • FIG. 7 it is a technical architecture diagram of a network acceleration method provided by an embodiment of the present application.
  • the technical architecture includes: application layer, service layer, policy layer and kernel layer.
  • FIG. 7 only shows some layers and some components related to the embodiment of the present application. In practical applications, layers and components not shown in FIG. 7 may also be included. Of course, only some of the components shown in FIG. 7 may also be included.
  • environment detection components There are environment detection components, network detection components, channel-level path management components, application-level policy management components, channel and application quality assessment components, and network connection management components in the service layer.
  • the environment detection component is used to detect various events of the upper-layer application. As an example, it can detect the opening and exit of the application, the application that is currently switched to the foreground, and the installation and uninstallation of the application.
  • the network detection component is used to detect the status (on or off, etc.) of the Wi-Fi network supported by the electronic device, and can also detect the status of the data service network supported by the electronic device.
  • a wireless network card 1 with a frequency band of 2.4 GHz and a wireless network card 2 with a frequency band of 5.0 GHz are set in the electronic device.
  • the network detection component can detect whether the wireless network in the 2.4GHz frequency band is on or off; it can also detect whether the wireless network in the 5.0GHz frequency band is on or off.
  • the electronic device is provided with a data service network card 1 of operator A and a data service network card 2 of operator B.
  • the network detection component can detect whether the data service of operator A is on or off; it can also detect whether the data service of operator B is on or off
  • Channel and application quality assessment components are used to assess the quality of network channels.
  • the channel and application quality evaluation component can evaluate the quality of the Wi-Fi network in the 2.4GHz frequency band, and can also evaluate the quality of the Wi-Fi network in the 5.0GHz frequency band.
  • the quality of operator A's cellular network can also be evaluated, and the quality of operator B's cellular network can also be evaluated.
  • the network connection management component is used to start a network channel, that is, to convert the network channel from a dormant state to an awakened state. Among them, the network channel in the wake-up state can be used directly.
  • the channel-level path management component stores the paths of multiple network channels, and is used to request or close any network channel, and can sense the status change of any network channel, and can also perceive the quality of any network channel.
  • the application-level policy management component is used to enable the network acceleration function and enable the monitoring function of data flow.
  • the flow perception component is used to collect statistics on the reported data flow and evaluate the network quality of each flow.
  • the stream-level policy management component stores the transmission quality improvement policy of the stream in the application, and is also used to instruct the execution of the transmission quality improvement policy.
  • the flow-level path management component is used to update the selection of network channels according to the policy changes of the upper layer, trigger network channel quality detection, and dynamically select the optimal channel. It can also be used to store the paths of different network channels. For example, it can store the current The path of the used network channel (for example, the primary network channel) and the backup network channel.
  • the traffic reporting component is used to collect data flow information and report the collected data flow information.
  • the policy enforcement component is used to perform network channel switching.
  • one component in the above embodiment may be split into two or more components, and two or more components at the same level may be merged into the same component.
  • the flow-level policy management component and the flow-level path management component of the policy layer can be combined into the same component; the application-level policy management component and the channel-level path management component can be combined into the same component.
  • FIG. 8 is a timing diagram of a network acceleration method implemented based on the components shown in FIG. 7 provided by the embodiment of the present application.
  • Step B1 the user starts application A or switches application A from the background to the foreground.
  • step B2 the environment detection component detects that the application A is started or the application A switches from the background to the foreground, and obtains the identification of the application A.
  • step B3 the environment detection component sends the identification of application A to the application-level policy management component.
  • the application identifier is used to uniquely identify the application, and may have a one-to-one correspondence with the package name of the application, or may use the package name of the application.
  • step B4 the application-level policy management component queries whether the application A corresponding to the received identifier supports network acceleration from the application configuration library based on the received identifier of the application A.
  • the result obtained from the application configuration library is: support network acceleration.
  • Step B5 if the query result supports network acceleration, the application-level policy management component sends information indicating that application A enables network acceleration to the flow-level path management component.
  • the message may carry the identifier of application A.
  • step B6 the flow-level path management component sends a message indicating that application A enables network acceleration to the flow reporting component.
  • the message may also carry the identifier of application A, and the message sent in step B6 may be the same as or different from the message sent in step B5.
  • step B7 the traffic reporting component registers a message monitoring hook after receiving the information indicating that application A has enabled network acceleration.
  • the message monitoring hook can monitor the relevant information of the data flow of the application A, and the relevant information is the information stored in the flow feature database of the application A.
  • the data flow carries path information of the network carrying the data flow.
  • step B4 the path of the network currently used by application A may be detected and the network quality of the network currently used by application A may be periodically detected.
  • the path of the network currently used by application A can be determined through the data flow monitored by the packet monitoring hook.
  • the path of the network currently used by application A may also be determined according to the logic set by the system to select the primary network when there are multiple available networks.
  • the electronic device is equipped with a wireless network card 1 in the 2.4GHz frequency band, a wireless network card 2 in the 5.0GHz frequency band, a data service network card 1 of operator A, and a data service network card 2 of operator B. Then one of wireless network card 1 or wireless network card 2 can be defaulted as the main Wi-Fi, and the other wireless network card is the secondary Wi-Fi; the default is one of the data service network card 1 of operator A and the data service network card 2 of operator B It is the primary card, and the other data service network card is the secondary card.
  • the network channel in the 2.4GHz frequency band is the main Wi-Fi network
  • the network channel in the 5.0GHz frequency band is the secondary Wi-Fi network
  • the network channel corresponding to the data service network card 1 is the main cellular network
  • the network channel corresponding to the data service network card 2 as a secondary cellular network.
  • the system defaults to the current main network of the electronic device or the foreground application as the main Wi-Fi network; when the main Wi-Fi network is unavailable, the system defaults to the current The active network of the main card is the cellular network.
  • the system defaults that the current main network of the electronic device or the foreground application is the secondary Wi-Fi network; when the secondary Wi-Fi network is unavailable, the system defaults the electronic device or the foreground application
  • the current primary network is the cellular network of the secondary card.
  • application A When application A is started and running in the foreground, application A uses the primary network according to the above rules; even when application A is in the foreground, the system switches some data streams in application A to other networks, after application A switches to the background, The data flow in application A resumes using the system's default primary network; after application A switches from the background to the foreground, application A continues to use the system's default primary network.
  • each network in the electronic device may be requested sequentially according to the above rules: primary Wi-Fi, primary card network, secondary Wi-Fi, secondary card network, and so on. Until an available and quality network is requested.
  • the network that is available and whose quality meets the requirements can be understood as the network currently used by application A. For details, please refer to step C1 to step C8.
  • Step C1 After receiving the information sent by the application-level policy management component, the flow-level path management component indicates that application A starts network acceleration, and then sends information requesting the active network to the channel-level path management component.
  • the channel-level path management component After receiving the request information, the channel-level path management component makes requests in the order of primary Wi-Fi, primary card network, secondary Wi-Fi, and secondary card network until an available network with quality that meets the requirements is found. A's primary network.
  • Step C2 the channel-level path management component sends request information of the status of the main Wi-Fi to the network detection component, and the request information is used to request the status of the main Wi-Fi.
  • Step C3 the network detection component determines that the main Wi-Fi is available.
  • Step C4 the network detection component returns the status of the main Wi-Fi to the channel-level path management component: available.
  • Step C5 when the channel-level path management component receives that the status of the main Wi-Fi is available, send a detection request of the quality of the main Wi-Fi to the channel and application quality evaluation component, and the detection request is used to detect the main Wi-Fi the quality of.
  • the network quality of any network may be determined by network quality parameters, and the network quality parameters include at least one of the following: bandwidth, delay, and air interface rate.
  • step C6 the channel and application quality evaluation component returns the quality monitoring result of the main Wi-Fi to the channel-level path management component after assessing the quality of the main Wi-Fi.
  • step D1 may also be executed.
  • Step D1 the network detecting component sends a quality monitoring message of the main Wi-Fi to the channel and application quality assessment component, and the monitoring message is used to request the channel and application quality assessment component to monitor the network quality of the main Wi-Fi.
  • Step D2 after receiving the message, the channel and application quality assessment component starts to monitor the network quality of the main Wi-Fi, and returns the quality of the main Wi-Fi to the channel-level path management component.
  • the main Wi-Fi can be determined as the main network of the application A, and the network quality of the main Wi-Fi can be monitored regularly.
  • step D2 what is monitored in step D2 is the quality of the network channel, and the monitoring algorithm used is different from the network quality evaluation algorithm determined according to the characteristics of the data stream in the above embodiment.
  • Algorithm A we can record the monitoring algorithm used in this step as Algorithm A.
  • the quality of the network channel can be evaluated according to parameters such as the delay, packet loss rate, bandwidth, and rate of the channel.
  • the channel and application quality evaluation component can start to monitor the network quality of the main Wi-Fi before receiving the detection request sent by step C5, so that the quality of the main Wi-Fi can be obtained quickly, and the quality of the main Wi-Fi can be obtained quickly. After the quality of the main Wi-Fi is checked, the quality monitoring result of the main Wi-Fi can be returned to the channel-level path management component in time.
  • the monitoring result obtained for the first time may be before receiving the detection request sent in step C5, or may be after the detection request sent in step C5.
  • Step C7 when the channel-level path management component determines that the network quality of the primary Wi-Fi meets the requirements, send the primary Wi-Fi as the path of the primary network to the flow-level path management component.
  • step C8 the flow-level path management component stores the path of the primary Wi-Fi network as the path of the primary network.
  • step C3 if in step C3, the status of the main Wi-Fi obtained by the network detection component is unavailable, the network detection component does not perform step D1, and correspondingly, the channel and application quality evaluation component does not perform step D2.
  • the channel-level path management component receives the message that the main Wi-Fi is unavailable sent by the network detection component, it does not perform step C5, and correspondingly, the channel and application quality assessment component does not perform step C6 either.
  • the channel-level path management component After the channel-level path management component receives the message that the main Wi-Fi is unavailable sent by the network detection component, it continues to follow the steps from step C2 to step C6 (may include step D1 and step D2, or may not include step D1 and step D2) Continue to request the main card network (that is, the next priority network of the currently requested network). If the result obtained is that the master card network is available and the network quality meets the requirements, then the path of the master card network is sent to the stream-level path management component as the path of the master network, and the stream-level path management component uses the path of the master card network as the master Path storage for the network. Similarly, when the network quality of the main card network meets the requirements, the channel and application quality evaluation component also needs to regularly evaluate the quality of the main card network.
  • steps C2 to C6 need to be executed cyclically until the primary network of the electronic device is obtained.
  • the detected network is the network corresponding to a network card of an electronic device.
  • the network card corresponding to the network requested each time can be recorded as the fourth network card.
  • the electronic device sequentially executes the step of determining the active network according to the priority order of the network cards of the electronic device until the active network of the electronic device is obtained;
  • the steps of determining the active network include:
  • the electronic device acquires the network status of the network corresponding to the fourth network card, where the fourth network card is a network card of the electronic device;
  • the electronic device obtains the network quality parameter of the fourth network card; when the network status of the fourth network card is unavailable, end the current round of the main network determination step and enter the next step The next round of primary network determination steps for the priority network card;
  • the step of determining the active network enters the step of determining the next round of the active network of the next priority network card.
  • the channel and application quality evaluation component can determine whether the network quality of the network meets the requirements, and regularly evaluate the network quality of the network if the requirements are met; the channel and application quality can also be received by the channel-level path management component. After the quality monitoring result of the network sent by the quality assessment component, it is determined whether the network quality of the network meets the requirements, and if the requirements are met, a request message is sent to the channel and application quality assessment component to request regular assessment of the network quality of the network.
  • the notification-level path management component can periodically obtain the network quality of the network currently carrying the data flow of application A, and send the obtained network quality of the network currently carrying the data flow of application A to the flow-level path management component.
  • the path of the network currently used by application A can be obtained according to the logic of selecting the active network when there are multiple available networks set by the system.
  • the first aspect transmits a message that application A enables acceleration to the lower-level traffic reporting component through the flow-level path management component, so that the traffic reports
  • the component registers the packet monitoring hook.
  • the network path of the active network and the network quality of the active network can also be obtained.
  • the flow sensing component transmits a message of starting data flow monitoring to the lower layer flow reporting component, so that the flow reporting component monitors the data flow of application A through the registered message monitoring hook (refer to step B8 for details).
  • step B8 the application-level policy management component sends a request message for starting service flow monitoring to the flow perception component.
  • the application-level policy management component may simultaneously execute step B5 and step B8 after executing step B4.
  • the application-level policy management component may also execute step B5 first after executing step B4, and then execute step B8 at a preset time (the specific value can be set according to actual conditions) after executing step B5.
  • Step B9 after receiving the request message sent in step B8, the traffic sensing component sends a message indicating traffic monitoring to the traffic reporting component.
  • Step B10 after receiving the flow monitoring message sent in step B9, the flow reporting component reports the monitored data flow to the flow perception module.
  • the message monitoring hook in the flow reporting component starts to monitor the data flow.
  • the flow monitoring message sent in step B9 report the monitored data flow to the flow perception module.
  • the monitored data flow may be continuously reported to the flow sensing component subsequently.
  • the traffic sensing component receives the data stream reported by the traffic reporting component, and determines a network quality assessment algorithm based on the characteristics of the data stream.
  • the network quality assessment algorithm in step B11 is different from the network channel assessment algorithm in step D2.
  • the algorithm in step B11 is denoted as Algorithm B.
  • Algorithm A is a common algorithm for each network channel, and evaluates the network quality of the entire network channel.
  • Algorithm B is an algorithm determined based on the characteristics of the data flow of the application currently enabling network acceleration, and evaluates the transmission quality of the data flow that meets the preset characteristics transmitted through the network channel.
  • step B12 the traffic sensing component starts to evaluate the transmission quality of each data flow of application A based on the network quality evaluation algorithm to obtain an evaluation result.
  • evaluation results may include: excellent (for example, identification 00), possible freezing (for example, identification 10), and freezing (for example, identification 11).
  • the conditions for evaluating freezing may also be set as conditions for evaluating possible freezing in practical applications.
  • Condition 1 If three consecutive delays exceed 300ms or packet loss exceeds 20% within 5 cycles, the evaluation result is stuck.
  • Condition 2 If two consecutive delays exceed 200ms or the packet loss rate exceeds 10% within 5 cycles, the evaluation result is possible freeze.
  • the network quality assessment algorithm obtained based on the characteristics of the data stream not only includes the judgment conditions for stalls defined in Table 2, but also includes the judgment conditions for possible stalls in practical applications.
  • condition 1 and condition 2 may be preset, and the evaluation result may also include: condition 1 is met, condition 2 is met, condition 1 is not met and condition 2 is not met.
  • the specific form of the evaluation result is not limited.
  • Step B13 the flow perception component sends the evaluation result to the flow level policy management component.
  • the evaluation result sent in this step may be an identifier indicating freeze, possible freeze, and excellent, and may also carry characteristics (or feature identifiers) of the data stream.
  • the evaluation result may: satisfy condition 1, satisfy condition 2, and neither satisfy condition 1 nor satisfy condition 2, and may also carry characteristics (or characteristic identifiers) of the data stream.
  • step B14 after receiving the evaluation result, the flow-level policy management component determines to request a backup network if the evaluation result indicates that there may be a freeze (condition 2 is met).
  • the transmission quality improvement strategies are both: handover.
  • condition 2 the request information of the backup path is sent to the stream-level path management component
  • condition 1 the switch information of the backup path is sent to the stream-level path management component.
  • the above settings can determine the backup network in advance and wake up the backup network in the case that the transmission quality of the predicted data stream may deteriorate (for example, satisfying condition 2), so that the transmission quality of the data stream does deteriorate (for example, satisfying the condition 2).
  • condition 1 the data flow with poor transmission quality can be quickly switched to the standby network. This is because the transmission quality of the data stream usually deteriorates gradually. Therefore, in the case of possible deterioration, first select the backup network and wake up the backup network. If the transmission quality of the data stream does deteriorate , switch the data flow with poor transmission quality to the standby network that has been awakened. In this way, it is possible to quickly respond to the switching of the data stream, so that the user is not aware of the switching of the data stream, and it is also possible to avoid the problem of high power consumption caused by prematurely waking up the standby network.
  • Step B15 when the flow-level policy management component determines that condition 2 is satisfied, it sends the request information of the backup path to the flow-level path pipeline component.
  • step B16 the flow-level path management component sends a backup path request message to the channel-level path management component when it is determined that there is no backup network currently.
  • the channel-level path management component After receiving the request message of the backup path, the channel-level path management component starts to search for an available network with the best quality other than the currently used active network. For details, please refer to the description of step B17 to step B23.
  • Step B17 the channel-level path management component sends a query request for the state of network B to the network detection component.
  • network B may be any network other than the currently active network.
  • the current active network can be recorded as network A.
  • Network B may be recorded as the network corresponding to the third network card.
  • step B18 the network detection component inquires whether the network status of network B is available.
  • Step B19 the network detection component sends the status of network B to the channel-level path management component: available.
  • step B20 the channel-level path management component sends a quality detection request of network B to the channel and application quality evaluation component when receiving that the network status of network B is available.
  • the network detection component may execute step B19 and step E1.
  • Step E1 the network detection component sends a request for monitoring the quality of the network B to the channel and application quality assessment component.
  • Step E2 when the channel and application quality assessment component receives the request for monitoring the quality of the network B sent by the network detection component, it starts to monitor the quality of the network B using the A algorithm.
  • step B21 the channel and application quality evaluation component is obtaining the quality monitoring result of network B.
  • the network quality parameter is used when evaluating the quality of the network channel
  • the stream quality parameter is used when evaluating the transmission quality of the data stream.
  • step B22 the channel-level path management component obtains the status of each network channel except the active network and the network quality of the available network if the status is available, in the manner of steps B17 to B21.
  • the channel-level path management component determines an available network with the best network quality as the primary card network according to the status and network quality of other networks except the primary network.
  • a range may also be set, and all network cards among the third network cards whose network quality parameters are within the range are used as backup networks.
  • step E2 the algorithm used in step E2 to detect the quality of network B is the same as the algorithm used in step D2.
  • the network with the best quality is determined as the backup network in practical applications.
  • the priority condition of the backup network can also be set as: a network other than the main network that is available, the network quality meets the requirements, and does not generate additional costs as the backup network, wherein the network that does not generate additional costs can be: a Wi-Fi network, The data service network with unlimited data plan, or the data service network with limited data plan but the current used traffic is less than the current monthly planned traffic (total traffic/total number of days in the month ⁇ current number of days).
  • the backup network may be the one with the best network quality among the networks satisfying the priority condition other than the active network.
  • the backup network selects the network that meets the secondary priority conditions as the backup network.
  • the secondary priority conditions are: the network other than the primary network is available and the network quality meets the requirements network as a backup network.
  • the backup network may be the one with the best network quality among the networks satisfying the sub-priority condition other than the active network.
  • the backup network may be the one with the best network quality among available networks other than the primary network.
  • Step B24 after determining the network with the best quality as the main card network, the channel-level path management component sends a request to enable the main card network to the network connection management component.
  • step B25 the network connection management component switches the network of the main card from the sleep state to the wake-up state after receiving the activation request of the main card network.
  • Step B26 the network connection management component sends a message that the main card network has been awakened to the channel-level path management component.
  • Step B27 the channel-level path management component sends the currently determined path and quality of the main card network with the best quality to the stream-level path management component.
  • the channel-level path management component can periodically obtain the network quality of the primary network of the electronic device. Certainly, the channel-level path management component may periodically send the obtained network quality of the active network of the electronic device to the flow-level path management component.
  • the flow-level path management component can periodically obtain the network quality of the active network (main Wi-Fi).
  • Step F1 the flow-level path management component has stored the network path of the primary network, and after receiving the path and network quality of the primary card network sent by the channel-level path management component, it can compare the latest received stored primary card network The quality parameter corresponding to the network path and the received quality parameter of the main card network determine a network path with better quality.
  • the network path with better quality is the pre-stored primary network path, it means that the quality of the backup network is worse, and even if the current primary network is relatively poor, there is no need to switch. Then there is no need to store the network path of the backup network. If the network path with better quality is not the pre-stored primary network path, it means that the quality of the backup network is better, and the network path of the backup network needs to be stored in case the transmission quality of the data flow currently using the primary network is worse In case, switch to the backup network.
  • step F1 If the result of the comparison in step F1 is that the quality of the primary card is better, the network path of the primary card is stored as a backup network.
  • the channel-level path management component may request to periodically monitor the network quality of the main card network, and periodically send the request to the flow-level path management component.
  • the network quality of other networks other than the active network can be regularly monitored. If the network quality with the best network quality is no longer the currently stored backup network, the backup network can be replaced with the current active network and the current backup network. Networks other than the Internet of higher quality. If a network is awakened as a backup network, and then is no longer the backup network nor the active network, the network can be switched from the wake-up state to the sleep state, so as to avoid excessive power consumption of electronic devices.
  • the flow reporting component is continuously monitoring the data flow and continuously reporting the monitored data flow.
  • Step B29 the traffic reporting component continuously reports the monitored data flow to the traffic sensing component.
  • Step B30 the traffic sensing component has determined the network quality assessment algorithm (algorithm B) of each data flow, and continues to use the algorithm B to obtain the assessment result.
  • algorithm B network quality assessment algorithm
  • step B31 the traffic awareness component continuously sends the evaluation result to the flow-level policy management component.
  • step B32 the flow-level policy management component determines that it is necessary to switch to the standby network based on the evaluation result.
  • condition 1 in the above example it is determined to switch to the backup network.
  • Step B33 after the flow-level policy management component determines to switch to the standby network, it sends an instruction to the flow-level path management component, which is used to indicate switching to the standby network.
  • Step B34 after receiving the instruction to switch the backup network, the flow-level path management component checks the stored path of the backup network (the path of the main card network), and then sends an instruction to switch to the main card network to the flow-level policy management component.
  • step B33 may carry the identifier of the data stream to be switched, and at the same time, the instruction transmitted in B34 may also carry the identifier of the data stream to be switched. The instruction sent by the two steps may also not carry the identifier of the data flow to be switched.
  • Step B35 the flow-level policy management component sends an instruction to the policy execution component, the instruction carries the data flow identifier and the main card network path, wherein the data flow identifier is the data flow identifier whose evaluation result meets condition 1, or the evaluation result meets condition 1
  • the data flow identifier is the data flow identifier whose evaluation result meets condition 1, or the evaluation result meets condition 1
  • Step B36 the policy execution component switches the data flow represented by the data flow identifier carried in the received command to the main card network represented by the network path carried in the command.
  • the network path may also be a network identifier for distinguishing different networks.
  • the network quality may not deteriorate gradually, but may also deteriorate suddenly.
  • the evaluation result received by the flow-level policy management component in step B14 is determined to switch the backup network, then in step B15, the flow-level policy management component sends the switch backup path to the flow-level path management component.
  • the stream-level path management component has not stored the paths of the backup networks. In this case, it is necessary to first determine the backup network (step B16 to step B27), and then directly execute step B34 to switch the data flow to the backup network when the backup network is determined.
  • step B14 the evaluation result received by the flow-level policy management component is determined to be switching the backup network, and at this time, the flow-level path management component has received the switching backup path and has stored the path of the backup network, then the step can no longer be performed B16 to step F1, but directly execute step B34 to switch the data flow to the standby network.
  • application A currently has data stream C and data stream D.
  • the electronic device requests and stores an alternate path according to the transmission quality evaluation result of data stream C (possibly stalled).
  • the transmission quality evaluation result of data stream D is excellent.
  • the evaluation result of the transmission quality of the data flow C is excellent, and the evaluation result of the transmission quality of the data flow D determines to switch the backup path.
  • the electronic device has stored the backup path, and the electronic device can switch the data flow to the backup network.
  • the characteristics of the data stream are used as the conditions for determining and waking up the backup network.
  • other methods may also be used as the conditions for determining and waking up the backup network. That is, a column may be added in Table 2: conditions for determining and waking up the backup network.
  • the conditions for determining and waking up the standby network may be the same or different, or partly the same and partly different.
  • conditions related to the traffic characteristics of the data flow of the application in this business scenario can be set as the conditions for determining and waking up the standby network; for all business scenarios of all applications, the same can be set Conditions: the signal strength gradually decreases, etc.
  • This example is for illustration only and does not constitute any limitation.
  • other methods may also be used to acquire the path of the active network currently used by application A, and monitor the path of the active network currently used by application A under the condition of determining the path of the active network currently used by application A. Network quality of the active network.
  • FIG. 9 it is a sequence diagram of another network acceleration method provided by the embodiment of the present application.
  • the flow reporting component monitors the data flow, it can determine the network carrying the data flow. Since it is pre-set that after application A is switched from the background to the foreground again, all data streams of the application still determine the currently used network channel according to the system default method. Therefore, after application A is switched from the background to the foreground again or application A is started, the network channel where the data flow monitored by the traffic reporting component is located is the primary network of application A. Because, the path of the active network can be determined through the data flow reported by the flow reporting component.
  • steps G1 to G6 may be executed to store the path and quality monitoring results of the active network.
  • step G1 the flow sensing component determines the network channel carrying the data flow according to the reported data flow.
  • Step G2 in the case of determining the network channel (the primary Wi-Fi), the flow sensing component sends a message indicating that the primary network is the primary Wi-Fi to the channel-level path management component.
  • Step G3 the channel-level path management component sends a quality detection request of the main Wi-Fi to the channel and application quality assessment component.
  • Step G4 the channel and application quality evaluation component uses algorithm A to regularly monitor the quality of the main Wi-Fi.
  • Step G5 the channel and application quality evaluation component returns the quality monitoring result of the main Wi-Fi to the channel-level path management component.
  • Step G6 the channel-level path management component sends the main Wi-Fi path and quality monitoring results to the stream-level path management component.
  • Step G7 the flow-level path management component stores the path of the primary Wi-Fi as the primary path, and stores the quality monitoring results of the primary Wi-Fi.
  • step G4 Since the quality of the primary network (main Wi-Fi) is regularly monitored in step G4, the flow-level path management component will receive the quality of the primary network (main Wi-Fi) periodically.
  • the electronic device may also execute step B11 and step B13. That is, the execution order of step G1 and step B11 is not limited.
  • step B14 If when the flow-level policy management component executes B14, it is determined that a backup network needs to be requested according to the data flow characteristics and evaluation results, then continue to perform subsequent steps (step B15 to step B36), and the subsequent steps can refer to the description of the embodiment shown in Figure 8, I won't repeat them here.
  • a network other than the active network may be requested.
  • the backup network can be compared with the main network, so that when the quality of the backup network is better than the main network, the transmission quality is poor.
  • the data flow is switched to the backup network.
  • FIG. 10 it is another network acceleration method provided by the embodiment of the present application.
  • Step B4 Step B8 and Step B9 are performed.
  • the traffic reporting component is triggered to execute step H1 after receiving the traffic monitoring request sent by the traffic sensing component in step B9, and registers a message monitoring hook.
  • the message monitoring hook After the message monitoring hook is registered, the message monitoring hook can monitor the data flow of application A. Subsequent steps are executed after the data flow of application A is monitored.
  • the traffic awareness component can determine the network channel currently used by application A, and can pass the identification of the currently used network channel (primary network) through step B13 Sent to flow-level policy management component.
  • step B14 the flow-level policy management component determines to request a backup network according to the characteristics of the data flow and the evaluation result.
  • Step B15 when the flow-level policy management component sends the request information of the backup path to the flow-level path management component, it may carry the identifier of the active network (or the path of the active network).
  • Step B16 the flow-level path management component sends the request information of the backup path to the channel-level path management component, which may also carry the identifier of the active network (or the path of the active network).
  • the channel-level path management component After the channel-level path management component receives the request information carrying the identification of the active network sent by the flow-level path management component, it can sequentially request the status of other network channels in the network channels supported by the electronic device except the active network, and When the state is available, request to monitor the quality monitoring results of the available network channels, and finally wake up the available network channel with the best quality, and send it to the flow-level path management component as a backup network.
  • step B17 to step B27 Reference may be made to the descriptions in the foregoing embodiments, and details are not repeated here.
  • Step 28 when the flow-level path management component determines that the primary network is not stored, it does not need to compare the quality of the received backup network with the quality of the primary network, but directly stores the received network channel as a backup path.
  • step B29 to step B36 reference may be made to the description in the foregoing embodiments.
  • the transmission quality improvement strategy further includes: concurrency.
  • the data stream is first divided into multiple available network channels of the electronic device. After being divided into multiple network channels, if any data flow satisfies the switching conditions specified by the network quality assessment algorithm (for example, the transmission rate is slow), switch the data flow that meets the switching conditions specified by the network quality assessment algorithm to other On a network channel with better quality.
  • the network quality assessment algorithm for example, the transmission rate is slow
  • step B11 the flow sensing component determines that the data flow needs to be allocated to multiple network channels according to the characteristics of the data flow.
  • Step J1 the traffic perception component sends information requesting all backup networks to the channel-level path management component.
  • step B17 after the channel-level path management component receives the request information of all backup paths, it starts to execute the steps from step B17 to step B26 on other networks in the network channel supported by the electronic device except the active network.
  • step B21 all other available network channels other than the active network need to be woken up. Therefore, after step B21, directly execute step B24 to request to wake up the currently available network channel.
  • step B24 directly execute step B24 to request to wake up the currently available network channel.
  • step B27 the channel-level path management component sends the path and quality monitoring results (may be represented by quality parameters) of each awakened backup network to the stream-level path management component.
  • Step B28 the flow-level path management component stores the path and quality parameters of each backup network.
  • the flow reporting component has been reporting the data flow, and at the same time, the flow sensing component has been transmitting the identifier of the currently monitored data flow to the flow-level path management component.
  • Step K3 after the flow-level path management component receives the path of the active network, the path of the standby network, and the identifiers of multiple data flows, distribute the multiple data flows to multiple network channels (active network and standby network) .
  • the flow-level path management component receives one active network path and three backup network paths, and the number of received data flow identifiers is 5, then the 5 data flow identifiers can be divided into 4 on a network channel.
  • the allocation in step K3 tries to allocate multiple data streams to multiple network channels based on the principle of equal distribution.
  • step K3 can be executed in the flow-level policy management component or in the flow-level path management component.
  • the flow-level policy management component needs to send the data flow identifier to the flow-level path management component.
  • step K2 is cancelled.
  • Step K4 the flow-level path management component sends the path of the network channel corresponding to each data flow identifier to the flow-level policy management component.
  • step K5 the flow-level policy management component sends the path of the received network channel corresponding to each data flow identifier to the policy management component.
  • step K6 the policy management component switches the data flow corresponding to the data flow identifier to the corresponding network channel according to each received data flow identifier and the path of the corresponding network channel.
  • the message monitoring hook has been monitoring the data flow, and has been reporting the monitored data flow at the same time, see step B29.
  • the traffic sensing component After distributing multiple data streams from the main network channel to multiple network channels, the data streams detected by the packet monitoring hook are carried on their respective corresponding network channels. Therefore, after receiving the data stream reported by the traffic reporting component, the traffic sensing component can determine that multiple data streams have been allocated to multiple network channels according to the monitored data stream.
  • Step K7 after the traffic sensing component determines that multiple data streams have been allocated to multiple network channels, it can use the characteristics of each data stream to obtain an evaluation algorithm C corresponding to each data stream.
  • step B30 the traffic sensing component obtains the transmission quality evaluation result of each data flow according to the evaluation algorithm C for determining each data flow.
  • the data flow when the evaluation result of a certain data flow satisfies the switching condition stipulated by the set evaluation algorithm, the data flow needs to be switched to another network channel with better quality.
  • the network quality of each network channel can be monitored periodically, and the network quality can be sent to the flow-level path management component.
  • Step K8 the flow-level path management component switches the data flow (data flow that does not meet the conditions set by algorithm C) to the network with the best quality (for example, the fastest transmission rate) according to the quality of each network channel received regularly on the channel.
  • the best quality for example, the fastest transmission rate
  • the data flow that does not meet the conditions set by Algorithm C is switched to a network channel with better quality.
  • other switching modes may also be set.
  • the current data flow on the Wi-Fi network that does not meet the conditions set by Algorithm C is preferentially switched to the data service network of the unlimited traffic package .
  • the current data flow on one Wi-Fi network that does not meet the conditions set by Algorithm C is preferentially switched to another Wi-Fi network.
  • the above switching methods are just examples. In actual applications, the switching methods can be set according to the actual situation.
  • the principle is: on the premise of avoiding additional traffic charges as much as possible, the data flow that meets the specific characteristics of the current application can be transmitted as quickly as possible.
  • FIG. 12 is another network acceleration method provided in the embodiment of the present application.
  • step J1 instead of separately requesting the path of the active network, when the flow sensing component determines that the current data flow needs to be allocated to multiple network channels according to the characteristics of the data flow, execute step J1 to request all networks path.
  • Step B17 to B26 the available network channels of the electronic device are awakened, and the path and quality monitoring results of each network channel after awakening are sent to the flow-level path management component.
  • the flow-level path management component distributes data flows over multiple network channels.
  • steps B28 to B36 reference may be made to the description of the embodiment shown in FIG. 11 , and details are not repeated here.
  • Network C in FIG. 12 is any network channel supported by electronic equipment.
  • the message monitoring hook in the traffic reporting component is used as an example to monitor the data stream of application A.
  • the following describes how the message monitoring hook monitors the data stream of application A and sends the monitored data stream to For traffic-aware components.
  • the traffic reporting component can obtain the packets of the data flow of application A by calling the Netfilter component.
  • the information reported by the traffic reporting component to the traffic sensing component includes not only the packets of the data flow of application A, but also some statistical information of the packets of the data flow of application A. For details, reference may be made to the description of the embodiment shown in FIG. 13 .
  • the traffic reporting component may pre-register a message monitoring hook (for example, nf_hook hook function).
  • a message monitoring hook for example, nf_hook hook function
  • the Netfilter component After the traffic reporting component calls the Netfilter component, the Netfilter component reports the packet of the data flow of application A, and the traffic reporting component calls the pre-registered nf_hook hook function after receiving the packet of the data flow reported by the Netfilter component.
  • the nf_hook hook function performs the following operations on the packets of the received data stream: packet parsing, flow table checking, and packet analysis.
  • the application identifier in the message and the quaternion (or quintuple) of the message to obtain the parsing result. If the application identifier exists, the application corresponding to the packet can be determined.
  • the four-tuple includes source IP, destination IP, source port, and destination port; the five-tuple includes: source IP, destination IP, source port, destination port, and protocol number. That is, the 4-tuple or 5-tuple of the packet carries some features of the data stream in Table 2 above.
  • the message (data packet) itself also carries the header feature.
  • the flow table After parsing, query the flow table according to the parsing result, and update the statistical information of the flow table.
  • the flow table stores identification information of data flows in each application and statistical information of each data flow.
  • the statistical information of each flow includes: the number of received packets of the data flow, the total number of bytes, and the number of error packets.
  • the statistical information of each flow can be determined according to the parameters set in the network quality assessment algorithm. Therefore, the statistical information of each flow may also include other information, for example, the traffic distribution information of the data flow in which the data packet belongs changes over time generated according to the size of the data packet received at the time point.
  • the identification of the data flow and related statistical information may be added to the flow table.
  • the packet After checking the flow table and updating the flow table information, the packet can be analyzed. For example, filter packets to obtain all or part of the packets.
  • the filtering process may be filtering heartbeat packets of a certain data flow. After filtering, the heartbeat packet message of the data flow is obtained.
  • the filtering process may be: by setting certain characteristics in advance, the packets meeting the characteristics are retained. That is, the packets satisfying some preset characteristics are the filtered packets.
  • the heartbeat packet message is a message that exists in the data stream according to a certain time interval.
  • the heartbeat packet has a fixed feature (for example, 0x64 or 0x65) at a fixed position (for example, the sixth byte). Because the heartbeat packet message is a message that exists according to a certain period of time, because the delay can be calculated based on the heartbeat packet message (for example, the mobile phone sends a heartbeat request message to the server, and the mobile phone receives the heartbeat response fed back by the server) The total elapsed time until the message).
  • the delay information is used to determine whether the data stream satisfies the conditions for improving the transmission quality set in Table 2 above.
  • the filtering condition may further include: selecting to retain data packets of a specific length. During specific implementation, it is determined whether the length of the data packet message is a preset specific length, if yes, the message is retained, and if not, the message is filtered out.
  • the obtained filtered partial packets are stored in the SKB queue.
  • the strategies for reporting the packets of the data flows stored in the SKB queue include: immediate reporting and periodic reporting.
  • a specific thread in the traffic reporting component checks the queue in time, and reports the packets in the queue to the traffic sensing component in time.
  • a timer is set in the traffic reporting component, and based on the time set by the timer, the messages in the SKB queue are checked at a certain period, and part or all of the messages in the queue are reported to the traffic sensing component.
  • some of the packets of the data flow stored in the SKB queue need to be reported immediately, and some need to be reported periodically.
  • a specific thread in the traffic reporting component checks the queue in time, and reports the packets in the queue that need to be reported immediately to the traffic sensing component in time.
  • a timer is also set in the traffic reporting component. Based on the time set by the timer, the messages in the SKB queue are checked at a certain period, and the messages in the queue that need to be regularly reported are reported to the traffic sensing component.
  • the traffic reporting component does not report all packets sent by the Netfilter component to the traffic sensing component. Instead, the packets satisfying the specific characteristics (which may carry statistical information of the packets satisfying the specific characteristics) are reported to the flow sensing component. At the same time, the statistical information related to the packets meeting the characteristics will be reported.
  • both the packet 1 and the packet 2 belong to packets of the same data flow.
  • the statistical information about the data flow in the flow table is updated according to packet 1.
  • packet 1 does not meet certain characteristics, so packet 1 is filtered out and will not be reported to the flow perception component.
  • the flow table after receiving packet 2 update the statistical information about the data flow in the flow table according to packet 2.
  • Packet 2 meets certain characteristics, so packet 2 will not be filtered out, and packet 2 will be reported For traffic-aware components. That is, although some packets are reported, the statistical information is obtained based on all packets under the data flow.
  • the reported packets and related statistical information in the above example are used by the flow sensing component to determine the characteristics of the data flow represented by the packet and the transmission quality of the data flow.
  • the traffic reporting component reports the packets of the data stream to the traffic sensing component, the following will describe how to determine the characteristic conditions and network quality of the data stream set in Table 2 based on the data stream packets reported by the traffic reporting component to the traffic sensing component Evaluate the conditions set by the algorithm to improve the transmission quality.
  • messages (data packets) of the same quadruple belong to the same data flow. If multiple packets with the same quaternion are transmitted through the network channel, then the multiple packets with the same quaternion belong to the same data flow, which can also be understood as: multiple packets can exist in one data flow. At the same time, the packets under a data flow carry the sequence number of the packet in the data flow. Since these packets have the same feature, the identifier of the data flow to which the packet belongs may be generated according to the same feature. As an example, the identifier of the data flow to which the packet belongs may be generated according to the quaternion of the packet.
  • the traffic reporting component After the traffic reporting component receives the message, it can determine the application to which the message belongs according to the application identifier carried in the message.
  • the identifier of the data stream to which the message belongs may also be generated according to the quaternion of the message.
  • the traffic sensing component can also determine the identifier of the application and the identifier of the data flow to which it belongs based on the received packet.
  • the traffic reporting component can determine the protocol in the data flow feature according to the protocol number in the quintuple of the message, and can determine the port in the data flow feature through the destination port in the quaternion or quintuple.
  • the packet characteristics in the data flow characteristics can be determined through the header characteristics of the packets. That is, based on the packet reported by the traffic reporting component, the characteristics of the data flow where the packet is located can be determined.
  • the above manner of determining the characteristics of the data stream is only an example, and in practical applications, the characteristics of the data stream where the packet is located may also be determined in other ways.
  • the electronic device After the electronic device can determine the characteristics of the data flow to which the received message belongs, it can determine the conditions for improving the transmission quality set by the corresponding network quality evaluation algorithm based on the characteristics of the data flow.
  • the identification of the application that is, the corresponding network quality assessment is jointly determined according to the identification of the application and the characteristics of the data flow The conditions set by the algorithm to improve the transmission quality.
  • the conditions for improving the transmission quality set by the network quality assessment algorithm are determined, the conditions for improving the transmission quality set by the network quality assessment algorithm are only used to evaluate Identified) the transmission quality of the data stream.
  • one or more of the following parameters can be used: delay, packet loss rate, presence of response and rate.
  • the delay can be determined through the heartbeat packet under a certain data flow. Since the packet carries the sequence number of the packet in the data stream, the packet loss situation can be determined according to the sequence number. Determine whether there is no downlink response based on the total number of packets in the statistical information in the above example. As an example, if the total number of packets received in two consecutive periods is the same, it is determined that there is no downlink response.
  • the transmission rate is determined by the total number of bytes in the statistical information in the above example. As an example, the ratio of the difference between the total number of bytes received in the previous cycle and the current cycle to the cycle is the downlink rate in this cycle.
  • the manner of determining the above parameters is only for example, and in practical applications, the above parameters may also be determined in other manners.
  • the embodiment of the present application also provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the steps in the foregoing method embodiments can be implemented.
  • the embodiment of the present application also provides a computer program product, which enables the first device to implement the steps in the foregoing method embodiments when the computer program product is run on the first device.
  • 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.
  • all or part of the processes in the methods of the above embodiments in the present application can be completed by instructing related hardware through computer programs, and the computer programs can be stored in a computer-readable storage medium.
  • the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file or some intermediate form.
  • the computer-readable medium may at least include: any entity or device capable of carrying the computer program code to the first device, a recording medium, a computer memory, a read-only memory (ROM, Read-Only Memory), a random-access memory (RAM, Random Access Memory), electrical carrier signals, telecommunication signals, and software distribution media.
  • a recording medium e.g., a hard disk, magnetic disk or optical disk, etc.
  • ROM Read-Only Memory
  • RAM Random Access Memory
  • electrical carrier signals telecommunication signals
  • software distribution media e.g., software distribution media.
  • computer readable media may not be electrical carrier signals and telecommunication signals under legislation and patent practice.
  • the embodiment of the present application also provides a chip system, the chip system includes a processor, the processor is coupled to the memory, and the processor executes the computer program stored in the memory to implement the steps of any method embodiment of the present application.
  • the chip system can be a single chip, or a chip module composed of multiple chips.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

本申请提供一种网络加速方法、电子设备、芯片系统及可读存储介质,涉及网络通信技术领域。该方法包括:电子设备中不同数据流(不同应用的不同数据流,同一应用的不同数据流)对应不同的流质量评估条件,任一数据流的流质量参数满足该数据流对应的流质量评估条件的情况下,电子设备将该数据流从当前网卡切换到其他网卡上传输以进行网络加速,流质量参数包括以下至少一项参数:时延、速率、丢包率、重传率和报文响应是否超时;由于对网络质量要求不同的数据流分别设置了各自对应的流质量评估条件,所以,可以针对数据流的流质量得到不同的网络加速时机,从而避免了卡顿现象。

Description

网络加速方法、电子设备、芯片系统及可读存储介质
本申请要求于2021年11月18日提交国家知识产权局、申请号为202111372930.6、申请名称为“网络加速方法、电子设备、芯片系统及可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及网络通信领域,尤其涉及网络加速方法、电子设备、芯片系统及可读存储介质。
背景技术
随着电子设备的智能化程度越来越高,电子设备中安装运行的应用软件也越来越多。很多应用软件在运行过程中需要通过网络与相应的服务器通信,以实现该应用软件提供的各种功能。
在用户使用应用软件的过程中,若该应用软件与相应服务器通信时使用的网络的质量较差,则会出现卡顿现象,影响用户的使用体验。目前,可以基于当前使用的网络的信号强度对当前使用的网络的质量进行评估,在当前使用的网络的质量较差的情况下,使用质量更好的网络。然而,这种提升网络质量的方法在一些应用软件的使用场景中仍然存在卡顿现象。
发明内容
本申请提供一种网络加速方法、电子设备、芯片系统及可读存储介质,降低电子设备的卡顿现象。
为达到上述目的,本申请采用如下技术方案:
第一方面,本申请提供一种网络加速方法,该方法包括:
电子设备运行第一应用,电子设备通过第一网卡传输第一应用的第一数据流和第二数据流,第一网卡为无线局域网网卡,第一网卡用于连接无线路由器;
当第一数据流的流质量参数满足第一条件,且第二数据流的流质量参数满足第一条件且不满足第二条件,电子设备通过第二网卡传输第一数据流,通过第一网卡传输第二数据流,流质量参数包括以下至少一项参数:时延、速率、丢包率、重传率和报文响应是否超时;
当第一数据流的流质量参数和第二数据流的流质量参数均满足第二条件,电子设备通过第二网卡传输第一数据流和第二数据流,流质量参数的第一条件优于流质量参数的第二条件。
本申请中,不同数据流对网络质量的要求并不完全一致。例如,第一应用(例如,通讯软件)的第一数据流(例如,视频通话时的数据流)对网络质量的要求高于第一应用的第二数据流(例如,浏览页面时的数据流)对网络质量的要求。可以为第一数据流的流质量参数设置第一条件,为第二数据流的流质量参数设置第二条件,当第一 数据流的流质量参数满足第一条件时,将第一数据流从原网卡上切换到新网卡上传输,当第二数据流的流质量参数满足第二条件时,将第二数据流从原网卡上切换到新网卡上传输。流质量参数采用了流级的评估传输质量的方式,相比于通过网络的信号强度这种通道级的评估传输质量的方式能够更精细化的评估数据流的传输质量,另外,由于为不同数据流设置了不同的评估条件(例如,第一条件、第二条件),可以为不同数据流提供符合该数据流进行网络加速的时机(例如,切换到其他网卡上),从而降低了应用的卡顿现象。
作为本申请第一方面的另一实现方式,第一数据流为具有第一特征的数据报文组成的数据流,第二数据流为具有第二特征的数据报文组成的数据流,第一特征和第二特征中的以下至少一项参数不同:数据报文的传输协议、传输端口和头部特征。
本申请中,可以通过数据报文携带的相关信息(传输协议、传输端口和头部特征)区分不同的数据流,从而能够实现流级的识别、流级的质量评估,流级的网络切换。
作为本申请第一方面的另一实现方式,在电子设备通过第一网卡传输第一应用的第一数据流和第二数据流的过程中,该方法还包括:
电子设备获取第一特征对应的第一条件和第二特征对应的第二条件;
电子设备判断第一数据流的流质量参数是否满足第一条件,判断第二数据流的流质量参数是否满足第二条件。
本申请中,可以预先为不同特征设置不同的条件,以具有第一特征的第一数据流为例,在确定第一应用的数据流的特征满足第一特征的情况下,可以得到第一条件,然后,判断满足第一特征的数据流的流质量参数是否满足第一条件。
作为本申请第一方面的另一实现方式,该方法还包括:
当第一数据流的流质量参数不满足第一条件,电子设备通过第一网卡传输第一数据流;
当第一数据流的流质量参数满足第一条件,电子设备通过第二网卡传输第一数据流;
当第二数据流的流质量参数不满足第二条件,电子设备通过第一网卡传输第二数据流;
当第二数据流的流质量参数满足第二条件,电子设备通过第二网卡传输第二数据流。
作为本申请第一方面的另一实现方式,在第一数据流的流质量参数满足第二条件时,第一数据流的流质量参数满足第一条件。
作为本申请第一方面的另一实现方式,电子设备通过第二网卡传输第一数据流包括:
电子设备查看电子设备是否存储有备用网络;
在电子设备存储有备用网络的情况下,电子设备通过备用网络传输第一数据流,其中,备用网络包括第二网卡对应的第二网络。
本申请中,为了及时将满足对应的流质量评估条件的数据流切换到其他网络上,可以预先得到备用网络并存储,以在数据流的流质量参数满足对应的条件时,及时将满足对应的评估条件的数据流切换到备用网络。
作为本申请第一方面的另一实现方式,该方法还包括:
在电子设备未存储有备用网络的情况下,电子设备获取电子设备的第三网卡对应的网络的网络质量参数,第三网卡为电子设备中除第一网卡以外的其他网卡,网络质量参数包括以下至少一项:带宽、时延和空口速率;
在第二网卡为第三网卡中网络质量最优的网卡的情况下,电子设备将第二网卡对应的第二网络作为备用网络存储,网络质量由网络质量参数确定。
本申请中,也可以在未存储备用网络的情况下,先得到备用网络,然后下次判定数据流的流质量参数满足对应的评估条件的情况下,将数据流切换到备用网络上传输。
作为本申请第一方面的另一实现方式,电子设备将第二网卡对应的第二网络作为备用网络存储之前,该方法还包括:
电子设备唤醒第二网卡对应的第二网络。
作为本申请第一方面的另一实现方式,电子设备将第二网卡对应的第二网络作为备用网络存储之前,该方法还包括:
电子设备获取第一网卡对应的第一网络的网络质量参数;
相应的,电子设备将第二网卡对应的第二网络作为备用网络存储包括:
在第二网卡对应的第二网络的网络质量优于第一网卡对应的第一网络的网络质量的情况下,电子设备将第二网卡对应的第二网络作为备用网络存储。
本申请中,还需要确定除主用网络以外的其他网络中质量最优的网络的网络质量是不是优于主用网络的网络质量。在优于主用网络的网络质量的情况下,才会作为备用网络,避免将数据流从网络质量不符合当前数据流的要求的主用网络切换到网络质量更差的网络上。
作为本申请第一方面的另一实现方式,电子设备运行第一应用包括:
电子设备在前台运行第一应用;
相应的,该方法还包括:
电子设备检测到第一应用在前台运行后,电子设备按照电子设备的网卡的优先级顺序依次执行主用网络确定步骤,直到得到电子设备的主用网络;
其中,主用网络确定步骤包括:
电子设备获取第四网卡对应的网络的网络状态,第四网卡为电子设备的一个网卡;
在第四网卡的网络状态为可用的情况下,电子设备获取第四网卡的网络质量参数;在第四网卡的网络状态为不可用的情况下,结束本次主用网络确定步骤;
在第四网卡的网络质量参数在预设范围内的情况下,将第四网卡作为电子设备的主用网络存储;在第四网卡的网络质量参数不在预设范围内的情况下,结束本次主用网络确定步骤。
本申请中,电子设备设置了网卡优先级的情况下,会按照网卡优先级顺序选择可用、切网络质量满足预设要求(例如,网络质量参数在预设范围内)的网卡作为主用网卡传输电子设备前台运行的应用的数据流。因此,可以在应用切换到前台后,按照同样的逻辑得到电子设备的主用网卡,主用网卡即传输第一应用的数据流的网卡。
作为本申请第一方面的另一实现方式,电子设备获取第一网卡对应的第一网络的网络质量参数包括:
在得到电子设备的主用网络之后,电子设备以第一周期监测主用网络的网络质量参数。
本申请中,为了便于随时和得到的备用网络的网络质量进行比较,需要定期监测主用网络的网络质量参数。
作为本申请第一方面的另一实现方式,电子设备获取第一网卡对应的第一网络的网络质量参数包括:
电子设备获取传输第一数据流和第二数据流的网络,传输第一数据流和第二数据流的网络为第一网卡对应的第一网络;
电子设备以第一周期监测第一网络的网络质量参数。
本申请还可以通过传输当前前台应用的数据流的网络确定主用网络。从而提供多样化的方式获取主用网络的网络质量参数,以便于在确定备用网络时,比较网络质量的优劣(或高低)。
作为本申请第一方面的另一实现方式,该方法还包括:
电子设备运行第二应用,电子设备通过第一网卡传输第二应用的数据流;
当第二应用的数据流包括第三数据流,电子设备通过第一网卡传输第一子数据流,通过第二网卡传输第二子数据流,第三数据流为具有第三特征的数据流,第一子数据流和第二子数据流属于第三数据流。
本申请中,针对不同特征数据流可以采用不同的网络策略,例如,可以切换,还可以并发。即将满足特定特征(例如,第三特征)的数据流中的各个子数据流分到电子设备的多个网卡上传输,以提高该特定特征的数据流的传输速度。
作为本申请第一方面的另一实现方式,当第二应用的数据流包括第三数据流,该方法还包括:
电子设备获取第三特征对应的第三条件;
在电子设备通过第一网卡传输第一子数据流的过程中,该方法还包括:
当第一子数据流满足第三条件、且第二子数据流不满足第三条件,电子设备通过第二网卡传输第一子数据流和第二子数据流。
在电子设备通过第二网卡传输第二子数据流的过程中,该方法还包括:
当第一子数据流不满足第三条件,且第二子数据流满足第三条件,电子设备通过第一网卡传输第一子数据流和第二子数据流。
本申请中,在通过多个网卡传输多个子数据流时,也可以查看各个网卡上的子数据流的流质量参数,以在某个网卡传输的子数据流的流质量参数满足对应的条件时,切换到其他质量更优的网卡上传输。
第二方面,提供一种电子设备,包括处理器,处理器用于运行存储器中存储的计算机程序,实现本申请第一方面任一项的方法。
第三方面,提供一种芯片系统,包括处理器,处理器与存储器耦合,处理器执行存储器中存储的计算机程序,以实现本申请第一方面任一项的方法。
第四方面,提供一种计算机可读存储介质,计算机可读存储介质存储有计算机程序,计算机程序被一个或多个处理器执行时实现本申请第一方面任一项的方法。
第五方面,本申请提供了一种计算机程序产品,当计算机程序产品在设备上运行 时,使得设备执行本申请第一方面任一项的方法。
可以理解的是,上述第二方面至第五方面的有益效果可以参见上述第一方面中的相关描述,在此不再赘述。
附图说明
图1为本申请实施例提供的一种电子设备的硬件结构示意图;
图2为本申请实施例提供的一种应用场景示意图;
图3为本申请实施例提供的一种网络加速方法示意图;
图4为本申请实施例提供的另一应用场景示意图;
图5为本申请实施例提供的另一网络加速方法示意图;
图6为本申请实施例提供的一种网络加速方法的流程示意图;
图7为本申请实施例提供的技术架构图;
图8为本申请实施例提供的网络加速方法的时序图;
图9为本申请实施例提供的另一网络加速方法的时序图;
图10为本申请实施例提供的另一网络加速方法的时序图;
图11为本申请实施例提供的另一网络加速方法的时序图;
图12为本申请实施例提供的另一网络加速方法的时序图;
图13为本申请实施例提供的流量上报组件上报给流量感知组件数据流的示意图。
具体实施方式
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本申请。
应当理解,当在本申请说明书和所附权利要求书中使用时,术语“包括”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。
还应当理解,在本申请实施例中,“一个或多个”是指一个、两个或两个以上;“和/或”,描述关联对象的关联关系,表示可以存在三种关系;例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A、B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。
另外,在本申请说明书和所附权利要求书的描述中,术语“第一”、“第二”、“第三”、“第四”等仅用于区分描述,而不能理解为指示或暗示相对重要性。
在本申请说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。
本申请实施例提供的一种网络加速方法,可以适用于电子设备中。该电子设备可以为平板电脑、手机、可穿戴设备、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本、个人数字助理(personal digital assistant,PDA)等电子设备。 本申请实施例对电子设备的具体类型不作限定。
图1示出了一种电子设备的结构示意图。电子设备100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中,传感器模块180可以包括压力传感器180A,触摸传感器180K等。
可以理解的是,本申请实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。例如,处理器110用于执行本申请实施例中的网络加速方法。
其中,控制器可以是电子设备100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。
USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为电子设备100充电,也可以用于电子设备100与外围设备之间传输数据。
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。
内部存储器121可以用于存储计算机可执行程序代码,可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行电子设备100的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)。
此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也 可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,外部存储器,显示屏194,摄像头193,和无线通信模块160等供电。
在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。
电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。
天线1和天线2用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。
无线通信模块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可以通过无线通信技术与网络以及其他设备通信。
电子设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。
音频模块170用于将数字音频信号转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。电子设备100可以通过扬声器170A收听音乐,或收听免提通话。
受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。当电子设备100接听电话或语音信息时,可以通过将受话器170B靠近人耳接听语音。
麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。当拨打电话或发送语音信息时,用户可以通过人嘴靠近麦克风170C发声,将声音信号输入到 麦克风170C。电子设备100可以设置至少一个麦克风170C。在另一些实施例中,电子设备100可以设置两个麦克风170C,除了监听语音信息,还可以实现降噪功能。在另一些实施例中,电子设备100还可以设置三个,四个或更多麦克风170C,实现采集声音信号,降噪,还可以识别声音来源,实现定向录音功能等。
耳机接口170D用于连接有线耳机。耳机接口170D可以是USB接口130,也可以是3.5mm的开放移动电子设备平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。
压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于显示屏194。压力传感器180A的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器180A,电极之间的电容改变。电子设备100根据电容的变化确定压力的强度。当有触摸操作作用于显示屏194,电子设备100根据压力传感器180A检测触摸操作强度。电子设备100也可以根据压力传感器180A的检测信号计算触摸的位置。
触摸传感器180K,也称“触控面板”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于电子设备100的表面,与显示屏194所处的位置不同。
按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。电子设备100可以接收按键输入,产生与电子设备100的用户设置以及功能控制有关的键信号输入。
马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振动反馈。
电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏194用于显示图像,视频等。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的正整数。
摄像头193用于捕获静态图像或视频。在一些实施例中,电子设备100可以包括1个或N个摄像头193,N为大于1的正整数。
SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和电子设备100的接触和分离。电子设备100可以支持1个或N个SIM卡接口,N为大于1的正整数。
本申请实施例并未特别限定一种网络加速方法的执行主体的具体结构,只要可以通过运行记录有本申请实施例的一种网络加速方法的代码,以根据本申请实施例提供的一种网络加速方法进行处理即可。例如,本申请实施例提供的一种网络加速方法的 执行主体可以是电子设备中能够调用程序并执行程序的功能模块,或者为应用于电子设备中的处理装置,例如,芯片。
如图1所示的电子设备中可以安装运行多个应用,例如:社交通信应用、游戏应用、音视频应用和新闻应用等。这些应用可以通过所在的电子设备与其他电子设备(例如,应用对应的服务器)建立网络连接。
作为示例,应用A可以通过所在的电子设备中的无线网卡(也可记为Wi-Fi网卡)与应用A对应的服务器建立网络连接;应用A还可以通过所在的电子设备中的数据业务网卡与应用A对应的服务器建立网络连接。其中,无线网卡为支持无线局域网(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)等移动通信技术上网的装置。
为了便于描述,可以将一个电子设备通过无线网卡与其他电子设备之间建立的网络通道记为Wi-Fi网络;将一个电子设备通过数据业务网卡与其他电子设备之间建立的网络通道记为蜂窝网络。
在实际应用中,不同应用(或者不同类别的应用)对所使用的网络通道的质量的要求不同。
参见图2,用户使用手机中的应用A(游戏类应用)玩游戏,其中,手机中的应用A通过手机中的无线网卡与应用A的服务器A建立网络连接,应用A和服务器A之间产生的数据流A(例如,游戏对战时产生的数据流)通过手机上的无线网卡和无线路由器之间的Wi-Fi网络传输。用户使用手机中的应用B(聊天类应用)聊天,其中,手机中的应用B通过手机的无线网卡与应用B的服务器B建立网络连接,应用B和服务器B之间产生的数据流B(例如,聊天时产生的数据流)通过手机上的无线网卡和无线路由器之间的Wi-Fi网络传输。
本申请实施例中将两个电子设备之间传输的数据序列记为数据流。在实际应用中,基于该数据流的应用场景,该数据流可以为视频流、音频流、下载流、会话流等。
若用户在同一位置(无线网卡和无线路由器之间的距离相同)、同一时间范围内(例如,半个小时以内)使用手机中的应用A和手机中的应用B,理论上Wi-Fi网络质量差异不大。然而,由于数据流A相比于数据流B在单位时间内产生的数据量更大,所以数据流A相比于数据流B对Wi-Fi网络的质量要求更高。用户使用应用B时比较顺畅,然而,用户使用应用A时可能出现卡顿现象,导致用户的体验较差。
因此,不同应用(或不同类别的应用)对网络通道的质量的要求是不同的。本申请实施例可以针对不同应用(或不同类别的应用)设置不同的网络质量评估算法。在评估某个应用当前使用的网络通道不足以承载该应用产生的数据流的情况下(例如,用户携带手机远离无线路由器的位置等),设置传输质量提升策略以加速数据流传输。
参见图2,在通过网络质量评估算法评估应用A的数据流A的传输质量较差的情 况下,可以将数据流A从当前的Wi-Fi网络切换到其他网络通道。如图2所示,手机可以将数据流A切换到手机的数据业务网卡和基站之间的蜂窝网络上,以通过该蜂窝网络与服务器A传输数据流A。
另外,即使用户使用同一应用处理不同业务时,对该应用使用的网络通道的质量的要求可能也不相同。
参见图3,用户使用手机中的应用B(聊天通信类应用)进行视频通话时还在查看浏览其他信息(例如,浏览朋友圈),其中,手机中的应用B通过手机中的无线网卡与应用B的服务器B建立网络连接,应用B和服务器B之间产生的数据流B1(例如,视频通话产生的数据流)和数据流B2(例如,浏览朋友圈产生的数据流)通过手机上的无线网卡和无线路由器之间的Wi-Fi网络传输。
由于数据流B1相比于数据流B2在单位时间内产生的数据量更大,所以数据流B1相比于数据流B2对Wi-Fi网络的质量要求更高。
在Wi-Fi网络较好的情况下,数据流B1传输较流畅(可以通过数据流B1的流质量参数体现,例如,数据流B1的流质量参数不满足为数据流B1设置的第一条件),数据流B2传输也较流畅(可以通过数据流B2的流质量参数体现,例如,数据流B2的流质量参数不满足为数据流B2设置的第二条件),数据流B1和数据流B2均通过无线网卡传输。
在Wi-Fi网络较差的情况下,数据流B1传输可能卡顿(可以通过数据流B1的流质量参数体现,例如,数据流B1的流质量参数满足为数据流B1设置的第一条件),数据流B2传输仍然较流畅(可以通过数据流B2的流质量参数体现,例如,数据流B2的流质量参数不满足为数据流B2设置的第二条件,有可能满足第一条件,也有可能不满足第一条件),数据流B1被切换到数据业务网卡上传输,数据流B2仍然通过无线网卡传输。
在Wi-Fi网络很差的情况下,数据流B1传输可能卡顿(可以通过数据流B1的流质量参数体现,例如,数据流B1的流质量参数满足为数据流B1设置的第一条件,也可能满足第二条件也可能不满足第二条件),数据流B2传输也可能卡顿(可以通过数据流B2的流质量参数体现,例如,数据流B2的流质量参数满足为数据流B2设置的第二条件),数据流B1和数据流B2均被切换到数据业务网卡上传输。
上述示例中可以理解,流质量参数的第一条件优于第二条件。并且,图3中从上到下为网络质量逐渐变差的过程。在实际应用中,网络质量也可能从图3中最上面的场景(Wi-Fi网络较好)直接变为最下面的场景(Wi-Fi网络很差)。
图3所示场景中,应用B可以作为第一应用的一个示例,数据流B1可以作为第一应用的第一数据流的一个示例,数据流B2可以作为第一应用的第二数据流的一个示例。无线局域网卡可以作为第一网卡的一个示例,数据业务网卡作为第二网卡的一个示例。
参见图4,用户使用应用A进行下载时,产生下载流A1,用户使用应用A进行会话时,产生会话流A2。下载流A1和会话流A2均可以通过无线网卡和2.4GHz的无线路由器之间的Wi-Fi网络传输。
若用户在同一位置(无线网卡和无线路由器之间的距离相同)、同一时间范围内 (例如,半个小时以内)使用手机中的应用A分别进行下载和会话,理论上,网络通道质量差异不大。然而,由于数据流A1相比于数据流A2在单位时间内产生的数据量更大,所以数据流A1相比于数据流B对网络通道的质量要求更高。用户使用应用A进行会话时比较顺畅,然而,用户使用应用A进行下载时可能觉得下载速率太慢,导致用户的体验较差。
因此,同一应用的不同业务场景对网络通道的质量的要求是不同的。本申请实施例可以针对同一应用的不同业务场景设置不同的网络质量评估算法。在评估应用当前使用的网络通道不足以承载该应用产生的某个数据流的情况下,设置传输质量提升策略以加速数据流传输。
参见图5,在通过网络质量评估算法评估应用A的数据流A1的传输质量较差的情况下,可以将数据流A1分配到多个网络通道上并行传输。如图3所示,手机上设置有无线网卡1,支持2.4GHz的收发;还设有无线网卡2,支持5.0GHz的收发;还设有数据业务网卡。数据流A1可能包括多个子数据流,可以将多个子数据流分为3组数据流:数据流A1-1,数据流A1-2和数据流A1-3。将3个数据流分别分发到3个网络通道上传输。
需要说明,图5中的无线路由器可以为同时支持2.4GHz的收发和5.0GHz的收发的一个无线路由器,还可以是分别支持2.4GHz的收发和5.0GHz的收发的两个路由器。
图5所示场景中,应用A可以记为第二应用,第二应用为可以产生第三数据流(例如下载流),第三数据流包括至少两个子数据流,下载流A1-1可以记为第二子数据流,下载流A1-3可以记为第一子数据流。当然,第二应用可以和第一应用为同一应用,也可以为第一应用以外的其他应用。第一网卡为无线网卡1。第二网卡为数据业务网卡,无线网卡2不再详细说明。
与上一示例的区别在于:上一示例中,若Wi-Fi网卡对应的网络变差,将下载流切换到数据业务网卡上。本示例中,在确定为特殊流(具有第三特征的数据流,例如,下载流)的情况,首先将下载流中的多个子数据流分配到电子设备的多个网卡上,若承载子数据流的任一网卡(例如,第一网卡)的网络质量不再能够满足位于该网卡的子数据流的要求(即满足为第三数据流设置的评估条件,该评估条件记为第三条件),则需要将不满足要求的网卡上的子数据流切换到其他网络质量更好的网卡上传输。例如,将第一网卡上满足第三条件的下载流A1-3切换到数据业务网卡上(此时下载流A1-1不满足第三条件),数据业务网卡上将传输下载流A1-1和下载流A1-3。或者,将第二网卡上下载的A1-1切换到无线网卡上(此时下载流A1-3不满足第三条件),无线网卡上将传输下载流A1-1和下载流A1-3。当然,也可以将不满足第三条件的子数据流切换到其他满足要求的网卡上。另外上述场景中,不同的数据流具有不同的特征,例如,第一数据流为具有第一特征的数据流,第二数据流为具有第二特征的数据流,第三数据流为具有第三特征的数据流。相应的,每个数据流对网络质量的要求可以通过各自对应的评估条件判定,例如,第一数据流对应的传输质量评估条件为第一条件,第二数据流对应的传输质量评估条件为第二条件,第三数据流对应的传输质量评估条件为第三条件。本申请实施例中的第一、第二、第三等仅用于表示不同示例中的不同目标物,在实际应用中,不同示例中的不同目标物可以为同一目标物,也可以 为不同的目标物。例如,第三数据流和第一数据流可以同一应用的同一类型的数据流(特征相同),只是在不同的实施例中由于方案不同命名不同。也可以为不同应用的不同数据流。
通过图2至图5可以理解,还可以设置不同的传输质量提升策略(例如,图3中的切换,图5中的并发)以加速数据流的传输,从而提升用户的体验。
本申请实施例中某个网络通道的网络质量的好(优)坏(差)或某个数据流在某个网络通道上的传输质量的好(优)坏(差)均可以通过一些参数(可以记为流质量参数)进行评估。在具体实现时,可以设置一些条件,例如,在满足条件1时,认为评估结果为好(优),在不满条件1时,认为评估结果为坏(差);或者在满足条件2(例如,上述示例中的第一条件、第二条件、第三条件)时,认为评估结果为坏(差),在不满条件2时,认为评估结果为好(优)。本申请实施例网络质量和传输质量的评判条件不做限定。流质量参数包括以下至少一项:时延、速率、丢包率、重传率和报文响应是否超时。当然,也可参照后续表2和表3中的示例。
上述场景中的第二网卡也可以理解为电子设备当前使用的主用网络以外的备用网络。
鉴于上述图2至图5的描述,本申请实施例提供一种网络加速方法。该网络加速方法中,开发人员可以预先针对不同应用(或不同类别的应用)设置不同的网络质量评估算法和不同的传输质量提升策略。
当然,实际应用中,也可以针对不同应用(或不同类别的应用)设置不同的网络质量评估算法和相同的传输质量提升策略;或者针对不同应用(或不同类别的应用)设置相同的网络质量评估算法和不同的传输质量提升策略。
还可以针对同一应用的不同业务场景设置不同的网络质量评估算法和不同的传输质量提升策略。
当然,实际应用中,也可以针对同一应用的不同业务场景设置不同的网络质量评估算法,和相同的网络质量提升策略;或者针对同一应用的不同业务场景设置相同的网络质量评估算法和不同的传输质量提升策略。
鉴于上述描述,可以得到如表1所示的网络加速方法,该网络加速方法中,可以考虑为不同的应用类别和/或不同的业务场景设置网络加速策略。在设置网络加速策略时,可以采用不同的网络质量评估算法和/或采用不同的传输质量提升策略。
表1多个网络加速方法
Figure PCTCN2022117085-appb-000001
以表1中的网络加速方法9为例,可以为不同类别的应用在不同业务场景(例如,通过应用的数据流的特征确定)下设置不同的网络质量评估算法,在网络质量评估算法评估的网络质量较差(或用于评估网络质量的一些参数满足某个条件)的情况下,采用不同的网络质量提升策略实现网络加速。其他网络加速方法不再一一举例。
参见图6,为本申请实施例提供的一种网络加速方法的流程示意图。该流程示意图与上述表1中的网络加速方法9对应。
步骤A1,电子设备检测到应用A在前台运行。
在本申请实施例中,应用A可以是电子设备中任意能够联网使用网络的应用程序。电子设备检测到应用A在前台运行可以是电子设备检测到应用A开启后在前台运行,也可以是监测到应用A从后台切换到前台运行。
步骤A2,电子设备确定应用A是否支持网络加速。
在本申请实施例中,电子设备中存储有应用配置库,该应用配置库可以由开发人员预先设置,也可以由用户在使用电子设备的过程中设置或添加。该应用配置库中存储有支持网络加速的应用的标识。
电子设备检测到应用A切换到前台后,可以获得应用A的应用标识,并在应用配置库中查询是否存在应用A的应用标识,若存在应用A的应用标识则表示应用A支持网络加速。
当然,上述确定应用A是否支持网络加速的方式仅用于举例。实际应用中,该应用配置库还可以存储多个应用标识,每个应用标识采用不同的字符表示该应用标识表示的应用是否支持网络加速。作为示例,可以采用“1”表示支持网络加速,采用“0” 表示不支持网络加速。其他确定应用是否支持网络加速的方式不再一一举例。
步骤A3,在应用A支持网络加速的情况下,电子设备查询应用A的数据流特征,以得到应用A的数据流特征对应的网络质量评估算法。
在本申请实施中,设置不同业务场景一方面便于理解设置不同网络质量评估算法的作用;另一方面还可以基于不同业务场景确定采用何种网络质量评估算法。然而,实际应用中,不同业务场景产生的数据流的特征可能不同。因此,并不是必须确定应用A当前的业务场景,可以根据应用A当前的数据流的特征确定当前应该采用的网络质量评估算法。应用A的数据流的各种信息可以存储在应用A的流特征库中。
在具体实现时,电子设备的系统中存在Netfilter组件,通过该组件可以获取到特定应用标识对应的应用的数据流。
作为一种示例,若承载应用A的数据流网络通道为网络通道1,则Netfilter组件可以获取应用A在网络通道1上的数据流的报文。若承载应用A的数据流网络通道为网络通道1和网络通道2,则Netfilter组件可以获取应用A在网络通道1和网络通道2上的数据流的报文。
当然,实际应用中,也可以通过其他方式获取数据流的报文。获取的数据流的报文的集合为流特征库。
在通过应用的数据流的特征确定网络质量评估算法时,可以将应用的数据流的协议、端口和报文特征作为特征确定网络质量评估算法。其中,协议为应用传输数据流时的协议类型,端口为传输数据流时使用的端口,报文特征为应用传输数据流时的数据包的头部特征。
作为示例,某社交通信类应用在进行音视频通话时,数据流对应的数据包的头部特征为97开头,即data[0]=97,传输数据包时采用UDP协议,并且使用8080端口传输数据包。在得到的数据流中,若某个数据流满足上述特征,则可以得到与该特征匹配的网络质量评估算法为:若5个周期(例如,每个周期为500ms)内连续3个周期内数据的时延超过300ms,或丢包率超过20%,则评估结果:卡顿。
上述确定网络质量评估算法的示例仅用于举例,实际应用中,还可以通过协议、端口和报文特征以外的其他特征确定网络质量评估算法。
当然,某个应用在实现某个功能时,可能产生多个数据流,若针对多个数据流的特征分别确定了网络质量评估算法,则采用对应的网络质量评估算法评估对应的数据流的传输质量。
作为示例,某个应用在实现某个功能时,可能产生数据流1、数据流2和数据流3。
根据数据流1的特征确定网络质量评估算法1,并确定数据流1是否满足算法1设置的传输质量提升条件;
根据数据流2的特征确定网络质量评估算法2,并确定数据流2是否满足算法2设置的传输质量提升条件;
数据流3的特征并未满足任一可确定网络质量评估算法的条件,则无需评估数据流3的传输质量,也不需要提升数据流3的传输质量。
步骤A4,电子设备判断应用A的数据流的相关参数是否满足算法设置的传输质量提升条件。
需要说明,实际应用中,可以根据算法模型以及应用A的数据流的相关参数得到应用A的数据流的传输质量评估结果(例如,可以得到质量分数或质量等级),根据传输质量评估结果确定是否需要提升该数据流的传输质量。当然,实际应用中,该算法可以预先设置确定需要提升该数据流的传输质量的条件,在满足该条件的情况下,获取传输质量提升策略,并执行传输质量提升策略。
如步骤A3中的网络质量评估算法的举例,需要得到应用A的各个数据流的时延、丢包率等。
如前,该应用A的流特征库中存储该应用A的数据流的各种信息,例如,应用使用当前网络时采用的协议的协议特征,应用使用当前网络时传输的数据包的头部特征等。当然,还可以包括应用使用当前网络时的流量特征。
其中,应用的流量特征可以包括:上行速率、下行速率、流间隔时间、包间隔时间、包大小和流量分布等信息。当然,还可以包括上述信息中的部分信息,或上述信息以外的其他信息。
通过流量特征可以得到时延情况、丢包情况、下行速率、上行速率等。因此,这些流量特征可以作为网络质量评估算法的评估参数。当然,实际应用中,不同的网络质量评估算法获得的用于评估网络质量的参数可能不同,例如,可以包含上述参数中的一个或多个,还可以包含上述参数以外的其他参数。因此,可以根据网络质量评估算法的评估参数确定应用的流量特征包含的参数类别。
步骤A5,在应用A的数据流的相关参数满足算法设置的条件情况下,根据应用A的数据流特征确定传输质量提升策略。
如前,可以预先为不同应用的不同业务场景(由数据流的特征确定)设置不同的传输质量提升策略,多个传输质量提升策略存储在提升策略库中。当然,实际应用中,也可以设置数据流的特征与传输质量提升策略的对应关系,在确定数据流的特征之后,就可以得到与该数据流的特征对应的传输质量提升策略。通过数据流的特征就可以从提升策略库中查询到与该特征匹配的传输质量提升策略。
步骤A6,执行传输质量提升策略。
本申请实施例中,一个应用在某个业务场景下可以产生多个数据流。在实际应用中,若多个数据流中部分数据流的特征满足预先设置的需要提升传输质量的条件,则可以将满足预先设置的需要提升传输质量的条件的数据流切换到其他网络通道;当然,也可以将满足预先设置的需要提升传输质量的条件的数据流以及与该满足预先设置的需要提升传输质量的条件的数据流相关的数据流切换到其他网络通道,可以预先设置数据流之间的相关性,例如,可以将下载类应用中具有相同源地址和目的地址的多个下载流设置为相关的数据流,也可以将聊天类应用中具有相同源地址和目的地址的视频流和音频流设置为相关的数据流;还可以将该应用的全部数据流切换到其他网络通道。
作为另一示例,实际应用中,若多个数据流中部分数据流的特征满足预先设置的需要提升传输质量的条件,也可以将满足预先设置的需要提升传输质量的条件的数据流分配到电子设备支持的多个网络通道;也可以将满足预先设置的需要提升传输质量的条件的数据流以及与该满足预先设置的需要提升传输质量的条件的数据流相关的数 据流分配到多个网络通道上。当然,还可以将该应用的全部数据流分配到电子设备支持的多个网络通道上。
作为另一示例,实际应用中,若多个数据流中部分数据流的特征满足预先设置的并发条件,则可以首先将满足并发条件的数据流分配到多个网络通道上。在多个网络通道上的多个数据流中,存在某个数据流的特征满足预先设置的需要提升传输质量的条件的情况下,再将满足预先设置的需要提升传输质量的条件的数据流切换到质量更优的网络通道上。
作为另一示例,可以基于表2中的数据流的特征确定相应的网络质量评估算法和相应的传输质量提升策略。
表2多个应用多个业务场景的流特征、网络质量评估算法和传输质量提升策略
Figure PCTCN2022117085-appb-000002
其中,表2中的com.tencent.mm可以为微信包名,com.tencent.tmgp.sgame可以为王者荣耀包名。数据流的特征均可以为协议、端口和报文特征。表2中一个条目可以为一个应用的一个业务场景设置的数据流的特征条件、网络质量评估算法和网络质量提升策略。另外,表2仅列举了部分应用的部分业务场景对应的协议、端口和报文特征,且仅用于示例。
表2中的网络质量评估算法和传输质量提升策略仅用于举例,在实际应用中还可以采用其他不同的确定网络质量评估算法的方式和采用不同的传输质量提升策略。传输质量提升策略中“切换”可以表示上述实施例中的任一形式的切换;“并发”可以表示上述实施例中的任一形式的并发。
作为另一示例,手机淘宝应用在浏览商品文字图像和观看商品视频业务场景时, 可以仅将评估网络质量较差的流切换到其他网络,也可以在质量较差的流的个数(或比例)大于预设值(或预设比例)的情况下,将该应用下的所有流均切换到其他网络。
例如,该应用在某个业务场景下可能产生10个流,若仅有1个流或2个流的质量较差,则将质量较差的流切换到其他网络,若有3个或以上的流的质量较差,则将该应用下的全部流(10个流)全部切换到备用网络。
另外,在具体实现时,可以为不同的应用设置不同的应用标识,可以在数据流的特征满足特征条件时,得到网络质量评估算法设置的提升传输质量的条件,在数据流的相关参数满足提升传输质量的条件时,获得传输质量提升策略,并执行传输质量提升策略。
在实际应用中,表2中仅列出了部分应用的部分数据流的特征,以及对应的网络质量评估算法和传输质量提升策略。在实际应用中,还可以采用其他网络质量评估算法和传输质量提升策略。作为示例,还可以采用表3中示例的网络质量评估算法。
表3网络质量评估算法
Figure PCTCN2022117085-appb-000003
当然,实际应用中,表3中的网络质量传输算法仅用于示例,实际应用中,还可以采用表3所示的网络质量传输算法以外的其他算法,本申请实施例对此不做限定。
在描述本申请实施例提供的网络加速方法后,下面将描述实现网络加速方法的技术实现细节。
参见图7,为本申请实施例提供的一种网络加速方法的技术架构图。
该技术架构包括:应用层、服务层、策略层和内核层。图7中仅示出了与本申请实施例相关的部分层和部分组件,实际应用中,还可以包括图7中未示出的层级和组件。当然,也可以仅包含图7所示的组件中的部分组件。
应用层中存在各种应用,例如,如前的视频类应用,游戏类应用等。
服务层中存在环境探测组件、网络探测组件、通道级路径管理组件、应用级策略管理组件、通道及应用质量评估组件、网络连接管理组件。
其中,环境探测组件用于探测上层应用的各种事件,作为示例,可以探测应用的打开、退出,还可以探测当前切换到前台的应用,还可以探测应用的安装、卸载等。网络探测组件用于探测电子设备支持的Wi-Fi网络的状态(开启或关闭等),还可以探测电子设备支持的数据业务网络的状态。作为示例,电子设备中设置有2.4GHz频段的无线网卡1和5.0GHz频段的无线网卡2。网络探测组件可以探测2.4GHz频段的无线网络为开启还是关闭状态;还可以探测5.0GHz频段的无线网络为开启或关闭状态。电子设备中设有运营商A的数据业务网卡1和运营商B的数据业务网卡2。网络探测组件可以探测运营商A的数据业务为开启还是关闭状态;还可以探测运营商B的数据业务为开启还是关闭状态。
通道及应用质量评估组件用于评估网络通道的质量。作为示例,该通道及应用质量评估组件可以评估2.4GHz频段的Wi-Fi网络的质量,还可以评估5.0GHz频段的Wi-Fi网络的质量。也可以评估运营商A的蜂窝网络的质量,还可以评估运营商B的蜂窝网络的质量。网络连接管理组件用于启动网络通道,即将网络通道从休眠状态转换为唤醒状态。其中,唤醒状态的网络通道可以直接被使用。
通道级路径管理组件存储有多条网络通道的路径,用于请求或关闭任一网络通道,可以感知任一网络通道的状态变化,还可以感知任一网络通道的质量。应用级策略管理组件用于开启网络加速功能,以及启用数据流的监控功能。
策略层中设有流级策略管理组件、流级路径管理组件和流量感知组件。其中,流量感知组件用于对上报的数据流进行统计,评估各个流的网络质量。流级策略管理组件存储应用中流的传输质量提升策略,还用于指示执行传输质量提升策略。流级路径管理组件用于根据上层的策略变化更新网络通道的选取,触发网络通道质量探测,动态选取最优通道,还可以用于存储不同的网络通道的路径,示例性的,可以存储应用当前使用的网络通道(例如,主网络通道)及备用网络通道的路径。
内核层存在策略执行组件和流量上报组件。其中,流量上报组件用于收集数据流信息,并上报收集的数据流信息。策略执行组件用于执行网络通道的切换。
作为本申请另一实施例,上述实施例中一个组件可以拆分为两个或多个组件,位于同一层级的两个或多个组件可以合并为同一组件。
作为示例,策略层的流级策略管理组件和流级路径管理组件可以合并为同一组件;应用级策略管理组件和通道级路径管理组件可以合并为同一组件。
为对上述架构图具有更清晰的理解,参见图8,为本申请实施例提供的基于图7 所示的各个组件实现的一种网络加速方法的时序图。
步骤B1,用户启动应用A或将应用A从后台切换到前台。
步骤B2,环境探测组件检测到应用A开启或应用A从后台切换到前台,获取应用A的标识。
步骤B3,环境探测组件将应用A的标识发送给应用级策略管理组件。
该应用的标识用于唯一识别该应用,可以和应用的包名具有一一对应的关系,也可以采用应用的包名。
步骤B4,应用级策略管理组件基于接收到的应用A的标识,从应用配置库中查询接收到的标识对应的应用A是否支持网络加速。从应用配置库中查询到的结果为:支持网络加速。
步骤B5,在查询结果为支持网络加速的情况下,应用级策略管理组件向流级路径管理组件下发用于表示应用A开启网络加速的信息。
在具体实现中,该消息可以携带应用A的标识。
步骤B6,流级路径管理组件向流量上报组件下发表示应用A开启网络加速的消息。
在具体实现时,该消息也可以携带应用A的标识,且步骤B6中发送的消息和步骤B5中发送的消息可以相同,也可以不同。
步骤B7,流量上报组件接收到表示应用A开启网络加速的信息之后,注册报文监听钩子。
该报文监听钩子可以监听应用A的数据流的相关信息,该相关信息为应用A的流特征库中存储的信息。该数据流中携带了承载该数据流的网络的路径信息。
在步骤B4之后,可以探测应用A当前使用的网络的路径以及定期检测应用A当前使用的网络的网络质量。
如前,可以通过报文监听钩子监听到的数据流确定应用A当前使用的网络的路径。
作为另一示例,还可以按照系统设置的在存在多个可用网络的情况下选择主用网络的逻辑判断应用A当前使用的网络的路径。
在实际应用中,若电子设备中设有2.4GHz频段的无线网卡1、5.0GHz频段的无线网卡2、运营商A的数据业务网卡1和运营商B的数据业务网卡2。则可以默认无线网卡1或无线网卡2中的一个为主Wi-Fi,另一无线网卡为副Wi-Fi;默认运营商A的数据业务网卡1和运营商B的数据业务网卡2中的一个为主卡,另一个数据业务网卡为副卡。
作为示例,2.4GHz频段的网络通道为主Wi-Fi网络,5.0GHz频段的网络通道为辅Wi-Fi网络,数据业务网卡1对应的网络通道为主蜂窝网络,数据业务网卡2对应的网络通道为辅蜂窝网络。
在主Wi-Fi网络可用的情况下,系统默认电子设备或前台应用当前的主用网络为主Wi-Fi网络,在主Wi-Fi网络不可用的情况下,系统默认电子设备或前台应用当前的主用网络为主卡蜂窝网络。在主卡蜂窝网络不可用的情况下,系统默认电子设备或前台应用当前的主用网络为副Wi-Fi网络,在副Wi-Fi网咯不可用的情况下,系统默认电子设备或前台应用当前的主用网络为副卡蜂窝网络。
在应用A开启后在前台运行时,应用A按照上述规则使用主用网络;即使应用A 在前台时,系统将应用A中的部分数据流切换到其他网络上,在应用A切换到后台后,应用A中的数据流恢复使用系统默认的主用网络;在应用A从后台切换到前台后,应用A继续使用系统默认的主用网络。
因此,本申请实施例中可以按照上述规则依次请求该电子设备中的每个网络:主Wi-Fi、主卡网络、副Wi-Fi和副卡网络等。直到请求到一个可用且质量满足要求的网络。该可用且质量满足要求的网络可以理解为应用A当前使用的网络。具体可参照步骤C1至步骤C8。
步骤C1,流级路径管理组件接收到应用级策略管理组件发送的用于表示应用A开启网络加速的信息之后,向通道级路径管理组件发送请求主用网络的信息。
通道级路径管理组件接收到该请求信息后,按照主Wi-Fi、主卡网络、副Wi-Fi和副卡网络的顺序依次请求,直到找到一条可用且质量满足要求的网络,该网络为应用A的主用网络。
步骤C2,通道级路径管理组件向网络探测组件发送主Wi-Fi的状态的请求信息,该请求信息用于请求主Wi-Fi的状态。
步骤C3,网络探测组件确定主Wi-Fi可用。
步骤C4,网络探测组件向通道级路径管理组件返回主Wi-Fi的状态:可用。
步骤C5,在通道级路径管理组件接收到主Wi-Fi的状态可用的情况下,向通道及应用质量评估组件发送主Wi-Fi的质量的探测请求,该探测请求用于探测主Wi-Fi的质量。
本申请实施例中,任一网络的网络质量可以通过网络质量参数确定,网络质量参数包括以下至少一项:带宽、时延和空口速率。
步骤C6,通道及应用质量评估组件在评估主Wi-Fi的质量后,将主Wi-Fi的质量监测结果返回给通道级路径管理组件。
在具体实现中,在步骤C3之后,即网络探测组件确定主Wi-Fi可用之后,还可以执行步骤D1。
步骤D1,网络探测组件向通道及应用质量评估组件发送主Wi-Fi的质量的监测消息,该监测消息用于请求通道及应用质量评估组件监测主Wi-Fi的网络质量。
步骤D2,通道及应用质量评估组件接收到该消息后,开始监测主Wi-Fi的网络质量,并返回主Wi-Fi的质量给通道级路径管理组件。
在主Wi-Fi的网络质量好(例如,网络质量参数在预设范围)的情况下,可以确定主Wi-Fi为应用A的主用网络,可以定期监测主Wi-Fi的网络质量。
需要说明,步骤D2中监测的为网络通道的质量,采用的监测算法和上述实施例中根据数据流的特征确定的网络质量评估算法不同。为了便于描述们可以将该步骤采用的监测算法记为算法A。
作为算法A的一个示例,可以根据该通道的时延、丢包率、带宽和速率等参数作为参考评估网络通道的质量。
按照步骤D1和步骤D2这种方式,通道及应用质量评估组件可以接收到步骤C5发送的探测请求之前就开始监测主Wi-Fi的网络质量,从而可以快速得到主Wi-Fi的质量,在得到主Wi-Fi的质量之后,能够及时返回给通道级路径管理组件主Wi-Fi的 质量监测结果。
在实际应用中,通道及应用质量评估组件接收到步骤D1发送的监测请求后,首次获得监测结果可能在接收到步骤C5发送的探测请求之前,也可能在步骤C5发送的探测请求之后。
步骤C7,在通道级路径管理组件确定主Wi-Fi的网络质量满足要求的情况下,将主Wi-Fi作为主用网络的路径发送给流级路径管理组件。
步骤C8,流级路径管理组件存储主Wi-Fi的路径为主用网络的路径。
作为本申请另一示例,若步骤C3中,网络探测组件得到的主Wi-Fi的状态为不可用,网络探测组件不再执行步骤D1,相应的,通道及应用质量评估组件也不再执行步骤D2。通道级路径管组件接收到网络探测组件发送的主Wi-Fi不可用的消息后,也不再执行步骤C5,相应的,通道及应用质量评估组件也不再执行步骤C6。
通道级路径管组件接收到网络探测组件发送的主Wi-Fi不可用的消息后,继续按照步骤C2至步骤C6的方式(可以包括步骤D1和步骤D2,也可以不包括步骤D1和步骤D2)继续请求主卡网络(即当前请求的网络的下一个优先级网络)。若得到的结果为主卡网络可用且网络质量满足要求,则将主卡网络的路径作为主用网络的路径发送给流级路径管理组件,流级路径管理组件将主卡网络的路径作为主用网络的路径存储。同理,在主卡网络的网络质量满足要求的情况下,通道及应用质量评估组件也需要定期的评估主卡网络的质量。
在确定主用网络的过程中,需要循环执行步骤C2至步骤C6,直到得到所述电子设备的主用网络。该示例中,每一次循环执行步骤C2至步骤C6的过程中,探测的网络为一个电子设备的一个网卡对应的网络,在该过程中,每次请求的网络对应网卡可以记为第四网卡。
即电子设备按照电子设备的网卡的优先级顺序依次执行主用网络确定步骤,直到得到电子设备的主用网络;
其中,主用网络确定步骤包括:
电子设备获取第四网卡对应的网络的网络状态,第四网卡为所述电子设备的一个网卡;
在第四网卡的网络状态为可用的情况下,电子设备获取第四网卡的网络质量参数;在第四网卡的网络状态为不可用的情况下,结束本轮主用网络确定步骤,进入下一个优先级网卡的下一轮主用网络确定步骤;
在第四网卡的网络质量参数在预设范围内的情况下,将第四网卡作为电子设备的主用网络存储;在第四网卡的网络质量参数不在预设范围内的情况下,结束本轮所述主用网络确定步骤,进入下一个优先级网卡的下一轮主用网络确定步骤。
在实际应用中,可以由通道及应用质量评估组件确定网络的网络质量是否满足要求,在满足要求的情况下,定期评估该网络的网络质量;也可以由通道级路径管理组件接收到通道及应用质量评估组件发送的网络的质量监测结果后,确定网络的网络质量是否满足要求,在满足要求的情况下,向通道及应用质量评估组件发送请求消息,以请求定期评估该网络的网络质量。通过上述方式通告级路径管理组件可以定期获取到当前承载应用A的数据流的网络的网络质量,并将获得的当前承载应用A的数据流 的网络的网络质量发送到流级路径管理组件。
通过上述示例可以理解,按照系统设置的在存在多个可用网络的情况下选择主用网络的逻辑可以得到应用A当前使用的网络的路径。
在应用级策略管理组件执行步骤B4之后,即确定标识对应的应用A支持加速后,第一方面向通过流级路径管理组件向下层的流量上报组件传输应用A开启加速的消息,以使得流量上报组件注册报文监听钩子。第二方面还可以获得主用网络的网络路径以及主用网络的网络质量。第三方面通过流量感知组件向下层的流量上报组件传输启动数据流监控的消息,以使得流量上报组件通过注册的报文监听钩子监听应用A的数据流(具体可参照步骤B8)。
步骤B8,应用级策略管理组件向流量感知组件发送启动业务流监控的请求消息。
在具体实现时,应用级策略管理组件可以在执行完步骤B4之后同时执行步骤B5和步骤B8。应用级策略管理组件也可以在执行完步骤B4之后先执行步骤B5,在执行完步骤B5之后的预设时间(具体值可以根据实际情况设置)再执行步骤B8。
步骤B9,流量感知组件接收到步骤B8发送的请求消息后,向流量上报组件发送表示流量监控的消息。
步骤B10,流量上报组件接收到步骤B9发送的流量监控的消息后,将监听到的数据流上报给流量感知模块。
在步骤B7之后,流量上报组件中的报文监听钩子就开始监测数据流。接收到步骤B9发送的流量监控的消息后,将监听到的数据流上报给流量感知模块。并且,后续可以持续将监听的数据流上报给流量感知组件。
步骤B11,流量感知组件接收到流量上报组件上报的数据流,基于该数据流的特征确定网络质量评估算法。
需要说明,步骤B11中的网络质量评估算法和步骤D2中评估网络通道的算法不同。为了便于描述,步骤B11中的算法记为算法B。算法A为各个网络通道通用的算法,评估的是整个网络通道的网络质量。算法B为基于当前开启网络加速的应用的数据流的特征确定的算法,评估的是通过网络通道传输的满足预先设置的特征的数据流的传输质量。
步骤B12,流量感知组件基于网络质量评估算法开始评估应用A的各个数据流的传输质量得到评估结果。
需要说明,评估结果可以包括:优(例如,标识00)、可能卡顿(例如,标识10)和卡顿(例如,标识11)。
作为示例,上述表2中,为评估卡顿的条件,在实际应用中,还可以设置评估为可能卡顿的条件。
条件1:5个周期内连续3个时延超过300ms或丢包超过20%,则评估结果为卡顿。
条件2:5个周期内连续2个时延超过200ms或丢包率超过10%,则评估结果为可能卡顿。
若未出现上述两种情况,则评估结果为优。
基于上述理解,可以确定根据数据流的特征得到的网络质量评估算法不仅包含表 2中限定的卡顿的判断条件,实际应用中,还可以包括可能卡顿的判断条件。
作为另一示例,可以预先设置条件1和条件2,该评估结果也可以包括:满足条件1,满足条件2,不满足条件1且不满足条件2。
在具体实现时,评估结果的具体形式不做限定。
步骤B13,流量感知组件向流级策略管理组件发送评估结果。
需要说明,该步骤发送的评估结果可以是表示卡顿、可能卡顿和优的标识,还可以携带数据流的特征(或特征标识)。
或者,该评估结果可以:满足条件1,满足条件2,不满足条件1且不满足条件2的标识,还可以携带数据流的特征(或特征标识)。
步骤B14,流级策略管理组件接收该评估结果后,在评估结果为可能卡顿(满足条件2)的情况下,确定请求备用网络。
作为另一示例,实际应用中,虽然满足条件1和条件2的情况下,传输质量提升策略均为:切换。但是,在满足条件2的情况下,向流级路径管理组件发送的是备用路径的请求信息,在满足条件1的情况下,向流级路径管理组件发送的是备用路径的切换信息。
采用上述设置可以在预判数据流的传输质量可能变差(例如满足条件2)的情况,提前确定好备用网络,并将备用网络唤醒,以便于在数据流的传输质量确实变差(例如满足条件1)的情况下,能够快速将传输质量差的数据流切换到备用网络上。这是由于数据流的传输质量通常是逐渐变差的,所以,在可能变差的情况下,先将选择好备用网络,并将备用网络唤醒,在数据流的传输质量确实变差的情况下,将传输质量较差的数据流切换到已经唤醒的备用网络上。这样,既能够快速响应数据流的切换,使得用户对数据流的切换无感知,还能够避免过早将备用网络唤醒导致的功耗高的问题。
步骤B15,流级策略管理组件在确定满足条件2的情况下,向流级路径管路组件发送备用路径的请求信息。
步骤B16,流级路径管理组件在确定当前不存在备用网络的情况下,向通道级路径管理组件发送备用路径的请求消息。
通道级路径管理组件接收到该备用路径的请求消息后,开始查找当前使用的主用网络以外的其他可用且质量最好的网络。具体可参照步骤B17至步骤B23的描述。
步骤B17,通道级路径管理组件向网络探测组件发送网络B的状态的查询请求。
在本申请实施例中,网络B可以是当前主用网络之外的其他任一网络。当前的主用网络可以记为网络A。网络B可以记为第三网卡对应的网络。
步骤B18,网络探测组件查询网络B的网络状态可用。
步骤B19,网络探测组件向通道级路径管理组件发送网络B的状态:可用。
步骤B20,通道级路径管理组件在接收到网络B的网络状态可用的情况下,向通道及应用质量评估组件发送网络B的质量的探测请求。
在实际应用中,为了快速得到网络B的网络质量,在步骤B18网络探测组件确定网络B的网络可用的情况下,网络探测组件可以执行步骤B19和步骤E1。
步骤E1,网络探测组件向通道及应用质量评估组件发送监测网络B的质量的请求。
步骤E2,通道及应用质量评估组件接收到网络探测组件发送的监测网络B的质量的请求的情况下,开始采用A算法监测网络B的质量。
步骤B21,通道及应用质量评估组件在得到网络B的质量监测结果。
本申请实施例中,在评估网络通道的质量时采用网络质量参数,在评估数据流的传输质量时采用流质量参数。
步骤B22,通道级路径管理组件按照步骤B17至步骤B21的方式得到除主用网络以外的其他每个网络通道的状态和在状态可用的情况下得到可用的网络的网络质量。
步骤B23,通道级路径管理组件根据除主用网络以外的其他网络的状态和网络质量确定可用且网络质量最优的网络为主卡网络。当然,实际应用中,也可以设置一个范围,将第三网卡中网络质量参数在该范围内的网卡均作为备用网络。
需要说明,步骤E2检测网络B的质量时采用的算法和步骤D2采用的算法相同。
本申请实施例以确定质量最优(例如,信号强度最大,带宽更大等)的网络为备用网络,实际应用中。当然,实际应用中,还可以设置其他确定备用网络的条件。作为示例,还可以设置备用网络优先条件为:主用网络以外的可用、网络质量满足要求且不产生额外费用的网络作为备用网络,其中,不产生额外费用的网络可以为:Wi-Fi网络,流量套餐不限量的数据业务网络,或者流量套餐限量的数据业务网络但是当前使用流量小于当前月度计划流量(总流量/月度总天数×当前天数)。当然,备用网络可以是主用网络以外满足优先条件的网络中网络质量最好的一个。
在当前除主用网络以外的其他网络均不满足优先条件的情况下,再选择满足次优先条件的网络作为备用网络,其中,次优先条件为:主用网络以外的可用且网络质量满足要求的网络作为备用网络。当然,备用网络可以是主用网络以外满足次优先条件的网络中网络质量最好的一个。
在当前除主用网络以外的其他网络仍然不满足次优先条件的情况下,再选择主用网络以外可用的网络作为备用网络。当然,备用网络可以是主用网络以外可用的网络中网络质量最好的一个。
上述选择备用网络的方式仅用于举例,实际应用中,还可以为其他方式,在此不做限定。
步骤B24,在确定质量最优的网络为主卡网络之后,通道级路径管理组件向网络连接管理组件发送启用主卡网络的请求。
步骤B25,网络连接管理组件接收到主卡网络的启用请求后,将主卡网络从休眠状态切换为唤醒状态。
步骤B26,网络连接管理组件向通道级路径管理组件发送主卡网络已经被唤醒的消息。
步骤B27,通道级路径管理组件将当前确定的质量最优的主卡网络的路径和质量向流级路径管理组件发送。
如前,通道级路径管理组件可以定期得到电子设备的主用网络的网络质量。当然,通道级路径管理组件可以定期将得到电子设备的主用网络的网络质量发送至流级路径管理组件。
因此,流级路径管理组件可以定期得到主用网络(主Wi-Fi)的网络质量。
步骤F1,流级路径管理组件已经存储了主用网络的网络路径,在接收到通道级路径管理组件发送的主卡网络的路径和网络质量之后,可以比较最新接收到的存储的主卡网络的网络路径对应的质量参数以及接收到的主卡网络的质量参数,确定出质量更好的网络路径。
在具体实现时,若质量更好的网络路径为预先存储的主用网络路径,则表示备用网络的质量更差,即使主用网络当前比较差,也没有切换的必要。则无需存储备用网络的网络路径。若质量更好的网络路径不为预先存储的主用网络路径,则表示备用网络的质量更好,则需要存储备用网络的网络路径,以备当前使用主用网络的数据流的传输质量更差的情况下,切换到备用网络上。
步骤F1的比较结果为主卡的质量更好的情况下,存储主卡的网络路径作为备用网络。
作为另一示例,在步骤B26之后,通道级路径管理组件可以请求定期监测主卡网络的网络质量,并定期发送给流级路径管理组件。
当然,实际应用中,可以定期监测主用网络以外的其他网络的网络质量,若网络质量最优的不再是当前存储的备用网络,则可以更换备用网络为当前的主用网络和当前的备用网络以外的其他质量更优的网络。若一个网络被作为备用网络唤醒,而后不再是备用网络也不是主用网络,则可以将该网络由唤醒状态再切换为休眠状态,以避免电子设备的功耗过大。
如前,流量上报组件在持续监控数据流,并持续上报监控到的数据流。
步骤B29,流量上报组件持续向流量感知组件上报监控到的数据流。
步骤B30,流量感知组件已经确定了各个数据流的网络质量评估算法(算法B),并持续采用算法B得到评估结果。
步骤B31,流量感知组件持续将该评估结果发送给流级策略管理组件。
步骤B32,流级策略管理组件基于该评估结果,确定需要切换到备用网络。
作为示例,在满足上述示例中的条件1的情况下,确定切换到备用网络。
步骤B33,流级策略管理组件在确定切换到备用网络之后,向流级路径管理组件发送指令,用于表示切换到备用网络。
步骤B34,流级路径管理组件接收到切换备用网络的指令后,查看存储有备用网络的路径(主卡网络的路径),则向流级策略管理组件发送切换到主卡网络的指令。
需要说明,流级策略管理组件存储有传输质量提升策略,因此,流级策略管理组件可以确定切换单条流,还是部分流还是全部流。在实际应用中,步骤B33中可以携带待切换的数据流的标识,同时,B34传输的指令中,也可以携带待切换的数据流的标识。两个步骤发送的指令中也可以不携带待切换的数据流的标识。
步骤B35,流级策略管理组件向策略执行组件发送指令,该指令携带数据流标识和主卡网络路径,其中,数据流标识为评估结果满足条件1的数据流标识,或者评估结果满足条件1的数据流以及相关的数据流标识,或者评估结果满足条件1的数据流所在的应用A的全部数据流标识。
步骤B36,策略执行组件执行将接收到的指令中携带的数据流标识表示的数据流切换到指令中携带的网络路径表示的主卡网络。
本申请实施例中,网络路径也可以为区分不同网络的网络标识。
作为本申请另一实施例,在实际应用中,网络质量可能并不是逐渐变差的,也可能是突发性变差。例如,步骤B14流级策略管理组件接收到的评估结果确定为切换备用网络,则步骤B15,流级策略管理组件向流级路径管理组件发送切换备用路径。然而,此时流级路径管理组件还未存储备用网络的路径。这种情况下,就需要先确定备用网络(步骤B16至步骤B27),然后在确定备用网络的情况下,直接执行步骤B34,以将数据流切换到备用网络。
当然,在步骤B14流级策略管理组件接收到的评估结果确定为切换备用网络,此时流级路径管理组件接收到切换备用路径且已经存储备用网络的路径的情况下,则可以不再执行步骤B16至步骤F1,而是直接执行步骤B34,以将数据流切换到备用网络。
作为示例,应用A当前存在数据流C和数据流D,在一个周期,电子设备根据数据流C的传输质量评估结果(可能卡顿)请求备用路径并存储,数据流D的传输质量评估结果优。下一个周期,数据流C的传输质量评估结果为优,数据流D的传输质量评估结果确定切换备用路径。此时,电子设备已经存储了备用路径,则电子设备可以将数据流切换到备用网络上。
上述示例中,均以数据流的特征作为确定并唤醒备用网络的条件,实际应用中,还可以采用其他方式作为确定并唤醒备用网络的条件。即表2中还可以增加一列:确定并唤醒备用网络的条件。不同应用(或同一应用的不同业务场景)在前台运行时,确定并唤醒备用网络的条件可以相同也可以不同,也可以部分相同部分不同。
作为示例,针对每个应用的不同业务场景,可以设置与该应用该业务场景的数据流的流量特征相关的条件作为确定并唤醒备用网络的条件;针对所有应用的所有业务场景,可以设置相同的条件:信号强度逐渐变小等。该示例仅用于举例,并不造成任何限定。
作为本申请另一实施例,在图8所示实施例中,若应用A的全部流或部分流被切换到主卡上,在应用A从前台切换到后台后,应用A的全部数据流会回到系统默认的主用网络:例如主Wi-Fi。主用网络的确定方式可以参照上述实施例中的描述。应用A再次从后台切换到前台后,应用的全部数据流仍然在主用网络:主Wi-Fi,则继续实施本申请实施例提供的网络加速方法。
作为本申请另一实施例,在具体实现时,还可以采用其他方式获取应用A当前使用的主用网络的路径,并在确定应用A当前使用的主用网络的路径的情况下监测当前使用的主用网络的网络质量。
参见图9,为本申请实施例提供的另一网络加速方法的时序图。
流量上报组件在监听数据流时,可以确定承载该数据流的网络。由于预先设置了应用A再次从后台切换到前台后,应用的全部数据流仍然按照系统默认的方式确定当前使用的网络通道。所以,应用A再次从后台切换到前台或者应用A开启后,流量上报组件监听到的数据流所在的网络通道就为应用A的主用网络。因为,可以通过流量上报组件上报的数据流确定主用网络的路径。
在步骤B10之后,即在流量感知组件接收到上报的数据流后,可以执行步骤G1至步骤G6以存储主用网络的路径和质量监测结果。
步骤G1,流量感知组件根据上报的数据流确定承载该数据流的网络通道。
步骤G2,在确定网络通道(为主Wi-Fi)的情况下,流量感知组件向通道级路径管理组件发送用于表示主用网络为主Wi-Fi的消息。
步骤G3,通道级路径管理组件向通道及应用质量评估组件发送主Wi-Fi的质量探测请求。
步骤G4,通道及应用质量评估组件采用算法A定期监测主Wi-Fi的质量。
步骤G5,通道及应用质量评估组件向通道级路径管理组件返回主Wi-Fi的质量监测结果。
步骤G6,通道级路径管理组件将主Wi-Fi的路径和质量监测结果发送给流级路径管理组件。
步骤G7,流级路径管理组件存储主Wi-Fi的路径为主用路径,并存储主Wi-Fi的质量监测结果。
由于步骤G4中为定期监测主用网络(主Wi-Fi)的质量,因此,流级路径管理组件会定期接收到主用网络(主Wi-Fi)的质量。在电子设备执行步骤G1至步骤G7的过程中,电子设备也可以执行步骤B11和步骤B13。即不限定步骤G1和步骤B11的执行顺序。
若在流级策略管理组件执行B14时,根据数据流特征和评估结果确定需要请求备用网络,则继续执行后续步骤(步骤B15至步骤B36),后续步骤可参照图8所示实施例的描述,在此不再赘述。
如前,确定主用网络的路径的情况下,在请求备用路径时,可以请求主用网络以外的其他网络。在定期监测主用网络的质量的情况下,在确定了备用网络后,可以将备用网络和主用网络进行比较,以在备用网络比主用网络的质量更优的情况下,将传输质量差的数据流切换到备用网络。当然,实际应用中,也可以在确定质量最好的备用网络的情况下,直接将传输质量差的数据流切换到备用网络。
参见图10,为本申请实施例提供的另一网络加速方法。
在步骤B4之后,执行步骤B8和步骤B9。
其中,流量上报组件在接收到步骤B9流量感知组件发送流量监控请求后被触发执行步骤H1,注册报文监听钩子。
在注册报文监听钩子后,该报文监听钩子可以监听应用A的数据流。在监听到应用A的数据流之后开始执行后续步骤。
需要说明,由于数据流中可以得到承载该数据流的网络通道,因此,流量感知组件可以确定应用A当前使用的网络通道,并可以将当前使用的网络通道的标识(主用网络)通过步骤B13发送到流级策略管理组件。
步骤B14,流级策略管理组件在根据数据流特征和评估结果确定请求备用网络。
步骤B15,流级策略管理组件将备用路径的请求信息发送到流级路径管理组件时,可以携带主用网络的标识(或主用网络的路径)。
步骤B16,流级路径管理组件向通道级路径管理组件发送备用路径的请求信息,也可以携带主用网络的标识(或主用网络的路径)。
通道级路径管理组件接收到流级路径管理组件发送的携带主用网络的标识的请求 信息后,可以依次请求电子设备支持的网络通道中除该主用网络以外的其他网络通道的状态,并在状态可用时,请求监测可用的网络通道的质量监测结果,最后将可用且质量最优的网络通道唤醒,并作为备用网络发送到流级路径管理组件。具体可参照步骤B17至步骤B27的描述。可参照上述实施例中的描述,在此不再赘述。
步骤28,流级路径管理组件在确定未存储主用网络的情况下,无需比较接收到的备用网络的质量和主用网络的质量,而是直接将接收到的网络通道作为备用路径存储。
后续步骤B29至步骤B36的描述具体可参照上述实施例中的描述。
作为本申请另一实施例,如表2所示,传输质量提升策略中还包括:并发。本申请实施例中,将上传下载类(存储类)应用进行大文件下载时,首先将数据流分到电子设备多个可用的网络通道上。在分到多个网络通道上后,若任一数据流满足网络质量评估算法规定的切换条件(例如,传输速率较慢)时,将满足网络质量评估算法规定的切换条件的数据流切换到其他质量更优的网络通道上。具体可参照图11所示实施例的描述。
步骤B11之前的步骤的描述可参照上述实施例中的描述,在此不再赘述。
步骤B11,流量感知组件在根据数据流特征确定需要将数据流分配到多个网络通道。
例如,表2中,在某上传下载类应用进行大文件下载时,需要将满足某特征的数据流分到多个网络通道上。
步骤J1,流量感知组件向通道级路径管理组件发送请求所有备用网络的信息。
步骤B17,通道级路径管理组件接收到所有备用路径的请求信息之后,开始对电子设备支持的网络通道中除主用网络以外的其他网络执行步骤B17至步骤B26的步骤。
需要说明的是,本申请实施例中,需要将主用网络以外的其他所有可用的网络通道唤醒。因此,在步骤B21之后,直接执行步骤B24请求唤醒当前可用的网络通道。按照上述过程将主用网络之外的每个可用的网络通道唤醒。
步骤B27,通道级路径管理组件将唤醒的每个备用网络的路径和质量监测结果(可以采用质量参数表示)发送到流级路径管理组件。
步骤B28,流级路径管理组件将每个备用网络的路径和质量参数存储。
需要说明,在电子设备执行步骤J1、B17至步骤B28的过程中,流量上报组件一直在上报数据流,同时流量感知组件一直向流级路径管理组件传输当前监听的数据流的标识。
步骤K3,在流级路径管理组件接收到主用网络的路径、备用网络的路径以及多个数据流的标识之后,将多个数据流分配到多个网络通道(主用网络和备用网络)上。
作为示例,若流级路径管理组件接收到1个主用网络的路径和3个备用网络的路径,接收到的数据流标识的个数为5个,则可以将5个数据流标识分到4个网络通道上。
在分配时,可以首先基于数据流个数和网络通道的个数均分的原则,在无法均分的情况下,分配给每个网络通道的数据流个数之间相差小于2。即步骤K3中的分配尽量以均分的原则将多个数据流分配到多个网络通道上。
当然,实际应用中,也可以采用其他分配的原则,例如,根据各个网络通道的质 量,将多个数据流分配到多个网络通道上,以使得质量更优的网络通道承载个数更多的数据流,质量较差的网络通道承载个数更少的数据流。其他分配的原则不再一一举例。
当然,也可以在该应用在前台运行时首次分配采用个数均分的原则,在首次之后的下一次分配(例如,可以设定分配周期)采用其他原则。
需要说明,步骤K3可以在流级策略管理组件中执行也可以在流级路径管理组件中执行。
若在流级路径管理组件中执行,则需要流级策略管理组件将数据流标识发送到流级路径管理组件。
若在流级策略管理组件中执行,则需要流级路径管理组件将多个网络路径发送到流级策略管理组件,并取消步骤K2。
步骤K4,流级路径管理组件将每个数据流标识对应的网络通道的路径发送给流级策略管理组件。
步骤K5,流级策略管理组件将接收到每个数据流标识对应的网络通道的路径发送给策略管理组件。
步骤K6,策略管理组件根据接收到的每个数据流标识和对应的网络通道的路径之后,将数据流标识对应的数据流切换到对应的网络通道上。
如前,报文监测钩子一直在监测数据流,同时也一直在上报监测到的数据流,参见步骤B29。
在将多个数据流从主网络通道分配到多个网络通道之后,报文监测钩子监测到的数据流承载各自对应的网络通道上。因此,流量感知组件接收到流量上报组件上报的数据流之后,可以根据监测到的数据流确定已经将多个数据流分配到多个网络通道上。
步骤K7,流量感知组件确定多个数据流已经分配到多个网络通道上后,可以采用各个数据流的特征得到与各个数据流对应的评估算法C。
步骤B30,流量感知组件根据确定各个数据流的评估算法C得到各个数据流的传输质量评估结果。
步骤B31至步骤B36可以参照上述实施例的描述,在此不再赘述。
本申请实施例中,在某个数据流的评估结果满足设置的评估算法规定的切换的条件下,需要将该数据流切换到其他质量更优的网络通道上。
如前,在确定并发的情况下,可以定期监测每个网络通道的网络质量,并将网络质量发送到流级路径管理组件。
步骤K8,流级路径管理组件根据定期接收到的各个网络通道的质量,将该数据流(不满足算法C设置的条件的数据流)切换到质量最优(例如,传输速率最快)的网络通道上。
该示例以不满足算法C设置的条件的数据流切换到质量更有的网络通道上。实际应用中,还可以设置其他切换方式。作为示例,切换到当前承载数据流的个数最少的网络通道上。或者,在用户的某个数据业务为不限流量套餐的情况下,将当前在Wi-Fi网络上的不满足算法C设置的条件的数据流优先切换到该不限流量套餐的数据业务网络上。当然,在用户的数据业务均为限流量套餐的情况下,将当前在一个Wi-Fi网络 上的不满足算法C设置的条件的数据流优先切换到另一个Wi-Fi网络上。
上述切换方式仅用于举例,实际应用中,可以根据实际情况设置切换方式,原则为:尽量不产生额外流量费用的前提下,最快传输当前应用下符合特定特征的数据流。
作为本申请另一实施例,参见图12,为本申请实施例提供的另一网络加速方法。
与图11所示的区别包括:
(1)触发流量上报组件注册报文监听钩子的方式不同,图11通过流级路径管理组件触发,图12通过流量感知组件触发。
(2)不再单独请求主用网络的路径,而是在流量感知组件根据数据流的特征确定需要先将当前的数据流分配到多个网络通道上的情况下,执行步骤J1,请求所有网络路径。
然后通过步骤B17至步骤B26将电子设备可用的网络通道唤醒,并将唤醒后的每个网络通道的路径和质量监测结果发送给流级路径管理组件。流级路径管理组件将数据流分配到多个网络通道上。步骤B28至步骤B36可以参照图11所示实施例的描述,在此不再赘述。图12中的网络C为电子设备支持的任一网络通道。
上述实施例中,均以流量上报组件中的报文监测钩子监听应用A的数据流为例进行说明,下面将描述报文监测钩子如何监听应用A的数据流,并将监听的数据流发送到给流量感知组件。
如前,电子设备的系统中存在Netfilter组件,通过该组件可以获取到特定应用标识对应的应用的数据流。流量上报组件可以通过调用Netfilter组件获取应用A的数据流的报文。具体实现时,流量上报组件上报给流量感知组件的信息不仅包括应用A的数据流的报文,还包括应用A的数据流的报文的一些统计信息。具体可参照图13所示实施例的描述。
参见图13,流量上报组件可以预先注册报文监听钩子(例如,nf_hook钩子函数)。
在流量上报组件调用Netfilter组件后,Netfilter组件上报应用A的数据流的报文,流量上报组件接收到Netfilter组件上报的数据流的报文之后,调用预先注册的nf_hook钩子函数。
该nf_hook钩子函数对接收到的数据流的报文进行以下操作:报文解析、查流表和报文分析等操作。
在进行解析时,可以查看该报文是否存在应用标识以及该报文的四元组(或五元组),以得到解析结果。若存在应用标识,则可以确定该报文对应的应用。四元组中包括源IP、目的IP、源端口、目的端口;五元组中包括:源IP、目的IP、源端口、目的端口以及协议号。即通过报文的四元组或五元组携带了上述表2中数据流的部分特征。另外,报文(数据包)中本身也携带了头部特征。
在进行解析之后,根据解析结果查询流表,并更新流表的统计信息。流表中存储了各个应用中数据流的标识信息、以及各个数据流的统计信息。各个流的统计信息包括:接收到该数据流的报文数量、总字节数、错误包数量等。
实际应用中,各个流的统计信息可以根据网络质量评估算法中设置的参数确定。因此,各个流的统计信息还可以包括其他信息,例如,根据时间点接收到的数据包的大小生成的该数据包所在的数据流随时间变化的流量分布信息。
当然,若流表中不存在某个数据流的标识信息或相关统计信息时,则可以在流表中增加该数据流的标识以及相关的统计信息。
在查流表并更新流表信息之后,则可以对报文进行分析。例如,过滤报文,从而得到全部或部分报文。
作为一种示例,该过滤过程可以是过滤某个数据流的心跳包报文。则经过过滤处理后,得到该数据流的心跳包报文。该过滤处理过程可以是:通过预先设置某些特征,将满足该特征的报文保留。即满足预先设置的某些特征的报文就为过滤后的报文。
其中,心跳包报文为按照一定的时间间隔存在于数据流中的报文。心跳包报文在固定位置(例如第6个字节)存在固定特征(例如0x64或0x65)。由于该心跳包报文为按照一定时间存在的报文,因为,可以基于该心跳包报文计算获得时延(例如,手机向服务器发送心跳请求报文开始,到手机接收到服务器反馈的心跳响应报文为止,总共经历的时间)。该时延信息用于确定该数据流是否满足上述表2中设置的提升传输质量的条件。
上述示例以过滤心跳包为例进行说明,实际应用中,还可以过滤处理以获得满足其它特征的数据包报文。
作为另一示例,过滤条件还可以包括:选择保留特定长度的数据包报文。在具体实现时,确定数据包报文的长度是否为预先设置的特定长度,若是,则保留该报文,若否,则将该报文过滤掉。
经过上述处理后,得到的过滤后的部分报文被存储在SKB队列中。
SKB队列中存储的数据流的报文上报时的策略包括:立即上报和定期上报。
若为立即上报,流量上报组件中的特定线程及时查看队列,将队列中的报文及时上报给流量感知组件。
若为定期上报,流量上报组件中设置了定时器,基于该定时器设置的时间以一定的周期查看SKB队列中的报文,将队列中的部分或全部报文上报给流量感知组件。
当然,实际应用中,SKB队列中存储的数据流的报文有些是需要立即上报的,有些是需要定期上报的。同样的原理,流量上报组件中的特定线程及时查看队列,将队列中的需要立即上报的报文及时上报给流量感知组件。流量上报组件中还设置了定时器,基于该定时器设置的时间以一定的周期查看SKB队列中的报文,将队列中的需要定期上报的报文上报给流量感知组件。
需要说明,上报报文时,还可以一定上报该报文相关的统计信息。
基于上述理解,流量上报组件并不是将Netfilter组件发送的所有报文均上报给流量感知组件。而是,将满足特定特征的报文(可以携带该满足特定特征的报文的统计信息)上报给流量感知组件。同时将上报与满足特征的报文相关的统计信息。
作为示例,若报文1和报文2均属于同一数据流的报文。接收到报文1后查流表时,根据报文1更新流表中关于该数据流的统计信息,然而,报文1不满足特定特征,所以报文1被过滤掉,不会上报给流量感知组件。接收到报文2后查流表时,根据报文2更新流表中关于该数据流的统计信息,报文2满足特定特征,所以报文2不会被过滤掉,报文2会被上报给流量感知组件。即虽然上报了部分报文,然而,统计信息是基于该数据流下的所有报文得到的。
上述示例中的上报的报文以及相关的统计信息用于流量感知组件确定该报文表示的数据流的特征以及该数据流的传输质量。在描述流量上报组件如何上报数据流的报文给流量感知组件之后,下面将描述如何基于流量上报组件上报给流量感知组件的数据流报文确定表2中设定数据流的特征条件、网络质量评估算法设置的提升传输质量的条件。
作为示例,相同四元组(源地址,源端口,目的地址,目的端口)的报文(数据包)同属一条数据流。若通过网络通道传输了多个具有相同四元组的报文,则多个具有相同四元组的报文同属于一个数据流,也可以理解为:一个数据流中可以存在多个报文。同时,一个数据流下的报文携带该报文在数据流中的序列号。由于这些报文具有相同的特征,可以根据该相同的特征生成该报文所属的数据流的标识,作为示例,可以根据报文的四元组生成该报文所属的数据流的标识。
流量上报组件接收到报文之后,可以根据报文携带的应用标识确定该报文所属的应用。还可以根据该报文的四元组生成该报文所属的数据流的标识。
当然,流量上传组件将报文上传到流量感知组件之后,流量感知组件也可以基于接收到的报文确定所属的应用的标识和所属的数据流的标识。流量上报组件可以根据报文的五元组中的协议号确定数据流特征中的协议,通过四元组或五元组中的目的端口可以确定数据流特征中的端口。通过报文的头部特征可以确定数据流特征中的报文特征。即,基于流量上报组件上报的报文可以确定该报文所在的数据流的特征。
当然,上述数据流的特征的确定方式仅用于举例,实际应用中,还可以通过其他方式确定报文所在的数据流的特征。
在电子设备能够确定接收到的报文所属的数据流的特征之后,就可以基于该数据流的特征确定对应的网络质量评估算法设置的提升传输质量的条件。
当然,实际应用中,为了确保得到的网络质量评估算法设置的提升传输质量的条件准确,还可以增加限定条件:应用的标识,即根据应用的标识和数据流的特征共同确定对应的网络质量评估算法设置的提升传输质量的条件。
在确定了网络质量评估算法设置的提升传输质量的条件之后,该网络质量评估算法设置的提升传输质量的条件仅用于评估具有相同数据流特征(也可以增加相同应用标识和/或相同数据流标识)的数据流的传输质量。
在评估传输质量时,可以采用如下参数中的一个或多个:时延、丢包率、是否存在响应和速率。
如前,可以通过某个数据流下的心跳包确定时延。由于报文中携带了该报文在数据流中的序列号,因此,可以根据该序列号确定丢包情况。通过上述示例中的统计信息中报文总数确定是否下行无响应,作为示例,连续两个周期内接收到的报文总数相同,则确定下行无响应。通过上述示例中的统计信息中的总字节数确定传输速率,作为示例,上一周期和本周期接收到的总字节数的差值与周期的比值为本周期下行速率。
当然,上述参数的确定方式仅用于举例,在实际应用中,还可以通过其他方式确定上述参数。
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何 限定。
本申请实施例还提供了一种计算机可读存储介质,计算机可读存储介质存储有计算机程序,计算机程序被处理器执行时可实现上述各个方法实施例中的步骤。
本申请实施例还提供了一种计算机程序产品,当计算机程序产品在第一设备上运行时,使得第一设备可实现上述各个方法实施例中的步骤。
集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,可以通过计算机程序来指令相关的硬件来完成,的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,计算机程序包括计算机程序代码,计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。计算机可读介质至少可以包括:能够将计算机程序代码携带到第一设备的任何实体或装置、记录介质、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质。例如U盘、移动硬盘、磁碟或者光盘等。在某些司法管辖区,根据立法和专利实践,计算机可读介质不可以是电载波信号和电信信号。
本申请实施例还提供了一种芯片系统,芯片系统包括处理器,处理器与存储器耦合,处理器执行存储器中存储的计算机程序,以实现本申请任一方法实施例的步骤。芯片系统可以为单个芯片,或者多个芯片组成的芯片模组。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及方法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。

Claims (17)

  1. 一种网络加速方法,其特征在于,包括:
    电子设备运行第一应用,所述电子设备通过第一网卡传输所述第一应用的第一数据流和第二数据流,所述第一网卡为无线局域网网卡,所述第一网卡用于连接无线路由器;
    当所述第一数据流的流质量参数满足第一条件,且所述第二数据流的流质量参数满足所述第一条件且不满足第二条件,所述电子设备通过第二网卡传输所述第一数据流,通过所述第一网卡传输所述第二数据流,所述流质量参数包括以下至少一项参数:时延、速率、丢包率、重传率和报文响应是否超时;
    当所述第一数据流的流质量参数和所述第二数据流的流质量参数均满足第二条件,所述电子设备通过所述第二网卡传输所述第一数据流和所述第二数据流,所述流质量参数的第一条件优于所述流质量参数的第二条件。
  2. 如权利要求1所述的方法,其特征在于,所述第一数据流为具有第一特征的数据报文组成的数据流,所述第二数据流为具有第二特征的数据报文组成的数据流,所述第一特征和所述第二特征中的以下至少一项参数不同:所述数据报文的传输协议、传输端口和头部特征。
  3. 如权利要求2所述的方法,其特征在于,在所述电子设备通过第一网卡传输所述第一应用的第一数据流和第二数据流的过程中,所述方法包括:
    所述电子设备获取所述第一特征对应的所述第一条件和所述第二特征对应的所述第二条件;
    所述电子设备判断所述第一数据流的流质量参数是否满足所述第一条件,判断所述第二数据流的流质量参数是否满足所述第二条件。
  4. 如权利要求1至3任一项所述的方法,其特征在于,所述方法还包括:
    当所述第一数据流的流质量参数不满足所述第一条件,所述电子设备通过所述第一网卡传输所述第一数据流;
    当所述第一数据流的流质量参数满足所述第一条件,所述电子设备通过所述第二网卡传输所述第一数据流;
    当所述第二数据流的流质量参数不满足所述第二条件,所述电子设备通过所述第一网卡传输所述第二数据流;
    当所述第二数据流的流质量参数满足所述第二条件,所述电子设备通过所述第二网卡传输所述第二数据流。
  5. 如权利要求4所述的方法,其特征在于,在所述第一数据流的流质量参数满足所述第二条件时,所述第一数据流的流质量参数满足所述第一条件。
  6. 如权利要求1至5任一项所述的方法,其特征在于,所述电子设备通过第二网卡传输所述第一数据流包括:
    所述电子设备查看所述电子设备是否存储有备用网络;
    在所述电子设备存储有所述备用网络的情况下,所述电子设备通过所述备用网络传输所述第一数据流,其中,所述备用网络包括所述第二网卡对应的第二网络。
  7. 如权利要求6所述的方法,其特征在于,所述方法还包括:
    在所述电子设备未存储有所述备用网络的情况下,所述电子设备获取所述电子设备的第三网卡对应的网络的网络质量参数,所述第三网卡为所述电子设备中除所述第一网卡以外的其他网卡,所述网络质量参数包括以下至少一项:带宽、时延和空口速率;
    在所述第二网卡为所述第三网卡中网络质量最优的网卡的情况下,所述电子设备将所述第二网卡对应的所述第二网络作为所述备用网络存储,所述网络质量由所述网络质量参数确定。
  8. 如权利要求7所述的方法,其特征在于,所述电子设备将所述第二网卡对应的所述第二网络作为所述备用网络存储之前,所述方法还包括:
    所述电子设备唤醒所述第二网卡对应的所述第二网络。
  9. 如权利要求7所述的方法,其特征在于,所述电子设备将所述第二网卡对应的所述第二网络作为所述备用网络存储之前,所述方法还包括:
    所述电子设备获取所述第一网卡对应的第一网络的网络质量参数;
    相应的,所述电子设备将所述第二网卡对应的所述第二网络作为所述备用网络存储包括:
    在所述第二网卡对应的所述第二网络的网络质量优于所述第一网卡对应的所述第一网络的网络质量的情况下,所述电子设备将所述第二网卡对应的所述第二网络作为所述备用网络存储。
  10. 如权利要求9所述的方法,其特征在于,所述电子设备运行第一应用包括:
    所述电子设备在前台运行所述第一应用;
    相应的,所述方法还包括:
    所述电子设备检测到所述第一应用在前台运行后,所述电子设备按照所述电子设备的网卡的优先级顺序依次执行主用网络确定步骤,直到得到所述电子设备的主用网络;
    其中,所述主用网络确定步骤包括:
    所述电子设备获取第四网卡对应的网络的网络状态,所述第四网卡为所述电子设备的一个网卡;
    在所述第四网卡的网络状态为可用的情况下,所述电子设备获取所述第四网卡的网络质量参数;在所述第四网卡的网络状态为不可用的情况下,结束本轮主用网络确定步骤;
    在所述第四网卡的网络质量参数在预设范围内的情况下,将所述第四网卡作为所述电子设备的主用网络存储;在所述第四网卡的网络质量参数不在所述预设范围内的情况下,结束本轮所述主用网络确定步骤。
  11. 如权利要求10所述的方法,其特征在于,所述电子设备获取所述第一网卡对应的第一网络的网络质量参数包括:
    在得到所述电子设备的主用网络之后,所述电子设备以第一周期监测所述主用网络的网络质量参数。
  12. 如权利要求9所述的方法,其特征在于,所述电子设备获取所述第一网卡对应的第一网络的网络质量参数包括:
    所述电子设备获取传输所述第一数据流和所述第二数据流的网络,所述传输所述第一数据流和所述第二数据流的网络为所述第一网卡对应的所述第一网络;
    所述电子设备以第一周期监测所述第一网络的网络质量参数。
  13. 如权利要求1至12任一项所述的方法,其特征在于,所述方法还包括:
    所述电子设备运行第二应用,所述电子设备通过所述第一网卡传输所述第二应用的数据流;
    当所述第二应用的数据流包括第三数据流,所述电子设备通过所述第一网卡传输第一子数据流,通过所述第二网卡传输第二子数据流,所述第三数据流为具有第三特征的数据流,所述第一子数据流和所述第二子数据流属于所述第三数据流。
  14. 如权利要求13所述的方法,其特征在于,当所述第二应用的数据流包括第三数据流,所述方法还包括:
    所述电子设备获取所述第三特征对应的第三条件;
    在所述电子设备通过所述第一网卡传输第一子数据流的过程中,所述方法还包括:
    当所述第一子数据流满足所述第三条件、且所述第二子数据流不满足所述第三条件,所述电子设备通过所述第二网卡传输所述第一子数据流和所述第二子数据流;
    在所述电子设备通过所述第二网卡传输第二子数据流的过程中,所述方法还包括:
    当所述第一子数据流不满足所述第三条件,且所述第二子数据流满足所述第三条件,所述电子设备通过所述第一网卡传输所述第一子数据流和所述第二子数据流。
  15. 一种电子设备,其特征在于,所述电子设备包括处理器,所述处理器用于运行存储器中存储的计算机程序,以使得所述电子设备实现如权利要求1至14任一项所述的方法。
  16. 一种芯片系统,其特征在于,包括处理器,所述处理器与存储器耦合,所述处理器执行存储器中存储的计算机程序,以实现如权利要求1至14任一项所述的方法。
  17. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储计算机程序,所述计算机程序在处理器上运行时实现如权利要求1至14任一项所述的方法。
PCT/CN2022/117085 2021-11-18 2022-09-05 网络加速方法、电子设备、芯片系统及可读存储介质 WO2023087850A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
EP22894390.8A EP4344171A1 (en) 2021-11-18 2022-09-05 Network acceleration method, electronic device, chip system, and readable storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111372930.6A CN116137722A (zh) 2021-11-18 2021-11-18 网络加速方法、电子设备、芯片系统及可读存储介质
CN202111372930.6 2021-11-18

Publications (1)

Publication Number Publication Date
WO2023087850A1 true WO2023087850A1 (zh) 2023-05-25

Family

ID=86332729

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/117085 WO2023087850A1 (zh) 2021-11-18 2022-09-05 网络加速方法、电子设备、芯片系统及可读存储介质

Country Status (3)

Country Link
EP (1) EP4344171A1 (zh)
CN (1) CN116137722A (zh)
WO (1) WO2023087850A1 (zh)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140003358A1 (en) * 2012-07-02 2014-01-02 Brent J. Elliott Application continuity with reroute and reset in a wireless communication network
WO2016119441A1 (zh) * 2015-01-26 2016-08-04 中兴通讯股份有限公司 业务迁移方法及装置
CN107852610A (zh) * 2016-06-29 2018-03-27 北京小米移动软件有限公司 数据传输方法、装置和终端
CN107911844A (zh) * 2013-01-24 2018-04-13 华为技术有限公司 控制分流的方法、ue、网络设备及服务器
CN113795040A (zh) * 2021-06-16 2021-12-14 荣耀终端有限公司 通道切换方法、电子设备及存储介质
CN113890905A (zh) * 2021-06-16 2022-01-04 荣耀终端有限公司 通道切换方法、电子设备及存储介质
CN114286402A (zh) * 2021-06-16 2022-04-05 荣耀终端有限公司 通道切换方法、电子设备及存储介质

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140003358A1 (en) * 2012-07-02 2014-01-02 Brent J. Elliott Application continuity with reroute and reset in a wireless communication network
CN107911844A (zh) * 2013-01-24 2018-04-13 华为技术有限公司 控制分流的方法、ue、网络设备及服务器
WO2016119441A1 (zh) * 2015-01-26 2016-08-04 中兴通讯股份有限公司 业务迁移方法及装置
CN107852610A (zh) * 2016-06-29 2018-03-27 北京小米移动软件有限公司 数据传输方法、装置和终端
CN113795040A (zh) * 2021-06-16 2021-12-14 荣耀终端有限公司 通道切换方法、电子设备及存储介质
CN113890905A (zh) * 2021-06-16 2022-01-04 荣耀终端有限公司 通道切换方法、电子设备及存储介质
CN114286402A (zh) * 2021-06-16 2022-04-05 荣耀终端有限公司 通道切换方法、电子设备及存储介质

Also Published As

Publication number Publication date
CN116137722A (zh) 2023-05-19
EP4344171A1 (en) 2024-03-27

Similar Documents

Publication Publication Date Title
WO2021179263A1 (zh) 直连链路中目的地址选择方法、装置及存储介质
WO2021082829A1 (zh) 蓝牙连接方法及相关装置
EP4135405A1 (en) Channel switching method, and electronic device and storage medium
KR102286208B1 (ko) 컴퓨팅 디바이스들에서의 전력 절약 기술들
WO2022262399A1 (zh) 通道切换方法、电子设备及存储介质
US20230007724A1 (en) Information processing method and apparatus, communication device, and storage medium
US20220216957A1 (en) Method and device for carrier aggregation, communication apparatus, and storage medium
WO2020237446A1 (zh) 监听方法、信令下发方法及装置、通信设备及存储
WO2023087852A1 (zh) 一种网络加速方法、电子设备、芯片系统及存储介质
WO2023087853A1 (zh) 一种网络加速方法、电子设备、芯片系统及存储介质
CN111527767B (zh) 一种网络性能提升的方法及设备
CN113840269B (zh) 一种多媒体数据传输方法、装置、电子设备和存储介质
CN112090065B (zh) 一种网络时延调控方法、设备及计算机可读存储介质
WO2023087850A1 (zh) 网络加速方法、电子设备、芯片系统及可读存储介质
CN116709442A (zh) 一种无线网络切换方法和电子设备
WO2021109148A1 (zh) 信息处理方法及装置、通信设备
US20170286356A1 (en) Enhanced quality of service mechanism for ma usb protocol
US20220191676A1 (en) Message transmission method and terminal
WO2022089136A1 (zh) Rrc连接释放控制方法和装置
WO2021056362A1 (zh) 控制资源集合的处理方法、装置及计算机存储介质
CN116744329A (zh) 一种网络加速方法和电子设备
WO2023245457A1 (zh) 一种信息传输方法、装置、通信设备及存储介质
CN115567505B (zh) 网络加速效果的显示方法、设备和存储介质
WO2024082811A1 (zh) 一种网络加速方法和装置
RU2802678C1 (ru) Способ переключения каналов, электронное устройство и носитель хранения данных

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: 22894390

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 18570606

Country of ref document: US

WWE Wipo information: entry into national phase

Ref document number: 2022894390

Country of ref document: EP

ENP Entry into the national phase

Ref document number: 2022894390

Country of ref document: EP

Effective date: 20231219