WO2018161588A1 - 广播接收者队列调整方法、装置、存储介质及电子设备 - Google Patents
广播接收者队列调整方法、装置、存储介质及电子设备 Download PDFInfo
- Publication number
- WO2018161588A1 WO2018161588A1 PCT/CN2017/106944 CN2017106944W WO2018161588A1 WO 2018161588 A1 WO2018161588 A1 WO 2018161588A1 CN 2017106944 W CN2017106944 W CN 2017106944W WO 2018161588 A1 WO2018161588 A1 WO 2018161588A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- broadcast
- historical
- broadcast receiver
- queue
- target
- 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.)
- Ceased
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04M—TELEPHONIC COMMUNICATION
- H04M1/00—Substation equipment, e.g. for use by subscribers
- H04M1/72—Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
- H04M1/724—User interfaces specially adapted for cordless or mobile telephones
- H04M1/72403—User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
- G06F9/5038—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/542—Event management; Broadcasting; Multicasting; Notifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/546—Message passing systems or structures, e.g. queues
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/60—Network streaming of media packets
- H04L65/61—Network streaming of media packets for supporting one-way streaming services, e.g. Internet radio
- H04L65/611—Network streaming of media packets for supporting one-way streaming services, e.g. Internet radio for multicast or broadcast
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04M—TELEPHONIC COMMUNICATION
- H04M1/00—Substation equipment, e.g. for use by subscribers
- H04M1/72—Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
- H04M1/724—User interfaces specially adapted for cordless or mobile telephones
- H04M1/72484—User interfaces specially adapted for cordless or mobile telephones wherein functions are triggered by incoming communication events
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W72/00—Local resource management
- H04W72/30—Resource management for broadcast services
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W72/00—Local resource management
- H04W72/50—Allocation or scheduling criteria for wireless resources
- H04W72/56—Allocation or scheduling criteria for wireless resources based on priority criteria
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04H—BROADCAST COMMUNICATION
- H04H60/00—Arrangements for broadcast applications with a direct linking to broadcast information or broadcast space-time; Broadcast-related systems
- H04H60/76—Arrangements characterised by transmission systems other than for broadcast, e.g. the Internet
- H04H60/81—Arrangements characterised by transmission systems other than for broadcast, e.g. the Internet characterised by the transmission system itself
- H04H60/90—Wireless transmission systems
Definitions
- the present invention relates to the field of terminal technologies, and in particular, to a broadcast receiver queue adjustment method, apparatus, storage medium, and electronic device.
- Broadcasting in Android is a widely used mechanism for transferring information between applications. Broadcasting in Android is used to monitor system events or application events.
- some applications perform self-starting or other operations in the background by receiving various broadcast messages.
- the application itself may be performing some time-consuming operations or the application itself may be stuck, resulting in the received broadcast messages being unable to be processed in time, and even some applications may time-out processing the broadcast messages, affecting The subsequent distribution of broadcast messages makes the system consume power and has poor stability.
- the embodiment of the present invention provides a broadcast receiver queue adjustment method, device, storage medium, and electronic device, which can improve the processing speed of the broadcast message and improve the stability of the system.
- the embodiment of the present application provides a broadcast receiver queue adjustment method, including:
- the first target broadcast recipient in the second broadcast recipient queue processes the broadcast message in parallel.
- the embodiment of the present application further provides a broadcast receiver queue adjustment apparatus, including:
- a first acquiring module configured to acquire a historical parameter of a broadcast receiver
- a determining module configured to determine whether the historical parameter meets the first setting condition
- a creating module configured to create a second broadcast receiver queue if a historical parameter of the first target broadcast receiver in the first broadcast receiver queue meets the first setting condition
- a mobile module configured to move the first target broadcast recipient into the second broadcast receiver queue, so that a broadcast receiver other than the first target broadcast receiver is removed from the first broadcast recipient queue, And the first target broadcast recipient in the second broadcast recipient queue broadcasts the message in parallel.
- an embodiment of the present application provides a storage medium, where the storage medium stores a plurality of instructions, where the instructions are adapted to be loaded by a processor to perform broadcast receiver queue adjustment as described in the first aspect above. method.
- an embodiment of the present application further provides an electronic device, including a memory and a processor, where the memory stores a plurality of instructions, and the processor loads the instructions in the memory to perform the following steps:
- the first target broadcast recipient in the second broadcast recipient queue processes the broadcast message in parallel.
- the embodiment of the present invention provides a broadcast receiver queue adjustment method, device, storage medium, and electronic device, which can improve the processing speed of the broadcast message and improve the stability of the system.
- FIG. 1 is an application scenario diagram of a broadcast receiver queue adjustment method according to an embodiment of the present application.
- FIG. 1b is a flowchart of a method for adjusting a broadcast receiver queue according to an embodiment of the present application.
- FIG. 2 is another flowchart of a method for adjusting a broadcast receiver queue according to an embodiment of the present application.
- FIG. 3 is still another flowchart of a method for adjusting a broadcast receiver queue according to an embodiment of the present application.
- FIG. 4 is a structural block diagram of a broadcast receiver queue adjustment apparatus according to an embodiment of the present application.
- FIG. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
- the embodiment of the present application provides a broadcast receiver queue adjustment method, including the following steps:
- the first target broadcast recipient in the second broadcast recipient queue processes the broadcast message in parallel.
- the historical parameter includes a historical timeout period for processing a broadcast message
- Determining whether the historical parameter meets the first setting condition comprises:
- creating a second broadcast receiver queue including:
- the historical timeout number is increased once;
- the historical timeout number is increased once, wherein the dynamic time threshold is determined based on the initial set value, the historical timeout number, and the time increase value.
- the time increase value is an increase amount of the dynamic time threshold for each set number of timeouts.
- the historical parameter includes a dynamic time threshold for determining a timeout for processing a broadcast message
- Determining whether the historical parameter meets the first setting condition comprises:
- creating a second broadcast receiver queue including:
- the dynamic time threshold is determined based on the acquired historical timeout number, the time increase value, and the initial set value; the initial set value is less than the second set threshold; and the second set threshold is a fixed value. .
- the historical parameter includes a historical timeout period for processing a broadcast message, a historical time for processing a broadcast message, a historical timeout period for processing a broadcast message accumulation, or a dynamic time threshold for determining a timeout for processing a broadcast message; the dynamic time threshold is based on history The number of timeouts, the time increase value, and the initial set value are determined.
- the historical parameter includes a historical timeout period for processing a broadcast message
- the method further includes:
- the order of the broadcast recipients whose same number of historical timeouts are the same is adjusted based on the accumulated historical timeout period.
- the number of the first target broadcast receivers is greater than one, when the target broadcast message is received, sequentially detecting whether the first target broadcast receiver has processed the Target broadcast message;
- the target broadcast message is distributed to the next first target broadcast recipient.
- the broadcast receiver queue adjustment method provided by the embodiment of the present application may be implemented by the broadcast receiver queue adjustment apparatus provided by the embodiment of the present application, and the apparatus may be implemented by software and/or hardware, and may be integrated into the electronic device.
- the electronic device can be a smart phone, a tablet computer, a palmtop computer, a laptop computer, and the like.
- the first broadcast receiver queue includes an application A, an application B, and an application C, and may obtain historical parameters of each application, determine whether the historical parameters of each application meet the first setting condition, and if there is a first setting condition Applying, creating a second broadcast receiver queue, and moving the application that meets the first setting condition to the second broadcast receiver queue, for example, if the application A in the first broadcast receiver queue meets the first setting condition, Moving application A into the second broadcast recipient queue such that the remaining applications (application B and application C) in the first broadcast recipient queue process the broadcast message in parallel with the application (application A) moved in the second broadcast recipient queue .
- the technical solution provided by the embodiment of the present application moves the first target broadcast receiver that meets the first setting condition in the first broadcast receiver queue to the created second broadcast receiver queue, so that the first The broadcast receivers other than the first target broadcast receiver in the broadcast receiver queue and the first target broadcast receiver in the second broadcast receiver queue process the broadcast messages in parallel, which can improve the speed of processing the broadcast and reduce the number of timeouts To ensure the stability of the system.
- a broadcast receiver queue adjustment method is provided, which is performed by a broadcast receiver queue adjustment device.
- a broadcast receiver queue adjustment device As shown in FIG. 1b, the technical solution provided by this embodiment is as follows:
- S110 Acquire a historical parameter of a broadcast recipient.
- the broadcast sender's service process sends a broadcast message to the broadcast management module (such as ActivityManagerService, activity management service) by calling a broadcast send function (such as the sendBroadcast function), and the broadcast management module receives the broadcast message and then Put into the broadcast transmission queue, the broadcast management module sends the broadcast message in the broadcast transmission queue to the broadcast receiver that meets the reception condition through the process communication mechanism (such as the Binder process communication mechanism).
- the broadcast management module such as ActivityManagerService, activity management service
- the broadcast management module receives the broadcast message and then Put into the broadcast transmission queue
- the broadcast management module sends the broadcast message in the broadcast transmission queue to the broadcast receiver that meets the reception condition through the process communication mechanism (such as the Binder process communication mechanism).
- a broadcast message refers to information transmitted by a system or application during operation for transmission between a system and/or an application.
- the broadcast message may be a system start broadcast message, a short message type broadcast message, a telephone type broadcast message, or a three-party application type broadcast message.
- the broadcast receiver sorts in a queue manner, and processes the broadcast message in order.
- the historical parameters of the broadcast receiver include a historical timeout period for processing a broadcast message, a history time for processing a broadcast message, a history timeout period for processing a broadcast message accumulation, or a dynamic time threshold for determining a timeout for processing a broadcast message, and broadcasting
- the received historical parameters are not limited to the above parameter forms.
- the historical timeout period of the broadcast receiver processing the broadcast message may be the historical timeout period of the broadcast receiver processing the broadcast message within the preset time period.
- the historical time when the broadcast receiver processes the broadcast message may be a historical time when the broadcast receiver processes the broadcast message within a preset time period, or may also be a historical time when the broadcast receiver processes the broadcast message within a preset number of times.
- the broadcast receiver can process multiple broadcast messages in a preset time period. Therefore, the broadcast receiver processes the history time of processing the broadcast message in the preset time period, which may include multiple, that is, one processing time per processing one broadcast message. .
- the preset number of times may be one time or multiple times. When the preset number of times is one time, the history time at which the broadcast receiver processes the broadcast message may be the time when the broadcast message was last processed.
- the historical timeout period is a time when the broadcast receiver processes the broadcast message within a preset time period or a preset number of times exceeds a set value, and the set value may be fixed or may vary with the timeout period. Variety.
- the accumulated historical timeout period is the time at which each time a set value is added and summed.
- the dynamic time threshold for determining the timeout of processing the broadcast message refers to determining that the broadcast receiver processes the broadcast message timeout when the broadcast receiver processes the broadcast message for a time greater than the dynamic time threshold.
- the dynamic time threshold is determined based on an initial set value, a historical timeout number, and a time increase value, wherein the time increase value is an increase amount of the dynamic time threshold for each set number of timeouts.
- S120 Determine whether the historical parameter meets the first setting condition.
- the first setting condition may be that the number of timeouts reaches a set number of times threshold; or the historical average time calculated based on the historical time of processing the broadcast message reaches a first set time threshold; or may be a process of processing a broadcast message.
- the latest historical time reaches the second set time threshold; or the accumulated historical timeout period for processing the broadcast message reaches the third set time threshold, or the dynamic time threshold for determining the timeout for processing the broadcast message is greater than one setting for the first time.
- a threshold, and an initial set value of the dynamic time threshold is less than the set threshold.
- the first setting condition is not limited to the above several forms, and may be other forms.
- S130 Create a second broadcast receiver queue if a historical parameter of the first target broadcast receiver in the first broadcast receiver queue meets the first setting condition.
- each broadcast message corresponds to one broadcast receiver queue, and the broadcast receiver in the first broadcast recipient queue registers at least one identical broadcast message.
- the second broadcast receiver queue when the broadcast message is received, if the historical parameter of the first target broadcast receiver in the first broadcast recipient queue meets the first setting condition, the second broadcast receiver queue may be created; or not received.
- the second broadcast receiver queue may also be created.
- the second broadcast receiver queue is created. Or if the historical average time of the first target broadcast receiver processing the broadcast message is greater than the first set time threshold, creating a second broadcast receiver queue, or if the first target broadcast receiver processes the broadcast message accumulation timeout time reaches the third Set a time threshold to create a second broadcast receiver queue.
- the judgment condition for creating the second broadcast receiver queue may also be other forms.
- the historical timeout number meets the first setting condition, or the dynamic time threshold for judging the processing of the broadcast message timeout meets the first setting condition, and the specific manner is explained in detail in the following embodiments.
- S140 Move the first target broadcast receiver to the second broadcast receiver queue, so that the broadcast receiver other than the first target broadcast receiver is removed from the first broadcast receiver queue, and The first target broadcast recipient in the second broadcast recipient queue processes the broadcast message in parallel.
- the broadcast receiver except the first target broadcast receiver in the first broadcast receiver queue is the broadcast receiver remaining in the first broadcast receiver queue after moving the first target broadcast receiver.
- the first target broadcast recipient in the first broadcast recipient queue is moved to the second broadcast recipient queue to remove the broadcast from the first broadcast recipient queue other than the first target recipient.
- the receiver processes the broadcast message and causes the first target broadcast receiver to process the broadcast message in the second broadcast receiver queue, preventing the first target broadcast recipient from processing the broadcast message to be slow, affecting the first broadcast receiver queue.
- the situation in which other broadcast recipients process broadcast messages increases the speed at which broadcast messages are processed.
- the first target broadcast receiver is moved to the created second broadcast receiver queue by the first target broadcast receiver whose historical parameters in the first broadcast receiver queue meet the first set condition, so that the first broadcast receiver queues
- the broadcast receivers other than the first target broadcast receiver and the first target broadcast receiver in the second broadcast receiver queue are processed in parallel, which can improve the speed of processing the broadcast message, reduce the number of timeouts, and ensure system stability.
- the method for adjusting the broadcast receiver queue further includes: if the historical parameter of the second target broadcast recipient meets the second setting condition, setting the second target broadcast receiver as a dangerous application; The broadcast message is prohibited from being distributed to the second target broadcast recipient.
- the historical parameter includes a historical timeout period for processing a broadcast message, a historical time for processing a broadcast message, a historical timeout period for processing a broadcast message accumulation, or a dynamic time threshold for determining a timeout for processing a broadcast message; the dynamic time threshold is based on history The number of timeouts, the time increase value, and the initial set value of the dynamic time threshold are determined.
- the historical timeout period of the second target broadcast receiver processing the broadcast message reaches a preset number threshold, or the historical time when the second target broadcast receiver processes the broadcast message reaches the first preset time threshold, or the second target broadcast Receiving, by the receiver, the historical timeout period of the accumulated broadcast message reaches the second preset time threshold, or determining that the dynamic time threshold for processing the broadcast message timeout is greater than the preset value, setting the second target broadcast receiver as a dangerous application; and broadcasting the message Distribution to the second target broadcast recipient is prohibited.
- another broadcast receiver queue adjustment method is provided. As shown in FIG. 2, the technical solution provided in this embodiment includes:
- S210 Acquire a historical parameter of a broadcast recipient, where the historical parameter includes a historical timeout number of processing a broadcast message.
- S220 Determine whether the historical timeout period of processing the broadcast message reaches a first set threshold.
- the historical timeout period of the broadcast message processing by the broadcast receiver refers to the number of timeouts for processing the broadcast message before the current time, and may be the historical timeout period of the broadcast receiver processing the broadcast message in the preset time period, or may be broadcast. The number of historical timeouts for the receiver to process broadcast messages under other conditions.
- the historical timeout number is incremented once.
- the set fixed time threshold is 10 s
- the number of times the broadcast receiver processes the broadcast message increases once.
- the historical timeout number is increased once, wherein the dynamic time threshold is determined based on the initial set value, the historical timeout number, and the time increase value, and the time increase value is set for each increment. The number of timeouts, the amount of increase in the dynamic time threshold.
- a variable is created in the broadcast management module for identifying the timeout number and the adjustment time increase value of the broadcast receiver processing the broadcast message. Based on the number of timeouts of the identity, the number of historical timeouts for the broadcast receiver to process the broadcast message can be obtained.
- T1 is the initial set value of the dynamic time threshold
- C is the historical timeout number
- T0 is the time increase value, which is 1.
- the initial setting value of the dynamic time threshold is 10s
- the historical timeout is 1 time
- the time increase value may also be an increase of 1 s on the basis of the corresponding dynamic time threshold when the broadcast message is last processed, or may be other forms.
- the dynamic time threshold is determined by the historical timeout number and the time increase value, and the timeout number of the broadcast receiver processing the broadcast message can be reasonably controlled.
- S230 Create a second broadcast receiver queue if the historical timeout period of the first target broadcast receiver in the first broadcast receiver queue processing the broadcast message reaches the first set threshold.
- the first set threshold can be set as needed.
- S240 Move the first target broadcast receiver to the second broadcast receiver queue, so that the broadcast receiver other than the first target broadcast receiver is removed from the first broadcast receiver queue, And the first target broadcast recipient in the second broadcast recipient queue processes the broadcast message in parallel.
- the broadcast message processing can be improved by moving the first target broadcast receiver whose first time the number of times of processing the broadcast broadcast message in the first broadcast receiver queue reaches the first set threshold to the second broadcast receiver queue. Speed, improve system stability.
- the method further includes: acquiring a historical timeout period for the broadcast receiver to process the accumulation of the broadcast message; The history timeout adjusts the order of the broadcast recipients whose same number of historical timeouts are the same.
- the broadcast receiver processes the broadcast message for a total of 3 times, the first timeout is 1 s, the second timeout is 1 s, and the third timeout is 2 s, then the broadcast receiver processes the broadcast message accumulation history timeout.
- the broadcast receivers with the same number of timeouts are sorted according to the accumulated historical timeout period from small to large, so that the broadcast receivers with less accumulated timeouts are processed first.
- D and E are respectively two broadcast receivers arranged in sequence, and the processing broadcast history timeout times of D and E are the same, the timeout time of D accumulation is 1s, and the timeout time of E accumulation is 2s, and D and E are adjusted. Order so that E processes the next broadcast message before D.
- a broadcast receiver queue adjustment method is provided. As shown in FIG. 3, the technical solution provided in this embodiment is specifically as follows:
- S310 Acquire a historical parameter of a broadcast receiver, where the historical parameter includes a dynamic time threshold for determining a timeout for processing a broadcast message.
- the dynamic time threshold is determined based on the acquired historical timeout number, the time increase value, and the initial set value of the dynamic time threshold.
- the time increase value is an increase amount of the dynamic time threshold value for each time the number of timeouts is increased.
- S320 Determine whether the dynamic time threshold is greater than a second set threshold for the first time.
- the initial set value of the dynamic time threshold is less than the second set threshold; the second set threshold is a fixed value. Since the dynamic time threshold varies with the number of historical timeouts, there is a case where the dynamic time threshold is greater than the second set threshold. For example, the initial time value of the dynamic time threshold is 5 s, and the second set threshold is 10 s. If the number of timeouts increases once, the dynamic time threshold increases by 1 s. When the number of timeouts reaches 6 times, the dynamic time threshold is 11 s, which is greater than the first time. The second set threshold.
- S330 Create a second broadcast receiver queue if the dynamic time threshold corresponding to the first target broadcast receiver in the first broadcast receiver queue for determining that the processing broadcast message timeout is greater than the second set threshold for the first time.
- the number of timesout for the broadcast receiver to process the broadcast message corresponds to the dynamic time threshold. Therefore, the broadcast recipient corresponds to the dynamic time threshold based on the number of timeouts. For example, if the timeout number of the first target broadcast receiver processing the broadcast message is 0, it corresponds to the initial set value of the dynamic time threshold. That is, if the timeout number of the first target broadcast receiver processing the broadcast message is 0, it is determined whether the processing broadcast message times out based on the time of processing the broadcast message and the initial setting value of the dynamic time threshold.
- S340 Move the first target broadcast receiver to the second broadcast receiver queue, so that the broadcast receiver other than the first target broadcast receiver is removed from the first broadcast receiver queue, And the first target broadcast recipient in the second broadcast recipient queue processes the broadcast message in parallel.
- the first target broadcast receiver in the first broadcast receiver queue for determining that the dynamic time threshold for processing the broadcast message timeout is greater than the second set threshold for the first time is moved to the second broadcast receiver queue. It can improve the speed of processing broadcasts, reduce the number of timeouts, and ensure system stability.
- the method further includes: if the number of the first target broadcast receivers in the second broadcast receiver queue is greater than one, when receiving the target broadcast message, Detecting whether the first target broadcast receiver has processed the target broadcast message within a third set threshold; if it detects that the current first target broadcast receiver has not processed the target broadcast message within a third set threshold And distributing the target broadcast message to the next first target broadcast recipient.
- the broadcast management module does not receive the feedback information of the processing completion sent by the first target broadcast receiver within the third set threshold, determining that the first target broadcast receiver is in the third The target broadcast message is not processed within the set threshold. If the current first target broadcast recipient has not processed the target broadcast message within the third set threshold, the target broadcast message is distributed to the next first target broadcast recipient. For example, in the second broadcast receiver queue, there are A, B, and C in sequence, and a total of three first target broadcast receivers. If B does not process the target broadcast message within the third set threshold, the target broadcast message is sent. Distribute to C so that C processes the target broadcast message.
- the embodiment of the present application further provides a broadcast receiver queue adjustment apparatus, including a first acquisition module, a determination module, a creation module, and a mobile module, as follows:
- a first acquiring module configured to acquire a historical parameter of a broadcast receiver
- a determining module configured to determine whether the historical parameter meets the first setting condition
- a creating module configured to create a second broadcast receiver queue if a historical parameter of the first target broadcast receiver in the first broadcast receiver queue meets the first setting condition
- a mobile module configured to move the first target broadcast recipient into the second broadcast receiver queue to remove a broadcast recipient other than the first target broadcast recipient from a first broadcast recipient queue And the first target broadcast recipient in the second broadcast recipient queue broadcasts the message in parallel.
- the historical parameter includes a historical timeout period for processing a broadcast message
- the determining module is configured to determine whether a historical timeout period of processing a broadcast message reaches a first set threshold
- the creating module is configured to create a second broadcast receiver queue if a historical timeout period of processing the broadcast message by the first target broadcast receiver in the first broadcast receiver queue reaches the first set threshold.
- the historical timeout number is increased once;
- the historical timeout number is increased once, wherein the dynamic time threshold is determined based on the initial set value, the historical timeout number, and the time increase value.
- the time increase value is an increase amount of the dynamic time threshold for each set number of timeouts.
- the historical parameter includes a dynamic time threshold for determining a timeout for processing a broadcast message
- the determining module is configured to determine whether a dynamic time threshold for determining that the processing broadcast message times out is greater than a second set threshold for the first time;
- the creating module is configured to create a second broadcast receiving, if the dynamic time threshold corresponding to the first target broadcast receiver in the first broadcast receiver queue is used to determine that the processing broadcast message timeout is greater than the second set threshold for the first time. Queue
- the dynamic time threshold is determined based on the acquired historical timeout number, the time increase value, and the initial set value; the initial set value is less than the second set threshold; and the second set threshold is a fixed value. .
- the apparatus further includes:
- a dangerous application setting module configured to set the second target broadcast receiver as a dangerous application if the historical parameter of the second target broadcast recipient meets the second setting condition
- the historical parameter includes a historical timeout period for processing a broadcast message, a historical time for processing a broadcast message, a historical timeout period for processing a broadcast message accumulation, or a dynamic time threshold for determining a timeout for processing a broadcast message; the dynamic time threshold is based on history The number of timeouts, the time increase value, and the initial set value are determined.
- the historical parameter includes a historical timeout period for processing a broadcast message
- the method further includes:
- a second acquiring module configured to acquire a historical timeout period for the broadcast receiver to process the accumulated broadcast message
- an adjustment module configured to adjust an order of the broadcast recipients whose history timeout times are the same based on the accumulated historical timeout period.
- the apparatus further includes:
- the timeout queue tracking module 490 is configured to: if the number of the first target broadcast receivers is greater than one, when the target broadcast message is received, sequentially detecting whether the first target broadcast receiver is within a third preset value range Processing the target broadcast message;
- the target broadcast message is distributed to the next first target broadcast recipient.
- a broadcast receiver queue adjustment apparatus is further provided, and the apparatus is configured to execute a broadcast receiver queue adjustment method.
- the apparatus includes a first acquisition module 410 and a determination module 420.
- the module 430 and the mobile module 440 are created.
- the first obtaining module 410 is configured to acquire historical parameters of the broadcast receiver.
- the determining module 420 is configured to determine whether the historical parameter meets the first setting condition
- the creating module 430 is configured to create a second broadcast receiver queue if a historical parameter of the first target broadcast receiver in the first broadcast receiver queue meets the first setting condition;
- a mobile module 440 configured to move the first target broadcast receiver into the second broadcast receiver queue, so that the first broadcast receiver queue is removed from the broadcast receiver other than the first target broadcast receiver And the first target broadcast recipient in the second broadcast recipient queue broadcasts the message in parallel.
- the historical parameter includes a historical timeout period for processing a broadcast message
- the determining module 420 is configured to determine whether the historical timeout period of processing the broadcast message reaches a first set threshold
- the creating module 430 is configured to create a second broadcast receiver queue if the historical timeout period of the first target broadcast receiver in the first broadcast receiver queue processing the broadcast message reaches a first set threshold.
- the historical timeout number is increased once;
- the historical timeout number is increased once, wherein the dynamic time threshold is determined based on the initial set value, the historical timeout number, and the time increase value.
- the time increase value is an increase amount of the dynamic time threshold for each set number of timeouts.
- the historical parameter includes a dynamic time threshold for determining a timeout for processing a broadcast message
- the determining module 420 is configured to determine whether the dynamic time threshold for determining that the processing broadcast message times out is greater than the second set threshold for the first time;
- the creating module 430 is configured to create a second broadcast receiver if the dynamic time threshold corresponding to the first target broadcast receiver in the first broadcast receiver queue for determining that the processing broadcast message times out is greater than the second set threshold for the first time. queue;
- the dynamic time threshold is determined based on the acquired historical timeout number, the time increase value, and the initial set value; the initial set value is less than the second set threshold; and the second set threshold is a fixed value. .
- the device further includes:
- the dangerous application setting module 450 is configured to set the second target broadcast receiver as a dangerous application if the historical parameter of the second target broadcast recipient meets the second setting condition;
- the historical parameter includes a historical timeout period for processing a broadcast message, a historical time for processing a broadcast message, a historical timeout period for processing a broadcast message accumulation, or a dynamic time threshold for determining a timeout for processing a broadcast message; the dynamic time threshold is based on history The number of timeouts, the time increase value, and the initial set value are determined.
- the historical parameter includes a historical timeout number of processing a broadcast message
- the device further includes:
- the second obtaining module 470 is configured to acquire a historical timeout period for the broadcast receiver to process the accumulated broadcast message
- the adjusting module 480 is configured to adjust an order of the broadcast receivers whose history timeout times are the same based on the accumulated historical timeout period.
- the device further includes:
- the timeout queue tracking module 490 is configured to: if the number of the first target broadcast receivers is greater than one, when the target broadcast message is received, sequentially detecting whether the first target broadcast receiver is within a third preset value range Processing the target broadcast message;
- the target broadcast message is distributed to the next first target broadcast recipient.
- the broadcast receiver queue adjusting apparatus moves the first target broadcast receiver that matches the historical parameter in the first broadcast receiver queue to the first set broadcast condition to the created second broadcast receiver queue.
- the processing of the broadcast can be improved by causing the broadcast receiver other than the first target broadcast receiver in the first broadcast recipient queue and the first target broadcast receiver in the second broadcast receiver queue to process the broadcast message in parallel. Speed, reduce the number of timeouts, and ensure system stability.
- the embodiment of the present application further provides an electronic device, including a processor and a memory, where the memory stores a plurality of instructions, and the processor loads the instructions in the memory to perform the following steps:
- the first target broadcast recipient in the second broadcast recipient queue processes the broadcast message in parallel.
- an electronic device such as a smart phone, a tablet, or the like.
- the broadcast receiver queue adjustment apparatus provided by the embodiment of the present application can be integrated into the electronic device.
- the electronic device 500 can include: a memory 501, a central processing unit (Central) Processing A unit (CPU) 502 (also referred to as a processor, hereinafter referred to as a CPU), a touch screen 512, and a computer program stored on the memory and operable on the processor.
- the touch screen 512 is configured to convert a user operation into an electrical signal input to the processor and display a visual output signal; the CPU 502 implements the following steps when executing the computer program:
- the electronic device 500 further includes: a peripheral interface 503, RF (Radio) Frequency, RF) circuit 505, audio circuit 506, speaker 511, power management chip 508, input/output (I/O) subsystem 509, other input/control devices 510, and external port 504, which communicate via one or more The bus or signal line 507 is in communication.
- RF Radio
- RF Radio Frequency
- RF radio frequency
- the illustrated electronic device 500 is merely one example of a terminal, and that the electronic device 500 may have more or fewer components than those shown in the figures, two or more components may be combined, or Can have different component configurations.
- the various components shown in the figures can 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 electronic device integrated with the broadcast receiver queue adjusting device provided in this embodiment is described in detail below.
- the electronic device takes a mobile phone as an example.
- the memory 501 can be accessed by the CPU 502, the peripheral interface 503, etc., and the memory 501 can include a high speed random access memory, and can also include a non-volatile memory, such as one or more magnetic disk storage devices, flash memory devices. Or other volatile solid-state storage devices.
- a non-volatile memory such as one or more magnetic disk storage devices, flash memory devices. Or other volatile solid-state storage devices.
- Peripheral interface 503 which can connect the input and output peripherals of the device to CPU 502 and memory 501.
- the I/O subsystem 509 which can connect input and output peripherals on the device, such as touch screen 512 and other input/control devices 510, to peripheral interface 503.
- the I/O subsystem 509 can include a display controller 5091 and one or more input controllers 5092 for controlling other input/control devices 510.
- one or more input controllers 5092 receive electrical signals from other input/control devices 510 or transmit electrical signals to other input/control devices 510, and other input/control devices 510 may include physical buttons (press buttons, rocker buttons, etc.) ), dial, slide switch, joystick, click wheel.
- the input controller 5092 can be connected to any of the following: a keyboard, an infrared port, a USB interface, and a pointing device such as a mouse.
- the touch screen 512 is an input interface and an output interface between the user terminal and the user, and displays the visual output to the user.
- the visual output may include graphics, text, icons, videos, and the like.
- Display controller 5091 in I/O subsystem 509 receives electrical signals from touch screen 512 or transmits electrical signals to touch screen 512.
- the touch screen 512 detects the contact on the touch screen, and the display controller 5091 converts the detected contact into an interaction with the user interface object displayed on the touch screen 512, that is, realizes human-computer interaction, and the user interface object displayed on the touch screen 512 can be operated.
- the icon of the game, the icon of the network to the corresponding network, and the like.
- the device may also include a light mouse, which is a touch sensitive surface that does not display a visual output, or an extension of a touch sensitive surface formed by the touch screen.
- the RF circuit 505 is mainly used for establishing communication between the mobile phone and the wireless network (ie, the network side), and realizing data reception and transmission between the mobile phone and the wireless network. For example, sending and receiving short messages, emails, and the like. Specifically, the RF circuit 505 receives and transmits an RF signal, which is also referred to as an electromagnetic signal, and the RF circuit 505 converts the electrical signal into an electromagnetic signal or converts the electromagnetic signal into an electrical signal, and through the electromagnetic signal and communication network and other devices Communicate.
- an RF signal which is also referred to as an electromagnetic signal
- RF circuitry 505 may include known circuitry for performing these functions including, but not limited to, an antenna system, an RF transceiver, one or more amplifiers, a tuner, one or more oscillators, a digital signal processor, a CODEC ( COder-DECoder, codec) chipset, user identification module (Subscriber Identity Module, SIM) and more.
- CODEC COder-DECoder, codec
- the audio circuit 506 is mainly used to receive audio data from the peripheral interface 503, convert the audio data into an electrical signal, and transmit the electrical signal to the speaker 511.
- the speaker 511 is configured to restore the voice signal received by the mobile phone from the wireless network through the RF circuit 505 to sound and play the sound to the user.
- the power management chip 508 is used for power supply and power management of the hardware connected to the CPU 502, the I/O subsystem, and the peripheral interface.
- the electronic device provided in this embodiment is used to perform the broadcast receiver queue adjustment method described in the foregoing embodiment, and the technical principle and the generated technical effect are similar, and details are not described herein again.
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
- Telephonic Communication Services (AREA)
Abstract
本申请实施例公开了一种广播接收者队列调整方法、装置、存储介质及电子设备,其中该方法,包括:获取广播接收者的历史参数;判断所述历史参数是否符合第一设定条件;若第一广播接收者队列中的第一目标广播接收者的历史参数符合所述第一设定条件,创建第二广播接收者队列;将所述第一目标广播接收者移动到所述第二广播接收者队列中,以使所述第一广播接收者队列中除去所述第一目标广播接收者之外的广播接收者、以及所述第二广播接收者队列中的所述第一目标广播接收者并行处理广播消息。
Description
本申请要求于2017年3月10日提交中国专利局、申请号为201710141454.4、发明名称为“一种广播接收者队列调整方法、装置及终端”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本发明涉及终端技术领域,尤其涉及一种广播接收者队列调整方法、装置、存储介质及电子设备。
Android系统中广播是一种广泛运用在应用程序之间传输信息的机制,Android中的广播用于监听系统事件或应用程序事件。
在Android系统中,一些应用在后台通过接收各种各样的广播消息进行自启动或者执行其他操作。在一些应用接收广播消息时,由于应用本身可能在执行一些耗时的操作或者应用本身出现卡顿的情况,导致接收到的广播消息无法及时处理,甚至有些应用对广播消息还会超时处理,影响广播消息的后续分发,使系统耗电,稳定性差。
本申请实施例提供一种广播接收者队列调整方法、装置、存储介质及电子设备,可以提高广播消息处理速度,提高系统的稳定性。
第一方面,本申请实施例提供了一种广播接收者队列调整方法,包括:
获取广播接收者的历史参数;
判断所述历史参数是否符合第一设定条件;
若第一广播接收者队列中的第一目标广播接收者的历史参数符合所述第一设定条件,创建第二广播接收者队列;
将所述第一目标广播接收者移动到所述第二广播接收者队列中,以使所述第一广播接收者队列中除去所述第一目标广播接收者之外的广播接收者、以及所述第二广播接收者队列中的所述第一目标广播接收者并行处理广播消息。
第二方面,本申请实施例还提供了一种广播接收者队列调整装置,包括:
第一获取模块,用于获取广播接收者的历史参数;
判断模块,用于判断所述历史参数是否符合第一设定条件;
创建模块,用于若第一广播接收者队列中的第一目标广播接收者的历史参数符合所述第一设定条件,创建第二广播接收者队列;
移动模块,用于将所述第一目标广播接收者移动到所述第二广播接收者队列中,以使第一广播接收者队列中除去所述第一目标广播接收者之外广播接收者、以及所述第二广播接收者队列中的所述第一目标广播接收者并行广播消息。
第三方面,本申请实施例提供了一种存储介质,所述存储介质中存储有多条指令,所述指令适于由处理器加载以执行如上述第一方面所述的广播接收者队列调整方法。
第四方面,本申请实施例还提供了一种电子设备,包括存储器和处理器,所述存储器存储有多条指令,所述处理器加载所述存储器中的指令用于执行以下步骤:
获取广播接收者的历史参数;
判断所述历史参数是否符合第一设定条件;
若第一广播接收者队列中的第一目标广播接收者的历史参数符合所述第一设定条件,创建第二广播接收者队列;
将所述第一目标广播接收者移动到所述第二广播接收者队列中,以使所述第一广播接收者队列中除去所述第一目标广播接收者之外的广播接收者、以及所述第二广播接收者队列中的所述第一目标广播接收者并行处理广播消息。
本申请实施例提供一种广播接收者队列调整方法、装置、存储介质及电子设备,可以提高广播消息处理速度,提高系统的稳定性。
通过阅读参照以下附图所作的对非限制性实施例所作的详细描述,本发明的其它特征、目的和优点将会变得更明显:
图1a是本申请实施例提供的广播接收者队列调整方法的应用场景图。
图1b是本申请实施例提供的广播接收者队列调整方法的流程图。
图2是本申请实施例提供的广播接收者队列调整方法的另一流程图。
图3是本申请实施例提供的广播接收者队列调整方法的又一流程图。
图4是本申请实施例提供的广播接收者队列调整装置的结构框图。
图5是本申请实施例提供的电子设备的结构示意图。
下面结合附图和实施例对本发明作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释本发明,而非对本发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与本发明相关的部分而非全部内容。
目前的广播方案中,缺乏对广播接收者(应用)的管理机制,例如:广播接收者队列中的有些应用,其本身可能在执行一些耗时的操作或者应用本身出现卡顿,这就会导致其接收到的广播消息无法及时处理,影响广播消息的后续分发,使系统耗电,稳定性差。
本申请实施例提供了一种广播接收者队列调整方法,包括以下步骤:
获取广播接收者的历史参数;
判断所述历史参数是否符合第一设定条件;
若第一广播接收者队列中的第一目标广播接收者的历史参数符合所述第一设定条件,创建第二广播接收者队列;
将所述第一目标广播接收者移动到所述第二广播接收者队列中,以使所述第一广播接收者队列中除去所述第一目标广播接收者之外的广播接收者、以及所述第二广播接收者队列中的所述第一目标广播接收者并行处理广播消息。
一实施例中,所述历史参数包括处理广播消息的历史超时次数;
所述判断所述历史参数是否符合第一设定条件,包括:
判断处理广播消息的历史超时次数是否达到第一设定阈值;
所述若第一广播接收者队列中的第一目标广播接收者的历史参数符合所述第一设定条件,创建第二广播接收者队列,包括:
若第一广播接收者队列中的第一目标广播接收者处理广播消息的历史超时次数达到所述第一设定阈值,创建第二广播接收者队列。
一实施例中,当所述广播接收者处理广播消息的时间大于设定的固定时间阈值时,所述历史超时次数增加一次;或者
当所述广播接收者处理广播消息的时间大于动态时间阈值时,所述历史超时次数增加一次,其中,所述动态时间阈值基于初始设定值、所述历史超时次数以及时间增幅值进行确定,所述时间增幅值为每增加设定数量的超时次数,所述动态时间阈值的增加量。
一实施例中,所述历史参数包括用于判断处理广播消息超时的动态时间阈值;
所述判断所述历史参数是否符合第一设定条件,包括:
判断用于判断处理广播消息超时的动态时间阈值是否首次大于第二设定阈值;
所述若第一广播接收者队列中的第一目标广播接收者的历史参数符合所述第一设定条件,创建第二广播接收者队列,包括:
若第一广播接收者队列中的第一目标广播接收者对应的用于判断处理广播消息超时的动态时间阈值首次大于所述第二设定阈值,创建第二广播接收者队列;
其中,所述动态时间阈值基于获取的历史超时次数、时间增幅值以及初始设定值进行确定;所述初始设定值小于所述第二设定阈值;所述第二设定阈值为固定值。
一实施例中,若第二目标广播接收者的历史参数符合第二设定条件,设置所述第二目标广播接收者为危险应用;
将广播消息禁止分发给所述第二目标广播接收者;
其中,所述历史参数包括处理广播消息的历史超时次数、处理广播消息的历史时间、处理广播消息累加的历史超时时间或用于判断处理广播消息超时的动态时间阈值;所述动态时间阈值基于历史超时次数、时间增幅值以及初始设定值进行确定。
一实施例中,所述历史参数包括处理广播消息的历史超时次数,还包括:
获取所述广播接收者处理广播消息累加的历史超时时间;
基于累加的所述历史超时时间调整所述历史超时次数相同的广播接收者的顺序。
一实施例中,若所述第一目标广播接收者的数量大于1个,当接收到目标广播消息时,依次检测所述第一目标广播接收者在第三设定阈值内是否处理完所述目标广播消息;
若检测到当前第一目标广播接收者在第三设定阈值没有处理完所述目标广播消息,将所述目标广播消息分发给下一个第一目标广播接收者。
本申请实施例提供的广播接收者队列调整方法,可以由本申请实施例所提供的广播接收者队列调整装置来执行,该装置可以由软件和/或硬件的方式来实现,并可集成于电子设备中,该电子设备可以是智能手机、平板电脑、掌上电脑、笔记本电脑等设备。
以本申请实施例提供的广播接收者队列调整装置集成于电子设备中为例,本申请实施例的广播接收者队列调整方法的一个具体应用场景,可如图1a所示,例如:电子设备的第一广播接收者队列中包括应用A、应用B和应用C,可以获取每个应用的历史参数,判断每个应用的历史参数是否符合第一设定条件,若存在符合第一设定条件的应用,则创建第二广播接收者队列,将符合第一设定条件的应用移动到第二广播接收者队列中,比如:第一广播接收者队列中的应用A符合第一设定条件,则将应用A移动到第二广播接收者队列中,使得第一广播接收者队列中的剩余应用(应用B和应用C)与第二广播接收者队列中移动过来的应用(应用A)并行处理广播消息。
本申请实施例提供的技术方案,通过将第一广播接收者队列中的历史参数符合第一设定条件的第一目标广播接收者移动到创建的第二广播接收者队列中,以使第一广播接收者队列中的除去第一目标广播接收者之外的广播接收者、以及第二广播接收者队列中的第一目标广播接收者并行处理广播消息,能够提高处理广播的速度,减少超时次数,保证系统稳定。
在一优选实施例中,提供了一种广播接收者队列调整方法,所述方法由广播接收者队列调整装置来执行,如图1b所示,本实施例提供的技术方案如下:
S110:获取广播接收者的历史参数。
在广播处理过程中,广播发送者的服务进程通过调用广播发送函数(如sendBroadcast函数)将广播消息发送至广播管理模块(如ActivityManagerService,活动管理服务),广播管理模块接收到该广播消息后将其放入广播发送队列,广播管理模块通过进程通信机制(如Binder进程通信机制)将广播发送队列中的广播消息发送至符合接收条件的广播接收者。
在广播机制中,广播消息指的是系统或者应用程序在运行过程中发送的,用于系统和/或应用程序之间传输的信息。示例性的,广播消息可以是系统启动广播消息、短信类广播消息、电话类广播消息或者三方应用类广播消息等。
在本实施例中,对于注册同一广播消息的广播接收者而言,当广播消息下发时,广播接收者以队列的方式进行排序,并按照顺序处理广播消息。
本实施例中,广播接收者的历史参数包括处理广播消息的历史超时次数、处理广播消息的历史时间,处理广播消息累加的历史超时时间或者用于判断处理广播消息超时的动态时间阈值,并且广播接收的历史参数并不局限于上述的参数形式。
其中,广播接收者处理广播消息的历史超时次数可以是广播接收者在预设时间段内处理广播消息的历史超时次数。
其中,广播接收者处理广播消息的历史时间可以是广播接收者在预设时间段内处理广播消息的历史时间,或者也可以是广播接收者在预设次数内处理广播消息的历史时间。其中,广播接收者在预设时间段内可以处理多个广播消息,因此,广播接收者处理在预设时间段处理广播消息的历史时间可以包括多个,即每处理一个广播消息对应一个处理时间。预设次数可以是一次也可以是多次,当预设次数是一次时,广播接收者处理广播消息的历史时间可以是最近一次处理广播消息的时间。
其中,历史超时时间是广播接收者在预设时间段内或者预设次数内处理广播消息的时间超出一设定值的时间,该设定值可以固定不变,也可以随超时次数的变化而变化。累加的历史超时时间是将每次超过一设定值的时间进行相加,并求和获得的时间。
其中,用于判断处理广播消息超时的动态时间阈值是指当广播接收者处理广播消息的时间大于动态时间阈值时,判断该广播接收者处理广播消息超时。其中,动态时间阈值基于初始设定值、历史超时次数以及时间增幅值进行确定,其中,时间增幅值为每增加设定数量的超时次数,动态时间阈值的增加量。
S120:判断所述历史参数是否符合第一设定条件。
其中,第一设定条件可以是超时次数达到一个设定次数阈值;或者也可以是基于处理广播消息的历史时间计算的历史平均时间达到第一设定时间阈值;或者也可以是处理广播消息的最近一次历史时间达到第二设定时间阈值;或者也可以是处理广播消息的累加的历史超时时间达到第三设定时间阈值,或者用于判断处理广播消息超时的动态时间阈值首次大于一个设定阈值,且该动态时间阈值的初始设定值小于该设定阈值。第一设定条件并不局限于上述的几种形式,还可以是其他形式。
S130:若第一广播接收者队列中的第一目标广播接收者的历史参数符合第一设定条件,创建第二广播接收者队列。
在本实施例中,每一个广播消息对应一个广播接收者队列,第一广播接收者队列中的广播接收者注册了至少一个相同的广播消息。
在本实施例中,当接收到广播消息时,若第一广播接收者队列中的第一目标广播接收者的历史参数符合第一设定条件,可以创建第二广播接收者队列;或者没有接收到广播消息时,若第一广播接收者队列中的第一目标广播接收者的历史参数符合第一设定条件,也可以创建第二广播接收者队列。
其中,若历史参数包括处理广播消息的时间,若第一目标广播接收者最近一次处理广播消息的时间大于第二设定时间阈值,创建第二广播接收者队列。或者若第一目标广播接收者处理广播消息的历史平均时间大于第一设定时间阈值,创建第二广播接收者队列,或者若第一目标广播接收者处理广播消息累加的历史超时时间达到第三设定时间阈值,创建第二广播接收者队列。
其中,对于创建第二广播接收者队列的判断条件还可以是其他形式。例如,历史超时次数符合第一设定条件,或者用于判断处理广播消息超时的动态时间阈值符合第一设定条件,具体的方式在下述实施例中进行详解。
S140:将所述第一目标广播接收者移动到所述第二广播接收者队列中,以使第一广播接收者队列中除去所述第一目标广播接收者之外的广播接收者,以及所述第二广播接收者队列中的所述第一目标广播接收者并行处理广播消息。
其中,第一广播接收者队列中除去第一目标广播接收者之外的广播接收者为:将第一目标广播接收者移动后,第一广播接收者队列中剩余的广播接收者。
在本实施例中,将第一广播接收者队列中的第一目标广播接收者移动到第二广播接收者队列中,以使第一广播接收者队列中除去第一目标接收者之外的广播接收者处理广播消息,并使第一目标广播接收者在第二广播接收者队列中处理广播消息,避免了第一目标广播接收者处理广播消息速度较慢,影响第一广播接收者队列中的其他广播接收者处理广播消息的情况,提高了处理广播消息的速度。
本实施例中,通过将第一广播接收者队列中的历史参数符合第一设定条件的第一目标广播接收者移动到创建的第二广播接收者队列中,以使第一广播接收者队列中除去第一目标广播接收者之外的广播接收者以及第二广播接收者队列中的第一目标广播接收者并行处理广播消息,能够提高处理广播消息的速度,减少超时次数,保证系统稳定。
在上述实施例的基础上,所述广播接收者队列调整的方法还包括:若第二目标广播接收者的历史参数符合第二设定条件,设置所述第二目标广播接收者为危险应用;将广播消息禁止分发给所述第二目标广播接收者。其中,所述历史参数包括处理广播消息的历史超时次数、处理广播消息的历史时间、处理广播消息累加的历史超时时间或用于判断处理广播消息超时的动态时间阈值;所述动态时间阈值基于历史超时次数、时间增幅值以及所述动态时间阈值的初始设定值进行确定。
具体的,若第二目标广播接收者处理广播消息的历史超时次数达到一预设次数阈值,或者第二目标广播接收者处理广播消息的历史时间达到第一预设时间阈值,或者第二目标广播接收者处理广播消息累加的历史超时时间达到第二预设时间阈值,或者用于判断处理广播消息超时的动态时间阈值大于预设值,设置第二目标广播接收者为危险应用;并将广播消息禁止分发给第二目标广播接收者。
由此,通过禁止分发给设定为危险应用的第二目标广播接收者广播消息,能够提高广播消息处理的速度,避免处理速度较慢的广播接收者处理广播消息时对其他广播接收者的影响。
在一优选实施例中,提供了另一种广播接收者队列调整方法,如图2所示,本实施例提供的技术方案包括:
S210:获取广播接收者的历史参数,其中,所述历史参数包括处理广播消息的历史超时次数。
S220:判断处理广播消息的历史超时次数是否达到第一设定阈值。
在本实施例中,广播接收者处理广播消息的历史超时次数是指在当前之前处理广播消息的超时次数,可以是预设时间段内广播接收者处理广播消息的历史超时次数,也可以是广播接收者在其他条件下处理广播消息的历史超时次数。
在本实施例中,当广播接收者处理广播消息的时间大于设定的固定时间阈值时,历史超时次数增加一次。例如,设定的固定时间阈值为10s,当广播接收者处理广播消息的时间大于10s时,广播接收者处理广播消息的超时次数增加一次。
或者当广播接收者处理广播消息的时间大于动态时间阈值时,历史超时次数增加一次,其中,动态时间阈值基于初始设定值、历史超时次数以及时间增幅值进行确定,时间增幅值为每增加设定数量的超时次数,动态时间阈值的增加量。
在本实施例中,在广播管理模块中创建一个变量,用于标识广播接收者处理广播消息的超时次数和调整时间增幅值。基于标识的超时次数就可以获取广播接收者处理广播消息的历史超时次数。
例如,每增加一次历史超时次数,动态时间阈值在上一次处理广播消息时对应动态时间阈值的的基础上增加1s,采用公式表述为:T=C×T0+T1。其中,T1为动态时间阈值的初始设定值,C为历史超时次数,T0为时间增幅值,即为1。若动态时间阈值的初始设定值为10s,若历史超时次数为1次,动态时间阈值为:1×1+10=11s,即在初始设定值的基础上增加1s,为11s。若再次处理广播消息的时间小于11s,则不超时,若处理广播消息的时间大于11s,则超时,历史超时次数增加1次。时间增幅值或者也可以是每增加两次超时次数,在上一次处理广播消息时对应的动态时间阈值的基础上增加1s,或者还可以是其他形式。
并且通过历史超时次数和时间增幅值确定动态时间阈值,能够合理控制广播接收者处理广播消息的超时次数。
S230:若第一广播接收者队列中的第一目标广播接收者处理广播消息的历史超时次数达到所述第一设定阈值,创建第二广播接收者队列。
在本实施例中,第一设定阈值可根据需要进行设定。
S240:将所述第一目标广播接收者移动到所述第二广播接收者队列中,以使所述第一广播接收者队列中除去所述第一目标广播接收者之外的广播接收者、以及所述第二广播接收者队列中的所述第一目标广播接收者并行处理广播消息。
本实施例中,通过将第一广播接收者队列中的处理广播消息的历史超时次数达到第一设定阈值的第一目标广播接收者移动到第二广播接收者队列中,可以提高广播消息处理速度,提高系统的稳定性。
在上述实施例的基础上,当所述历史参数包括处理广播消息的历史超时次数时,所述的方法还包括:获取所述广播接收者处理广播消息累加的历史超时时间;基于累加的所述历史超时时间调整所述历史超时次数相同的广播接收者的顺序。
例如,在预设时间段内,广播接收者处理广播消息共超时3次,第一次超时1s,第二次超时1s,第三次超时2s,则该广播接收者处理广播消息累加的历史超时时间为:3次超时时间之和,即为4s(1+1+2=4)。
具体的,在预设时间段内或预设次数内,将超时次数相同的广播接收者按照累加的历史超时时间从少到多进行排序,以使累加的超时时间较少的广播接收者先处理广播消息,提高广播消息的速度。例如,D和E分别是依次排列的两个广播接收者,且D和E的处理广播历史超时的次数相同,D累加的超时时间为1s,E累加的超时时间为2s,调整D和E的顺序,以使E在D之前处理下一个广播消息。
在一优选实施例中,提供了又一种广播接收者队列调整方法,如图3所示,本实施例提供的技术方案具体如下:
S310:获取广播接收者的历史参数,其中,所述历史参数包括用于判断处理广播消息超时的动态时间阈值。
在本实施例中,动态时间阈值基于获取的历史超时次数、时间增幅值以及所述动态时间阈值的初始设定值进行确定。其中,时间增幅值为每增加设定数量的超时次数,所述动态时间阈值的增加量。
S320:判断所述动态时间阈值是否首次大于第二设定阈值。
在本实施例中,动态时间阈值的初始设定值小于第二设定阈值;第二设定阈值为固定值。由于动态时间阈值随历史超时次数而变化,因此,存在动态时间阈值大于第二设定阈值的情况。例如,动态时间阈值的初始设定值为5s,第二设定阈值为10s,若每超时次数增加一次,动态时间阈值增加1s,当超时次数达到6次时,动态时间阈值为11s,首次大于第二设定阈值。
S330:若第一广播接收者队列中的第一目标广播接收者对应的用于判断处理广播消息超时的动态时间阈值首次大于第二设定阈值,创建第二广播接收者队列。
在本实施例中,广播接收者处理广播消息的超时次数与动态时间阈值相对应。因此,广播接收者基于超时次数与动态时间阈值对应。例如,若第一目标广播接收者处理广播消息的超时次数为0,对应的是动态时间阈值的初始设定值。即若第一目标广播接收者处理广播消息的超时次数为0,判断处理广播消息是否超时基于处理广播消息的时间与动态时间阈值的初始设定值。
S340:将所述第一目标广播接收者移动到所述第二广播接收者队列中,以使所述第一广播接收者队列中除去所述第一目标广播接收者之外的广播接收者、以及所述第二广播接收者队列中的所述第一目标广播接收者并行处理广播消息。
本实施例中,通过将第一广播接收者队列中的用于判断处理广播消息超时的动态时间阈值首次大于第二设定阈值的第一目标广播接收者移动到第二广播接收者队列中,可以提高处理广播的速度,减少超时次数,保证系统稳定。
在上述各实施例的基础上,所述的方法还包括:若所述第二广播接收者队列中的所述第一目标广播接收者的数量大于1个,当接收到目标广播消息时,依次检测所述第一目标广播接收者在第三设定阈值内是否处理完所述目标广播消息;若检测到当前第一目标广播接收者在第三设定阈值内没有处理完所述目标广播消息,将所述目标广播消息分发给下一个第一目标广播接收者。
具体的,从开始处理目标广播消息开始,在第三设定阈值内,广播管理模块没有收到第一目标广播接收者发送的处理完成的反馈信息,则判定第一目标广播接收者在第三设定阈值内没有处理完目标广播消息。若当前第一目标广播接收者在第三设定阈值内没有处理完目标广播消息,将目标广播消息分发给下一个第一目标广播接收者。例如,在第二广播接收者队列中,依次存在A、B和C,共3个第一目标广播接收者,若B在第三设定阈值内没有处理完目标广播消息,则将目标广播消息分发给C,以使C处理目标广播消息。
由此,能够避免处理速度较慢的广播接收者对其他广播接收者的影响,提高广播消息处理的速度。
本申请实施例还提供了一种广播接收者队列调整装置,包括第一获取模块、判断模块、创建模块和移动模块,如下:
第一获取模块,用于获取广播接收者的历史参数;
判断模块,用于判断所述历史参数是否符合第一设定条件;
创建模块,用于若第一广播接收者队列中的第一目标广播接收者的历史参数符合所述第一设定条件,创建第二广播接收者队列;
移动模块,用于将所述第一目标广播接收者移动到所述第二广播接收者队列中,以使第一广播接收者队列中除去所述第一目标广播接收者之外的广播接收者、以及所述第二广播接收者队列中的所述第一目标广播接收者并行广播消息。
一实施例中,所述历史参数包括处理广播消息的历史超时次数;
所述判断模块,用于判断处理广播消息的历史超时次数是否达到第一设定阈值;
所述创建模块,用于若第一广播接收者队列中的第一目标广播接收者处理广播消息的历史超时次数达到所述第一设定阈值,创建第二广播接收者队列。
一实施例中,当所述广播接收者处理广播消息的时间大于设定的固定时间阈值时,所述历史超时次数增加一次;或者
当所述广播接收者处理广播消息的时间大于动态时间阈值时,所述历史超时次数增加一次,其中,所述动态时间阈值基于初始设定值、所述历史超时次数以及时间增幅值进行确定,所述时间增幅值为每增加设定数量的超时次数,所述动态时间阈值的增加量。
一实施例中,所述历史参数包括用于判断处理广播消息超时的动态时间阈值;
所述判断模块,用于判断用于判断处理广播消息超时的动态时间阈值是否首次大于第二设定阈值;
所述创建模块,用于若第一广播接收者队列中的第一目标广播接收者对应的用于判断处理广播消息超时的动态时间阈值首次大于所述第二设定阈值,创建第二广播接收者队列;
其中,所述动态时间阈值基于获取的历史超时次数、时间增幅值以及初始设定值进行确定;所述初始设定值小于所述第二设定阈值;所述第二设定阈值为固定值。
一实施例中,所述装置还包括:
危险应用设置模块,用于若第二目标广播接收者的历史参数符合第二设定条件,设置所述第二目标广播接收者为危险应用;
禁止分发模块,用于将广播消息禁止分发给所述第二目标广播接收者;
其中,所述历史参数包括处理广播消息的历史超时次数、处理广播消息的历史时间、处理广播消息累加的历史超时时间或用于判断处理广播消息超时的动态时间阈值;所述动态时间阈值基于历史超时次数、时间增幅值以及初始设定值进行确定。
一实施例中,所述历史参数包括处理广播消息的历史超时次数,还包括:
第二获取模块,用于获取所述广播接收者处理广播消息累加的历史超时时间;
调整模块,用于基于累加的所述历史超时时间调整所述历史超时次数相同的广播接收者的顺序。
一实施例中,所述装置还包括:
超时队列跟踪模块490,用于若所述第一目标广播接收者的数量大于1个,当接收到目标广播消息时,依次检测所述第一目标广播接收者在第三预设值范围内是否处理完所述目标广播消息;
若检测到当前第一目标广播接收者在第三设定阈值内处理完所述目标广播消息,将所述目标广播消息分发给下一个第一目标广播接收者。
在一优选实施例中,还提供一种广播接收者队列调整装置,所述装置用于执行广播接收者队列调整方法,如图4所示,所述装置包括第一获取模块410、判断模块420,创建模块430和移动模块440。
其中,第一获取模块410,用于获取广播接收者的历史参数;
判断模块420,用于判断所述历史参数是否符合第一设定条件;
创建模块430,用于若第一广播接收者队列中的第一目标广播接收者的历史参数符合所述第一设定条件,创建第二广播接收者队列;
移动模块440,用于将所述第一目标广播接收者移动到所述第二广播接收者队列中,以使第一广播接收者队列中除去所述第一目标广播接收者之外广播接收者、以及所述第二广播接收者队列中的所述第一目标广播接收者并行广播消息。
进一步的,所述历史参数包括处理广播消息的历史超时次数;
所述判断模块420,用于判断处理广播消息的历史超时次数是否达到第一设定阈值;
所述创建模块430,用于若第一广播接收者队列中的第一目标广播接收者处理广播消息的历史超时次数达到第一设定阈值,创建第二广播接收者队列。
进一步的,当所述广播接收者处理广播消息的时间大于设定的固定时间阈值时,所述历史超时次数增加一次;或者
当所述广播接收者处理广播消息的时间大于动态时间阈值时,所述历史超时次数增加一次,其中,所述动态时间阈值基于初始设定值、所述历史超时次数以及时间增幅值进行确定,所述时间增幅值为每增加设定数量的超时次数,所述动态时间阈值的增加量。
进一步的,所述历史参数包括用于判断处理广播消息超时的动态时间阈值;
所述判断模块420,用于判断用于判断处理广播消息超时的动态时间阈值是否首次大于第二设定阈值;
所述创建模块430,用于若第一广播接收者队列中的第一目标广播接收者对应的用于判断处理广播消息超时的动态时间阈值首次大于第二设定阈值,创建第二广播接收者队列;
其中,所述动态时间阈值基于获取的历史超时次数、时间增幅值以及初始设定值进行确定;所述初始设定值小于所述第二设定阈值;所述第二设定阈值为固定值。
进一步的,所述装置还包括:
危险应用设置模块450,用于若第二目标广播接收者的历史参数符合第二设定条件,设置所述第二目标广播接收者为危险应用;
禁止分发模块460,用于将广播消息禁止分发给所述第二目标广播接收者;
其中,所述历史参数包括处理广播消息的历史超时次数、处理广播消息的历史时间、处理广播消息累加的历史超时时间或用于判断处理广播消息超时的动态时间阈值;所述动态时间阈值基于历史超时次数、时间增幅值以及初始设定值进行确定。
进一步的,所述历史参数包括处理广播消息的历史超时次数,所述装置还包括:
第二获取模块470,用于获取所述广播接收者处理广播消息累加的历史超时时间;
调整模块480,用于基于累加的所述历史超时时间调整所述历史超时次数相同的广播接收者的顺序。
进一步的,所述装置还包括:
超时队列跟踪模块490,用于若所述第一目标广播接收者的数量大于1个,当接收到目标广播消息时,依次检测所述第一目标广播接收者在第三预设值范围内是否处理完所述目标广播消息;
若检测到当前第一目标广播接收者在第三设定阈值内处理完所述目标广播消息,将所述目标广播消息分发给下一个第一目标广播接收者。
本实施例提供的一种广播接收者队列调整装置,通过将第一广播接收者队列中的历史参数符合第一设定条件的第一目标广播接收者移动到创建的第二广播接收者队列中,以使第一广播接收者队列中的除去第一目标广播接收者之外的广播接收者、以及第二广播接收者队列中的第一目标广播接收者并行处理广播消息,能够提高处理广播的速度,减少超时次数,保证系统稳定。
本申请实施例还提供一种电子设备,包括处理器和存储器,所述存储器存储有多条指令,所述处理器加载所述存储器中的指令用于执行以下步骤:
获取广播接收者的历史参数;
判断所述历史参数是否符合第一设定条件;
若第一广播接收者队列中的第一目标广播接收者的历史参数符合所述第一设定条件,创建第二广播接收者队列;
将所述第一目标广播接收者移动到所述第二广播接收者队列中,以使所述第一广播接收者队列中除去所述第一目标广播接收者之外的广播接收者、以及所述第二广播接收者队列中的所述第一目标广播接收者并行处理广播消息。
在一优选实施例中,还提供一种电子设备,该电子设备比如可以是智能手机、平板电脑等设备。该电子设备中可集成本申请实施例提供的广播接收者队列调整装置。如图5所示,该电子设备500可以包括:存储器501、中央处理器(Central
Processing
Unit,CPU)502(又称处理器,以下简称CPU)、触摸屏512以及存储在存储器上并可在处理器上运行的计算机程序。所述触摸屏512,用于将用户操作转换成电信号输入至所述处理器,并显示可视输出信号;CPU502执行计算机程序时实现以下步骤:
在正常的广播接收者队列中,获取广播接收者处理广播消息的历史时间;获取广播接收者的历史参数;判断所述历史参数是否符合第一设定条件;若第一广播接收者队列中的第一目标广播接收者的历史参数符合所述第一设定条件,创建第二广播接收者队列;将所述第一目标广播接收者移动到所述第二广播接收者队列中,以使所述第一广播接收者队列中除去所述第一目标广播接收者之外的广播接收者、以及所述第二广播接收者队列中的所述第一目标广播接收者并行处理广播消息。
所述电子设备500还包括:外设接口503、RF(Radio
Frequency,射频)电路505、音频电路506、扬声器511、电源管理芯片508、输入/输出(I/O)子系统509、其他输入/控制设备510以及外部端口504,这些部件通过一个或多个通信总线或信号线507来通信。
应该理解的是,图示电子设备500仅仅是终端的一个范例,并且电子设备500可以具有比图中所示出的更多的或者更少的部件,可以组合两个或更多的部件,或者可以具有不同的部件配置。图中所示出的各种部件可以在包括一个或多个信号处理和/或专用集成电路在内的硬件、软件、或硬件和软件的组合中实现。
下面就本实施例提供的集成有广播接收者队列调整装置的电子设备进行详细的描述,该电子设备以手机为例。
存储器501,所述存储器501可以被CPU502、外设接口503等访问,所述存储器501可以包括高速随机存取存储器,还可以包括非易失性存储器,例如一个或多个磁盘存储器件、闪存器件、或其他易失性固态存储器件。
外设接口503,所述外设接口503可以将设备的输入和输出外设连接到CPU502和存储器501。
I/O子系统509,所述I/O子系统509可以将设备上的输入输出外设,例如触摸屏512和其他输入/控制设备510,连接到外设接口503。I/O子系统509可以包括显示控制器5091和用于控制其他输入/控制设备510的一个或多个输入控制器5092。其中,一个或多个输入控制器5092从其他输入/控制设备510接收电信号或者向其他输入/控制设备510发送电信号,其他输入/控制设备510可以包括物理按钮(按压按钮、摇臂按钮等)、拨号盘、滑动开关、操纵杆、点击滚轮。值得说明的是,输入控制器5092可以与以下任一个连接:键盘、红外端口、USB接口以及诸如鼠标的指示设备。
触摸屏512,所述触摸屏512是用户终端与用户之间的输入接口和输出接口,将可视输出显示给用户,可视输出可以包括图形、文本、图标、视频等。
I/O子系统509中的显示控制器5091从触摸屏512接收电信号或者向触摸屏512发送电信号。触摸屏512检测触摸屏上的接触,显示控制器5091将检测到的接触转换为与显示在触摸屏512上的用户界面对象的交互,即实现人机交互,显示在触摸屏512上的用户界面对象可以是运行游戏的图标、联网到相应网络的图标等。值得说明的是,设备还可以包括光鼠,光鼠是不显示可视输出的触摸敏感表面,或者是由触摸屏形成的触摸敏感表面的延伸。
RF电路505,主要用于建立手机与无线网络(即网络侧)的通信,实现手机与无线网络的数据接收和发送。例如收发短信息、电子邮件等。具体地,RF电路505接收并发送RF信号,RF信号也称为电磁信号,RF电路505将电信号转换为电磁信号或将电磁信号转换为电信号,并且通过该电磁信号与通信网络以及其他设备进行通信。RF电路505可以包括用于执行这些功能的已知电路,其包括但不限于天线系统、RF收发机、一个或多个放大器、调谐器、一个或多个振荡器、数字信号处理器、CODEC(COder-DECoder,编译码器)芯片组、用户标识模块(Subscriber
Identity Module,SIM)等等。
音频电路506,主要用于从外设接口503接收音频数据,将该音频数据转换为电信号,并且将该电信号发送给扬声器511。
扬声器511,用于将手机通过RF电路505从无线网络接收的语音信号,还原为声音并向用户播放该声音。
电源管理芯片508,用于为CPU502、I/O子系统及外设接口所连接的硬件进行供电及电源管理。
本实施例提供的电子设备用于执行上述实施例所述的广播接收者队列调整方法,其技术原理和产生的技术效果类似,这里不再赘述。
注意,上述仅为本发明的较佳实施例及所运用技术原理。本领域技术人员会理解,本发明不限于这里所述的特定实施例,对本领域技术人员来说能够进行各种明显的变化、重新调整和替代而不会脱离本发明的保护范围。因此,虽然通过以上实施例对本发明进行了较为详细的说明,但是本发明不仅仅限于以上实施例,在不脱离本发明构思的情况下,还可以包括更多其他等效实施例,而本发明的范围由所附的权利要求范围决定。
Claims (20)
- 一种广播接收者队列调整方法,其中,包括:获取广播接收者的历史参数;判断所述历史参数是否符合第一设定条件;若第一广播接收者队列中的第一目标广播接收者的历史参数符合所述第一设定条件,创建第二广播接收者队列;将所述第一目标广播接收者移动到所述第二广播接收者队列中,以使所述第一广播接收者队列中除去所述第一目标广播接收者之外的广播接收者、以及所述第二广播接收者队列中的所述第一目标广播接收者并行处理广播消息。
- 根据权利要求1所述的方法,其中,所述历史参数包括处理广播消息的历史超时次数;所述判断所述历史参数是否符合第一设定条件,包括:判断处理广播消息的历史超时次数是否达到第一设定阈值;所述若第一广播接收者队列中的第一目标广播接收者的历史参数符合所述第一设定条件,创建第二广播接收者队列,包括:若第一广播接收者队列中的第一目标广播接收者处理广播消息的历史超时次数达到所述第一设定阈值,创建第二广播接收者队列。
- 根据权利要求2所述的方法,其中,当所述广播接收者处理广播消息的时间大于设定的固定时间阈值时,所述历史超时次数增加一次;或者当所述广播接收者处理广播消息的时间大于动态时间阈值时,所述历史超时次数增加一次,其中,所述动态时间阈值基于初始设定值、所述历史超时次数以及时间增幅值进行确定,所述时间增幅值为每增加设定数量的超时次数,所述动态时间阈值的增加量。
- 根据权利要求1所述的方法,其中,所述历史参数包括用于判断处理广播消息超时的动态时间阈值;所述判断所述历史参数是否符合第一设定条件,包括:判断用于判断处理广播消息超时的动态时间阈值是否首次大于第二设定阈值;所述若第一广播接收者队列中的第一目标广播接收者的历史参数符合所述第一设定条件,创建第二广播接收者队列,包括:若第一广播接收者队列中的第一目标广播接收者对应的用于判断处理广播消息超时的动态时间阈值首次大于所述第二设定阈值,创建第二广播接收者队列;其中,所述动态时间阈值基于获取的历史超时次数、时间增幅值以及初始设定值进行确定;所述初始设定值小于所述第二设定阈值;所述第二设定阈值为固定值。
- 根据权利要求1所述的方法,其中,还包括:若第二目标广播接收者的历史参数符合第二设定条件,设置所述第二目标广播接收者为危险应用;将广播消息禁止分发给所述第二目标广播接收者;其中,所述历史参数包括处理广播消息的历史超时次数、处理广播消息的历史时间、处理广播消息累加的历史超时时间或用于判断处理广播消息超时的动态时间阈值;所述动态时间阈值基于历史超时次数、时间增幅值以及初始设定值进行确定。
- 根据权利要求1所述的方法,其中,所述历史参数包括处理广播消息的历史超时次数,还包括:获取所述广播接收者处理广播消息累加的历史超时时间;基于累加的所述历史超时时间调整所述历史超时次数相同的广播接收者的顺序。
- 根据权利要求1所述的方法,其中,还包括:若所述第一目标广播接收者的数量大于1个,当接收到目标广播消息时,依次检测所述第一目标广播接收者在第三设定阈值内是否处理完所述目标广播消息;若检测到当前第一目标广播接收者在第三设定阈值没有处理完所述目标广播消息,将所述目标广播消息分发给下一个第一目标广播接收者。
- 一种广播接收者队列调整装置,其中,包括:第一获取模块,用于获取广播接收者的历史参数;判断模块,用于判断所述历史参数是否符合第一设定条件;创建模块,用于若第一广播接收者队列中的第一目标广播接收者的历史参数符合所述第一设定条件,创建第二广播接收者队列;移动模块,用于将所述第一目标广播接收者移动到所述第二广播接收者队列中,以使第一广播接收者队列中除去所述第一目标广播接收者之外的广播接收者、以及所述第二广播接收者队列中的所述第一目标广播接收者并行广播消息。
- 根据权利要求8所述的装置,其中,所述历史参数包括处理广播消息的历史超时次数;所述判断模块,用于判断处理广播消息的历史超时次数是否达到第一设定阈值;所述创建模块,用于若第一广播接收者队列中的第一目标广播接收者处理广播消息的历史超时次数达到所述第一设定阈值,创建第二广播接收者队列。
- 根据权利要求8所述的装置,其中,所述历史参数包括用于判断处理广播消息超时的动态时间阈值;所述判断模块,用于判断用于判断处理广播消息超时的动态时间阈值是否首次大于第二设定阈值;所述创建模块,用于若第一广播接收者队列中的第一目标广播接收者对应的用于判断处理广播消息超时的动态时间阈值首次大于所述第二设定阈值,创建第二广播接收者队列;其中,所述动态时间阈值基于获取的历史超时次数、时间增幅值以及初始设定值进行确定;所述初始设定值小于所述第二设定阈值;所述第二设定阈值为固定值。
- 根据权利要求8所述的装置,其中,还包括:危险应用设置模块,用于若第二目标广播接收者的历史参数符合第二设定条件,设置所述第二目标广播接收者为危险应用;禁止分发模块,用于将广播消息禁止分发给所述第二目标广播接收者;其中,所述历史参数包括处理广播消息的历史超时次数、处理广播消息的历史时间、处理广播消息累加的历史超时时间或用于判断处理广播消息超时的动态时间阈值;所述动态时间阈值基于历史超时次数、时间增幅值以及初始设定值进行确定。
- 根据权利要求8所述的装置,其中,所述历史参数包括处理广播消息的历史超时次数,还包括:第二获取模块,用于获取所述广播接收者处理广播消息累加的历史超时时间;调整模块,用于基于累加的所述历史超时时间调整所述历史超时次数相同的广播接收者的顺序。
- 一种存储介质,其中,所述存储介质中存储有多条指令,所述指令适于由处理器加载以执行如权利要求1至7任一项所述的广播接收者队列调整方法。
- 一种电子设备,其中,包括处理器和存储器,所述存储器存储有多条指令,所述处理器加载所述存储器中的指令用于执行以下步骤:获取广播接收者的历史参数;判断所述历史参数是否符合第一设定条件;若第一广播接收者队列中的第一目标广播接收者的历史参数符合所述第一设定条件,创建第二广播接收者队列;将所述第一目标广播接收者移动到所述第二广播接收者队列中,以使所述第一广播接收者队列中除去所述第一目标广播接收者之外的广播接收者、以及所述第二广播接收者队列中的所述第一目标广播接收者并行处理广播消息。
- 根据权利要求14所述的电子设备,其中,所述历史参数包括处理广播消息的历史超时次数;在判断所述历史参数是否符合第一设定条件时,所述处理器具体用于执行以下步骤:判断处理广播消息的历史超时次数是否达到第一设定阈值;在第一广播接收者队列中的第一目标广播接收者的历史参数符合所述第一设定条件,创建第二广播接收者队列时,所述处理器具体用于执行以下步骤:在第一广播接收者队列中的第一目标广播接收者处理广播消息的历史超时次数达到所述第一设定阈值时,创建第二广播接收者队列。
- 根据权利要求15所述的电子设备,其中,当所述广播接收者处理广播消息的时间大于设定的固定时间阈值时,所述历史超时次数增加一次;或者当所述广播接收者处理广播消息的时间大于动态时间阈值时,所述历史超时次数增加一次,其中,所述动态时间阈值基于初始设定值、所述历史超时次数以及时间增幅值进行确定,所述时间增幅值为每增加设定数量的超时次数,所述动态时间阈值的增加量。
- 根据权利要求14所述的电子设备,其中,所述历史参数包括用于判断处理广播消息超时的动态时间阈值;在判断所述历史参数是否符合第一设定条件时,所述处理器具体用于执行以下步骤:判断用于判断处理广播消息超时的动态时间阈值是否首次大于第二设定阈值;在第一广播接收者队列中的第一目标广播接收者的历史参数符合所述第一设定条件,创建第二广播接收者队列时,所述处理器具体用于执行以下步骤:在第一广播接收者队列中的第一目标广播接收者对应的用于判断处理广播消息超时的动态时间阈值首次大于所述第二设定阈值时,创建第二广播接收者队列;其中,所述动态时间阈值基于获取的历史超时次数、时间增幅值以及初始设定值进行确定;所述初始设定值小于所述第二设定阈值;所述第二设定阈值为固定值。
- 根据权利要求14所述的电子设备,其中,所述处理器还用于执行以下步骤:若第二目标广播接收者的历史参数符合第二设定条件,设置所述第二目标广播接收者为危险应用;将广播消息禁止分发给所述第二目标广播接收者;其中,所述历史参数包括处理广播消息的历史超时次数、处理广播消息的历史时间、处理广播消息累加的历史超时时间或用于判断处理广播消息超时的动态时间阈值;所述动态时间阈值基于历史超时次数、时间增幅值以及初始设定值进行确定。
- 根据权利要求14所述的电子设备,其中,所述历史参数包括处理广播消息的历史超时次数,所述处理器还用于执行以下步骤:获取所述广播接收者处理广播消息累加的历史超时时间;基于累加的所述历史超时时间调整所述历史超时次数相同的广播接收者的顺序。
- 根据权利要求14所述的电子设备,其中,所述处理器还用于执行以下步骤:若所述第一目标广播接收者的数量大于1个,当接收到目标广播消息时,依次检测所述第一目标广播接收者在第三设定阈值内是否处理完所述目标广播消息;若检测到当前第一目标广播接收者在第三设定阈值没有处理完所述目标广播消息,将所述目标广播消息分发给下一个第一目标广播接收者。
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| EP17899903.3A EP3591947B1 (en) | 2017-03-10 | 2017-10-19 | Broadcast receiver queue adjustment method, apparatus, storage medium, and electronic device |
| US16/565,431 US11160052B2 (en) | 2017-03-10 | 2019-09-09 | Method for adjusting broadcast receiver queue, storage medium and electronic device |
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201710141454.4 | 2017-03-10 | ||
| CN201710141454.4A CN106936827B (zh) | 2017-03-10 | 2017-03-10 | 一种广播接收者队列调整方法、装置及终端 |
Related Child Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| US16/565,431 Continuation US11160052B2 (en) | 2017-03-10 | 2019-09-09 | Method for adjusting broadcast receiver queue, storage medium and electronic device |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2018161588A1 true WO2018161588A1 (zh) | 2018-09-13 |
Family
ID=59433578
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2017/106944 Ceased WO2018161588A1 (zh) | 2017-03-10 | 2017-10-19 | 广播接收者队列调整方法、装置、存储介质及电子设备 |
Country Status (4)
| Country | Link |
|---|---|
| US (1) | US11160052B2 (zh) |
| EP (1) | EP3591947B1 (zh) |
| CN (1) | CN106936827B (zh) |
| WO (1) | WO2018161588A1 (zh) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113626312A (zh) * | 2021-07-15 | 2021-11-09 | 荣耀终端有限公司 | 一种测试方法、电子设备以及存储介质 |
Families Citing this family (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106936827B (zh) * | 2017-03-10 | 2019-03-08 | Oppo广东移动通信有限公司 | 一种广播接收者队列调整方法、装置及终端 |
| CN110413911B (zh) * | 2018-04-26 | 2023-08-11 | 腾讯科技(深圳)有限公司 | 网络图片加载方法、装置、终端设备及存储介质 |
| CN112039931B (zh) * | 2019-06-03 | 2023-04-28 | 本无链科技(深圳)有限公司 | 一种用于p2p网络的弹性广播方法及系统 |
| CN110633161B (zh) * | 2019-09-19 | 2022-09-02 | 北京安云世纪科技有限公司 | 一种广播的处理方法及装置 |
| CN115412488A (zh) * | 2021-05-28 | 2022-11-29 | 中兴通讯股份有限公司 | 信息处理方法、网络设备、网络系统及存储介质 |
| WO2025147840A1 (zh) * | 2024-01-09 | 2025-07-17 | 荣耀终端股份有限公司 | 广播处理方法和装置 |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2008003536A2 (en) * | 2006-07-07 | 2008-01-10 | International Business Machines Corporation | Method, system and computer program for determining the processing order of a plurality of events |
| CN101296130A (zh) * | 2008-05-30 | 2008-10-29 | 北京同步科技有限公司 | 一种实现多进程共享端口接收网络通知的系统及其方法 |
| CN103888619A (zh) * | 2014-04-16 | 2014-06-25 | 青岛海信电子设备股份有限公司 | 一种消息处理方法及其系统 |
| CN106936827A (zh) * | 2017-03-10 | 2017-07-07 | 广东欧珀移动通信有限公司 | 一种广播接收者队列调整方法、装置及终端 |
Family Cites Families (13)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP3300776B2 (ja) * | 1994-03-15 | 2002-07-08 | 株式会社日立製作所 | 並列プロセッサの切替え制御方式 |
| US6058389A (en) * | 1997-10-31 | 2000-05-02 | Oracle Corporation | Apparatus and method for message queuing in a database system |
| US20030226056A1 (en) * | 2002-05-28 | 2003-12-04 | Michael Yip | Method and system for a process manager |
| US6898664B2 (en) * | 2002-08-28 | 2005-05-24 | Hewlett-Packard Development Company, L.P. | Optimizing performance for a storage device within a computer system |
| US7529329B2 (en) * | 2004-08-10 | 2009-05-05 | Applied Micro Circuits Corporation | Circuit for adaptive sampling edge position control and a method therefor |
| CN100370845C (zh) | 2004-12-22 | 2008-02-20 | 华为技术有限公司 | 在宽带码分多址系统中对小区广播服务消息调度的方法 |
| US7631315B2 (en) * | 2005-03-28 | 2009-12-08 | Microsoft Corporation | Using subqueues to enhance local message processing |
| US8443379B2 (en) * | 2008-06-18 | 2013-05-14 | Microsoft Corporation | Peek and lock using queue partitioning |
| CN102265277B (zh) * | 2011-06-01 | 2014-03-05 | 华为技术有限公司 | 数据存储系统的操作方法和装置 |
| US8621074B2 (en) * | 2012-04-27 | 2013-12-31 | Xerox Business Services, Llc | Intelligent work load manager |
| US9207978B2 (en) * | 2013-10-09 | 2015-12-08 | Wipro Limited | Method and system for efficient execution of ordered and unordered tasks in multi-threaded and networked computing |
| CN103595547B (zh) * | 2013-11-15 | 2016-07-13 | 北京奇虎科技有限公司 | 智能设备的广播拦截方法和装置 |
| US20150169363A1 (en) * | 2013-12-18 | 2015-06-18 | Qualcomm Incorporated | Runtime Optimization of Multi-core System Designs for Increased Operating Life and Maximized Performance |
-
2017
- 2017-03-10 CN CN201710141454.4A patent/CN106936827B/zh not_active Expired - Fee Related
- 2017-10-19 WO PCT/CN2017/106944 patent/WO2018161588A1/zh not_active Ceased
- 2017-10-19 EP EP17899903.3A patent/EP3591947B1/en active Active
-
2019
- 2019-09-09 US US16/565,431 patent/US11160052B2/en active Active
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2008003536A2 (en) * | 2006-07-07 | 2008-01-10 | International Business Machines Corporation | Method, system and computer program for determining the processing order of a plurality of events |
| CN101296130A (zh) * | 2008-05-30 | 2008-10-29 | 北京同步科技有限公司 | 一种实现多进程共享端口接收网络通知的系统及其方法 |
| CN103888619A (zh) * | 2014-04-16 | 2014-06-25 | 青岛海信电子设备股份有限公司 | 一种消息处理方法及其系统 |
| CN106936827A (zh) * | 2017-03-10 | 2017-07-07 | 广东欧珀移动通信有限公司 | 一种广播接收者队列调整方法、装置及终端 |
Non-Patent Citations (1)
| Title |
|---|
| See also references of EP3591947A4 |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113626312A (zh) * | 2021-07-15 | 2021-11-09 | 荣耀终端有限公司 | 一种测试方法、电子设备以及存储介质 |
| CN113626312B (zh) * | 2021-07-15 | 2022-12-06 | 北京荣耀终端有限公司 | 一种测试方法、电子设备以及存储介质 |
Also Published As
| Publication number | Publication date |
|---|---|
| US11160052B2 (en) | 2021-10-26 |
| CN106936827A (zh) | 2017-07-07 |
| EP3591947A4 (en) | 2020-01-08 |
| EP3591947B1 (en) | 2021-05-12 |
| US20200008175A1 (en) | 2020-01-02 |
| CN106936827B (zh) | 2019-03-08 |
| EP3591947A1 (en) | 2020-01-08 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2018161588A1 (zh) | 广播接收者队列调整方法、装置、存储介质及电子设备 | |
| WO2018161585A1 (zh) | 电子设备帧率的控制方法、装置、存储介质及电子设备 | |
| WO2021029692A1 (en) | Electronic device for adjusting transmission power based on sar and method for operating same | |
| WO2018161580A1 (zh) | 广播的控制方法、装置、存储介质及电子设备 | |
| WO2018161581A1 (zh) | 控制广播发送的方法、装置、存储介质及电子设备 | |
| WO2018076866A1 (zh) | 数据处理方法、装置、存储介质、电子设备及服务器 | |
| WO2018076818A1 (zh) | 数据的备份方法、装置、电子设备、存储介质及系统 | |
| WO2018076812A1 (zh) | 数据请求的响应方法、装置、存储介质、服务器及系统 | |
| WO2020226353A1 (en) | Electronic device for establishing communication with external electronic device and method of controlling the same | |
| WO2018076867A1 (zh) | 数据备份的删除方法、装置、系统、存储介质和服务器 | |
| WO2021025401A1 (en) | Electronic device for reducing power consumption and operating method thereof | |
| WO2018161571A1 (zh) | 动态调节终端的节能等级的方法、装置、介质及电子设备 | |
| WO2018161602A1 (zh) | 电子设备帧率的控制方法、装置、存储介质及电子设备 | |
| WO2018076819A1 (zh) | 数据的上传方法、装置、存储介质、电子设备及系统 | |
| WO2017206883A1 (zh) | 一种应用处理方法、装置、存储介质及电子设备 | |
| WO2018161593A1 (zh) | 广播处理方法、装置、存储介质和终端设备 | |
| WO2018161603A1 (zh) | 移动终端图像绘制的控制方法、装置、介质及电子设备 | |
| WO2018076829A1 (zh) | 终端数据的处理方法、装置、系统、存储介质及服务器 | |
| WO2018166199A1 (zh) | 定位精度等级调整方法、装置、存储介质及电子设备 | |
| WO2018076830A1 (zh) | 数据同步周期的调整方法、装置、电子设备、存储介质及系统 | |
| WO2021145659A1 (en) | Audio output device and method for controlling output speed of audio data thereof | |
| WO2018076888A1 (zh) | 移动终端数据的同步方法、装置及系统、存储介质及移动终端 | |
| EP3909386A1 (en) | Electronic device for transmitting response message in bluetooth network environment and method for the same | |
| WO2018076811A1 (zh) | 数据分享方法、装置、存储介质及电子设备 | |
| WO2018161576A1 (zh) | 一种广播的控制方法、装置、存储介质及移动终端 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 17899903 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| ENP | Entry into the national phase |
Ref document number: 2017899903 Country of ref document: EP Effective date: 20191002 |