CN116456405A - Network switching method and electronic equipment - Google Patents
Network switching method and electronic equipment Download PDFInfo
- Publication number
- CN116456405A CN116456405A CN202210019678.9A CN202210019678A CN116456405A CN 116456405 A CN116456405 A CN 116456405A CN 202210019678 A CN202210019678 A CN 202210019678A CN 116456405 A CN116456405 A CN 116456405A
- Authority
- CN
- China
- Prior art keywords
- evaluation
- index
- network
- current
- threshold
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W36/00—Hand-off or reselection arrangements
- H04W36/0005—Control or signalling for completing the hand-off
- H04W36/0083—Determination of parameters used for hand-off, e.g. generation or modification of neighbour cell lists
- H04W36/0085—Hand-off measurements
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W36/00—Hand-off or reselection arrangements
- H04W36/0005—Control or signalling for completing the hand-off
- H04W36/0083—Determination of parameters used for hand-off, e.g. generation or modification of neighbour cell lists
- H04W36/00837—Determination of triggering parameters for hand-off
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W36/00—Hand-off or reselection arrangements
- H04W36/14—Reselecting a network or an air interface
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W36/00—Hand-off or reselection arrangements
- H04W36/24—Reselection being triggered by specific parameters
- H04W36/30—Reselection being triggered by specific parameters by measured or perceived connection quality data
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
- Y02D30/70—Reducing energy consumption in communication networks in wireless communication networks
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
本申请提供了一种网络切换方法及电子设备置,该方法包括:在电子设备运行目标应用程序的过程中,获取目标数据流,接着确定目标应用程序对应的多个评估指标以及每个评估指标对应的门限,在此基础上对目标数据流中多个评估指标的值进行统计,得到每个评估指标对应的目标值;针对多个评估指标中的每个评估指标,比较每个评估指标对应的目标值与每个评估指标对应的门限,得到第一评估指标的数量;在第一评估指标的数量超过数量阈值的情况下,将电子设备的网络从当前网络切换至备用网络。本申请可根据应用程序对应的多个评估指标确定出网络切换的时机,进而可以提高网络切换的准确性。
The present application provides a network switching method and an electronic device device. The method includes: acquiring the target data stream during the process of running the target application program on the electronic device, and then determining multiple evaluation indicators corresponding to the target application program and each evaluation indicator The corresponding threshold, on this basis, count the values of multiple evaluation indicators in the target data stream to obtain the target value corresponding to each evaluation indicator; for each evaluation indicator in the multiple evaluation indicators, compare the corresponding The target value of , and the threshold corresponding to each evaluation index, obtain the number of the first evaluation index; when the number of the first evaluation index exceeds the number threshold, switch the network of the electronic device from the current network to the standby network. The present application can determine the timing of network switching according to multiple evaluation indicators corresponding to the application program, thereby improving the accuracy of network switching.
Description
技术领域technical field
本申请实施例涉及终端设备领域,尤其涉及一种网络切换方法及电子设备。The embodiments of the present application relate to the field of terminal equipment, and in particular, to a network switching method and electronic equipment.
背景技术Background technique
随着通信技术的发展,目前许多电子设备例如智能手机,可以支持利用Wi-Fi网络进行通信和利用移动蜂窝数据网络进行通信。一般情况下,若用户在接入了Wi-Fi网络的同时也开启了移动蜂窝网络数据网络,则移动终端会默认利用Wi-Fi网络进行通信。并且,在Wi-Fi通信质量不好的情况下,电子设备可以进行网络的切换以提高用户的使用体验。因此,如何提高网络切换的准确性是亟待解决的技术问题。With the development of communication technologies, currently many electronic devices such as smart phones can support communication by using a Wi-Fi network and communication by using a mobile cellular data network. Generally, if the user also turns on the mobile cellular network data network while accessing the Wi-Fi network, the mobile terminal will use the Wi-Fi network for communication by default. Moreover, when the Wi-Fi communication quality is poor, the electronic device can switch networks to improve user experience. Therefore, how to improve the accuracy of network switching is an urgent technical problem to be solved.
发明内容Contents of the invention
为了解决上述技术问题,本申请提供一种网络切换方法及电子设备。在该方法中,电子设备运行不同的应用程序时根据应用程序对应的多个评估指标确定出网络切换的时机,提高网络切换的准确性。In order to solve the above technical problems, the present application provides a network switching method and electronic equipment. In the method, when the electronic device runs different application programs, the timing of network switching is determined according to multiple evaluation indicators corresponding to the application programs, thereby improving the accuracy of network switching.
第一方面,本申请实施例提供一种网络切换方法。该方法包括:在电子设备运行目标应用程序的过程中,获取目标数据流;其中,目标数据流是电子设备与目标服务器进行网络通信产生的数据,目标服务器为提供目标应用程序的服务的设备;电子设备确定目标应用程序对应的多个评估指标以及每个评估指标对应的门限,评估指标用于描述网络通信质量;电子设备对目标数据流中多个评估指标的值进行统计,得到每个评估指标对应的目标值;电子设备针对多个评估指标中的每个评估指标,比较每个评估指标对应的目标值与每个评估指标对应的门限,得到第一评估指标的数量;其中,第一评估指标满足以下条件:评估指标的目标值和评估指标对应的门限满足第一条件;在第一评估指标的数量超过数量阈值的情况下,将电子设备的网络从当前网络切换至备用网络。这样,电子设备可根据应用程序对应的多个评估指标确定出网络切换的时机,从而提高网络切换的准确性。In a first aspect, the embodiment of the present application provides a network switching method. The method includes: acquiring a target data stream during the process of running the target application program on the electronic device; wherein, the target data stream is data generated by network communication between the electronic device and a target server, and the target server is a device providing a service of the target application program; The electronic device determines multiple evaluation indicators corresponding to the target application program and the threshold corresponding to each evaluation indicator, and the evaluation indicators are used to describe the quality of network communication; the electronic device counts the values of multiple evaluation indicators in the target data stream to obtain each evaluation index The target value corresponding to the index; the electronic device compares the target value corresponding to each evaluation index with the threshold corresponding to each evaluation index for each evaluation index in the multiple evaluation indexes, and obtains the number of the first evaluation index; wherein, the first The evaluation index satisfies the following conditions: the target value of the evaluation index and the threshold corresponding to the evaluation index meet the first condition; when the number of the first evaluation index exceeds the number threshold, the network of the electronic device is switched from the current network to the standby network. In this way, the electronic device can determine the timing of network switching according to multiple evaluation indicators corresponding to the application program, thereby improving the accuracy of network switching.
根据第一方面,确定目标应用程序对应的多个评估指标以及每个评估指标对应的门限,包括:确定目标应用程序当前运行的业务场景;获取业务场景对应的多个评估指标以及每个评估指标对应的门限。这样,目标应用程序运行的业务场景不同,则对应的切换时机也不同,可以进一步提高网络切换的准确性。According to the first aspect, determining the multiple evaluation indicators corresponding to the target application program and the threshold corresponding to each evaluation indicator includes: determining the business scenario in which the target application program is currently running; obtaining multiple evaluation indicators corresponding to the business scenario and each evaluation indicator the corresponding threshold. In this way, different service scenarios in which the target application program runs correspond to different handover timings, which can further improve the accuracy of network handover.
示例性的,目标应用程序可以包括直播业务场景和观看视频业务场景。其中,直播业务场景和观看视频业务场景对应的评估指标不相同。Exemplarily, the target application program may include live broadcast business scenarios and video viewing business scenarios. Among them, the evaluation indicators corresponding to the live broadcast business scenario and the video watching business scenario are different.
根据第一方面,或者以上第一方面的任意一种实现方式,针对多个评估指标中的每个评估指标,比较每个评估指标对应的目标值与每个评估指标对应的门限,得到第一评估指标的数量,包括:如果在第一时刻确定多个评估指标中的当前指标超出对应的门限,则获取指定时间段内第一评估指标的数量,指定时间段包括至少一个检测周期;其中,指定时间段的结束时间点为第一时刻,指定时间段的时长为指定时长。这样,电子设备可以更加准确灵活的实现对网络的切换,进而可以提高用户的使用体验。According to the first aspect, or any implementation method of the above first aspect, for each of the multiple evaluation indicators, compare the target value corresponding to each evaluation indicator with the threshold corresponding to each evaluation indicator, and obtain the first The number of evaluation indicators, including: if it is determined at the first moment that the current indicator among the multiple evaluation indicators exceeds the corresponding threshold, then obtain the number of the first evaluation indicators within a specified time period, and the specified time period includes at least one detection cycle; wherein, The end time point of the specified time period is the first moment, and the duration of the specified time period is the specified duration. In this way, the electronic device can implement network switching more accurately and flexibly, thereby improving user experience.
示例性的,指定时长可以为3s,检测周期可以为500ms。Exemplarily, the specified duration may be 3s, and the detection period may be 500ms.
根据第一方面,或者以上第一方面的任意一种实现方式,指定时间段内第一评估指标的数量,是同一检测周期内评估指标的投票标记的数量和,其中,添加投票标记的评估指标为第一评估指标。According to the first aspect, or any implementation method of the above first aspect, the number of the first evaluation indicators in the specified time period is the sum of the number of voting marks of the evaluation indicators in the same detection cycle, wherein the evaluation indicators with voting marks added as the first evaluation index.
根据第一方面,或者以上第一方面的任意一种实现方式,针对多个评估指标中的每个评估指标,比较每个评估指标对应的目标值与每个评估指标对应的门限,得到第一评估指标的数量,包括:从多个评估指标中选择一个评估指标作为当前指标;执行当前指标判断操作,当前指标判断操作用于判断当前指标的目标值和当前指标对应的门限是否符合第一条件;若符合第一条件,则为当前指标添加投票标记;统计多个评估指标中投票标记的数量,并将该数量作为第一评估指标的数量;若第一评估指标的数量未超出数量阈值,则从多个评估指标中选择下一个评估指标作为当前指标,再次执行当前指标判断操作,直至完成对多个评估指标的判断操作。这样,电子设备可以对目标应用程序的多个评估指标进行持续监测,以保证网络质量为卡顿时能够得到及时的切换。According to the first aspect, or any implementation method of the above first aspect, for each of the multiple evaluation indicators, compare the target value corresponding to each evaluation indicator with the threshold corresponding to each evaluation indicator, and obtain the first The number of evaluation indicators, including: selecting an evaluation indicator from multiple evaluation indicators as the current indicator; executing the current indicator judgment operation, which is used to judge whether the target value of the current indicator and the threshold corresponding to the current indicator meet the first condition ; If the first condition is met, add a voting mark for the current indicator; count the number of voting marks in multiple evaluation indicators, and use this number as the number of the first evaluation indicator; if the number of the first evaluation indicator does not exceed the number threshold, Then select the next evaluation index from the multiple evaluation indexes as the current index, and execute the judgment operation of the current index again until the judgment operation on the multiple evaluation indexes is completed. In this way, the electronic device can continuously monitor multiple evaluation indicators of the target application program, so as to ensure timely switching when the network quality is stuck.
示例性的,数量阈值可以为2票,多个评估指标可以为4个。Exemplarily, the quantity threshold may be 2 votes, and the multiple evaluation indicators may be 4.
根据第一方面,或者以上第一方面的任意一种实现方式,在完成对多个评估指标的判断操作的情况下,获取下一个检测周期的数据流,并将下一个检测周期的数据流作为目标数据流,利用目标数据流中的多个评估指标的值再次获取第一评估指标的数量,以及确定第一评估指标的数量是否超过数量阈值。这样,电子设备可以结合不同周期获取的评估指标的值综合确定是否执行网络切换操作。According to the first aspect, or any implementation of the above first aspect, in the case of completing the judgment operation on multiple evaluation indicators, the data flow of the next detection cycle is obtained, and the data flow of the next detection cycle is used as The target data stream, using the values of the multiple evaluation indicators in the target data stream to obtain the quantity of the first evaluation indicator again, and determine whether the quantity of the first evaluation indicator exceeds the quantity threshold. In this way, the electronic device can comprehensively determine whether to perform the network switching operation in combination with the values of the evaluation indicators acquired in different periods.
根据第一方面,或者以上第一方面的任意一种实现方式,执行当前指标判断操作;若符合第一条件,则为当前指标添加投票标记,包括:若当前指标为预设指标,则获取当前指标对应的第一门限和第二门限;确定当前指标的目标值是否超出第一门限,若超出第一门限,则为当前指标添加投票标记,并确定当前指标的目标值是否超出第二门限;若当前指标的目标值超出第二门限,则再次为当前指标添加投票标记。这样,同一指标的值在严重恶化的情况下可以投出两票,如此也可以触发网络的切换操作。According to the first aspect, or any implementation method of the above first aspect, the current indicator judgment operation is performed; if the first condition is met, a voting mark is added to the current indicator, including: if the current indicator is a preset indicator, then the current indicator is obtained The first threshold and the second threshold corresponding to the indicator; determine whether the target value of the current indicator exceeds the first threshold, if it exceeds the first threshold, add a voting mark for the current indicator, and determine whether the target value of the current indicator exceeds the second threshold; If the target value of the current indicator exceeds the second threshold, a voting mark is added to the current indicator again. In this way, the value of the same indicator can cast two votes in the case of severe deterioration, which can also trigger the switching operation of the network.
示例性的,预设指标可以包括下行速率(TCP+UDP)、WiFi MAC层上行重传率以及TCP上行重传率。Exemplarily, the preset indicators may include downlink rate (TCP+UDP), WiFi MAC layer uplink retransmission rate, and TCP uplink retransmission rate.
根据第一方面,或者以上第一方面的任意一种实现方式,若符合第一条件,则为当前指标添加投票标记之后,包括:记录添加投票标记的当前时间;在当前时间的指定时长后将投票标记清除。这样,电子设备获取的投票标记的数量具有实时性,如此可以避免网络被误切换。According to the first aspect, or any implementation of the first aspect above, if the first condition is met, after adding the voting mark to the current indicator, it includes: recording the current time when the voting mark is added; Voting marks are cleared. In this way, the number of voting tokens obtained by the electronic device is real-time, so that network switching by mistake can be avoided.
根据第一方面,或者以上第一方面的任意一种实现方式,指定时间段内第一评估指标的数量,是至少两个检测周期内评估指标的投票标记的数量和,其中,添加投票标记的评估指标为第一评估指标。According to the first aspect, or any implementation of the above first aspect, the number of the first evaluation indicators in the specified time period is the sum of the number of voting marks of the evaluation indicators in at least two detection cycles, wherein the number of voting marks added The evaluation index is the first evaluation index.
根据第一方面,或者以上第一方面的任意一种实现方式,目标应用程序不同,对应的评估指标不同。According to the first aspect, or any implementation manner of the above first aspect, the target application programs are different, and the corresponding evaluation indicators are different.
示例性的,目标应用程序可以为直播类应用程序或者浏览类应用程序。其中,直播类应用程序和浏览类应用程序对应的评估指标不相同。Exemplarily, the target application program may be a live broadcast application program or a browsing application program. Among them, the evaluation indicators corresponding to the live broadcast application and the browsing application are different.
根据第一方面,或者以上第一方面的任意一种实现方式,不同目标应用程序对应的同一评估指标的门限不同。According to the first aspect, or any implementation manner of the above first aspect, the thresholds of the same evaluation index corresponding to different target applications are different.
示例性的,直播类应用程序或者浏览类应用程序对应的同一评估指标的门限不同。Exemplarily, the thresholds of the same evaluation index corresponding to the live broadcast application program or the browsing application program are different.
根据第一方面,或者以上第一方面的任意一种实现方式,业务场景包括直播业务场景,直播业务场景对应的评估指标至少包括往返传输时间、下行速率、下行重传率和上行重传率。According to the first aspect, or any implementation method of the above first aspect, the service scenario includes a live broadcast service scenario, and the evaluation indicators corresponding to the live broadcast service scenario at least include round-trip transmission time, downlink rate, downlink retransmission rate, and uplink retransmission rate.
示例性的,下行速率可以为下行速率(TCP+UDP),下行重传率可以为TCP下行重传率,上行重传率可以为WiFi MAC层上行重传率。Exemplarily, the downlink rate may be the downlink rate (TCP+UDP), the downlink retransmission rate may be the TCP downlink retransmission rate, and the uplink retransmission rate may be the WiFi MAC layer uplink retransmission rate.
第二方面,本申请实施例提供一种电子设备。该电子设备包括:一个或多个处理器;存储器;以及一个或多个计算机程序,其中一个或多个计算机程序存储在存储器上,当计算机程序被一个或多个处理器执行时,使得电子设备执行以下步骤:在电子设备运行目标应用程序的过程中,获取目标数据流;其中,目标数据流是电子设备与目标服务器进行网络通信产生的数据,目标服务器为提供目标应用程序的服务的设备;确定目标应用程序对应的多个评估指标以及每个评估指标对应的门限,评估指标用于描述网络通信质量;对目标数据流中多个评估指标的值进行统计,得到每个评估指标对应的目标值;针对多个评估指标中的每个评估指标,比较每个评估指标对应的目标值与每个评估指标对应的门限,得到第一评估指标的数量;其中,第一评估指标满足以下条件:评估指标的目标值和评估指标对应的门限满足第一条件;在第一评估指标的数量超过数量阈值的情况下,将电子设备的网络从当前网络切换至备用网络。In a second aspect, the embodiment of the present application provides an electronic device. The electronic device includes: one or more processors; memory; and one or more computer programs, wherein the one or more computer programs are stored on the memory, and when executed by the one or more processors, the electronic device Perform the following steps: during the process of running the target application program on the electronic device, obtain the target data stream; wherein, the target data stream is data generated by the electronic device and the target server through network communication, and the target server is a device that provides the service of the target application program; Determine the multiple evaluation indicators corresponding to the target application and the threshold corresponding to each evaluation indicator. The evaluation indicators are used to describe the quality of network communication; count the values of multiple evaluation indicators in the target data stream to obtain the target corresponding to each evaluation indicator value; for each evaluation index among the multiple evaluation indexes, compare the target value corresponding to each evaluation index with the threshold corresponding to each evaluation index, and obtain the quantity of the first evaluation index; wherein, the first evaluation index satisfies the following conditions: The target value of the evaluation index and the threshold corresponding to the evaluation index meet the first condition; when the number of the first evaluation index exceeds the number threshold, the network of the electronic device is switched from the current network to the standby network.
根据第二方面,当计算机程序被一个或多个处理器执行时,使得电子设备执行以下步骤:确定目标应用程序当前运行的业务场景;获取业务场景对应的多个评估指标以及每个评估指标对应的门限。According to the second aspect, when the computer program is executed by one or more processors, the electronic device is made to perform the following steps: determine the business scenario in which the target application program is currently running; obtain multiple evaluation indicators corresponding to the business scenario and each evaluation indicator corresponds to threshold.
根据第二方面,或者以上第二方面的任意一种实现方式,当计算机程序被一个或多个处理器执行时,使得电子设备执行以下步骤:如果在第一时刻确定多个评估指标中的当前指标超出对应的门限,则获取指定时间段内第一评估指标的数量,指定时间段包括至少一个检测周期;其中,指定时间段的结束时间点为第一时刻,指定时间段的时长为指定时长。According to the second aspect, or any implementation of the above second aspect, when the computer program is executed by one or more processors, the electronic device is made to perform the following steps: If the current If the index exceeds the corresponding threshold, the number of the first evaluation index in the specified time period is obtained, and the specified time period includes at least one detection cycle; where the end time point of the specified time period is the first moment, and the duration of the specified time period is the specified duration .
根据第二方面,或者以上第二方面的任意一种实现方式,指定时间段内第一评估指标的数量,是同一检测周期内评估指标的投票标记的数量和,其中,添加投票标记的评估指标为第一评估指标。According to the second aspect, or any implementation of the above second aspect, the number of the first evaluation indicators in the specified time period is the sum of the number of voting marks of the evaluation indicators in the same detection cycle, wherein the evaluation indicators with voting marks added as the first evaluation index.
根据第二方面,或者以上第二方面的任意一种实现方式,当计算机程序被一个或多个处理器执行时,使得电子设备执行以下步骤:从多个评估指标中选择一个评估指标作为当前指标;执行当前指标判断操作,当前指标判断操作用于判断当前指标的目标值和当前指标对应的门限是否符合第一条件;若符合第一条件,则为当前指标添加投票标记;统计多个评估指标中投票标记的数量,并将该数量作为第一评估指标的数量;若第一评估指标的数量未超出数量阈值,则从多个评估指标中选择下一个评估指标作为当前指标,再次执行当前指标判断操作,直至完成对多个评估指标的判断操作。According to the second aspect, or any implementation manner of the above second aspect, when the computer program is executed by one or more processors, the electronic device is made to perform the following steps: selecting an evaluation index from a plurality of evaluation indexes as the current index ; Execute the current index judgment operation, the current index judgment operation is used to judge whether the target value of the current index and the threshold corresponding to the current index meet the first condition; if the first condition is met, add a voting mark for the current index; count multiple evaluation indicators The number of voting marks in the middle, and use this number as the number of the first evaluation index; if the number of the first evaluation index does not exceed the number threshold, select the next evaluation index from multiple evaluation indicators as the current index, and execute the current index again The judgment operation is performed until the judgment operation on multiple evaluation indicators is completed.
根据第二方面,或者以上第二方面的任意一种实现方式,当计算机程序被一个或多个处理器执行时,使得电子设备执行以下步骤:在完成对多个评估指标的判断操作的情况下,获取下一个检测周期的数据流,并将下一个检测周期的数据流作为目标数据流,利用目标数据流中的多个评估指标的值再次获取第一评估指标的数量,以及确定第一评估指标的数量是否超过数量阈值。According to the second aspect, or any implementation manner of the above second aspect, when the computer program is executed by one or more processors, the electronic device is made to perform the following steps: in the case of completing the judgment operation on multiple evaluation indicators , obtain the data flow of the next detection cycle, and use the data flow of the next detection cycle as the target data flow, use the values of multiple evaluation indicators in the target data flow to obtain the number of the first evaluation indicators again, and determine the first evaluation Whether the number of indicators exceeds the number threshold.
根据第二方面,或者以上第二方面的任意一种实现方式,当计算机程序被一个或多个处理器执行时,使得电子设备执行以下步骤:若当前指标为预设指标,则获取当前指标对应的第一门限和第二门限;确定当前指标的目标值是否超出第一门限,若超出第一门限,则为当前指标添加投票标记,并确定当前指标的目标值是否超出第二门限;若当前指标的目标值超出第二门限,则再次为当前指标添加投票标记。According to the second aspect, or any implementation of the above second aspect, when the computer program is executed by one or more processors, the electronic device is made to perform the following steps: if the current indicator is a preset indicator, obtain the corresponding The first threshold and the second threshold of the current indicator; determine whether the target value of the current indicator exceeds the first threshold, if it exceeds the first threshold, add a voting mark for the current indicator, and determine whether the target value of the current indicator exceeds the second threshold; if the current If the target value of the indicator exceeds the second threshold, a voting mark is added to the current indicator again.
根据第二方面,或者以上第二方面的任意一种实现方式,当计算机程序被一个或多个处理器执行时,使得电子设备执行以下步骤:记录添加投票标记的当前时间;在当前时间的指定时长后将投票标记清除。According to the second aspect, or any implementation of the above second aspect, when the computer program is executed by one or more processors, the electronic device is made to perform the following steps: record the current time when the voting mark is added; specify the voting mark at the current time After a certain amount of time, the vote mark will be cleared.
根据第二方面,或者以上第二方面的任意一种实现方式,指定时间段内第一评估指标的数量,是至少两个检测周期内评估指标的投票标记的数量和,其中,添加投票标记的评估指标为第一评估指标。According to the second aspect, or any implementation of the above second aspect, the number of the first evaluation indicators in the specified time period is the sum of the number of voting marks of the evaluation indicators in at least two detection cycles, wherein the number of voting marks added The evaluation index is the first evaluation index.
根据第二方面,或者以上第二方面的任意一种实现方式,目标应用程序不同,对应的评估指标不同。According to the second aspect, or any implementation manner of the above second aspect, the target application programs are different, and the corresponding evaluation indicators are different.
根据第二方面,或者以上第二方面的任意一种实现方式,不同目标应用程序对应的同一评估指标的门限不同。According to the second aspect, or any implementation manner of the above second aspect, different target application programs have different thresholds for the same evaluation index.
根据第二方面,或者以上第二方面的任意一种实现方式,业务场景包括直播业务场景,直播业务场景对应的评估指标至少包括往返传输时间、下行速率、下行重传率和上行重传率。According to the second aspect, or any implementation method of the above second aspect, the service scenario includes a live broadcast service scenario, and the evaluation indicators corresponding to the live broadcast service scenario at least include round-trip transmission time, downlink rate, downlink retransmission rate, and uplink retransmission rate.
第三方面,本申请实施例提供一种芯片。该芯片包括一个或多个接口电路和一个或多个处理器;接口电路用于从电子设备的存储器接收信号,并向处理器发送信号,信号包括存储器中存储的计算机指令;当处理器执行计算机指令时,使得电子设备执行权利第一方面以及第一方面中任意一项的网络切换方法。In a third aspect, the embodiment of the present application provides a chip. The chip includes one or more interface circuits and one or more processors; the interface circuit is used to receive signals from the memory of the electronic device and send signals to the processor, the signals include computer instructions stored in the memory; when the processor executes the computer Instructing the electronic device to execute the first aspect of the right and the network switching method of any one of the first aspect.
第三方面以及第三方面的任意一种实现方式分别与第一方面以及第一方面的任意一种实现方式相对应。第三方面以及第三方面的任意一种实现方式所对应的技术效果可参见上述第一方面以及第一方面的任意一种实现方式所对应的技术效果,此处不再赘述。The third aspect and any implementation manner of the third aspect correspond to the first aspect and any implementation manner of the first aspect respectively. For the technical effects corresponding to the third aspect and any one of the implementation manners of the third aspect, refer to the above-mentioned first aspect and the technical effects corresponding to any one of the implementation manners of the first aspect, which will not be repeated here.
第四方面,本申请实施例提供一种计算机可读存储介质。该计算机可读存储介质包括计算机程序,其特征在于,当计算机程序在电子设备上运行时,使得电子设备执行第一方面以及第一方面中任意一项网络切换方法。In a fourth aspect, the embodiment of the present application provides a computer-readable storage medium. The computer-readable storage medium includes a computer program, which is characterized in that, when the computer program is run on the electronic device, the electronic device is made to execute the first aspect and any one of the network switching methods in the first aspect.
第四方面以及第四方面的任意一种实现方式分别与第一方面以及第一方面的任意一种实现方式相对应。第四方面以及第四方面的任意一种实现方式所对应的技术效果可参见上述第一方面以及第一方面的任意一种实现方式所对应的技术效果,此处不再赘述。The fourth aspect and any implementation manner of the fourth aspect correspond to the first aspect and any implementation manner of the first aspect respectively. For the technical effects corresponding to the fourth aspect and any one of the implementation manners of the fourth aspect, refer to the above-mentioned first aspect and the technical effects corresponding to any one of the implementation manners of the first aspect, and details are not repeated here.
附图说明Description of drawings
图1为本申请实施例示出的电子设备与云端进行网络连接的示意图;FIG. 1 is a schematic diagram of a network connection between an electronic device and a cloud shown in an embodiment of the present application;
图2为本申请实施例提供的一种应用场景示意图;FIG. 2 is a schematic diagram of an application scenario provided by an embodiment of the present application;
图3为本申请实施例提供的另一应用场景示意图;FIG. 3 is a schematic diagram of another application scenario provided by the embodiment of the present application;
图4为本申请实施例提供的一种网络切换示意图;FIG. 4 is a schematic diagram of network switching provided by an embodiment of the present application;
图5为本申请实施例示出的电子设备的结构示意图;FIG. 5 is a schematic structural diagram of an electronic device shown in an embodiment of the present application;
图6为本申请实施例提供的技术架构图;FIG. 6 is a technical architecture diagram provided by an embodiment of the present application;
图7为本申请实施例提供的一种网络切换的流程示意图;FIG. 7 is a schematic flow diagram of a network handover provided in an embodiment of the present application;
图8为本申请实施例提供的应用程序为虎牙时的指标评估示意图;Figure 8 is a schematic diagram of index evaluation when the application program provided by the embodiment of the present application is Huya;
图9a~9c为本申请实施例提供的电子设备的界面示意图。9a to 9c are schematic diagrams of the interface of the electronic device provided by the embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of them. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of this application.
应当理解,当在本申请说明书和所附权利要求书中使用时,术语“包括”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。It should be understood that when used in this specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and/or components, but does not exclude one or more other Presence or addition of features, wholes, steps, operations, elements, components and/or collections thereof.
还应当理解,在本申请实施例中,“一个或多个”是指一个、两个或两个以上;“和/或”,描述关联对象的关联关系,表示可以存在三种关系;例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A、B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。It should also be understood that in the embodiments 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.
本申请实施例的说明书和权利要求书中的术语“第一”和“第二”等是用于区别不同的对象,而不是用于描述对象的特定顺序。例如,第一目标对象和第二目标对象等是用于区别不同的目标对象,而不是用于描述目标对象的特定顺序。The terms "first" and "second" in the description and claims of the embodiments of the present application are used to distinguish different objects, rather than to describe a specific order of objects. For example, the first target object, the second target object, etc. are used to distinguish different target objects, rather than describing a specific order of the target objects.
在本申请说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。Reference 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. Thus, 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.
在本申请实施例的描述中,除非另有说明,“多个”的含义是指两个或两个以上。例如,多个处理单元是指两个或两个以上的处理单元;多个系统是指两个或两个以上的系统。In the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more. For example, multiple processing units refer to two or more processing units; multiple systems refer to two or more systems.
本申请实施例中,电子设备可以通过无线网卡与其他电子设备之间建立网络通道,同时电子设备也可以通过数据业务网卡与其他电子设备之间建立网络通道。其中,通过无线网卡与其他电子设备之间建立的网络通道可以称作是Wi-Fi网络,而通过数据业务网卡与其他电子设备之间建立的网络通道可以称作是蜂窝网络。在实际应用中,不同应用(或者不同类别的应用)对所使用的网络通道的质量的要求不同。In the embodiment of the present application, the electronic device can establish a network channel with other electronic devices through a wireless network card, and at the same time, the electronic device can also establish a network channel with other electronic devices through a data service network card. Wherein, the network channel established between the wireless network card and other electronic devices may be called a Wi-Fi network, and the network channel established between the data service network card and other electronic devices may be called a cellular network. In practical applications, different applications (or different types of applications) have different requirements on the quality of the used network channels.
另外,电子设备可以配置有网络加速模块,该网络加速模块用于在电子设备运行应用程序时,若出现网络卡顿,则执行网络切换操作。具体的,通过该网络加速模块本申请实施例可以实现对Wi-Fi网络和蜂窝网络的切换,详细请参阅图1。通过图1可以看出,电子设备中的应用程序在运行的过程中,如果确定电子设备当前连接的Wi-Fi网络出现卡顿,则可以将电子设备的网络从Wi-Fi网络切换至蜂窝网络。In addition, the electronic device may be configured with a network acceleration module, and the network acceleration module is used to perform a network switching operation if a network freeze occurs when the electronic device is running an application program. Specifically, switching between a Wi-Fi network and a cellular network can be realized through the network acceleration module in this embodiment of the present application, please refer to FIG. 1 for details. It can be seen from Figure 1 that during the running of the application program in the electronic device, if it is determined that the Wi-Fi network currently connected to the electronic device is stuck, the network of the electronic device can be switched from the Wi-Fi network to the cellular network .
参见图2,用户使用手机中的应用A看视频/直播,其中,手机中的应用A通过手机中的无线网卡与应用A的服务器A建立网络连接。应用A和服务器A之间产生的数据流A(例如,直播时产生的数据流)通过手机上的无线网卡和无线路由器之间的Wi-Fi网络传输。用户使用手机中的应用B(浏览类应用)聊天,手机中的应用B通过手机的无线网卡与应用B的服务器B建立网络连接。另外,应用B和服务器B之间产生的数据流B(例如,浏览网址时产生的数据流)通过手机上的无线网卡和无线路由器之间的Wi-Fi网络传输。Referring to FIG. 2 , the user uses application A in the mobile phone to watch video/live broadcast, 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. The data stream A generated between the application A and the server A (for example, the data stream generated during the live broadcast) 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 (browsing application) in the mobile phone to chat, and 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. In addition, the data flow B generated between the application B and the server B (for example, the data flow generated when browsing a website) is transmitted through the Wi-Fi network between the wireless network card on the mobile phone and the wireless router.
本申请实施例中将两个电子设备之间传输的数据序列记为数据流。在实际应用中,该数据流可以为视频流、音频流、下载流、会话流等。In the embodiment of the present application, the data sequence transmitted between two electronic devices is recorded as a data stream. In practical applications, the data stream may be a video stream, an audio stream, a download stream, a session stream, and the like.
若用户在同一位置(无线网卡和无线路由器之间的距离相同)、同一时间范围内(例如,半个小时以内)使用手机中的应用A和手机中的应用B,理论上Wi-Fi通信质量差异不大。然而,由于数据流A相比于数据流B在单位时间内产生的数据量更大,所以数据流A相比于数据流B对Wi-Fi网络的质量要求更高。用户使用应用B时比较顺畅,然而,用户使用应用A时可能出现卡顿现象,导致用户的体验较差。If the user uses application A and application B in the mobile phone at the same location (the distance between the wireless network card and the wireless router is the same) and within the same time range (for example, within half an hour), the theoretical Wi-Fi communication quality Little difference. However, 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.
另外,同一应用的不同业务场景,由于处理不同的业务,如此会导致相同应用的不同业务场景对通信质量的要求也可能不相同。如图3所示,应用A可以包括两个场景,这两个场景分别可以是直播业务场景和视频场景。处于直播业务场景时应用A产生的数据流可以为直播流A1,处于视频场景时应用A产生的数据流可以为视频流A2。直播流A1和视频流A2均可以通过无线网卡和2.4GHz的无线路由器之间的Wi-Fi网络传输。In addition, since different business scenarios of the same application process different services, different business scenarios of the same application may have different communication quality requirements. As shown in FIG. 3 , application A may include two scenarios, which may be a live broadcast service scenario and a video scenario respectively. The data stream generated by application A in the live broadcast service scenario may be live stream A1, and the data stream generated by application A in the video scene may be video stream A2. Both the live stream A1 and the video stream A2 can be transmitted through the Wi-Fi network between the wireless network card and the 2.4GHz wireless router.
若用户在同一位置(无线网卡和无线路由器之间的距离相同)、同一时间范围内(例如,半个小时以内)使用手机中的应用A分别进行直播和视频,理论上,网络通道质量差异不大。然而,由于直播流A1相比于视频流A2在单位时间内产生的数据量更大,所以直播流A1相比于数据流B对网络通道的质量要求更高。用户使用应用A观看视频时比较顺畅,然而,用户使用应用A进行直播时可能觉得网络速率太慢,导致用户的体验较差。If the user is at the same location (the distance between the wireless network card and the wireless router is the same) and within the same time range (for example, within half an hour), the user uses application A in the mobile phone to perform live broadcast and video respectively, in theory, the difference in network channel quality is not the same. big. However, since the live stream A1 generates a larger amount of data per unit time than the video stream A2, the live stream A1 has higher requirements on the quality of the network channel than the data stream B. The user uses App A to watch the video smoothly. However, the user may feel that the network speed is too slow when using App A for live broadcast, resulting in a poor user experience.
综上可以知道,同一电子设备的不同应用程序对网络通道的质量的要求不同,并且同一应用的不同业务场景对网络通道的质量的要求也可能不同。在确定某个应用当前使用的网络通道不足以承载该应用产生的数据流的情况下,可以通过切换网络来提升通信质量。To sum up, it can be known that different application programs of the same electronic device have different requirements on the quality of the network channel, and different business scenarios of the same application may also have different requirements on the quality of the network channel. When it is determined that the network channel currently used by an application is not enough to carry the data flow generated by the application, the communication quality can be improved by switching the network.
参见图4,在确定应用A的数据流A的传输质量较差的情况下,可以将数据流A从当前的Wi-Fi网络切换到其他网络通道。如图4所示,手机可以将数据流A切换到手机的数据业务网卡和基站之间的蜂窝网络上,以通过该蜂窝网络与服务器A传输数据流A。Referring to FIG. 4 , when it is determined that the transmission quality of the data stream A of the application A is poor, the data stream A may be switched from the current Wi-Fi network to another network channel. As shown in FIG. 4 , 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.
本申请实施例中某个网络通道的通信质量的好(优)坏(差)或某个数据流在某个网络通道上的传输质量的好(优)坏(差)均可以通过一些参数进行判断。在具体实现时,可以设置一些条件,例如,在满足预设条件时,认为通信质量为好(优),在不满预设条件时,认为通信质量为坏(差)。In the embodiment of the present application, whether the communication quality of a certain network channel is good (excellent) or bad (poor) or the transmission quality of a certain data stream on a certain network channel is good (good) or bad (poor) can be determined by some parameters judge. During specific implementation, some conditions may be set, for example, when the preset conditions are satisfied, the communication quality is considered good (excellent), and when the preset conditions are not satisfied, the communication quality is considered bad (poor).
通过上述介绍可以知道,执行网络切换的前提是网络通道的通信质量无法满足应用程序的正常通信,故如何确定当前应用程序(业务场景)的评估指标是否符合切换条件是至关重要的。From the above introduction, it can be seen that the premise of performing network switching is that the communication quality of the network channel cannot meet the normal communication of the application program, so how to determine whether the evaluation index of the current application program (business scenario) meets the switching conditions is very important.
目前在确定是否执行网络切换操作时,主要是在关键流的基础上进行的,然而为了保证数据的安全性,电子设备与服务器之间交互的多数数据流是经过加密的,如经过HTTPS加密。然而,这样会导致在判断是否执行网络切换操作时,很难从关键流的角度出发来对网络的通信质量进行判断。At present, when determining whether to perform a network switching operation, it is mainly performed on the basis of key streams. However, in order to ensure data security, most of the data streams exchanged between electronic devices and servers are encrypted, such as encrypted by HTTPS. However, this will make it difficult to judge the communication quality of the network from the perspective of key flows when judging whether to perform the network switching operation.
并且,现有的电子设备与服务器在进行数据交互时,传输的数据流已不仅限于单一的流,即在进行数据传输时会存在多条流传输的可能,而多条数据流的存在使得无法从关键流出发来对网络的通信质量进行判断。例如,短视频应用程序在直播业务场景下与服务器之间的传输,既有TCP((Transmission Control Protocol,传输控制协议)流又有UDP(User Datagram Protocol,用户数据报协议)流,且夹杂有P2P(Peer-to-peer,对等网络)流的传输。Moreover, when existing electronic devices and servers perform data interaction, the transmitted data stream is not limited to a single stream, that is, there may be multiple streams during data transmission, and the existence of multiple data streams makes it impossible to The communication quality of the network is judged from the key flow. For example, the transmission between the short video application program and the server in the live broadcast business scenario includes both TCP ((Transmission Control Protocol, Transmission Control Protocol) flow and UDP (User Datagram Protocol, User Datagram Protocol) flow, and mixed with P2P (Peer-to-peer, peer-to-peer network) stream transmission.
另外,在确定是否执行网络切换操作时,也可以通过判断网络通道来实现,然而仅通过网络通道来进行通信质量的判断一般只会用到物理层或者MAC(Medium AccessControl)层的参数。并且,通过通道判断是否执行网络切换操作时,无法针对不同的场景采用不同的评估指标,即无法对不同的场景进行区分,通过上述介绍可以知道同一应用程序的不同场景对网络的通信质量的要求可能不同。例如,应用A的直播业务场景对于速率有一定要求,而游戏场景对于速率要求不高,但是直播业务场景对时延和丢包的要求则较高。In addition, when determining whether to perform the network switching operation, it can also be realized by judging the network channel. However, only the parameters of the physical layer or MAC (Medium Access Control) layer are generally used to judge the communication quality only through the network channel. Moreover, when judging whether to perform network switching operations through the channel, different evaluation indicators cannot be used for different scenarios, that is, different scenarios cannot be distinguished. Through the above introduction, we can know the requirements of different scenarios of the same application on the communication quality of the network may be different. For example, the live broadcast service scenario of application A has certain requirements on the rate, while the game scene has low requirements on the rate, but the live broadcast service scenario has higher requirements on delay and packet loss.
因此,现有网络切换的判断方法无法准确的对不同的应用程序以及不同的业务场景进行判断,进而导致网络切换的准确率较低。Therefore, the existing method for judging network handover cannot accurately judge different application programs and different service scenarios, which leads to a low accuracy rate of network handover.
为了解决上述问题,本申请实施例提供了一种网络切换方法。该网络切换方法中,开发人员可以预先针对不同的应用程序配置不同的评估指标以及其对应的门限。另外,针对同一应用的不同场景也可以设置不同的评估指标以及门限。如此,可以在一定程度上提高网络切换准确网络切换的准确性。In order to solve the above problem, an embodiment of the present application provides a network switching method. In the network switching method, developers can pre-configure different evaluation indicators and their corresponding thresholds for different application programs. In addition, different evaluation indicators and thresholds can also be set for different scenarios of the same application. In this way, the accuracy of network switching can be improved to a certain extent.
本申请实施例中的网络切换方法可应用于电子设备中。该电子设备适用于上述场景中的手机。另外,电子设备还可以为平板电脑、笔记本、可穿戴设备、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本、个人数字助理(personal digital assistant,PDA)等。本申请实施例对电子设备的具体类型不作限定。The network switching method in the embodiment of the present application can be applied to electronic equipment. The electronic device is suitable for mobile phones in the above scenarios. In addition, the electronic device may also be a tablet computer, a notebook, 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 the like. The embodiment of the present application does not limit the specific type of the electronic device.
图5示出了本申请实施例中的电子设备100的结构示意图。应该理解的是,图5所示电子设备100仅是电子设备的一个范例,并且电子设备100可以具有比图中所示的更多的或者更少的部件,可以组合两个或多个的部件,或者可以具有不同的部件配置。图5中所示出的各种部件可以在包括一个或多个信号处理和/或专用集成电路在内的硬件、软件、或硬件和软件的组合中实现。FIG. 5 shows a schematic structural diagram of an electronic device 100 in an embodiment of the present application. It should be understood that the electronic device 100 shown in FIG. 5 is only an example of an electronic device, and the electronic device 100 may have more or fewer components than those shown in the figure, and two or more components may be combined , or can have different component configurations. The various components shown in Figure 5 may be implemented in hardware, software, or a combination of hardware and software including one or more signal processing and/or application specific integrated circuits.
电子设备100可以包括:处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器,陀螺仪传感器,气压传感器,磁传感器,加速度传感器,距离传感器,接近光传感器,指纹传感器,温度传感器,触摸传感器,环境光传感器,骨传导传感器等。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, indicator 192, camera 193, display screen 194, And a subscriber identification module (subscriber identification module, SIM) card interface 195 and so on. The sensor module 180 may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, and the like.
可以理解的是,本申请实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that, the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100 . In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown 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.
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processingunit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。例如,处理器110用于执行本申请实施例中的网络切换方法。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), etc. . 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 switching method in the embodiment of the present application.
其中,控制器可以是电子设备100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。Wherein, the controller may be the nerve center and command center of the electronic device 100 . The controller can generate an operation control signal according to the instruction opcode and timing signal, and complete the control of fetching and executing the instruction.
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为电子设备100充电,也可以用于电子设备100与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他电子设备,例如AR设备等。A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. The USB interface 130 is an interface conforming to the USB standard specification, specifically, it may be a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like. The USB interface 130 can be used to connect a charger to charge the electronic device 100 , and can also be used to transmit data between the electronic device 100 and peripheral devices. It can also be used to connect headphones and play audio through them. This interface can also be used to connect other electronic devices, such as AR devices.
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过电子设备100的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备供电。The charging management module 140 is configured to receive a charging input from a charger. Wherein, the charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from the wired charger through the USB interface 130 . In some wireless charging embodiments, the charging management module 140 may receive a wireless charging input through a wireless charging coil of the electronic device 100 . While the charging management module 140 is charging the battery 142 , it can also supply power to the electronic device through the power management module 141 .
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,外部存储器,显示屏194,摄像头193,和无线通信模块160等供电。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 .
天线1和天线2用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。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. For example: Antenna 1 can be multiplexed as a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
移动通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。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 .
无线通信模块160可以提供应用在电子设备100上的包括无线局域网(wirelesslocal area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。The wireless communication module 160 can provide applications on the electronic device 100 including wireless local area networks (wireless local area networks, WLAN) (such as wireless fidelity (wireless fidelity, Wi-Fi) network), bluetooth (bluetooth, BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions.
在一些实施例中,电子设备100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得电子设备100可以通过无线通信技术与网络以及其他设备通信。In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology.
电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。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.
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emittingdiode,OLED)等。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的正整数。The display screen 194 is used to display images, videos and the like. The display screen 194 includes a display panel. The display panel may be a liquid crystal display (liquid crystal display, LCD), an organic light-emitting diode (organic light-emitting diode, OLED) or the like. In some embodiments, the electronic device 100 may include 1 or N display screens 194 , where N is a positive integer greater than 1.
电子设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。The electronic device 100 can realize the shooting function through the ISP, the camera 193 , the video codec, the GPU, the display screen 194 and the application processor.
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,电子设备100可以包括1个或N个摄像头193,N为大于1的正整数。Camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects it to the photosensitive element. The photosensitive element may be a charge coupled device (charge coupled device, CCD) or a complementary metal-oxide-semiconductor (complementary metal-oxide-semiconductor, CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. DSP converts digital image signals into standard RGB, YUV and other image signals. In some embodiments, the electronic device 100 may include 1 or N cameras 193 , where N is a positive integer greater than 1.
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100 . The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. Such as saving music, video and other files in the external memory card.
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行电子设备100的各种功能应用以及执行内部存储器121的指令,使得电子设备执行本申请中的网络切换方法。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。The internal memory 121 may be used to store computer-executable program codes including instructions. The processor 110 executes various functional applications of the electronic device 100 and executes the instructions of the internal memory 121 by executing the instructions stored in the internal memory 121 , so that the electronic device executes the network switching method in this application. 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, at least one application program required by a function (such as a sound playing function, an image playing function, etc.) and the like. The storage data area can store data created during the use of the electronic device 100 (such as audio data, phonebook, etc.) and the like. In addition, 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.
在本申请的实施例中,内部存储器121中还可以存储实现本申请实施例的网络切换方法对应的可执行程序代码,处理器通过运行网络切换方法对应的可执行程序代码可以实现网络切换。In the embodiment of the present application, the internal memory 121 may also store executable program code corresponding to the network switching method of the embodiment of the present application, and the processor may implement network switching by running the executable program code corresponding to the network switching method.
电子设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。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.
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signal. The audio module 170 may also be used to encode and decode audio signals. In some embodiments, 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 .
按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。电子设备100可以接收按键输入,产生与电子设备100的用户设置以及功能控制有关的键信号输入。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 .
马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振动反馈。例如,作用于不同应用(例如拍照,音频播放等)的触摸操作,可以对应不同的振动反馈效果。指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。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. For example, touch operations applied to different applications (such as taking pictures, playing audio, etc.) may correspond to different vibration feedback effects. The indicator 192 can be an indicator light, and can be used to indicate charging status, power change, and can also be used to indicate messages, missed calls, notifications, and the like.
本申请实施例并未特别限定一种网络切换方法的执行主体的具体结构,只要可以通过运行记录有本申请实施例的一种网络切换方法的代码,以根据本申请实施例提供的一种网络切换方法进行处理即可。例如,本申请实施例提供的一种网络切换方法的执行主体可以是电子设备中能够调用程序并执行程序的功能模块,或者为应用于电子设备中的处理装置,例如,芯片。The embodiment of the present application does not specifically limit the specific structure of the execution subject of a network switching method, as long as the code of a network switching method in the embodiment of the Just switch the method for processing. For example, the execution subject of a network switching method provided in the embodiment of the present application may be a functional module in the electronic device capable of invoking and executing the program, or a processing device applied in the electronic device, for example, a chip.
本申请实施例中的电子设备上可以安装运行多个应用,例如:短视频应用、浏览器应用、游戏和新闻应用等,其中,短视频应用可以用于播放视频或者是进行视频直播等。这些应用可以通过所在的电子设备与其他电子设备(例如,应用对应的服务器)建立网络连接。Multiple applications can be installed and run on the electronic device in the embodiment of the present application, such as: short video applications, browser applications, games and news applications, etc., wherein the short video applications can be used to play videos or perform live video broadcasts. These applications can establish network connections with other electronic devices (for example, servers corresponding to the applications) through the electronic devices.
作为示例,电子设备中安装有应用A,该应用可以为短视频应用。另外,该应用A可以通过所在的电子设备中的无线网卡(也可记为Wi-Fi网卡)与应用A对应的服务器建立网络连接;应用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)、宽带码分多址(WidebandCode Division Multiple Access,WCDMA)、长期演进(Long Term Evolution,LTE)、第五代移动通信技术(5th Generation Mobile Communication Technology,5G)等移动通信技术上网的装置。As an example, application A is installed in the electronic device, and the application may be a short video application. In addition, the application A can establish a network connection with the server corresponding to the application A through the wireless network card (also referred to as a Wi-Fi network card) in the electronic device; the application A can also communicate with the server through the data service network card in the electronic device Server A corresponding to application A establishes a network connection. Among them, 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 radio service (General packet radio service, GPRS), enhanced data rate GSM evolution technology (Enhanced Data Rate for GSM Evolution, EDGE), Time Division-Synchronous Code Division Multiple Access (TD-SCDMA), High Speed Downlink Packet Access (HSDPA), Wideband Code Division Multiple Access (WidebandCode 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.
图6是本申请实施例的电子设备100的软件结构框图。通过图6可知,电子设备技术架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。FIG. 6 is a block diagram of the software structure of the electronic device 100 according to the embodiment of the present application. It can be seen from Figure 6 that the technical architecture of electronic equipment divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate through software interfaces.
应用层可以包括各种应用程序,例如,如前所述的短视频应用、浏览器应用。另外,应用程序还可以包括相机,图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,短信息等应用程序。另外,应用层也可以称作是应用程序层。The application layer may include various applications, for example, short video applications and browser applications as mentioned above. In addition, the application program can also include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, and short message. In addition, the application layer may also be referred to as an application program layer.
服务层可以包括环境探测组件、网络探测组件、通道级路径管理组件、应用级策略管理组件、通道及应用质量评估组件、网络连接管理组件。The service layer may include 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.
其中,环境探测组件用于探测上层应用的各种事件,作为示例,可以探测应用的打开、退出,还可以探测当前切换到前台的应用,还可以探测应用的安装、卸载等。Among them, 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.
网络探测组件用于探测电子设备支持的Wi-Fi网络的状态(开启或关闭等),还可以探测电子设备支持的数据业务网络的状态。作为示例,电子设备中设置有2.4GHz频段的无线网卡1和5.0GHz频段的无线网卡2。网络探测组件可以探测2.4GHz频段的无线网络为开启还是关闭状态;还可以探测5.0GHz频段的无线网络为开启或关闭状态。电子设备中设有运营商A的数据业务网卡1和运营商B的数据业务网卡2。网络探测组件可以探测运营商A的数据业务为开启还是关闭状态;还可以探测运营商B的数据业务为开启还是关闭状态。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. As an example, 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.
通道及应用质量评估组件用于评估网络通道的质量。作为示例,该通道及应用质量评估组件可以评估2.4GHz频段的Wi-Fi网络的质量,还可以评估5.0GHz频段的Wi-Fi网络的质量。也可以评估运营商A的蜂窝网络的质量,还可以评估运营商B的蜂窝网络的质量。Channel and application quality assessment components are used to assess the quality of network channels. As an example, 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 policy layer may include a flow-level policy management component, a flow-level path management component, and a traffic awareness component.
其中,流量感知组件可用于对上报的数据流进行统计,也可以在接收到流量上报组件传输的数据流时,判断各个数据流的通信质量。流级策略管理组件指示策略执行组件执行网络切换操作。流级路径管理组件用于根据上层的策略变化更新网络通道的选取,触发网络通道质量探测,动态选取最优通道,还可以用于存储不同的网络通道的路径,示例性的,可以存储应用当前使用的网络通道(例如,主网络通道)及备用网络通道的路径。另外,流级路径管理组件也可以在接收到流级感知组件传输的数据流时,判断各个数据流的通信质量。Wherein, the traffic sensing component can be used to count the reported data streams, and can also judge the communication quality of each data stream when receiving the data streams transmitted by the traffic reporting component. The flow-level policy management component instructs the policy enforcement component to perform network switching operations. 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. In addition, the flow-level path management component may also judge the communication quality of each data flow when receiving the data flow transmitted by the flow-level perception component.
内核层包括策略执行组件和流量上报组件。其中,流量上报组件用于收集数据流信息,并上报收集的数据流信息。策略执行组件用于执行网络通道的切换。The kernel layer includes policy enforcement components and traffic reporting components. Wherein, 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.
作为本申请另一实施例,上述实施例中一个组件可以拆分为两个或多个组件,位于同一层级的两个或多个组件可以合并为同一组件。As another embodiment of the present application, 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.
作为示例,策略层的流级策略管理组件和流级路径管理组件可以合并为同一组件;应用级策略管理组件和通道级路径管理组件可以合并为同一组件。另外,本申请实施例中判断电子设备当前运行的应用程序是否符合网络切换的条件可以运行于流级路径管理组件,也可以运行于流量感知组件,下述实施例将会详细说明在何种情况下进行网络切换。As an example, 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. In addition, in the embodiment of the present application, judging whether the application program currently running on the electronic device meets the conditions for network switching can be run in the stream-level path management component, or in the traffic awareness component. The following embodiments will describe in detail under what circumstances to switch the network.
在本申请实施例中,检测到电子设备运行目标应用程序时,可以获取该目标应用程序对应的多个评估指标,然后,基于这些评估指标综合确定是否执行网络切换操作。并且,电子设备运行的应用程序不同,其对应的评估指标也不同,如此在一定程度上可以提高网络切换的准确性。In the embodiment of the present application, when it is detected that the electronic device is running the target application program, multiple evaluation indicators corresponding to the target application program may be obtained, and then, based on these evaluation indicators, it is comprehensively determined whether to perform the network switching operation. Moreover, different application programs run by electronic devices have different corresponding evaluation indicators, so that the accuracy of network switching can be improved to a certain extent.
如图7所示,本申请实施例提供的一种网络切换方法,该网络切换方法可以包括下述的步骤S10至步骤S12。As shown in FIG. 7 , a network switching method provided by an embodiment of the present application may include the following steps S10 to S12.
步骤S01:流级路径管理组件获取目标应用程序的目标数据流。Step S01: The flow-level path management component obtains the target data flow of the target application.
需要说明的是,获取可以是指接收到流量上报组件上报的目标数据流。作为一种方式,流量上报组件可以每隔预设周期向流级路径管理组件上报一次应用A相关的数据流,该数据流可以作为目标数据流。例如,流量上报组件可以每隔500ms将其采集的数据流上报至流级路径管理组件。也就是说,上述目标数据流可以是当前周期的数据流。It should be noted that obtaining may refer to receiving the target data flow reported by the flow reporting component. As a manner, the flow reporting component may report the data flow related to application A to the flow-level path management component once every preset period, and the data flow may be used as the target data flow. For example, the flow reporting component may report the collected data flow to the flow-level path management component every 500 ms. That is to say, the above-mentioned target data flow may be the data flow of the current cycle.
本申请实施例中,流级路径管理组件在检测到电子设备运行目标应用程序时,可以获取该目标应用程序对应的目标数据流。另外,如果目标应用程序包括多个业务场景,则可以获取当前运行的业务场景的目标数据流。In the embodiment of the present application, when the stream-level path management component detects that the electronic device is running the target application program, it can acquire the target data stream corresponding to the target application program. In addition, if the target application includes multiple business scenarios, the target data flow of the currently running business scenario can be obtained.
另外,目标数据流可以是由连续的多个数据包组成,其中,多个数据包可以是流量上报组件在不同时刻采集的关于目标应用程序的数据,即目标数据流可以是电子设备在与目标服务器进行网络通信时产生的数据。其中,每个数据包可以看作是一个窗口。另外,每个数据包可以包括多个评估指标的值。In addition, the target data stream may be composed of multiple consecutive data packets, wherein the multiple data packets may be data about the target application program collected by the traffic reporting component at different times, that is, the target data stream may be the Data generated by the server during network communication. Among them, each packet can be regarded as a window. Additionally, each data packet may include values for multiple evaluation metrics.
作为一个示例,用户启动应用A或将应用A从后台切换到前台时,应用级策略管理组件可以指示流量上报组件开始对应用A进行监听,即指示流量上报组件上报应用A的数据流至流级路径管理组件。其中,应用A可以是电子设备中任意能够联网使用网络的应用程序。As an example, when the user starts application A or switches application A from the background to the foreground, the application-level policy management component can instruct the traffic reporting component to start monitoring application A, that is, instruct the traffic reporting component to report the data flow of application A to the flow level Path management component. Wherein, the application A may be any application program in the electronic device that can be connected to the network.
步骤S02:流级路径管理组件从目标数据流中选出多个评估指标对应的值,并对每个评估指标的值进行窗口统计。Step S02: The flow-level path management component selects values corresponding to multiple evaluation indicators from the target data stream, and performs window statistics on the value of each evaluation indicator.
本申请实施例中,每个应用程序可以存储有对应的多个评估指标,流级路径管理组件在获取到流量上报组件传输的目标数据流后,其可以从目标数据流中选出多个评估指标对应的评估值。In the embodiment of this application, each application program can store multiple corresponding evaluation indicators. After the stream-level path management component obtains the target data stream transmitted by the traffic reporting component, it can select multiple evaluation indicators from the target data stream. The evaluation value corresponding to the indicator.
一个应用程序可以仅对应有一个业务场景。例如,导航出行类应用程序A仅对应有搜索路线一个业务场景。另外,一个应用程序也可以对应有多个业务场景。例如,短视频类应用程序B对应有直播业务场景和观看视频业务场景。An application can correspond to only one business scenario. For example, navigation and travel application A only corresponds to one business scenario of searching routes. In addition, an application can also correspond to multiple business scenarios. For example, short video application B corresponds to a live broadcast business scenario and a video viewing business scenario.
为了更准确的实现网络的切换,本申请实施例为每个应用程序以及每个应用程序对应的每个业务场景配置了多个评估指标。另外,本申请也为每个评估指标配置有对应的门限。因此,应用程序不同则对应的评估指标也可能不同。并且,不同应用程序对应的同一评估指标的门限也可能不同。In order to implement network switching more accurately, the embodiment of the present application configures multiple evaluation indicators for each application program and each service scenario corresponding to each application program. In addition, this application also configures a corresponding threshold for each evaluation index. Therefore, the corresponding evaluation indicators may be different for different applications. Moreover, the thresholds of the same evaluation index corresponding to different application programs may also be different.
综上所述,应用程序、应用程序对应的业务场景、评估指标以及评估指标对应的门限之间可以存在一定的对应关系。为了更好的理解应用程序、业务场景、评估指标以及评估指标对应的门限之间的关系,本申请实施例给出如下表1。To sum up, there may be a certain correspondence between the application program, the business scenario corresponding to the application program, the evaluation index, and the threshold corresponding to the evaluation index. In order to better understand the relationship among applications, business scenarios, evaluation indicators, and thresholds corresponding to the evaluation indicators, the embodiment of the present application provides the following Table 1.
其中,表1可以存储于流级路径管理组件中,在检测到电子设备运行目标应用程序时,流级路径管理组件可以利用该表1获取到目标应用程序对应的多个评估指标。Wherein, Table 1 may be stored in the stream-level path management component. When detecting that the electronic device is running the target application, the stream-level path management component may use the Table 1 to obtain multiple evaluation indicators corresponding to the target application.
通过表1可以看出,同一应用程序(业务场景)可以对应有多个评估指标,应用程序不同,则对应的评估指标也可能不相同。It can be seen from Table 1 that the same application (business scenario) can have multiple evaluation indicators, and the corresponding evaluation indicators may be different for different applications.
作为一个示例,“虎牙”应用程序中的直播业务场景对应的评估指标可以是TCPRTT(Round Trip Time,往返传输时间)、TCP下行速率、TCP下行重传率以及WiFi MAC层上行重传率。As an example, the evaluation indicators corresponding to the live broadcast business scenario in the "Huya" application can be TCPRTT (Round Trip Time, round-trip transmission time), TCP downlink rate, TCP downlink retransmission rate, and WiFi MAC layer uplink retransmission rate.
作为另一个示例,“浏览器”应用程序中的浏览网站的业务场景对应的评估指标可以是TCP RTT、TCP上行重传率、TCP下行重传率以及WiFi MAC层上行重传率。As another example, the evaluation indicators corresponding to the business scenario of browsing websites in the "browser" application program may be TCP RTT, TCP uplink retransmission rate, TCP downlink retransmission rate, and WiFi MAC layer uplink retransmission rate.
另外,通过表1知道同一评估指标对应的门限可以有一个,也可以有多个。例如,应用程序“虎牙”的评估指标TCP RTT和TCP下行重传率的门限有一个,即只有门限1。又如,评估指标下行速率(TCP+UDP)和WiFi MAC层上行重传率对应的门限可以有两个,即存在门限1和门限2。In addition, it is known from Table 1 that there may be one or more thresholds corresponding to the same evaluation indicator. For example, there is only one threshold for the evaluation indicators TCP RTT and TCP downlink retransmission rate of the application "Huya", that is, only threshold 1. For another example, there may be two thresholds corresponding to the evaluation index downlink rate (TCP+UDP) and the uplink retransmission rate of the WiFi MAC layer, that is, threshold 1 and threshold 2.
需要说明的是,为每个应用程序(业务场景)配置评估指标时本申请实施例可以从TCP RTT、下行速率、上行速率、重传率等评估指标中选取一个或多个。其中,重传率可以包括TCP下行重传率、TCP上行重传率以及WiFi MAC层上行重传率等。It should be noted that, when configuring evaluation indicators for each application program (business scenario), in the embodiment of the present application, one or more evaluation indicators such as TCP RTT, downlink rate, uplink rate, and retransmission rate may be selected. Wherein, the retransmission rate may include a TCP downlink retransmission rate, a TCP uplink retransmission rate, and a WiFi MAC layer uplink retransmission rate.
表1多个应用程序、多个业务场景的评估指标和门限Table 1 Evaluation indicators and thresholds for multiple applications and multiple business scenarios
另外,速率可以包括上行速率和下行速率,且该下行速率可以包括TCP下行速率、UDP下行速率以及TCP+UDP下行速率等。可选的,也可以将时延、丢包率以及是否存在响应等配置为评估指标,具体为应用程序或者是业务场景配置哪些评估指标这里不进行明确限制,可以根据实际情况进行选择。In addition, the rate may include an uplink rate and a downlink rate, and the downlink rate may include a TCP downlink rate, a UDP downlink rate, a TCP+UDP downlink rate, and the like. Optionally, delay, packet loss rate, and whether there is a response can also be configured as evaluation indicators. The specific evaluation indicators configured for the application or business scenario are not specifically limited here, and can be selected according to the actual situation.
上述表1中仅列举了部分应用程序以及应用程序对应场景的评估指标以及门限,且仅用于示例。The above Table 1 only lists some applications and the evaluation indicators and thresholds of the scenarios corresponding to the applications, and is only used as an example.
通过上述介绍知道,目标数据流可以包括多个数据包,每个数据包对应一个窗口,且每个窗口可以包括多个评估指标的值,为了更好的实现对应用A的评估。流级路径管理组件在得到多个评估指标后,可以对每个评估指标对应的多个值进行窗口统计,以得到每个评估指标对应的目标值。It is known from the above introduction that the target data stream may include multiple data packets, each data packet corresponds to a window, and each window may include values of multiple evaluation indicators, in order to better evaluate the application A. After obtaining multiple evaluation indicators, the flow-level path management component can perform window statistics on multiple values corresponding to each evaluation indicator, so as to obtain the target value corresponding to each evaluation indicator.
本申请实施例中,窗口统计可以是对同一个评估指标对应的多个值进行统计。作为一个示例,窗口统计可以是获取同一个评估指标对应的多个评估值的平均,并将获取的平均值作为该评估指标的目标值。In the embodiment of the present application, the window statistics may be to perform statistics on multiple values corresponding to the same evaluation indicator. As an example, window statistics may be obtained by obtaining an average of multiple evaluation values corresponding to the same evaluation index, and using the obtained average value as a target value of the evaluation index.
作为另一个示例,窗口统计也可以是获取同一个评估指标对应的多个评估值中的最大值,并将该最大值做为该评估指标的目标值。具体采取哪种统计策略这里不进行明确限制,可以根据实际情况进行选择。As another example, the window statistics may also be to obtain the maximum value among multiple evaluation values corresponding to the same evaluation index, and use the maximum value as the target value of the evaluation index. There is no specific restriction on which statistical strategy to adopt here, and it can be selected according to the actual situation.
作为一种方式,在对评估指标进行窗口统计时,流级路径管理组件可以仅执行一次窗口统计操作,或者也可以执行多次窗口统计操作。并且,在执行多次窗口统计操作时,窗口的数量也可以不同。As a way, when performing window statistics on the evaluation index, the flow-level path management component may only perform one window statistics operation, or may also perform multiple window statistics operations. Moreover, when performing multiple window statistical operations, the number of windows may also be different.
作为一个示例,在对评估指标下行速率(TCP+UDP)进行统计时可以进行两次窗口统计。其中,第一次进行窗口统计可以是获取4个窗口的平均值,得到第一目标值;第二次进行窗口统计是获取7个窗口的平均值,得到第二目标值。As an example, two window statistics may be performed when performing statistics on the downlink rate (TCP+UDP) of the evaluation index. Wherein, performing window statistics for the first time may be to obtain the average value of 4 windows to obtain the first target value; performing window statistics for the second time is to obtain the average value of 7 windows to obtain the second target value.
通过表1知道“虎牙”的直播业务场景对应的评估指标包括TCP RTT、下行速率(TCP+UDP)、TCP下行重传率以及WiFi MAC层上行重传率。本申请可以将TCP RTT可以记作是R,下行速率记作V,TCP下行重传率记作是P,WiFi MAC层上行重传率记作是C。From Table 1, we know that the evaluation indicators corresponding to the live broadcast business scenario of "Huya" include TCP RTT, downlink rate (TCP+UDP), TCP downlink retransmission rate, and WiFi MAC layer uplink retransmission rate. In this application, the TCP RTT can be recorded as R, the downlink rate as V, the TCP downlink retransmission rate as P, and the WiFi MAC layer uplink retransmission rate as C.
在获取到多个评估指标后,流级路径管理组件可以从目标数据流中选取距离当前时刻最近的4个数据包进行窗口统计,这4个数据包分别是数据包1、数据包2、数据包3以及数据包4。另外,数据包1包括的评估指标有R1、V1、P1和C1;数据包2包括的评估指标有R2、V2、P2和C2;数据包3包括的评估指标有R3、V3、P3和C3;数据包4包括的评估指标有R4、V4、P4和C4。After obtaining multiple evaluation indicators, the flow-level path management component can select the 4 data packets closest to the current moment from the target data flow for window statistics. These 4 data packets are data packet 1, data packet 2, data packet Packet 3 and Data Packet 4. In addition, the evaluation indicators included in data package 1 are R1, V1, P1 and C1; the evaluation indicators included in data package 2 are R2, V2, P2 and C2; the evaluation indicators included in data package 3 are R3, V3, P3 and C3; The evaluation indicators included in data package 4 are R4, V4, P4 and C4.
流级路径管理组件在获取到4个数据包后可以对这些数据包中的每个评估指标进行窗口统计。例如,计算4个数据包中TCP下行重传率的平均值,得到TCP下行重传率的目标值。具体的计算公式可以为:(P1+P2+P3+P4)/4,其他评估指标的统计与TCP下行重传率的统计类似这里就不再进行赘述。After obtaining 4 data packets, the flow-level path management component can perform window statistics on each evaluation indicator in these data packets. For example, calculate the average value of the TCP downlink retransmission rate in 4 data packets to obtain the target value of the TCP downlink retransmission rate. The specific calculation formula can be: (P1+P2+P3+P4)/4, the statistics of other evaluation indicators are similar to the statistics of the TCP downlink retransmission rate and will not be repeated here.
另外,在对每个评估指标的值进行窗口统计时,可以采用相同的统计方式,也可以采用不同的统计方式。例如,对每个评估指标的值进行统计时均是计算平均值。又如,对一部分评估指标的值进行统计时可以是计算平均值,另一部分可以是获取最大值/最小值等。In addition, when performing window statistics on the value of each evaluation index, the same statistical method may be used, or different statistical methods may be used. For example, the average value is calculated when the value of each evaluation index is counted. For another example, when performing statistics on the values of some evaluation indicators, it may be to calculate the average value, and another part may be to obtain the maximum value/minimum value, etc.
综上所述,通过对多个评估指标的值进行窗口统计便可以获取到每个评估指标对应的目标值,后续便可以基于这些目标值来确定是否执行网络切换操作。另外,在获取到每个评估指标对应的目标值后,流级路径管理组件可以从多个评估指标中选出一个作为当前指标,即进入步骤S03。To sum up, by performing window statistics on the values of multiple evaluation indicators, the target value corresponding to each evaluation indicator can be obtained, and then it can be determined whether to perform a network switching operation based on these target values. In addition, after obtaining the target value corresponding to each evaluation index, the flow-level path management component may select one of the evaluation indexes as the current index, that is, enter step S03.
需要说明的是,目标数据流中的评估指标的值可以是流级路径管理组件从流量上报组件处获取的。例如,如TCP RTT、TCP下行速率以及TCP下行重传率的值。可选的,评估指标的值也可以是流级路径管理组件从服务层处获取的。例如,WiFi MAC层上行重传率的值。各评估指标具体是由哪个组件传输流至级路径管理组件的这里不进行明确限制,可以根据应用程序以及应用程序对应的场景的实际情况进行选择。It should be noted that the value of the evaluation indicator in the target data flow may be obtained by the flow-level path management component from the flow reporting component. For example, values such as TCP RTT, TCP downlink rate, and TCP downlink retransmission rate. Optionally, the value of the evaluation indicator may also be obtained by the flow-level path management component from the service layer. For example, the value of the uplink retransmission rate of the WiFi MAC layer. There is no specific restriction on which component transmits the flow to the stage path management component for each evaluation index, and it can be selected according to the actual situation of the application program and the scenario corresponding to the application program.
步骤S03:流级路径管理组件从多个评估指标中选出一个作为当前指标。Step S03: The flow-level path management component selects one of multiple evaluation indicators as the current indicator.
在一些实施方式中,流级路径管理组件可以按照顺序依次从多个评估指标中选出当前指标,然后确定当前指标是否满足投票条件。具体的,流级路径管理组件可以确定当前指标是否超出对应的门限,即进入步骤S04。In some implementation manners, the flow-level path management component may sequentially select a current indicator from multiple evaluation indicators, and then determine whether the current indicator satisfies the voting condition. Specifically, the stream-level path management component may determine whether the current index exceeds a corresponding threshold, that is, enter step S04.
步骤S04:流级路径管理组件确定当前指标的目标值是否超出对应的门限。Step S04: the flow-level path management component determines whether the target value of the current index exceeds the corresponding threshold.
作为一种方式,在获取到当前指标时,流级路径管理组件可以确定当前指标的目标值是否超出门限。如果超出门限,则设置当前指标的投票标记,即进入步骤S05。其中,门限可以是当前指标对应的最大值/最小值。As a manner, when the current index is acquired, the flow-level path management component can determine whether the target value of the current index exceeds the threshold. If it exceeds the threshold, set the voting mark of the current indicator, that is, enter step S05. Wherein, the threshold may be the maximum/minimum value corresponding to the current indicator.
另外,在确定当前指标没有超出门限时,流级路径管理组件可以确定当前指标是否已经投票,即进入步骤S10。In addition, when it is determined that the current index does not exceed the threshold, the flow-level path management component may determine whether the current index has voted, that is, enter step S10.
作为一个示例,当前指标为TCP下行重传率,则确定TCP下行重传率的目标值P0是否大于TCP下行重传率对应的门限(20%)。如果TCP下行重传率的目标值P0大于门限,则可以设置当前指标TCP下行重传率的投票标记。其中,投票标记用于表示当前指标TCP下行重传率已超出门限。As an example, if the current index is the TCP downlink retransmission rate, it is determined whether the target value P0 of the TCP downlink retransmission rate is greater than the threshold (20%) corresponding to the TCP downlink retransmission rate. If the target value P0 of the TCP downlink retransmission rate is greater than the threshold, a voting mark for the current target TCP downlink retransmission rate may be set. Among them, the voting mark is used to indicate that the current indicator TCP downlink retransmission rate has exceeded the threshold.
步骤S05:流级路径管理组件设置当前指标的投票标记。Step S05: The flow-level path management component sets the voting mark of the current indicator.
本申请实施例中,在确定当前指标的目标值超出门限时,流级路径管理组件可以设置当前指标的投票标记,其中,设置当前指标的投票标记可以是,为当前的评估指标设置投票标记。In this embodiment of the application, when it is determined that the target value of the current index exceeds the threshold, the flow-level path management component may set the voting mark of the current index, wherein setting the voting mark of the current index may be setting the voting mark for the current evaluation index.
作为一个示例,如果确定当前指标TCP下行重传率超出其对应的门限,则可以将TCP下行重传率对应的投票标记置为1,其中,1用来表示已投1票。As an example, if it is determined that the current TCP downlink retransmission rate exceeds its corresponding threshold, the voting mark corresponding to the TCP downlink retransmission rate may be set to 1, where 1 is used to indicate that 1 vote has been cast.
需要说明的是,流级路径管理组件在确定当前指标的目标值是否超出对应的门限时,其可以先确定当前指标是否仅存在一个门限。如果仅存在一个门限,则确定当前指标的目标值是否超出该门限。It should be noted that, when the flow-level path management component determines whether the target value of the current index exceeds the corresponding threshold, it may first determine whether there is only one threshold for the current index. If there is only one threshold, it is determined whether the target value of the current indicator exceeds the threshold.
另外,如果确定当前指标存在多个门限,则流级路径管理组件可以先确定当前指标的第一目标值是否超出门限1,若超出门限1,则为当前指标设置投票标记,此时的投票标记为1。在此基础上,继续确定当前指标的第二目标值是否超出门限2,如果超出门限2,则再次为当前指标设置投票标记,此时的投票标记为2。换句话说,如果同一个评估指标被标记两次,则表示产生两次投票。In addition, if it is determined that there are multiple thresholds for the current index, the flow-level path management component can first determine whether the first target value of the current index exceeds the threshold 1, and if it exceeds the threshold 1, set a voting mark for the current index, and the voting mark at this time is 1. On this basis, continue to determine whether the second target value of the current indicator exceeds the threshold 2, and if it exceeds the threshold 2, set the voting mark for the current indicator again, and the voting mark at this time is 2. In other words, if the same evaluation metric is marked twice, it means that there are two votes.
本申请实施例中,第一目标值和第二目标值可以相同,也可以不同。另外,获取第一目标值的窗口数量和获取第二目标值的窗口数量可以相同,也可以不同,具体如何选择这里不进行明确限制,可根据实际情况进行选择。In this embodiment of the present application, the first target value and the second target value may be the same or different. In addition, the number of windows for obtaining the first target value and the number of windows for obtaining the second target value may be the same or different, and the specific selection is not specifically limited here and may be selected according to actual conditions.
作为一个示例,当前指标WiFi MAC层上行重传率的第一目标值超出门限1,则WiFiMAC层上行重传率对应的投票标记可以为1。其中,1用来表示已投1票。另外,如果当前指标WiFi MAC层上行重传率的目标值大于门限2,则将票标记设置为2。其中,2用来表示已投2票。As an example, if the first target value of the current index WiFi MAC layer uplink retransmission rate exceeds the threshold 1, the voting mark corresponding to the WiFi MAC layer uplink retransmission rate may be 1. Among them, 1 is used to indicate that 1 vote has been cast. In addition, if the target value of the current indicator WiFi MAC layer uplink retransmission rate is greater than the threshold 2, the ticket mark is set to 2. Among them, 2 is used to indicate that 2 votes have been cast.
步骤S06:流级路径管理组件记录当前指标的投票时间。Step S06: The flow-level path management component records the voting time of the current index.
在一些实施方式中,流级路径管理组件在置当前指标的投票标记之后,其可以记录当前指标的投票时间。换句话说,在执行投票操作之后,流级路径管理组件可以对当前指标的投票时间进行记录。例如,流级路径管理组件在为当前指标TCP RTT设置投票标后,其可以记录投票的时间点。In some implementations, after the flow-level path management component sets the voting mark of the current indicator, it can record the voting time of the current indicator. In other words, after the voting operation is performed, the flow-level path management component can record the voting time of the current indicator. For example, after the flow-level path management component sets a voting mark for the current indicator TCP RTT, it can record the time point of voting.
需要说明的是,流级路径管理组件也可以存储有当前指标的历史投票时间,通过将当前的投票时间和历史投票时间进行比较,流级路径管理组件可以更加准确的实现对网络的切换。It should be noted that the flow-level path management component can also store the historical voting time of the current index. By comparing the current voting time with the historical voting time, the flow-level path management component can more accurately implement network switching.
步骤S07:流级路径管理组件判断存在投票标记的投票是否达到两票。Step S07: The flow-level path management component judges whether the votes with voting marks reach two votes.
作为一种方式,流级路径管理组件在记录投票时间之后,其也可以确定当前投票数量是否累计有两票,即确定当前的投票数是否达到两票。其中,两票可以是同一评估指标投两票的情况,也可以是不同的两个评估指标分别投了两票的情况。As a way, after the stream-level path management component records the voting time, it can also determine whether the current number of votes has accumulated two votes, that is, determine whether the current number of votes has reached two votes. Wherein, the two votes may be the case where the same evaluation index casts two votes, or may be the case where two different evaluation indexes cast two votes respectively.
作为一个示例,当下行速率(TCP+UDP)或者WiFi MAC层上行重传率满足各自评估指标对应的门限2时,则确定当前投票累计两票,即下行速率(TCP+UDP)的投票标记为2,或者WiFi MAC层上行重传率的投票标记为2,则确定当前投票累计两票。As an example, when the downlink rate (TCP+UDP) or the uplink retransmission rate of the WiFi MAC layer meets the threshold 2 corresponding to the respective evaluation indicators, it is determined that the current vote has accumulated two votes, that is, the downlink rate (TCP+UDP) vote is marked as 2, or the vote mark of the uplink retransmission rate of the WiFi MAC layer is 2, then it is determined that the current vote has accumulated two votes.
作为另一个示例,TCP RTT的投票标记为1,下行速率(TCP+UDP)的投票标记为1,确定当前投票累计两票;TCP RTT的投票标记为1,TCP下行重传率的投票标记为1,确定当前投票累计两票;TCP RTT的投票标记为1,WiFi MAC层上行重传率的投票标记为1,确定当前投票累计两票;下行速率(TCP+UDP)的投票标记为1,TCP下行重传率的投票标记为1,确定当前投票累计两票;下行速率(TCP+UDP)的投票标记为1,WiFi MAC层上行重传率的投票标记为1,确定当前投票累计两票;TCP下行重传率的投票标记为1,WiFi MAC层上行重传率的投票标记为1,确定当前投票累计两票。As another example, the vote for TCP RTT is marked as 1, the vote for the downlink rate (TCP+UDP) is marked as 1, and it is determined that the current vote has accumulated two votes; the vote for TCP RTT is marked as 1, and the vote for TCP downlink retransmission rate is marked as 1. Confirm that the current vote has accumulated two votes; the vote for TCP RTT is marked as 1, the vote for the uplink retransmission rate of the WiFi MAC layer is marked as 1, and the current vote has accumulated two votes; the vote for the downlink rate (TCP+UDP) is marked as 1, The vote for the TCP downlink retransmission rate is marked as 1, and the current vote has accumulated two votes; the vote for the downlink rate (TCP+UDP) is marked as 1, and the vote for the WiFi MAC layer uplink retransmission rate is marked as 1, and the current vote has accumulated two votes ; The vote for the TCP downlink retransmission rate is marked as 1, and the vote for the WiFi MAC layer uplink retransmission rate is marked as 1, and it is determined that the current vote has accumulated two votes.
通过上述介绍可以知道,每个应用程序/业务场景对应于的评估指标可以有多个,且投票的方式也可以不相同,故上述评估指标以及投票方式仅为示例,具体以实际情况为准。From the above introduction, we can know that there can be multiple evaluation indicators corresponding to each application/business scenario, and the voting methods can also be different, so the above evaluation indicators and voting methods are only examples, and the actual situation shall prevail.
在另一些实施方式中,流级路径管理组件在确定当前投票累计两票时,则可以确定网络的通信质量为“卡顿”,即进入步骤S08。另外,如果当前投票数未达到两票,则可以确定每个评估指标是否均遍历完成,即进入步骤S09。In some other implementation manners, when the flow-level path management component determines that the current voting has accumulated two votes, it may determine that the communication quality of the network is "stuck", that is, enter step S08. In addition, if the current number of votes does not reach two votes, it may be determined whether each evaluation index has been traversed, that is, enter step S09.
需要说明的是,在确定是否执行网络切换操作时,不同的应用程序(业务场景)可以对应有相同数量的评估指标,也可以对应有不同数量的评估指标,具体如何设置这里不进行明确限制,可以根据实际情况进行选择。It should be noted that when determining whether to perform network switching operations, different applications (business scenarios) can have the same number of evaluation indicators or different numbers of evaluation indicators. There is no clear limit on how to set it here. You can choose according to the actual situation.
综上所述,不同应用程序(业务场景)对网络通道的质量的要求是不同的。本申请实施例可以针对不同应用(业务场景)配置有不同的评估指标,并基于这些评估指标确定当前网络的通信质量是否为卡顿,如果为卡顿,则执行网络切换操作,其在一定程度上可以提高网络切换的准确性。To sum up, different applications (business scenarios) have different requirements on the quality of network channels. The embodiment of the present application can be configured with different evaluation indicators for different applications (business scenarios), and based on these evaluation indicators, it is determined whether the communication quality of the current network is stuck, and if it is stuck, the network switching operation is performed, which to a certain extent It can improve the accuracy of network switching.
步骤S08:流级路径管理组件判定网络为卡顿,确定切换网络。Step S08: The flow-level path management component determines that the network is stuck, and determines to switch the network.
作为一种方式,流级路径管理组件在获取到投票结果为两票时,可以确定应用A的网络通信质量差,即网络卡顿,此时流级路径管理组件确定切换网络。在此基础上,流级路径管理组件可以向通道级路径管理组件请求备用网络,并在获取到备用网络后将备用网络通过流级策略管理组件传输至策略执行组件,以通过策略执行组件将电子设备的网络从Wi-Fi网络切换至蜂窝网络。As a way, when the stream-level path management component obtains two votes, it can determine that the network communication quality of application A is poor, that is, the network freezes, and at this time, the stream-level path management component determines to switch the network. On this basis, the flow-level path management component can request the backup network from the channel-level path management component, and after obtaining the backup network, transfer the backup network to the policy execution component through the flow-level policy management component, so that the electronic The device's network switches from a Wi-Fi network to a cellular network.
步骤S09:流级路径管理组件确定每个评估指标是否均完成遍历。Step S09: the flow-level path management component determines whether each evaluation indicator has been traversed.
作为一种方式,在确定当前投票数没有达到两票时,流级路径管理组件可以确定每个评估指标是否均完成遍历。如果确定目标数据流中的每个评估指标均已完成遍历,流级路径管理组件则可以获取下一个周期的数据流,并将下个周期的数据流作为目标数据流。在此基础上,重复执行步骤S02至步骤S08。As a manner, when it is determined that the current number of votes does not reach two votes, the flow-level path management component may determine whether each evaluation index has been traversed. If it is determined that each evaluation index in the target data flow has been traversed, the flow-level path management component may obtain the data flow of the next cycle, and use the data flow of the next cycle as the target data flow. On this basis, step S02 to step S08 are repeatedly executed.
另外,如果存在未被遍历的评估指标,则获取下一个评估指标,并将所述下一个评估指标作为当前指标,继续确定当前指标的目标值是否超出对应的指标阈值。In addition, if there is an evaluation index that has not been traversed, the next evaluation index is obtained, and the next evaluation index is used as the current index, and continues to determine whether the target value of the current index exceeds the corresponding index threshold.
作为一个示例,“虎牙”的直播业务场景对应评估指标有四个,这四个评估指标分别是TCP RTT、下行速率(TCP+UDP)、TCP下行重传率以及WiFi MAC层上行重传率。在分别对TCP RTT、下行速率(TCP+UDP)以及TCP下行重传率完成遍历后,流级路径管理组件确定出还有WiFi MAC层上行重传率未被遍历。此时,流级路径管理组件可以将WiFi MAC层上行重传率作为当前指标,然后继续确定WiFi MAC层上行重传率的目标值是否超出对应的指标阈值。As an example, there are four evaluation indicators corresponding to the live broadcast business scenario of "Huya". These four evaluation indicators are TCP RTT, downlink rate (TCP+UDP), TCP downlink retransmission rate, and WiFi MAC layer uplink retransmission rate. After traversing the TCP RTT, the downlink rate (TCP+UDP) and the TCP downlink retransmission rate respectively, the flow-level path management component determines that the uplink retransmission rate of the WiFi MAC layer has not been traversed. At this point, the flow-level path management component may take the uplink retransmission rate of the WiFi MAC layer as a current indicator, and then continue to determine whether the target value of the uplink retransmission rate of the WiFi MAC layer exceeds the corresponding indicator threshold.
作为另一个示例,如果流级路径管理组件确定TCP RTT、下行速率(TCP+UDP)、TCP下行重传率以及WiFi MAC层上行重传率均已完成遍历,则获取下一个周期的数据流,并将其作为目标数据流,重复执行上述的网络通信质量判断操作。As another example, if the flow-level path management component determines that the TCP RTT, downlink rate (TCP+UDP), TCP downlink retransmission rate, and WiFi MAC layer uplink retransmission rate have all completed traversal, then obtain the data flow of the next cycle, And take it as the target data stream, and repeat the above-mentioned network communication quality judgment operation.
步骤S10:流级路径管理组件判断当前指标的投票标记是否为空。Step S10: The flow-level path management component judges whether the voting mark of the current indicator is empty.
本申请实施例中,流级路径管理组件在确定当前指标的目标值未超出对应的指标阈值时,可以判断当前指标的投票标记是否为空。其中,投票标记为空指的是当前指标没有投票。如果当前指标的投票标记为空,则确定每个评估指标是否均完成遍历,即进入步骤S09。另外,如果当前指标的投票标记为非空,即当前指标已经投票,流级路径管理组件则确定当前指标的投票时间是否已超过指定时长,即进入步骤S11。In the embodiment of the present application, when the flow-level path management component determines that the target value of the current indicator does not exceed the corresponding indicator threshold, it may determine whether the voting mark of the current indicator is empty. Among them, the voting mark is empty means that there is no voting for the current indicator. If the voting mark of the current indicator is empty, it is determined whether each evaluation indicator has been traversed, that is, enter step S09. In addition, if the voting mark of the current indicator is not empty, that is, the current indicator has already voted, the flow-level path management component determines whether the voting time of the current indicator has exceeded the specified time, that is, enters step S11.
步骤S11:流级路径管理组件确定当前指标的投票时间是否已超过指定时长。Step S11: The flow-level path management component determines whether the voting time of the current index has exceeded the specified time.
通过上述介绍知道,每次投票之后,流级路径管理组件均可以记录当前指标投票的时间,并且流级路径管理组件也可以存储有历史投票时间。为了保证网络切换的准确性,在确定当前指标已经投票之后,流级路径管理组件可以确定该指标的投票时间是否已超过指定时长。其中,指定时长可以为3秒。Through the above introduction, we know that after each vote, the flow-level path management component can record the time of the current index vote, and the flow-level path management component can also store the historical voting time. In order to ensure the accuracy of network switching, after determining that the current indicator has been voted, the flow-level path management component can determine whether the voting time of the indicator has exceeded the specified time. Wherein, the specified duration may be 3 seconds.
如果当前指标的投票时间已超过指定时长,流级路径管理组件则可以去除当前指标的投票标记,即进入步骤S12。另外,如果当前指标的投票时间未超过指定时长,流级路径管理组件则可以确定每个评估指标是否均完成遍历,即进入步骤S09。If the voting time of the current indicator has exceeded the specified time, the flow-level path management component may remove the voting mark of the current indicator, that is, enter step S12. In addition, if the voting time of the current indicator does not exceed the specified time, the flow-level path management component can determine whether each evaluation indicator has been traversed, that is, enter step S09.
作为一个示例,通过流级路径管理组件判断出当前指标TCP RTT的目标值未超出门限,并确定出当前指标TCP RTT之前已经投票。此时,流级路径管理组件可以判断之前投票的时间至当前时间的时长是否超出3秒,如果没有超出3秒,则进入步骤S09。如果超出3秒,则可以去除当前指标的投票标记。As an example, the flow-level path management component determines that the target value of the current indicator TCP RTT does not exceed the threshold, and determines that the current indicator TCP RTT has voted before. At this point, the flow-level path management component can judge whether the time from the previous voting time to the current time exceeds 3 seconds, and if not, proceed to step S09. If it exceeds 3 seconds, the voting mark of the current indicator can be removed.
需要说明的是,指定时长内可以包括多个周期,且每个周期内不同的评估指标超出对应的门限时均可以对应设置有投票标记。例如,指定时长为3s,包括6个周期,每个周期的时长为500ms。It should be noted that the specified duration can include multiple periods, and when different evaluation indicators in each period exceed the corresponding threshold, corresponding voting marks can be set. For example, the specified duration is 3s, including 6 cycles, and the duration of each cycle is 500ms.
步骤S12:流级路径管理组件去除当前指标的投票标记。Step S12: The flow-level path management component removes the voting mark of the current indicator.
本申请实施例中,去除当前指标的投票标记可以是将当前指标的投票记录初始化为零,即流级路径管理组件去除掉当前指标之前设置的投票标记。In this embodiment of the present application, removing the voting mark of the current index may be to initialize the voting record of the current index to zero, that is, the flow-level path management component removes the voting mark set before the current index.
作为一种方式,通过上述投票流程,流级路径管理组件可以得到投票结果,该投票结果可以包括:零票、一票以及两票。流级路径管理组件在获取到投票结果后,其可以基于投票结果获取到当前网络的通信质量的情况。具体的,当投票结果为零票或者是一票时,对应的网络的通信质量的情况为优(Good);当投票结果为两票时,对应的通信质量为卡顿(Bad)。As a manner, through the above voting process, the flow-level path management component may obtain a voting result, and the voting result may include: zero votes, one vote, and two votes. After the flow-level path management component obtains the voting result, it can obtain the communication quality of the current network based on the voting result. Specifically, when the voting result is zero votes or one vote, the communication quality of the corresponding network is good (Good); when the voting result is two votes, the corresponding communication quality is bad.
为了更清楚的理解投票的过程本申请实施例给出了如图8所示的示例图。通过图8可以看出“虎牙”的直播业务场景对应的评估指标可以有4个,分别是TCP RTT、下行速率(TCP+UDP)、TCP下行重传率以及WiFi MAC层上行重传率。In order to understand the voting process more clearly, the embodiment of this application provides an example diagram as shown in FIG. 8 . From Figure 8, it can be seen that there are four evaluation indicators corresponding to the live broadcast business scenario of "Huya", namely TCP RTT, downlink rate (TCP+UDP), TCP downlink retransmission rate, and WiFi MAC layer uplink retransmission rate.
作为一种方式,指定时长可以包括多个周期,在该指定时长内如果不同评估指标在不同周期内设置有投票标记,且投票标记的数量超出数量阈值,则确定网络的通信质量为Bad(卡顿)。如图8所示的A是TCP RTT在第一指定时长的第一周期内的值超出其对应的门限值时产生的投票标记。如图8所示的B是下行速率(TCP+UDP)在第一指定时长的第二周期内的值超出其对应的门限值时产生的投票标记。可见,此时的投票标记达到数量阈值两票,确定确定网络的通信质量为Bad(卡顿)。As a method, the specified duration can include a plurality of cycles, and if different evaluation indicators are provided with voting marks in different cycles within the specified duration, and the number of voting marks exceeds the threshold value, then it is determined that the communication quality of the network is Bad (card pause). A as shown in FIG. 8 is a voting mark generated when the value of the TCP RTT in the first cycle of the first specified time exceeds its corresponding threshold value. B shown in FIG. 8 is a voting mark generated when the value of the downlink rate (TCP+UDP) in the second period of the first specified time exceeds its corresponding threshold value. It can be seen that the voting mark at this time reaches the threshold of two votes, and it is determined that the communication quality of the network is Bad (stuck).
作为另一种方式,在指定时长内如果仅有一个评估指标设置有投票标记,则确定网络的通信质量为Good(优)。如图8所示的C是下行速率(TCP+UDP)在第二指定时长的第一周期内的值超出其对应的门限值时产生的投票标记。可见,此时的投票标记未达到数量阈值两票,确定确定网络的通信质量为Good(优)。As another way, if only one evaluation indicator is set with a voting mark within a specified time period, it is determined that the communication quality of the network is Good (excellent). C shown in FIG. 8 is a voting mark generated when the value of the downlink rate (TCP+UDP) in the first cycle of the second specified time exceeds its corresponding threshold. It can be seen that the voting mark at this time does not reach the quantity threshold of two votes, and it is determined that the communication quality of the network is Good (excellent).
作为另一种方式,在指定时长内如果不同评估指标在同一周期内设置有投票标记,且投票标记超出数量阈值,则确定网络的通信质量为Bad(卡顿)。如图8所示的D是TCPRTT在第三指定时长的第一周期内的值超出其对应的门限值时产生的投票标记。如图8所示的E是下行速率(TCP+UDP)在第三指定时长的第一周期内的值超出其对应的门限值时产生的投票标记。可见,此时的投票标记达到数量阈值两票,确定确定网络的通信质量为Bad(卡顿)。As another way, if different evaluation indicators are set with voting marks in the same period within a specified period of time, and the number of voting marks exceeds a threshold, it is determined that the communication quality of the network is Bad (stuck). D as shown in FIG. 8 is a voting mark generated when the value of TCPRTT in the first cycle of the third designated time exceeds its corresponding threshold value. E shown in FIG. 8 is a voting mark generated when the value of the downlink rate (TCP+UDP) in the first cycle of the third specified time exceeds its corresponding threshold value. It can be seen that the voting mark at this time reaches the threshold of two votes, and it is determined that the communication quality of the network is Bad (stuck).
作为另一种方式,在指定时长内如果同一评估指标在同一周期内设置有多个投票标记,且投票标记超出数量阈值,则确定网络的通信质量为Bad(卡顿)。如图8所示的F是WiFi MAC层上行重传率在第四指定时长的第一周期内的值既超出其对应的第一门限,又超出其对应的第二门限时产生的投票标记。可见,此时的投票标记达到数量阈值两票,确定确定网络的通信质量为Bad(卡顿)。As another way, if the same evaluation indicator is set with multiple voting marks in the same period within a specified period of time, and the voting marks exceed the number threshold, it is determined that the communication quality of the network is Bad (stuck). F shown in FIG. 8 is a voting mark generated when the value of the uplink retransmission rate of the WiFi MAC layer in the first period of the fourth specified time exceeds both the corresponding first threshold and the corresponding second threshold. It can be seen that the voting mark at this time reaches the threshold of two votes, and it is determined that the communication quality of the network is Bad (stuck).
换句话说,如果WiFi MAC层上行重传率严重恶化则可以直接投两票,并确定网络通信质量为Bad(卡顿)。具体的,流级路径管理组件可以确定WiFi MAC层上行重传率的值是否超出其对应的门限2,若超出,则确定WiFi MAC层上行重传率严重恶化,此时确定网络的通信质量为Bad(卡顿)。In other words, if the uplink retransmission rate of the WiFi MAC layer deteriorates seriously, two votes can be cast directly, and the network communication quality can be determined as Bad (stuck). Specifically, the flow-level path management component can determine whether the value of the uplink retransmission rate of the WiFi MAC layer exceeds its corresponding threshold 2. If it exceeds, it is determined that the uplink retransmission rate of the WiFi MAC layer is seriously deteriorated. At this time, the communication quality of the network is determined to be Bad (Carton).
为了保证用户的使用体验,在确定网络的通信质量为Bad(卡顿)时,本申请实施例则可以将电子设备的网络从Wi-Fi网络切换至蜂窝网络,即执行网络切换操作。In order to ensure user experience, when the communication quality of the network is determined to be Bad (stuck), the embodiment of the present application may switch the network of the electronic device from the Wi-Fi network to the cellular network, that is, perform a network switching operation.
需要说明的是,在指定时长内如果多个评估指标中仅有一个评估指标投出1票或者是0票时,则确定网络的通信质量为Good。其中,指定时间段可以为3s。例如,在3s内,仅有TCP下行重传率投出1票,此时判定出网络的通信质量为Good。It should be noted that, within a specified period of time, if only one of the multiple evaluation indicators casts 1 vote or 0 vote, it is determined that the communication quality of the network is Good. Wherein, the specified time period may be 3s. For example, within 3s, only the TCP downlink retransmission rate casts 1 vote, and at this time it is determined that the communication quality of the network is Good.
综上所述,投票的评估指标可以属于不同周期内,如图8所示的A和B。另外,投票的不同评估指标也可以是属于同一周期内,如图8中的D和E属于同一周期内。并且,同一评估指标如果在指定时长内的不同周期投有两票,也可以确定网络的通信质量为Bad(卡顿)。To sum up, the evaluation indicators of voting can belong to different periods, as shown in Figure 8 A and B. In addition, different evaluation indicators of voting may also belong to the same period, for example, D and E in Fig. 8 belong to the same period. Moreover, if the same evaluation indicator casts two votes in different periods within a specified time period, it can also be determined that the communication quality of the network is Bad (stuck).
需要说明的是,本申请实施例中的票数门限是可配的,其可以是两票,也可以是多于两票。例如,票数门限也可以为3票或者更多。票数门限具体设置为多少,这里不进行明确限制,可以根据实际情况进行选择。It should be noted that the vote threshold in this embodiment of the application is configurable, and it may be two votes or more than two votes. For example, the vote threshold may also be 3 votes or more. There is no specific limit on how many votes the threshold is set to, and it can be selected according to the actual situation.
本申请实施例中,流级路径管理组件在确定网络的通信质量为卡顿时,确定切换网络,即将电子设备当前的网络从Wi-Fi网络切换至蜂窝网络。In the embodiment of the present application, when the stream-level path management component determines that the communication quality of the network is stuck, it determines to switch the network, that is, switches the current network of the electronic device from the Wi-Fi network to the cellular network.
在执行网络切换操作时,流级路径管理组件可以确定当前是否存在备用网络,如果不存在备用网络,流级路径管理组件可以向通道级路径管理组件发送备用路径的请求消息。其中,备用网络可以为蜂窝网络。When performing a network switching operation, the flow-level path management component can determine whether there is a backup network. If there is no backup network, the flow-level path management component can send a backup path request message to the channel-level path management component. Wherein, the standby network may be a cellular network.
作为一种方式,通道级路径管理组件接收到该备用路径的请求消息后,开始查找当前使用的主用网络以外的其他可用且质量最好的网络,并将查找到的网络作为备用在确定备用网络之后,通道级路径管理组件可以向网络连接管理组件发送启用备用网络的请求。As a method, after receiving the request message of the backup path, the channel-level path management component starts to search for other available and best-quality networks other than the currently used active network, and uses the found network as a backup when determining the backup path After the network, the channel-level path management component can send a request to enable the backup network to the network connection management component.
另外,网络连接管理组件接收到备用网络的启用请求后,将备用网络从休眠状态切换为唤醒状态。在此基础上,网络连接管理组件可以向通道级路径管理组件发送备用网络已经被唤醒的消息。在此基础上,通道级路径管理组件可以将备用网络发送至流级路径管理组件。In addition, after receiving the activation request of the standby network, the network connection management component switches the standby network from a sleep state to a wake-up state. On this basis, the network connection management component may send a message that the standby network has been awakened to the channel-level path management component. On this basis, the channel-level path management component can send the backup network to the flow-level path management component.
作为一种方式,流级路径管理组件在获取到备用网络后可以将该备用网络通过流级策略管理组件传输至策略执行组件,以通过策略执行组件将电子设备的网络从当前网络切换至备用网络。具体的,将电子设备的网络从Wi-Fi网络切换至蜂窝网络。As a method, after obtaining the standby network, the flow-level path management component can transmit the standby network to the policy enforcement component through the flow-level policy management component, so as to switch the network of the electronic device from the current network to the standby network through the policy enforcement component . Specifically, switch the network of the electronic device from the Wi-Fi network to the cellular network.
在另一些实施方式中,如果流级管理组件在确定当前存在备用网络时,则可以不再请求获取备用网络的路径,而是直接将其存储的备用网络发送至流及策略执行组件,以将电子设备的网络切换到备用网络。In some other implementations, if the flow-level management component determines that there is a backup network, it may no longer request to obtain the path of the backup network, but directly sends the stored backup network to the flow and policy execution component, so that The network of the electronic device is switched to the backup network.
在另一些实施方式中,在确定执行网络切换操作时,本申请实施例也可以输出提示信息,以通过该提示信息提示用户当前的网络已从Wi-Fi网络切换至蜂窝网络。为了更清楚的理解网络切换以及提示的过程,本申请实施例给出如图9a~图9c所示的示例图。通过图9a可以看出电子设备上可以安装有多个应用程序,这些应用程序可以包括时钟、日历、图库、浏览器以及“虎牙”等。In some other implementation manners, when it is determined to perform the network switching operation, the embodiment of the present application may also output prompt information, so as to remind the user that the current network has been switched from the Wi-Fi network to the cellular network through the prompt information. In order to understand the process of network switching and prompting more clearly, the embodiment of the present application provides example diagrams as shown in FIG. 9a to FIG. 9c. It can be seen from FIG. 9a that multiple application programs can be installed on the electronic device, and these application programs can include a clock, a calendar, a gallery, a browser, and "Huya".
可选的,当用户点击应用程序“虎牙”的图标时,其便可以打开该应用程序,而后电子设备的显示界面便可以从图9a跳转至图9b,图9b为用户直播的视频界面,该视频界面可以包括用户的粉丝数量、人气数量、直播的时间以及表情等控件。在此过程中,应用级策略管理组件可以指示流量上报组件开始对“虎牙”的数据流进行监听。另外,流量上报组件在对“虎牙”进行监听的过程中,可以周期性的将监听到的数据流上报至流级路径管理组件。Optionally, when the user clicks on the icon of the application "Huya", it can open the application, and then the display interface of the electronic device can jump from Figure 9a to Figure 9b, Figure 9b is the user's live video interface, The video interface may include controls such as the number of fans of the user, the number of popularity, the time of the live broadcast, and expressions. During this process, the application-level policy management component can instruct the traffic reporting component to start monitoring the data flow of "Huya". In addition, the traffic reporting component can periodically report the monitored data flow to the flow-level path management component in the process of monitoring "Huya".
流级路径管理组件在接收到流量上报组件传输的与“虎牙”相关的目标数据流后,可以从目标数据流中选出“虎牙”对应的多个评估指标的值。在此基础上,流级路径管理组件可以基于这些评估指标的值综合确定是否执行网络切换操作。具体的,如果确定网络的通信质量为卡顿,则执行网络切换操作。After the stream-level path management component receives the target data stream related to "Huya" transmitted by the traffic reporting component, it can select the values of multiple evaluation indicators corresponding to "Huya" from the target data stream. On this basis, the flow-level path management component can comprehensively determine whether to perform a network switching operation based on the values of these evaluation indicators. Specifically, if it is determined that the communication quality of the network is stalled, a network switching operation is performed.
另外,策略执行组件在执行完网络切换操作后,为了保证用户的使用体验,在将电子设备的网络从Wi-Fi网络切换至蜂窝网络后,可以输出提示信息。具体的,策略执行组件可以将成功执行切换操作的结果返回至流级路径管理组件,流级路径管理组件则可以向服务层发送提示信息的显示请求,服务层的视图系统可以基于该请求控制电子设备显示出如图9c所示的界面。In addition, after executing the network switching operation, the policy execution component may output prompt information after switching the network of the electronic device from the Wi-Fi network to the cellular network in order to ensure user experience. Specifically, the policy execution component can return the result of successfully executing the switching operation to the flow-level path management component, and the flow-level path management component can send a display request for prompt information to the service layer, and the view system of the service layer can control the electronic system based on the request. The device displays an interface as shown in Figure 9c.
换句话说,在执行网络切换操作之后,本申请实施例可以输出如图9c所示的网络切换提示框,通过该网络切换提示框告知用户电子设备已从无线网络切换至蜂窝网络。本申请实施例中的提示信息仅为示例,电子设备也可以通过浮窗、震动或者语音等中的一种或者多种方式输出提示信息。In other words, after the network switching operation is performed, the embodiment of the present application may output a network switching prompt box as shown in FIG. 9c, through which the user is notified that the electronic device has switched from the wireless network to the cellular network. The prompt information in the embodiment of the present application is only an example, and the electronic device may also output the prompt information through one or more ways of floating window, vibration, or voice.
本申请另一实施例,为了保证网络切换的准确性,电子设备在获取到备用网络的路径时,其也可以将当前网络与备用网络进行比较。本实施中的流级路径管理组件在接收到通道级路径管理组件传输的备用网络时,可以确定备用网络的通信质量是否优于当前网络的通信质量,如果优于,执行网络切换操作。In another embodiment of the present application, in order to ensure the accuracy of network switching, when the electronic device obtains the path of the backup network, it may also compare the current network with the backup network. When the flow-level path management component in this implementation receives the backup network transmitted by the channel-level path management component, it can determine whether the communication quality of the backup network is better than that of the current network, and if so, perform network switching operations.
另外,如果当前网络的通信质量优于备用网络,则表示备用网络的通信质量更差,即使当前网络比较差,也没有切换的必要。In addition, if the communication quality of the current network is better than that of the standby network, it means that the communication quality of the standby network is worse, and even if the current network is relatively poor, there is no need to switch.
在另一些实施方式中,执行网络切换的组件也可以为流量感知组件。具体的,流量感知组件在接收到流量上报组件传输的目标应用程序的目标数据流后,其可以从目标数据流中选出多个评估指标的值,然后基于多个评估指标的值,综合确定电子设备的通信网络是否出现卡顿的情况。如果确定网络的通信质量为卡顿,流量感知组件则可以指示策略执行组件执行网络的切换操作。In some other implementation manners, the component performing network switching may also be a flow sensing component. Specifically, after the traffic sensing component receives the target data stream of the target application transmitted by the traffic reporting component, it can select the values of multiple evaluation indicators from the target data stream, and then comprehensively determine the Whether the communication network of the electronic device is stuck. If it is determined that the communication quality of the network is stalled, the traffic sensing component may instruct the policy enforcement component to perform a network switching operation.
需要说明的是,如果目标应用程序对应的业务场景是多个,则目标数据流是当前运行的业务场景对应的数据。如果目标应用程序对应的业务不是多个,则目标数据流可以是目标应用程序对应的数据。It should be noted that, if there are multiple business scenarios corresponding to the target application program, the target data flow is the data corresponding to the currently running business scenario. If there are not multiple services corresponding to the target application, the target data flow may be data corresponding to the target application.
可以理解的是,电子设备为了实现上述功能,其包含了执行各个功能相应的硬件和/或软件模块。结合本文中所公开的实施例描述的各示例的算法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。本领域技术人员可以结合实施例对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。It can be understood that, in order to realize the above functions, the electronic device includes hardware and/or software modules corresponding to each function. Combining the algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed by hardware or computer software drives hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions in combination with the embodiments for each specific application, but such implementation should not be regarded as exceeding the scope of the present application.
本实施例还提供一种计算机存储介质,该计算机存储介质中存储有计算机指令,当该计算机指令在电子设备上运行时,使得电子设备执行上述相关方法步骤实现上述实施例中的网络切换方法。This embodiment also provides a computer storage medium, in which computer instructions are stored, and when the computer instructions are run on the electronic device, the electronic device is made to execute the above related method steps to implement the network switching method in the above embodiment.
本实施例还提供了一种计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行上述相关步骤,以实现上述实施例中的网络切换方法。This embodiment also provides a computer program product, which, when running on a computer, causes the computer to execute the above related steps, so as to implement the network switching method in the above embodiment.
另外,本申请的实施例还提供一种装置,这个装置具体可以是芯片,组件或模块,该装置可包括相连的处理器和存储器;其中,存储器用于存储计算机执行指令,当装置运行时,处理器可执行存储器存储的计算机执行指令,以使芯片执行上述各方法实施例中的网络切换方法。In addition, an embodiment of the present application also provides a device, which may specifically be a chip, a component or a module, and the device may include a connected processor and a memory; wherein the memory is used to store computer-executable instructions, and when the device is running, The processor can execute the computer-executable instructions stored in the memory, so that the chip executes the network switching methods in the above method embodiments.
其中,本实施例提供的电子设备、计算机存储介质、计算机程序产品或芯片均用于执行上文所提供的对应的方法,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。Wherein, the electronic device, computer storage medium, computer program product or chip provided in this embodiment is all used to execute the corresponding method provided above, therefore, the beneficial effects it can achieve can refer to the corresponding method provided above The beneficial effects in the method will not be repeated here.
通过以上实施方式的描述,所属领域的技术人员可以了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。Through the description of the above embodiments, those skilled in the art can understand that for the convenience and brevity of the description, only the division of the above-mentioned functional modules is used as an example for illustration. In practical applications, the above-mentioned functions can be allocated by different Completion of functional modules means that the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed devices and methods may be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or It may be integrated into another device, or some features may be omitted, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。A unit described as a separate component may or may not be physically separated, and a component shown as a unit may be one physical unit or multiple physical units, which may be located in one place or distributed to multiple different places. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
本申请各个实施例的任意内容,以及同一实施例的任意内容,均可以自由组合。对上述内容的任意组合均在本申请的范围之内。Any content of each embodiment of the present application, as well as any content of the same embodiment, can be freely combined. Any combination of the above contents is within the scope of the present application.
集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If an 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 readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the software product is stored in a storage medium Among them, several instructions are included to make a device (which may be a single-chip microcomputer, a chip, etc.) or a processor (processor) execute all or part of the steps of the methods in various embodiments of the present application. The above-mentioned storage medium includes: U disk, mobile hard disk, read only memory (read only memory, ROM), random access memory (random access memory, RAM), magnetic disk or optical disk and other various media that can store program codes.
上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请。The embodiments of the present application have been described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementations. The above-mentioned specific implementations are only illustrative and not restrictive. Those of ordinary skill in the art will Under the inspiration of this application, without departing from this application.
Claims (25)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210019678.9A CN116456405A (en) | 2022-01-10 | 2022-01-10 | Network switching method and electronic equipment |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210019678.9A CN116456405A (en) | 2022-01-10 | 2022-01-10 | Network switching method and electronic equipment |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN116456405A true CN116456405A (en) | 2023-07-18 |
Family
ID=87127797
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202210019678.9A Pending CN116456405A (en) | 2022-01-10 | 2022-01-10 | Network switching method and electronic equipment |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN116456405A (en) |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20070165572A1 (en) * | 2004-02-10 | 2007-07-19 | Forward Information Technologies Sa | Method and system for seamless handover of mobile devices in heterogeneous networks |
| CN110798869A (en) * | 2018-08-02 | 2020-02-14 | 华为技术有限公司 | Network switching method, electronic equipment and chip subsystem |
| CN112469099A (en) * | 2020-11-25 | 2021-03-09 | 维沃移动通信有限公司 | Networking control method, networking control device, electronic equipment and storage medium |
| CN112996063A (en) * | 2019-12-18 | 2021-06-18 | 中国移动通信集团四川有限公司 | Network switching method and server |
-
2022
- 2022-01-10 CN CN202210019678.9A patent/CN116456405A/en active Pending
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20070165572A1 (en) * | 2004-02-10 | 2007-07-19 | Forward Information Technologies Sa | Method and system for seamless handover of mobile devices in heterogeneous networks |
| CN110798869A (en) * | 2018-08-02 | 2020-02-14 | 华为技术有限公司 | Network switching method, electronic equipment and chip subsystem |
| CN112996063A (en) * | 2019-12-18 | 2021-06-18 | 中国移动通信集团四川有限公司 | Network switching method and server |
| CN112469099A (en) * | 2020-11-25 | 2021-03-09 | 维沃移动通信有限公司 | Networking control method, networking control device, electronic equipment and storage medium |
Non-Patent Citations (1)
| Title |
|---|
| 白晓东;郭菊;: "异构网络TCP性能优化研究", 实验室研究与探索, no. 01, 15 January 2018 (2018-01-15) * |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN113795040B (en) | Channel switching method, electronic device and storage medium | |
| EP4216501B1 (en) | Method for switching channels, electronic device, and storage medium | |
| CN113810938B (en) | Channel switching method, electronic device and storage medium | |
| US12501366B2 (en) | State control method and communication device | |
| CN115484649B (en) | Channel switching method, electronic device and storage medium | |
| US12199913B2 (en) | Control resource set processing method, device, and computer storage medium | |
| CN116709368B (en) | Network acceleration method and device | |
| US20250175816A1 (en) | Network acceleration method and apparatus | |
| CN116709442A (en) | A kind of wireless network switching method and electronic equipment | |
| CN113890905B (en) | Channel switching method, electronic device and storage medium | |
| CN115002797B (en) | Network quality detection method and related electronic equipment | |
| CN116744329A (en) | A network acceleration method and electronic device | |
| CN117939661A (en) | Access control method, device, communication equipment and medium | |
| CN116456405A (en) | Network switching method and electronic equipment | |
| CN116709369B (en) | Network acceleration method and electronic device | |
| CN108156653B (en) | Data transmission method and device | |
| CN113810965B (en) | Channel switching method, electronic device and storage medium | |
| RU2802678C1 (en) | Channel switching method, electronic device and storage medium | |
| CN117915356B (en) | A network acceleration method and apparatus | |
| HK40068161B (en) | Channel switching method, electronic device and storage medium | |
| HK40068161A (en) | Channel switching method, electronic device and storage medium | |
| CN116709367A (en) | A network acceleration method and device | |
| CN119383673A (en) | Application bandwidth control method and electronic device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| CB02 | Change of applicant information | ||
| CB02 | Change of applicant information |
Country or region after: China Address after: Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040 Applicant after: Honor Terminal Co.,Ltd. Address before: 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong Applicant before: Honor Device Co.,Ltd. Country or region before: China |