WO2018161593A1 - 广播处理方法、装置、存储介质和终端设备 - Google Patents
广播处理方法、装置、存储介质和终端设备 Download PDFInfo
- Publication number
- WO2018161593A1 WO2018161593A1 PCT/CN2017/107186 CN2017107186W WO2018161593A1 WO 2018161593 A1 WO2018161593 A1 WO 2018161593A1 CN 2017107186 W CN2017107186 W CN 2017107186W WO 2018161593 A1 WO2018161593 A1 WO 2018161593A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- broadcast
- broadcast message
- message
- sending
- identifier value
- Prior art date
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 20
- 238000012545 processing Methods 0.000 claims abstract description 68
- 238000000034 method Methods 0.000 claims abstract description 34
- 238000012544 monitoring process Methods 0.000 claims description 49
- 230000007246 mechanism Effects 0.000 claims description 21
- 230000004044 response Effects 0.000 claims description 13
- 230000005540 biological transmission Effects 0.000 claims description 11
- 230000001960 triggered effect Effects 0.000 claims description 7
- 238000004590 computer program Methods 0.000 claims description 4
- 230000008569 process Effects 0.000 description 16
- 230000006870 function Effects 0.000 description 10
- 230000002093 peripheral effect Effects 0.000 description 8
- 238000004891 communication Methods 0.000 description 7
- 230000003068 static effect Effects 0.000 description 5
- 238000010586 diagram Methods 0.000 description 4
- 230000000007 visual effect Effects 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 2
- 230000007547 defect Effects 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 238000005457 optimization Methods 0.000 description 2
- 239000011230 binding agent Substances 0.000 description 1
- 238000010168 coupling process Methods 0.000 description 1
- 238000005859 coupling reaction Methods 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04H—BROADCAST COMMUNICATION
- H04H20/00—Arrangements for broadcast or for distribution combined with broadcast
- H04H20/42—Arrangements for resource management
- H04H20/423—Transmitter side
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/542—Event management; Broadcasting; Multicasting; Notifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04H—BROADCAST COMMUNICATION
- H04H20/00—Arrangements for broadcast or for distribution combined with broadcast
- H04H20/42—Arrangements for resource management
- H04H20/426—Receiver side
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04H—BROADCAST COMMUNICATION
- H04H20/00—Arrangements for broadcast or for distribution combined with broadcast
- H04H20/65—Arrangements characterised by transmission systems for broadcast
- H04H20/71—Wireless systems
- H04H20/72—Wireless systems of terrestrial networks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/06—Selective distribution of broadcast services, e.g. multimedia broadcast multicast service [MBMS]; Services to user groups; One-way selective calling services
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/60—Subscription-based services using application servers or record carriers, e.g. SIM application toolkits
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W72/00—Local resource management
- H04W72/30—Resource management for broadcast services
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/54—Indexing scheme relating to G06F9/54
- G06F2209/543—Local
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/12—Messaging; Mailboxes; Announcements
- H04W4/14—Short messaging services, e.g. short message services [SMS] or unstructured supplementary service data [USSD]
Definitions
- the embodiments of the present application relate to computer technologies, and in particular, to a broadcast processing method, apparatus, storage medium, and terminal device.
- Broadcast is a widely used mechanism for transmitting information between applications. Taking the Android operating system as an example, it uses broadcast to realize data transmission and sharing between applications. Typically, such as Android's own text messages, telephones and other broadcasts.
- the broadcast sender sends a broadcast message by calling the sendBroadcast function
- the broadcast receiver registers the broadcast receiver (BroadcastReceiver) in the management module by calling the registerReceiver function, and defines a broadcast message of interest to the broadcaster. To achieve the reception of the corresponding broadcast message.
- the present application provides a broadcast processing method, apparatus, storage medium, and terminal device, which improves broadcast processing efficiency, reduces system resource consumption, and increases system stability.
- an embodiment of the present application provides a broadcast processing method, including:
- the type of the broadcast message is a normal broadcast
- an interface that sends the broadcast message is invoked, and the broadcast message is sent to a corresponding broadcast recipient.
- the embodiment of the present application further provides a broadcast processing apparatus, including:
- An obtaining module configured to acquire a broadcast message currently sent in a broadcast queue
- a determining module configured to determine a type of the broadcast message
- a sending module configured to: if the type of the broadcast message is a normal broadcast, invoke an interface that sends the broadcast message, and send the broadcast message to a corresponding broadcast receiver.
- the embodiment of the present application further provides a storage medium, where the storage medium stores a plurality of instructions, the instructions being adapted to be loaded by a processor to perform the steps of the broadcast processing method as described above.
- the embodiment of the present application further provides a terminal device, including: a processor, a memory, and a computer program stored on the memory and operable on the processor, wherein when the processor executes the computer program Implement the following steps:
- the type of the broadcast message is a normal broadcast
- an interface that sends the broadcast message is invoked, and the broadcast message is sent to a corresponding broadcast recipient.
- the present application provides a broadcast processing method, apparatus, storage medium, and terminal device, which improves broadcast processing efficiency, reduces system resource consumption, and increases system stability.
- FIG. 1 is a flowchart of a broadcast processing method according to an embodiment of the present application.
- FIG. 2 is a flowchart of another broadcast processing method provided by an embodiment of the present application.
- FIG. 3 is a flowchart of another broadcast processing method provided by an embodiment of the present application.
- FIG. 4 is a structural block diagram of a broadcast processing apparatus according to an embodiment of the present application.
- FIG. 5 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
- the management module puts the broadcast message into the ordered broadcast queue for sequential transmission. Broadcast processing is inefficient, system resources are consumed too much, and stability is poor.
- the embodiments of the present application can be overcome by adopting the following implementation manners.
- a broadcast processing method includes the following steps:
- the type of the broadcast message is a normal broadcast
- an interface that sends the broadcast message is invoked, and the broadcast message is sent to a corresponding broadcast recipient.
- the invoking an interface that sends the broadcast message, and sending the broadcast message to a corresponding broadcast recipient includes:
- Generating a feedback parameter calling an interface that sends the broadcast message according to the feedback parameter, and sending the broadcast message to a corresponding broadcast receiver.
- an interface that sends the broadcast message is invoked, and sending the broadcast message to a corresponding broadcast recipient includes:
- the type of the broadcast message is a normal broadcast, determining the number of corresponding broadcast recipients, according to the number of the broadcast recipients, invoking a corresponding number of interfaces for sending the broadcast message, sequentially and/or the broadcast message Or synchronously sent to the corresponding broadcast recipient.
- the transmitting the broadcast message to a corresponding broadcast recipient comprises:
- Creating a broadcast message object setting an identifier value of the broadcast message, and adding the identifier value to the broadcast message, and sending a broadcast message including the identifier value to a corresponding broadcast receiver;
- the processing time of the broadcast message containing the identifier value is monitored. If the processing time is greater than the preset monitoring time, the timeout response mechanism is triggered, where the preset monitoring time is greater than the system default monitoring time.
- the method further includes:
- the monitoring of the processing time of the broadcast message is cancelled according to the feedback result of the corresponding broadcast receiver processing the broadcast message, and the feedback result includes the identifier value of the broadcast message.
- the identification value is a hash value.
- the determining the type of the broadcast message comprises:
- the type of the broadcast message is determined according to a transmission instruction used when transmitting the broadcast message.
- the type of the broadcast message is determined by acquiring a broadcast message currently sent in the broadcast queue. If the type of the broadcast message is a normal broadcast, the interface that sends the broadcast message is invoked, and the broadcast message is sent. The method is sent to the corresponding broadcast receiver, which solves the problem that the existing broadcast receiver is also arranged in the ordered broadcast queue due to the low efficiency of the broadcast when the static registration is used, and the broadcast processing speed is improved. Reduce system resource consumption and increase system stability.
- FIG. 1 is a flowchart of a broadcast processing method according to an embodiment of the present disclosure.
- the method may be performed by a terminal device provided by an embodiment of the present application.
- the broadcast processing device of the terminal device may be implemented by using software and hardware.
- the specific solution provided by this embodiment is as follows:
- the broadcast sender's service process sends a broadcast message to the management module (such as ActivityManagerService, activity management service) by calling a broadcast send function (such as the sendBroadcast function), and the management module puts the broadcast message and puts it into the broadcast process.
- the management module sends the broadcast message in the broadcast queue to the broadcast receiver that meets the receiving condition through a process communication mechanism (such as a Binder process communication mechanism).
- a broadcast message refers to information transmitted by a system or an application during operation, and is used for transmission between a system and an application.
- the broadcast message may be a system initiated broadcast message, a short message broadcast message, Telephone broadcast messages or three-party application broadcast messages.
- the process in which the broadcast sender transmits the broadcast message and the process in which the broadcast receiver receives the broadcast message are asynchronous operation processes, and the broadcast sender and the broadcast receiver implement low-coupling relationship matching through the management module, that is, the broadcast sender does not transmit the broadcast message.
- the broadcast receiver only receives the broadcast message of interest to itself, nor does it care about the specific broadcast sender.
- the management module receives the broadcast message sent by the broadcast sender and places it in the broadcast queue, and the management module sequentially transmits the broadcast message in the broadcast queue.
- the process by which the broadcast sender sends a broadcast message to the management module can be expressed as follows (for example, the counter application sends a broadcast message):
- Intent intent new Intent (BROADCAST_COUNTER_ACTION);
- the broadcast message currently sent in the broadcast queue is acquired. If it is an ordered broadcast queue, when an ordered broadcast is sent, all corresponding broadcast receivers need to be processed and fed back to the maintenance. After the management module of the broadcast queue feeds back the result, the management module determines, according to the feedback result, that the issued ordered broadcast processing is completed, and then starts transmitting the next broadcast message in the broadcast queue.
- the currently sent broadcast message may be the sent broadcast message or the broadcast message that is being prepared for transmission after receiving the feedback result of the previous broadcast message.
- the broadcast message can be divided into ordinary broadcast and ordered broadcast according to different broadcast transmission modes.
- the broadcast receiver After the normal broadcast is sent by the management module, the broadcast receiver receives the broadcast message unordered, and after the broadcast is sent by the management module, the broadcast receiver sequentially receives the order, that is, the first broadcast receiver receives After the broadcast message is processed and processed, the second broadcast receiver can start receiving and processing the broadcast message, and so on.
- the registration instruction of the broadcast recipient may be a registration instruction (static registration instruction) registered in the management module, and may also be a registration instruction (dynamic registration instruction) registered in the application of the broadcast recipient.
- the management module puts the broadcast message into the ordered broadcast queue for sequential transmission, which seriously affects the broadcast.
- the processing speed of the message itself also affects the processing speed of other broadcast messages in the ordered broadcast queue.
- the type of the broadcast message is determined.
- the broadcast command may be determined by the broadcast command used by the broadcast sender to send the broadcast message.
- the type for example, the broadcast message sent by the sendBroadcast function is a normal broadcast, and the broadcast message sent by the sendOrderedBroadcast function is an ordered broadcast).
- the type of the currently transmitted broadcast message is a normal broadcast
- an interface that transmits the broadcast message is invoked, and the broadcast message is sent to a corresponding broadcast recipient. Therefore, by judging the type of the broadcast message, the ordinary broadcast message in the ordered broadcast queue is directly sent to the corresponding next broadcast receiver, and the processing of the ordinary broadcast itself is improved without waiting for the feedback result of the previous broadcast receiver. Speed, while also making the processing speed of broadcasts in the ordered broadcast queue also greatly increased.
- the management module can acquire the registration instruction of the broadcast receiver, and the registration instruction of the broadcast receiver is issued by the broadcast recipient.
- the broadcast recipient registers (subscribes) the broadcast message that it wants to receive to the management module through the process communication mechanism.
- the broadcast receiver's service process registers the broadcast receiver in the management module by calling the registerReceiver function, and defines the broadcast message of interest to itself.
- the management module sends the broadcast message in the broadcast queue, according to the registration status of the broadcast receiver, Sending the broadcast message to a message loop queue corresponding to the broadcast receiver to which the subscription is made, and receiving, by the broadcast receiver, the receiving method (such as the onReceive method) in the registered broadcast receiver after receiving the broadcast message to perform the corresponding Function to process received broadcast messages.
- the receiving method such as the onReceive method
- the registration process of the broadcast receiver receiving the broadcast message can be expressed as:
- the broadcast message (BROADCAST_COUNTER_ACTION) sent by the broadcast sender is sent by the management module, since the broadcast receiver registers the corresponding broadcast receiver that receives the broadcast message, the broadcast message is received and processed by the corresponding broadcast receiver.
- the technical solution provided in this embodiment determines the type of the broadcast message by acquiring a broadcast message currently sent in the broadcast queue. If the type of the broadcast message is a normal broadcast, the interface that sends the broadcast message is invoked. The broadcast message is sent to the corresponding broadcast receiver, which solves the problem that the existing broadcast receiver is used in the static registration, and the ordinary broadcast is also arranged in the ordered broadcast queue, and the broadcast processing efficiency is low, and the broadcast is improved. Processing speed reduces system resource consumption and increases system stability.
- FIG. 2 is a flowchart of another broadcast processing method according to an embodiment of the present application.
- the broadcast message is sent.
- the interface, sending the broadcast message to the corresponding broadcast recipient includes:
- the type of the broadcast message is a normal broadcast, determining the number of corresponding broadcast recipients, according to the number of the broadcast recipients, invoking a corresponding number of interfaces for sending the broadcast message, sequentially and/or the broadcast message Or synchronously sent to the corresponding broadcast recipient.
- the type of the broadcast message is a normal broadcast, determine the number of corresponding broadcast recipients, and according to the number of broadcast receivers, call the corresponding number of interfaces for sending broadcast messages, and send the broadcast messages to the corresponding ones in sequence and/or synchronously. Broadcast recipient.
- invoking an interface that sends the broadcast message, sending the broadcast message to a corresponding broadcast receiver includes: generating a feedback parameter, invoking an interface for sending the broadcast message according to the feedback parameter, The broadcast message is sent to the corresponding broadcast recipient. Since each broadcast receiver in the ordered broadcast queue needs to process the broadcast message in turn, and feed back the processing result, the next broadcast receiver performs the processing.
- generating a feedback parameter (which can be understood as a false parameter generated by the system)
- the interface that sends the broadcast message is directly called to send the broadcast message without waiting for the current broadcast receiver to process the feedback. After the result, the interface that sends the broadcast message is called according to the processing result to send the broadcast message.
- the broadcast recipient corresponding to the broadcast message is traversed, the number of broadcast recipients is determined, and the interface that sends the broadcast message is sequentially and/or synchronously transmitted to send the broadcast message to the corresponding broadcast recipient, such that the plurality of broadcasts
- the receiver can receive and process the broadcast message in time or at the same time, which greatly improves the processing efficiency of the broadcast message.
- This embodiment provides a broadcast processing method, which solves the defects of the existing broadcast mechanism, improves the broadcast processing efficiency, reduces system resource consumption, and increases system stability.
- FIG. 3 is a flowchart of another broadcast processing method according to an embodiment of the present disclosure.
- the sending the broadcast message to a corresponding broadcast receiver includes:
- Creating a broadcast message object setting an identifier value of the broadcast message, and adding the identifier value to the broadcast message, and sending a broadcast message including the identifier value to a corresponding broadcast receiver;
- the processing time of the broadcast message containing the identifier value is monitored. If the processing time is greater than the preset monitoring time, the timeout response mechanism is triggered, where the preset monitoring time is greater than the system default monitoring time.
- the type of the broadcast message is a normal broadcast, invoke an interface that sends the broadcast message, create a broadcast message object, set an identifier value of the broadcast message, and add the identifier value to the broadcast message. And transmitting a broadcast message including the identification value to a corresponding broadcast recipient.
- the identification value can be a hash value, each hash value corresponding to a unique broadcast message.
- the broadcast message is uniquely identified and confirmed by adding the identification value to the broadcast message.
- the management module sets a timeout response mechanism for the transmission of the broadcast message, that is, the broadcast message is sent slowly to trigger the timeout response mechanism, thereby causing the application to exit.
- the preset monitoring time is greater than the system default monitoring time (which can be 1.5-3 times the system default monitoring time).
- timing is started after the broadcast message containing the identifier value is sent, and if the feedback result that the broadcast message is processed is not received at the preset monitoring time, the timeout response mechanism is triggered. In the prior art solution, if the speed of the broadcast message is to be increased, the system default monitoring time needs to be reduced.
- the broadcast message sending speed will be significantly decreased, and in the broadcast processing mechanism used in this solution, the common type is The broadcast message can be sent quickly, and the broadcast monitoring speed is increased.
- the preset monitoring time is greater than the system default monitoring time, so that the probability that the timeout response mechanism is triggered is significantly reduced.
- the method further includes: canceling monitoring the processing time of the broadcast message according to the feedback result of the corresponding broadcast receiver processing the broadcast message
- the feedback result includes an identification value of the broadcast message. If the feedback result of the broadcast receiver is received, the corresponding monitored broadcast message is determined according to the identifier value in the feedback result, and the monitoring of the broadcast message is released.
- This embodiment provides a broadcast processing method, which improves the broadcast message processing speed, reduces the probability of sending a timeout response, further improves the broadcast processing mechanism, and improves the broadcast processing efficiency.
- FIG. 4 is a structural block diagram of a broadcast processing apparatus according to an embodiment of the present disclosure.
- the apparatus is configured to execute the broadcast processing method provided by the foregoing embodiment, and has a function module and a beneficial effect corresponding to the execution method.
- the device specifically includes: an obtaining module 401, a determining module 402, and a sending module 403.
- the obtaining module 401 is configured to acquire a broadcast message currently sent in the broadcast queue.
- a determining module 402 configured to determine a type of the broadcast message
- the sending module 403 is configured to: if the type of the broadcast message is a normal broadcast, invoke an interface that sends the broadcast message, and send the broadcast message to a corresponding broadcast receiver.
- the technical solution provided in this embodiment solves the defects of the existing broadcast mechanism, improves the broadcast processing efficiency, reduces system resource consumption, and increases system stability.
- the sending module 403 is specifically configured to: generate a feedback parameter, invoke an interface that sends the broadcast message according to the feedback parameter, and send the broadcast message to a corresponding broadcast receiver.
- the sending module 403 is specifically configured to: if the type of the broadcast message is a normal broadcast, determine the number of corresponding broadcast recipients, and send the corresponding number of times according to the number of the broadcast recipients.
- the sending module 403 specifically includes: an identifier value setting unit 4031, configured to create a broadcast message object, set an identifier value of the broadcast message, and add the identifier value to the broadcast message; 4032, configured to send a broadcast message that includes the identifier value to a corresponding broadcast receiver, and a monitoring unit 4033, configured to monitor a processing time of the sent broadcast message that includes the identifier value, if the processing time is greater than The preset monitoring time triggers a timeout response mechanism, where the preset monitoring time is greater than the system default monitoring time.
- the monitoring unit 4033 is further configured to: after the monitoring time of the sent broadcast message including the identifier value is monitored, cancel the feedback result of the broadcast message according to the corresponding broadcast receiver, and cancel Monitoring the processing time of the broadcast message, the feedback result including an identification value of the broadcast message.
- the embodiment of the present application further provides a storage medium, where the storage medium stores a plurality of instructions, and the instructions are adapted to be loaded by a processor to perform the steps in the broadcast processing method described in any of the foregoing embodiments.
- FIG. 5 is a schematic structural diagram of a terminal device according to an embodiment of the present disclosure.
- the terminal device may include: a memory 501 and a central processing unit (Central). Processing Unit, CPU) 502, peripheral interface 503, RF (Radio) Frequency, RF circuit 505, audio circuit 506, speaker 511, power management chip 508, input/output (I/O) subsystem 509, touch screen 512, other input/control devices 510, and external port 504, these components are passed through one or A plurality of communication buses or signal lines 507 are in communication.
- Central Central
- CPU central processing unit
- the illustrated terminal device 500 is merely one example of a terminal device, and that the terminal device 500 may have more or fewer components than those shown in the figures, and two or more components may be combined. Or it can have different component configurations.
- the various components shown in the figures can be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and application specific integrated circuits.
- the terminal device for rights management of a multi-open application provided in this embodiment is described in detail below.
- the terminal device takes a smart phone as an example.
- the memory 501 can be accessed by the CPU 502, the peripheral interface 503, etc., and the memory 501 can include a high speed random access memory, and can also include a non-volatile memory, such as one or more magnetic disk storage devices, flash memory devices. Or other volatile solid-state storage devices.
- a non-volatile memory such as one or more magnetic disk storage devices, flash memory devices. Or other volatile solid-state storage devices.
- Peripheral interface 503 which can connect the input and output peripherals of the device to CPU 502 and memory 501.
- the I/O subsystem 509 which can connect input and output peripherals on the device, such as touch screen 512 and other input/control devices 510, to peripheral interface 503.
- the I/O subsystem 509 can include a display controller 5091 and one or more input controllers 5092 for controlling other input/control devices 510.
- one or more input controllers 5092 receive electrical signals from other input/control devices 510 or transmit electrical signals to other input/control devices 510, and other input/control devices 510 may include physical buttons (press buttons, rocker buttons, etc.) ), dial, slide switch, joystick, click wheel.
- the input controller 5092 can be connected to any of the following: a keyboard, an infrared port, a USB interface, and a pointing device such as a mouse.
- the touch screen 512 is an input interface and an output interface between the user terminal and the user, and displays the visual output to the user.
- the visual output may include graphics, text, icons, videos, and the like.
- Display controller 5091 in I/O subsystem 509 receives electrical signals from touch screen 512 or transmits electrical signals to touch screen 512.
- the touch screen 512 detects the contact on the touch screen, and the display controller 5091 converts the detected contact into an interaction with the user interface object displayed on the touch screen 512, that is, realizes human-computer interaction, and the user interface object displayed on the touch screen 512 can be operated.
- the icon of the game, the icon of the network to the corresponding network, and the like.
- the device may also include a light mouse, which is a touch sensitive surface that does not display a visual output, or an extension of a touch sensitive surface formed by the touch screen.
- the RF circuit 505 is mainly used for establishing communication between the mobile phone and the wireless network (ie, the network side), and realizing data reception and transmission between the mobile phone and the wireless network. For example, sending and receiving short messages, emails, and the like. Specifically, the RF circuit 505 receives and transmits an RF signal, which is also referred to as an electromagnetic signal, and the RF circuit 505 converts the electrical signal into an electromagnetic signal or converts the electromagnetic signal into an electrical signal, and through the electromagnetic signal and communication network and other devices Communicate.
- an RF signal which is also referred to as an electromagnetic signal
- RF circuitry 505 may include known circuitry for performing these functions including, but not limited to, an antenna system, an RF transceiver, one or more amplifiers, a tuner, one or more oscillators, a digital signal processor, a CODEC ( COder-DECoder, codec) chipset, user identification module (Subscriber Identity Module, SIM) and more.
- CODEC COder-DECoder, codec
- the audio circuit 506 is mainly used to receive audio data from the peripheral interface 503, convert the audio data into an electrical signal, and transmit the electrical signal to the speaker 511.
- the speaker 511 is configured to restore the voice signal received by the mobile phone from the wireless network through the RF circuit 505 to sound and play the sound to the user.
- the power management chip 508 is used for power supply and power management of the hardware connected to the CPU 502, the I/O subsystem, and the peripheral interface.
- the CPU 502 provided by the embodiment of the present application may perform the following operations:
- the type of the broadcast message is a normal broadcast
- an interface that sends the broadcast message is invoked, and the broadcast message is sent to a corresponding broadcast recipient.
- the invoking an interface that sends the broadcast message, and sending the broadcast message to a corresponding broadcast receiver includes:
- Generating a feedback parameter calling an interface that sends the broadcast message according to the feedback parameter, and sending the broadcast message to a corresponding broadcast receiver.
- the interface that sends the broadcast message is invoked, and sending the broadcast message to the corresponding broadcast receiver includes:
- the type of the broadcast message is a normal broadcast, determining the number of corresponding broadcast recipients, according to the number of the broadcast recipients, invoking a corresponding number of interfaces for sending the broadcast message, sequentially and/or the broadcast message Or synchronously sent to the corresponding broadcast recipient.
- the sending the broadcast message to the corresponding broadcast receiver includes:
- Creating a broadcast message object setting an identifier value of the broadcast message, and adding the identifier value to the broadcast message, and sending a broadcast message including the identifier value to a corresponding broadcast receiver;
- the processing time of the broadcast message containing the identifier value is monitored. If the processing time is greater than the preset monitoring time, the timeout response mechanism is triggered, where the preset monitoring time is greater than the system default monitoring time.
- the method further includes:
- the monitoring of the processing time of the broadcast message is cancelled according to the feedback result of the corresponding broadcast receiver processing the broadcast message, and the feedback result includes the identifier value of the broadcast message.
Landscapes
- Engineering & Computer Science (AREA)
- Signal Processing (AREA)
- Computer Networks & Wireless Communication (AREA)
- Multimedia (AREA)
- General Business, Economics & Management (AREA)
- Business, Economics & Management (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
- Mobile Radio Communication Systems (AREA)
- Telephonic Communication Services (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本申请实施例公开了一种广播处理方法、装置、存储介质和终端设备,其中方法包括:获取广播队列中当前发送的广播消息;确定广播消息的类型;若广播消息的类型为普通广播,则调用发送所述广播消息的接口,将所述广播消息发送至对应的广播接收者。本方案提高了广播处理效率,降低了系统资源消耗,使得系统稳定性增加。
Description
本申请要求于2017年03月10日提交中国专利局、申请号为201710140903.3、发明名称为“广播处理方法、装置和终端设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请实施例涉及计算机技术,尤其涉及一种广播处理方法、装置、存储介质和终端设备。
广播是一种被广泛运用的在应用程序之间进行信息传输的机制,以安卓操作系统为例,其通过广播(Broadcast)来实现应用程序间数据的传输和共享。典型的,如安卓自带的短信、电话等广播。
在安卓系统中,广播发送者通过调用sendBroadcast函数进行广播消息的发送,广播接收者通过调用registerReceiver函数在管理模块中进行广播接收器(BroadcastReceiver)的注册,并定义自身感兴趣的广播消息,由此来实现对相应的广播消息的接收。
本申请提供了一种广播处理方法、装置、存储介质和终端设备,提高了广播处理效率,降低了系统资源消耗,增加了系统的稳定性。
第一方面,本申请实施例提供了一种广播处理方法,包括:
获取广播队列中当前发送的广播消息;
确定所述广播消息的类型;
如果所述广播消息的类型为普通广播,则调用发送所述广播消息的接口,将所述广播消息发送至对应的广播接收者。
第二方面,本申请实施例还提供了一种广播处理装置,包括:
获取模块,用于获取广播队列中当前发送的广播消息;
确定模块,用于确定所述广播消息的类型;
发送模块,用于如果所述广播消息的类型为普通广播,则调用发送所述广播消息的接口,将所述广播消息发送至对应的广播接收者。
第三方面,本申请实施例还提供了一种存储介质,所述存储介质中存储有多条指令,所述指令适于由处理器加载以执行如上面所述的广播处理方法的步骤。
第四方面,本申请实施例还提供了一种终端设备,包括:处理器、存储器以及存储在存储器上并可在处理器上运行的计算机程序,其中,所述处理器执行所述计算机程序时实现以下步骤:
获取广播队列中当前发送的广播消息;
确定所述广播消息的类型;
如果所述广播消息的类型为普通广播,则调用发送所述广播消息的接口,将所述广播消息发送至对应的广播接收者。
本申请提供了一种广播处理方法、装置、存储介质和终端设备,提高了广播处理效率,降低了系统资源消耗,增加了系统的稳定性。
下面结合附图,通过对本申请的具体实施方式详细描述,将使本申请的技术方案及其它有益效果显而易见。
图1是本申请实施例提供的一种广播处理方法的流程图;
图2是本申请实施例提供的另一种广播处理方法的流程图;
图3是本申请实施例提供的另一种广播处理方法的流程图;
图4是本申请实施例提供的一种广播处理装置的结构框图;
图5是本申请实施例提供的一种终端设备的结构示意图。
下面结合附图和实施例对本申请作进一步的详细说明。可以理解的是,此处所描述的具体实施例用于解释本申请,而非对本申请的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与本申请相关的部分而非全部结构。
一般地,当采取静态注册的方式进行广播接收者的注册时,不论广播发送者发送的是普通广播还是有序广播,管理模块都会将该广播消息放入有序广播队列进行按序发送,使得广播处理效率低下,系统资源消耗过多且稳定性差。本申请实施例可以采取如下的实现方式来克服。
一种广播处理方法,包括以下步骤:
获取广播队列中当前发送的广播消息;
确定所述广播消息的类型;
如果所述广播消息的类型为普通广播,则调用发送所述广播消息的接口,将所述广播消息发送至对应的广播接收者。
在一些实施例中,所述调用发送所述广播消息的接口,将所述广播消息发送至对应的广播接收者包括:
生成反馈参数,依据所述反馈参数调用发送所述广播消息的接口,将所述广播消息发送至对应的广播接收者。
在一些实施例中,所述如果所述广播消息的类型为普通广播,则调用发送所述广播消息的接口,将所述广播消息发送至对应的广播接收者包括:
如果所述广播消息的类型为普通广播,则确定对应的广播接收者的数量,依据所述广播接收者的数量,调用相应次数的发送所述广播消息的接口,将所述广播消息依次和/或同步发送至对应的广播接收者。
在一些实施例中,所述将所述广播消息发送至对应的广播接收者包括:
创建广播消息对象,设置所述广播消息的标识值,并将所述标识值添加至所述广播消息中,将包含所述标识值的广播消息发送至对应的广播接收者;
对发送的包含所述标识值的广播消息的处理时间进行监控,如果所述处理时间大于预设监控时间,则触发超时响应机制,其中,所述预设监控时间大于系统默认的监控时间。
在一些实施例中,在所述对发送的包含所述标识值的广播消息的处理时间进行监控之后,还包括:
依据对应的广播接收者处理所述广播消息的反馈结果,取消对所述广播消息的处理时间的监控,所述反馈结果包含所述广播消息的标识值。
在一些实施例中,所述标识值为哈希值。
在一些实施例中,所述确定所述广播消息的类型,包括:
根据发送所述广播消息时使用的发送指令确定所述广播消息的类型。
本申请实施例,通过获取广播队列中当前发送的广播消息,确定所述广播消息的类型,如果所述广播消息的类型为普通广播,则调用发送所述广播消息的接口,将所述广播消息发送至对应的广播接收者,解决了现有的广播接收者在使用静态注册时,造成的普通广播也被安排在有序广播队列中造成的广播处理效率低下的问题,提高了广播处理速度,降低了系统资源消耗,使得系统稳定性增加。
以下将分别进行详细说明。
图1是本申请实施例提供的一种广播处理方法的流程图,该方法可以由本申请实施例提供的终端设备来执行,该终端设备的广播处理装置可采用软件以及硬件的方式实现,如图1所示,本实施例提供的具体方案如下:
S101、获取广播队列中当前发送的广播消息。
在广播处理过程中,广播发送者的服务进程通过调用广播发送函数(如sendBroadcast函数)将广播消息发送至管理模块(如ActivityManagerService,活动管理服务),管理模块接收到该广播消息后将其放入广播队列,管理模块通过进程通信机制(如Binder进程通信机制)将广播队列中的广播消息发送至符合接收条件的广播接收者。
广播机制中,广播消息指的是系统或者应用程序在运行过程中发送的,用于系统以及应用程序之间传输的信息,示例性的,广播消息可以是系统启动广播消息、短信类广播消息、电话类广播消息或者三方应用类广播消息等。广播发送者发送广播消息的过程和广播接收者接收广播消息的过程是异步操作过程,广播发送者和广播接收者通过管理模块实现低耦合的关系匹配,即广播发送者在发送广播消息后并不关心具体的广播接收者是谁,广播接收者只接收自己感兴趣的广播消息,也不关心具体的广播发送者。
在一些实施例中,管理模块接收广播发送者发送的广播消息并放入广播队列中,管理模块对广播队列中的广播消息依次进行发送。广播发送者发送广播消息至管理模块的过程可表示如下(以计数器应用程序发送一个广播消息为例):
//创建一个广播消息
Intent intent = new Intent
(BROADCAST_COUNTER_ACTION);
//传递计数器参数及对应的计数值
intent.putExtra(COUNTER_VALUE, counter);
//发送广播消息
sendBroadcast(intent)
在一些实施例中,对广播队列中当前发送的广播消息进行获取,若为有序广播队列,则当一个有序广播被发出后,需要对应的所有的广播接收者全部处理完毕并反馈给维护广播队列的管理模块反馈结果后,管理模块根据该反馈结果确定该已发出的有序广播处理完毕,进而开始发送广播队列中的下一个广播消息。该实施例中,当前发送的广播消息可以是发出的广播消息也可以是收到前一个广播消息的反馈结果后正在准备发送的广播消息。
S102、确定所述广播消息的类型。
其中,根据广播发送方式的不同可将广播消息分为普通广播和有序广播。普通广播被管理模块发出后,广播接收者对该广播消息的接收是无序的,而有序广播被管理模块发出后,广播接收者按照顺序先后依次接收,即第一个广播接收者接收到广播消息并处理完毕后,第二个广播接收者才能开始接收并处理该广播消息,依次类推。
在一些实施例中,广播接收者的注册指令可以是注册在管理模块中的注册指令(静态注册指令),还可以是注册在广播接收者的应用程序中的注册指令(动态注册指令)。当采取静态注册的方式进行广播接收者的注册时,不论广播发送者发送的是普通广播还是有序广播,管理模块都会将该广播消息放入有序广播队列进行按序发送,严重影响了广播消息本身的处理速度,也影响了有序广播队列中其它广播消息的处理速度。
在一些实施例中,当获取到广播队列中当前发送的广播消息后,对该广播消息的类型进行确定,示例性的,可通过广播发送者发送该广播消息时使用的发送指令确定给广播消息的类型(如:采用sendBroadcast函数发送的广播消息为普通广播,采用sendOrderedBroadcast函数发送的广播消息为有序广播)。
S103、如果所述广播消息的类型为普通广播,则调用发送所述广播消息的接口,将所述广播消息发送至对应的广播接收者。
在一些实施例中,当确定出当前发送的广播消息的类型为普通广播,则调用发送所述广播消息的接口,将所述广播消息发送至对应的广播接收者。由此,通过对广播消息类型的判断,将有序广播队列中的普通广播消息直接发送至对应的下一个广播接收者,不用等待之前的广播接收者的反馈结果,提高了普通广播自身的处理速度,同时使得有序广播队列中广播的处理速度也大幅提升。
在一些实施例中,广播接收者在接收广播消息时,管理模块可以对广播接收器的注册指令进行获取,该广播接收器的注册指令由广播接收者发出。通常,广播接收者通过进程通信机制向管理模块注册(订阅)想要接收的广播消息。广播接收者的服务进程通过调用registerReceiver函数在管理模块中进行广播接收器的注册,同时定义自身感兴趣的广播消息,管理模块在发送广播队列中的广播消息时,依据广播接收者的注册情况,将该广播消息发送至对其进行订阅了的广播接收者相应的消息循环队列中,广播接收者接收到该广播消息后回调注册的广播接收器中的接收方法(如onReceive方法)来执行相应的功能以对接收到的广播消息进行处理。
以接收计数器发送的广播消息为例,广播接收者接收广播消息的注册过程可表示为:
//定义一个感兴趣的广播消息(订阅广播消息)
IntentFilter counterActionFilter =
new
IntentFilter(CounterService.BROADCAST_COUNTER_ACTION);
//进行广播接收器的注册
registerReceiver(counterActionReceiver,counterActionFilter)
当该广播发送者发送的广播消息(BROADCAST_COUNTER_ACTION)由管理模块发出后,由于广播接收者注册了对应的接收该广播消息的广播接收器,该广播消息即会被对应的广播接收者接收、处理。
本实施例提供的技术方案,通过获取广播队列中当前发送的广播消息,确定所述广播消息的类型,如果所述广播消息的类型为普通广播,则调用发送所述广播消息的接口,将所述广播消息发送至对应的广播接收者,解决了现有的广播接收者在使用静态注册时,造成的普通广播也被安排在有序广播队列中造成的广播处理效率低下的问题,提高了广播处理速度,降低了系统资源消耗,使得系统稳定性增加。
图2是本申请实施例提供的另一种广播处理方法的流程图,在上述实施例的基础上,可选的,如果所述广播消息的类型为普通广播,则调用发送所述广播消息的接口,将所述广播消息发送至对应的广播接收者包括:
如果所述广播消息的类型为普通广播,则确定对应的广播接收者的数量,依据所述广播接收者的数量,调用相应次数的发送所述广播消息的接口,将所述广播消息依次和/或同步发送至对应的广播接收者。
基于上述优化,如图2所示,本实施例提供的技术方案具体如下:
S201、获取广播队列中当前发送的广播消息。
S202、确定所述广播消息的类型。
S203、如果广播消息的类型为普通广播,则确定对应的广播接收者的数量,依据广播接收者的数量,调用相应次数的发送广播消息的接口,将广播消息依次和/或同步发送至对应的广播接收者。
在一些实施例中,调用发送所述广播消息的接口,将所述广播消息发送至对应的广播接收者包括:生成反馈参数,依据所述反馈参数调用发送所述广播消息的接口,将所述广播消息发送至对应的广播接收者。由于有序广播队列中各个广播接收者需要依次对广播消息进行处理,并将处理结果反馈后进行下一广播接收者的处理。该实施例中,通过生成反馈参数(可以理解为系统生成的虚假参数)用于替代原有的处理结果,直接调用发送广播消息的接口对该广播消息进行发送而不必等待当前广播接收者反馈处理结果后再依据处理结果调用发送广播消息的接口进行广播消息的发送。
在一些实施例中,对广播消息对应的广播接收者进行遍历,确定广播接收者的数目,依次和/或同步调用发送广播消息的接口将广播消息发送至对应的广播接收者,使得多个广播接收者可以及时或同时接收并处理广播消息,极大的提高了广播消息的处理效率。
本实施例提供了一种广播处理方法,解决了现有的广播机制存在的缺陷,提高了广播处理效率,降低了系统资源消耗,使得系统稳定性增加。
图3是本申请实施例提供的另一种广播处理方法的流程图,在上述实施例的基础上,可选的,所述将所述广播消息发送至对应的广播接收者包括:
创建广播消息对象,设置所述广播消息的标识值,并将所述标识值添加至所述广播消息中,将包含所述标识值的广播消息发送至对应的广播接收者;
对发送的包含所述标识值的广播消息的处理时间进行监控,如果所述处理时间大于预设监控时间,则触发超时响应机制,其中,所述预设监控时间大于系统默认的监控时间。
基于上述优化,如图3所示,本实施例提供的技术方案具体如下:
S301、获取广播队列中当前发送的广播消息。
S302、确定所述广播消息的类型。
S303、如果所述广播消息的类型为普通广播,则调用发送所述广播消息的接口,创建广播消息对象,设置所述广播消息的标识值,并将所述标识值添加至所述广播消息中,将包含所述标识值的广播消息发送至对应的广播接收者。
在一些实施例中,该标识值可以是哈希值,每个哈希值对应一个唯一的广播消息。通过将标识值添加到广播消息的方式对广播消息进行唯一性识别、确认。
S304、对发送的包含所述标识值的广播消息的处理时间进行监控,如果所述处理时间大于预设监控时间,则触发超时响应机制。
在一些实施例中,管理模块对广播消息的发送设置了超时响应机制,即广播消息发送较慢则触发该超时响应机制,进而引起应用程序的退出。本步骤中,预设监控时间大于系统默认的监控时间(可以是系统默认监控时间的1.5-3倍)。示例性的,当发送出包含标识值的广播消息后开始进行计时,若在预设监控时间未接收到该广播消息被处理完毕的反馈结果,则触发超时响应机制。现有技术方案中,若想提高广播消息发送速度需要减低系统默认监控时间,若提高系统默认监控时间则广播消息发送速度会相应显著下降,而在本方案使用的广播处理机制下,普通类型的广播消息可以快速发送,提高广播消息发送速度的同时,设置的预设监控时间大于系统默认的监控时间,使得超时响应机制被触发的概率显著下降。
在所述对发送的包含所述标识值的广播消息的处理时间进行监控之后,还包括:依据对应的广播接收者处理所述广播消息的反馈结果,取消对所述广播消息的处理时间的监控,所述反馈结果包含所述广播消息的标识值。如果接收到广播接收者的反馈结果,则依据反馈结果中的标识值确定对应的监控的广播消息,并解除对该广播消息的监控。
本实施例提供了一种广播处理方法,在提高广播消息处理速度的同时,降低了发送超时响应的概率,进一步完善了广播处理机制,提高了广播处理效率。
图4是本申请实施例提供的一种广播处理装置的结构框图,该装置用于执行上述实施例提供的广播处理方法,具备执行方法相应的功能模块和有益效果。如图4所示,该装置具体包括:获取模块401、确定模块402、发送模块403。
其中,获取模块401,用于获取广播队列中当前发送的广播消息;
确定模块402,用于确定所述广播消息的类型;
发送模块403,用于如果所述广播消息的类型为普通广播,则调用发送所述广播消息的接口,将所述广播消息发送至对应的广播接收者。
本实施例提供的技术方案,解决了现有的广播机制存在的缺陷,提高了广播处理效率,降低了系统资源消耗,使得系统稳定性增加。
可选的,所述发送模块403具体用于:生成反馈参数,依据所述反馈参数调用发送所述广播消息的接口,将所述广播消息发送至对应的广播接收者。
可选的,所述发送模块403具体用于:如果所述广播消息的类型为普通广播,则确定对应的广播接收者的数量,依据所述广播接收者的数量,调用相应次数的发送所述广播消息的接口,将所述广播消息依次和/或同步发送至对应的广播接收者。
可选的,所述发送模块403具体包括:标识值设置单元4031,用于创建广播消息对象,设置所述广播消息的标识值,并将所述标识值添加至所述广播消息中;发送单元4032,用于将包含所述标识值的广播消息发送至对应的广播接收者;监控单元4033,用于对发送的包含所述标识值的广播消息的处理时间进行监控,如果所述处理时间大于预设监控时间,则触发超时响应机制,其中,所述预设监控时间大于系统默认的监控时间。
可选的,所述监控单元4033还用于:在所述对发送的包含所述标识值的广播消息的处理时间进行监控之后,依据对应的广播接收者处理所述广播消息的反馈结果,取消对所述广播消息的处理时间的监控,所述反馈结果包含所述广播消息的标识值。
本申请实施例还提供一种存储介质,所述存储介质中存储有多条指令,所述指令适于由处理器加载以执行上述任一实施例所述的广播处理方法中的步骤。
需要说明的是,本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于计算机可读存储介质中,存储介质可以包括:只读存储器(ROM,Read
Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁盘或光盘等。
本实施例在上述各实施例的基础上提供了一种终端设备,该终端设备可以包括本申请提供的广播处理装置。图5是本申请实施例提供的一种终端设备的结构示意图,如图5所示,该终端设备可以包括:存储器501、中央处理器(Central
Processing Unit,CPU)502、外设接口503、RF(Radio
Frequency,射频)电路505、音频电路506、扬声器511、电源管理芯片508、输入/输出(I/O)子系统509、触摸屏512、其他输入/控制设备510以及外部端口504,这些部件通过一个或多个通信总线或信号线507来通信。
应该理解的是,图示终端设备500仅仅是终端设备的一个范例,并且终端设备500可以具有比图中所示出的更多的或者更少的部件,可以组合两个或更多的部件,或者可以具有不同的部件配置。图中所示出的各种部件可以在包括一个或多个信号处理以及专用集成电路在内的硬件、软件、或硬件和软件的组合中实现。
下面就本实施例提供的用于多开应用的权限管理的终端设备进行详细的描述,该终端设备以智能手机为例。
存储器501,所述存储器501可以被CPU502、外设接口503等访问,所述存储器501可以包括高速随机存取存储器,还可以包括非易失性存储器,例如一个或多个磁盘存储器件、闪存器件、或其他易失性固态存储器件。
外设接口503,所述外设接口503可以将设备的输入和输出外设连接到CPU502和存储器501。
I/O子系统509,所述I/O子系统509可以将设备上的输入输出外设,例如触摸屏512和其他输入/控制设备510,连接到外设接口503。I/O子系统509可以包括显示控制器5091和用于控制其他输入/控制设备510的一个或多个输入控制器5092。其中,一个或多个输入控制器5092从其他输入/控制设备510接收电信号或者向其他输入/控制设备510发送电信号,其他输入/控制设备510可以包括物理按钮(按压按钮、摇臂按钮等)、拨号盘、滑动开关、操纵杆、点击滚轮。值得说明的是,输入控制器5092可以与以下任一个连接:键盘、红外端口、USB接口以及诸如鼠标的指示设备。
触摸屏512,所述触摸屏512是用户终端与用户之间的输入接口和输出接口,将可视输出显示给用户,可视输出可以包括图形、文本、图标、视频等。
I/O子系统509中的显示控制器5091从触摸屏512接收电信号或者向触摸屏512发送电信号。触摸屏512检测触摸屏上的接触,显示控制器5091将检测到的接触转换为与显示在触摸屏512上的用户界面对象的交互,即实现人机交互,显示在触摸屏512上的用户界面对象可以是运行游戏的图标、联网到相应网络的图标等。值得说明的是,设备还可以包括光鼠,光鼠是不显示可视输出的触摸敏感表面,或者是由触摸屏形成的触摸敏感表面的延伸。
RF电路505,主要用于建立手机与无线网络(即网络侧)的通信,实现手机与无线网络的数据接收和发送。例如收发短信息、电子邮件等。具体地,RF电路505接收并发送RF信号,RF信号也称为电磁信号,RF电路505将电信号转换为电磁信号或将电磁信号转换为电信号,并且通过该电磁信号与通信网络以及其他设备进行通信。RF电路505可以包括用于执行这些功能的已知电路,其包括但不限于天线系统、RF收发机、一个或多个放大器、调谐器、一个或多个振荡器、数字信号处理器、CODEC(COder-DECoder,编译码器)芯片组、用户标识模块(Subscriber
Identity Module,SIM)等等。
音频电路506,主要用于从外设接口503接收音频数据,将该音频数据转换为电信号,并且将该电信号发送给扬声器511。
扬声器511,用于将手机通过RF电路505从无线网络接收的语音信号,还原为声音并向用户播放该声音。
电源管理芯片508,用于为CPU502、I/O子系统及外设接口所连接的硬件进行供电及电源管理。
本申请实施例提供的CPU502可执行如下操作:
获取广播队列中当前发送的广播消息;
确定所述广播消息的类型;
如果所述广播消息的类型为普通广播,则调用发送所述广播消息的接口,将所述广播消息发送至对应的广播接收者。
可选的,所述调用发送所述广播消息的接口,将所述广播消息发送至对应的广播接收者包括:
生成反馈参数,依据所述反馈参数调用发送所述广播消息的接口,将所述广播消息发送至对应的广播接收者。
可选的,所述如果所述广播消息的类型为普通广播,则调用发送所述广播消息的接口,将所述广播消息发送至对应的广播接收者包括:
如果所述广播消息的类型为普通广播,则确定对应的广播接收者的数量,依据所述广播接收者的数量,调用相应次数的发送所述广播消息的接口,将所述广播消息依次和/或同步发送至对应的广播接收者。
可选的,所述将所述广播消息发送至对应的广播接收者包括:
创建广播消息对象,设置所述广播消息的标识值,并将所述标识值添加至所述广播消息中,将包含所述标识值的广播消息发送至对应的广播接收者;
对发送的包含所述标识值的广播消息的处理时间进行监控,如果所述处理时间大于预设监控时间,则触发超时响应机制,其中,所述预设监控时间大于系统默认的监控时间。
可选的,在所述对发送的包含所述标识值的广播消息的处理时间进行监控之后,还包括:
依据对应的广播接收者处理所述广播消息的反馈结果,取消对所述广播消息的处理时间的监控,所述反馈结果包含所述广播消息的标识值。
注意,上述仅为本申请的较佳实施例及所运用技术原理。本领域技术人员会理解,本申请不限于这里所述的特定实施例,对本领域技术人员来说能够进行各种明显的变化、重新调整和替代而不会脱离本申请的保护范围。因此,虽然通过以上实施例对本申请进行了较为详细的说明,但是本申请不仅仅限于以上实施例,在不脱离本申请构思的情况下,还可以包括更多其他等效实施例,而本申请的范围由所附的权利要求范围决定。
Claims (20)
- 一种广播处理方法,其中,包括:获取广播队列中当前发送的广播消息;确定所述广播消息的类型;如果所述广播消息的类型为普通广播,则调用发送所述广播消息的接口,将所述广播消息发送至对应的广播接收者。
- 根据权利要求1所述的方法,其中,所述调用发送所述广播消息的接口,将所述广播消息发送至对应的广播接收者包括:生成反馈参数,依据所述反馈参数调用发送所述广播消息的接口,将所述广播消息发送至对应的广播接收者。
- 根据权利要求2所述的方法,其中,所述如果所述广播消息的类型为普通广播,则调用发送所述广播消息的接口,将所述广播消息发送至对应的广播接收者包括:如果所述广播消息的类型为普通广播,则确定对应的广播接收者的数量,依据所述广播接收者的数量,调用相应次数的发送所述广播消息的接口,将所述广播消息依次和/或同步发送至对应的广播接收者。
- 根据权利要求1所述的方法,其中,所述将所述广播消息发送至对应的广播接收者包括:创建广播消息对象,设置所述广播消息的标识值,并将所述标识值添加至所述广播消息中,将包含所述标识值的广播消息发送至对应的广播接收者;对发送的包含所述标识值的广播消息的处理时间进行监控,如果所述处理时间大于预设监控时间,则触发超时响应机制,其中,所述预设监控时间大于系统默认的监控时间。
- 根据权利要求4所述的方法,其中,在所述对发送的包含所述标识值的广播消息的处理时间进行监控之后,还包括:依据对应的广播接收者处理所述广播消息的反馈结果,取消对所述广播消息的处理时间的监控,所述反馈结果包含所述广播消息的标识值。
- 根据权利要求4所述的方法,其中,所述标识值为哈希值。
- 根据权利要求1所述的方法,其中,所述确定所述广播消息的类型,包括:根据发送所述广播消息时使用的发送指令确定所述广播消息的类型。
- 一种广播处理装置,其中,包括:获取模块,用于获取广播队列中当前发送的广播消息;确定模块,用于确定所述广播消息的类型;发送模块,用于如果所述广播消息的类型为普通广播,则调用发送所述广播消息的接口,将所述广播消息发送至对应的广播接收者。
- 根据权利要求8所述的装置,其中,所述发送模块具体用于:生成反馈参数,依据所述反馈参数调用发送所述广播消息的接口,将所述广播消息发送至对应的广播接收者。
- 根据权利要求9所述的装置,其中,所述发送模块具体用于:如果所述广播消息的类型为普通广播,则确定对应的广播接收者的数量,依据所述广播接收者的数量,调用相应次数的发送所述广播消息的接口,将所述广播消息依次和/或同步发送至对应的广播接收者。
- 根据权利要求8所述的装置,其中,所述发送模块具体包括:标识值设置单元,用于创建广播消息对象,设置所述广播消息的标识值,并将所述标识值添加至所述广播消息中;发送单元,用于将包含所述标识值的广播消息发送至对应的广播接收者;监控单元,用于对发送的包含所述标识值的广播消息的处理时间进行监控,如果所述处理时间大于预设监控时间,则触发超时响应机制,其中,所述预设监控时间大于系统默认的监控时间。
- 根据权利要求11所述的装置,其中,所述监控单元还用于:在所述对发送的包含所述标识值的广播消息的处理时间进行监控之后,依据对应的广播接收者处理所述广播消息的反馈结果,取消对所述广播消息的处理时间的监控,所述反馈结果包含所述广播消息的标识值。
- 一种存储介质,其中,所述存储介质中存储有多条指令,所述指令适于由处理器加载以执行上述权利要求1至7任一项所述广播处理方法。
- 一种终端设备,包括:处理器、存储器以及存储在存储器上并可在处理器上运行的计算机程序,其中,所述处理器执行所述计算机程序时实现以下步骤:获取广播队列中当前发送的广播消息;确定所述广播消息的类型;如果所述广播消息的类型为普通广播,则调用发送所述广播消息的接口,将所述广播消息发送至对应的广播接收者。
- 根据权利要求14所述的终端设备,其中,所述调用发送所述广播消息的接口,将所述广播消息发送至对应的广播接收者包括:生成反馈参数,依据所述反馈参数调用发送所述广播消息的接口,将所述广播消息发送至对应的广播接收者。
- 根据权利要求15所述的终端设备,其中,所述如果所述广播消息的类型为普通广播,则调用发送所述广播消息的接口,将所述广播消息发送至对应的广播接收者包括:如果所述广播消息的类型为普通广播,则确定对应的广播接收者的数量,依据所述广播接收者的数量,调用相应次数的发送所述广播消息的接口,将所述广播消息依次和/或同步发送至对应的广播接收者。
- 根据权利要求14所述的终端设备,其中,所述将所述广播消息发送至对应的广播接收者包括:创建广播消息对象,设置所述广播消息的标识值,并将所述标识值添加至所述广播消息中,将包含所述标识值的广播消息发送至对应的广播接收者;对发送的包含所述标识值的广播消息的处理时间进行监控,如果所述处理时间大于预设监控时间,则触发超时响应机制,其中,所述预设监控时间大于系统默认的监控时间。
- 根据权利要求17所述的终端设备,其中,在所述对发送的包含所述标识值的广播消息的处理时间进行监控之后,还包括:依据对应的广播接收者处理所述广播消息的反馈结果,取消对所述广播消息的处理时间的监控,所述反馈结果包含所述广播消息的标识值。
- 根据权利要求17所述的终端设备,其中,所述标识值为哈希值。
- 根据权利要求14所述的终端设备,其中,所述确定所述广播消息的类型,包括:根据发送所述广播消息时使用的发送指令确定所述广播消息的类型。
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
EP17900023.7A EP3592004B1 (en) | 2017-03-10 | 2017-10-21 | Broadcast processing method, device, storage medium and terminal device |
US16/565,385 US10819455B2 (en) | 2017-03-10 | 2019-09-09 | Broadcast processing method, non-transitory storage medium, and electronic device |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710140903.3 | 2017-03-10 | ||
CN201710140903.3A CN106686557B (zh) | 2017-03-10 | 2017-03-10 | 广播处理方法、装置和终端设备 |
Related Child Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US16/565,385 Continuation US10819455B2 (en) | 2017-03-10 | 2019-09-09 | Broadcast processing method, non-transitory storage medium, and electronic device |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2018161593A1 true WO2018161593A1 (zh) | 2018-09-13 |
Family
ID=58828625
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2017/107186 WO2018161593A1 (zh) | 2017-03-10 | 2017-10-21 | 广播处理方法、装置、存储介质和终端设备 |
Country Status (4)
Country | Link |
---|---|
US (2) | US20180262284A1 (zh) |
EP (1) | EP3592004B1 (zh) |
CN (1) | CN106686557B (zh) |
WO (1) | WO2018161593A1 (zh) |
Families Citing this family (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11663628B2 (en) | 2012-05-14 | 2023-05-30 | Iqzone, Inc. | Systems and methods for unobtrusively displaying media content on portable devices |
CN106686557B (zh) | 2017-03-10 | 2019-05-03 | Oppo广东移动通信有限公司 | 广播处理方法、装置和终端设备 |
US10637786B2 (en) * | 2017-12-07 | 2020-04-28 | California Eastern Laboratories, Inc. | Network traffic and processor activity management apparatuses, systems, and methods |
US10637677B2 (en) * | 2017-12-07 | 2020-04-28 | California Eastern Laboratories, Inc. | Broadcast transmission control apparatuses, systems, and methods |
CN109992309B (zh) * | 2017-12-29 | 2021-03-12 | Oppo广东移动通信有限公司 | 应用程序处理方法和装置、电子设备、计算机可读存储介质 |
SG11202007783XA (en) | 2018-06-28 | 2021-01-28 | Ulvac Techno Ltd | Power supply apparaus for electrostatic chuck and substrate control method |
CN110244834B (zh) * | 2019-05-15 | 2021-06-11 | 深圳市优博讯科技股份有限公司 | 一种应用行为对齐方法及终端设备 |
CN110351669B (zh) * | 2019-06-28 | 2022-05-31 | 南京中感微电子有限公司 | 蓝牙无线广播发射、接收方法、设备及通信系统 |
US20210125229A1 (en) | 2019-10-25 | 2021-04-29 | Iqzone, Inc. | System and method for using activity-backed overlays to display media content on portable devices during periods of user inactivity |
CN113556696A (zh) * | 2021-07-23 | 2021-10-26 | Tcl通讯(宁波)有限公司 | 认证短信发送方法、装置、系统、设备和存储介质 |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101156463A (zh) * | 2003-11-19 | 2008-04-02 | 捷讯研究有限公司 | 为wlan启用无线通信设备提供网络广播信息的方法和装置 |
CN105872989A (zh) * | 2016-06-12 | 2016-08-17 | 天津市北海通信技术有限公司 | 广播信息下发方法及系统 |
US20170055139A1 (en) * | 2015-08-18 | 2017-02-23 | At&T Intellectual Property I, L.P. | Supplementing Broadcast Messages |
CN106686557A (zh) * | 2017-03-10 | 2017-05-17 | 广东欧珀移动通信有限公司 | 广播处理方法、装置和终端设备 |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR100504836B1 (ko) * | 2003-05-15 | 2005-07-29 | 엘지전자 주식회사 | 이동 통신 단말기의 동보전송 메시지 송수신 방법 |
US9319161B2 (en) * | 2012-04-09 | 2016-04-19 | Youtoo Technologies, LLC | Participating in television programs |
CN103595547B (zh) * | 2013-11-15 | 2016-07-13 | 北京奇虎科技有限公司 | 智能设备的广播拦截方法和装置 |
CN104994481B (zh) | 2015-07-10 | 2018-09-28 | 上海斐讯数据通信技术有限公司 | 一种Android系统中应用程序之间广播消息的收发方法及系统 |
CN105897438A (zh) | 2016-03-22 | 2016-08-24 | 上海斐讯数据通信技术有限公司 | 一种广播发送方法及装置 |
-
2017
- 2017-03-10 CN CN201710140903.3A patent/CN106686557B/zh active Active
- 2017-10-21 EP EP17900023.7A patent/EP3592004B1/en active Active
- 2017-10-21 WO PCT/CN2017/107186 patent/WO2018161593A1/zh unknown
- 2017-10-26 US US15/794,716 patent/US20180262284A1/en not_active Abandoned
-
2019
- 2019-09-09 US US16/565,385 patent/US10819455B2/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101156463A (zh) * | 2003-11-19 | 2008-04-02 | 捷讯研究有限公司 | 为wlan启用无线通信设备提供网络广播信息的方法和装置 |
US20170055139A1 (en) * | 2015-08-18 | 2017-02-23 | At&T Intellectual Property I, L.P. | Supplementing Broadcast Messages |
CN105872989A (zh) * | 2016-06-12 | 2016-08-17 | 天津市北海通信技术有限公司 | 广播信息下发方法及系统 |
CN106686557A (zh) * | 2017-03-10 | 2017-05-17 | 广东欧珀移动通信有限公司 | 广播处理方法、装置和终端设备 |
Non-Patent Citations (1)
Title |
---|
See also references of EP3592004A4 |
Also Published As
Publication number | Publication date |
---|---|
US20200008016A1 (en) | 2020-01-02 |
EP3592004B1 (en) | 2020-10-07 |
EP3592004A1 (en) | 2020-01-08 |
US10819455B2 (en) | 2020-10-27 |
CN106686557A (zh) | 2017-05-17 |
US20180262284A1 (en) | 2018-09-13 |
CN106686557B (zh) | 2019-05-03 |
EP3592004A4 (en) | 2020-02-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2018161593A1 (zh) | 广播处理方法、装置、存储介质和终端设备 | |
WO2018151505A1 (en) | Electronic device and method for displaying screen thereof | |
WO2018021678A1 (en) | Electronic device and method for operating the same | |
EP3414647A1 (en) | Electronic device and method for activating applications therefor | |
WO2018076861A1 (zh) | 数据传输的控制方法、装置、存储介质、服务器及系统 | |
WO2018076819A1 (zh) | 数据的上传方法、装置、存储介质、电子设备及系统 | |
WO2018076841A1 (zh) | 数据分享方法、装置、存储介质及服务器 | |
WO2020180042A1 (en) | Electronic device for transmitting response message in bluetooth network environment and method thereof | |
WO2018076867A1 (zh) | 数据备份的删除方法、装置、系统、存储介质和服务器 | |
WO2018161580A1 (zh) | 广播的控制方法、装置、存储介质及电子设备 | |
EP2994810A1 (en) | Method and apparatus for displaying user interface through sub device that is connectable with portable electronic device | |
WO2018161575A1 (zh) | 调整广播消息队列的方法、装置、存储介质及终端 | |
WO2018233352A1 (zh) | 数据传输方法、装置、终端以及计算机可读存储介质 | |
WO2017107557A1 (zh) | 一种基于移动终端的快捷菜单弹出方法及系统 | |
WO2018171534A1 (zh) | 基于移动终端的双摄像头供电控制方法、系统及移动终端 | |
WO2018161601A1 (zh) | 屏幕背光调节方法、装置、存储介质及电子设备 | |
WO2018076888A1 (zh) | 移动终端数据的同步方法、装置及系统、存储介质及移动终端 | |
WO2018161576A1 (zh) | 一种广播的控制方法、装置、存储介质及移动终端 | |
WO2018161581A1 (zh) | 控制广播发送的方法、装置、存储介质及电子设备 | |
WO2018161595A1 (zh) | 广播接收器的注册方法、装置、终端设备及存储介质 | |
WO2018161592A1 (zh) | 切换背景灰阶进行省电的方法、装置、存储介质及电子设备 | |
WO2018145597A1 (zh) | 基于移动终端的屏幕补光拍照方法及系统、移动终端 | |
WO2016192589A1 (zh) | 一种信息传输方法、装置及系统 | |
WO2018161588A1 (zh) | 广播接收者队列调整方法、装置、存储介质及电子设备 | |
WO2018076880A1 (zh) | 数据备份方法、装置、存储介质及终端 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 17900023 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
ENP | Entry into the national phase |
Ref document number: 2017900023 Country of ref document: EP Effective date: 20190930 |