WO2018161968A1 - 广播消息排队的方法、装置及终端 - Google Patents

广播消息排队的方法、装置及终端 Download PDF

Info

Publication number
WO2018161968A1
WO2018161968A1 PCT/CN2018/078626 CN2018078626W WO2018161968A1 WO 2018161968 A1 WO2018161968 A1 WO 2018161968A1 CN 2018078626 W CN2018078626 W CN 2018078626W WO 2018161968 A1 WO2018161968 A1 WO 2018161968A1
Authority
WO
WIPO (PCT)
Prior art keywords
broadcast message
broadcast
priority
determining
message queue
Prior art date
Application number
PCT/CN2018/078626
Other languages
English (en)
French (fr)
Inventor
裴润升
付亮晶
吴汝煜
林志泳
张俊
Original Assignee
广东欧珀移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 广东欧珀移动通信有限公司 filed Critical 广东欧珀移动通信有限公司
Priority to EP18764720.1A priority Critical patent/EP3591949B1/en
Publication of WO2018161968A1 publication Critical patent/WO2018161968A1/zh
Priority to US16/565,425 priority patent/US11051272B2/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W72/00Local resource management
    • H04W72/30Resource management for broadcast services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/542Event management; Broadcasting; Multicasting; Notifications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72484User interfaces specially adapted for cordless or mobile telephones wherein functions are triggered by incoming communication events
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W72/00Local resource management
    • H04W72/50Allocation or scheduling criteria for wireless resources
    • H04W72/56Allocation or scheduling criteria for wireless resources based on priority criteria
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/548Queue

Definitions

  • the present disclosure relates to the field of system broadcast technologies, for example, to a method, an apparatus, and a terminal for broadcasting message queuing.
  • Android (Android) system is a widely used operating system for mobile phones and other terminals. In the Android system, there are many different applications. In order to quickly transfer information in different applications, the Android system uses the broadcast mechanism to implement information transfer. When there are messages to notify different applications, the message is broadcasted. Send to different apps.
  • the broadcast message sent by the broadcast sender is not limited, so that a broadcast sender can send any number of broadcast messages at will, or send the broadcast message very frequently, which causes the broadcast message to be processed in the broadcast message queue to be very Many, may cause important broadcast messages can not be processed in time, causing system function abnormalities.
  • the present disclosure provides a method, a device, and a terminal for queuing a broadcast message, which can process important broadcast messages in a timely manner and avoid abnormal system functions.
  • the present disclosure provides a method for queuing broadcast messages, the method comprising:
  • the broadcast message is inserted into the broadcast message queue according to the insertion location.
  • the present disclosure also provides an apparatus for queuing broadcast messages, the apparatus comprising:
  • a broadcast message listening module configured to listen to a broadcast message sent by a broadcast sender
  • a broadcast receiver determining module configured to determine a broadcast recipient of the broadcast message when listening to the broadcast sender to send a broadcast message
  • a priority determining module configured to determine a priority of the broadcast message according to the broadcast receiver
  • Inserting a location determining module configured to determine an insertion location of the broadcast message in a broadcast message queue according to a priority of the broadcast message
  • a broadcast message insertion module is configured to insert the broadcast message into the broadcast message queue according to the insertion location.
  • the present disclosure also provides a terminal comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor executing the computer program to implement the following steps:
  • the broadcast message is inserted into the broadcast message queue according to the insertion location.
  • the present disclosure also provides a computer readable storage medium storing computer executable instructions for performing any of the methods described above.
  • the method, device and terminal for queuing broadcast messages provided by the present disclosure can implement important broadcast messages in a timely and rapid manner, and avoid system abnormalities.
  • FIG. 1 is a flowchart of a method for queuing broadcast messages according to an embodiment
  • FIG. 2 is a flowchart of a method for queuing broadcast messages according to another embodiment
  • FIG. 3 is a schematic structural diagram of an apparatus for queuing a broadcast message according to an embodiment
  • FIG. 4 is a schematic structural diagram of a terminal according to an embodiment.
  • FIG. 1 is a flowchart of a method for queuing a broadcast message according to this embodiment.
  • the embodiment is applicable to determining a location of a broadcast message in a broadcast message queue when a broadcast message is monitored, and the method may be performed by a broadcast message.
  • the device is executed by a queued device, wherein the device can be implemented by at least one of software and hardware.
  • the device can be integrated into the terminal, and the terminal can be a smart phone, a tablet computer, etc., and the method can include the following steps:
  • step 110 a broadcast message sent by the broadcast sender is listened to.
  • the broadcast mechanism refers to a communication method between components in the operating system of the terminal, and is a mechanism widely used to transmit messages between applications.
  • a broadcast message is sent under the Android system of the terminal.
  • the broadcast message can be a variety of event message data generated in the operating system. For example, if a text message is sent or a phone call is made, the broadcast will be sent.
  • an application receives the broadcast, it can perform corresponding processing.
  • the broadcast sender can be system and application software.
  • the application software may be a third-party application software installed on a terminal such as a mobile phone or an application provided by the system.
  • the third-party application software installed on the terminal may include a WeChat client, a QQ client, a Taobao client, and an Alipay client.
  • the system's own applications can include calendar, clock, weather and notes.
  • the broadcast message may be a system broadcast and an application broadcast, wherein the system broadcast may include a bright screen broadcast, a blackout broadcast, an unlock broadcast, a network state change broadcast, a Bluetooth state change broadcast, a switching language broadcast, and a switching theme broadcast, etc.
  • the application broadcast may be A broadcast made by the application software.
  • the broadcast management module (such as ActivityManagerService) in the terminal can monitor the dynamics of all broadcast senders in the system, and detect whether the broadcast sender sends a broadcast message.
  • ActivityManagerService plays the role of broadcast center in the broadcast mechanism of Android system, and is responsible for all broadcast registration and release operations in the system.
  • the registration of broadcast refers to the process of registering the broadcast receiver to ActivityManagerService.
  • the broadcast release includes the broadcast sender sending the broadcast to the ActivityManagerService.
  • the ActivityManagerService checks which broadcast receivers subscribe to the broadcast in its own registration center, and sends the broadcast to these broadcast receivers one by one.
  • the broadcast message sent by the broadcast sender is monitored by the ActivityManagerService to listen to whether the broadcast sender sends the broadcast message to the ActivityManagerService, and when the broadcast sender sends the broadcast message to the ActivityManagerService through the ActivityManagerService, it is determined to listen to the broadcast transmission.
  • the person sent a broadcast message is monitored by the ActivityManagerService to listen to whether the broadcast sender sends the broadcast message to the ActivityManagerService, and when the broadcast sender sends the broadcast message to the ActivityManagerService through the ActivityManagerService, it is determined to listen to the broadcast transmission.
  • the person sent a broadcast message is monitored by the ActivityManagerService to listen to whether the broadcast sender sends the broadcast message to the ActivityManagerService, and when the broadcast sender sends the broadcast message to the ActivityManagerService through the ActivityManagerService, it is determined to listen to the broadcast transmission.
  • the person sent a broadcast message is monitored by the ActivityManagerService to listen to whether the broadcast sender sends the broadcast message to the ActivityManagerService, and when the broadcast sender sends the broadcast message to the ActivityManagerService through
  • step 120 upon receiving a broadcast message from the broadcast sender, the broadcast recipient of the broadcast message is determined.
  • the broadcast receiver that has received the broadcast message is queried, thereby determining the broadcast recipient receiving the broadcast message.
  • the broadcast sender sends a broadcast message to be sent to the ActivityManagerService, and after receiving the broadcast message, the ActivityManagerService checks in the registration center which broadcast receivers subscribe to the broadcast, and then receives the broadcast reception by registering and receiving the broadcast message.
  • the broadcaster ie, the broadcast receiving process
  • step 130 a priority of the broadcast message is determined according to the broadcast recipient.
  • the priority of the broadcast message may be determined according to the importance degree of the broadcast receiver. For example, if the broadcast receiver is a system, the priority of the broadcast message is determined to be a higher priority; If the broadcast recipient is a third party application, then the priority of the broadcast message is determined to be a lower priority.
  • the priority of a broadcast message can be set to three priorities: highest priority, secondary priority, and normal priority. It also stipulates that the highest priority broadcast message is queued to the front end of the broadcast message queue and can be processed faster; the secondary priority broadcast message is ranked behind the highest priority broadcast message in the broadcast message queue, at the highest priority. After the broadcast message is processed, the normal priority broadcast message is queued after the next priority broadcast message in the broadcast message queue, and processed after the highest priority and the next priority broadcast message are processed; the priority is the same. Broadcast messages are processed in the order in which they are queued.
  • determining the priority of the broadcast message according to the broadcast receiver may include: counting a frequency of use of the broadcast receiver in a preset time; determining the broadcast according to the use frequency The priority of the message.
  • the priority of broadcast messages is set to a higher priority, thereby increasing the speed at which highly active applications receive broadcast messages.
  • determining a priority of the broadcast message according to the frequency of use including: determining, according to the frequency of use, a frequency range to which the frequency of use belongs; determining, according to the frequency range, the broadcast message Priority.
  • the correspondence between the frequency range and the priority of the broadcast message can be established in advance. Determining, according to the frequency range of the broadcast receiver, the frequency range to which the frequency of use belongs, according to the frequency range and the corresponding relationship, the priority of the broadcast message can be directly determined, and the frequency of use can be more quickly used.
  • the broadcast message of the broadcast receiver is processed to speed up the processing of the broadcast message.
  • determining the priority of the broadcast message according to the broadcast receiver comprising: determining that the broadcast message has a higher priority than the broadcast receiver is currently running The priority of all broadcast messages in the broadcast message queue.
  • the broadcast recipient is the currently running application, it is determined that the priority of the broadcast message is highest, ie higher than the priority of all broadcast messages in the broadcast message queue. For example, if WeChat is the currently running application, and new information is sent, an information broadcast is generated. However, many broadcast messages in the current broadcast message queue are waiting to be processed, and the related information can only be broadcasted in order.
  • the broadcast message queue is entered, so that the information broadcast needs to wait for a long time to be processed, and the method provided in this embodiment can determine that the information broadcast has the highest priority, and the information broadcast is directly arranged in the broadcast message queue. For the head, the broadcast information can be processed in time, so that the user receives the information in time.
  • step 140 an insertion position of the broadcast message in the broadcast message queue is determined according to a priority of the broadcast message.
  • the broadcast message queues are arranged in the order of priority of the broadcast messages, the high-priority broadcast messages are arranged in the queue, and the low-priority broadcast messages are arranged at the end of the queue.
  • the insertion position of the broadcast messages in the broadcast message queue can be directly determined according to the priority of the broadcast message.
  • the priority of the broadcast message has three levels, namely, the highest priority, the second priority, and the lowest priority.
  • the current broadcast message queue has only the secondary priority and the lowest priority broadcast message, and the currently broadcast broadcast message.
  • the priority of the broadcast is the highest priority, and it can be determined that the insertion position of the broadcast message in the broadcast message queue is the head of the queue.
  • determining the insertion position of the broadcast message in the broadcast message queue according to the priority of the broadcast message may include:
  • the insertion position of the broadcast message in the broadcast message queue is determined.
  • the broadcast message queues are arranged in the order of priority. After the priority of the broadcast message is determined, the priority is compared with the priority of the broadcast message in the broadcast message queue, and according to the comparison result, the The insertion position of the broadcast message in the broadcast message queue improves the processing speed of the broadcast message.
  • determining the insertion position of the broadcast message in the broadcast message queue according to the comparison result may include:
  • the priority is not lower than a priority of all broadcast messages in the broadcast message queue, determining two adjacent broadcasts in the broadcast message queue that are higher than the priority and lower than the priority And confirming that the insertion position of the broadcast message is between the two adjacent broadcast messages.
  • the processing speed of the broadcast message can be speeded up.
  • step 150 the broadcast message is inserted into the broadcast message queue according to the insertion location.
  • the broadcast message is inserted into the insertion location of the broadcast message queue based on the determined insertion location.
  • the broadcast receiver of the broadcast message is determined, and the priority of the broadcast message is determined according to the broadcast receiver, and then determined according to the priority.
  • the broadcast message is inserted into the broadcast message queue at the insertion position in the broadcast message queue. Since the location of the broadcast message in the broadcast message queue is determined according to the priority, the high priority broadcast message can be processed in time and quickly. , timely and important processing of important broadcast messages, to avoid system function abnormalities.
  • FIG. 2 is a flowchart of a method for queuing a broadcast message according to another embodiment, where the method includes the following steps:
  • step 210 a broadcast message sent by the broadcast sender is listened to.
  • step 220 upon receiving a broadcast message from the broadcast sender, the broadcast recipient of the broadcast message is determined.
  • a priority of the broadcast message is determined based on the broadcast recipient.
  • step 240 an insertion location of the broadcast message in the broadcast message queue is determined according to a priority of the broadcast message.
  • step 250 the broadcast message is inserted into the broadcast message queue according to the insertion location.
  • step 260 the broadcast recipient of the current broadcast message is identified in accordance with the queuing sequence of the broadcast messages in the broadcast message queue.
  • the broadcast message queue is queued according to the priority of the broadcast message, and the broadcast message queue is continuously changing dynamically.
  • the broadcast message queue is continuously updated, and the broadcast message queue is distributed.
  • Broadcast messages are cleared in the broadcast message queue, and it is also possible to have new broadcast messages entering the broadcast message queue when distributing broadcast messages in the broadcast message queue.
  • the broadcast message queue includes a broadcast message 1, a broadcast message 2, a broadcast message 3, a broadcast message 4, ... a broadcast message 100 in a queued order of broadcast messages, and is distributed according to the queued order of broadcast messages in the broadcast message queue.
  • the broadcast message 1 is first distributed, and the broadcast message 2 is distributed after the broadcast message 1 is distributed, in this order, until the broadcast message in the broadcast message queue is distributed.
  • the current broadcast message may be a broadcast message to be distributed, for example, the broadcast message queue includes a broadcast message 1, a broadcast message 2, a broadcast message 3, a broadcast message 4, ... a broadcast message according to a sequence of distribution. 100, wherein the broadcast message 1 is a broadcast message currently being distributed, then the broadcast message 2 is the broadcast message currently to be distributed, or the broadcast message before the broadcast message 1 is just distributed, and the broadcast message 1 is currently to be distributed. Broadcast message.
  • the broadcast recipient can be a third-party application installed on the terminal or an application that comes with the system. For example, in the Android system, when the broadcast receiver of the current broadcast message is identified, it is checked by the ActivityManager Service which broadcast receivers subscribe to the broadcast receiver that receives the broadcast message, thereby determining the broadcast recipient of the broadcast message.
  • step 270 the current broadcast message is distributed to the broadcast recipient.
  • the broadcast message After identifying the broadcast recipient of the current broadcast message to be distributed, the broadcast message is sequentially distributed to one or more broadcast recipients, and the broadcast recipient can be assured of a timely response to the broadcast message.
  • the broadcast receiver of the broadcast message of the broadcast message determines the priority of the broadcast message according to the broadcast receiver, and determines the broadcast message according to the priority of the broadcast message. Inserting a broadcast message into the broadcast message queue according to the insertion position, and distributing the broadcast message according to the queued order of the broadcast message in the broadcast message queue, thereby realizing timely and timely distribution of important broadcast messages, It can also ensure that the broadcast receiver responds quickly to the broadcast message and avoids system function abnormality.
  • FIG. 3 is a schematic structural diagram of an apparatus for queuing a broadcast message according to the embodiment.
  • the apparatus for queuing a broadcast message according to this embodiment includes: a broadcast message monitoring module 310 and a broadcast receiver determining module 320.
  • the broadcast message monitoring module 310 is configured to listen to a broadcast message sent by a broadcast sender.
  • the broadcast receiver determining module 320 is configured to determine a broadcast recipient of the broadcast message when the broadcast sender is notified to send a broadcast message;
  • the priority determining module 330 is configured to determine a priority of the broadcast message according to the broadcast receiver
  • the insertion location determining module 340 is configured to determine an insertion location of the broadcast message in the broadcast message queue according to a priority of the broadcast message;
  • the broadcast message insertion module 350 is configured to insert the broadcast message into the broadcast message queue according to the insertion location.
  • the priority determining module 330 includes:
  • a frequency statistics unit configured to count the frequency of use of the broadcast receiver within a preset time
  • the priority determining unit is configured to determine a priority of the broadcast message according to the usage frequency.
  • the priority determining unit is configured to: determine, according to the frequency of use, a frequency range to which the frequency of use belongs; and determine a priority of the broadcast message according to the frequency range.
  • the priority determining module 330 includes:
  • the highest priority determining unit is configured to determine that the priority of the broadcast message is higher than a priority of all broadcast messages in the broadcast message queue if the broadcast recipient is currently running.
  • the insertion position determining module 340 includes:
  • a priority comparison unit configured to compare a priority of the broadcast message with a priority of a broadcast message in the broadcast message queue
  • the insertion position determining unit is configured to determine an insertion position of the broadcast message in the broadcast message queue according to the comparison result.
  • the insertion position determining unit is configured to:
  • the priority is not lower than a priority of all broadcast messages in the broadcast message queue, determining two adjacent broadcasts in the broadcast message queue that are higher than the priority and lower than the priority And confirming that the insertion position of the broadcast message is between the two adjacent broadcast messages.
  • the apparatus further includes:
  • a broadcast receiver identification module configured to identify a broadcast recipient of the current broadcast message according to a queuing sequence of the broadcast message in the broadcast message queue after the broadcast message insertion module inserts the broadcast message into the broadcast message queue;
  • a broadcast message distribution module is arranged to distribute the current broadcast message to the broadcast recipient.
  • the device for queuing the broadcast message described above may perform the method for queuing a broadcast message provided by any embodiment of the present disclosure, and has a corresponding functional module and a beneficial effect of the execution method.
  • a method for queuing broadcast messages provided by any embodiment of the present disclosure.
  • FIG. 4 is a schematic structural diagram of a terminal according to the embodiment.
  • the terminal may include: a casing (not shown), a memory 401, and a central processing unit (CPU) 402. (also referred to as a processor, hereinafter referred to as a CPU), a computer program stored on the memory 401 and operable on the processor 402, a circuit board (not shown), and a power supply circuit (not shown).
  • CPU central processing unit
  • the circuit board is disposed inside a space enclosed by the casing; the CPU 402 and the memory 401 are disposed on the circuit board; and the power circuit is configured to supply power to each circuit or device of the terminal;
  • the memory 401 is configured to store a computer program executable on a processor; the CPU 402 is configured to read and execute a computer program stored in the memory 401.
  • the terminal further includes: a peripheral interface 403, an RF (Radio Frequency) circuit 405, an audio circuit 406, a speaker 411, a power management chip 408, an input/output (I/O) subsystem 409, a touch screen 412, other inputs, or Control device 410 and external port 404 are communicated via one or more communication buses or signal lines 407.
  • RF Radio Frequency
  • the illustrated terminal 400 is merely one example of a terminal, and the terminal 400 may have more or fewer components than those shown in the figures, two or more components may be combined, or may 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 at least one of one or more signal processing programs and application specific integrated circuits.
  • the terminal for queuing a broadcast message provided by this embodiment is described below.
  • the terminal uses a mobile phone as an example.
  • the memory 401 can be accessed by the CPU 402, the peripheral interface 403, etc., and the memory 401 can include a high speed random access memory, and can also include a nonvolatile memory, such as one or more magnetic disk storage devices, flash memory devices. Or other volatile solid-state storage devices.
  • a nonvolatile memory such as one or more magnetic disk storage devices, flash memory devices. Or other volatile solid-state storage devices.
  • Peripheral interface 403 which can connect the input and output peripherals of the device to CPU 402 and memory 401.
  • I/O subsystem 409 which can connect input and output peripherals on the device, such as touch screen 402 (equivalent to the screen in the above embodiment) and other input or control devices 410, to peripherals Interface 403.
  • I/O subsystem 409 can include display controller 4091 and one or more input controllers 4092 that are configured to control other input or control devices 410.
  • one or more input controllers 4092 receive electrical signals from other input or control devices 410 or transmit electrical signals to other input or control devices 410, and other input or control devices 410 may include physical buttons (press buttons, rocker buttons, etc.) ), dial, slide switch, joystick, click wheel.
  • the input controller 4092 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 412 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 4091 in I/O subsystem 409 receives electrical signals from touch screen 412 or transmits electrical signals to touch screen 412.
  • the touch screen 412 detects the contact on the touch screen, and the display controller 4091 converts the detected contact into an interaction with the user interface object displayed on the touch screen 412, ie, realizes human-computer interaction, and the user interface object displayed on the touch screen 412 may be running.
  • the icon of the game, the icon of the network to the corresponding network, and the like.
  • the terminal 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 405 is configured to establish communication between the mobile phone and the wireless network (ie, the network side) to implement data reception and transmission between the mobile phone and the wireless network. For example, sending and receiving short messages, emails, and the like.
  • the RF circuit 405 receives and transmits an RF signal, which is also referred to as an electromagnetic signal, and the RF circuit 405 converts the electrical signal into an electromagnetic signal or converts the electromagnetic signal into an electrical signal, and performs the electromagnetic signal with the communication network and other devices. Communication.
  • the RF circuit 405 may include known circuits for performing these functions, such as including 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 and subscriber identity module (Subscriber Identity Module, SIM) and so on.
  • CODEC COder-DECoder
  • codec Codec chipset
  • SIM Subscriber Identity Module
  • the audio circuit 406 is configured to receive audio data from the peripheral interface 403, convert the audio data into an electrical signal, and transmit the electrical signal to the speaker 411.
  • the speaker 411 is arranged to restore the voice signal received by the mobile phone from the wireless network through the RF circuit 405 to sound and play the sound to the user.
  • the power management chip 408 is configured to provide power and power management for the hardware connected to the CPU 402, the I/O subsystem, and the peripheral interface.
  • the CPU 402 provided in this embodiment implements the following steps when executing the computer program stored in the memory 401:
  • the broadcast message is inserted into the broadcast message queue according to the insertion location.
  • the foregoing terminal may perform the method provided by any embodiment of the present disclosure, and has a corresponding functional module and a beneficial effect of the execution method.
  • the embodiment further provides a computer readable storage medium storing computer executable instructions for performing any of the above methods.
  • the storage medium may be a non-transitory storage medium or a transitory storage medium.
  • the non-transitory storage medium may include: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like, which can store program codes. medium.
  • All or part of the processes in the foregoing embodiment may be completed by a computer program indicating related hardware, and the program may be stored in a non-transitory computer readable storage medium, and when the program is executed, may include the above The flow of an embodiment of the method.
  • the present disclosure provides a method, a device, and a terminal for queuing a broadcast message, which can determine the location of a broadcast message in a broadcast message queue according to a priority, so that a high-priority broadcast message can be processed in a timely manner and quickly and importantly processed. Broadcast messages to avoid system malfunctions.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Human Computer Interaction (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephone Function (AREA)
  • Telephonic Communication Services (AREA)

Abstract

一种广播消息排队的方法、装置及终端。该方法包括:监听广播发送者发出的广播消息;在监听到所述广播发送者发出广播消息时,确定所述广播消息的广播接收者;根据所述广播接收者,确定所述广播消息的优先级;根据所述广播消息的优先级,确定所述广播消息在广播消息队列中的插入位置;根据所述插入位置,将所述广播消息插入所述广播消息队列。

Description

广播消息排队的方法、装置及终端 技术领域
本公开涉及系统广播技术领域,例如涉及一种广播消息排队的方法、装置及终端。
背景技术
安卓(Android)系统是目前应用较为广泛的一种手机等终端的操作系统。Android系统中,有很多不同的应用程序,为了在不同的应用程序中快速的进行信息传递,Android系统利用广播机制来实现信息传递,有消息要通知不同的应用程序时,就通过广播将这个消息发送给不同的应用程序。
在Android系统中,广播发送者发送的广播消息没有限制,从而一个广播发送者可以随意发送任意数量的广播消息,或非常频繁的发送广播消息,会导致广播消息队列中待处理的广播消息非常的多,可能导致重要的广播消息不能得到及时处理,引起系统功能异常。
发明内容
本公开提供一种广播消息排队的方法、装置及终端,可以及时快速的处理重要的广播消息,避免系统功能异常。
本公开提供了一种广播消息排队的方法,所述方法包括:
监听广播发送者发出的广播消息;
在监听到所述广播发送者发出广播消息时,确定所述广播消息的广播接收者;
根据所述广播接收者,确定所述广播消息的优先级;
根据所述广播消息的优先级,确定所述广播消息在广播消息队列中的插入位置;
根据所述插入位置,将所述广播消息插入所述广播消息队列。
本公开还提供了一种广播消息排队的装置,所述装置包括:
广播消息监听模块,设置为监听广播发送者发出的广播消息;
广播接收者确定模块,设置为在监听到所述广播发送者发出广播消息时,确定所述广播消息的广播接收者;
优先级确定模块,设置为根据所述广播接收者,确定所述广播消息的优先级;
插入位置确定模块,设置为根据所述广播消息的优先级,确定所述广播消息在广播消息队列中的插入位置;
广播消息插入模块,设置为根据所述插入位置,将所述广播消息插入所述广播消息队列。
本公开还提供了一种终端,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现以下步骤:
监听广播发送者发出的广播消息;
在监听到所述广播发送者发出广播消息时,确定所述广播消息的广播接收者;
根据所述广播接收者,确定所述广播消息的优先级;
根据所述广播消息的优先级,确定所述广播消息在广播消息队列中的插入位置;
根据所述插入位置,将所述广播消息插入所述广播消息队列。
本公开还提供一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令用于执行上述任意一种方法。
本公开提供的广播消息排队的方法、装置及终端可以实现及时快速的处理重要的广播消息,避免了系统功能异常。
附图说明
图1是一实施例提供的一种广播消息排队的方法的流程图;
图2是另一实施例提供的一种广播消息排队的方法的流程图;
图3是一实施例提供的一种广播消息排队的装置的结构示意图;
图4是一实施例提供的一种终端的结构示意图。
具体实施方式
附图中仅示出了与本实施例相关的部分而非全部内容,一些实施例被描述成作为流程图描绘的处理或方法。虽然流程图将多个步骤描述成顺序的处理,但是其中的许多步骤可以被并行地、并发地或者同时实施。此外,多个步骤的顺序可以被重新安排。当步骤操作完成时所述处理可以被终止,但是还可以具有未包括在附图中的附加步骤。所述处理可以对应于方法、函数、规程、子例程、子程序等等。
图1是本实施例提供的一种广播消息排队的方法的流程图,本实施例可适用于在监听到广播消息时确定广播消息在广播消息队列中的位置的情况,该方法可以由广播消息排队的装置来执行,其中该装置可由软件和硬件中的至少一种形式实现,该装置可集成于终端中,该终端可以是智能手机、平板电脑等, 该方法可以包括如下步骤:
在步骤110中,监听广播发送者发出的广播消息。
其中,广播机制是指在终端的操作系统中一种组件间的通讯方式,是一种广泛运用在应用程序之间传输消息的机制。例如在终端的安卓系统下,有一些操作完成以后,会发送广播消息。广播消息可以是操作系统中产生的多种多样的事件消息数据,比如说发出一条短信或打出一个电话,都会发送广播,当一个应用程序接收了这个广播时,就可以做出相应的处理。广播发送者可以是系统和应用程序软件。应用程序软件可以是安装于手机等终端的第三方应用软件或者系统自带的应用程序,例如:安装于终端的第三方应用程序软件可以包括微信客户端、QQ客户端、淘宝客户端和支付宝客户端等,系统自带的应用程序可以包括日历、时钟、天气和便签等。广播消息可以是系统广播和应用广播,其中,系统广播可以包括亮屏广播、熄屏广播、解锁广播、网络状态变化广播、蓝牙状态变化广播、切换语言广播和切换主题广播等,应用广播可以是由应用程序软件发出的广播。
可以通过终端中的广播管理模块(如ActivityManagerService)监听系统中所有广播发送者的动态,检测广播发送者是否发出广播消息。其中,ActivityManagerService在Android系统的广播机制中扮演着广播中心的角色,负责系统中所有广播的注册和发布操作,其中,广播的注册是指应用程序把广播接收器注册到ActivityManagerService的过程。广播的发布包括广播发送者将广播发送到ActivityManagerService,ActivityManagerService接收到这个广播以后在自己的注册中心查看有哪些广播接收器订阅了该广播,把这个广播逐一发送到这些广播接收器中。在Android系统中,监听广播发送者发出的广播消息即通过ActivityManagerService来监听广播发送者是否将广播消息发送到 ActivityManagerService,当通过ActivityManagerService监听到广播发送者将广播消息发送到ActivityManagerService时,确定监听到广播发送者发出了广播消息。
在步骤120中,在监听到广播发送者发出广播消息时,确定所述广播消息的广播接收者。
在通过广播管理模块监听到广播发送者发出广播消息时,查询注册了接收该广播消息的广播接收器,从而确定接收所述广播消息的广播接收者。
例如,在Android系统中,广播发送者将要发布的广播消息发送到ActivityManagerService,ActivityManagerService接收到广播消息后在注册中心查看有哪些广播接收器订阅了该广播,这时通过注册接收该广播消息的广播接收器(即广播接收进程)可以确定接收该广播消息的广播接收者(应用程序或者系统)。
在步骤130中,根据所述广播接收者,确定所述广播消息的优先级。
在确定了广播消息的广播接收者后,可以根据广播接收者的重要程度确定所述广播消息的优先级,例如,广播接收者是系统,则确定广播消息的优先级为较高的优先级;如果广播接收者是第三方应用程序,则确定广播消息的优先级为较低的优先级。
例如,可以将广播消息的优先级设置为三个优先级:最高优先级、次优先级和普通优先级。并规定:最高优先级的广播消息排到广播消息队列的前端,可以更快的被处理;次优先级的广播消息排在广播消息队列中最高优先级的广播消息的后面,在最高优先级的广播消息处理完之后进行处理;普通优先级的广播消息排在广播消息队列中次优先级的广播消息的后面,在最高优先级和次优先级的广播消息处理完之后进行处理;优先级相同的广播消息,按照入队顺 序进行处理。
在一个实施例中,根据所述广播接收者,确定所述广播消息的优先级,可以包括:统计所述广播接收者在预设时间内的使用频率;根据所述使用频率,确定所述广播消息的优先级。
在确定了广播消息的广播接收者后,获取在当前时间之前的预设时间内用户对该广播接收者的使用频率,并根据使用频率确定广播消息的优先级,如果使用频率较高,则将广播消息的优先级设置为较高的优先级,从而提高了活跃度较高的应用接收广播消息的速度。
在一个实施例中,根据所述使用频率,确定所述广播消息的优先级,包括:根据所述使用频率,确定所述使用频率所属的频率范围;根据所述频率范围,确定所述广播消息的优先级。
可以预先建立频率范围与广播消息的优先级的对应关系。根据广播接收者在预设时间内的使用频率,确定该使用频率所属的频率范围,根据该频率范围及所述对应关系,可以直接确定该广播消息的优先级,可以更加快速的对使用频率高的广播接收者的广播消息进行处理,从而加快广播消息的处理速度。
在另一个实施例中,根据所述广播接收者,确定所述广播消息的优先级,包括:在所述广播接收者当前正在运行的情况下,确定所述广播消息的优先级高于所述广播消息队列中的所有广播消息的优先级。
如果广播接收者是当前正在运行的应用程序,则确定所述广播消息的优先级是最高的,即高于广播消息队列中的所有广播消息的优先级。例如,微信是当前运行的应用程序,且有新的信息发送过来,则产生信息广播,而当前广播消息队列中已有很多广播消息在等待处理,则利用相关技术只能将该信息广播按照顺序进入广播消息队列,从而该信息广播需要等待较长的时间才能被处理 到,而通过本实施例提供的方法,可以确定该信息广播的优先级最高,将该信息广播直接排列在广播消息队列的对头,可以及时对该广播信息进行处理,从而用户及时收到该信息。
在步骤140中,根据所述广播消息的优先级,确定所述广播消息在广播消息队列中的插入位置。
其中,广播消息队列按照广播消息的优先级的顺序进行排列,高优先级的广播消息排列在队头,低优先级的广播消息排列在队尾。
由于广播消息队列是按照广播消息的优先级的顺序进行排列的,则根据广播消息的优先级可以直接确定出该广播消息在广播消息队列中的插入位置。
例如,广播消息的优先级共有三级,分别为最高优先级、次优先级和最低优先级,当前的广播消息队列中只有次优先级和最低优先级的广播消息,且当前监听到的广播消息的优先级为最高优先级,则可以确定该广播消息在广播消息队列中的插入位置为队头。
在一个实施例中,根据所述广播消息的优先级,确定所述广播消息在广播消息队列中的插入位置,可以包括:
将所述广播消息的优先级与所述广播消息队列中的广播消息的优先级进行对比;
根据对比结果,确定所述广播消息在所述广播消息队列中的插入位置。
广播消息队列是按照优先级的高低顺序进行排列的,在确定了广播消息的优先级后,将该优先级与广播消息队列中的广播消息的优先级进行对比,根据对比结果,可以确定所述广播消息在广播消息队列中的插入位置,提高广播消息的处理速度。
在一个实施例中,根据对比结果,确定所述广播消息在所述广播消息队列 中的插入位置,可以包括:
当所述广播消息队列中有与所述优先级相同的广播消息时,确定所述广播消息的插入位置为与所述优先级相同的广播消息之后;
当所述广播消息队列中没有与所述优先级相同的广播消息时,判断所述优先级是否高于所述广播消息队列中的所有广播消息的优先级;
如果所述优先级高于所述广播消息队列中的所有广播消息的优先级,则确定所述插入位置为所述广播消息队列的队头;
如果所述优先级不高于所述广播消息队列中的所有广播消息的优先级,则判断所述优先级是否低于所述广播消息队列中的所有广播消息的优先级;
如果所述优先级低于所述广播消息队列中的所有广播消息的优先级,则确定所述插入位置为所述广播消息的队尾;
如果所述优先级不低于所述广播消息队列中的所有广播消息的优先级,则确定所述广播消息队列中的高于所述优先级和低于所述优先级的相邻两个广播消息,并确定所述广播消息的插入位置为所述相邻两个广播消息之间。
在将广播消息的优先级与广播消息队列中的广播消息的优先级进行对比时,可以判断广播消息队列中是否有与广播消息的优先级相同的广播消息,如果有,则可以直接根据该相同优先级的广播消息所在的位置确定所述广播消息的插入位置,确定的插入位置可以是该相同优先级的广播消息之后并近邻该相同优先级的广播消息。如果广播消息队列中没有与广播消息的优先级相同的广播消息,可以分为三种情况分别进行处理:即所述优先级高于所述广播消息队列中的所有广播消息的优先级、所述优先级低于所述广播消息队列中的所有广播消息的优先级以及所述优先级介于所述广播消息队列中的广播消息的优先级之间。通过分情况确定广播消息的优先级,可以加快广播消息的处理速度。
在步骤150中,根据所述插入位置,将所述广播消息插入所述广播消息队列。
根据确定的插入位置,将所述广播消息插入所述广播消息队列的插入位置中。
本实施例中,通过在监听到广播发送者发出广播消息时,确定所述广播消息的广播接收者,并根据所述广播接收者确定所述广播消息的优先级,进而根据所述优先级确定所述广播消息在广播消息队列中的插入位置,将所述广播消息插入广播消息队列,由于根据优先级确定广播消息在广播消息队列中的位置,从而可以及时快速的处理高优先级的广播消息,及时快速的处理重要的广播消息,避免了系统功能异常。
图2是另一个实施例提供的一种广播消息排队的方法的流程图,该方法包括如下步骤:
在步骤210中,监听广播发送者发出的广播消息。
在步骤220中,在监听到广播发送者发出广播消息时,确定所述广播消息的广播接收者。
在步骤230中,根据所述广播接收者,确定所述广播消息的优先级。
在步骤240中,根据所述广播消息的优先级,确定所述广播消息在广播消息队列中的插入位置。
在步骤250中,根据所述插入位置,将所述广播消息插入所述广播消息队列。
在步骤260中,按照所述广播消息队列中的广播消息的排队顺序,识别当前的广播消息的广播接收者。
本实施例中,广播消息队列是根据广播消息的优先级进行排队的,广播消 息队列在不断的动态变化中,在终端运行的过程中,广播消息队列在持续更新,广播消息队列中分发完毕的广播消息在广播消息队列中清除,在分发广播消息队列中的广播消息时也有可能有新的广播消息进入广播消息队列。例如,广播消息队列中按照广播消息的排队顺序包括广播消息1、广播消息2、广播消息3、广播消息4......广播消息100,按照广播消息队列中的广播消息的排队顺序分发其中的广播消息时,先分发广播消息1,广播消息1分发完之后分发广播消息2,以此顺序类推,直到将广播消息队列中的广播消息分发完毕。
其中,当前的广播消息可以是当前待分发的广播消息,例如:广播消息队列中按照分发的先后顺序包括广播消息1、广播消息2、广播消息3、广播消息4......广播消息100,其中广播消息1是当前正在分发的广播消息,那么广播消息2即为当前待分发的广播消息,也可以是广播消息1之前的广播消息刚分发完毕,则广播消息1是当前待分发的广播消息。广播接收者可以是安装于终端的第三方应用软件或者系统自带的应用程序。例如,在Android系统中,识别当前的广播消息的广播接收者时,通过ActivityManagerService在注册中心查看有哪些广播接收者订阅了接收该广播消息的广播接收器,从而确定该广播消息的广播接收者。
在步骤270中,将所述当前的广播消息分发给该广播接收者。
在识别当前待分发的广播消息的广播接收者之后,依次将该广播消息分发给一个或多个广播接收者,可以保证广播接收者对广播消息的及时响应。
本实施例中,通过在监听到广播发送者发出广播消息时,确定广播消息的广播消息的广播接收者,根据所述广播接收者确定广播消息的优先级,根据广播消息的优先级确定广播消息在广播消息队列中的插入位置,进而根据所述插入位置,将广播消息插入广播消息队列,并根据广播消息队列中广播消息的排 队顺序分发广播消息,从而实现了及时快速分发重要的广播消息,并可以保证广播接收者快速的响应该广播消息,避免了系统功能异常。
图3是本实施例提供的一种广播消息排队的装置的结构示意图,如图3所示,本实施例所述的广播消息排队的装置包括:广播消息监听模块310、广播接收者确定模块320、优先级确定模块330、插入位置确定模块340和广播消息插入模块350。
其中,广播消息监听模块310,设置为监听广播发送者发出的广播消息;
广播接收者确定模块320,设置为在监听到广播发送者发出广播消息时,确定所述广播消息的广播接收者;
优先级确定模块330,设置为根据所述广播接收者,确定所述广播消息的优先级;
插入位置确定模块340,设置为根据所述广播消息的优先级,确定所述广播消息在广播消息队列中的插入位置;
广播消息插入模块350,设置为根据所述插入位置,将所述广播消息插入所述广播消息队列。
在一实施例中,所述优先级确定模块330包括:
使用频率统计单元,设置为统计所述广播接收者在预设时间内的使用频率;
优先级确定单元,设置为根据所述使用频率,确定所述广播消息的优先级。
在一实施例中,所述优先级确定单元是设置为:根据所述使用频率,确定所述使用频率所属的频率范围;根据所述频率范围,确定所述广播消息的优先 级。
在一实施例中,所述优先级确定模块330包括:
最高优先级确定单元,设置为如果所述广播接收者当前正在运行,则确定所述广播消息的优先级高于所述广播消息队列中的所有广播消息的优先级。
在一实施例中,所述插入位置确定模块340包括:
优先级对比单元,设置为将所述广播消息的优先级与所述广播消息队列中的广播消息的优先级进行对比;
插入位置确定单元,设置为根据对比结果,确定所述广播消息在所述广播消息队列中的插入位置。
在一实施例中,所述插入位置确定单元是设置为:
当所述广播消息队列中有与所述优先级相同的广播消息时,确定所述广播消息的插入位置为与所述优先级相同的广播消息之后;
当所述广播消息队列中没有与所述优先级相同的广播消息时,判断所述优先级是否高于所述广播消息队列中的所有广播消息的优先级;
如果所述优先级高于所述广播消息队列中的所有广播消息的优先级,则确定所述插入位置为所述广播消息队列的队头;
如果所述优先级不高于所述广播消息队列中的所有广播消息的优先级,则判断所述优先级是否低于所述广播消息队列中的所有广播消息的优先级;
如果所述优先级低于所述广播消息队列中的所有广播消息的优先级,则确定所述插入位置为所述广播消息的队尾;
如果所述优先级不低于所述广播消息队列中的所有广播消息的优先级,则确定所述广播消息队列中的高于所述优先级和低于所述优先级的相邻两个广播消息,并确定所述广播消息的插入位置为所述相邻两个广播消息之间。
在一实施例中,所述装置还包括:
广播接收者识别模块,设置为在广播消息插入模块将所述广播消息插入所述广播消息队列之后,按照所述广播消息队列中的广播消息的排队顺序,识别当前的广播消息的广播接收者;
广播消息分发模块,设置为将所述当前的广播消息分发给该广播接收者。
上述广播消息排队的装置可执行本公开任意实施例所提供的广播消息排队的方法,具备执行方法相应的功能模块和有益效果。未在本实施例中详尽描述的技术细节,可参见本公开任意实施例提供的广播消息排队的方法。
本实施例还提供了一种终端,该终端可以包括本公开任意实施例提供的广播消息排队的装置。图4为本实施例提供的一种终端的结构示意图,如图4所示,该终端可以包括:壳体(图中未示出)、存储器401、中央处理器(Central Processing Unit,CPU)402(又称处理器,以下简称CPU)、存储在存储器401上并可在处理器402上运行的计算机程序、电路板(图中未示出)和电源电路(图中未示出)。所述电路板安置在所述壳体围成的空间内部;所述CPU402和所述存储器401设置在所述电路板上;所述电源电路,设置为为所述终端的各个电路或器件供电;所述存储器401,设置为存储可在处理器上运行的计算机程序;所述CPU402设置为读取并执行所述存储器401中存储的计算机程序。
该终端还包括:外设接口403、RF(Radio Frequency,射频)电路405、音频电路406、扬声器411、电源管理芯片408、输入/输出(I/O)子系统409、触摸屏412、其他输入或控制设备410以及外部端口404,这些部件通过一个或多个通信总线或信号线407来通信。
图示终端400仅仅是终端的一个示例,并且终端400可以具有比图中所示 出的更多的或者更少的部件,可以组合两个或更多的部件,或者可以具有不同的部件配置。图中所示出的多种部件可以在包括一个或多个信号处理程序及专用集成电路中的至少一个在内的硬件、软件、或硬件和软件的组合中实现。
下面就本实施例提供的用于广播消息排队的终端进行描述,该终端以手机为例。
存储器401,所述存储器401可以被CPU402、外设接口403等访问,所述存储器401可以包括高速随机存取存储器,还可以包括非易失性存储器,例如一个或多个磁盘存储器件、闪存器件、或其他易失性固态存储器件。
外设接口403,所述外设接口403可以将设备的输入和输出外设连接到CPU402和存储器401。
I/O子系统409,所述I/O子系统409可以将设备上的输入输出外设,例如触摸屏402(相当于上述实施例中的屏幕)和其他输入或控制设备410,连接到外设接口403。I/O子系统409可以包括显示控制器4091和设置为控制其他输入或控制设备410的一个或多个输入控制器4092。其中,一个或多个输入控制器4092从其他输入或控制设备410接收电信号或者向其他输入或控制设备410发送电信号,其他输入或控制设备410可以包括物理按钮(按压按钮、摇臂按钮等)、拨号盘、滑动开关、操纵杆、点击滚轮。输入控制器4092可以与以下任一个连接:键盘、红外端口、USB接口以及诸如鼠标的指示设备。
触摸屏412,所述触摸屏412是用户终端与用户之间的输入接口和输出接口,将可视输出显示给用户,可视输出可以包括图形、文本、图标和视频等。
I/O子系统409中的显示控制器4091从触摸屏412接收电信号或者向触摸屏412发送电信号。触摸屏412检测触摸屏上的接触,显示控制器4091将检测到的接触转换为与显示在触摸屏412上的用户界面对象的交互,即实现人机交 互,显示在触摸屏412上的用户界面对象可以是运行游戏的图标、联网到相应网络的图标等。终端设备还可以包括光鼠,光鼠是不显示可视输出的触摸敏感表面,或者是由触摸屏形成的触摸敏感表面的延伸。
RF电路405,设置为建立手机与无线网络(即网络侧)的通信,实现手机与无线网络的数据接收和发送。例如收发短信息、电子邮件等。例如,RF电路405接收并发送RF信号,RF信号也称为电磁信号,RF电路405将电信号转换为电磁信号或将电磁信号转换为电信号,并且通过该电磁信号与通信网络以及其他设备进行通信。RF电路405可以包括用于执行这些功能的已知电路,如包括天线系统、RF收发机、一个或多个放大器、调谐器、一个或多个振荡器、数字信号处理器、CODEC(COder-DECoder,编译码器)芯片组和用户标识模块(Subscriber Identity Module,SIM)等等。
音频电路406,用设置为从外设接口403接收音频数据,将该音频数据转换为电信号,并且将该电信号发送给扬声器411。
扬声器411,设置为将手机通过RF电路405从无线网络接收的语音信号,还原为声音并向用户播放该声音。
电源管理芯片408,设置为为CPU402、I/O子系统及外设接口所连接的硬件进行供电及电源管理。
本实施例提供的CPU402在执行所述存储器401中存储的计算机程序时实现以下步骤:
监听广播发送者发出的广播消息;
在监听到广播发送者发出广播消息时,确定所述广播消息的广播接收者;
根据所述广播接收者,确定所述广播消息的优先级;
根据所述广播消息的优先级,确定所述广播消息在广播消息队列中的插入 位置;
根据所述插入位置,将所述广播消息插入所述广播消息队列。
上述终端可执行本公开任意实施例所提供的方法,具备执行方法相应的功能模块和有益效果。
本实施例还提供一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令用于执行上述任意一种方法。
存储介质可以是非暂态存储介质,也可以是暂态存储介质。非暂态存储介质可以包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等多种可以存储程序代码的介质。
上述实施例方法中的全部或部分流程,是可以通过计算机程序来指示相关的硬件完成的,该程序可存储于一个非暂态计算机可读存储介质中,该程序被执行时,可包括如上述方法的实施例的流程。
工业实用性
本公开提供一种广播消息排队的方法、装置及终端,可以实现根据优先级确定广播消息在广播消息队列中的位置,从而可以及时快速的处理高优先级的广播消息,及时快速的处理重要的广播消息,避免了系统功能异常。

Claims (16)

  1. 一种广播消息排队的方法,包括:
    监听广播发送者发出的广播消息;
    在监听到所述广播发送者发出广播消息时,确定所述广播消息的广播接收者;
    根据所述广播接收者,确定所述广播消息的优先级;
    根据所述广播消息的优先级,确定所述广播消息在广播消息队列中的插入位置;
    根据所述插入位置,将所述广播消息插入所述广播消息队列。
  2. 根据权利要求1所述的方法,其中,根据所述广播接收者,确定所述广播消息的优先级,包括:
    统计所述广播接收者在预设时间内的使用频率;
    根据所述使用频率,确定所述广播消息的优先级。
  3. 根据权利要求2所述的方法,其中,根据所述使用频率,确定所述广播消息的优先级,包括:
    根据所述使用频率,确定所述使用频率所属的频率范围;
    根据所述频率范围,确定所述广播消息的优先级。
  4. 根据权利要求1所述的方法,其中,根据所述广播接收者,确定所述广播消息的优先级,包括:
    在所述广播接收者当前正在运行的情况下,确定所述广播消息的优先级高于所述广播消息队列中的所有广播消息的优先级。
  5. 根据权利要求1所述的方法,其中,根据所述广播消息的优先级,确定所述广播消息在广播消息队列中的插入位置,包括:
    将所述广播消息的优先级与所述广播消息队列中的广播消息的优先级进行 对比;
    根据对比结果,确定所述广播消息在所述广播消息队列中的插入位置。
  6. 根据权利要求5所述的方法,其中,根据对比结果,确定所述广播消息在所述广播消息队列中的插入位置,包括:
    当所述广播消息队列中有与所述优先级相同的广播消息时,确定所述广播消息的插入位置为与所述优先级相同的广播消息之后;
    当所述广播消息队列中没有与所述优先级相同的广播消息时,判断所述优先级是否高于所述广播消息队列中的所有广播消息的优先级;
    当所述优先级高于所述广播消息队列中的所有广播消息的优先级时,确定所述插入位置为所述广播消息队列的队头;
    当所述优先级不高于所述广播消息队列中的所有广播消息的优先级时,判断所述优先级是否低于所述广播消息队列中的所有广播消息的优先级;
    当所述优先级低于所述广播消息队列中的所有广播消息的优先级时,确定所述插入位置为所述广播消息的队尾;
    当所述优先级不低于所述广播消息队列中的所有广播消息的优先级时,确定所述广播消息队列中的高于所述优先级和低于所述优先级的相邻两个广播消息,并确定所述广播消息的插入位置为所述相邻两个广播消息之间。
  7. 根据权利要求1-6任一所述的方法,在将所述广播消息插入所述广播消息队列之后,还包括:
    按照所述广播消息队列中的广播消息的排队顺序,识别当前的广播消息对应的广播接收者;
    将所述当前的广播消息分发给对应的广播接收者。
  8. 一种广播消息排队的装置,包括:
    广播消息监听模块,设置为监听广播发送者发出的广播消息;
    广播接收者确定模块,设置为在监听到所述广播发送者发出广播消息时,确定所述广播消息的广播接收者;
    优先级确定模块,设置为根据所述广播接收者,确定所述广播消息的优先级;
    插入位置确定模块,设置为根据所述广播消息的优先级,确定所述广播消息在广播消息队列中的插入位置;
    广播消息插入模块,设置为根据所述插入位置,将所述广播消息插入所述广播消息队列。
  9. 根据权利要求8所述的装置,其中,所述优先级确定模块包括:
    使用频率统计单元,设置为统计所述广播接收者在预设时间内的使用频率;
    优先级确定单元,设置为根据所述使用频率,确定所述广播消息的优先级。
  10. 根据权利要求9所述的装置,其中,所述优先级确定单元是设置为:
    根据所述使用频率,确定所述使用频率所属的频率范围;
    根据所述频率范围,确定所述广播消息的优先级。
  11. 根据权利要求8所述的装置,其中,所述优先级确定模块包括:
    最高优先级确定单元,设置为在所述广播接收者当前正在运行的情况下,确定所述广播消息的优先级高于所述广播消息队列中的所有广播消息的优先级。
  12. 根据权利要求8所述的装置,其中,所述插入位置确定模块包括:
    优先级对比单元,设置为将所述广播消息的优先级与所述广播消息队列中 的广播消息的优先级进行对比;
    插入位置确定单元,设置为根据对比结果,确定所述广播消息在所述广播消息队列中的插入位置。
  13. 根据权利要求12所述的装置,其中,所述插入位置确定单元是设置为:
    当所述广播消息队列中有与所述优先级相同的广播消息时,确定所述广播消息的插入位置为与所述优先级相同的广播消息之后;
    当所述广播消息队列中没有与所述优先级相同的广播消息时,判断所述优先级是否高于所述广播消息队列中的所有广播消息的优先级;
    当所述优先级高于所述广播消息队列中的所有广播消息的优先级时,确定所述插入位置为所述广播消息队列的队头;
    当所述优先级不高于所述广播消息队列中的所有广播消息的优先级时,判断所述优先级是否低于所述广播消息队列中的所有广播消息的优先级;
    当所述优先级低于所述广播消息队列中的所有广播消息的优先级时,确定所述插入位置为所述广播消息的队尾;
    当所述优先级不低于所述广播消息队列中的所有广播消息的优先级时,则确定所述广播消息队列中的高于所述优先级和低于所述优先级的相邻两个广播消息,并确定所述广播消息的插入位置为所述相邻两个广播消息之间。
  14. 根据权利要求8-13任一所述的装置,还包括:
    广播接收者识别模块,设置为在将所述广播消息插入所述广播消息队列之后,按照所述广播消息队列中的广播消息的排队顺序,识别当前的广播消息对应的广播接收者;
    广播消息分发模块,设置为将所述当前的广播消息分发给对应的广播接收 者。
  15. 一种终端,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现以下步骤:
    监听广播发送者发出的广播消息;
    在监听到所述广播发送者发出广播消息时,确定所述广播消息的广播接收者;
    根据所述广播接收者,确定所述广播消息的优先级;
    根据所述广播消息的优先级,确定所述广播消息在广播消息队列中的插入位置;
    根据所述插入位置,将所述广播消息插入所述广播消息队列。
  16. 一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令用于执行权利要求1-7任一所述的方法。
PCT/CN2018/078626 2017-03-10 2018-03-09 广播消息排队的方法、装置及终端 WO2018161968A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP18764720.1A EP3591949B1 (en) 2017-03-10 2018-03-09 Broadcast message queuing method and device, and terminal
US16/565,425 US11051272B2 (en) 2017-03-10 2019-09-09 Method for arranging broadcast message in operating system and electronic device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710140760.6 2017-03-10
CN201710140760.6A CN106851016B (zh) 2017-03-10 2017-03-10 广播消息排队的方法、装置及终端

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/565,425 Continuation US11051272B2 (en) 2017-03-10 2019-09-09 Method for arranging broadcast message in operating system and electronic device

Publications (1)

Publication Number Publication Date
WO2018161968A1 true WO2018161968A1 (zh) 2018-09-13

Family

ID=59143547

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/078626 WO2018161968A1 (zh) 2017-03-10 2018-03-09 广播消息排队的方法、装置及终端

Country Status (4)

Country Link
US (1) US11051272B2 (zh)
EP (1) EP3591949B1 (zh)
CN (1) CN106851016B (zh)
WO (1) WO2018161968A1 (zh)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106851016B (zh) 2017-03-10 2019-03-19 Oppo广东移动通信有限公司 广播消息排队的方法、装置及终端
CN108762953B (zh) * 2018-05-25 2022-03-15 连云港杰瑞电子有限公司 一种消息队列实现方法
CN112052101A (zh) * 2020-07-17 2020-12-08 苏宁智能终端有限公司 一种广播的处理方法、装置及计算机系统
US11621995B2 (en) 2020-07-27 2023-04-04 Cloudflare, Inc. Preloading on-demand code pieces in a distributed cloud computing network
CN117707754A (zh) * 2023-06-30 2024-03-15 荣耀终端有限公司 系统广播发送方法和电子设备
CN117879742B (zh) * 2024-02-29 2024-06-14 广东美电国创科技有限公司 应急广播管理方法及装置

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140013271A1 (en) * 2012-07-05 2014-01-09 Research In Motion Limited Prioritization of multitasking applications in a mobile device interface
CN103593217A (zh) * 2013-11-26 2014-02-19 广东欧珀移动通信有限公司 一种调整耳机的hook键启动应用次序的方法及终端
CN103826008A (zh) * 2014-02-18 2014-05-28 华为终端有限公司 一种移动终端通知消息提示方法、装置及移动终端
CN103888619A (zh) * 2014-04-16 2014-06-25 青岛海信电子设备股份有限公司 一种消息处理方法及其系统
CN106851016A (zh) * 2017-03-10 2017-06-13 广东欧珀移动通信有限公司 广播消息排队的方法、装置及终端

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5784615A (en) * 1994-12-13 1998-07-21 Microsoft Corporation Computer system messaging architecture
US7490183B2 (en) * 2004-02-12 2009-02-10 International Business Machines Corporation Information kit integration architecture for end-user systems
GB2412762B (en) * 2004-04-02 2009-01-28 Symbian Software Ltd Inter process communication in a computing device
US8023408B2 (en) * 2004-11-19 2011-09-20 International Business Machines Corporation Dynamically changing message priority or message sequence number
US7660321B2 (en) * 2006-03-01 2010-02-09 Alcatel-Lucent Usa Inc. System and method for prioritizing session initiation protocol messages
CN103532823B (zh) * 2012-07-04 2018-11-23 中兴通讯股份有限公司 物联网消息处理方法、装置及系统
CN104254074B (zh) * 2013-06-28 2020-08-07 腾讯科技(深圳)有限公司 一种拦截骚扰短消息的方法和装置
KR101510150B1 (ko) * 2013-07-05 2015-04-10 충남대학교산학협력단 메시지 가로채기 방지 방법 및 이를 이용하는 휴대 단말기
CN103401896B (zh) 2013-07-15 2016-06-22 四川公用信息产业有限责任公司 一种多Android客户端服务共享方法及系统
CN103491507B (zh) * 2013-09-05 2017-08-01 广东欧珀移动通信有限公司 一种有序广播优先级重定位的方法及装置
EP3106985B1 (en) * 2015-06-16 2020-05-06 Huawei Technologies Co., Ltd. Method and apparatus for classifying virtual activities of mobile users
CN105357648A (zh) 2015-10-10 2016-02-24 上海斐讯数据通信技术有限公司 向应用程序发送广播消息的方法及Android系统

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140013271A1 (en) * 2012-07-05 2014-01-09 Research In Motion Limited Prioritization of multitasking applications in a mobile device interface
CN103593217A (zh) * 2013-11-26 2014-02-19 广东欧珀移动通信有限公司 一种调整耳机的hook键启动应用次序的方法及终端
CN103826008A (zh) * 2014-02-18 2014-05-28 华为终端有限公司 一种移动终端通知消息提示方法、装置及移动终端
CN103888619A (zh) * 2014-04-16 2014-06-25 青岛海信电子设备股份有限公司 一种消息处理方法及其系统
CN106851016A (zh) * 2017-03-10 2017-06-13 广东欧珀移动通信有限公司 广播消息排队的方法、装置及终端

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3591949A4 *

Also Published As

Publication number Publication date
EP3591949A1 (en) 2020-01-08
EP3591949B1 (en) 2022-04-27
EP3591949A4 (en) 2020-03-11
CN106851016B (zh) 2019-03-19
CN106851016A (zh) 2017-06-13
US20200008174A1 (en) 2020-01-02
US11051272B2 (en) 2021-06-29

Similar Documents

Publication Publication Date Title
WO2018161968A1 (zh) 广播消息排队的方法、装置及终端
CN106851014B (zh) 调整广播消息队列的方法、装置及终端
US10819455B2 (en) Broadcast processing method, non-transitory storage medium, and electronic device
CN106921947B (zh) 调整广播消息队列的方法、装置及终端
US10097292B2 (en) Method, device, terminal and storage medium for adjusting broadcast message queue
CN106851015B (zh) 调整广播消息队列的方法、装置及终端
CN106936825B (zh) 一种控制广播发送的方法、装置及移动终端
EP3592003B1 (en) Broadcast control method, device, storage medium and mobile terminal
US20200004614A1 (en) Broadcast Transmission Method, Terminal, and Storage Medium
US10908976B2 (en) Broadcast queue adjustment method, terminal, and storage medium
CN109165114B (zh) 应用程序无响应的处理方法、装置、存储介质及智能终端
US10990460B2 (en) Method of generating broadcast queue, storage medium, and terminal
EP3373137B1 (en) Method, apparatus and terminal device for sending broadcast
EP3592005A1 (en) Method and device for controlling broadcast recipient, and mobile terminal
WO2018161589A1 (zh) 控制广播发送的方法、装置、存储介质及电子设备
CN106850458B (zh) 广播消息排队的方法、装置及终端
EP3373513B1 (en) Method for monitoring broadcast message and terminal
CN106899943B (zh) 控制广播发送者发送广播消息的方法、装置和终端设备
CN106936828B (zh) 一种广播接收者队列调整方法、装置及终端
CN106936996B (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: 18764720

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

Country of ref document: EP

Effective date: 20191002