WO2018161579A1 - Broadcast message queuing method and apparatus, storage device, and electronic device - Google Patents

Broadcast message queuing method and apparatus, storage device, and electronic device Download PDF

Info

Publication number
WO2018161579A1
WO2018161579A1 PCT/CN2017/106769 CN2017106769W WO2018161579A1 WO 2018161579 A1 WO2018161579 A1 WO 2018161579A1 CN 2017106769 W CN2017106769 W CN 2017106769W WO 2018161579 A1 WO2018161579 A1 WO 2018161579A1
Authority
WO
WIPO (PCT)
Prior art keywords
broadcast message
priority
broadcast
determining
message queue
Prior art date
Application number
PCT/CN2017/106769
Other languages
French (fr)
Chinese (zh)
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 广东欧珀移动通信有限公司
Publication of WO2018161579A1 publication Critical patent/WO2018161579A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling
    • H04L47/62Queue scheduling characterised by scheduling criteria
    • H04L47/625Queue scheduling characterised by scheduling criteria for service slots or service orders
    • H04L47/6275Queue scheduling characterised by scheduling criteria for service slots or service orders based on priority
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/24Traffic characterised by specific attributes, e.g. priority or QoS
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling
    • H04L47/62Queue scheduling characterised by scheduling criteria
    • H04L47/624Altering the ordering of packets in an individual queue
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/06Selective distribution of broadcast services, e.g. multimedia broadcast multicast service [MBMS]; Services to user groups; One-way selective calling services

Definitions

  • the embodiments of the present invention relate to system broadcast technologies, and in particular, to a method, an apparatus, a storage device, and an electronic device for queuing a broadcast message.
  • 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. When there are messages to notify different applications, the message is sent to the broadcaster. Different apps.
  • the embodiment of the present invention provides a method, a device, a storage medium, and an electronic device for queuing broadcast messages, which can process important broadcast messages in a timely manner and avoid abnormal system functions.
  • the embodiment of the present application provides a method for queuing a broadcast message, where the method includes:
  • the broadcast message is inserted into the broadcast message queue according to the insertion location.
  • the embodiment of the present application further provides an apparatus for queuing a broadcast message, where the apparatus includes:
  • a broadcast message monitoring module configured to listen to a broadcast message sent by a broadcast sender
  • a priority determining module configured to determine a priority of the broadcast message according to the broadcast sender when the broadcast sender is notified to send a broadcast message
  • An insertion location determining module configured to determine, according to a priority of the broadcast message, an insertion location of the broadcast message in a broadcast message queue;
  • a broadcast message insertion module configured to insert the broadcast message into the broadcast message queue according to the insertion location.
  • an embodiment of the present application provides a storage medium, where the storage medium stores a plurality of instructions, and the instructions are adapted to be loaded by a processor to perform the method for queuing the broadcast message.
  • an 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 broadcast message is inserted into the broadcast message queue according to the insertion location.
  • the embodiment of the present invention provides a method, a device, a storage medium, and an electronic device for queuing broadcast messages, which can process important broadcast messages in a timely manner and avoid abnormal system functions.
  • FIG. 1 is a flowchart of a method for queuing a broadcast message according to an embodiment of the present application.
  • FIG. 2 is a flowchart of another method for queuing broadcast messages according to an embodiment of the present application.
  • FIG. 3 is a schematic structural diagram of an apparatus for queuing a broadcast message according to an embodiment of the present application.
  • FIG. 4 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 method for queuing a broadcast message, including:
  • the broadcast message is inserted into the broadcast message queue according to the insertion location.
  • determining, according to the broadcast sender, a priority of the broadcast message including:
  • the priority of the broadcast message is determined according to the frequency of use.
  • determining a priority of the broadcast message according to the frequency of use includes:
  • the correspondence between the frequency range and the priority of the broadcast message is established in advance
  • Determining a priority of the broadcast message according to the frequency range including:
  • determining the insertion position of the broadcast message in the broadcast message queue according to the priority of the broadcast message includes:
  • the insertion position of the broadcast message in the broadcast message queue is determined.
  • determining the insertion position of the broadcast message in the broadcast message queue according to the comparison result includes:
  • 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 method further includes:
  • FIG. 1 is a flowchart of a method for queuing a broadcast message according to an embodiment of the present application.
  • 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 broadcasted.
  • the device is executed by a message queuing device, wherein the device may be implemented by software and/or hardware, and the device may be integrated into an electronic device, and the electronic device may be a smart phone, a tablet computer or the like, and the method includes the following steps:
  • Step 110 Listen to a broadcast message sent by a broadcast sender.
  • the broadcast mechanism is essentially a communication between components in an operating system of an electronic device, and is a mechanism widely used to transfer messages between applications.
  • a broadcast message is sent under the Android system of an electronic device.
  • the broadcast message can be a variety of event message data generated in the operating system. For example, if you send a text message or make a phone call, a broadcast will be sent.
  • an application receives the broadcast, it can handle it.
  • the broadcast sender can be system and application software.
  • the application software may be a third-party application software installed on an electronic device such as a mobile phone or an application provided by the system.
  • a third-party application software installed on the electronic device may include a WeChat client, a QQ client, a Taobao client, and an Alipayer.
  • Clients, etc., 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 video screen broadcast, an unlock broadcast, a network state change broadcast, a Bluetooth state change broadcast, a switching language broadcast, a switching theme broadcast, etc., and the application broadcast may be A broadcast made by the application software.
  • the broadcast management module (such as ActivityManagerService) in the electronic device 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 registry, and then sends the broadcast to the 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 When listening to the broadcast sender to send a broadcast message, determine the priority of the broadcast message according to the broadcast sender.
  • the priority of the broadcast message may be determined according to the importance of the broadcast sender or the importance of the broadcast message and the urgency of the real-time processing, for example, if the broadcast sender Is the system, then the priority of the broadcast message is determined to be a higher priority; if the broadcast sender is a third-party application, the priority of the broadcast message is determined to be a lower priority.
  • the priority of the 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.
  • the corresponding mobile phone when the user presses the power button to light the screen or turns off the screen, the corresponding mobile phone sends a bright screen broadcast or a blackout broadcast, and the broadcast is performed according to the broadcast when the broadcast enters the broadcast message queue.
  • the chronological order enters the broadcast message queue. If there are many broadcasts in the broadcast message queue in front of this bright-screen broadcast or the cut-off broadcast, the broadcast is waiting for processing (these broadcasts are not system broadcasts), which will affect the speed of the mobile phone.
  • the screen is slowed down.
  • the ActivityManagerService when the ActivityManagerService detects that the system sends a bright broadcast or a blackout broadcast to the ActivityManagerService, and determines that the broadcast sender that sends the bright broadcast or the cut-off broadcast is the system, the bright screen is broadcasted or extinguished.
  • the priority of the screen broadcast is set to the highest priority, so that it is placed at the front end of the broadcast message queue, so that the bright screen broadcast or the screencast broadcast can be processed as soon as possible.
  • determining, according to the broadcast sender, a priority of the broadcast message optionally including:
  • the priority of the broadcast message is determined according to the frequency of use.
  • determining a priority of the broadcast message according to the frequency of use optionally including:
  • the correspondence between the frequency range and the priority of the broadcast message can be established in advance. First, according to the frequency of use, the frequency range to which the frequency of use belongs is determined. According to the frequency range and the corresponding relationship, the priority of the broadcast message can be directly determined, thereby further speeding up the processing speed of the broadcast message.
  • Step 130 Determine, according to a priority of the broadcast message, an insertion location of the broadcast message in a broadcast message queue.
  • 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, only the secondary and lowest priority broadcast messages in the current broadcast message queue are currently monitored.
  • the priority of the broadcast message 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 optionally including:
  • 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 the broadcast can be determined according to the comparison result. The insertion position of the message in the broadcast message queue further 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 optionally including:
  • 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 priority of the broadcast message with the priority of the broadcast message in the broadcast message queue may first determine whether there is a broadcast message with the same priority as the broadcast message in the broadcast message queue, and if so, directly according to the broadcast message The location of the broadcast message of the same priority determines the insertion location of the broadcast message, and the determined insertion location may be a broadcast message of the same priority and adjacent to the same priority broadcast message. If there is no broadcast message in the broadcast message queue that has the same priority as the broadcast message, it can be processed separately in three cases: that is, the priority is higher than the priority of all the broadcast messages in the broadcast message queue, The priority is lower than the priority of all broadcast messages in the broadcast message queue and the priority is between the priority of the broadcast messages in the broadcast message queue. By determining the priority of the broadcast message by case, the processing speed of the broadcast message can be further accelerated.
  • Step 140 Insert the broadcast message 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 message queuing method provided by this embodiment determines the priority of the broadcast message according to the broadcast sender when the broadcast sender sends the broadcast message, and determines the broadcast message according to the priority of the broadcast message.
  • the insertion position in the broadcast message queue is further inserted into the broadcast message queue according to the insertion position, thereby realizing timely and fast processing of important broadcast messages and avoiding system function abnormality.
  • FIG. 2 is a flowchart of a method for queuing a broadcast message according to an embodiment of the present application, where the method includes the following steps:
  • Step 210 Listen to a broadcast message sent by a broadcast sender.
  • Step 220 When listening to the broadcast sender to send a broadcast message, determine the priority of the broadcast message according to the broadcast sender.
  • Step 230 Determine, according to a priority of the broadcast message, an insertion position of the broadcast message in a broadcast message queue.
  • Step 240 Insert the broadcast message into the broadcast message queue according to the insertion position.
  • Step 250 Identify a broadcast recipient of the current broadcast message according to a queuing sequence of the broadcast message in the broadcast message queue.
  • the broadcast message queue is queued according to the priority of the broadcast message.
  • the broadcast message queue is continuously updated, and the broadcast message queue is distributed.
  • the completed broadcast message is cleared in the broadcast message queue, and it is also possible that a new broadcast message enters the broadcast message queue when distributing the broadcast message 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 a queued order of broadcast messages in the broadcast message queue.
  • the current broadcast message may be a broadcast message to be distributed currently.
  • 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, and a broadcast message in a sequence of distribution.
  • Message 1 is the broadcast message currently being distributed
  • broadcast message 2 is the broadcast message currently to be distributed.
  • the broadcast recipient can be a third-party application installed on the electronic device or an application that comes with the system. Exemplarily, 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 its broadcast recipient.
  • Step 260 distributing the current broadcast message to the broadcast recipient.
  • the broadcast recipient By distributing the broadcast message to each broadcast recipient in turn after identifying the broadcast recipient of the broadcast message currently to be distributed, the broadcast recipient can be assured of a timely response to the broadcast message.
  • the technical solution of the embodiment determines the insertion position of the broadcast message in the broadcast message queue according to the priority of the broadcast message by determining the priority of the broadcast message according to the broadcast sender when the broadcast sender sends the broadcast message. And according to the insertion location, the broadcast message is inserted into the broadcast message queue, and the broadcast message is distributed according to the queued order of the broadcast message in the broadcast message queue, thereby realizing timely and timely distribution of important broadcast messages, and ensuring the broadcast receiver quickly Responding to the broadcast message, avoiding system function exceptions.
  • the embodiment of the present application further provides an apparatus for queuing broadcast messages, including:
  • a broadcast message monitoring module configured to listen to a broadcast message sent by a broadcast sender
  • a priority determining module configured to determine a priority of the broadcast message according to the broadcast sender when the broadcast sender is notified to send a broadcast message
  • An insertion location determining module configured to determine, according to a priority of the broadcast message, an insertion location of the broadcast message in a broadcast message queue;
  • a broadcast message insertion module configured to insert the broadcast message into the broadcast message queue according to the insertion location.
  • the priority determining module includes:
  • a frequency statistics unit configured to count the frequency of use of the broadcast sender within a preset time
  • a priority determining unit configured to determine a priority of the broadcast message according to the frequency of use.
  • the priority determining unit is specifically configured to:
  • the correspondence between the frequency range and the priority of the broadcast message is established in advance
  • the priority determining unit is specifically configured to determine a priority of the broadcast message according to the frequency range, including:
  • the insertion position determining module 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
  • an insertion location determining unit configured to determine, according to the comparison result, an insertion position of the broadcast message in the broadcast message queue.
  • the insertion position determining unit is specifically 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 method further includes:
  • a broadcast receiver identification module configured to identify a broadcast receiver of a current broadcast message according to a queuing sequence of broadcast messages in the broadcast message queue
  • a broadcast message distribution module configured to distribute the current broadcast message to the broadcast recipient.
  • FIG. 3 is a schematic structural diagram of an apparatus for queuing a broadcast message according to an embodiment of the present application.
  • the apparatus for queuing broadcast messages according to the example includes: a broadcast message listening module 310, a priority determining module 320, an insertion location determining module 330, and a broadcast message inserting module 340.
  • the broadcast message monitoring module is configured to listen to a broadcast message sent by a broadcast sender
  • a priority determining module configured to determine a priority of the broadcast message according to the broadcast sender when the broadcast sender is notified to send a broadcast message
  • An insertion location determining module configured to determine, according to a priority of the broadcast message, an insertion location of the broadcast message in a broadcast message queue;
  • a broadcast message insertion module configured to insert the broadcast message into the broadcast message queue according to the insertion location.
  • the priority determining module includes:
  • a frequency statistics unit configured to count the frequency of use of the broadcast sender within a preset time
  • a priority determining unit configured to determine a priority of the broadcast message according to the frequency of use.
  • the priority determining unit is specifically configured to:
  • the insertion position determining module 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
  • an insertion location determining unit configured to determine, according to the comparison result, an insertion position of the broadcast message in the broadcast message queue.
  • the insertion position determining unit is specifically 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 method further includes:
  • a broadcast receiver identification module configured to identify a broadcast receiver of a current broadcast message according to a queuing sequence of broadcast messages in the broadcast message queue
  • a broadcast message distribution module configured to distribute the current broadcast message to the broadcast recipient.
  • the device for queuing the broadcast message can perform the method for queuing the broadcast message provided by any embodiment of the present application, and has the corresponding functional modules and beneficial effects of the execution method.
  • the device for queuing the broadcast message can perform the method for queuing the broadcast message provided by any embodiment of the present application, and has the corresponding functional modules and beneficial effects of the execution method.
  • the embodiment of the present application further provides a storage medium, where the storage medium stores a plurality of instructions, and the instructions are adapted to be loaded by the processor in the steps in any of the foregoing embodiments.
  • FIG. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
  • the electronic device may include: a housing (not shown), a memory 401, and a central processing unit (Central). Processing Unit, CPU) 402 (also referred to as a processor, hereinafter referred to as CPU), a computer program, a circuit board (not shown), and a power supply circuit (not shown) stored on the memory 401 and operable on the processor 402 Out).
  • CPU Central
  • CPU 402 also referred to as a processor, hereinafter referred to as CPU
  • 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 electronic device
  • the memory 401 is configured to store a computer program executable on a processor; the CPU 402 reads and executes a computer program stored in the memory 401.
  • the electronic device further includes: a peripheral interface 403, RF (Radio) Frequency, RF circuit 405, audio circuit 406, speaker 411, power management chip 408, input/output (I/O) subsystem 409, touch screen 412, other input/control devices 410, and external port 404, these components are passed through one or A plurality of communication buses or signal lines 407 are in communication.
  • RF Radio
  • the illustrated electronic device 400 is merely one example of an electronic device, and that the electronic device 400 may have more or fewer components than those illustrated in the figures, and that two or more components may be combined, Or it 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 following is a detailed description of an electronic device for queuing a broadcast message provided by this embodiment.
  • the electronic device takes 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.
  • the I/O subsystem 409 which can connect input and output peripherals on the device, such as touch screen 412 (equivalent to the screen in the above embodiment) and other input/control devices 410, to peripherals Interface 403.
  • the I/O subsystem 409 can include a display controller 4091 and one or more input controllers 4092 for controlling other input/control devices 410.
  • one or more input controllers 4092 receive electrical signals from other input/control devices 410 or transmit electrical signals to other input/control devices 410, and other input/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 electronic device 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 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 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 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 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 405 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 406 is mainly used 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 configured 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 used for power supply and power management of the hardware connected to the CPU 402, the I/O subsystem, and the peripheral interface.
  • the CPU 402 provided by the embodiment of the present application 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 CPU 402 when the broadcast sender determines the priority of the broadcast message, the CPU 402 is configured to perform the following steps:
  • the priority of the broadcast message is determined according to the frequency of use.
  • the CPU 402 when determining the priority of the broadcast message according to the frequency of use, is configured to perform the following steps:
  • the CPU 402 when determining the insertion position of the broadcast message in the broadcast message queue according to the priority of the broadcast message, the CPU 402 is configured to perform the following steps:
  • the insertion position of the broadcast message in the broadcast message queue is determined.
  • the CPU 402 when determining the insertion position of the broadcast message in the broadcast message queue according to the comparison result, the CPU 402 is configured to perform the following steps:
  • 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 foregoing electronic device may perform the method provided by any embodiment of the present application, and has a corresponding functional module and a beneficial effect of the execution method.
  • the storage medium may include: a read only memory (ROM, Read) Only Memory), Random Access Memory (RAM), disk or CD.

Abstract

A broadcast message queuing method, comprising: monitoring a broadcast message sent by a broadcast sender; determining the priority of the broadcast message according to the broadcast sender when the broadcast sender is monitored to send the broadcast message; determining the insert location of the broadcast message in a broadcast message queue according to the priority; and inserting the broadcast message in the broadcast message queue according to the insert location. The present application also provides a broadcast message queuing apparatus, a storage device, and an electronic device.

Description

广播消息排队的方法、装置、存储设备及电子设备 Method, device, storage device and electronic device for broadcasting message queuing
本申请要求于2017年03月10日提交中国专利局、申请号为CN201710144310.4、发明名称为“广播消息排队的方法、装置及终端”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese Patent Application filed on March 10, 2017, to the Chinese Patent Office, the application number is CN201710144310.4, and the invention is entitled "Method, Apparatus and Terminal for Broadcast Message Queuing", the entire contents of which are incorporated by reference. In this application.
技术领域Technical field
本申请实施例涉及系统广播技术,尤其涉及一种广播消息排队的方法、装置、存储设备及电子设备。The embodiments of the present invention relate to system broadcast technologies, and in particular, to a method, an apparatus, a storage device, and an electronic device for queuing a broadcast message.
背景技术Background technique
安卓(Android)系统是目前应用较为广泛的一种手机等终端的操作系统。Android系统中,有很多不同的应用程序,为了在不同的应用程序中快速的进行信息传递,Android系统利用广播机制来实现,有消息要通知不同的应用程序时,就通过广播将这个消息发送给不同的应用程序。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. When there are messages to notify different applications, the message is sent to the broadcaster. Different apps.
技术问题technical problem
本申请实施例提供一种广播消息排队的方法、装置、存储介质及电子设备,可以及时快速的处理重要的广播消息,避免系统功能异常。The embodiment of the present invention provides a method, a device, a storage medium, and an electronic device for queuing broadcast messages, which can process important broadcast messages in a timely manner and avoid abnormal system functions.
技术解决方案Technical solution
第一方面,本申请实施例提供了一种广播消息排队的方法,所述方法包括:In a first aspect, the embodiment of the present application provides a method for queuing a broadcast message, where the method includes:
监听广播发送者发出的广播消息;Listening to broadcast messages from broadcast senders;
在监听到广播发送者发出广播消息时,根据所述广播发送者确定所述广播消息的优先级;Determining, according to the broadcast sender, a priority of the broadcast message when listening to the broadcast sender to send a broadcast message;
根据所述广播消息的优先级,确定所述广播消息在广播消息队列中的插入位置;Determining an insertion position of the broadcast message in a broadcast message queue according to a priority of the broadcast message;
根据所述插入位置,将所述广播消息插入所述广播消息队列。The broadcast message is inserted into the broadcast message queue according to the insertion location.
第二方面,本申请实施例还提供了一种广播消息排队的装置,所述装置包括:In a second aspect, the embodiment of the present application further provides an apparatus for queuing a broadcast message, where the apparatus includes:
广播消息监听模块,用于监听广播发送者发出的广播消息;a broadcast message monitoring module, configured to listen to a broadcast message sent by a broadcast sender;
优先级确定模块,用于在监听到广播发送者发出广播消息时,根据所述广播发送者确定所述广播消息的优先级;a priority determining module, configured to determine a priority of the broadcast message according to the broadcast sender when the broadcast sender is notified to send a broadcast message;
插入位置确定模块,用于根据所述广播消息的优先级,确定所述广播消息在广播消息队列中的插入位置;An insertion location determining module, configured to determine, according to a priority of the broadcast message, an insertion location of the broadcast message in a broadcast message queue;
广播消息插入模块,用于根据所述插入位置,将所述广播消息插入所述广播消息队列。And a broadcast message insertion module, configured to insert the broadcast message into the broadcast message queue according to the insertion location.
第三方面,本申请实施例提供一种存储介质,所述存储介质中存储有多条指令,所述指令适于由处理器加载以执行上述广播消息排队的方法。In a third aspect, an embodiment of the present application provides a storage medium, where the storage medium stores a plurality of instructions, and the instructions are adapted to be loaded by a processor to perform the method for queuing the broadcast message.
第四方面,本申请实施例还提供了一种电子设备,包括处理器和存储器,所述存储器存储有多条指令,所述处理器加载所述存储器中的指令用于执行以下步骤:In a fourth aspect, an 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:
监听广播发送者发出的广播消息;Listening to broadcast messages from broadcast senders;
在监听到广播发送者发出广播消息时,根据所述广播发送者确定所述广播消息的优先级;Determining, according to the broadcast sender, a priority of the broadcast message when listening to the broadcast sender to send a broadcast message;
根据所述广播消息的优先级,确定所述广播消息在广播消息队列中的插入位置;Determining an insertion position of the broadcast message in a broadcast message queue according to a priority of the broadcast message;
根据所述插入位置,将所述广播消息插入所述广播消息队列。The broadcast message is inserted into the broadcast message queue according to the insertion location.
有益效果 Beneficial effect
本申请实施例提供一种广播消息排队的方法、装置、存储介质及电子设备,可以及时快速的处理重要的广播消息,避免系统功能异常。The embodiment of the present invention provides a method, a device, a storage medium, and an electronic device for queuing broadcast messages, which can process important broadcast messages in a timely manner and avoid abnormal system functions.
附图说明DRAWINGS
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings used in the description of the embodiments will be briefly described below. It is obvious that the drawings in the following description are only some embodiments of the present application. Other drawings can also be obtained from those skilled in the art based on these drawings without paying any creative effort.
图1是本申请实施例提供的一种广播消息排队的方法的流程图。FIG. 1 is a flowchart of a method for queuing a broadcast message according to an embodiment of the present application.
图2是本申请实施例提供的另一种广播消息排队的方法的流程图。FIG. 2 is a flowchart of another method for queuing broadcast messages according to an embodiment of the present application.
图3是本申请实施例提供的一种广播消息排队的装置的结构示意图。FIG. 3 is a schematic structural diagram of an apparatus for queuing a broadcast message according to an embodiment of the present application.
图4为本申请实施例提供的一种电子设备的结构示意图。FIG. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
本发明的最佳实施方式BEST MODE FOR CARRYING OUT THE INVENTION
下面结合附图和实施例对本申请作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释本申请,而非对本申请的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与本申请相关的部分而非全部内容。The present application will be further described in detail below with reference to the accompanying drawings and embodiments. It is understood that the specific embodiments described herein are merely illustrative of the application and are not intended to be limiting. It should also be noted that, for the convenience of description, only some, but not all, of the contents related to the present application are shown in the drawings.
在Android系统中,广播发送者发送的广播消息没有限制,从而一个广播发送者可以随意发送任意数量的广播,或非常频繁的发送广播,会导致广播消息队列中待处理的广播消息非常的多,导致重要的广播消息不能得到及时处理,引起系统功能异常。In the Android system, there is no limit to the broadcast message sent by the broadcast sender, so that a broadcast sender can send any number of broadcasts at will, or send the broadcast very frequently, which will result in a lot of broadcast messages to be processed in the broadcast message queue. As a result, important broadcast messages cannot be processed in time, causing system functions to be abnormal.
在更加详细地讨论示例性实施例之前应当提到的是,一些示例性实施例被描述成作为流程图描绘的处理或方法。虽然流程图将各步骤描述成顺序的处理,但是其中的许多步骤可以被并行地、并发地或者同时实施。此外,各步骤的顺序可以被重新安排。当其操作完成时所述处理可以被终止,但是还可以具有未包括在附图中的附加步骤。所述处理可以对应于方法、函数、规程、子例程、子程序等等。Before discussing the exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as a process or method depicted as a flowchart. Although the flowcharts describe the various steps as a sequential process, many of the steps can be implemented in parallel, concurrently, or concurrently. In addition, the order of the steps can be rearranged. The process may be terminated when its operation is completed, but may also have additional steps not included in the figures. The processing may correspond to methods, functions, procedures, subroutines, subroutines, and the like.
本申请实施例提供一种广播消息排队的方法,包括:The embodiment of the present application provides a method for queuing a broadcast message, including:
监听广播发送者发出的广播消息;Listening to broadcast messages from broadcast senders;
在监听到广播发送者发出广播消息时,根据所述广播发送者确定所述广播消息的优先级;Determining, according to the broadcast sender, a priority of the broadcast message when listening to the broadcast sender to send a broadcast message;
根据所述广播消息的优先级,确定所述广播消息在广播消息队列中的插入位置;Determining an insertion position of the broadcast message in a broadcast message queue according to a priority of the broadcast message;
根据所述插入位置,将所述广播消息插入所述广播消息队列。The broadcast message is inserted into the broadcast message queue according to the insertion location.
一实施例中,根据所述广播发送者确定所述广播消息的优先级,包括:In an embodiment, determining, according to the broadcast sender, a priority of the broadcast message, including:
统计所述广播发送者在预设时间内的使用频率;Counting the frequency of use of the broadcast sender within a preset time;
根据所述使用频率,确定所述广播消息的优先级。The priority of the broadcast message is determined according to the frequency of use.
一实施例中,根据所述使用频率,确定所述广播消息的优先级,包括:In an embodiment, determining a priority of the broadcast message according to the frequency of use includes:
根据所述使用频率,确定所述使用频率所属的频率范围;Determining, according to the frequency of use, a frequency range to which the frequency of use belongs;
根据所述频率范围,确定所述广播消息的优先级。Determining the priority of the broadcast message based on the frequency range.
一实施例中,预先建立频率范围与广播消息的优先级的对应关系;In an embodiment, the correspondence between the frequency range and the priority of the broadcast message is established in advance;
根据所述频率范围,确定所述广播消息的优先级,包括:Determining a priority of the broadcast message according to the frequency range, including:
根据所述频率范围以及所述对应关系,确定所述广播消息的优先级。Determining a priority of the broadcast message according to the frequency range and the correspondence.
一实施例中,根据所述广播消息的优先级,确定所述广播消息在广播消息队列中的插入位置,包括:In an embodiment, determining the insertion position of the broadcast message in the broadcast message queue according to the priority of the broadcast message includes:
将所述广播消息的优先级与所述广播消息队列中的广播消息的优先级进行对比;Comparing the priority of the broadcast message with the priority of the broadcast message in the broadcast message queue;
根据对比结果,确定所述广播消息在所述广播消息队列中的插入位置。Based on the comparison result, the insertion position of the broadcast message in the broadcast message queue is determined.
一实施例中,根据对比结果,确定所述广播消息在所述广播消息队列中的插入位置,包括:In an embodiment, determining the insertion position of the broadcast message in the broadcast message queue according to the comparison result includes:
当所述广播消息队列中有与所述优先级相同的广播消息时,确定所述广播消息的插入位置为与所述优先级相同的广播消息之后;When the broadcast message queue has the same broadcast message as the priority, determining that the insertion position of the broadcast message is after the same broadcast message as the priority;
当所述广播消息队列中没有与所述优先级相同的广播消息时,判断所述优先级是否高于所述广播消息队列中的所有广播消息的优先级;When there is no broadcast message with the same priority in the broadcast message queue, determining whether the priority is higher than a priority of all broadcast messages in the broadcast message queue;
如果所述优先级高于所述广播消息队列中的所有广播消息的优先级,则确定所述插入位置为所述广播消息队列的队头;Determining that the insertion location is a head of the broadcast message queue if the priority is higher than a priority of all broadcast messages in the broadcast message queue;
如果所述优先级不高于所述广播消息队列中的所有广播消息的优先级,则判断所述优先级是否低于所述广播消息队列中的所有广播消息的优先级;If the priority is not higher than the priority of all broadcast messages in the broadcast message queue, determining whether the priority is lower than a priority of all broadcast messages in the broadcast message queue;
如果所述优先级低于所述广播消息队列中的所有广播消息的优先级,则确定所述插入位置为所述广播消息的队尾;Determining that the insertion location is a tail of the broadcast message if the priority is lower than a priority of all broadcast messages in the broadcast message queue;
如果所述优先级不低于所述广播消息队列中的所有广播消息的优先级,则确定所述广播消息队列中的高于所述优先级和低于所述优先级的相邻两个广播消息,并确定所述广播消息的插入位置为所述相邻两个广播消息之间。If 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.
一实施例中,在将所述广播消息排列在所述位置之后,还包括:In an embodiment, after the broadcast message is arranged in the location, the method further includes:
按照所述广播消息队列中的广播消息的排队顺序,识别当前的广播消息的广播接收者;Identifying a broadcast recipient of the current broadcast message according to a queuing sequence of broadcast messages in the broadcast message queue;
将所述当前的广播消息分发给所述广播接收者。Distributing the current broadcast message to the broadcast recipient.
图1是本申请实施例提供的一种广播消息排队的方法的流程图,本实施例可适用于在监听到广播消息时确定广播消息在广播消息队列中的位置的情况,该方法可以由广播消息排队的装置来执行,其中该装置可由软件和/或硬件实现,该装置可集成于电子设备中,该电子设备可以是智能手机、平板电脑等,该方法包括如下步骤:1 is a flowchart of a method for queuing a broadcast message according to an embodiment of the present application. 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 broadcasted. The device is executed by a message queuing device, wherein the device may be implemented by software and/or hardware, and the device may be integrated into an electronic device, and the electronic device may be a smart phone, a tablet computer or the like, and the method includes the following steps:
步骤110,监听广播发送者发出的广播消息。Step 110: Listen to a broadcast message sent by a broadcast sender.
在一实施例中,广播机制本质上是在电子设备的操作系统中一种组件间的通讯方式,是一种广泛运用在应用程序之间传输消息的机制。例如在电子设备的安卓系统下,有一些操作完成以后,会发送广播消息。广播消息可以是操作系统中产生的各种各样的事件消息数据。比如说发出一条短信或打出一个电话,都会发送广播,当某个应用程序接收了这个广播时,就可以做出相应的处理。广播发送者可以是系统和应用程序软件。应用程序软件可以是安装于手机等电子设备的第三方应用软件或者系统自带的应用程序,例如:安装于电子设备的第三方应用软件可以包括微信客户端、QQ客户端、淘宝客户端和支付宝客户端等,系统自带的应用程序可以包括日历、时钟、天气和便签等。广播消息可以是系统广播和应用广播,其中,系统广播可以包括亮屏广播、息屏广播、解锁广播、网络状态变化广播、蓝牙状态变化广播、切换语言广播、切换主题广播等,应用广播可以是由应用程序软件发出的广播。In an embodiment, the broadcast mechanism is essentially a communication between components in an operating system of an electronic device, and is a mechanism widely used to transfer messages between applications. For example, under the Android system of an electronic device, after some operations are completed, a broadcast message is sent. The broadcast message can be a variety of event message data generated in the operating system. For example, if you send a text message or make a phone call, a broadcast will be sent. When an application receives the broadcast, it can handle it. The broadcast sender can be system and application software. The application software may be a third-party application software installed on an electronic device such as a mobile phone or an application provided by the system. For example, a third-party application software installed on the electronic device may include a WeChat client, a QQ client, a Taobao client, and an Alipayer. Clients, etc., 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 video screen broadcast, an unlock broadcast, a network state change broadcast, a Bluetooth state change broadcast, a switching language broadcast, a switching theme broadcast, etc., and the application broadcast may be A broadcast made by the application software.
可以通过电子设备中的广播管理模块(如ActivityManagerService)监听系统中所有广播发送者的动态,检测广播发送者是否发出广播消息。其中,ActivityManagerService在Android系统的广播机制中扮演着广播中心的角色,负责系统中所有广播的注册和发布操作,其中,广播的注册是指应用程序把广播接收器注册到ActivityManagerService的过程。广播的发布包括广播发送者将广播发送到ActivityManagerService,ActivityManagerService接收到这个广播以后在自己的注册中心查看有哪些广播接收器订阅了该广播,然后把这个广播逐一发送到这些广播接收器中。在Android系统中,监听广播发送者发出的广播消息即通过ActivityManagerService来监听广播发送者是否将广播消息发送到ActivityManagerService,当通过ActivityManagerService监听到广播发送者将广播消息发送到ActivityManagerService时,确定监听到广播发送者发出了广播消息。The broadcast management module (such as ActivityManagerService) in the electronic device can monitor the dynamics of all broadcast senders in the system, and detect whether the broadcast sender sends a broadcast message. Among them, 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. After receiving the broadcast, the ActivityManagerService checks which broadcast receivers subscribe to the broadcast in its own registry, and then sends the broadcast to the broadcast receivers one by one. In the Android system, 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.
步骤120,在监听到广播发送者发出广播消息时,根据所述广播发送者确定所述广播消息的优先级。Step 120: When listening to the broadcast sender to send a broadcast message, determine the priority of the broadcast message according to the broadcast sender.
在通过广播管理模块监听到广播发送者发出广播消息时,可以根据广播发送者的重要程度或者广播消息的重要性及实时处理的紧迫性确定所述广播消息的优先级,例如,如果广播发送者是系统,则确定广播消息的优先级为较高的优先级;如果广播发送者是第三方应用程序,则确定广播消息的优先级为较低的优先级。When the broadcast management module listens to the broadcast sender to issue a broadcast message, the priority of the broadcast message may be determined according to the importance of the broadcast sender or the importance of the broadcast message and the urgency of the real-time processing, for example, if the broadcast sender Is the system, then the priority of the broadcast message is determined to be a higher priority; if the broadcast sender is a third-party application, the priority of the broadcast message is determined to be a lower priority.
示例性的,可以将广播消息的优先级设置为三个优先级:最高优先级、次优先级和普通优先级。并规定:最高优先级的广播消息排到广播消息队列的前端,可以更快的被处理;次优先级的广播消息排在广播消息队列中最高优先级的广播消息的后面,在最高优先级的广播消息处理完之后进行处理;普通优先级的广播消息排在广播消息队列中次优先级的广播消息的后面,在最高优先级和次优先级的广播消息处理完之后进行处理;优先级相同的广播消息,按照入队顺序进行处理。Exemplarily, the priority of the 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.
示例性的,现有技术中,Android系统的手机在用户按下电源键亮屏或熄屏时,要对应的发送亮屏广播或熄屏广播,在该广播进入广播消息队列时会按照广播的时间先后顺序进入广播消息队列,如果广播消息队列中在这个亮屏广播或熄屏广播前面还有很多广播在等待处理(这些广播不是系统广播),会影响到手机的亮灭屏速度,导致亮灭屏变慢。而在本实施例中,通过ActivityManagerService监听到系统将亮屏广播或熄屏广播发送到ActivityManagerService时,确定发送该亮屏广播或熄屏广播的广播发送者为系统,则将该亮屏广播或熄屏广播的优先级设置为最高的优先级,从而放在广播消息队列的前端,从而能够尽快对该亮屏广播或熄屏广播进行处理。Exemplarily, in the prior art, when the user presses the power button to light the screen or turns off the screen, the corresponding mobile phone sends a bright screen broadcast or a blackout broadcast, and the broadcast is performed according to the broadcast when the broadcast enters the broadcast message queue. The chronological order enters the broadcast message queue. If there are many broadcasts in the broadcast message queue in front of this bright-screen broadcast or the cut-off broadcast, the broadcast is waiting for processing (these broadcasts are not system broadcasts), which will affect the speed of the mobile phone. The screen is slowed down. In this embodiment, when the ActivityManagerService detects that the system sends a bright broadcast or a blackout broadcast to the ActivityManagerService, and determines that the broadcast sender that sends the bright broadcast or the cut-off broadcast is the system, the bright screen is broadcasted or extinguished. The priority of the screen broadcast is set to the highest priority, so that it is placed at the front end of the broadcast message queue, so that the bright screen broadcast or the screencast broadcast can be processed as soon as possible.
在一个实施例中,根据所述广播发送者确定所述广播消息的优先级,可选包括:In an embodiment, determining, according to the broadcast sender, a priority of the broadcast message, optionally including:
统计所述广播发送者在预设时间内的使用频率;Counting the frequency of use of the broadcast sender within a preset time;
根据所述使用频率,确定所述广播消息的优先级。The priority of the broadcast message is determined according to the frequency of use.
在监听到广播发送者发出广播消息时,确定在当前时间之前的预设时间内用户对该广播发送者的使用频率,并根据使用频率确定广播消息的优先级,如果使用频率较高,则将广播消息的优先级设置为较高的优先级,从而提高了活跃应用接收广播消息的速度。When monitoring the broadcast sender to send a broadcast message, determining the frequency of use of the broadcast sender by the user within a preset time before the current time, and determining the priority of the broadcast message according to the frequency of use, if the frequency of use is higher, The priority of the broadcast message is set to a higher priority, thereby increasing the speed at which the active application receives the broadcast message.
在一个实施例中,根据所述使用频率,确定所述广播消息的优先级,可选包括:In an embodiment, determining a priority of the broadcast message according to the frequency of use, optionally including:
根据所述使用频率,确定所述使用频率所属的频率范围;Determining, according to the frequency of use, a frequency range to which the frequency of use belongs;
根据所述频率范围,确定所述广播消息的优先级。Determining the priority of the broadcast message based on the frequency range.
可以预先建立频率范围与广播消息的优先级的对应关系。首先根据使用频率,确定该使用频率所属的频率范围,根据该频率范围及所述对应关系,可以直接确定该广播消息的优先级,从而进一步加快了广播消息的处理速度。The correspondence between the frequency range and the priority of the broadcast message can be established in advance. First, according to the frequency of use, the frequency range to which the frequency of use belongs is determined. According to the frequency range and the corresponding relationship, the priority of the broadcast message can be directly determined, thereby further speeding up the processing speed of the broadcast message.
步骤130,根据所述广播消息的优先级,确定所述广播消息在广播消息队列中的插入位置。Step 130: Determine, according to a priority of the broadcast message, an insertion location of the broadcast message in a broadcast message queue.
其中,广播消息队列按照广播消息的优先级的顺序进行排列,高优先级的广播消息排列在队头,低优先级的广播消息排列在队尾。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.
由于广播消息队列是按照广播消息的优先级的顺序进行排列的,则根据广播消息的优先级可以直接确定出该广播消息在广播消息队列中的插入位置。Since the broadcast message queues are arranged in the order of priority of the broadcast messages, the insertion position of the broadcast messages in the broadcast message queue can be directly determined according to the priority of the broadcast message.
示例性的,如果广播消息的优先级共有三级,分别为最高优先级、次优先级和最低优先级,当前的广播消息队列中只有次优先级和最低优先级的广播消息,且当前监听到的广播消息的优先级为最高优先级,则可以确定该广播消息在广播消息队列中的插入位置为队头。Exemplarily, if the priority of the broadcast message has three levels, namely, the highest priority, the second priority, and the lowest priority, only the secondary and lowest priority broadcast messages in the current broadcast message queue are currently monitored. The priority of the broadcast message 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.
在一个实施例中,根据所述广播消息的优先级,确定所述广播消息在广播消息队列中的插入位置,可选包括:In an embodiment, determining the insertion position of the broadcast message in the broadcast message queue according to the priority of the broadcast message, optionally including:
将所述广播消息的优先级与所述广播消息队列中的广播消息的优先级进行对比;Comparing the priority of the broadcast message with the priority of the broadcast message in the broadcast message queue;
根据对比结果,确定所述广播消息在所述广播消息队列中的插入位置。Based on the comparison result, 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 the broadcast can be determined according to the comparison result. The insertion position of the message in the broadcast message queue further improves the processing speed of the broadcast message.
在一个实施例中,根据对比结果,确定所述广播消息在所述广播消息队列中的插入位置,可选包括:In an embodiment, determining the insertion position of the broadcast message in the broadcast message queue according to the comparison result, optionally including:
当所述广播消息队列中有与所述优先级相同的广播消息时,确定所述广播消息的插入位置为与所述优先级相同的广播消息之后;When the broadcast message queue has the same broadcast message as the priority, determining that the insertion position of the broadcast message is after the same broadcast message as the priority;
当所述广播消息队列中没有与所述优先级相同的广播消息时,判断所述优先级是否高于所述广播消息队列中的所有广播消息的优先级;When there is no broadcast message with the same priority in the broadcast message queue, determining whether the priority is higher than a priority of all broadcast messages in the broadcast message queue;
如果所述优先级高于所述广播消息队列中的所有广播消息的优先级,则确定所述插入位置为所述广播消息队列的队头;Determining that the insertion location is a head of the broadcast message queue if the priority is higher than a priority of all broadcast messages in the broadcast message queue;
如果所述优先级不高于所述广播消息队列中的所有广播消息的优先级,则判断所述优先级是否低于所述广播消息队列中的所有广播消息的优先级;If the priority is not higher than the priority of all broadcast messages in the broadcast message queue, determining whether the priority is lower than a priority of all broadcast messages in the broadcast message queue;
如果所述优先级低于所述广播消息队列中的所有广播消息的优先级,则确定所述插入位置为所述广播消息的队尾;Determining that the insertion location is a tail of the broadcast message if the priority is lower than a priority of all broadcast messages in the broadcast message queue;
如果所述优先级不低于所述广播消息队列中的所有广播消息的优先级,则确定所述广播消息队列中的高于所述优先级和低于所述优先级的相邻两个广播消息,并确定所述广播消息的插入位置为所述相邻两个广播消息之间。If 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.
在将广播消息的优先级与广播消息队列中的广播消息的优先级进行对比时,可以先判断广播消息队列中是否有与广播消息的优先级相同的广播消息,如果有,则可以直接根据该相同优先级的广播消息所在的位置确定所述广播消息的插入位置,确定的插入位置可以是该相同优先级的广播消息之后并近邻该相同优先级的广播消息。如果广播消息队列中没有与广播消息的优先级相同的广播消息,可以分为三种情况分别进行处理:即所述优先级高于所述广播消息队列中的所有广播消息的优先级、所述优先级低于所述广播消息队列中的所有广播消息的优先级以及所述优先级介于所述广播消息队列中的广播消息的优先级之间。通过分情况确定广播消息的优先级,可以进一步加快广播消息的处理速度。When comparing the priority of the broadcast message with the priority of the broadcast message in the broadcast message queue, it may first determine whether there is a broadcast message with the same priority as the broadcast message in the broadcast message queue, and if so, directly according to the broadcast message The location of the broadcast message of the same priority determines the insertion location of the broadcast message, and the determined insertion location may be a broadcast message of the same priority and adjacent to the same priority broadcast message. If there is no broadcast message in the broadcast message queue that has the same priority as the broadcast message, it can be processed separately in three cases: that is, the priority is higher than the priority of all the broadcast messages in the broadcast message queue, The priority is lower than the priority of all broadcast messages in the broadcast message queue and the priority is between the priority of the broadcast messages in the broadcast message queue. By determining the priority of the broadcast message by case, the processing speed of the broadcast message can be further accelerated.
步骤140,根据所述插入位置,将所述广播消息插入所述广播消息队列。Step 140: Insert the broadcast message 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.
由上可知,本实施例提供的广播消息排队的方法,通过在监听到广播发送者发出广播消息时,根据所述广播发送者确定广播消息的优先级,根据广播消息的优先级确定广播消息在广播消息队列中的插入位置,进而根据所述插入位置,将广播消息插入广播消息队列,从而实现了及时快速的处理重要的广播消息,避免了系统功能异常。As can be seen from the above, the broadcast message queuing method provided by this embodiment determines the priority of the broadcast message according to the broadcast sender when the broadcast sender sends the broadcast message, and determines the broadcast message according to the priority of the broadcast message. The insertion position in the broadcast message queue is further inserted into the broadcast message queue according to the insertion position, thereby realizing timely and fast processing of important broadcast messages and avoiding system function abnormality.
在一实施例中,如图2所示,图2是本申请一个实施例提供的一种广播消息排队的方法的流程图,该方法包括如下步骤:In an embodiment, as shown in FIG. 2, FIG. 2 is a flowchart of a method for queuing a broadcast message according to an embodiment of the present application, where the method includes the following steps:
步骤210,监听广播发送者发出的广播消息。Step 210: Listen to a broadcast message sent by a broadcast sender.
步骤220,在监听到广播发送者发出广播消息时,根据所述广播发送者确定所述广播消息的优先级。Step 220: When listening to the broadcast sender to send a broadcast message, determine the priority of the broadcast message according to the broadcast sender.
步骤230,根据所述广播消息的优先级,确定所述广播消息在广播消息队列中的插入位置。Step 230: Determine, according to a priority of the broadcast message, an insertion position of the broadcast message in a broadcast message queue.
步骤240,根据所述插入位置,将所述广播消息插入所述广播消息队列。Step 240: Insert the broadcast message into the broadcast message queue according to the insertion position.
步骤250,按照所述广播消息队列中的广播消息的排队顺序,识别当前的广播消息的广播接收者。Step 250: Identify a broadcast recipient of the current broadcast message according to a queuing sequence of the broadcast message in the broadcast message queue.
本申请实施例中,广播消息队列是根据广播消息的优先级进行排队的,广播消息队列在不断的动态变化中,在电子设备运行的过程中,广播消息队列在持续更新,广播消息队列中分发完毕的广播消息在广播消息队列中清除,在分发广播消息队列中的广播消息时也有可能有新的广播消息进入广播消息队列。示例性的,广播消息队列中按照广播消息的排队顺序包括广播消息1、广播消息2、广播消息3、广播消息4……广播消息100,按照广播消息队列中的广播消息的排队顺序分发其中的广播消息时,先分发广播消息1,广播消息1分发完之后分发广播消息2,以此顺序类推,直到将广播消息队列中的广播消息分发完毕。In the embodiment of the present application, the broadcast message queue is queued according to the priority of the broadcast message. In the continuous dynamic change of the broadcast message queue, during the operation of the electronic device, the broadcast message queue is continuously updated, and the broadcast message queue is distributed. The completed broadcast message is cleared in the broadcast message queue, and it is also possible that a new broadcast message enters the broadcast message queue when distributing the broadcast message in the broadcast message queue. Exemplarily, 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 a queued order of broadcast messages in the broadcast message queue. When broadcasting a message, 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.
其中,当前的广播消息可以是当前待分发的广播消息,例如:广播消息队列中按照分发的先后顺序包括广播消息1、广播消息2、广播消息3、广播消息4……广播消息100,其中广播消息1是当前正在分发的广播消息,那么广播消息2即为当前待分发的广播消息。广播接收者可以是安装于电子设备的第三方应用软件或者系统自带的应用程序。示例性的,在Android系统中,识别当前的广播消息的广播接收者时,通过ActivityManagerService在注册中心查看有哪些广播接收者订阅了接收该广播消息的广播接收器,从而确定其广播接收者。The current broadcast message may be a broadcast message to be distributed currently. 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 100, and a broadcast message in a sequence of distribution. Message 1 is the broadcast message currently being distributed, then broadcast message 2 is the broadcast message currently to be distributed. The broadcast recipient can be a third-party application installed on the electronic device or an application that comes with the system. Exemplarily, 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 its broadcast recipient.
步骤260,将所述当前的广播消息分发给所述广播接收者。Step 260, distributing the current broadcast message to the broadcast recipient.
通过在识别当前待分发的广播消息的广播接收者之后,再依次将该广播消息分发给各广播接收者,可以保证广播接收者对广播消息的及时响应。By distributing the broadcast message to each broadcast recipient in turn after identifying the broadcast recipient of the broadcast message currently to be distributed, the broadcast recipient can be assured of a timely response to the broadcast message.
本实施例的技术方案,通过在监听到广播发送者发出广播消息时,根据所述广播发送者确定广播消息的优先级,根据广播消息的优先级确定广播消息在广播消息队列中的插入位置,进而根据所述插入位置,将广播消息插入广播消息队列,并根据广播消息队列中广播消息的排队顺序分发其中的广播消息,从而实现了及时快速分发重要的广播消息,并可以保证广播接收者快速的响应该广播消息,避免了系统功能异常。The technical solution of the embodiment determines the insertion position of the broadcast message in the broadcast message queue according to the priority of the broadcast message by determining the priority of the broadcast message according to the broadcast sender when the broadcast sender sends the broadcast message. And according to the insertion location, the broadcast message is inserted into the broadcast message queue, and the broadcast message is distributed according to the queued order of the broadcast message in the broadcast message queue, thereby realizing timely and timely distribution of important broadcast messages, and ensuring the broadcast receiver quickly Responding to the broadcast message, avoiding system function exceptions.
本申请实施例还提供一种广播消息排队的装置,包括:The embodiment of the present application further provides an apparatus for queuing broadcast messages, including:
广播消息监听模块,用于监听广播发送者发出的广播消息;a broadcast message monitoring module, configured to listen to a broadcast message sent by a broadcast sender;
优先级确定模块,用于在监听到广播发送者发出广播消息时,根据所述广播发送者确定所述广播消息的优先级;a priority determining module, configured to determine a priority of the broadcast message according to the broadcast sender when the broadcast sender is notified to send a broadcast message;
插入位置确定模块,用于根据所述广播消息的优先级,确定所述广播消息在广播消息队列中的插入位置;An insertion location determining module, configured to determine, according to a priority of the broadcast message, an insertion location of the broadcast message in a broadcast message queue;
广播消息插入模块,用于根据所述插入位置,将所述广播消息插入所述广播消息队列。And a broadcast message insertion module, configured to insert the broadcast message into the broadcast message queue according to the insertion location.
一实施例中,所述优先级确定模块包括:In an embodiment, the priority determining module includes:
使用频率统计单元,用于统计所述广播发送者在预设时间内的使用频率;Using a frequency statistics unit, configured to count the frequency of use of the broadcast sender within a preset time;
优先级确定单元,用于根据所述使用频率,确定所述广播消息的优先级。a priority determining unit, configured to determine a priority of the broadcast message according to the frequency of use.
一实施例中,所述优先级确定单元具体用于:In an embodiment, the priority determining unit is specifically configured to:
根据所述使用频率,确定所述使用频率所属的频率范围;Determining, according to the frequency of use, a frequency range to which the frequency of use belongs;
根据所述频率范围,确定所述广播消息的优先级。Determining the priority of the broadcast message based on the frequency range.
一实施例中,预先建立频率范围与广播消息的优先级的对应关系;In an embodiment, the correspondence between the frequency range and the priority of the broadcast message is established in advance;
所述优先级确定单元具体用于:根据所述频率范围,确定所述广播消息的优先级,包括:The priority determining unit is specifically configured to determine a priority of the broadcast message according to the frequency range, including:
根据所述频率范围以及所述对应关系,确定所述广播消息的优先级。Determining a priority of the broadcast message according to the frequency range and the correspondence.
一实施例中,所述插入位置确定模块包括:In an embodiment, the insertion position determining module 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;
插入位置确定单元,用于根据对比结果,确定所述广播消息在所述广播消息队列中的插入位置。And an insertion location determining unit, configured to determine, according to the comparison result, an insertion position of the broadcast message in the broadcast message queue.
一实施例中,所述插入位置确定单元具体用于:In an embodiment, the insertion position determining unit is specifically configured to:
当所述广播消息队列中有与所述优先级相同的广播消息时,确定所述广播消息的插入位置为与所述优先级相同的广播消息之后;When the broadcast message queue has the same broadcast message as the priority, determining that the insertion position of the broadcast message is after the same broadcast message as the priority;
当所述广播消息队列中没有与所述优先级相同的广播消息时,判断所述优先级是否高于所述广播消息队列中的所有广播消息的优先级;When there is no broadcast message with the same priority in the broadcast message queue, determining whether the priority is higher than a priority of all broadcast messages in the broadcast message queue;
如果所述优先级高于所述广播消息队列中的所有广播消息的优先级,则确定所述插入位置为所述广播消息队列的队头;Determining that the insertion location is a head of the broadcast message queue if the priority is higher than a priority of all broadcast messages in the broadcast message queue;
如果所述优先级不高于所述广播消息队列中的所有广播消息的优先级,则判断所述优先级是否低于所述广播消息队列中的所有广播消息的优先级;If the priority is not higher than the priority of all broadcast messages in the broadcast message queue, determining whether the priority is lower than a priority of all broadcast messages in the broadcast message queue;
如果所述优先级低于所述广播消息队列中的所有广播消息的优先级,则确定所述插入位置为所述广播消息的队尾;Determining that the insertion location is a tail of the broadcast message if the priority is lower than a priority of all broadcast messages in the broadcast message queue;
如果所述优先级不低于所述广播消息队列中的所有广播消息的优先级,则确定所述广播消息队列中的高于所述优先级和低于所述优先级的相邻两个广播消息,并确定所述广播消息的插入位置为所述相邻两个广播消息之间。If 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.
一实施例中,还包括:In an embodiment, the method further includes:
广播接收者识别模块,用于按照所述广播消息队列中的广播消息的排队顺序,识别当前的广播消息的广播接收者;a broadcast receiver identification module, configured to identify a broadcast receiver of a current broadcast message according to a queuing sequence of broadcast messages in the broadcast message queue;
广播消息分发模块,用于将所述当前的广播消息分发给所述广播接收者。And a broadcast message distribution module, configured to distribute the current broadcast message to the broadcast recipient.
为了更好地实施以上方法,本申请实施例还提供一种广播消息排队的装置,如图3所示,图3是本申请实施例提供的一种广播消息排队的装置的结构示意图,本实施例所述的广播消息排队的装置包括:广播消息监听模块310、优先级确定模块320、插入位置确定模块330和广播消息插入模块340。In order to better implement the above method, the embodiment of the present application further provides a device for queuing a broadcast message. As shown in FIG. 3, FIG. 3 is a schematic structural diagram of an apparatus for queuing a broadcast message according to an embodiment of the present application. The apparatus for queuing broadcast messages according to the example includes: a broadcast message listening module 310, a priority determining module 320, an insertion location determining module 330, and a broadcast message inserting module 340.
其中,广播消息监听模块,用于监听广播发送者发出的广播消息;The broadcast message monitoring module is configured to listen to a broadcast message sent by a broadcast sender;
优先级确定模块,用于在监听到广播发送者发出广播消息时,根据所述广播发送者确定所述广播消息的优先级;a priority determining module, configured to determine a priority of the broadcast message according to the broadcast sender when the broadcast sender is notified to send a broadcast message;
插入位置确定模块,用于根据所述广播消息的优先级,确定所述广播消息在广播消息队列中的插入位置;An insertion location determining module, configured to determine, according to a priority of the broadcast message, an insertion location of the broadcast message in a broadcast message queue;
广播消息插入模块,用于根据所述插入位置,将所述广播消息插入所述广播消息队列。And a broadcast message insertion module, configured to insert the broadcast message into the broadcast message queue according to the insertion location.
在一实施例中,所述优先级确定模块包括:In an embodiment, the priority determining module includes:
使用频率统计单元,用于统计所述广播发送者在预设时间内的使用频率;Using a frequency statistics unit, configured to count the frequency of use of the broadcast sender within a preset time;
优先级确定单元,用于根据所述使用频率,确定所述广播消息的优先级。a priority determining unit, configured to determine a priority of the broadcast message according to the frequency of use.
在一实施例中,所述优先级确定单元具体用于:In an embodiment, the priority determining unit is specifically configured to:
根据所述使用频率,确定所述使用频率所属的频率范围;Determining, according to the frequency of use, a frequency range to which the frequency of use belongs;
根据所述频率范围,确定所述广播消息的优先级。Determining the priority of the broadcast message based on the frequency range.
在一实施例中,所述插入位置确定模块包括:In an embodiment, the insertion position determining module 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;
插入位置确定单元,用于根据对比结果,确定所述广播消息在所述广播消息队列中的插入位置。And an insertion location determining unit, configured to determine, according to the comparison result, an insertion position of the broadcast message in the broadcast message queue.
在一实施例中,所述插入位置确定单元具体用于:In an embodiment, the insertion position determining unit is specifically configured to:
当所述广播消息队列中有与所述优先级相同的广播消息时,确定所述广播消息的插入位置为与所述优先级相同的广播消息之后;When the broadcast message queue has the same broadcast message as the priority, determining that the insertion position of the broadcast message is after the same broadcast message as the priority;
当所述广播消息队列中没有与所述优先级相同的广播消息时,判断所述优先级是否高于所述广播消息队列中的所有广播消息的优先级;When there is no broadcast message with the same priority in the broadcast message queue, determining whether the priority is higher than a priority of all broadcast messages in the broadcast message queue;
如果所述优先级高于所述广播消息队列中的所有广播消息的优先级,则确定所述插入位置为所述广播消息队列的队头;Determining that the insertion location is a head of the broadcast message queue if the priority is higher than a priority of all broadcast messages in the broadcast message queue;
如果所述优先级不高于所述广播消息队列中的所有广播消息的优先级,则判断所述优先级是否低于所述广播消息队列中的所有广播消息的优先级;If the priority is not higher than the priority of all broadcast messages in the broadcast message queue, determining whether the priority is lower than a priority of all broadcast messages in the broadcast message queue;
如果所述优先级低于所述广播消息队列中的所有广播消息的优先级,则确定所述插入位置为所述广播消息的队尾;Determining that the insertion location is a tail of the broadcast message if the priority is lower than a priority of all broadcast messages in the broadcast message queue;
如果所述优先级不低于所述广播消息队列中的所有广播消息的优先级,则确定所述广播消息队列中的高于所述优先级和低于所述优先级的相邻两个广播消息,并确定所述广播消息的插入位置为所述相邻两个广播消息之间。If 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.
在一实施例中,还包括:In an embodiment, the method further includes:
广播接收者识别模块,用于按照所述广播消息队列中的广播消息的排队顺序,识别当前的广播消息的广播接收者;a broadcast receiver identification module, configured to identify a broadcast receiver of a current broadcast message according to a queuing sequence of broadcast messages in the broadcast message queue;
广播消息分发模块,用于将所述当前的广播消息分发给所述广播接收者。And a broadcast message distribution module, configured to distribute the current broadcast message to the broadcast recipient.
上述广播消息排队的装置可执行本申请任意实施例所提供的广播消息排队的方法,具备执行方法相应的功能模块和有益效果。未在本实施例中详尽描述的技术细节,可参见本申请任意实施例提供的广播消息排队的方法。The device for queuing the broadcast message can perform the method for queuing the broadcast message provided by any embodiment of the present application, and has the corresponding functional modules and beneficial effects of the execution method. For details of the technical details that are not described in detail in this embodiment, refer to the method for queuing broadcast messages provided by any embodiment of the present application.
本申请实施例还提供了一种存储介质,所述存储介质中存储有多条指令,所述指令适于由处理器加载上述任一实施例中的步骤。The embodiment of the present application further provides a storage medium, where the storage medium stores a plurality of instructions, and the instructions are adapted to be loaded by the processor in the steps in any of the foregoing embodiments.
本申请实施例还提供了一种电子设备,该电子设备可以包括本申请任意实施例提供的广播消息排队的装置。图4为本申请实施例提供的一种电子设备的结构示意图,如图4所示,该电子设备可以包括:壳体(图中未示出)、存储器401、中央处理器(Central Processing Unit,CPU)402(又称处理器,以下简称CPU)、存储在存储器401上并可在处理器402上运行的计算机程序、电路板(图中未示出)和电源电路(图中未示出)。所述电路板安置在所述壳体围成的空间内部;所述CPU402和所述存储器401设置在所述电路板上;所述电源电路,用于为所述电子设备的各个电路或器件供电;所述存储器401,用于存储可在处理器上运行的计算机程序;所述CPU402通过读取并执行所述存储器401中存储的计算机程序。The embodiment of the present application further provides an electronic device, which may include a device for queuing a broadcast message provided by any embodiment of the present application. FIG. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. As shown in FIG. 4, the electronic device may include: a housing (not shown), a memory 401, and a central processing unit (Central). Processing Unit, CPU) 402 (also referred to as a processor, hereinafter referred to as CPU), a computer program, a circuit board (not shown), and a power supply circuit (not shown) stored on the memory 401 and operable on the processor 402 Out). 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 electronic device The memory 401 is configured to store a computer program executable on a processor; the CPU 402 reads and executes a computer program stored in the memory 401.
该电子设备还包括:外设接口403、RF(Radio Frequency,射频)电路405、音频电路406、扬声器411、电源管理芯片408、输入/输出(I/O)子系统409、触摸屏412、其他输入/控制设备410以及外部端口404,这些部件通过一个或多个通信总线或信号线407来通信。The electronic device further includes: a peripheral interface 403, RF (Radio) Frequency, RF circuit 405, audio circuit 406, speaker 411, power management chip 408, input/output (I/O) subsystem 409, touch screen 412, other input/control devices 410, and external port 404, these components are passed through one or A plurality of communication buses or signal lines 407 are in communication.
应该理解的是,图示电子设备400仅仅是电子设备的一个范例,并且电子设备400可以具有比图中所示出的更多的或者更少的部件,可以组合两个或更多的部件,或者可以具有不同的部件配置。图中所示出的各种部件可以在包括一个或多个信号处理和/或专用集成电路在内的硬件、软件、或硬件和软件的组合中实现。It should be understood that the illustrated electronic device 400 is merely one example of an electronic device, and that the electronic device 400 may have more or fewer components than those illustrated in the figures, and that two or more components may be combined, Or it 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 following is a detailed description of an electronic device for queuing a broadcast message provided by this embodiment. The electronic device takes a mobile phone as an example.
存储器401,所述存储器401可以被CPU402、外设接口403等访问,所述存储器401可以包括高速随机存取存储器,还可以包括非易失性存储器,例如一个或多个磁盘存储器件、闪存器件、或其他易失性固态存储器件。 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.
外设接口403,所述外设接口403可以将设备的输入和输出外设连接到CPU402和存储器401。Peripheral interface 403, which can connect the input and output peripherals of the device to CPU 402 and memory 401.
I/O子系统409,所述I/O子系统409可以将设备上的输入输出外设,例如触摸屏412(相当于上述实施例中的屏幕)和其他输入/控制设备410,连接到外设接口403。I/O子系统409可以包括显示控制器4091和用于控制其他输入/控制设备410的一个或多个输入控制器4092。其中,一个或多个输入控制器4092从其他输入/控制设备410接收电信号或者向其他输入/控制设备410发送电信号,其他输入/控制设备410可以包括物理按钮(按压按钮、摇臂按钮等)、拨号盘、滑动开关、操纵杆、点击滚轮。值得说明的是,输入控制器4092可以与以下任一个连接:键盘、红外端口、USB接口以及诸如鼠标的指示设备。I/O subsystem 409, which can connect input and output peripherals on the device, such as touch screen 412 (equivalent to the screen in the above embodiment) and other input/control devices 410, to peripherals Interface 403. The I/O subsystem 409 can include a display controller 4091 and one or more input controllers 4092 for controlling other input/control devices 410. Wherein, one or more input controllers 4092 receive electrical signals from other input/control devices 410 or transmit electrical signals to other input/control devices 410, and other input/control devices 410 may include physical buttons (press buttons, rocker buttons, etc.) ), dial, slide switch, joystick, click wheel. It is worth noting that 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.
触摸屏412,所述触摸屏412是用户电子设备与用户之间的输入接口和输出接口,将可视输出显示给用户,可视输出可以包括图形、文本、图标、视频等。The touch screen 412 is an input interface and an output interface between the user electronic device and the user, and displays the visual output to the user. The visual output may include graphics, text, icons, videos, and the like.
I/O子系统409中的显示控制器4091从触摸屏412接收电信号或者向触摸屏412发送电信号。触摸屏412检测触摸屏上的接触,显示控制器4091将检测到的接触转换为与显示在触摸屏412上的用户界面对象的交互,即实现人机交互,显示在触摸屏412上的用户界面对象可以是运行游戏的图标、联网到相应网络的图标等。值得说明的是,设备还可以包括光鼠,光鼠是不显示可视输出的触摸敏感表面,或者是由触摸屏形成的触摸敏感表面的延伸。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. It is worth noting that 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.
RF电路405,主要用于建立手机与无线网络(即网络侧)的通信,实现手机与无线网络的数据接收和发送。例如收发短信息、电子邮件等。具体地,RF电路405接收并发送RF信号,RF信号也称为电磁信号,RF电路405将电信号转换为电磁信号或将电磁信号转换为电信号,并且通过该电磁信号与通信网络以及其他设备进行通信。RF电路405可以包括用于执行这些功能的已知电路,其包括但不限于天线系统、RF收发机、一个或多个放大器、调谐器、一个或多个振荡器、数字信号处理器、CODEC(COder-DECoder,编译码器)芯片组、用户标识模块(Subscriber Identity Module,SIM)等等。The RF circuit 405 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 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 through the electromagnetic signal and communication network and other devices Communicate. RF circuitry 405 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.
音频电路406,主要用于从外设接口403接收音频数据,将该音频数据转换为电信号,并且将该电信号发送给扬声器411。The audio circuit 406 is mainly used 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.
扬声器411,用于将手机通过RF电路405从无线网络接收的语音信号,还原为声音并向用户播放该声音。The speaker 411 is configured 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.
电源管理芯片408,用于为CPU402、I/O子系统及外设接口所连接的硬件进行供电及电源管理。The power management chip 408 is used for power supply and power management of the hardware connected to the CPU 402, the I/O subsystem, and the peripheral interface.
本申请实施例提供的CPU402在执行所述存储器401中存储的计算机程序时实现以下步骤:The CPU 402 provided by the embodiment of the present application implements the following steps when executing the computer program stored in the memory 401:
监听广播发送者发出的广播消息;Listening to broadcast messages from broadcast senders;
在监听到广播发送者发出广播消息时,根据所述广播发送者确定所述广播消息的优先级;Determining, according to the broadcast sender, a priority of the broadcast message when listening to the broadcast sender to send a broadcast message;
根据所述广播消息的优先级,确定所述广播消息在广播消息队列中的插入位置;Determining an insertion position of the broadcast message in a broadcast message queue according to a priority of the broadcast message;
根据所述插入位置,将所述广播消息插入所述广播消息队列。The broadcast message is inserted into the broadcast message queue according to the insertion location.
一实施例中,根据所述广播发送者确定所述广播消息的优先级时,CPU402用于执行以下步骤:In an embodiment, when the broadcast sender determines the priority of the broadcast message, the CPU 402 is configured to perform the following steps:
统计所述广播发送者在预设时间内的使用频率;Counting the frequency of use of the broadcast sender within a preset time;
根据所述使用频率,确定所述广播消息的优先级。The priority of the broadcast message is determined according to the frequency of use.
一实施例中,根据所述使用频率,确定所述广播消息的优先级时,CPU402用于执行以下步骤:In an embodiment, when determining the priority of the broadcast message according to the frequency of use, the CPU 402 is configured to perform the following steps:
根据所述使用频率,确定所述使用频率所属的频率范围;Determining, according to the frequency of use, a frequency range to which the frequency of use belongs;
根据所述频率范围,确定所述广播消息的优先级。Determining the priority of the broadcast message based on the frequency range.
一实施例中,根据所述广播消息的优先级,确定所述广播消息在广播消息队列中的插入位置时,CPU402用于执行以下步骤:In an embodiment, when determining the insertion position of the broadcast message in the broadcast message queue according to the priority of the broadcast message, the CPU 402 is configured to perform the following steps:
将所述广播消息的优先级与所述广播消息队列中的广播消息的优先级进行对比;Comparing the priority of the broadcast message with the priority of the broadcast message in the broadcast message queue;
根据对比结果,确定所述广播消息在所述广播消息队列中的插入位置。Based on the comparison result, the insertion position of the broadcast message in the broadcast message queue is determined.
一实施例中,根据对比结果,确定所述广播消息在所述广播消息队列中的插入位置时,CPU402用于执行以下步骤:In an embodiment, when determining the insertion position of the broadcast message in the broadcast message queue according to the comparison result, the CPU 402 is configured to perform the following steps:
当所述广播消息队列中有与所述优先级相同的广播消息时,确定所述广播消息的插入位置为与所述优先级相同的广播消息之后;When the broadcast message queue has the same broadcast message as the priority, determining that the insertion position of the broadcast message is after the same broadcast message as the priority;
当所述广播消息队列中没有与所述优先级相同的广播消息时,判断所述优先级是否高于所述广播消息队列中的所有广播消息的优先级;When there is no broadcast message with the same priority in the broadcast message queue, determining whether the priority is higher than a priority of all broadcast messages in the broadcast message queue;
如果所述优先级高于所述广播消息队列中的所有广播消息的优先级,则确定所述插入位置为所述广播消息队列的队头;Determining that the insertion location is a head of the broadcast message queue if the priority is higher than a priority of all broadcast messages in the broadcast message queue;
如果所述优先级不高于所述广播消息队列中的所有广播消息的优先级,则判断所述优先级是否低于所述广播消息队列中的所有广播消息的优先级;If the priority is not higher than the priority of all broadcast messages in the broadcast message queue, determining whether the priority is lower than a priority of all broadcast messages in the broadcast message queue;
如果所述优先级低于所述广播消息队列中的所有广播消息的优先级,则确定所述插入位置为所述广播消息的队尾;Determining that the insertion location is a tail of the broadcast message if the priority is lower than a priority of all broadcast messages in the broadcast message queue;
如果所述优先级不低于所述广播消息队列中的所有广播消息的优先级,则确定所述广播消息队列中的高于所述优先级和低于所述优先级的相邻两个广播消息,并确定所述广播消息的插入位置为所述相邻两个广播消息之间。If 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 foregoing electronic device may perform the method provided by any embodiment of the present application, and has a corresponding functional module and a beneficial effect of the execution method.
需要说明的是,本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于计算机可读的存储介质中,如存储在终端的存储器中,并被该终端内的至少一个处理器执行,在执行过程中可包括如信息发布方法的实施例的流程。其中,存储介质可以包括:只读存储器(ROM,Read Only Memory)、随机存取记忆体(RAM,Random Access Memory)、磁盘或光盘等。It should be noted that those skilled in the art can understand that all or part of the steps of the foregoing embodiments can be completed by a program to instruct related hardware, and the program can be stored in a computer readable storage medium. As stored in the memory of the terminal and executed by at least one processor within the terminal, a flow such as an embodiment of the information dissemination method may be included in the execution. The storage medium may include: a read only memory (ROM, Read) Only Memory), Random Access Memory (RAM), disk or CD.
注意,上述仅为本申请的较佳实施例及所运用技术原理。本领域技术人员会理解,本申请不限于这里所述的特定实施例,对本领域技术人员来说能够进行各种明显的变化、重新调整和替代而不会脱离本申请的保护范围。因此,虽然通过以上实施例对本申请进行了较为详细的说明,但是本申请不仅仅限于以上实施例,在不脱离本申请构思的情况下,还可以包括更多其他等效实施例,而本申请的范围由所附的权利要求范围决定。Note that the above are only the preferred embodiments of the present application and the technical principles applied thereto. A person skilled in the art will understand that the present application is not limited to the specific embodiments described herein, and that various changes, modifications and substitutions can be made by those skilled in the art without departing from the scope of the invention. Therefore, although the present application has been described in detail by the above embodiments, the present application is not limited to the above embodiments, and other equivalent embodiments may be included without departing from the concept of the present application. The scope is determined by the scope of the appended claims.

Claims (20)

  1. 一种广播消息排队的方法,其中,所述方法包括:A method for queuing broadcast messages, wherein the method includes:
    监听广播发送者发出的广播消息;Listening to broadcast messages from broadcast senders;
    在监听到广播发送者发出广播消息时,根据所述广播发送者确定所述广播消息的优先级;Determining, according to the broadcast sender, a priority of the broadcast message when listening to the broadcast sender to send a broadcast message;
    根据所述广播消息的优先级,确定所述广播消息在广播消息队列中的插入位置;Determining an insertion position of the broadcast message in a broadcast message queue according to a priority of the broadcast message;
    根据所述插入位置,将所述广播消息插入所述广播消息队列。The broadcast message is inserted into the broadcast message queue according to the insertion location.
  2. 根据权利要求1所述的方法,其中,根据所述广播发送者确定所述广播消息的优先级,包括:The method of claim 1, wherein determining the priority of the broadcast message according to the broadcast sender comprises:
    统计所述广播发送者在预设时间内的使用频率;Counting the frequency of use of the broadcast sender within a preset time;
    根据所述使用频率,确定所述广播消息的优先级。The priority of the broadcast message is determined according to the frequency of use.
  3. 根据权利要求2所述的方法,其中,根据所述使用频率,确定所述广播消息的优先级,包括:The method of claim 2, wherein determining the priority of the broadcast message according to the frequency of use comprises:
    根据所述使用频率,确定所述使用频率所属的频率范围;Determining, according to the frequency of use, a frequency range to which the frequency of use belongs;
    根据所述频率范围,确定所述广播消息的优先级。Determining the priority of the broadcast message based on the frequency range.
  4. 根据权利要求3所述的方法,其中,预先建立频率范围与广播消息的优先级的对应关系;The method according to claim 3, wherein the correspondence between the frequency range and the priority of the broadcast message is established in advance;
    根据所述频率范围,确定所述广播消息的优先级,包括:Determining a priority of the broadcast message according to the frequency range, including:
    根据所述频率范围以及所述对应关系,确定所述广播消息的优先级。Determining a priority of the broadcast message according to the frequency range and the correspondence.
  5. 根据权利要求1所述的方法,其中,根据所述广播消息的优先级,确定所述广播消息在广播消息队列中的插入位置,包括:The method according to claim 1, wherein determining the insertion position of the broadcast message in the broadcast message queue according to the priority of the broadcast message comprises:
    将所述广播消息的优先级与所述广播消息队列中的广播消息的优先级进行对比;Comparing the priority of the broadcast message with the priority of the broadcast message in the broadcast message queue;
    根据对比结果,确定所述广播消息在所述广播消息队列中的插入位置。Based on the comparison result, the insertion position of the broadcast message in the broadcast message queue is determined.
  6. 根据权利要求5所述的方法,其中,根据对比结果,确定所述广播消息在所述广播消息队列中的插入位置,包括:The method according to claim 5, wherein determining the insertion position of the broadcast message in the broadcast message queue according to the comparison result comprises:
    当所述广播消息队列中有与所述优先级相同的广播消息时,确定所述广播消息的插入位置为与所述优先级相同的广播消息之后;When the broadcast message queue has the same broadcast message as the priority, determining that the insertion position of the broadcast message is after the same broadcast message as the priority;
    当所述广播消息队列中没有与所述优先级相同的广播消息时,判断所述优先级是否高于所述广播消息队列中的所有广播消息的优先级;When there is no broadcast message with the same priority in the broadcast message queue, determining whether the priority is higher than a priority of all broadcast messages in the broadcast message queue;
    如果所述优先级高于所述广播消息队列中的所有广播消息的优先级,则确定所述插入位置为所述广播消息队列的队头;Determining that the insertion location is a head of the broadcast message queue if the priority is higher than a priority of all broadcast messages in the broadcast message queue;
    如果所述优先级不高于所述广播消息队列中的所有广播消息的优先级,则判断所述优先级是否低于所述广播消息队列中的所有广播消息的优先级;If the priority is not higher than the priority of all broadcast messages in the broadcast message queue, determining whether the priority is lower than a priority of all broadcast messages in the broadcast message queue;
    如果所述优先级低于所述广播消息队列中的所有广播消息的优先级,则确定所述插入位置为所述广播消息的队尾;Determining that the insertion location is a tail of the broadcast message if the priority is lower than a priority of all broadcast messages in the broadcast message queue;
    如果所述优先级不低于所述广播消息队列中的所有广播消息的优先级,则确定所述广播消息队列中的高于所述优先级和低于所述优先级的相邻两个广播消息,并确定所述广播消息的插入位置为所述相邻两个广播消息之间。If 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.
  7. 根据权利要求1-6任一所述的方法,其中,在将所述广播消息排列在所述位置之后,还包括:The method of any of claims 1-6, further comprising: after arranging the broadcast message in the location,
    按照所述广播消息队列中的广播消息的排队顺序,识别当前的广播消息的广播接收者;Identifying a broadcast recipient of the current broadcast message according to a queuing sequence of broadcast messages in the broadcast message queue;
    将所述当前的广播消息分发给所述广播接收者。Distributing the current broadcast message to the broadcast recipient.
  8. 一种广播消息排队的装置,其中,所述装置包括:A device for queuing broadcast messages, wherein the device comprises:
    广播消息监听模块,用于监听广播发送者发出的广播消息;a broadcast message monitoring module, configured to listen to a broadcast message sent by a broadcast sender;
    优先级确定模块,用于在监听到广播发送者发出广播消息时,根据所述广播发送者确定所述广播消息的优先级;a priority determining module, configured to determine a priority of the broadcast message according to the broadcast sender when the broadcast sender is notified to send a broadcast message;
    插入位置确定模块,用于根据所述广播消息的优先级,确定所述广播消息在广播消息队列中的插入位置;An insertion location determining module, configured to determine, according to a priority of the broadcast message, an insertion location of the broadcast message in a broadcast message queue;
    广播消息插入模块,用于根据所述插入位置,将所述广播消息插入所述广播消息队列。And a broadcast message insertion module, configured to insert the broadcast message into the broadcast message queue according to the insertion location.
  9. 根据权利要求8所述的装置,其中,所述优先级确定模块包括:The apparatus of claim 8, wherein the priority determining module comprises:
    使用频率统计单元,用于统计所述广播发送者在预设时间内的使用频率;Using a frequency statistics unit, configured to count the frequency of use of the broadcast sender within a preset time;
    优先级确定单元,用于根据所述使用频率,确定所述广播消息的优先级。a priority determining unit, configured to determine a priority of the broadcast message according to the frequency of use.
  10. 根据权利要求9所述的装置,其中,所述优先级确定单元具体用于:The apparatus according to claim 9, wherein the priority determining unit is specifically configured to:
    根据所述使用频率,确定所述使用频率所属的频率范围;Determining, according to the frequency of use, a frequency range to which the frequency of use belongs;
    根据所述频率范围,确定所述广播消息的优先级。Determining the priority of the broadcast message based on the frequency range.
  11. 根据权利要求10所述的装置,其中,预先建立频率范围与广播消息的优先级的对应关系;The apparatus according to claim 10, wherein a correspondence relationship between a frequency range and a priority of a broadcast message is established in advance;
    所述优先级确定单元具体用于:根据所述频率范围,确定所述广播消息的优先级,包括:The priority determining unit is specifically configured to determine a priority of the broadcast message according to the frequency range, including:
    根据所述频率范围以及所述对应关系,确定所述广播消息的优先级。Determining a priority of the broadcast message according to the frequency range and the correspondence.
  12. 根据权利要求8所述的装置,其中,所述插入位置确定模块包括:The apparatus of claim 8 wherein said insertion location determining module comprises:
    优先级对比单元,用于将所述广播消息的优先级与所述广播消息队列中的广播消息的优先级进行对比;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;
    插入位置确定单元,用于根据对比结果,确定所述广播消息在所述广播消息队列中的插入位置。And an insertion location determining unit, configured to determine, according to the comparison result, an insertion position of the broadcast message in the broadcast message queue.
  13. 根据权利要求12所述的装置,其中,所述插入位置确定单元具体用于:The apparatus according to claim 12, wherein the insertion position determining unit is specifically configured to:
    当所述广播消息队列中有与所述优先级相同的广播消息时,确定所述广播消息的插入位置为与所述优先级相同的广播消息之后;When the broadcast message queue has the same broadcast message as the priority, determining that the insertion position of the broadcast message is after the same broadcast message as the priority;
    当所述广播消息队列中没有与所述优先级相同的广播消息时,判断所述优先级是否高于所述广播消息队列中的所有广播消息的优先级;When there is no broadcast message with the same priority in the broadcast message queue, determining whether the priority is higher than a priority of all broadcast messages in the broadcast message queue;
    如果所述优先级高于所述广播消息队列中的所有广播消息的优先级,则确定所述插入位置为所述广播消息队列的队头;Determining that the insertion location is a head of the broadcast message queue if the priority is higher than a priority of all broadcast messages in the broadcast message queue;
    如果所述优先级不高于所述广播消息队列中的所有广播消息的优先级,则判断所述优先级是否低于所述广播消息队列中的所有广播消息的优先级;If the priority is not higher than the priority of all broadcast messages in the broadcast message queue, determining whether the priority is lower than a priority of all broadcast messages in the broadcast message queue;
    如果所述优先级低于所述广播消息队列中的所有广播消息的优先级,则确定所述插入位置为所述广播消息的队尾;Determining that the insertion location is a tail of the broadcast message if the priority is lower than a priority of all broadcast messages in the broadcast message queue;
    如果所述优先级不低于所述广播消息队列中的所有广播消息的优先级,则确定所述广播消息队列中的高于所述优先级和低于所述优先级的相邻两个广播消息,并确定所述广播消息的插入位置为所述相邻两个广播消息之间。If 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.
  14. 根据权利要求8-13任一所述的装置,其中,还包括:The device according to any one of claims 8-13, further comprising:
    广播接收者识别模块,用于按照所述广播消息队列中的广播消息的排队顺序,识别当前的广播消息的广播接收者;a broadcast receiver identification module, configured to identify a broadcast receiver of a current broadcast message according to a queuing sequence of broadcast messages in the broadcast message queue;
    广播消息分发模块,用于将所述当前的广播消息分发给所述广播接收者。And a broadcast message distribution module, configured to distribute the current broadcast message to the broadcast recipient.
  15. 一种存储介质,其中,所述存储介质中存储有多条指令,所述指令适于由处理器加载以执行如权利要求1-7任一项所述的步骤。A storage medium, wherein the storage medium stores a plurality of instructions adapted to be loaded by a processor to perform the steps of any of claims 1-7.
  16. 一种电子设备,其中,包括处理器和存储器,所述存储器存储有多条指令,所述处理器加载所述存储器中的指令用于执行以下步骤:An electronic device, comprising a processor and a memory, the memory storing a plurality of instructions, the processor loading instructions in the memory for performing the following steps:
    监听广播发送者发出的广播消息;Listening to broadcast messages from broadcast senders;
    在监听到广播发送者发出广播消息时,根据所述广播发送者确定所述广播消息的优先级;Determining, according to the broadcast sender, a priority of the broadcast message when listening to the broadcast sender to send a broadcast message;
    根据所述广播消息的优先级,确定所述广播消息在广播消息队列中的插入位置;Determining an insertion position of the broadcast message in a broadcast message queue according to a priority of the broadcast message;
    根据所述插入位置,将所述广播消息插入所述广播消息队列。The broadcast message is inserted into the broadcast message queue according to the insertion location.
  17. 根据权利要求16所述的电子设备,其中,根据所述广播发送者确定所述广播消息的优先级时,所述处理器用于执行以下步骤:The electronic device of claim 16, wherein the processor is configured to perform the following steps when the broadcast sender determines a priority of the broadcast message:
    统计所述广播发送者在预设时间内的使用频率;Counting the frequency of use of the broadcast sender within a preset time;
    根据所述使用频率,确定所述广播消息的优先级。The priority of the broadcast message is determined according to the frequency of use.
  18. 根据权利要求17所述的电子设备,其中,根据所述使用频率,确定所述广播消息的优先级时,所述处理器用于执行以下步骤:The electronic device of claim 17, wherein the processor is configured to perform the following steps when determining a priority of the broadcast message according to the frequency of use:
    根据所述使用频率,确定所述使用频率所属的频率范围;Determining, according to the frequency of use, a frequency range to which the frequency of use belongs;
    根据所述频率范围,确定所述广播消息的优先级。Determining the priority of the broadcast message based on the frequency range.
  19. 根据权利要求16所述的电子设备,其中,根据所述广播消息的优先级,确定所述广播消息在广播消息队列中的插入位置时,所述处理器用于执行以下步骤:The electronic device according to claim 16, wherein, when determining an insertion position of the broadcast message in a broadcast message queue according to a priority of the broadcast message, the processor is configured to perform the following steps:
    将所述广播消息的优先级与所述广播消息队列中的广播消息的优先级进行对比;Comparing the priority of the broadcast message with the priority of the broadcast message in the broadcast message queue;
    根据对比结果,确定所述广播消息在所述广播消息队列中的插入位置。Based on the comparison result, the insertion position of the broadcast message in the broadcast message queue is determined.
  20. 根据权利要求19所述的电子设备,其中,根据对比结果,确定所述广播消息在所述广播消息队列中的插入位置时,所述处理器用于执行以下步骤:The electronic device according to claim 19, wherein, when determining the insertion position of the broadcast message in the broadcast message queue according to the comparison result, the processor is configured to perform the following steps:
    当所述广播消息队列中有与所述优先级相同的广播消息时,确定所述广播消息的插入位置为与所述优先级相同的广播消息之后;When the broadcast message queue has the same broadcast message as the priority, determining that the insertion position of the broadcast message is after the same broadcast message as the priority;
    当所述广播消息队列中没有与所述优先级相同的广播消息时,判断所述优先级是否高于所述广播消息队列中的所有广播消息的优先级;When there is no broadcast message with the same priority in the broadcast message queue, determining whether the priority is higher than a priority of all broadcast messages in the broadcast message queue;
    如果所述优先级高于所述广播消息队列中的所有广播消息的优先级,则确定所述插入位置为所述广播消息队列的队头;Determining that the insertion location is a head of the broadcast message queue if the priority is higher than a priority of all broadcast messages in the broadcast message queue;
    如果所述优先级不高于所述广播消息队列中的所有广播消息的优先级,则判断所述优先级是否低于所述广播消息队列中的所有广播消息的优先级;If the priority is not higher than the priority of all broadcast messages in the broadcast message queue, determining whether the priority is lower than a priority of all broadcast messages in the broadcast message queue;
    如果所述优先级低于所述广播消息队列中的所有广播消息的优先级,则确定所述插入位置为所述广播消息的队尾;Determining that the insertion location is a tail of the broadcast message if the priority is lower than a priority of all broadcast messages in the broadcast message queue;
    如果所述优先级不低于所述广播消息队列中的所有广播消息的优先级,则确定所述广播消息队列中的高于所述优先级和低于所述优先级的相邻两个广播消息,并确定所述广播消息的插入位置为所述相邻两个广播消息之间。If 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.
PCT/CN2017/106769 2017-03-10 2017-10-18 Broadcast message queuing method and apparatus, storage device, and electronic device WO2018161579A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710144310.4 2017-03-10
CN201710144310.4A CN106850458B (en) 2017-03-10 2017-03-10 Broadcast the message the method, apparatus and terminal being lined up

Publications (1)

Publication Number Publication Date
WO2018161579A1 true WO2018161579A1 (en) 2018-09-13

Family

ID=59145113

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/106769 WO2018161579A1 (en) 2017-03-10 2017-10-18 Broadcast message queuing method and apparatus, storage device, and electronic device

Country Status (2)

Country Link
CN (1) CN106850458B (en)
WO (1) WO2018161579A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106850458B (en) * 2017-03-10 2019-06-07 Oppo广东移动通信有限公司 Broadcast the message the method, apparatus and terminal being lined up
CN112383373A (en) * 2020-11-18 2021-02-19 广东长盈科技股份有限公司 Intelligent broadcast scheduling method and system for realizing emergency broadcast

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103491507A (en) * 2013-09-05 2014-01-01 深圳市欧珀通信软件有限公司 Method and device for relocation of orderly broadcast priority
CN104199669A (en) * 2014-09-12 2014-12-10 北京奇虎科技有限公司 Method and device for managing application program processes
CN104680060A (en) * 2014-11-25 2015-06-03 北京奇虎科技有限公司 Procedure self-starting management method and procedure self-starting management device
CN106484473A (en) * 2016-09-29 2017-03-08 Tcl集团股份有限公司 A kind of application starts method and apparatus
CN106850458A (en) * 2017-03-10 2017-06-13 广东欧珀移动通信有限公司 Broadcast the message method, device and the terminal queued up

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100370845C (en) * 2004-12-22 2008-02-20 华为技术有限公司 Method for scheduling message of broadcasting service in sub zone in broadband CDMA system
US8677002B2 (en) * 2006-01-28 2014-03-18 Blackfire Research Corp Streaming media system and method
CN103200639B (en) * 2013-03-03 2015-06-17 西安电子科技大学 Method of self-organizing network directed route in air

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103491507A (en) * 2013-09-05 2014-01-01 深圳市欧珀通信软件有限公司 Method and device for relocation of orderly broadcast priority
CN104199669A (en) * 2014-09-12 2014-12-10 北京奇虎科技有限公司 Method and device for managing application program processes
CN104680060A (en) * 2014-11-25 2015-06-03 北京奇虎科技有限公司 Procedure self-starting management method and procedure self-starting management device
CN106484473A (en) * 2016-09-29 2017-03-08 Tcl集团股份有限公司 A kind of application starts method and apparatus
CN106850458A (en) * 2017-03-10 2017-06-13 广东欧珀移动通信有限公司 Broadcast the message method, device and the terminal queued up

Also Published As

Publication number Publication date
CN106850458A (en) 2017-06-13
CN106850458B (en) 2019-06-07

Similar Documents

Publication Publication Date Title
WO2018161581A1 (en) Control method, device, storage medium, and electronic apparatus for broadcast sending
WO2018076866A1 (en) Data processing method, device, storage medium, electronic device and server
WO2018076819A1 (en) Data upload method, apparatus, storage medium, electronic device and system
WO2018161580A1 (en) Broadcast control method and apparatus, storage medium, and electronic device
WO2017206878A1 (en) Wakeup lock-based processing method and apparatus, storage medium, and electronic device
WO2018166199A1 (en) Method for adjusting precision level of positioning, device, storage medium and electronic device
WO2018076818A1 (en) Data backup method, apparatus, electronic device, storage medium, and system
WO2017206883A1 (en) Application processing method and apparatus, storage medium, and electronic device
WO2018161588A1 (en) Broadcast receiver queue adjustment method, apparatus, storage medium, and electronic device
WO2017206862A1 (en) Bright screen lock-based processing method and apparatus, storage medium, and electronic device
WO2018161585A1 (en) Method and apparatus for controlling frame rate of electronic device, storage medium, and electronic device
WO2015053454A1 (en) Communication service operating method and electronic device supporting the same
WO2018161576A1 (en) Broadcast control method, device, storage medium and mobile terminal
WO2018076830A1 (en) Method and device for adjusting data synchronization cycle, electronic device, storage medium, and system
WO2018076888A1 (en) Method, device and system for synchronizing data of mobile terminal, storage medium and mobile terminal
WO2021162186A1 (en) Electronic device using communication channel generated by electrical connection between electronic device and external electronic device, and method for operating electronic device
WO2018076829A1 (en) Terminal data processing method, apparatus, system, storage medium and server
WO2018076842A1 (en) Data backup method, device, system, storage medium, and electronic device
WO2017206867A1 (en) Sensor shutdown method and apparatus, storage medium, and electronic device
WO2017206885A1 (en) Application program shutdown method and apparatus, storage medium, and electronic device
WO2018161575A1 (en) Method and device for adjusting broadcast message queue, storage medium, and terminal
WO2018161579A1 (en) Broadcast message queuing method and apparatus, storage device, and electronic device
WO2022154363A1 (en) Audio device for processing audio data and operating method thereof
WO2020171465A1 (en) Electronic device and application managing method thereof
WO2018076873A1 (en) Data sharing method, apparatus, medium, electronic device and system

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17899901

Country of ref document: EP

Kind code of ref document: A1