+

WO2018161575A1 - Method and device for adjusting broadcast message queue, storage medium, and terminal - Google Patents

Method and device for adjusting broadcast message queue, storage medium, and terminal Download PDF

Info

Publication number
WO2018161575A1
WO2018161575A1 PCT/CN2017/106607 CN2017106607W WO2018161575A1 WO 2018161575 A1 WO2018161575 A1 WO 2018161575A1 CN 2017106607 W CN2017106607 W CN 2017106607W WO 2018161575 A1 WO2018161575 A1 WO 2018161575A1
Authority
WO
WIPO (PCT)
Prior art keywords
broadcast message
broadcast
same
terminal
queue
Prior art date
Application number
PCT/CN2017/106607
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 WO2018161575A1 publication Critical patent/WO2018161575A1/en

Links

Classifications

    • 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 medium, and a terminal for adjusting a broadcast message queue.
  • 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, an apparatus, a storage medium, and a terminal for adjusting a broadcast message queue, which can avoid blocking of broadcast messages and reduce system overhead.
  • the embodiment of the present application provides a method for adjusting a broadcast message queue, where the method includes:
  • the same broadcast message sent by the same broadcast sender in the broadcast message queue is subjected to the subtraction process.
  • the embodiment of the present application further provides an apparatus for adjusting a broadcast message queue, where the apparatus includes:
  • An information acquiring module configured to acquire current load information
  • the busy state determining module is configured to determine, according to the current load information, whether the terminal is currently in a busy state
  • the message processing module is configured to perform a subtraction process on the same broadcast message sent by the same broadcast sender in the broadcast message queue if the terminal is currently in a busy state.
  • an embodiment of the present application further provides a storage medium, where the computer program stores a computer program, and when the computer program runs on a computer, the computer executes the foregoing method for adjusting a broadcast message queue.
  • an embodiment of the present application further provides a terminal, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the following steps:
  • the same broadcast message sent by the same broadcast sender in the broadcast message queue is subjected to the subtraction process.
  • the embodiment of the present invention provides a method, an apparatus, a storage medium, and a terminal for adjusting a broadcast message queue, which can avoid blocking of broadcast messages and reduce system overhead.
  • FIG. 1 is a flowchart of a method for adjusting a broadcast message queue according to an embodiment of the present application
  • FIG. 2 is a flowchart of a method for adjusting a broadcast message queue according to an embodiment of the present application
  • FIG. 3 is a flowchart of a method for adjusting a broadcast message queue according to an embodiment of the present application
  • FIG. 4 is a flowchart of a method for adjusting a broadcast message queue according to an embodiment of the present application
  • FIG. 5 is a structural block diagram of an apparatus for adjusting a broadcast message queue according to an embodiment of the present application
  • FIG. 6 is a schematic structural diagram of a terminal according to an embodiment of the present application.
  • An embodiment of the present application provides a method for adjusting a broadcast message queue, where the method includes:
  • the same broadcast message sent by the same broadcast sender in the broadcast message queue is subjected to the subtraction process.
  • determining, according to the current load information, whether the terminal is currently in a busy state includes:
  • performing the subtraction process on the same broadcast message sent by the same broadcast sender in the broadcast message queue includes:
  • a preset number of broadcast messages are retained according to the enqueue order of the same broadcast message.
  • the preset number of broadcast messages are retained according to the enqueue order of the same broadcast message, including:
  • the broadcast message of the enqueue after the same broadcast message is removed, and the preset number of broadcast messages of the first queue are reserved.
  • the method further includes:
  • the method after receiving the broadcast message sending request, after identifying whether there is a broadcast message in the current broadcast message queue that is the same as the broadcast message requested by the broadcast message sending request, the method further includes:
  • the broadcast message requested by the broadcast message sending request is added to the current broadcast message queue.
  • the load information includes at least one of processor usage, memory usage, and occupancy of input and output system resources.
  • the method may be performed by a device that adjusts a broadcast message queue.
  • the device may be implemented by software and/or hardware, and the device may be integrated into the terminal.
  • the terminal may be a smart phone, a tablet computer, etc., and the method includes:
  • Step 101 Acquire current load information.
  • the load information can be understood as parameter information that can describe the running status of the terminal, for example, the number of currently running programs, the number of loaded applications, the usage of the CPU, or the size of the occupied memory.
  • the load information can reflect the level of the terminal load, and the high or low load is relative to the computing power of the CPU. Too high a load will cause many processes to slow down. It takes a long time to open a new process, causing the system to get stuck. Therefore, it is generally recommended not to make the load too high.
  • the load information includes at least one of: CPU (processor) usage, memory usage, and occupancy of IO (input and output system) resources.
  • the CPU usage rate is the CPU resource occupied by the running program, indicating the case where the terminal runs the program at a certain point in time. The higher the usage rate, the more programs the terminal is running at this time.
  • Memory usage also known as memory usage, refers to the memory overhead of this process.
  • File IO Input-Output, input and output
  • IO without cache without cache means that each read and write operation calls a system call in the kernel.
  • the size of any one or more of CPU usage, memory usage, and file IO resource occupancy can be used to characterize the level of the load.
  • Step 102 Determine, according to the current load information, whether the terminal is currently in a busy state.
  • the current CPU load size may be determined according to the current load information, and the preset algorithm may be used to identify whether the terminal is currently busy.
  • Step 103 If the terminal is currently in a busy state, perform the subtraction process on the same broadcast message sent by the same broadcast sender in the broadcast message queue.
  • the broadcast mechanism is essentially a communication method between components in the operating system of the mobile terminal, and is a mechanism widely used to transmit messages between applications.
  • a broadcast message is sent under the Android system of the mobile terminal.
  • 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 mechanism includes three basic elements: a broadcast, a broadcast receiver, and an intended content, wherein the broadcast is used to transmit the broadcast, the broadcast receiver is used to receive the broadcast, and the broadcast receiver can tell the system what type of broadcast is interested by calling the function, and Registering a broadcast receiver with the system has the right to receive broadcast messages of this type.
  • Intent content is used to store media related to broadcast related information.
  • ActivityManagerService is the broadcast center in the broadcast mechanism of the Android system, and is responsible for the registration and release operations of all broadcasts in the system.
  • the registration of the broadcast refers to the process in which the application registers the broadcast receiver to the 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 of Android system has some similarities with the radio broadcast in the traditional sense. It is called broadcast because the sender is only responsible for sending, and does not care whether the receiver receives the message data or how the receiver is concerned. Processing message data. In addition, broadcast messages can be received by more than one application or not by any application.
  • a broadcast message queue is a form in which a broadcast message is sequentially enqueued in the order of broadcast time.
  • the broadcast message queue can be either the default broadcast queue or a third-party application broadcast queue.
  • the broadcast message queue may be a queue consisting of a system broadcast including a bright screen broadcast, a blackout broadcast, an unlock broadcast, a network state change broadcast, a Bluetooth state change broadcast, a switched language broadcast, a switching theme broadcast, or the like.
  • the broadcast message can be named when the broadcast message is established, and the same broadcast message can be a broadcast message with the same name.
  • multiple broadcast messages whose names are "bright screen broadcasts" may be referred to as the same broadcast message.
  • the same broadcast sender may send multiple broadcast messages, some of which are the same.
  • the same broadcast message sent by the same broadcast sender in the broadcast message queue can be deleted, which can reduce the broadcast congestion.
  • the same broadcast sender successively transmits a plurality of switched language broadcasts.
  • the broadcast message may be processed. For example, some of the switched language broadcast information may be deleted, or only the appropriate amount of the switched language broadcast message in the broadcast message queue may be reserved, thereby reducing the congestion of the broadcast. If the terminal is not busy, you can do nothing else.
  • the broadcast messages are sequentially distributed according to the enqueue order in the broadcast message queue.
  • the embodiment of the present application can determine whether the terminal is in a busy state according to the load information, and perform the process of deleting the same broadcast message sent by the same broadcast sender in the broadcast message queue in the busy state, thereby preventing the broadcast message from being blocked and avoiding the system from appearing.
  • the Caton phenomenon reduces system overhead.
  • FIG. 2 is a flowchart of a method for adjusting a broadcast message queue according to an embodiment of the present disclosure.
  • the method in this embodiment includes:
  • Step 201 Acquire current load information.
  • Step 202 When the current load information meets a preset condition, determine that the terminal is currently in a busy state.
  • the preset condition may be set according to some parameters of the performance of the terminal CPU, and the preset condition may limit at least one type of load information, for example, the preset condition may be that the CPU usage rate is higher than 80%, or may be used by the CPU. The rate is higher than 80% and the memory usage is higher than 80%, or the CPU usage is higher than 75%, the memory usage is higher than 80%, and the file IO resource occupancy rate is higher than 85%.
  • Step 203 Perform the subtraction process on the same broadcast message sent by the same broadcast sender in the broadcast message queue.
  • the embodiment of the present application determines whether the terminal is in a busy state by setting a preset condition of the load information, and can simply and accurately determine the state of the terminal, and perform the same broadcast message sent by the same broadcast sender in the broadcast message queue in the busy state. Decrement processing can avoid blocking broadcast messages, avoid system stalls, and reduce system overhead.
  • FIG. 3 is a flowchart of a method for adjusting a broadcast message queue according to an embodiment of the present disclosure. The method in this embodiment includes:
  • Step 301 Acquire current load information.
  • Step 302 Determine, according to the current load information, whether the terminal is currently in a busy state.
  • Step 303 If the terminal is currently in a busy state, the same broadcast message sent by the same broadcast sender in the broadcast message queue is counted.
  • the source of the information may be determined according to the broadcast message, that is, the broadcast sender is determined.
  • the broadcast sender can be determined by obtaining the relevant identifier of the broadcast message or related configuration parameters.
  • the broadcast message type can be determined according to the characteristics of the broadcast message, and the same broadcast message can be counted.
  • the broadcast sender of the broadcast message can be determined by the ActivityManagerService.
  • Step 304 Reserve a preset number of broadcast messages according to the enqueue sequence of the same broadcast message.
  • the preset number may be set according to the response speed of the terminal, or may be determined according to the length of the current broadcast message queue. According to the enqueue sequence of the same broadcast message, the preset number of broadcast messages are reserved, and the remaining broadcast messages are deleted, so as to reduce the congestion of the broadcast message and avoid the phenomenon of stuttering in the system.
  • the preset number of broadcast messages are retained according to the enqueue sequence of the same broadcast message, including: removing the first broadcast message in the same broadcast message, and retaining the enqueue after the queue a preset number of broadcast messages; or removing broadcast messages that are enqueued in the same broadcast message and retaining a preset number of broadcast messages that are queued first.
  • the preset number of broadcast messages that are enqueued after the reservation are retained, and other broadcast messages are removed.
  • the preset number is 2
  • the number of the same broadcast messages sent by the broadcast sender to the application A is 4, and the A1, A2, A3, and A4 are sequentially named according to the enqueue order.
  • the two broadcast messages enqueued, namely A3 and A4, remove all broadcast messages of this type before A3 and A4.
  • Broadcast messages can reduce the number of broadcast messages, avoid blocking broadcast messages, avoid system stalls, and reduce system overhead. At the same time, it is ensured that the broadcast messages of the incoming queues are smoothly distributed, and the loss of new broadcast messages is avoided.
  • the preset number of broadcast messages of the first queue are reserved according to the order of enqueue in the queue of the broadcast message, and other broadcast messages are removed.
  • the preset number is 2
  • the number of the same broadcast messages sent by the broadcast sender for the application A is 4, and the A1, A2, A3, and A4 are sequentially named according to the enqueue order.
  • the two broadcast messages enqueued, namely A1 and A2, remove all broadcast messages of this type after A1 and A2.
  • Broadcast messages can reduce the number of broadcast messages, avoid blocking broadcast messages, avoid system stalls, and reduce system overhead. At the same time, it ensures that the broadcast messages of the first-in queue are distributed smoothly, and the loss of the first-entry broadcast messages with long waiting time is avoided.
  • FIG. 4 is a flowchart of a method for adjusting a broadcast message queue according to an embodiment of the present disclosure. The method in this embodiment includes:
  • Step 401 Acquire current load information.
  • Step 402 Determine, according to the current load information, whether the terminal is currently in a busy state.
  • Step 403 If the terminal is currently in a busy state, perform the subtraction process on the same broadcast message sent by the same broadcast sender in the broadcast message queue.
  • Step 404 After receiving the broadcast message sending request, identify whether there is a broadcast message in the current broadcast message queue that is the same as the broadcast message requested by the broadcast message sending request; if yes, execute step 405, otherwise execute Step 406.
  • Step 405 Replace the broadcast message requested by the broadcast message sending request with the same broadcast message in the current broadcast message queue.
  • Step 406 Allow the broadcast message requested by the broadcast message sending request to enter the current broadcast message queue.
  • the current broadcast message queue can be understood as a broadcast message queue composed of all undistributed broadcast messages with the current time point as the time node and before the time node. After receiving a new broadcast message transmission request, the broadcast message is matched with the broadcast message in the broadcast message queue before the broadcast message is not received. If the current broadcast message queue includes the same broadcast message as the broadcast message, the broadcast message may be used to replace the existing same broadcast message. If not, the broadcast message is added to the broadcast message queue, waiting for subsequent processing. .
  • the foregoing determining whether the terminal is busy and performing the process of deleting the same broadcast message sent by the same broadcast sender in the broadcast message team when the terminal is busy, and the newly received
  • the sequence of the process of the broadcast message processing is not limited, that is, there is no strict sequence between the steps 401-403 and the steps 404-406, and the order of protection of the embodiment of the present application is not limited.
  • the embodiment of the present application can determine whether the terminal is in a busy state according to the load information, and perform the process of deleting the same broadcast message sent by the same broadcast sender in the broadcast message queue in the busy state, thereby preventing the broadcast message from being blocked and avoiding the system from appearing.
  • the Caton phenomenon reduces system overhead.
  • the newly received broadcast message is processed, which can avoid the large overhead caused by the frequent sending of the same broadcast message to the system, and does not cause loss of a certain type of broadcast message, and provides an orderly broadcast message distribution. The guarantee.
  • An embodiment of the present application provides an apparatus for adjusting a broadcast message queue, where the apparatus includes:
  • An information acquiring module configured to acquire current load information
  • the busy state determining module is configured to determine, according to the current load information, whether the terminal is currently in a busy state
  • the message processing module is configured to perform a subtraction process on the same broadcast message sent by the same broadcast sender in the broadcast message queue if the terminal is currently in a busy state.
  • the busy state determination module includes:
  • the busy state determining unit is configured to determine that the terminal is currently in a busy state when the current load information meets a preset condition.
  • the message processing module includes:
  • a message statistics unit configured to count the same broadcast message sent by the same broadcast sender in the broadcast message queue
  • a message retention unit configured to reserve a preset number of broadcast messages according to the enqueue order of the same broadcast message.
  • the message retention unit is specifically configured to:
  • the broadcast message of the enqueue after the same broadcast message is removed, and the preset number of broadcast messages of the first queue are reserved.
  • the apparatus further includes:
  • a message identifying module configured to: after receiving the broadcast message sending request, identify whether there is a broadcast message in the current broadcast message queue that is the same as the broadcast message requested by the broadcast message sending request;
  • a message enqueue processing module if yes, replacing the broadcast message requested by the broadcast message sending request with the same broadcast message in the current broadcast message queue.
  • the message enqueue processing module is further configured to:
  • the broadcast message requested by the broadcast message sending request is added to the current broadcast message queue.
  • the load information includes at least one of processor usage, memory usage, and occupancy of input and output system resources.
  • FIG. 5 is a structural block diagram of an apparatus for adjusting a broadcast message queue according to an embodiment of the present disclosure.
  • the apparatus may be implemented by software and/or hardware, and may be integrated into a terminal, and may perform a method for adjusting a broadcast message queue to a terminal.
  • the broadcast message in the control is controlled.
  • the device includes an information acquisition module 501, a busy state determination module 502, and a message processing module 503.
  • the information obtaining module 501 is configured to acquire current load information.
  • the busy state determining module 502 is configured to determine, according to the current load information, whether the terminal is currently in a busy state;
  • the message processing module 503 is configured to perform a subtraction process on the same broadcast message sent by the same broadcast sender in the broadcast message queue if the terminal is currently in a busy state.
  • the apparatus for adjusting a broadcast message queue determines whether the terminal is in a busy state according to the load information, and performs the deletion processing on the same broadcast message sent by the same broadcast sender in the broadcast message queue in the busy state. It can avoid blocking broadcast messages, avoid system stalls and reduce system overhead.
  • the busy state determination module 502 includes:
  • the busy state determining unit is configured to determine that the terminal is currently in a busy state when the current load information meets a preset condition.
  • the message processing module 503 includes:
  • a message statistics unit configured to count the same broadcast message sent by the same broadcast sender in the broadcast message queue
  • a message retention unit configured to reserve a preset number of broadcast messages according to the enqueue order of the same broadcast message.
  • the message retention unit is specifically configured to:
  • the broadcast message of the enqueue after the same broadcast message is removed, and the preset number of broadcast messages of the first queue are reserved.
  • the apparatus further comprises:
  • a message identifying module configured to: after receiving the broadcast message sending request, identify whether there is a broadcast message in the current broadcast message queue that is the same as the broadcast message requested by the broadcast message sending request;
  • a message enqueue processing module if yes, replacing the broadcast message requested by the broadcast message sending request with the same broadcast message in the current broadcast message queue.
  • the load information includes at least one of the following: CPU usage, memory usage, and occupancy of file IO resources.
  • the device for adjusting the broadcast message queue can perform the method for adjusting the broadcast message queue provided by any embodiment of the present application, and has the corresponding functional modules and beneficial effects of the method for adjusting the broadcast message queue.
  • the device for adjusting the broadcast message queue can perform the method for adjusting the broadcast message queue provided by any embodiment of the present application, and has the corresponding functional modules and beneficial effects of the method for adjusting the broadcast message queue.
  • FIG. 6 is a schematic structural diagram of a terminal according to an embodiment of the present disclosure.
  • the terminal may include: a casing (not shown), a memory 601, and a central processing unit (Central). Processing Unit, CPU) 602 (also referred to as a processor, hereinafter referred to as CPU), a computer program stored on the memory 601 and operable on the processor 602, a circuit board (not shown), and a power supply circuit (not shown) Out).
  • CPU central processing unit
  • the circuit board is disposed inside a space enclosed by the casing; the CPU 602 and the memory 601 are disposed on the circuit board; and the power circuit is configured to supply power to each circuit or device of the terminal;
  • the memory 601 is configured to store a computer program executable on a processor; the CPU 602 reads and executes a computer program stored in the memory 601.
  • the terminal further includes: a peripheral interface 603, RF (Radio) Frequency (RF) circuit 605, audio circuit 606, speaker 611, power management chip 608, input/output (I/O) subsystem 609, touch screen 612, other input/control devices 610, and external port 604, these components are passed through one or A plurality of communication buses or signal lines 607 are in communication.
  • RF Radio
  • RF Radio Frequency
  • the illustrated terminal 600 is merely one example of a terminal, and that the terminal 600 may have more or fewer components than those shown in the figures, two or more components may be combined, or may have Different component configurations.
  • the various components shown in the figures can be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.
  • the terminal uses a mobile phone as an example.
  • the memory 601 can be accessed by the CPU 602, the peripheral interface 603, etc., and the memory 601 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 603, which can connect the input and output peripherals of the device to CPU 602 and memory 601.
  • I/O subsystem 609 which can connect input and output peripherals on the device, such as touch screen 612 and other input/control devices 610, to peripheral interface 603.
  • I/O subsystem 609 can include display controller 6091 and one or more input controllers 6092 for controlling other input/control devices 610.
  • one or more input controllers 6092 receive electrical signals from other input/control devices 610 or transmit electrical signals to other input/control devices 610, and other input/control devices 610 may include physical buttons (press buttons, rocker buttons, etc.) ), dial, slide switch, joystick, click wheel.
  • the input controller 6092 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 612 is an input interface and an output interface between the user terminal and the user, and displays the visual output to the user.
  • the visual output may include graphics, text, icons, videos, and the like.
  • Display controller 6091 in I/O subsystem 609 receives an electrical signal from touch screen 612 or an electrical signal to touch screen 612.
  • the touch screen 612 detects the contact on the touch screen, and the display controller 6091 converts the detected contact into an interaction with the user interface object displayed on the touch screen 612, ie, realizes human-computer interaction, and the user interface object displayed on the touch screen 612 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 605 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 605 receives and transmits an RF signal, which is also referred to as an electromagnetic signal, and the RF circuit 605 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 605 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 606 is mainly used to receive audio data from the peripheral interface 603, convert the audio data into an electrical signal, and transmit the electrical signal to the speaker 611.
  • the speaker 611 is configured to restore the voice signal received by the mobile phone from the wireless network through the RF circuit 605 to sound and play the sound to the user.
  • the power management chip 608 is used for power supply and power management of the hardware connected to the CPU 602, the I/O subsystem, and the peripheral interface.
  • the CPU 602 provided by the embodiment of the present application implements the following steps when executing the computer program stored in the memory 601:
  • the same broadcast message sent by the same broadcast sender in the broadcast message queue is subjected to the subtraction process.
  • the foregoing terminal can perform the method for adjusting the broadcast message queue provided by any embodiment of the present application, and has the corresponding functional modules and beneficial effects of performing the method for adjusting the broadcast message queue provided by any embodiment.
  • the embodiment of the present application further provides a storage medium, where the computer program stores a computer program, and when the computer program runs on a computer, the computer executes the method for adjusting a broadcast message queue according to any one of the foregoing embodiments.
  • Storage media may include, but is not limited to, read only memory (ROM, Read) Only Memory), Random Access Memory (RAM), disk or optical disk.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Telephonic Communication Services (AREA)

Abstract

A method and device for adjusting a broadcast message queue, a storage medium, and a terminal. The method comprises: obtaining the current load information; determining whether the terminal is currently in a busy state according to the current load information; and if the terminal is currently in the busy state, deleting the same broadcast message sent by the same broadcast sender in the broadcast message queue.

Description

调整广播消息队列的方法、装置、存储介质及终端 Method, device, storage medium and terminal for adjusting broadcast message queue
本申请要求于2017年3月10日提交中国专利局、申请号为201710144263.3、发明名称为“调整广播消息队列的方法、装置及终端”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims priority to Chinese Patent Application No. 200910144263.3, entitled "Method, Apparatus and Terminal for Adjusting Broadcast Message Queuing", filed on March 10, 2017, 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 medium, and a terminal for adjusting a broadcast message queue.
背景技术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.
在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. The processing speed is slowed down, resulting in blocking of broadcast messages, which increases system overhead and affects the normal operation of the system.
技术问题technical problem
本申请实施例提供一种调整广播消息队列的方法、装置、存储介质及终端,可以避免广播消息阻塞,减少系统开销。The embodiment of the present invention provides a method, an apparatus, a storage medium, and a terminal for adjusting a broadcast message queue, which can avoid blocking of broadcast messages and reduce system overhead.
技术解决方案Technical solution
第一方面,本申请实施例提供了一种调整广播消息队列的方法,所述方法包括:In a first aspect, the embodiment of the present application provides a method for adjusting a broadcast message queue, where the method includes:
获取当前负载信息;Obtain current load information;
根据所述当前负载信息,判断终端当前是否处于繁忙状态;Determining, according to the current load information, whether the terminal is currently in a busy state;
如果终端当前处于繁忙状态,则对广播消息队列中相同的广播发送者发送的相同的广播消息进行删减处理。If the terminal is currently in a busy state, the same broadcast message sent by the same broadcast sender in the broadcast message queue is subjected to the subtraction process.
第二方面,本申请实施例还提供了一种调整广播消息队列的装置,所述装置包括:In a second aspect, the embodiment of the present application further provides an apparatus for adjusting a broadcast message queue, where the apparatus includes:
信息获取模块,用于获取当前负载信息;An information acquiring module, configured to acquire current load information;
繁忙状态判断模块,用于根据所述当前负载信息,判断终端当前是否处于繁忙状态;The busy state determining module is configured to determine, according to the current load information, whether the terminal is currently in a busy state;
消息处理模块,用于如果终端当前处于繁忙状态,则对广播消息队列中相同的广播发送者发送的相同的广播消息进行删减处理。The message processing module is configured to perform a subtraction process on the same broadcast message sent by the same broadcast sender in the broadcast message queue if the terminal is currently in a busy state.
第三方面,本申请实施例还提供了一种存储介质,所述存储介质中存储有计算机程序,当所述计算机程序在计算机上运行时,所述计算机执行上述调整广播消息队列的方法。In a third aspect, an embodiment of the present application further provides a storage medium, where the computer program stores a computer program, and when the computer program runs on a computer, the computer executes the foregoing method for adjusting a broadcast message queue.
第四方面,本申请实施例还提供了一种终端,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现以下步骤:In a fourth aspect, an embodiment of the present application further provides a terminal, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the following steps:
获取当前负载信息;Obtain current load information;
根据所述当前负载信息,判断终端当前是否处于繁忙状态;Determining, according to the current load information, whether the terminal is currently in a busy state;
如果终端当前处于繁忙状态,则对广播消息队列中相同的广播发送者发送的相同的广播消息进行删减处理。If the terminal is currently in a busy state, the same broadcast message sent by the same broadcast sender in the broadcast message queue is subjected to the subtraction process.
有益效果 Beneficial effect
本申请实施例提供一种调整广播消息队列的方法、装置、存储介质及终端,可以避免广播消息阻塞,减少系统开销。The embodiment of the present invention provides a method, an apparatus, a storage medium, and a terminal for adjusting a broadcast message queue, which can avoid blocking of broadcast messages and reduce system overhead.
附图说明DRAWINGS
图1是本申请实施例提供的一种调整广播消息队列的方法的流程图;1 is a flowchart of a method for adjusting a broadcast message queue according to an embodiment of the present application;
图2是本申请一个实施例提供的一种调整广播消息队列的方法的流程图;2 is a flowchart of a method for adjusting a broadcast message queue according to an embodiment of the present application;
图3是本申请一个实施例提供的一种调整广播消息队列的方法的流程图;3 is a flowchart of a method for adjusting a broadcast message queue according to an embodiment of the present application;
图4是本申请一个实施例提供的一种调整广播消息队列的方法的流程图;4 is a flowchart of a method for adjusting a broadcast message queue according to an embodiment of the present application;
图5是本申请实施例提供的一种调整广播消息队列的装置的结构框图;FIG. 5 is a structural block diagram of an apparatus for adjusting a broadcast message queue according to an embodiment of the present application;
图6为本申请实施例提供的一种终端的结构示意图。FIG. 6 is a schematic structural diagram of a terminal 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.
在更加详细地讨论示例性实施例之前应当提到的是,一些示例性实施例被描述成作为流程图描绘的处理或方法。虽然流程图将各步骤描述成顺序的处理,但是其中的许多步骤可以被并行地、并发地或者同时实施。此外,各步骤的顺序可以被重新安排。当其操作完成时所述处理可以被终止,但是还可以具有未包括在附图中的附加步骤。所述处理可以对应于方法、函数、规程、子例程、子程序等等。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.
本申请实施例提供一种调整广播消息队列的方法,所述方法包括:An embodiment of the present application provides a method for adjusting a broadcast message queue, where the method includes:
获取当前负载信息;Obtain current load information;
根据所述当前负载信息,判断终端当前是否处于繁忙状态;Determining, according to the current load information, whether the terminal is currently in a busy state;
如果终端当前处于繁忙状态,则对广播消息队列中相同的广播发送者发送的相同的广播消息进行删减处理。If the terminal is currently in a busy state, the same broadcast message sent by the same broadcast sender in the broadcast message queue is subjected to the subtraction process.
在一些实施例中,根据所述当前负载信息,判断终端当前是否处于繁忙状态包括:In some embodiments, determining, according to the current load information, whether the terminal is currently in a busy state includes:
当所述当前负载信息满足预设条件时,确定终端当前处于繁忙状态。When the current load information meets the preset condition, it is determined that the terminal is currently in a busy state.
在一些实施例中,对广播消息队列中相同的广播发送者发送的相同的广播消息进行删减处理包括:In some embodiments, performing the subtraction process on the same broadcast message sent by the same broadcast sender in the broadcast message queue includes:
统计广播消息队列中相同的广播发送者发送的相同的广播消息;Counting the same broadcast message sent by the same broadcast sender in the broadcast message queue;
根据所述相同的广播消息的入队顺序,保留预设数量的广播消息。A preset number of broadcast messages are retained according to the enqueue order of the same broadcast message.
在一些实施例中,根据所述相同的广播消息的入队顺序,保留预设数量的广播消息,包括:In some embodiments, the preset number of broadcast messages are retained according to the enqueue order of the same broadcast message, including:
移除所述相同的广播消息中先入队的广播消息,并保留后入队的预设数量的广播消息;或者Removing the first broadcast message in the same broadcast message and retaining a preset number of broadcast messages after enqueuing; or
移除所述相同的广播消息中后入队的广播消息,并保留先入队的预设数量的广播消息。The broadcast message of the enqueue after the same broadcast message is removed, and the preset number of broadcast messages of the first queue are reserved.
在一些实施例中,所述方法还包括:In some embodiments, the method further includes:
在接收到广播消息发送请求后,识别在当前的广播消息队列中是否有与所述广播消息发送请求所请求发送的广播消息相同的广播消息;After receiving the broadcast message sending request, identifying whether there is a broadcast message in the current broadcast message queue that is the same as the broadcast message requested by the broadcast message sending request;
如果有,则将所述广播消息发送请求所请求发送的广播消息替换所述当前的广播消息队列中的相同的广播消息。If so, replace the broadcast message requested by the broadcast message request with the same broadcast message in the current broadcast message queue.
在一些实施例中,在接收到广播消息发送请求后,识别在当前的广播消息队列中是否有与所述广播消息发送请求所请求发送的广播消息相同的广播消息之后,还包括:In some embodiments, after receiving the broadcast message sending request, after identifying whether there is a broadcast message in the current broadcast message queue that is the same as the broadcast message requested by the broadcast message sending request, the method further includes:
如果没有,则将所述广播消息发送请求所请求发送的广播消息加入当前广播消息队列中。If not, the broadcast message requested by the broadcast message sending request is added to the current broadcast message queue.
在一些实施例中,所述负载信息包括处理器使用率、内存使用率、输入输出系统资源的占有率中的至少一种。In some embodiments, the load information includes at least one of processor usage, memory usage, and occupancy of input and output system resources.
图1是本申请实施例提供的一种调整广播消息队列的方法的流程图,本实施例可适用于对广播消息发送队列进行调整的情况,该方法可以由调整广播消息队列的装置来执行,其中该装置可由软件和/或硬件实现,该装置可集成于终端中,终端可以是智能手机、平板电脑等,该方法包括:1 is a flowchart of a method for adjusting a broadcast message queue according to an embodiment of the present disclosure. This embodiment is applicable to a situation in which a broadcast message transmission queue is adjusted. The method may be performed by a device that adjusts a broadcast message queue. The device may be implemented by software and/or hardware, and the device may be integrated into the terminal. The terminal may be a smart phone, a tablet computer, etc., and the method includes:
步骤101,获取当前负载信息。Step 101: Acquire current load information.
其中,负载信息可以理解成是能够表征终端运行情况的参数信息,例如可以是当前运行程序的数量多少、已加载的应用数量、CPU的使用情况,也可以是已占用内存的大小等。负载信息可体现终端负载的高低情况,而负载的高或低是相对于CPU的计算能力来说的。负载太高会导致很多进程拖慢,新打开一个进程需要很久,导致系统卡顿,因此一般建议不要使负载过高。The load information can be understood as parameter information that can describe the running status of the terminal, for example, the number of currently running programs, the number of loaded applications, the usage of the CPU, or the size of the occupied memory. The load information can reflect the level of the terminal load, and the high or low load is relative to the computing power of the CPU. Too high a load will cause many processes to slow down. It takes a long time to open a new process, causing the system to get stuck. Therefore, it is generally recommended not to make the load too high.
在一些实施例中,所述负载信息包括下述至少一种:CPU(处理器)使用率、内存使用率和IO(输入输出系统)资源的占有率。In some embodiments, the load information includes at least one of: CPU (processor) usage, memory usage, and occupancy of IO (input and output system) resources.
其中,CPU使用率是运行的程序占用的CPU资源,表示终端在某个时间点的运行程序的情况。使用率越高,说明终端在这个时间上运行的程序越多。内存使用率,也称内存占用率,指的是此进程所开销的内存。文件IO(Input-Output,输入输出)可以称之为不带缓存的IO,不带缓存指的是每个读写操作都调用内核中的一个系统调用。CPU使用率、内存使用率和文件IO资源的占有率中任意一个或多个的大小,都可以表征负载的高低。Among them, the CPU usage rate is the CPU resource occupied by the running program, indicating the case where the terminal runs the program at a certain point in time. The higher the usage rate, the more programs the terminal is running at this time. Memory usage, also known as memory usage, refers to the memory overhead of this process. File IO (Input-Output, input and output) can be called IO without cache, without cache means that each read and write operation calls a system call in the kernel. The size of any one or more of CPU usage, memory usage, and file IO resource occupancy can be used to characterize the level of the load.
步骤102,根据所述当前负载信息,判断终端当前是否处于繁忙状态。Step 102: Determine, according to the current load information, whether the terminal is currently in a busy state.
其中,可以根据当前负载信息判断当前的CPU负载大小,可以按照预置的算法识别终端当前是否繁忙。The current CPU load size may be determined according to the current load information, and the preset algorithm may be used to identify whether the terminal is currently busy.
步骤103,如果终端当前处于繁忙状态,则对广播消息队列中相同的广播发送者发送的相同的广播消息进行删减处理。 Step 103: If the terminal is currently in a busy state, perform the subtraction process on the same broadcast message sent by the same broadcast sender in the broadcast message queue.
其中,广播机制本质上是在移动终端的操作系统中一种组件间的通讯方式,是一种广泛运用在应用程序之间传输消息的机制。例如在移动终端的安卓系统下,有一些操作完成以后,会发送广播消息。广播消息可以是操作系统中产生的各种各样的事件消息数据。比如说发出一条短信或打出一个电话,都会发送广播,当某个应用程序接收了这个广播时,就可以做出相应的处理。广播机制包括三个基本要素:广播、广播接收器以及意图内容,其中,广播用于发送广播,广播接收器用于接收广播,广播接收者可以通过调用函数告诉系统对什么类型的广播感兴趣,并且向系统注册广播接收器,便具备接收该类型的广播消息的权限。意图内容用于保存广播相关信息的媒介。Among them, the broadcast mechanism is essentially a communication method between components in the operating system of the mobile terminal, and is a mechanism widely used to transmit messages between applications. For example, under the Android system of the mobile terminal, 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 mechanism includes three basic elements: a broadcast, a broadcast receiver, and an intended content, wherein the broadcast is used to transmit the broadcast, the broadcast receiver is used to receive the broadcast, and the broadcast receiver can tell the system what type of broadcast is interested by calling the function, and Registering a broadcast receiver with the system has the right to receive broadcast messages of this type. Intent content is used to store media related to broadcast related information.
在Android系统中,ActivityManagerService是Android系统的广播机制中的广播中心,负责系统中所有广播的注册和发布操作,其中,广播的注册是指应用程序把广播接收器注册到ActivityManagerService的过程。广播的发布包括广播发送者将广播发送到ActivityManagerService,ActivityManagerService接收到这个广播以后在自己的注册中心查看有哪些广播接收器订阅了该广播,然后把这个广播逐一发送到这些广播接收器中。In the Android system, ActivityManagerService is the broadcast center in the broadcast mechanism of the Android system, and is responsible for the registration and release operations of all broadcasts in the system. The registration of the broadcast refers to the process in which the application registers the broadcast receiver to the 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.
Android系统的广播跟传统意义中的电台广播有一些相似之处,之所以称之为广播,是因为发送方只负责发送,并不关心接收方是否接到消息数据,也不关心接收方是如何处理消息数据的。另外,广播消息既可以被不止一个应用程序接收,也可能不被任何应用程序所接收。The broadcast of Android system has some similarities with the radio broadcast in the traditional sense. It is called broadcast because the sender is only responsible for sending, and does not care whether the receiver receives the message data or how the receiver is concerned. Processing message data. In addition, broadcast messages can be received by more than one application or not by any application.
广播消息队列是指广播消息按照广播时间的先后顺序依次入队,形成的队列的形式。广播消息队列可以是默认广播队列,也可以是第三方应用广播队列。示例性地,广播消息队列可以是包括亮屏广播、熄屏广播、解锁广播、网络状态变化广播、蓝牙状态变化广播、切换语言广播、切换主题广播等系统广播构成的队列,也可以是由第三方应用软件发出的广播构成的队列。可以在建立广播消息时对广播消息进行命名,相同的广播消息可以是名称相同的广播消息。示例性地,名称均为“亮屏广播”的多个广播消息可以称为相同的广播消息。在一段时间内,同一个广播发送者可能会发送多个广播消息,这些广播消息中有一部分是相同的。当终端繁忙时,可以对广播消息队列中相同的广播发送者发送的相同的广播消息进行删减处理,可以减少广播堵塞。示例性的,以切换语言广播为例,相同的广播发送者陆续发送了多次切换语言广播。当终端繁忙时,可以对该广播消息进行处理,例如可以将其中的一部分切换语言广播信息予以删减,也可以只保留广播消息队列中最新入队的适量切换语言广播消息,减少广播的堵塞。若终端不繁忙,则可以不做其他处理。按照广播消息队列中的入队顺序,对广播消息进行依次分发。A broadcast message queue is a form in which a broadcast message is sequentially enqueued in the order of broadcast time. The broadcast message queue can be either the default broadcast queue or a third-party application broadcast queue. Illustratively, the broadcast message queue may be a queue consisting of a system broadcast including a bright screen broadcast, a blackout broadcast, an unlock broadcast, a network state change broadcast, a Bluetooth state change broadcast, a switched language broadcast, a switching theme broadcast, or the like. A queue of broadcasts sent by the three-party application. The broadcast message can be named when the broadcast message is established, and the same broadcast message can be a broadcast message with the same name. Illustratively, multiple broadcast messages whose names are "bright screen broadcasts" may be referred to as the same broadcast message. For a period of time, the same broadcast sender may send multiple broadcast messages, some of which are the same. When the terminal is busy, the same broadcast message sent by the same broadcast sender in the broadcast message queue can be deleted, which can reduce the broadcast congestion. Illustratively, in the case of a switched language broadcast, the same broadcast sender successively transmits a plurality of switched language broadcasts. When the terminal is busy, the broadcast message may be processed. For example, some of the switched language broadcast information may be deleted, or only the appropriate amount of the switched language broadcast message in the broadcast message queue may be reserved, thereby reducing the congestion of the broadcast. If the terminal is not busy, you can do nothing else. The broadcast messages are sequentially distributed according to the enqueue order in the broadcast message queue.
本申请实施例通过根据负载信息判断终端是否处于繁忙状态,并对繁忙状态下的广播消息队列中相同的广播发送者发送的相同的广播消息进行删减处理,可以避免广播消息阻塞,避免系统出现卡顿现象,减少了系统开销。The embodiment of the present application can determine whether the terminal is in a busy state according to the load information, and perform the process of deleting the same broadcast message sent by the same broadcast sender in the broadcast message queue in the busy state, thereby preventing the broadcast message from being blocked and avoiding the system from appearing. The Caton phenomenon reduces system overhead.
图2是本申请一个实施例提供的一种调整广播消息队列的方法的流程图,本实施例的方法包括:2 is a flowchart of a method for adjusting a broadcast message queue according to an embodiment of the present disclosure. The method in this embodiment includes:
步骤201,获取当前负载信息。Step 201: Acquire current load information.
步骤202,当所述当前负载信息满足预设条件时,确定终端当前处于繁忙状态。Step 202: When the current load information meets a preset condition, determine that the terminal is currently in a busy state.
其中,预设条件可以根据终端CPU的性能进行的一些参数设定,预设条件可对至少一种负载信息进行限定,例如预设条件可以是CPU使用率高于80%,也可以是CPU使用率高于80%且内存使用率高于80%,或者可以是CPU使用率高于75%、内存使用率高于80%且文件IO资源的占有率高于85%等。The preset condition may be set according to some parameters of the performance of the terminal CPU, and the preset condition may limit at least one type of load information, for example, the preset condition may be that the CPU usage rate is higher than 80%, or may be used by the CPU. The rate is higher than 80% and the memory usage is higher than 80%, or the CPU usage is higher than 75%, the memory usage is higher than 80%, and the file IO resource occupancy rate is higher than 85%.
步骤203,对广播消息队列中相同的广播发送者发送的相同的广播消息进行删减处理。Step 203: Perform the subtraction process on the same broadcast message sent by the same broadcast sender in the broadcast message queue.
本申请实施例通过设定负载信息预设条件,判断终端是否处于繁忙状态,可简单准确判断终端的状态,并对繁忙状态下的广播消息队列中相同的广播发送者发送的相同的广播消息进行删减处理,可以避免广播消息阻塞,避免系统出现卡顿现象,减少了系统开销。The embodiment of the present application determines whether the terminal is in a busy state by setting a preset condition of the load information, and can simply and accurately determine the state of the terminal, and perform the same broadcast message sent by the same broadcast sender in the broadcast message queue in the busy state. Decrement processing can avoid blocking broadcast messages, avoid system stalls, and reduce system overhead.
图3是本申请一个实施例提供的一种调整广播消息队列的方法的流程图,本实施例的方法包括:FIG. 3 is a flowchart of a method for adjusting a broadcast message queue according to an embodiment of the present disclosure. The method in this embodiment includes:
步骤301,获取当前负载信息。Step 301: Acquire current load information.
步骤302,根据所述当前负载信息,判断终端当前是否处于繁忙状态。Step 302: Determine, according to the current load information, whether the terminal is currently in a busy state.
步骤303,如果终端当前处于繁忙状态,则统计广播消息队列中相同的广播发送者发送的相同的广播消息。Step 303: If the terminal is currently in a busy state, the same broadcast message sent by the same broadcast sender in the broadcast message queue is counted.
其中,可根据广播消息确定信息来源,即确定广播发送者。例如可以通过获取广播消息的相关标识或相关配置参数的方式确定广播发送者。可根据广播消息的特征确定广播消息类型,并对相同的广播消息进行统计。Wherein, the source of the information may be determined according to the broadcast message, that is, the broadcast sender is determined. For example, the broadcast sender can be determined by obtaining the relevant identifier of the broadcast message or related configuration parameters. The broadcast message type can be determined according to the characteristics of the broadcast message, and the same broadcast message can be counted.
示例性的,在Android系统中,可以通过ActivityManagerService确定广播消息的广播发送者。Exemplarily, in the Android system, the broadcast sender of the broadcast message can be determined by the ActivityManagerService.
步骤304,根据所述相同的广播消息的入队顺序,保留预设数量的广播消息。Step 304: Reserve a preset number of broadcast messages according to the enqueue sequence of the same broadcast message.
其中,预设数量可根据终端的响应速度等进行设定,还可以根据当前广播消息队列的长度进行确定。根据相同的广播消息的入队顺序,将预设数量的广播消息保留,删减其余广播消息,以达到减少广播消息堵塞,避免系统出现卡顿现象。The preset number may be set according to the response speed of the terminal, or may be determined according to the length of the current broadcast message queue. According to the enqueue sequence of the same broadcast message, the preset number of broadcast messages are reserved, and the remaining broadcast messages are deleted, so as to reduce the congestion of the broadcast message and avoid the phenomenon of stuttering in the system.
在一些实施例中,根据所述相同的广播消息的入队顺序,保留预设数量的广播消息,包括:移除所述相同的广播消息中先入队的广播消息,并保留后入队的预设数量的广播消息;或者移除所述相同的广播消息中后入队的广播消息,并保留先入队的预设数量的广播消息。In some embodiments, the preset number of broadcast messages are retained according to the enqueue sequence of the same broadcast message, including: removing the first broadcast message in the same broadcast message, and retaining the enqueue after the queue a preset number of broadcast messages; or removing broadcast messages that are enqueued in the same broadcast message and retaining a preset number of broadcast messages that are queued first.
其中,对于相同的广播消息,按照广播消息队列中入队的先后顺序,保留后入队的预设数量的广播消息,其他广播消息移除。示例性地,假如预设数量为2,统计得到广播发送者为应用A发送的相同的广播消息的数量为4,按照入队顺序,依次命名为A1、A2、A3及A4,此时保留后入队的2个广播消息,即A3和A4,将A3和A4之前的所有此类型的广播消息均移除。通过根据负载信息判断终端是否处于繁忙状态,并统计繁忙状态下的广播消息队列中相同的广播发送者发送的相同的广播消息,移除先入队的广播消息,保留后入队的预设数量的广播消息,可以实现减少广播消息的数量,避免广播消息阻塞,避免系统出现卡顿现象,减少了系统开销。同时保证后入队的广播消息顺利分发,避免了新广播消息的丢失。For the same broadcast message, according to the order of enqueue in the broadcast message queue, the preset number of broadcast messages that are enqueued after the reservation are retained, and other broadcast messages are removed. Exemplarily, if the preset number is 2, the number of the same broadcast messages sent by the broadcast sender to the application A is 4, and the A1, A2, A3, and A4 are sequentially named according to the enqueue order. The two broadcast messages enqueued, namely A3 and A4, remove all broadcast messages of this type before A3 and A4. If the terminal is in a busy state according to the load information, and the same broadcast message sent by the same broadcast sender in the broadcast message queue in the busy state is counted, the broadcast message of the first-in queue is removed, and the preset number of the queue is retained. Broadcast messages can reduce the number of broadcast messages, avoid blocking broadcast messages, avoid system stalls, and reduce system overhead. At the same time, it is ensured that the broadcast messages of the incoming queues are smoothly distributed, and the loss of new broadcast messages is avoided.
对于相同的广播消息,按照广播消息的队列中入队的先后顺序,保留先入队的预设数量的广播消息,其他广播消息移除。示例性地,假如预设数量为2,统计得到广播发送者为应用A发送的相同的广播消息的数量为4,按照入队顺序,依次命名为A1、A2、A3及A4,此时保留先入队的2个广播消息,即A1和A2,将A1和A2之后的所有此类型的广播消息均去掉。通过根据负载信息判断终端是否处于繁忙状态,并统计繁忙状态下的广播消息队列中相同的广播发送者发送的相同的广播消息,移除后入队的广播消息,保留先入队的预设数量的广播消息,可以实现减少广播消息的数量,避免广播消息阻塞,避免系统出现卡顿现象,减少了系统开销。同时保证先入队的广播消息顺利分发,避免了等待时间较长的先入队广播消息的丢失。For the same broadcast message, the preset number of broadcast messages of the first queue are reserved according to the order of enqueue in the queue of the broadcast message, and other broadcast messages are removed. Exemplarily, if the preset number is 2, the number of the same broadcast messages sent by the broadcast sender for the application A is 4, and the A1, A2, A3, and A4 are sequentially named according to the enqueue order. The two broadcast messages enqueued, namely A1 and A2, remove all broadcast messages of this type after A1 and A2. By determining whether the terminal is in a busy state according to the load information, and counting the same broadcast message sent by the same broadcast sender in the broadcast message queue in the busy state, removing the broadcast message after entering the queue, and retaining the preset number of the first queue. Broadcast messages can reduce the number of broadcast messages, avoid blocking broadcast messages, avoid system stalls, and reduce system overhead. At the same time, it ensures that the broadcast messages of the first-in queue are distributed smoothly, and the loss of the first-entry broadcast messages with long waiting time is avoided.
图4是本申请一个实施例提供的一种调整广播消息队列的方法的流程图,本实施例的方法包括:FIG. 4 is a flowchart of a method for adjusting a broadcast message queue according to an embodiment of the present disclosure. The method in this embodiment includes:
步骤401,获取当前负载信息。Step 401: Acquire current load information.
步骤402,根据所述当前负载信息,判断终端当前是否处于繁忙状态。Step 402: Determine, according to the current load information, whether the terminal is currently in a busy state.
步骤403,如果终端当前处于繁忙状态,则对广播消息队列中相同的广播发送者发送的相同的广播消息进行删减处理。Step 403: If the terminal is currently in a busy state, perform the subtraction process on the same broadcast message sent by the same broadcast sender in the broadcast message queue.
步骤404,在接收到广播消息发送请求后,识别在当前的广播消息队列中是否有与所述广播消息发送请求所请求发送的广播消息相同的广播消息;如果是,则执行步骤405,否则执行步骤406。Step 404: After receiving the broadcast message sending request, identify whether there is a broadcast message in the current broadcast message queue that is the same as the broadcast message requested by the broadcast message sending request; if yes, execute step 405, otherwise execute Step 406.
步骤405,将所述广播消息发送请求所请求发送的广播消息替换所述当前的广播消息队列中的相同的广播消息。Step 405: Replace the broadcast message requested by the broadcast message sending request with the same broadcast message in the current broadcast message queue.
步骤406,允许所述广播消息发送请求所请求发送的广播消息进入所述当前的广播消息队列。Step 406: Allow the broadcast message requested by the broadcast message sending request to enter the current broadcast message queue.
其中,当前的广播消息队列可以理解为以当前时间点为时间节点,在时间节点之前,由所有未分发的广播消息构成的广播消息队列。当接收到新的广播消息发送请求后,将广播消息与该广播消息未接收前的广播消息队列中的广播消息进行匹配。若当前的广播消息队列中包含与该广播消息相同的广播消息时,可以用该广播消息替换已有的相同广播消息,若没有,则将该广播消息加入到广播消息队列中,等待后续的处理。The current broadcast message queue can be understood as a broadcast message queue composed of all undistributed broadcast messages with the current time point as the time node and before the time node. After receiving a new broadcast message transmission request, the broadcast message is matched with the broadcast message in the broadcast message queue before the broadcast message is not received. If the current broadcast message queue includes the same broadcast message as the broadcast message, the broadcast message may be used to replace the existing same broadcast message. If not, the broadcast message is added to the broadcast message queue, waiting for subsequent processing. .
需要说明的是,本申请实施例中,上述判断终端是否繁忙及在终端繁忙时对广播消息队里中相同的广播发送者发送的相同广播消息进行删减处理的过程,与对新接收到的广播消息处理的过程之间的先后顺序不做限定,即步骤401-403与步骤404-406之间不存在严格的先后顺序,无论顺序如何,均属于本申请实施例的保护范围。It should be noted that, in the embodiment of the present application, the foregoing determining whether the terminal is busy and performing the process of deleting the same broadcast message sent by the same broadcast sender in the broadcast message team when the terminal is busy, and the newly received The sequence of the process of the broadcast message processing is not limited, that is, there is no strict sequence between the steps 401-403 and the steps 404-406, and the order of protection of the embodiment of the present application is not limited.
本申请实施例通过根据负载信息判断终端是否处于繁忙状态,并对繁忙状态下的广播消息队列中相同的广播发送者发送的相同的广播消息进行删减处理,可以避免广播消息阻塞,避免系统出现卡顿现象,减少了系统开销。同时,对新接收的广播消息进行处理,既可以避免由于相同广播消息的频繁发送给系统带来较大的开销,又不会造成某种类型广播消息的丢失,为有序地广播消息分发提供了保障。The embodiment of the present application can determine whether the terminal is in a busy state according to the load information, and perform the process of deleting the same broadcast message sent by the same broadcast sender in the broadcast message queue in the busy state, thereby preventing the broadcast message from being blocked and avoiding the system from appearing. The Caton phenomenon reduces system overhead. At the same time, the newly received broadcast message is processed, which can avoid the large overhead caused by the frequent sending of the same broadcast message to the system, and does not cause loss of a certain type of broadcast message, and provides an orderly broadcast message distribution. The guarantee.
本申请实施例提供一种调整广播消息队列的装置,所述装置包括:An embodiment of the present application provides an apparatus for adjusting a broadcast message queue, where the apparatus includes:
信息获取模块,用于获取当前负载信息;An information acquiring module, configured to acquire current load information;
繁忙状态判断模块,用于根据所述当前负载信息,判断终端当前是否处于繁忙状态;The busy state determining module is configured to determine, according to the current load information, whether the terminal is currently in a busy state;
消息处理模块,用于如果终端当前处于繁忙状态,则对广播消息队列中相同的广播发送者发送的相同的广播消息进行删减处理。The message processing module is configured to perform a subtraction process on the same broadcast message sent by the same broadcast sender in the broadcast message queue if the terminal is currently in a busy state.
在一些实施例中,所述繁忙状态判断模块包括:In some embodiments, the busy state determination module includes:
繁忙状态确定单元,用于当所述当前负载信息满足预设条件时,确定终端当前处于繁忙状态。The busy state determining unit is configured to determine that the terminal is currently in a busy state when the current load information meets a preset condition.
在一些实施例中,所述消息处理模块包括:In some embodiments, the message processing module includes:
消息统计单元,用于统计广播消息队列中相同的广播发送者发送的相同的广播消息;a message statistics unit, configured to count the same broadcast message sent by the same broadcast sender in the broadcast message queue;
消息保留单元,用于根据所述相同的广播消息的入队顺序,保留预设数量的广播消息。And a message retention unit, configured to reserve a preset number of broadcast messages according to the enqueue order of the same broadcast message.
在一些实施例中,所述消息保留单元具体用于:In some embodiments, the message retention unit is specifically configured to:
移除所述相同的广播消息中先入队的广播消息,并保留后入队的预设数量的广播消息;或者Removing the first broadcast message in the same broadcast message and retaining a preset number of broadcast messages after enqueuing; or
移除所述相同的广播消息中后入队的广播消息,并保留先入队的预设数量的广播消息。The broadcast message of the enqueue after the same broadcast message is removed, and the preset number of broadcast messages of the first queue are reserved.
在一些实施例中,所述装置还包括:In some embodiments, the apparatus further includes:
消息识别模块,用于在接收到广播消息发送请求后,识别在当前的广播消息队列中是否有与所述广播消息发送请求所请求发送的广播消息相同的广播消息;a message identifying module, configured to: after receiving the broadcast message sending request, identify whether there is a broadcast message in the current broadcast message queue that is the same as the broadcast message requested by the broadcast message sending request;
消息入队处理模块,用于如果有,则将所述广播消息发送请求所请求发送的广播消息替换所述当前的广播消息队列中的相同的广播消息。And a message enqueue processing module, if yes, replacing the broadcast message requested by the broadcast message sending request with the same broadcast message in the current broadcast message queue.
在一些实施例中,所述消息入队处理模块还用于:In some embodiments, the message enqueue processing module is further configured to:
如果没有,则将所述广播消息发送请求所请求发送的广播消息加入当前广播消息队列中。If not, the broadcast message requested by the broadcast message sending request is added to the current broadcast message queue.
在一些实施例中,所述负载信息包括处理器使用率、内存使用率、输入输出系统资源的占有率中的至少一种。In some embodiments, the load information includes at least one of processor usage, memory usage, and occupancy of input and output system resources.
图5是本申请实施例提供的一种调整广播消息队列的装置的结构框图,该装置可由软件和/或硬件实现,一般可集成在终端中,可通过执行调整广播消息队列的方法来对终端中的广播消息进行控制。如图5所示,该装置包括信息获取模块501、繁忙状态判断模块502及消息处理模块503。FIG. 5 is a structural block diagram of an apparatus for adjusting a broadcast message queue according to an embodiment of the present disclosure. The apparatus may be implemented by software and/or hardware, and may be integrated into a terminal, and may perform a method for adjusting a broadcast message queue to a terminal. The broadcast message in the control is controlled. As shown in FIG. 5, the device includes an information acquisition module 501, a busy state determination module 502, and a message processing module 503.
信息获取模块501,用于获取当前负载信息;The information obtaining module 501 is configured to acquire current load information.
繁忙状态判断模块502,用于根据所述当前负载信息,判断终端当前是否处于繁忙状态;The busy state determining module 502 is configured to determine, according to the current load information, whether the terminal is currently in a busy state;
消息处理模块503,用于如果终端当前处于繁忙状态,则对广播消息队列中相同的广播发送者发送的相同的广播消息进行删减处理。The message processing module 503 is configured to perform a subtraction process on the same broadcast message sent by the same broadcast sender in the broadcast message queue if the terminal is currently in a busy state.
本申请实施例提供的调整广播消息队列的装置,通过根据负载信息判断终端是否处于繁忙状态,并对繁忙状态下的广播消息队列中相同的广播发送者发送的相同的广播消息进行删减处理,可以避免广播消息阻塞,避免系统出现卡顿现象,减少了系统开销。The apparatus for adjusting a broadcast message queue provided by the embodiment of the present application determines whether the terminal is in a busy state according to the load information, and performs the deletion processing on the same broadcast message sent by the same broadcast sender in the broadcast message queue in the busy state. It can avoid blocking broadcast messages, avoid system stalls and reduce system overhead.
在一些实施例中,所述繁忙状态判断模块502包括:In some embodiments, the busy state determination module 502 includes:
繁忙状态确定单元,用于当所述当前负载信息满足预设条件时,确定终端当前处于繁忙状态。The busy state determining unit is configured to determine that the terminal is currently in a busy state when the current load information meets a preset condition.
在一些实施例中,所述消息处理模块503包括:In some embodiments, the message processing module 503 includes:
消息统计单元,用于统计广播消息队列中相同的广播发送者发送的相同的广播消息;a message statistics unit, configured to count the same broadcast message sent by the same broadcast sender in the broadcast message queue;
消息保留单元,用于根据所述相同的广播消息的入队顺序,保留预设数量的广播消息。And a message retention unit, configured to reserve a preset number of broadcast messages according to the enqueue order of the same broadcast message.
在一些实施例中,所述消息保留单元具体用于:In some embodiments, the message retention unit is specifically configured to:
移除所述相同的广播消息中先入队的广播消息,并保留后入队的预设数量的广播消息;或者Removing the first broadcast message in the same broadcast message and retaining a preset number of broadcast messages after enqueuing; or
移除所述相同的广播消息中后入队的广播消息,并保留先入队的预设数量的广播消息。The broadcast message of the enqueue after the same broadcast message is removed, and the preset number of broadcast messages of the first queue are reserved.
在一些实施例中,该装置还包括:In some embodiments, the apparatus further comprises:
消息识别模块,用于在接收到广播消息发送请求后,识别在当前的广播消息队列中是否有与所述广播消息发送请求所请求发送的广播消息相同的广播消息;a message identifying module, configured to: after receiving the broadcast message sending request, identify whether there is a broadcast message in the current broadcast message queue that is the same as the broadcast message requested by the broadcast message sending request;
消息入队处理模块,用于如果有,则将所述广播消息发送请求所请求发送的广播消息替换所述当前的广播消息队列中的相同的广播消息。And a message enqueue processing module, if yes, replacing the broadcast message requested by the broadcast message sending request with the same broadcast message in the current broadcast message queue.
在一些实施例中,所述负载信息包括下述至少一种:CPU使用率、内存使用率和文件IO资源的占有率。In some embodiments, the load information includes at least one of the following: CPU usage, memory usage, and occupancy of file IO resources.
上述调整广播消息队列的装置可执行本申请任意实施例所提供的调整广播消息队列的方法,具备执行的调整广播消息队列的方法相应的功能模块和有益效果。未在本实施例中详尽描述的技术细节,可参见本申请任意实施例提供的方法。The device for adjusting the broadcast message queue can perform the method for adjusting the broadcast message queue provided by any embodiment of the present application, and has the corresponding functional modules and beneficial effects of the method for adjusting the broadcast message queue. For technical details that are not described in detail in this embodiment, reference may be made to the method provided by any embodiment of the present application.
本申请实施例还提供了一种终端,该终端可以包括本申请任意实施例提供的调整广播消息队列的装置。图6为本申请实施例提供的一种终端的结构示意图,如图7所示,该终端可以包括:壳体(图中未示出)、存储器601、中央处理器(Central Processing Unit,CPU)602(又称处理器,以下简称CPU)、存储在存储器601上并可在处理器602上运行的计算机程序、电路板(图中未示出)和电源电路(图中未示出)。所述电路板安置在所述壳体围成的空间内部;所述CPU602和所述存储器601设置在所述电路板上;所述电源电路,用于为所述终端的各个电路或器件供电;所述存储器601,用于存储可在处理器上运行的计算机程序;所述CPU602通过读取并执行所述存储器601中存储的计算机程序。The embodiment of the present application further provides a terminal, which may include the apparatus for adjusting a broadcast message queue provided by any embodiment of the present application. FIG. 6 is a schematic structural diagram of a terminal according to an embodiment of the present disclosure. As shown in FIG. 7, the terminal may include: a casing (not shown), a memory 601, and a central processing unit (Central). Processing Unit, CPU) 602 (also referred to as a processor, hereinafter referred to as CPU), a computer program stored on the memory 601 and operable on the processor 602, a circuit board (not shown), and a power supply circuit (not shown) Out). The circuit board is disposed inside a space enclosed by the casing; the CPU 602 and the memory 601 are disposed on the circuit board; and the power circuit is configured to supply power to each circuit or device of the terminal; The memory 601 is configured to store a computer program executable on a processor; the CPU 602 reads and executes a computer program stored in the memory 601.
该终端还包括:外设接口603、RF(Radio Frequency,射频)电路605、音频电路606、扬声器611、电源管理芯片608、输入/输出(I/O)子系统609、触摸屏612、其他输入/控制设备610以及外部端口604,这些部件通过一个或多个通信总线或信号线607来通信。The terminal further includes: a peripheral interface 603, RF (Radio) Frequency (RF) circuit 605, audio circuit 606, speaker 611, power management chip 608, input/output (I/O) subsystem 609, touch screen 612, other input/control devices 610, and external port 604, these components are passed through one or A plurality of communication buses or signal lines 607 are in communication.
应该理解的是,图示终端600仅仅是终端的一个范例,并且终端600可以具有比图中所示出的更多的或者更少的部件,可以组合两个或更多的部件,或者可以具有不同的部件配置。图中所示出的各种部件可以在包括一个或多个信号处理和/或专用集成电路在内的硬件、软件、或硬件和软件的组合中实现。It should be understood that the illustrated terminal 600 is merely one example of a terminal, and that the terminal 600 may have more or fewer components than those shown in the figures, two or more components may be combined, or may have Different component configurations. The various components shown in the figures can be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.
下面就本申请实施例提供的用于调整广播消息队列的终端进行详细的描述,该终端以手机为例。The following is a detailed description of a terminal for adjusting a broadcast message queue provided by an embodiment of the present application. The terminal uses a mobile phone as an example.
存储器601,所述存储器601可以被CPU602、外设接口603等访问,所述存储器601可以包括高速随机存取存储器,还可以包括非易失性存储器,例如一个或多个磁盘存储器件、闪存器件、或其他易失性固态存储器件。 The memory 601 can be accessed by the CPU 602, the peripheral interface 603, etc., and the memory 601 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.
外设接口603,所述外设接口603可以将设备的输入和输出外设连接到CPU602和存储器601。Peripheral interface 603, which can connect the input and output peripherals of the device to CPU 602 and memory 601.
I/O子系统609,所述I/O子系统609可以将设备上的输入输出外设,例如触摸屏612和其他输入/控制设备610,连接到外设接口603。I/O子系统609可以包括显示控制器6091和用于控制其他输入/控制设备610的一个或多个输入控制器6092。其中,一个或多个输入控制器6092从其他输入/控制设备610接收电信号或者向其他输入/控制设备610发送电信号,其他输入/控制设备610可以包括物理按钮(按压按钮、摇臂按钮等)、拨号盘、滑动开关、操纵杆、点击滚轮。值得说明的是,输入控制器6092可以与以下任一个连接:键盘、红外端口、USB接口以及诸如鼠标的指示设备。I/O subsystem 609, which can connect input and output peripherals on the device, such as touch screen 612 and other input/control devices 610, to peripheral interface 603. I/O subsystem 609 can include display controller 6091 and one or more input controllers 6092 for controlling other input/control devices 610. Wherein, one or more input controllers 6092 receive electrical signals from other input/control devices 610 or transmit electrical signals to other input/control devices 610, and other input/control devices 610 may include physical buttons (press buttons, rocker buttons, etc.) ), dial, slide switch, joystick, click wheel. It is worth noting that the input controller 6092 can be connected to any of the following: a keyboard, an infrared port, a USB interface, and a pointing device such as a mouse.
触摸屏612,所述触摸屏612是用户终端与用户之间的输入接口和输出接口,将可视输出显示给用户,可视输出可以包括图形、文本、图标、视频等。The touch screen 612 is an input interface and an output interface between the user terminal and the user, and displays the visual output to the user. The visual output may include graphics, text, icons, videos, and the like.
I/O子系统609中的显示控制器6091从触摸屏612接收电信号或者向触摸屏612发送电信号。触摸屏612检测触摸屏上的接触,显示控制器6091将检测到的接触转换为与显示在触摸屏612上的用户界面对象的交互,即实现人机交互,显示在触摸屏612上的用户界面对象可以是运行游戏的图标、联网到相应网络的图标等。值得说明的是,设备还可以包括光鼠,光鼠是不显示可视输出的触摸敏感表面,或者是由触摸屏形成的触摸敏感表面的延伸。Display controller 6091 in I/O subsystem 609 receives an electrical signal from touch screen 612 or an electrical signal to touch screen 612. The touch screen 612 detects the contact on the touch screen, and the display controller 6091 converts the detected contact into an interaction with the user interface object displayed on the touch screen 612, ie, realizes human-computer interaction, and the user interface object displayed on the touch screen 612 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电路605,主要用于建立手机与无线网络(即网络侧)的通信,实现手机与无线网络的数据接收和发送。例如收发短信息、电子邮件等。具体地,RF电路605接收并发送RF信号,RF信号也称为电磁信号,RF电路605将电信号转换为电磁信号或将电磁信号转换为电信号,并且通过该电磁信号与通信网络以及其他设备进行通信。RF电路605可以包括用于执行这些功能的已知电路,其包括但不限于天线系统、RF收发机、一个或多个放大器、调谐器、一个或多个振荡器、数字信号处理器、CODEC(COder-DECoder,编译码器)芯片组、用户标识模块(Subscriber Identity Module,SIM)等等。The RF circuit 605 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 605 receives and transmits an RF signal, which is also referred to as an electromagnetic signal, and the RF circuit 605 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 605 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.
音频电路606,主要用于从外设接口603接收音频数据,将该音频数据转换为电信号,并且将该电信号发送给扬声器611。The audio circuit 606 is mainly used to receive audio data from the peripheral interface 603, convert the audio data into an electrical signal, and transmit the electrical signal to the speaker 611.
扬声器611,用于将手机通过RF电路605从无线网络接收的语音信号,还原为声音并向用户播放该声音。The speaker 611 is configured to restore the voice signal received by the mobile phone from the wireless network through the RF circuit 605 to sound and play the sound to the user.
电源管理芯片608,用于为CPU602、I/O子系统及外设接口所连接的硬件进行供电及电源管理。The power management chip 608 is used for power supply and power management of the hardware connected to the CPU 602, the I/O subsystem, and the peripheral interface.
本申请实施例提供的CPU602在执行所述存储器601中存储的计算机程序时实现以下步骤:The CPU 602 provided by the embodiment of the present application implements the following steps when executing the computer program stored in the memory 601:
获取当前负载信息;Obtain current load information;
根据所述当前负载信息,判断终端当前是否处于繁忙状态;Determining, according to the current load information, whether the terminal is currently in a busy state;
如果终端当前处于繁忙状态,则对广播消息队列中相同的广播发送者发送的相同的广播消息进行删减处理。If the terminal is currently in a busy state, the same broadcast message sent by the same broadcast sender in the broadcast message queue is subjected to the subtraction process.
上述终端可执行本申请任意实施例所提供的调整广播消息队列的方法,具备执行任意实施例所提供的调整广播消息队列的方法相应的功能模块和有益效果。The foregoing terminal can perform the method for adjusting the broadcast message queue provided by any embodiment of the present application, and has the corresponding functional modules and beneficial effects of performing the method for adjusting the broadcast message queue provided by any embodiment.
本申请实施例还提供一种存储介质,该存储介质中存储有计算机程序,当该计算机程序在计算机上运行时,该计算机执行上述任一实施例所述的调整广播消息队列的方法。The embodiment of the present application further provides a storage medium, where the computer program stores a computer program, and when the computer program runs on a computer, the computer executes the method for adjusting a broadcast message queue according to any one of the foregoing embodiments.
需要说明的是,本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于计算机可读存储介质中,该存储介质可以包括但不限于:只读存储器(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 instructing related hardware, and the program can be stored in a computer readable storage medium. Storage media may include, but is not limited to, read only memory (ROM, Read) Only Memory), Random Access Memory (RAM), disk or optical disk.
注意,上述仅为本申请的较佳实施例及所运用技术原理。本领域技术人员会理解,本申请不限于这里所述的特定实施例,对本领域技术人员来说能够进行各种明显的变化、重新调整和替代而不会脱离本申请的保护范围。因此,虽然通过以上实施例对本申请进行了较为详细的说明,但是本申请不仅仅限于以上实施例,在不脱离本申请构思的情况下,还可以包括更多其他等效实施例,而本申请的范围由所附的权利要求范围决定。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 adjusting a broadcast message queue, wherein the method includes:
    获取当前负载信息;Obtain current load information;
    根据所述当前负载信息,判断终端当前是否处于繁忙状态;Determining, according to the current load information, whether the terminal is currently in a busy state;
    如果终端当前处于繁忙状态,则对广播消息队列中相同的广播发送者发送的相同的广播消息进行删减处理。If the terminal is currently in a busy state, the same broadcast message sent by the same broadcast sender in the broadcast message queue is subjected to the subtraction process.
  2. 根据权利要求1所述的方法,其中,根据所述当前负载信息,判断终端当前是否处于繁忙状态包括:The method according to claim 1, wherein determining whether the terminal is currently in a busy state according to the current load information comprises:
    当所述当前负载信息满足预设条件时,确定终端当前处于繁忙状态。When the current load information meets the preset condition, it is determined that the terminal is currently in a busy state.
  3. 根据权利要求1所述的方法,其中,对广播消息队列中相同的广播发送者发送的相同的广播消息进行删减处理包括:The method of claim 1, wherein the performing the subtraction process on the same broadcast message sent by the same broadcast sender in the broadcast message queue comprises:
    统计广播消息队列中相同的广播发送者发送的相同的广播消息;Counting the same broadcast message sent by the same broadcast sender in the broadcast message queue;
    根据所述相同的广播消息的入队顺序,保留预设数量的广播消息。A preset number of broadcast messages are retained according to the enqueue order of the same broadcast message.
  4. 根据权利要求3所述的方法,其中,根据所述相同的广播消息的入队顺序,保留预设数量的广播消息,包括:The method according to claim 3, wherein the preset number of broadcast messages are retained according to the enqueue order of the same broadcast message, including:
    移除所述相同的广播消息中先入队的广播消息,并保留后入队的预设数量的广播消息;或者Removing the first broadcast message in the same broadcast message and retaining a preset number of broadcast messages after enqueuing; or
    移除所述相同的广播消息中后入队的广播消息,并保留先入队的预设数量的广播消息。The broadcast message of the enqueue after the same broadcast message is removed, and the preset number of broadcast messages of the first queue are reserved.
  5. 根据权利要求1-4任一所述的方法,其中,所述方法还包括:The method of any of claims 1-4, wherein the method further comprises:
    在接收到广播消息发送请求后,识别在当前的广播消息队列中是否有与所述广播消息发送请求所请求发送的广播消息相同的广播消息;After receiving the broadcast message sending request, identifying whether there is a broadcast message in the current broadcast message queue that is the same as the broadcast message requested by the broadcast message sending request;
    如果有,则将所述广播消息发送请求所请求发送的广播消息替换所述当前的广播消息队列中的相同的广播消息。If so, replace the broadcast message requested by the broadcast message request with the same broadcast message in the current broadcast message queue.
  6. 根据权利要求5所述的方法,其中,在接收到广播消息发送请求后,识别在当前的广播消息队列中是否有与所述广播消息发送请求所请求发送的广播消息相同的广播消息之后,还包括:The method according to claim 5, wherein after receiving the broadcast message transmission request, identifying whether there is a broadcast message identical to the broadcast message requested to be transmitted by the broadcast message transmission request in the current broadcast message queue, include:
    如果没有,则将所述广播消息发送请求所请求发送的广播消息加入当前广播消息队列中。If not, the broadcast message requested by the broadcast message sending request is added to the current broadcast message queue.
  7. 根据权利要求1-4任一所述的方法,其中,所述负载信息包括处理器使用率、内存使用率、输入输出系统资源的占有率中的至少一种。The method according to any one of claims 1 to 4, wherein the load information comprises at least one of a processor usage rate, a memory usage rate, and an occupancy rate of input and output system resources.
  8. 一种调整广播消息队列的装置,其中,所述装置包括:An apparatus for adjusting a broadcast message queue, wherein the apparatus comprises:
    信息获取模块,用于获取当前负载信息;An information acquiring module, configured to acquire current load information;
    繁忙状态判断模块,用于根据所述当前负载信息,判断终端当前是否处于繁忙状态;The busy state determining module is configured to determine, according to the current load information, whether the terminal is currently in a busy state;
    消息处理模块,用于如果终端当前处于繁忙状态,则对广播消息队列中相同的广播发送者发送的相同的广播消息进行删减处理。The message processing module is configured to perform a subtraction process on the same broadcast message sent by the same broadcast sender in the broadcast message queue if the terminal is currently in a busy state.
  9. 根据权利要求8所述的装置,其中,所述繁忙状态判断模块包括:The apparatus of claim 8, wherein the busy state determination module comprises:
    繁忙状态确定单元,用于当所述当前负载信息满足预设条件时,确定终端当前处于繁忙状态。The busy state determining unit is configured to determine that the terminal is currently in a busy state when the current load information meets a preset condition.
  10. 根据权利要求8所述的装置,其中,所述消息处理模块包括:The apparatus of claim 8 wherein said message processing module comprises:
    消息统计单元,用于统计广播消息队列中相同的广播发送者发送的相同的广播消息;a message statistics unit, configured to count the same broadcast message sent by the same broadcast sender in the broadcast message queue;
    消息保留单元,用于根据所述相同的广播消息的入队顺序,保留预设数量的广播消息。And a message retention unit, configured to reserve a preset number of broadcast messages according to the enqueue order of the same broadcast message.
  11. 根据权利要求10所述的装置,其中,所述消息保留单元具体用于:The apparatus according to claim 10, wherein the message retaining unit is specifically configured to:
    移除所述相同的广播消息中先入队的广播消息,并保留后入队的预设数量的广播消息;或者Removing the first broadcast message in the same broadcast message and retaining a preset number of broadcast messages after enqueuing; or
    移除所述相同的广播消息中后入队的广播消息,并保留先入队的预设数量的广播消息。The broadcast message of the enqueue after the same broadcast message is removed, and the preset number of broadcast messages of the first queue are reserved.
  12. 根据权利要求8-11任一所述的装置,其中,所述装置还包括:The device of any of claims 8-11, wherein the device further comprises:
    消息识别模块,用于在接收到广播消息发送请求后,识别在当前的广播消息队列中是否有与所述广播消息发送请求所请求发送的广播消息相同的广播消息;a message identifying module, configured to: after receiving the broadcast message sending request, identify whether there is a broadcast message in the current broadcast message queue that is the same as the broadcast message requested by the broadcast message sending request;
    消息入队处理模块,用于如果有,则将所述广播消息发送请求所请求发送的广播消息替换所述当前的广播消息队列中的相同的广播消息。And a message enqueue processing module, if yes, replacing the broadcast message requested by the broadcast message sending request with the same broadcast message in the current broadcast message queue.
  13. 根据权利要求12所述的装置,其中,所述消息入队处理模块还用于:The apparatus according to claim 12, wherein the message enqueue processing module is further configured to:
    如果没有,则将所述广播消息发送请求所请求发送的广播消息加入当前广播消息队列中。If not, the broadcast message requested by the broadcast message sending request is added to the current broadcast message queue.
  14. 根据权利要求8-11任一所述的装置,其中,所述负载信息包括处理器使用率、内存使用率、输入输出系统资源的占有率中的至少一种。The apparatus according to any one of claims 8-11, wherein the load information comprises at least one of a processor usage rate, a memory usage rate, and an occupancy rate of input and output system resources.
  15. 一种存储介质,其中,所述存储介质中存储有计算机程序,当所述计算机程序在计算机上运行时,所述计算机执行权利要求1-7任一所述的方法。A storage medium, wherein the storage medium stores a computer program, and when the computer program is run on a computer, the computer executes the method of any one of claims 1-7.
  16. 一种终端,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其中,所述处理器执行所述计算机程序时实现以下步骤:A terminal comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the computer program to implement the following steps:
    获取当前负载信息;Obtain current load information;
    根据所述当前负载信息,判断终端当前是否处于繁忙状态;Determining, according to the current load information, whether the terminal is currently in a busy state;
    如果终端当前处于繁忙状态,则对广播消息队列中相同的广播发送者发送的相同的广播消息进行删减处理。If the terminal is currently in a busy state, the same broadcast message sent by the same broadcast sender in the broadcast message queue is subjected to the subtraction process.
  17. 根据权利要求16所述的终端,其中,判断终端当前是否处于繁忙状态时,所述处理器执行所述计算机程序时实现以下步骤:The terminal according to claim 16, wherein the determining, when the terminal is currently in a busy state, the processor executing the computer program implements the following steps:
    当所述当前负载信息满足预设条件时,确定终端当前处于繁忙状态。When the current load information meets the preset condition, it is determined that the terminal is currently in a busy state.
  18. 根据权利要求16所述的终端,其中,对广播消息队列中相同的广播发送者发送的相同的广播消息进行删减处理时,所述处理器执行所述计算机程序时实现以下步骤:The terminal according to claim 16, wherein when the same broadcast message transmitted by the same broadcast sender in the broadcast message queue is subjected to the subtraction processing, the processor executes the computer program to implement the following steps:
    统计广播消息队列中相同的广播发送者发送的相同的广播消息;Counting the same broadcast message sent by the same broadcast sender in the broadcast message queue;
    根据所述相同的广播消息的入队顺序,保留预设数量的广播消息。A preset number of broadcast messages are retained according to the enqueue order of the same broadcast message.
  19. 根据权利要求18所述的终端,其中,根据所述相同的广播消息的入队顺序,保留预设数量的广播消息时,所述处理器执行所述计算机程序时实现以下步骤:The terminal according to claim 18, wherein, when the predetermined number of broadcast messages are retained according to the enqueue order of the same broadcast message, the processor performs the following steps when the computer program is executed:
    移除所述相同的广播消息中先入队的广播消息,并保留后入队的预设数量的广播消息;或者Removing the first broadcast message in the same broadcast message and retaining a preset number of broadcast messages after enqueuing; or
    移除所述相同的广播消息中后入队的广播消息,并保留先入队的预设数量的广播消息。The broadcast message of the enqueue after the same broadcast message is removed, and the preset number of broadcast messages of the first queue are reserved.
  20. 根据权利要求16-19任一所述的终端,其中,所述处理器执行所述计算机程序时还实现以下步骤:A terminal according to any one of claims 16 to 19, wherein said processor further implements the following steps when said computer program is executed:
    在接收到广播消息发送请求后,识别在当前的广播消息队列中是否有与所述广播消息发送请求所请求发送的广播消息相同的广播消息;After receiving the broadcast message sending request, identifying whether there is a broadcast message in the current broadcast message queue that is the same as the broadcast message requested by the broadcast message sending request;
    如果有,则将所述广播消息发送请求所请求发送的广播消息替换所述当前的广播消息队列中的相同的广播消息。If so, replace the broadcast message requested by the broadcast message request with the same broadcast message in the current broadcast message queue.
PCT/CN2017/106607 2017-03-10 2017-10-17 Method and device for adjusting broadcast message queue, storage medium, and terminal WO2018161575A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710144263.3A CN106921947B (en) 2017-03-10 2017-03-10 Method, device and terminal for adjusting broadcast message queue
CN201710144263.3 2017-03-10

Publications (1)

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

Family

ID=59461349

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/106607 WO2018161575A1 (en) 2017-03-10 2017-10-17 Method and device for adjusting broadcast message queue, storage medium, and terminal

Country Status (2)

Country Link
CN (1) CN106921947B (en)
WO (1) WO2018161575A1 (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106921947B (en) * 2017-03-10 2020-09-29 Oppo广东移动通信有限公司 Method, device and terminal for adjusting broadcast message queue
CN107729158B (en) * 2017-09-20 2022-01-11 惠州Tcl移动通信有限公司 Method for simplifying application program register, storage medium and electronic equipment
CN109379719B (en) * 2018-11-26 2021-11-16 努比亚技术有限公司 Application program broadcast processing method and device and computer readable storage medium
CN110633161B (en) * 2019-09-19 2022-09-02 北京安云世纪科技有限公司 Broadcast processing method and device
CN114064283A (en) * 2021-11-23 2022-02-18 展讯通信(天津)有限公司 A broadcast information processing method, device, chip and electronic device
CN116088714B (en) * 2022-05-26 2024-05-28 荣耀终端有限公司 Message prompt box processing method and related device
CN116701008B (en) * 2022-09-23 2024-08-13 荣耀终端有限公司 Broadcasting method and apparatus

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1829340A (en) * 2005-03-03 2006-09-06 中兴通讯股份有限公司 Method for sending broadcast channel assignment message in CDMA system trunking communication system
CN104375861A (en) * 2014-11-04 2015-02-25 北京奇虎科技有限公司 Installation-free operation method and device for application programs based on Android platform and terminal
CN105208590A (en) * 2015-08-17 2015-12-30 广东欧珀移动通信有限公司 Mobile terminal operation system card slack abnormity detection recovery method and mobile terminal
CN105335243A (en) * 2015-11-30 2016-02-17 上海斐讯数据通信技术有限公司 Broadcast message operation method and system in Android system
US20160323170A1 (en) * 2013-11-15 2016-11-03 Beijing Qihoo Technology Company Limited Broadcast interception method and apparatus of intelligent device
CN106851014A (en) * 2017-03-10 2017-06-13 广东欧珀移动通信有限公司 Adjust method, device and the terminal of broadcast message queue
CN106851015A (en) * 2017-03-10 2017-06-13 广东欧珀移动通信有限公司 Adjust method, device and the terminal of broadcast message queue
CN106844069A (en) * 2017-03-10 2017-06-13 广东欧珀移动通信有限公司 Method, device and terminal for adjusting broadcast message queue
CN106921947A (en) * 2017-03-10 2017-07-04 广东欧珀移动通信有限公司 Adjust method, device and the terminal of broadcast message queue

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101835043B (en) * 2010-03-23 2013-10-09 熔点网讯(北京)科技有限公司 Adaptive bandwidth desktop sharing method based on block encoding

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1829340A (en) * 2005-03-03 2006-09-06 中兴通讯股份有限公司 Method for sending broadcast channel assignment message in CDMA system trunking communication system
US20160323170A1 (en) * 2013-11-15 2016-11-03 Beijing Qihoo Technology Company Limited Broadcast interception method and apparatus of intelligent device
CN104375861A (en) * 2014-11-04 2015-02-25 北京奇虎科技有限公司 Installation-free operation method and device for application programs based on Android platform and terminal
CN105208590A (en) * 2015-08-17 2015-12-30 广东欧珀移动通信有限公司 Mobile terminal operation system card slack abnormity detection recovery method and mobile terminal
CN105335243A (en) * 2015-11-30 2016-02-17 上海斐讯数据通信技术有限公司 Broadcast message operation method and system in Android system
CN106851014A (en) * 2017-03-10 2017-06-13 广东欧珀移动通信有限公司 Adjust method, device and the terminal of broadcast message queue
CN106851015A (en) * 2017-03-10 2017-06-13 广东欧珀移动通信有限公司 Adjust method, device and the terminal of broadcast message queue
CN106844069A (en) * 2017-03-10 2017-06-13 广东欧珀移动通信有限公司 Method, device and terminal for adjusting broadcast message queue
CN106921947A (en) * 2017-03-10 2017-07-04 广东欧珀移动通信有限公司 Adjust method, device and the terminal of broadcast message queue

Also Published As

Publication number Publication date
CN106921947B (en) 2020-09-29
CN106921947A (en) 2017-07-04

Similar Documents

Publication Publication Date Title
WO2018161575A1 (en) Method and device for adjusting broadcast message queue, storage medium, and terminal
WO2018161580A1 (en) Broadcast control method and apparatus, storage medium, and electronic device
WO2018161593A1 (en) Broadcast processing method, device, storage medium and terminal device
WO2018021678A1 (en) Electronic device and method for operating the same
WO2018076861A1 (en) Data transmission control method, apparatus, storage medium, server and system
WO2015005606A1 (en) Method for controlling chat window and electronic device implementing the same
CN106851015B (en) Method, device and terminal for adjusting broadcast message queue
WO2018161576A1 (en) Broadcast control method, device, storage medium and mobile terminal
WO2018161601A1 (en) Screen backlight adjusting method, device, storage medium and electronic device
WO2018233352A1 (en) Data transmission method, device, terminal and computer-readable storage medium
US10097292B2 (en) Method, device, terminal and storage medium for adjusting broadcast message queue
WO2017206862A1 (en) Bright screen lock-based processing method and apparatus, storage medium, and electronic device
WO2018101777A1 (en) Method and apparatus for streaming audio by using wireless link
WO2018076869A1 (en) Data backup method, apparatus, storage medium and electronic device
WO2018161581A1 (en) Control method, device, storage medium, and electronic apparatus for broadcast sending
WO2018161584A1 (en) Application program control method, device, medium, and electronic apparatus
WO2018161595A1 (en) Broadcast receiver registration method, device, terminal apparatus, and storage medium
WO2017206870A1 (en) Sensor shutdown method and apparatus, storage medium, and electronic device
EP3126937A1 (en) Input device, method, and system for electronic device
WO2018145597A1 (en) Mobile terminal-based screen light-supplementing photographing method and system, and mobile terminal
WO2018076880A1 (en) Data backup method, apparatus, storage medium, and terminal
WO2018161588A1 (en) Broadcast receiver queue adjustment method, apparatus, storage medium, and electronic device
WO2018161594A1 (en) Method and apparatus for generating broadcast queue, storage medium, and electronic device
WO2017185647A1 (en) Softsim-based imsi number management and calling methods, server and network side device
WO2018161573A1 (en) Broadcast receiver queue adjusting method and apparatus, storage medium, and electronic device

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

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

Country of ref document: EP

Kind code of ref document: A1

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载