CN106851592B - Method, device and terminal for adjusting broadcast receiver - Google Patents
Method, device and terminal for adjusting broadcast receiver Download PDFInfo
- Publication number
- CN106851592B CN106851592B CN201710140530.XA CN201710140530A CN106851592B CN 106851592 B CN106851592 B CN 106851592B CN 201710140530 A CN201710140530 A CN 201710140530A CN 106851592 B CN106851592 B CN 106851592B
- Authority
- CN
- China
- Prior art keywords
- broadcast
- broadcast receiver
- historical
- receivers
- receiver
- 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.)
- Expired - Fee Related
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/06—Selective distribution of broadcast services, e.g. multimedia broadcast multicast service [MBMS]; Services to user groups; One-way selective calling services
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Telephonic Communication Services (AREA)
- Circuits Of Receivers In General (AREA)
Abstract
Description
技术领域technical field
本发明涉及终端技术领域,尤其涉及一种广播接收者的调整方法、装置及终端。The present invention relates to the technical field of terminals, and in particular, to a broadcast receiver adjustment method, device and terminal.
背景技术Background technique
Android系统中广播是一种广泛运用在应用程序之间传输信息的机制,Android中的广播用于监听系统事件或应用程序事件。Broadcasting in the Android system is a mechanism widely used to transmit information between applications. Broadcasting in Android is used to monitor system events or application events.
在Android系统中,一些应用在后台通过接收各种各样的广播消息进行自启动或者执行其他操作。在一些应用接收广播消息时,由于应用本身可能在执行一些耗时的操作或者应用本身出现卡顿的情况,导致接收到的广播消息无法及时处理,甚至有些应用对广播消息还会超时处理,影响广播消息的后续分发,使系统稳定性差。In the Android system, some applications perform self-starting or perform other operations by receiving various broadcast messages in the background. When some applications receive broadcast messages, because the application itself may be performing some time-consuming operations or the application itself is stuck, the received broadcast messages cannot be processed in time, and some applications may even process the broadcast messages over time, which affects Subsequent distribution of broadcast messages makes the system less stable.
发明内容SUMMARY OF THE INVENTION
本发明实施例提供一种广播接收者的调整方法、装置及终端,可以提高广播消息的处理效率,保障系统稳定性。Embodiments of the present invention provide a broadcast receiver adjustment method, device, and terminal, which can improve the processing efficiency of broadcast messages and ensure system stability.
第一方面,本发明实施例提供了一种广播接收者的调整方法,包括:In a first aspect, an embodiment of the present invention provides a method for adjusting a broadcast receiver, including:
获取广播接收者处理广播消息的历史参数或者广播接收者的类型;Get the history parameters of the broadcast receiver processing the broadcast message or the type of the broadcast receiver;
基于获取的所述历史参数或者所述类型将所述广播接收者划分等级;Ranking the broadcast recipients based on the acquired historical parameters or the types;
基于划分的等级对所述广播接收者进行调整。The broadcast recipients are adjusted based on the classified level.
第二方面,本发明实施例还提供了一种广播接收者的调整装置,包括:In a second aspect, an embodiment of the present invention further provides an apparatus for adjusting a broadcast receiver, including:
获取模块,用于获取广播接收者处理广播消息的历史参数或者广播接收者的类型;The acquisition module is used to acquire the historical parameters of the broadcast receiver's processing of the broadcast message or the type of the broadcast receiver;
划分模块,用于基于获取的所述历史参数或者所述类型将所述广播接收者划分等级;a dividing module, configured to divide the broadcast receivers into ranks based on the acquired historical parameters or the types;
调整模块,用于基于划分的等级对所述广播接收者进行调整。An adjustment module, configured to adjust the broadcast receiver based on the divided level.
第三方面,本发明实施例还提供了一种终端,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现以下步骤:In a third aspect, an embodiment of the present invention also provides a terminal, including a memory, a processor, and a computer program stored in the memory and running on the processor, where the processor implements the following steps when executing the computer program:
获取广播接收者处理广播消息的历史参数或者广播接收者的类型;Get the history parameters of the broadcast receiver processing the broadcast message or the type of the broadcast receiver;
基于获取的所述历史参数或者所述类型将所述广播接收者划分等级;Ranking the broadcast recipients based on the acquired historical parameters or the types;
基于划分的等级对所述广播接收者进行调整。The broadcast recipients are adjusted based on the classified level.
本发明实施例提供的技术方案,通过广播接收者处理广播消息的历史参数或者广播接收者的类型将广播接收者划分等级,并根据等级对广播接收者进行调整,可以提高广播消息的处理效率,保障系统稳定性。According to the technical solution provided by the embodiments of the present invention, the broadcast receivers are classified into grades according to the historical parameters of the broadcast receivers processing the broadcast messages or the types of the broadcast receivers, and the broadcast receivers are adjusted according to the grades, which can improve the processing efficiency of the broadcast messages. Ensure system stability.
附图说明Description of drawings
通过阅读参照以下附图所作的对非限制性实施例所作的详细描述,本发明的其它特征、目的和优点将会变得更明显:Other features, objects and advantages of the present invention will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:
图1是本发明一个实施例提供的一种广播接收者的调整方法流程图;1 is a flowchart of a method for adjusting a broadcast receiver provided by an embodiment of the present invention;
图2是本发明一个实施例提供的一种广播接收者的调整方法流程图;2 is a flowchart of a method for adjusting a broadcast receiver provided by an embodiment of the present invention;
图3是本发明一个实施例提供的一种广播接收者的调整方法流程图;3 is a flowchart of a method for adjusting a broadcast receiver provided by an embodiment of the present invention;
图4是本发明一个实施例提供的一种广播接收者的调整方法流程图;4 is a flowchart of a method for adjusting a broadcast receiver provided by an embodiment of the present invention;
图5是本发明一个实施例提供的一种广播接收者的调整方法流程图;5 is a flowchart of a method for adjusting a broadcast receiver provided by an embodiment of the present invention;
图6是本发明一个实施例提供的一种广播接收者的调整装置结构框图;6 is a structural block diagram of an apparatus for adjusting a broadcast receiver provided by an embodiment of the present invention;
图7是本发明一个实施例提供的一种终端的结构示意图。FIG. 7 is a schematic structural diagram of a terminal according to an embodiment of the present invention.
具体实施方式Detailed ways
下面结合附图和实施例对本发明作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释本发明,而非对本发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与本发明相关的部分而非全部内容。The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention, but not to limit the present invention. In addition, it should be noted that, for the convenience of description, the drawings only show some but not all of the contents related to the present invention.
图1是本发明一个实施例提供的一种广播接收者的调整方法流程图,所述方法由广播接收者的调整装置来执行,所述装置由软件和/或硬件来执行,所述装置配置在诸如手机等终端中。FIG. 1 is a flowchart of a method for adjusting a broadcast receiver provided by an embodiment of the present invention. The method is executed by an adjustment device of the broadcast receiver, and the device is executed by software and/or hardware. The device is configured with in terminals such as mobile phones.
如图1所示,本实施例提供的技术方案包括:As shown in Figure 1, the technical solution provided by this embodiment includes:
S110:获取广播接收者处理广播消息的历史参数或者广播接收者的类型。S110: Acquire historical parameters of the broadcast receiver for processing the broadcast message or the type of the broadcast receiver.
在广播处理过程中,广播发送者的服务进程通过调用广播发送函数(如sendBroadcast函数)将广播消息发送至广播管理模块(如ActivityManagerService,活动管理服务),广播管理模块接收到该广播消息后将其放入广播发送队列,广播管理模块通过进程通信机制(如Binder进程通信机制)将广播发送队列中的广播消息发送至符合接收条件的广播接收者。In the broadcast processing process, the service process of the broadcast sender sends the broadcast message to the broadcast management module (such as ActivityManagerService, activity management service) by calling the broadcast sending function (such as the sendBroadcast function), and the broadcast management module receives the broadcast message. Put it into the broadcast sending queue, and the broadcast management module sends the broadcast messages in the broadcast sending queue to the broadcast receivers that meet the receiving conditions through the process communication mechanism (such as the Binder process communication mechanism).
在广播机制中,广播消息指的是系统或者应用程序在运行过程中发送的,用于系统和/或应用程序之间传输的信息,示例性的,广播消息可以是系统启动广播消息、短信类广播消息、电话类广播消息或者三方应用类广播消息等。In the broadcast mechanism, the broadcast message refers to the information sent by the system or the application during the running process and used for transmission between the system and/or the application. Exemplarily, the broadcast message may be a system startup broadcast message, a short message, etc. Broadcast messages, telephony broadcast messages, or three-party application broadcast messages, etc.
其中,广播接收者处理广播消息的历史参数包括处理广播消息的历史超时次数、处理广播消息的历史时间,处理广播消息累加的历史超时时间或者处理广播消息对应的动态时间阈值,其中,动态时间阈值用于判断处理广播消息是否超时。并且广播接收处理广播消息的历史参数并不局限于上述的参数形式。Among them, the historical parameters of the broadcast receiver processing the broadcast message include the historical timeout times of processing the broadcast message, the historical time of processing the broadcast message, the accumulated historical timeout time of processing the broadcast message or the dynamic time threshold corresponding to the processing of the broadcast message, wherein the dynamic time threshold Used to determine whether the processing of broadcast messages times out. And the history parameter of broadcast reception and processing broadcast message is not limited to the above parameter form.
其中,广播接收者处理广播消息的历史平均时间可以是广播接收者在预设时间段内处理广播消息的历史平均时间,或者也可以是广播接收者在预设次数内处理广播消息的历史平均时间。The historical average time for the broadcast receiver to process the broadcast message may be the historical average time for the broadcast receiver to process the broadcast message within a preset time period, or the historical average time for the broadcast receiver to process the broadcast message within a preset number of times. .
在预设时间段内,广播接收者可以处理一个广播消息,也可以处理多个广播消息,为了确定每个广播接收者处理广播消息的快慢,对预设时间段进行设置,以使广播接收者处理多个广播消息。在预设时间段内,获取广播接收者处理每个广播消息的时间。Within a preset time period, the broadcast receiver can process one broadcast message or multiple broadcast messages. In order to determine the speed at which each broadcast receiver processes the broadcast message, the Handle multiple broadcast messages. Get the time that the broadcast receiver processes each broadcast message within a preset time period.
其中,广播接收者处理广播消息的历史超时次数可以是广播接收者在预设时间段内或者预设次数内处理广播消息的历史超时次数。The number of historical timeouts for the broadcast receiver to process the broadcast message may be the number of historical timeouts for the broadcast receiver to process the broadcast message within a preset time period or within a preset number of times.
其中,历史超时时间是广播接收者在预设时间段内或者预设次数内处理广播消息的时间超出一设定时间阈值的时间,该设定时间阈值可以固定不变,也可以随超时次数的变化而变化。累加的历史超时时间是将每次超过一设定时间阈值的时间进行相加,并求和获得的时间。Among them, the historical timeout time is the time when the broadcast receiver processes the broadcast message within a preset time period or a preset number of times and exceeds a set time threshold. change with change. The accumulated historical timeout time is the time obtained by summing the time exceeding a set time threshold each time.
其中,动态时间阈值是指当广播接收者处理广播消息的时间大于动态时间阈值时,判断该广播接收者处理广播消息超时。其中,动态时间阈值基于初始设定值、历史超时次数以及时间增幅值进行确定,其中,时间增幅值为每增加设定数量的超时次数,动态时间阈值的增加量。The dynamic time threshold means that when the time for the broadcast receiver to process the broadcast message is greater than the dynamic time threshold, it is determined that the broadcast receiver has timed out processing the broadcast message. The dynamic time threshold is determined based on the initial setting value, the number of historical timeouts, and the time increment value, wherein the time increment value is the increment of the dynamic time threshold value for each additional set number of timeout times.
其中,广播接收者的类型包括系统、系统应用和三方应用。其中,广播接收者的类型还可以是其他的类型划分形式。The types of broadcast receivers include systems, system applications, and third-party applications. The types of broadcast receivers may also be other types of division forms.
S120:基于获取的所述历史参数或者所述类型将所述广播接收者划分等级。S120: Classify the broadcast recipients based on the acquired historical parameters or the types.
其中,基于获取的所述历史参数将所述广播接收者划分等级可以包括:基于获取的历史平均时间、历史超时次数、动态时间阈值或者累加的历史超时时间将广播接收者划分等级。Wherein, classifying the broadcast receivers based on the acquired historical parameters may include: classifying the broadcast receivers based on the acquired historical average time, the number of historical timeouts, the dynamic time threshold or the accumulated historical timeouts.
在将广播接收者划分等级之前,需要设置广播接收者的等级,并为等级配置对应的参数范围。其中,广播接收者的等级可以是一级、二级和三级,或者也可以为快速等级、中速等级和慢速等级。其中,以根据累加的历史超时时间将广播接收者划分等级为例进行说明,为广播接收者的等级配置的对应的处理广播消息累加的超时时间的范围。如,三级级对应的处理广播消息的累加的超时时间范围中的最大值、小于二级对应的处理广播消息的累加的超时时间范围中的最小值。二级对应的处理广播消息的超时时间范围中的最大值小于一级对应的处理广播消息的超时时间范围中的最小值。也就是说等级越高,累加的历史超时时间越短。Before classifying broadcast receivers into levels, you need to set the level of broadcast receivers and configure the corresponding parameter range for the level. Wherein, the classes of the broadcast receivers may be the first class, the second class and the third class, or may also be the fast class, the medium speed class and the slow speed class. Wherein, the classification of broadcast receivers according to the accumulated historical timeout time is taken as an example for description, and the range of the corresponding accumulated timeout time for processing broadcast messages is configured for the level of the broadcast receiver. For example, the maximum value in the accumulated timeout time range for processing broadcast messages corresponding to the third level is smaller than the minimum value in the accumulated timeout time range for processing broadcast messages corresponding to the second level. The maximum value in the timeout time range for processing broadcast messages corresponding to the second stage is smaller than the minimum value in the timeout time range for processing broadcast messages corresponding to the first stage. That is to say, the higher the level, the shorter the accumulated historical timeout time.
对于根据其他历史参数以及广播接收者的类型对广播接收者划分等级的方式在下述的实施例进行详细说明。The manner of classifying broadcast receivers according to other historical parameters and types of broadcast receivers will be described in detail in the following embodiments.
需要说明的是,广播接收者的等级还可以是其他形式,广播接收者的等级并不局限于上述的三个等级,还可以是四个以及其他数量的等级,可根据需要进行设定。It should be noted that the level of broadcast receivers may also be in other forms. The level of broadcast receivers is not limited to the above three levels, but may also be four or other levels, which can be set as required.
S130:基于划分的等级对所述广播接收者进行调整。S130: Adjust the broadcast receiver based on the divided level.
基于划分的等级对广播接收者进行调整可以包括:基于划分的等级调整广播接收者在广播接收者队列中的顺序;或者也可以包括基于划分的等级创建与等级对应的广播接收者队列,并将广播接收者移动到对应的广播接收者队列中。Adjusting the broadcast receivers based on the divided grades may include: adjusting the order of the broadcast receivers in the broadcast receiver queue based on the divided grades; or may also include creating a broadcast receiver queue corresponding to the grades based on the divided grades, and adding The broadcast receiver is moved to the corresponding broadcast receiver queue.
在本实施例中,对于注册了同一广播消息的广播接收者,广播接收者按照广播接收者队列的顺序处理广播消息。例如,对于熄屏广播消息,在终端内,注册熄屏广播消息的广播接收者是视频应用和音乐应用,并且处理熄屏广播消息的顺序依次是视频应用和音乐应用。视频应用和音乐应用按照队列的顺序对熄屏广播消息进行处理。In this embodiment, for broadcast receivers registered with the same broadcast message, the broadcast receiver processes the broadcast messages in the order of the broadcast receiver queue. For example, for the screen-off broadcast message, in the terminal, the broadcast receivers registered for the screen-off broadcast message are the video application and the music application, and the sequence of processing the screen-off broadcast message is the video application and the music application in sequence. Video apps and music apps process screen-off broadcast messages in queue order.
其中,基于划分的等级调整广播接收者在广播接收者队列中的顺序,可以包括:按照划分的等级从高到低的顺序将广播接收者在广播接收者队列中依次排序,以调整广播接收者处理广播消息的顺序。其中,划分等级从高到低的顺序依次为快速等级、中速等级和慢速等级;或者也可以是一级、二级和三级。Wherein, adjusting the order of the broadcast receivers in the broadcast receiver queue based on the divided grades may include: sorting the broadcast receivers in the broadcast receiver queue in descending order of the divided grades, so as to adjust the broadcast receivers The order in which broadcast messages are processed. Among them, the order of classification levels from high to low is fast level, medium speed level and slow level; or it may also be first level, second level and third level.
例如,注册了广播消息的广播接收者分别有A,B,C,其中划分的A的等级为慢速等级,划分的B的等级为快速等级,划分的C的等级为中速等级。将A,B,C三个广播接收者按照等级从高到低依次排序,排列的顺序是B,C,A,以使处理速度较快的B先处理广播消息,C和A依次分别再处理广播消息。由此,能够避免处理速度较慢的广播接收者对处理速度较快的广播接收者的影响,提高广播消息的处理效率。For example, the broadcast receivers registered with the broadcast message are A, B, and C, respectively, where A is classified as a slow class, B is classified as a fast class, and C is classified as a medium speed class. Sort the three broadcast receivers A, B, and C in descending order from high to low. The order is B, C, and A, so that B, which has a faster processing speed, processes the broadcast message first, and C and A process the broadcast messages in turn. broadcast message. Thereby, the influence of the broadcast receiver with the slow processing speed on the broadcast receiver with the fast processing speed can be avoided, and the processing efficiency of the broadcast message can be improved.
在上述实施例的基础上,对广播接收者进行调整的方法还包括:当同一等级的广播接收者的数量大于1个时,按照广播接收者在调整之前广播接收者队列中的先后顺序对同一等级的广播接收者进行排序。由此,能够使等级相同的广播接收者处理广播消息时保留原来的先后顺序,按照原来的先后顺序进行处理广播消息。On the basis of the above-mentioned embodiment, the method for adjusting broadcast receivers further includes: when the number of broadcast receivers of the same level is greater than one, adjusting the broadcast receivers in the order of the broadcast receivers in the broadcast receiver queue before adjustment The rank of broadcast receivers is sorted. In this way, it is possible to keep the original order when the broadcast receivers of the same level process the broadcast messages, and process the broadcast messages according to the original order.
例如,注册了同一广播消息的广播接收者分别有a,b,c和d,其中,b和d的等级均为快速等级,a的等级为慢速等级,c的等级为中速等级。按照等级从高到低调整广播接收者在广播接收者队列中的顺序,调整之后的顺序是b、d在c、a之前,c在a之前。其中,b和d为同一等级,在对b和d排序时,按照b和d在调整之前广播接收者队列中的先后顺序对b、d进行排序。在调整之前的广播接收者队列中,b在d之前,因此,处理广播消息的广播接收者的排序是b,d,c,a。For example, broadcast receivers registered with the same broadcast message are a, b, c, and d, respectively, where b and d are both fast, a is slow, and c is medium. Adjust the order of broadcast receivers in the broadcast receiver queue from high to low. The adjusted order is that b and d are before c and a, and c is before a. Among them, b and d are of the same level. When sorting b and d, sort b and d according to the order of b and d in the broadcast receiver queue before adjustment. In the broadcast receiver queue before adjustment, b comes before d, so the order of broadcast receivers processing broadcast messages is b, d, c, a.
需要说明的是,对于同一等级的广播接收者的数量大于1个,对同一等级的广播接收者的排序还可以采用其他的排序方式,并不局限于上述的方式。It should be noted that, if the number of broadcast receivers of the same level is greater than one, other sorting methods may also be used for the sorting of broadcast receivers of the same level, which are not limited to the above-mentioned methods.
其中,基于划分的等级创建与等级对应的广播接收者队列,并将广播接收者移动到对应的广播接收者队列中,可以理解为每个广播接收者队列中的广播接收者的等级相同,广播接收者队列的数量由划分的等级进行确定。例如,划分的等级为快速等级、中速等级和慢速等级,创建与快速等级、中速等级和慢速等级分别对应的三个广播接收者队列,并将广播接收者移动到对应的广播接收者队列中。通过该方法,能够提高广播消息的处理速度以及效率,保持系统的稳定性。Among them, the broadcast receiver queue corresponding to the level is created based on the divided level, and the broadcast receiver is moved to the corresponding broadcast receiver queue. It can be understood that the broadcast receivers in each broadcast receiver queue have the same level, and the broadcast receiver The number of recipient queues is determined by the level of division. For example, divide the classes into fast class, medium speed class and slow class, create three broadcast receiver queues corresponding to the fast class, medium speed class and slow class respectively, and move the broadcast receivers to the corresponding broadcast receivers in the queue. Through this method, the processing speed and efficiency of broadcast messages can be improved, and the stability of the system can be maintained.
本实施例中,通过广播接收者处理广播消息的历史参数或者广播接收者的类型将广播接收者划分等级,并根据等级对广播接收者进行调整,提高处理广播消息的效率,保障系统稳定性。In this embodiment, broadcast receivers are classified according to their historical parameters of processing broadcast messages or types of broadcast receivers, and broadcast receivers are adjusted according to the levels, thereby improving the efficiency of processing broadcast messages and ensuring system stability.
图2是本发明一个实施例提供的一种广播接收者的调整方法流程图,本实施例中,历史参数包括历史平均时间,所述基于获取的所述历史参数将所述广播接收者划分等级,包括:基于获取的所述历史平均时间将所述广播接收者划分等级;所述基于划分的等级对所述广播接收者进行调整,包括:基于划分的等级调整广播接收者在广播接收者队列中的顺序。FIG. 2 is a flowchart of a method for adjusting broadcast receivers according to an embodiment of the present invention. In this embodiment, historical parameters include historical average time, and the broadcast receivers are classified into levels based on the acquired historical parameters. , which includes: classifying the broadcast receivers into ranks based on the acquired historical average time; and adjusting the broadcast receivers based on the divided ranks includes: adjusting the broadcast receivers in the broadcast receiver queue based on the divided ranks in the order.
如图2所示,本实施例提供的技术方案如下:As shown in Figure 2, the technical solution provided by this embodiment is as follows:
S210:获取广播接收者处理广播消息的历史平均时间。S210: Obtain the historical average time for the broadcast receiver to process the broadcast message.
具体的,各广播接收者处理广播消息的数量可能相同,也可能不相同。各广播接收者处理广播消息的类型可能相同,也可能不相同。在计算广播接收者处理广播消息的历史平均时间时,可以对处理的广播消息类型不进行考虑,基于广播接收者处理的各广播消息的时间中的所有时间,计算历史平均时间。Specifically, the number of broadcast messages processed by each broadcast receiver may or may not be the same. Each broadcast receiver may or may not handle the same type of broadcast message. When calculating the historical average time for the broadcast receiver to process the broadcast message, the type of the processed broadcast message may not be considered, and the historical average time may be calculated based on all the times of each broadcast message processed by the broadcast receiver.
本实施例中以计算预设时间段内的历史平均时间为例进行说明,例如,终端内的三个广播接收者分别是A,B,C。若在预设时间段内A处理了5个广播消息,5个广播消息分别是a1、a2,a3,a4和a5,处理各个广播消息的时间分别是8s,7s,9s,8s,10s。若在预设时间段内B处理了3个广播消息,3个广播消息分别是a1,a2,b1,B处理各个广播消息的时间分别是5s,6s,8s。若C在预设时间段内处理了3个广播消息,3个广播消息分别是a1,a2和c1,C处理各个广播消息的时间分别是7s,6s和8s。In this embodiment, the calculation of the historical average time within a preset time period is taken as an example for description. For example, the three broadcast receivers in the terminal are A, B, and C, respectively. If A processes 5 broadcast messages within the preset time period, the 5 broadcast messages are a1, a2, a3, a4 and a5 respectively, and the processing time of each broadcast message is 8s, 7s, 9s, 8s, 10s respectively. If B processes three broadcast messages within the preset time period, the three broadcast messages are a1, a2, and b1 respectively, and the time for B to process each broadcast message is 5s, 6s, and 8s, respectively. If C processes three broadcast messages within the preset time period, the three broadcast messages are respectively a1, a2 and c1, and the time for C to process each broadcast message is 7s, 6s and 8s respectively.
由此,可见看出,A,B,C三个广播接收者处理广播消息的类型并不完全相同,在计算A,B,C三个广播接收者在预设时间段内处理广播消息的历史平均时间时,可以不考虑广播消息的类型,基于A,B,C三个广播接收者处理各广播消息时间中的所有时间,计算处理广播消息的历史平均时间。通过该方法,预设时间段内广播接收者A处理广播消息的历史平均时间是:(8+7+9+8+10)/5=8.4s;预设时间段内广播接收者B处理广播消息的历史平均时间是(5+6+8)/3=6.3s;预设时间段内广播接收者C处理广播消息的历史平均时间是(7+6+8)/3=7s。From this, it can be seen that the types of broadcast messages processed by the three broadcast receivers A, B, and C are not exactly the same. When averaging the time, regardless of the type of the broadcast message, the historical average time for processing the broadcast message can be calculated based on all the times when the three broadcast receivers A, B, and C process each broadcast message. Through this method, the historical average time for broadcast receiver A to process broadcast messages within the preset time period is: (8+7+9+8+10)/5=8.4s; within the preset time period, broadcast receiver B processes broadcast messages. The historical average time for the message is (5+6+8)/3=6.3s; the historical average time for the broadcast receiver C to process the broadcast message within the preset time period is (7+6+8)/3=7s.
在计算广播接收者处理广播消息的历史平均时间时,也可以考虑广播消息的类型。因此,可选的,当各广播接收者在处理的广播消息存在相同的类型时,历史平均时间的计算还可以是:基于各广播接收者处理广播消息的时间,计算所述预设时间段内广播接收者处理相同类型的广播消息的历史平均时间。The type of broadcast message can also be considered when calculating the historical average time for a broadcast receiver to process a broadcast message. Therefore, optionally, when the broadcast messages being processed by each broadcast receiver have the same type, the calculation of the historical average time may also be: based on the time when each broadcast receiver processes the broadcast message, calculate The historical average time for broadcast receivers to process broadcast messages of the same type.
例如,在本实施例中,A,B,C三个广播接收者在预设时间段内处理的相同类型的广播消息分别是a1和a2,基于处理a1和a2的时间,计算历史平均时间。通过该方法,预设时间段内广播接收者A处理广播消息的历史平均时间是:(8+7)/2=7.5s;预设时间段内广播接收者B处理广播消息的历史平均时间是:(5+6)/2=5.5s;预设时间段内广播接收者C处理广播消息的历史平均时间是(7+6)/2=6.5s。For example, in this embodiment, broadcast messages of the same type processed by three broadcast receivers A, B, and C within a preset time period are a1 and a2, respectively, and the historical average time is calculated based on the processing time of a1 and a2. Through this method, the historical average time for broadcast receiver A to process broadcast messages in the preset time period is: (8+7)/2=7.5s; the historical average time for broadcast receiver B to process broadcast messages in the preset time period is : (5+6)/2=5.5s; the historical average time for the broadcast receiver C to process the broadcast message in the preset time period is (7+6)/2=6.5s.
由此,通过历史平均时间,能够准确获取广播接收处理广播消息的速度,以控制广播接收者处理广播消息的顺序。Therefore, through the historical average time, it is possible to accurately obtain the speed at which the broadcast receiver processes the broadcast message, so as to control the order in which the broadcast receiver processes the broadcast message.
S220:基于获取的所述历史平均时间将所述广播接收者划分等级。S220: Classify the broadcast receivers based on the acquired historical average time.
在本实施例中,如果广播接收者处理广播消息的历史平均时间在某一等级的时间范围内,将该广播接收者划分为对应的等级。由此,通过历史平均时间划分广播接收者的等级,能够对准确划分广播接收者的等级,以合理调整广播接收者在广播接收者队列中的顺序。In this embodiment, if the historical average time for the broadcast receiver to process the broadcast message is within a time range of a certain level, the broadcast receiver is classified into a corresponding level. In this way, by classifying the broadcast receivers according to the historical average time, it is possible to accurately classify the broadcast receivers, so as to reasonably adjust the order of the broadcast receivers in the broadcast receiver queue.
S230:基于划分的等级调整所述广播接收者在广播接收者队列中的顺序。S230: Adjust the order of the broadcast receivers in the broadcast receiver queue based on the divided levels.
在上述实施例的基础上,基于获取的所述历史平均时间将广播接收者划分等级,还可以包括:在获取的广播接收者处理广播消息的时间中,选取大于设定阈值的时间;基于选取的大于设定阈值的时间,计算广播接收者处理广播消息的平均超时时间;基于所述平均超时时间将所述广播接收者划分等级。其中,设定阈值为设定的处理广播消息的标准时间。并且对于平均超时时间进行计算时,也可以考虑广播的类型,即基于选取的大于设定阈值的时间,计算广播接收者处理相同类型的广播消息的平均超时时间。On the basis of the above embodiment, classifying the broadcast receivers into grades based on the acquired historical average time may further include: selecting a time greater than a set threshold from the acquired time when the broadcast receiver processes the broadcast message; If the time is greater than the set threshold value, calculate the average timeout time for the broadcast receiver to process the broadcast message; classify the broadcast receiver into grades based on the average timeout time. The set threshold is the set standard time for processing broadcast messages. And when calculating the average timeout time, the type of broadcast can also be considered, that is, based on the selected time greater than the set threshold, calculate the average timeout time for broadcast receivers to process broadcast messages of the same type.
需要说明的是,基于获取的广播接收者处理广播消息的历史平均时间将广播接收者划分响应等级的具体方式,并不局限于上述的方式,还可以是其他方式。It should be noted that the specific manner of classifying the broadcast receivers into response levels based on the acquired historical average time of the broadcast receivers processing the broadcast message is not limited to the above manner, and may also be other manners.
由此,通过划分的等级调整广播接收者在广播接收者队列中的顺序,能够避免处理速度慢的广播接收者对处理速度快的广播接收者的影响,优化广播接收者处理广播消息的顺序,提高广播接收者处理广播消息的消息,保证系统的稳定性。In this way, by adjusting the order of broadcast receivers in the broadcast receiver queue by the divided levels, the influence of broadcast receivers with slow processing speed on broadcast receivers with fast processing speed can be avoided, and the order in which broadcast receivers process broadcast messages can be optimized. Improve the broadcast receiver's processing of broadcast messages to ensure the stability of the system.
图3是本发明一个实施例提供的一种广播接收者的调整方法的流程图,其中,所述历史参数包括历史超时次数,所述基于获取的所述历史参数将所述广播接收者划分等级,包括:基于获取的所述历史超时次数将所述广播接收者划分等级;所述基于划分的等级对所述广播接收者进行调整,包括:基于划分的等级调整广播接收者在广播接收者队列中的顺序。3 is a flowchart of a method for adjusting a broadcast receiver according to an embodiment of the present invention, wherein the historical parameter includes the number of historical timeouts, and the broadcast receiver is classified into levels based on the acquired historical parameter , including: classifying the broadcast receiver into a grade based on the acquired historical timeout times; and adjusting the broadcast receiver based on the divided grade includes: adjusting the broadcast receiver's position in the broadcast receiver queue based on the divided grade in the order.
如图3所示,本实施例提供的技术方案包括:As shown in Figure 3, the technical solution provided by this embodiment includes:
S310:获取广播接收者处理广播消息的历史超时次数。S310: Acquire the historical timeout times for the broadcast receiver to process the broadcast message.
本实施例中,对于广播接收者处理广播消息的超时次数是通过标识的超时次数而获得。广播管理模块是终端系统中的一个功能模块,在广播管理模块中创建一个变量,采用该变量标识超时次数,根据标识的超时次数而获得超时次数。In this embodiment, the number of timeouts for the broadcast receiver to process the broadcast message is obtained through the identified number of timeouts. The broadcast management module is a functional module in the terminal system. A variable is created in the broadcast management module, the variable is used to identify the number of timeouts, and the number of timeouts is obtained according to the identified number of timeouts.
其中,对于广播接收者处理广播消息是否超时通过如下的方式:判断广播接收者处理广播消息的时间是否大于设定时间阈值;如果是,判定广播接收者处理广播消息超时。当广播接收者处理广播消息超时时,对该广播接收者处理广播消息的超时次数进行标识。Wherein, whether the broadcast receiver processes the broadcast message overtime is as follows: judging whether the time for the broadcast receiver to process the broadcast message is greater than the set time threshold; if so, it is determined that the broadcast receiver processes the broadcast message overtime. When the broadcast receiver times out in processing the broadcast message, the number of times that the broadcast receiver processes the broadcast message overtime is identified.
在本实施例中,当广播接收者处理广播消息的时间大于设定的固定时间阈值时,历史超时次数增加一次。例如,设定的固定时间阈值为10s,当广播接收者处理广播消息的时间大于10s时,广播接收者处理广播消息的超时次数增加一次。In this embodiment, when the time for the broadcast receiver to process the broadcast message is greater than the set fixed time threshold, the number of historical timeouts increases once. For example, the set fixed time threshold is 10s. When the time for the broadcast receiver to process the broadcast message is longer than 10s, the number of timeouts for the broadcast receiver to process the broadcast message is increased by one time.
或者当广播接收者处理广播消息的时间大于动态时间阈值时,历史超时次数增加一次,其中,动态时间阈值基于初始设定值、历史超时次数以及时间增幅值进行确定,时间增幅值为每增加设定数量的超时次数,动态时间阈值的增加量。Or when the time for the broadcast receiver to process the broadcast message is greater than the dynamic time threshold, the number of historical timeouts is increased by one. The dynamic time threshold is determined based on the initial setting value, the number of historical timeouts, and the time increment value. A fixed number of timeouts, the increment of the dynamic time threshold.
例如,每增加一次历史超时次数,动态时间阈值在上一次处理广播消息时对应动态时间阈值的基础上增加1s,采用公式表述为:T=C×T0+T1。其中,T1为动态时间阈值的初始设定值,C为历史超时次数,T0为时间增幅值,即为1。若动态时间阈值的初始设定值为10s,若历史超时次数为1次,动态时间阈值为:1×1+10=11s,即在初始设定值的基础上增加1s,为11s。若再次处理广播消息的时间小于11s,则不超时,若处理广播消息的时间大于11s,则超时,历史超时次数增加1次。时间增幅值或者也可以是每增加两次超时次数,在上一次处理广播消息时对应的动态时间阈值的基础上增加1s,或者还可以是其他形式。For example, each time the number of historical timeouts is increased, the dynamic time threshold is increased by 1s on the basis of the dynamic time threshold corresponding to the last time the broadcast message was processed, which is expressed by the formula: T=C×T0+T1. Among them, T1 is the initial setting value of the dynamic time threshold, C is the number of historical timeouts, and T0 is the time increment value, which is 1. If the initial set value of the dynamic time threshold is 10s, and if the number of historical timeouts is 1, the dynamic time threshold is: 1×1+10=11s, that is, 1s is added to the initial set value, which is 11s. If the time to process the broadcast message again is less than 11s, the timeout will not occur. If the time to process the broadcast message is greater than 11s, the timeout will occur, and the number of historical timeouts will increase by 1. The time increment value may also be increased by 1 s on the basis of the dynamic time threshold value corresponding to the last time the broadcast message was processed for each additional two times of timeout, or may also be in other forms.
并且通过历史超时次数和时间增幅值确定动态时间阈值,能够合理控制广播接收者处理广播消息的超时次数。Moreover, the dynamic time threshold is determined by the historical timeout times and the time increment value, which can reasonably control the timeout times for the broadcast receiver to process the broadcast message.
S320:基于获取的所述历史超时次数将所述广播接收者划分等级。S320: Classify the broadcast receivers based on the acquired historical timeout times.
在本实施例中,如果广播接收者处理广播消息的历史超时次数在某一等级的次数范围内,将该广播接收者划分为对应的等级。例如,快速等级的超时次数范围是0-3次,中速等级的超时次数范围为4-6次,慢速等级的超时次数范围是大于6次。若目标广播接收者的历史超时次数为5次,则目标广播接收者的历史超时次数在中速等级的超时次数范围内,将目标广播接收者划分为中速等级。In this embodiment, if the historical time-out times for the broadcast receiver to process the broadcast message is within the range of times of a certain level, the broadcast receiver is classified into a corresponding level. For example, the range of the timeout times of the fast level is 0-3 times, the range of the number of timeouts of the medium speed level is 4-6 times, and the range of the number of timeouts of the slow level is more than 6 times. If the number of historical timeouts of the target broadcast receiver is 5, and the number of historical timeouts of the target broadcast receiver is within the range of the number of timeouts of the medium speed level, the target broadcast receiver is divided into the medium speed level.
由此,通过历史超时次数划分广播接收者的等级,能够准确划分广播接收者的等级,以优化广播接收者在广播接收者队列中的顺序。In this way, by classifying the broadcast receivers according to the number of historical timeouts, the broadcast receivers can be classified accurately, so as to optimize the order of the broadcast receivers in the broadcast receiver queue.
S330:基于划分的等级调整广播接收者在广播接收者队列中的顺序。S330: Adjust the order of the broadcast receivers in the broadcast receiver queue based on the divided levels.
在本实施例中,按照历史超时次数将广播接收者进行分级,并在同一广播接收者队列中,调整广播接收者的顺序,以使历史超时次数少的广播接收者先处理广播消息,提高广播消息的处理效率,避免处理速度较慢的广播接收者对处理速度较快的广播接收者的影响,保证系统稳定性。In this embodiment, the broadcast receivers are classified according to the number of historical timeouts, and in the same broadcast receiver queue, the order of the broadcast receivers is adjusted, so that the broadcast receivers with fewer historical timeouts process the broadcast messages first, and improve the broadcast efficiency. The processing efficiency of the message can avoid the influence of the broadcast receiver with a slower processing speed on the broadcast receiver with a faster processing speed, and ensure the stability of the system.
图4是本发明一个实施例提供的一种广播接收者的调整方法流程图,其中,历史参数包括动态时间阈值;所述基于获取的所述历史参数将所述广播接收者划分等级,包括:基于获取的与所述广播接收者对应的动态时间阈值将所述广播接收者划分等级;所述基于划分的等级对所述广播接收者进行调整,包括:基于划分的等级调整所述广播接收者在广播接收者队列中的顺序。4 is a flowchart of a method for adjusting a broadcast receiver provided by an embodiment of the present invention, wherein the historical parameter includes a dynamic time threshold; and the classification of the broadcast receiver based on the acquired historical parameter includes: Classifying the broadcasting receivers based on the acquired dynamic time thresholds corresponding to the broadcasting recipients; and adjusting the broadcasting recipients based on the classified classes includes: adjusting the broadcasting recipients based on the classified classes. The order in the broadcast receiver queue.
如图4所示,本实施例提供的技术方案包括:As shown in Figure 4, the technical solution provided by this embodiment includes:
S410:获取广播接收者处理广播消息对应的动态时间阈值。S410: Obtain a dynamic time threshold corresponding to the broadcast receiver processing the broadcast message.
在本实施例中,动态时间阈值用于判断广播接收者处理广播消息是否超时。当广播接收者处理广播消息的时间大于动态时间阈值时,判断该广播接收者处理广播消息超时。动态时间阈值基于获取的历史超时次数、时间增幅值以及初始设定值进行确定。其中,时间增幅值为每增加设定数量的历史超时次数,动态时间阈值的增加量。In this embodiment, the dynamic time threshold is used to determine whether the broadcast receiver has timed out to process the broadcast message. When the time for the broadcast receiver to process the broadcast message is greater than the dynamic time threshold, it is determined that the broadcast receiver has timed out for processing the broadcast message. The dynamic time threshold is determined based on the acquired historical timeout times, time increment value and initial setting value. Among them, the time increment value is the increment of the dynamic time threshold for each increase of the set number of historical timeouts.
其中,广播接收者处理广播消息的历史超时次数与动态时间阈值相对应。因此,广播接收者处理广播消息时基于历史超时次数与动态时间阈值对应。例如,广播接收者处理广播消息的超时次数为0,对应的是动态时间阈值的初始设定值。即若广播接收者处理广播消息的超时次数为0,判断处理广播消息是否超时基于处理广播消息的时间与动态时间阈值的初始设定值进行确定。The number of historical timeouts for the broadcast receiver to process the broadcast message corresponds to the dynamic time threshold. Therefore, when the broadcast receiver processes the broadcast message, it corresponds to the dynamic time threshold based on the number of historical timeouts. For example, the number of timeouts for the broadcast receiver to process the broadcast message is 0, which corresponds to the initial set value of the dynamic time threshold. That is, if the number of timeouts of the broadcast receiver processing the broadcast message is 0, judging whether the processing of the broadcast message has timed out is determined based on the time for processing the broadcast message and the initial setting value of the dynamic time threshold.
S420:基于获取的与所述广播接收者对应的动态时间阈值将所述广播接收者划分等级。S420: Classify the broadcast receivers based on the acquired dynamic time thresholds corresponding to the broadcast receivers.
在本实施例中,广播接收者的历史超时次数不同,对应的动态时间阈值不同。如果广播接收者处理广播消息对应的动态时间阈值在某一等级的时间范围内,将该广播接收者划分为对应的等级。In this embodiment, the number of historical timeouts of the broadcast receivers is different, and the corresponding dynamic time thresholds are different. If the dynamic time threshold corresponding to the broadcast receiver processing the broadcast message is within a time range of a certain level, the broadcast receiver is divided into a corresponding level.
由此,通过动态时间阈值划分广播接收者的等级,能够准确划分广播接收者的等级,以优化广播接收者在广播接收者队列中的顺序。In this way, by classifying the broadcast receivers according to the dynamic time threshold, the broadcast receivers can be classified accurately, so as to optimize the order of the broadcast receivers in the broadcast receiver queue.
S430:基于划分的等级调整所述广播接收者在广播接收者队列中的顺序。S430: Adjust the order of the broadcast receivers in the broadcast receiver queue based on the divided levels.
在本实施例中,按照与广播接收者对应的动态时间阈值将广播接收者进行分级,并在同一广播接收者队列中,调整广播接收者的顺序,以使对应的动态时间阈值较少的广播接收者先处理广播消息,提高广播消息的处理效率,避免处理速度较慢的广播接收者对处理速度较快的广播接收者的影响,保证系统的稳定性。In this embodiment, the broadcast receivers are classified according to the dynamic time thresholds corresponding to the broadcast receivers, and in the same broadcast receiver queue, the order of the broadcast receivers is adjusted, so that the broadcast receivers with less corresponding dynamic time thresholds are broadcasted. The receiver processes the broadcast message first, which improves the processing efficiency of the broadcast message, avoids the influence of the broadcast receiver with a slower processing speed on the broadcast receiver with a faster processing speed, and ensures the stability of the system.
图5是本发明一个实施例提供的一种广播接收者的调整方法流程图,其中,广播接收者的类型包括:系统、系统应用和三方应用;所述基于获取的所述类型将所述广播接收者划分等级,包括:根据所述广播接收者的类型将所述广播接收者划分为与所述系统、所述系统应用和所述三方应用分别对应的等级;所述基于划分的等级对所述广播接收者进行调整,包括:创建与划分的等级对应的广播接收者队列,并将所述广播接收者移动到对应的广播接收者队列中。Fig. 5 is a flowchart of a method for adjusting broadcast receivers provided by an embodiment of the present invention, wherein the types of broadcast receivers include: system, system application, and third-party application; Classifying the receivers into grades, including: classifying the broadcast receivers into grades corresponding to the system, the system application, and the three-party application according to the types of the broadcast receivers; Adjusting the broadcast receiver includes: creating a broadcast receiver queue corresponding to the divided level, and moving the broadcast receiver to the corresponding broadcast receiver queue.
如图5所示,本实施例提供的技术方案包括:As shown in Figure 5, the technical solution provided by this embodiment includes:
S510:获取广播接收者的类型。S510: Obtain the type of the broadcast receiver.
其中,广播接收者的类型包括:系统、系统应用和三方应用。The types of broadcast receivers include: system, system application, and third-party application.
S520:根据所述广播接收者的类型将所述广播接收者划分为与系统、系统应用和三方应用分别对应的等级。S520: Classify the broadcast receivers into levels corresponding to the system, the system application, and the third-party application according to the type of the broadcast receiver.
在本实施例中,设置系统、系统应用和三方应用的等级,根据广播接收者的类型将广播接收者划分为与系统、系统应用和三方应用分别对应的等级。例如,将系统、系统应用和三方应用分别设置为一级、二级和三级。若一个目标广播接收者的类型为系统,则将该目标广播接收划分为与系统对应的等级,即一级。In this embodiment, the levels of the system, the system application, and the third-party application are set, and the broadcast receivers are divided into levels corresponding to the system, the system application, and the third-party application according to the type of the broadcast receiver. For example, set the system, system application and third-party application to the first, second and third level respectively. If the type of a target broadcast receiver is a system, the target broadcast receiver is divided into a level corresponding to the system, that is, the first level.
S530:创建与划分的等级对应的广播接收者队列,并将所述广播接收者移动到对应的广播接收者队列中。S530: Create a broadcast receiver queue corresponding to the divided level, and move the broadcast receiver to the corresponding broadcast receiver queue.
在本实施例中,划分的等级与广播接收者队列对应,并将广播接收者移动到与广播接收者的等级对应的广播接收者队列中。例如,若广播接收者的类型为系统,将该广播接收者的移动到与系统等级对应的广播接收者队列中。In this embodiment, the divided levels correspond to the broadcast receiver queue, and the broadcast receivers are moved to the broadcast receiver queue corresponding to the broadcast receiver's level. For example, if the type of the broadcast receiver is system, move the broadcast receiver to the broadcast receiver queue corresponding to the system level.
由此,通过广播接收者的类型划分广播接收者的等级,并按照划分的等级对广播接收者进行调整,能够提高广播消息的处理速度以及效率。In this way, the broadcast receivers are classified according to the types of broadcast receivers, and the broadcast receivers are adjusted according to the divided levels, so that the processing speed and efficiency of broadcast messages can be improved.
图6是本发明一个实施例提供的一种广播接收者的调整装置的结构框图,所述装置用于执行广播接收者的调整方法,如图6所示,所述装置包括获取模块610、划分模块620和调整模块630。FIG. 6 is a structural block diagram of an apparatus for adjusting broadcast receivers provided by an embodiment of the present invention. The apparatus is used to execute a method for adjusting broadcast receivers. As shown in FIG. 6 , the apparatus includes an acquisition module 610, a division module 620 and adjustment module 630.
其中,获取模块610,用于获取广播接收者处理广播消息的历史参数或者广播接收者的类型;Wherein, the obtaining module 610 is used to obtain the historical parameters of the broadcast receiver processing the broadcast message or the type of the broadcast receiver;
划分模块620,用于基于获取的所述历史参数或者所述类型将所述广播接收者划分等级;A classification module 620, configured to classify the broadcast receivers into ranks based on the acquired historical parameters or the types;
调整模块630,用于基于划分的等级对所述广播接收者进行调整。An adjustment module 630, configured to adjust the broadcast receivers based on the divided levels.
进一步的,所述历史参数包括历史平均时间,Further, the historical parameters include historical average time,
所述划分模块620,用于基于获取的所述历史平均时间将所述广播接收者划分等级;The dividing module 620 is configured to divide the broadcast receivers into grades based on the acquired historical average time;
所述调整模块630,用于基于划分的等级调整广播接收者在广播接收者队列中的顺序。The adjusting module 630 is configured to adjust the order of the broadcast receivers in the broadcast receiver queue based on the divided levels.
进一步的,所述历史参数包括历史超时次数,Further, the historical parameter includes the number of historical timeouts,
所述划分模块620,用于基于获取的所述历史超时次数将所述广播接收者划分等级;The dividing module 620 is configured to divide the broadcast receivers into grades based on the acquired historical timeout times;
所述调整模块630,用于基于划分的等级调整广播接收者在广播接收者队列中的顺序。The adjusting module 630 is configured to adjust the order of the broadcast receivers in the broadcast receiver queue based on the divided levels.
进一步的,当所述广播接收者处理广播消息的时间大于设定的固定时间阈值时,所述历史超时次数增加一次;或者Further, when the time for the broadcast receiver to process the broadcast message is greater than the set fixed time threshold, the number of historical timeouts is increased once; or
当所述广播接收者处理广播消息的时间大于动态时间阈值时,所述历史超时次数增加一次,其中,所述动态时间阈值基于初始设定值、所述历史超时次数以及时间增幅值进行确定,所述时间增幅值为每增加设定数量的超时次数,所述动态时间阈值的增加量。When the time for the broadcast receiver to process the broadcast message is greater than a dynamic time threshold, the number of historical timeouts is increased by one, wherein the dynamic time threshold is determined based on an initial setting value, the number of historical timeouts, and a time increment value, The time increment value is the increment of the dynamic time threshold value for each increase of the set number of timeout times.
进一步的,所述历史参数包括动态时间阈值;Further, the historical parameter includes a dynamic time threshold;
所述划分模块620,用于基于获取的与所述广播接收者对应的动态时间阈值将所述广播接收者划分等级;The dividing module 620 is configured to divide the broadcast receivers into ranks based on the obtained dynamic time thresholds corresponding to the broadcast receivers;
所述调整模块630,用于基于划分的等级调整所述广播接收者在广播接收者队列中的顺序;The adjustment module 630 is configured to adjust the order of the broadcast receivers in the broadcast receiver queue based on the divided levels;
其中,所述动态时间阈值用于判断广播接收者处理广播消息是否超时;所述动态时间阈值基于获取的历史超时次数、时间增幅值以及初始设定值进行确定。Wherein, the dynamic time threshold is used to judge whether the broadcast receiver has timed out processing the broadcast message; the dynamic time threshold is determined based on the acquired historical timeout times, time increment value and initial setting value.
进一步的,广播接收者的类型包括:系统、系统应用和三方应用;Further, the types of broadcast receivers include: system, system application and third-party application;
所述划分模块620,用于根据所述广播接收者的类型将所述广播接收者划分为与所述系统、所述系统应用和所述三方应用分别对应的等级;the dividing module 620, configured to divide the broadcast receivers into levels corresponding to the system, the system application and the three-party application according to the types of the broadcast receivers;
所述调整模块630,用于创建与划分的等级对应的广播接收者队列,并将所述广播接收者移动到对应的广播接收者队列中。The adjustment module 630 is configured to create a broadcast receiver queue corresponding to the divided level, and move the broadcast receiver to the corresponding broadcast receiver queue.
本实施例提供的一种广播接收者调整装置,通过广播接收者处理广播消息的历史参数或者广播接收者的类型将广播接收者划分等级,并根据等级对广播接收者进行调整,可以提高处理广播消息的效率,保障系统稳定性。The apparatus for adjusting broadcast receivers provided in this embodiment classifies the broadcast receivers according to the historical parameters of the broadcast receivers processing broadcast messages or the types of the broadcast receivers, and adjusts the broadcast receivers according to the grades, which can improve the processing of broadcast receivers. The efficiency of the message ensures the stability of the system.
本发明实施例提供了一种终端,该终端中可集成本发明实施例提供的广播接收者的调整装置。图7为本发明一个实施例提供的一种终端的结构示意图。如图7所示,该终端700可以包括:存储器701、中央处理器(Central Processing Unit,CPU)702(又称处理器,以下简称CPU)、触摸屏712以及存储在存储器上并可在CPU上运行的计算机程序。所述触摸屏712,用于将用户操作转换成电信号输入至所述CPU,并显示可视输出信号;CPU702执行计算机程序时实现以下步骤:获取广播接收者处理广播消息的历史参数或者广播接收者的类型;基于获取的所述历史参数或者所述类型将所述广播接收者划分等级;基于划分的等级对所述广播接收者进行调整。An embodiment of the present invention provides a terminal, in which the apparatus for adjusting a broadcast receiver provided by the embodiment of the present invention can be integrated. FIG. 7 is a schematic structural diagram of a terminal according to an embodiment of the present invention. As shown in FIG. 7 , the terminal 700 may include: a memory 701, a central processing unit (Central Processing Unit, CPU) 702 (also known as a processor, hereinafter referred to as a CPU), a touch screen 712, and a touch screen 712 that is stored in the memory and can run on the CPU computer program. The touch screen 712 is used to convert user operations into electrical signals and input them to the CPU, and display a visual output signal; when the CPU 702 executes the computer program, the following steps are implemented: acquiring historical parameters of broadcast receivers processing broadcast messages or broadcast receivers The type of the broadcast receiver is classified based on the acquired historical parameter or the type; the broadcast receiver is adjusted based on the divided grade.
所述终端700还包括:外设接口703、RF(Radio Frequency,射频)电路705、音频电路706、扬声器711、电源管理芯片708、输入/输出(I/O)子系统709、其他输入/控制设备710以及外部端口704,这些部件通过一个或多个通信总线或信号线707来通信。The terminal 700 further includes: a peripheral interface 703, an RF (Radio Frequency, radio frequency) circuit 705, an audio circuit 706, a speaker 711, a power management chip 708, an input/output (I/O) subsystem 709, and other input/control Devices 710 and external ports 704, these components communicate via one or more communication buses or signal lines 707.
应该理解的是,图示终端700仅仅是终端的一个范例,并且终端700可以具有比图中所示出的更多的或者更少的部件,可以组合两个或更多的部件,或者可以具有不同的部件配置。图中所示出的各种部件可以在包括一个或多个信号处理和/或专用集成电路在内的硬件、软件、或硬件和软件的组合中实现。It should be understood that the illustrated terminal 700 is merely an example of a terminal, and that the terminal 700 may have more or fewer components than those shown in the figure, may combine two or more components, or may have Different part configurations. The various components shown in the figures 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.
下面就本实施例提供的集成有广播接收者的调整装置的终端进行详细的描述,该终端以手机为例。The following is a detailed description of the terminal provided in this embodiment that integrates the adjustment device of the broadcast receiver, and the terminal is a mobile phone as an example.
存储器701,所述存储器701可以被CPU702、外设接口703等访问,所述存储器701可以包括高速随机存取存储器,还可以包括非易失性存储器,例如一个或多个磁盘存储器件、闪存器件、或其他易失性固态存储器件。Memory 701, which can be accessed by CPU 702, peripheral interface 703, etc., said memory 701 can include high-speed random access memory, and can also include non-volatile memory, such as one or more disk storage devices, flash memory devices , or other volatile solid-state storage devices.
外设接口703,所述外设接口703可以将设备的输入和输出外设连接到CPU702和存储器701。A peripheral interface 703 that can connect the input and output peripherals of the device to the CPU 702 and the memory 701 .
I/O子系统709,所述I/O子系统709可以将设备上的输入输出外设,例如触摸屏712和其他输入/控制设备710,连接到外设接口703。I/O子系统709可以包括显示控制器7091和用于控制其他输入/控制设备710的一个或多个输入控制器7092。其中,一个或多个输入控制器7092从其他输入/控制设备710接收电信号或者向其他输入/控制设备710发送电信号,其他输入/控制设备710可以包括物理按钮(按压按钮、摇臂按钮等)、拨号盘、滑动开关、操纵杆、点击滚轮。值得说明的是,输入控制器7092可以与以下任一个连接:键盘、红外端口、USB接口以及诸如鼠标的指示设备。I/O subsystem 709 , which can connect input and output peripherals on the device, such as touch screen 712 and other input/control devices 710 , to peripherals interface 703 . The I/O subsystem 709 may include a display controller 7091 and one or more input controllers 7092 for controlling other input/control devices 710 . Wherein, one or more input controllers 7092 receive electrical signals from or send electrical signals to other input/control devices 710, which may include physical buttons (push buttons, rocker buttons, etc. ), dial pad, slide switch, joystick, click wheel. Notably, the input controller 7092 can be connected to any of the following: a keyboard, an infrared port, a USB interface, and a pointing device such as a mouse.
触摸屏712,所述触摸屏712是用户终端与用户之间的输入接口和输出接口,将可视输出显示给用户,可视输出可以包括图形、文本、图标、视频等。The touch screen 712, which is an input interface and an output interface between the user terminal and the user, displays visual output to the user, and the visual output may include graphics, text, icons, videos, and the like.
I/O子系统709中的显示控制器7091从触摸屏712接收电信号或者向触摸屏712发送电信号。触摸屏712检测触摸屏上的接触,显示控制器7091将检测到的接触转换为与显示在触摸屏712上的用户界面对象的交互,即实现人机交互,显示在触摸屏712上的用户界面对象可以是运行游戏的图标、联网到相应网络的图标等。值得说明的是,设备还可以包括光鼠,光鼠是不显示可视输出的触摸敏感表面,或者是由触摸屏形成的触摸敏感表面的延伸。Display controller 7091 in I/O subsystem 709 receives electrical signals from touch screen 712 or sends electrical signals to touch screen 712 . The touch screen 712 detects the contact on the touch screen, and the display controller 7091 converts the detected contact into interaction with the user interface object displayed on the touch screen 712, that is, to realize human-computer interaction, and the user interface object displayed on the touch screen 712 can be run. Icons for games, icons for connecting to the corresponding network, etc. It is worth noting that the device may also include a light mouse, which is a touch-sensitive surface that does not display visual output, or an extension of the touch-sensitive surface formed by a touch screen.
RF电路705,主要用于建立手机与无线网络(即网络侧)的通信,实现手机与无线网络的数据接收和发送。例如收发短信息、电子邮件等。具体地,RF电路705接收并发送RF信号,RF信号也称为电磁信号,RF电路705将电信号转换为电磁信号或将电磁信号转换为电信号,并且通过该电磁信号与通信网络以及其他设备进行通信。RF电路705可以包括用于执行这些功能的已知电路,其包括但不限于天线系统、RF收发机、一个或多个放大器、调谐器、一个或多个振荡器、数字信号处理器、CODEC(COder-DECoder,编译码器)芯片组、用户标识模块(Subscriber Identity Module,SIM)等等。The RF circuit 705 is mainly used to establish the communication between the mobile phone and the wireless network (ie, the network side), so as to realize the data reception and transmission between the mobile phone and the wireless network. Such as sending and receiving text messages, e-mails, etc. Specifically, the RF circuit 705 receives and transmits RF signals, also known as electromagnetic signals, the RF circuit 705 converts electrical signals into electromagnetic signals or converts electromagnetic signals into electrical signals, and communicates with communication networks and other devices through the electromagnetic signals to communicate. RF circuitry 705 may include known circuitry for performing these functions including, but not limited to, antenna systems, RF transceivers, one or more amplifiers, tuners, one or more oscillators, digital signal processors, CODECs ( COder-DECoder, codec) chip set, subscriber identity module (Subscriber Identity Module, SIM) and so on.
音频电路706,主要用于从外设接口703接收音频数据,将该音频数据转换为电信号,并且将该电信号发送给扬声器711。The audio circuit 706 is mainly used for receiving audio data from the peripheral interface 703 , converting the audio data into an electrical signal, and sending the electrical signal to the speaker 711 .
扬声器711,用于将手机通过RF电路705从无线网络接收的语音信号,还原为声音并向用户播放该声音。The speaker 711 is used to restore the voice signal received by the mobile phone from the wireless network through the RF circuit 705 to sound and play the sound to the user.
电源管理芯片708,用于为CPU702、I/O子系统及外设接口所连接的硬件进行供电及电源管理。The power management chip 708 is used for power supply and power management for the hardware connected to the CPU 702, the I/O subsystem and the peripheral interface.
本实施例提供的终端用于执行上述实施例所述的广播接收者的调整装置,其技术原理和产生的技术效果类似,这里不再赘述。The terminal provided in this embodiment is used to execute the apparatus for adjusting broadcast receivers described in the foregoing embodiments, and the technical principle and the resulting technical effects are similar, which will not be repeated here.
注意,上述仅为本发明的较佳实施例及所运用技术原理。本领域技术人员会理解,本发明不限于这里所述的特定实施例,对本领域技术人员来说能够进行各种明显的变化、重新调整和替代而不会脱离本发明的保护范围。因此,虽然通过以上实施例对本发明进行了较为详细的说明,但是本发明不仅仅限于以上实施例,在不脱离本发明构思的情况下,还可以包括更多其他等效实施例,而本发明的范围由所附的权利要求范围决定。Note that the above are only preferred embodiments of the present invention and applied technical principles. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the protection scope of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and can also include more other equivalent embodiments without departing from the concept of the present invention. The scope is determined by the scope of the appended claims.
Claims (9)
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710140530.XA CN106851592B (en) | 2017-03-10 | 2017-03-10 | Method, device and terminal for adjusting broadcast receiver |
PCT/CN2018/078563 WO2018161956A1 (en) | 2017-03-10 | 2018-03-09 | Broadcast recipient adjustment method, device, and terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710140530.XA CN106851592B (en) | 2017-03-10 | 2017-03-10 | Method, device and terminal for adjusting broadcast receiver |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106851592A CN106851592A (en) | 2017-06-13 |
CN106851592B true CN106851592B (en) | 2019-12-10 |
Family
ID=59144119
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710140530.XA Expired - Fee Related CN106851592B (en) | 2017-03-10 | 2017-03-10 | Method, device and terminal for adjusting broadcast receiver |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN106851592B (en) |
WO (1) | WO2018161956A1 (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106851592B (en) * | 2017-03-10 | 2019-12-10 | Oppo广东移动通信有限公司 | Method, device and terminal for adjusting broadcast receiver |
CN106919459B (en) * | 2017-03-10 | 2020-12-04 | Oppo广东移动通信有限公司 | Management method, device and terminal for broadcast receiver |
CN115277557B (en) * | 2022-07-25 | 2024-01-05 | Oppo广东移动通信有限公司 | Broadcast processing method, device, electronic equipment and storage medium |
CN115988437B (en) * | 2022-12-27 | 2023-12-15 | 中为聚旦数字科技(苏州)有限公司 | Service short message monitoring system and method based on big data |
Family Cites Families (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090028564A1 (en) * | 2007-07-27 | 2009-01-29 | Villarruel Fernando X | Dual Broadcast and Narrowcast Systems and Methods |
US8676253B2 (en) * | 2011-05-24 | 2014-03-18 | Spreadtrum Communications (Shanghai) Co., Ltd. | Method and device for ranking frequencies |
US20140289761A1 (en) * | 2013-03-15 | 2014-09-25 | Blinkx, Inc. | Systems and Methods of Processing Data Involving Presentation of Information on Android Devices |
CN103491507B (en) * | 2013-09-05 | 2017-08-01 | 广东欧珀移动通信有限公司 | A kind of method and device of ordered broadcast priority reorientation |
CN105988868B (en) * | 2015-02-12 | 2019-04-16 | Oppo广东移动通信有限公司 | A kind of method and terminal shifting application program |
CN105208590B (en) * | 2015-08-17 | 2018-07-06 | 广东欧珀移动通信有限公司 | The detection restoration methods and mobile terminal of mobile terminal operating system interim card exception |
CN105550104B (en) * | 2015-12-08 | 2018-04-20 | 北京奇虎科技有限公司 | Application program capacity test method and device |
CN106406821A (en) * | 2016-08-15 | 2017-02-15 | 平安科技(深圳)有限公司 | Data processing request sorting method and device |
CN106851592B (en) * | 2017-03-10 | 2019-12-10 | Oppo广东移动通信有限公司 | Method, device and terminal for adjusting broadcast receiver |
-
2017
- 2017-03-10 CN CN201710140530.XA patent/CN106851592B/en not_active Expired - Fee Related
-
2018
- 2018-03-09 WO PCT/CN2018/078563 patent/WO2018161956A1/en active Application Filing
Also Published As
Publication number | Publication date |
---|---|
CN106851592A (en) | 2017-06-13 |
WO2018161956A1 (en) | 2018-09-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11157334B2 (en) | Control method and apparatus for broadcast sending, storage medium, and electronic device | |
CN106851592B (en) | Method, device and terminal for adjusting broadcast receiver | |
CN106919459B (en) | Management method, device and terminal for broadcast receiver | |
US10097292B2 (en) | Method, device, terminal and storage medium for adjusting broadcast message queue | |
US11160052B2 (en) | Method for adjusting broadcast receiver queue, storage medium and electronic device | |
US10908976B2 (en) | Broadcast queue adjustment method, terminal, and storage medium | |
CN107070670B (en) | Method, device and terminal equipment for controlling broadcast sender to send broadcast message | |
WO2018161966A1 (en) | Broadcast sending method, device, terminal and storage medium | |
CN106936826B (en) | Registration method and device of broadcast receiver and terminal equipment | |
US10990460B2 (en) | Method of generating broadcast queue, storage medium, and terminal | |
CN106951333A (en) | Broadcast control method and device and mobile terminal | |
CN106953852A (en) | Registration method and device of broadcast receiver and terminal equipment | |
CN106936828B (en) | Method, device and terminal for adjusting broadcast receiver queue | |
US11048568B2 (en) | Broadcast sending control method and apparatus, storage medium, and electronic device | |
CN106844070B (en) | Broadcast control method and device and mobile terminal | |
CN106936994B (en) | A kind of control method of broadcast recipients, device and mobile terminal | |
CN106851595B (en) | Ordered broadcast processing method and device and terminal equipment | |
CN106851594B (en) | Broadcast sending method, device and terminal | |
CN106933684A (en) | A method, device and mobile terminal for controlling a broadcast receiver | |
CN106919461B (en) | Method and device for adjusting broadcast receiver queue and terminal equipment | |
CN106933685B (en) | Management method, device and terminal for broadcast receiver | |
CN106899943B (en) | Method, device and terminal equipment for controlling broadcast sender to send broadcast message | |
CN106933686A (en) | Method, device and terminal for adjusting broadcast message queue | |
CN106850458A (en) | Method, device and terminal for broadcast message queuing |
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 |
Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18 Applicant after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd. Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18 Applicant before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd. |
|
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20191210 |