Control method and apparatus for broadcast sending, storage medium, and electronic device
A control method for broadcast sending includes: acquiring a receiver queue corresponding to a broadcast message to be sent; determining a target receiver according to priorities of receivers in the receiver queue and a predetermined priority; and sending the broadcast message to the target receiver.
1. A control method for broadcast sending, comprising:
acquiring a receiver queue corresponding to a broadcast message to be sent;
determining a target receiver according to a priority of each receiver in the receiver queue and a predetermined priority; and
sending the broadcast message to the target receiver;
wherein determining the target receiver according to the priority of each receiver in the receiver queue and the predetermined priority comprises:
acquiring user operation records of a plurality of receivers having a same priority;
sorting recent usage of the plurality of receivers based on the user operation records; and
determining the target receiver according to a sorting result;
wherein acquiring the user operation records of the plurality of receivers having the same priority comprises:
acquiring a switching time of each receiver, wherein the switching time is a time when the receiver is switched from a foreground operation to a background operation; and
calculating a time difference between the switching time and a current time, wherein the time difference indicates recent usage of the receiver;
wherein sorting the recent usage of the plurality of receivers based on the user operation records comprises:
sorting the plurality of receivers having the same priority according to a numerical order of the time difference.
2. The control method for broadcast sending as claimed in claim 1 , wherein acquiring the receiver queue corresponding to the broadcast message to be sent comprises:
acquiring applications that subscribe to the broadcast message to be sent; and
generating the receiver queue corresponding to the broadcast message according to the acquired applications.
3. A storage medium, having a plurality of instructions stored therein, the instructions being adapted to be loaded by a processor to perform operations of:
acquiring a receiver queue corresponding to a broadcast message to be sent;
determining a target receiver according to a priority of each receiver in the receiver queue and a predetermined priority; and
sending the broadcast message to the target receiver;
wherein determining the target receiver according to the priority of each receiver in the receiver queue and the predetermined priority comprises:
acquiring user operation records of a plurality of receivers having a same priority;
sorting recent usage of the plurality of receivers based on the user operation records; and
determining the target receiver according to a sorting result;
wherein acquiring the user operation records of the plurality of receivers having the same priority comprises:
acquiring a switching time of each receiver, wherein the switching time is a time when the receiver is switched from a foreground operation to a background operation; and
calculating a time difference between the switching time and a current time, wherein the time difference indicates recent usage of the receiver;
wherein sorting the recent usage of the plurality of receivers based on the user operation records comprises:
sorting the plurality of receivers having the same priority according to a numerical order of the time difference.
4. An electronic device, comprising:
a memory, a processor and a computer program that is stored on the memory and runnable on the processor,
wherein the computer program is executed by the processor to implement the following operations:
acquiring a receiver queue corresponding to a broadcast message to be sent;
determining a target receiver according to a priority of each receiver in the receiver queue and a predetermined priority; and
sending the broadcast message to the target receiver;
wherein determining the target receiver according to the priority of each receiver in the receiver queue and the predetermined priority comprises:
acquiring user operation records of a plurality of receivers having a same priority;
sorting recent usage of the plurality of receivers based on the user operation records; and
determining the target receiver according to a sorting result;
wherein acquiring the user operation records of the plurality of receivers having the same priority comprises:
acquiring a switching time of each receiver, wherein the switching time is a time when the receiver is switched from a foreground operation to a background operation; and
calculating a time difference between the switching time and a current time, wherein the time difference indicates recent usage of the receiver;
wherein sorting the recent usage of the plurality of receivers based on the user operation records comprises:
sorting the plurality of receivers having the same priority according to a numerical order of the time difference.
5. The control method for broadcast sending as claimed in claim 1 , wherein the priority of each receiver in the receiver queue are priorities defined by a system for a broadcast mechanism or system process recycling priorities of applications; and a priority of a perceptible application receiver is used as the predetermined priority.
6. The control method for broadcast sending as claimed in claim 1 , wherein the user operation records of the plurality of receivers comprises:
records of time nodes which reflect an order of a user opens applications, closes applications, or switches applications to run in the background.
7. The control method for broadcast sending as claimed in claim 1 , wherein determining the target receiver according to the sorting result comprises:
on a basis of determining the target receiver according to the predetermined priority, sorting, according to the recent usage, receivers having a lowest priority in the determined target receiver, and canceling sending of the broadcast message to one or more receivers having a lower recent usage sorting result; or,
using one or more receivers having most recent usage in each priority as the target receiver.
8. The electronic device as claimed in claim 4 , wherein in acquiring the receiver queen corresponding to the broadcast message to be sent, the computer program is executed by the processor to implement the following operations:
acquiring applications that subscribe to the broadcast message to be sent; and
generating the receiver queue corresponding to the broadcast message according to the acquired applications.