CN115277557B - Broadcast processing method, device, electronic equipment and storage medium - Google Patents

Broadcast processing method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115277557B
CN115277557B CN202210884568.9A CN202210884568A CN115277557B CN 115277557 B CN115277557 B CN 115277557B CN 202210884568 A CN202210884568 A CN 202210884568A CN 115277557 B CN115277557 B CN 115277557B
Authority
CN
China
Prior art keywords
broadcast
queue
broadcasting
processed
receiver
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN202210884568.9A
Other languages
Chinese (zh)
Other versions
CN115277557A (en
Inventor
吏渊
刘桦
张剑秋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202210884568.9A priority Critical patent/CN115277557B/en
Publication of CN115277557A publication Critical patent/CN115277557A/en
Application granted granted Critical
Publication of CN115277557B publication Critical patent/CN115277557B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/15Flow control; Congestion control in relation to multipoint traffic
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/542Event management; Broadcasting; Multicasting; Notifications
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/24Traffic characterised by specific attributes, e.g. priority or QoS
    • H04L47/2425Traffic characterised by specific attributes, e.g. priority or QoS for supporting services specification, e.g. SLA
    • H04L47/2433Allocation of priorities to traffic types
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling
    • H04L47/62Queue scheduling characterised by scheduling criteria
    • H04L47/6215Individual queue per QOS, rate or priority
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling
    • H04L47/62Queue scheduling characterised by scheduling criteria
    • H04L47/625Queue scheduling characterised by scheduling criteria for service slots or service orders
    • H04L47/6275Queue scheduling characterised by scheduling criteria for service slots or service orders based on priority
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/548Queue

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The application discloses a broadcast processing method, a device, an electronic device and a storage medium, wherein the broadcast processing method comprises the following steps: dividing the broadcasting to be processed into a plurality of broadcasting queues according to the receiver types of broadcasting receivers of the broadcasting to be processed, wherein each broadcasting queue corresponds to a different receiver type, and the broadcasting receivers to be processed in each broadcasting queue correspond to the receiver types corresponding to each broadcasting queue; and if the to-be-processed broadcast is an ordered broadcast, transmitting the to-be-processed broadcast in the plurality of broadcast queues in parallel, wherein the to-be-processed broadcast is serially transmitted to broadcast receivers of the to-be-processed broadcast in each broadcast queue. The method can reduce the influence among the receivers of different receiver types of the serial broadcasting and accelerate the processing speed of the serial broadcasting.

Description

Broadcast processing method, device, electronic equipment and storage medium
Technical Field
The present invention relates to the technical field of electronic devices, and in particular, to a broadcast processing method, apparatus, electronic device, and storage medium.
Background
Broadcasting in the Android (Android) system is a mechanism widely applied to information transmission among application programs, and broadcasting in the Android is used for monitoring system events or application program events. Broadcasts can be generally classified into ordered broadcasts, unordered broadcasts, etc., wherein ordered broadcasts are transmitted to each broadcast receiver one by one in a serial manner. However, in such a scheme, since it takes time for each broadcast receiver to receive a broadcast, the broadcast receivers affect each other when receiving the broadcast.
Disclosure of Invention
The application provides a broadcast processing method, a device, electronic equipment and a storage medium, which can reduce the influence among receivers of different receiver types of serial broadcast and accelerate the processing speed of the serial broadcast.
In a first aspect, an embodiment of the present application provides a broadcast processing method, where the method includes: dividing the broadcasting to be processed into a plurality of broadcasting queues according to the receiver types of broadcasting receivers of the broadcasting to be processed, wherein each broadcasting queue corresponds to a different receiver type, and the broadcasting receivers to be processed in each broadcasting queue correspond to the receiver types corresponding to each broadcasting queue; and if the to-be-processed broadcast is an ordered broadcast, transmitting the to-be-processed broadcast in the plurality of broadcast queues in parallel, wherein the to-be-processed broadcast is serially transmitted to broadcast receivers of the to-be-processed broadcast in each broadcast queue.
In a second aspect, an embodiment of the present application provides a broadcast processing apparatus, including: the system comprises a broadcast dividing module and a broadcast sending module, wherein the broadcast dividing module is used for dividing a to-be-processed broadcast into a plurality of broadcast queues according to the type of a receiver to which the broadcast receiver corresponding to the to-be-processed broadcast belongs, each broadcast queue corresponds to a different receiver type, and the broadcast receiver to be processed broadcast in each broadcast queue corresponds to the type of the receiver corresponding to each broadcast queue; the broadcast transmitting module is configured to transmit the broadcast to be processed in the plurality of broadcast queues in parallel if the broadcast to be processed is an ordered broadcast, where the broadcast to be processed is serially transmitted to broadcast receivers of the broadcast to be processed in each broadcast queue.
In a third aspect, an embodiment of the present application provides an electronic device, including: one or more processors; a memory; one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications configured to perform the broadcast processing method provided in the first aspect above.
In a fourth aspect, embodiments of the present application provide a computer readable storage medium having stored therein program code that is callable by a processor to perform the broadcast processing method provided in the first aspect described above.
According to the scheme, the to-be-processed broadcast is divided into a plurality of broadcast queues according to the types of the receivers of the to-be-processed broadcast receivers, each broadcast queue corresponds to a different receiver type, the to-be-processed broadcast receivers in each broadcast queue correspond to the corresponding receiver type of each broadcast queue, and if the to-be-processed broadcast is an ordered broadcast, the to-be-processed broadcast in the plurality of broadcast queues is sent in parallel, wherein the to-be-processed broadcast is serially sent to the to-be-processed broadcast receivers in each broadcast queue. The to-be-processed broadcast is divided into a plurality of broadcast queues of different receiver types, and the to-be-processed broadcasts in the plurality of broadcast queues are transmitted in parallel, so that the influence among the receivers of different receiver types when the ordered broadcast is transmitted can be reduced, and the processing speed of the serial broadcast can be accelerated.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 shows a schematic view of a scenario provided in an embodiment of the present application.
Fig. 2 shows a flow chart of a broadcast processing method according to an embodiment of the present application.
Fig. 3 shows a flow chart of a broadcast processing method according to another embodiment of the present application.
Fig. 4 shows a flow chart of a broadcast processing method according to a further embodiment of the present application.
Fig. 5 shows a flow chart of a broadcast processing method according to still another embodiment of the present application.
Fig. 6 shows a schematic view of a scenario provided in an embodiment of the present application.
Fig. 7 shows a block diagram of a broadcast processing apparatus according to an embodiment of the present application.
Fig. 8 is a block diagram of an electronic device for performing a broadcast processing method according to an embodiment of the present application.
Fig. 9 is a storage unit for storing or carrying program codes for implementing the broadcast processing method according to the embodiment of the present application.
Detailed Description
In order to enable those skilled in the art to better understand the present application, the following description will make clear and complete descriptions of the technical solutions in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application.
In an Android (Android) system, broadcasting is used as one of four important Android components, and is mainly used for enabling Android applications to mutually send and receive broadcast messages with the Android system and other Android applications. The broadcasting usage scenario is often that a broadcast is sent out under a certain condition, and multiple broadcast receiving objects receivers can monitor the broadcast notification and make corresponding changes. Such as on/off screen, and network state switching, etc., will send out corresponding broadcast.
Broadcasting is generally classified into ordered broadcasting, which corresponds to a serial transmission manner, and unordered broadcasting, which corresponds to a parallel transmission manner. As shown in fig. 1, a broadcast, when transmitted, enters a serial queue and a parallel queue according to its broadcast type (ordered broadcast or unordered broadcast) and is then transmitted to a broadcast receiver registered to listen to the broadcast.
The processing mode for the broadcasting in the parallel queue is as follows: each broadcast is simultaneously transmitted to all broadcast receivers of the broadcast in parallel, and after all broadcast receiving groups of the broadcast receive the broadcast and process the broadcast, the next broadcast is started to be transmitted in parallel in the mode. The processing mode for broadcasting in the serial queue is as follows: each broadcast is sent to each broadcast receiving object one by one according to the priority order of broadcast receivers determined by the system or a random sending mode, after the processing is finished, the broadcast is sent to the next broadcast receiver, and the process is carried out until all broadcast receivers of the broadcast receive the broadcast and process the broadcast, namely the processing of the broadcast is finished, and then the next broadcast is sent in the mode.
In the above serial transmission manner, since the time consumed for the broadcast receiver to receive the broadcast may be different, the time consumed for a part of the broadcast receivers to receive the broadcast may be long, which may result in a later time for receiving the broadcast after the broadcast receiver, so that the broadcast receivers may affect each other when receiving the broadcast; in addition, when the time consumption of part of broadcasting receivers is long, the total sending duration of the broadcasting is long, so that the processing of other broadcasting which is arranged behind the current broadcasting in the serial queue is further influenced, and the broadcasting sending efficiency of the serial queue is reduced.
In order to solve the above problems, the inventor proposes a broadcast processing method, a device, an electronic apparatus and a storage medium provided by the embodiments of the present application, which can reduce the influence between receivers of different receiver types of serial broadcasting when sending ordered broadcasting, and accelerate the processing speed of serial broadcasting. The specific broadcast processing method is described in detail in the following embodiments.
The following describes the broadcast processing method provided in the embodiment of the present application in detail with reference to the accompanying drawings.
Referring to fig. 2, fig. 2 is a flow chart illustrating a broadcast processing method according to an embodiment of the present application. In a specific embodiment, the broadcast processing method is applied to a broadcast processing apparatus 400 as shown in fig. 7 and an electronic device 100 (fig. 8) configured with the broadcast processing apparatus 400. The specific flow of the embodiment will be described below by taking an electronic device as an example, and it will be understood that the electronic device applied in the embodiment may be a smart phone, a tablet computer, a smart watch, an electronic book, etc., which is not limited herein. The following details about the flow shown in fig. 2, the broadcast processing method specifically may include the following steps:
Step S110: dividing the broadcast to be processed into a plurality of broadcast queues according to the receiver types of the broadcast receivers of the broadcast to be processed, wherein each broadcast queue corresponds to a different receiver type, and the broadcast receivers of the broadcast to be processed in each broadcast queue correspond to the receiver types corresponding to each broadcast queue.
The broadcast refers to a broadcast sender, and is used for transmitting information between the broadcast sender and a broadcast receiver, for example, the broadcast may be on/off screen, network state switching, telephone broadcasting, etc. The broadcast sender is a system or application transmitting a broadcast, and the broadcast receiver is a system or application registered with the broadcast for receiving the broadcast and processing related services. Applications may include software, programs, components, etc.; the broadcast receiver may register the broadcast dynamically or may register the broadcast statically, without limitation.
When a broadcast sender sends a broadcast, the broadcast may be sent to a broadcast management module, for example, an activity management service (activitymanagement), by calling a broadcast sending function, for example, a sendroadcast function, and the broadcast management module may place the broadcast as a to-be-processed broadcast in a broadcast sending queue after receiving the broadcast, that is, the broadcast in the broadcast sending queue is the to-be-processed broadcast, that is, the broadcast to be sent by the broadcast management module to a broadcast receiver according to a receiving condition through a process communication mechanism. For convenience in explaining the broadcast processing method provided in the embodiments of the present application, the broadcast to be processed may be any broadcast to be transmitted to a broadcast receiver.
In the embodiment of the present application, the to-be-processed broadcast in the broadcast transmission queue may be divided into different broadcast queues according to the receiver types of the broadcast receivers of the to-be-processed broadcast, and each broadcast queue corresponds to a different receiver type, and then the broadcasts in the respective broadcast queues are processed in parallel, so that the interaction of the broadcast receivers of different receiver types when receiving the broadcast is reduced in the case that the broadcast is an ordered broadcast. In addition, in order to avoid the repetition of the transmission of the to-be-processed broadcast, the broadcast receivers in each broadcast queue correspond to the receiver type corresponding to each broadcast queue, that is, all the receivers corresponding to the to-be-processed broadcast are divided into different broadcast queues according to the receiver type corresponding to the broadcast queue, so that the to-be-processed broadcast is only transmitted to the broadcast receivers of the receiver type corresponding to the broadcast queue when the to-be-processed broadcast is located in each broadcast queue.
In some embodiments, the receiver type may be an application type of the receiver, for example, may include a system application type and a third party application type, and thus, in a case where the broadcast to be processed is an ordered broadcast, by sequentially transmitting the broadcast to be processed in each broadcast queue to the broadcast receiver in parallel, interaction between the broadcast receiver of the system application type and the broadcast receiver of the third party application type when receiving the broadcast can be reduced.
In other embodiments, the receiver types may be types that are divided in advance according to the reception priorities of all possible broadcast receivers, and the receiver types corresponding to the broadcast receivers with different reception priorities are different. Thus, by the subsequent steps, the interaction of the broadcast receivers of the receiver types corresponding to different reception priorities in receiving the broadcast can be reduced.
In one possible implementation, the above-mentioned receiving priority may be determined according to the number of runs of the application corresponding to the broadcast receiver. For example, all the broadcasting receivers existing can be ranked according to the order of the running times of the applications corresponding to the broadcasting receivers from large to small, the ranking result is obtained, and then the priorities of the broadcasting receivers in different ranking intervals are determined to be different priorities according to the ranking result.
In a possible implementation manner, the receiving priority may also be an adj priority corresponding to each broadcast receiver. The adj priority is used for sequentially releasing the memories according to the sizes of the adj priorities when the memories are insufficient, and the importance of the processes can be reflected to a certain extent, so that the receiving priority of the broadcast receiver can be determined based on the adj priorities.
In still other embodiments, the recipient type may be a process type of the broadcast recipient, e.g., the process type includes an interactive process, a batch process, a monitoring process, etc. Thus, in the case where the broadcasting to be processed is an ordered broadcasting, by sequentially transmitting the broadcasting to be processed in each broadcasting queue in parallel to the broadcasting receivers, it is possible to reduce the mutual influence of the broadcasting receivers of different process types when receiving the broadcasting.
Of course, in the embodiment of the present application, the specific manner of dividing the receiver types may not be limited.
Step S120: and if the to-be-processed broadcast is an ordered broadcast, transmitting the to-be-processed broadcast in the plurality of broadcast queues in parallel, wherein the to-be-processed broadcast is serially transmitted to broadcast receivers of the to-be-processed broadcast in each broadcast queue.
In this embodiment of the present application, after the to-be-processed broadcast is divided into broadcast queues corresponding to a plurality of different receiver types, and the broadcast receivers to be processed in each broadcast queue are made to correspond to the receiver types corresponding to each broadcast queue, the to-be-processed broadcast in each broadcast queue may be sent according to the broadcast type of the to-be-processed broadcast. If the broadcast to be processed is an ordered broadcast, the broadcast to be processed in the plurality of broadcast queues may be transmitted in parallel, and the broadcast to be processed in each broadcast queue is serially transmitted to the broadcast receiver of the broadcast to be processed in each broadcast queue. Therefore, the broadcasting to be processed is transmitted in the broadcasting queues corresponding to different receiver types in series, the mutual influence of broadcasting receivers of different process types when receiving the broadcasting can be reduced, and in addition, the broadcasting to be processed is transmitted in parallel in a plurality of broadcasting queues, so that the transmission speed of the broadcasting to be processed can be improved.
In some embodiments, if the pending broadcast is an out-of-order broadcast, the pending broadcasts in each broadcast queue may be sent in parallel, with the pending broadcasts being sent in each broadcast queue in parallel to the broadcast receivers of the pending broadcasts in each broadcast queue. Optionally, in order to avoid the problem that resources are tensed due to broadcast concurrency when there are more broadcast receivers in any broadcast queue to be processed, the to-be-processed broadcast in each broadcast queue may be processed, so as to avoid the problem of operation blocking.
According to the broadcast processing method, before the broadcast to be processed is sent, the broadcast to be processed is divided into the plurality of broadcast queues of different receiver types, and the broadcast to be processed in the plurality of broadcast queues is sent in parallel, so that the influence among receivers of different receiver types when ordered broadcast is sent can be reduced, the processing speed of serial broadcast is accelerated, and the operation blocking of electronic equipment is avoided.
Referring to fig. 3, fig. 3 is a flow chart illustrating a broadcast processing method according to another embodiment of the present application. The broadcast processing method is applied to the electronic device, and will be described in detail with respect to the flowchart shown in fig. 3, where the broadcast processing method specifically includes the following steps:
Step S210: dividing the to-be-processed broadcast into a plurality of broadcast queues according to the receiver types existing in all the receiver types of the broadcast receivers corresponding to the to-be-processed broadcast, wherein each broadcast queue corresponds to a different receiver type.
In this embodiment of the present application, before a broadcast to be processed is sent, all broadcast receivers of the broadcast to be processed may be obtained, and the receiver types of all broadcast receivers are determined, so as to obtain the receiver types existing in all broadcast receivers, and then the broadcast to be processed is divided into a plurality of broadcast queues according to the existing receiver types, where each broadcast queue corresponds to one of the existing receiver types. That is, the broadcasting to be processed is divided into broadcasting queues corresponding to each of the recipient types according to each of the recipient types existing.
In some embodiments, after determining the receiver types of all broadcast receivers, it may be determined whether there are multiple receiver types; if there are multiple receiver types, it means that if the broadcast to be processed is an ordered broadcast, the broadcast to be processed is directly transmitted according to the transmission mode of the ordered broadcast, so that different receiver types will affect when receiving the broadcast, and therefore in this case, the broadcast to be processed may be divided into multiple broadcast queues according to the receiver types existing in the receiver types of all the broadcast receivers corresponding to the broadcast to be processed, and the subsequent steps may be performed. If there is only one receiver type among the receiver types of all the broadcasting receivers, that is, all the broadcasting receivers of the to-be-processed broadcasting are of the same receiver type, the to-be-processed broadcasting may be transmitted in series or in parallel directly according to the broadcasting type (ordered broadcasting or unordered broadcasting) of the to-be-processed broadcasting in this case, so that all the broadcasting receivers of the to-be-processed broadcasting receive the to-be-processed broadcasting.
In some embodiments, a plurality of different broadcast queues may be created in the electronic device in advance according to all possible receiver types, and each broadcast queue corresponds to one receiver type. When the broadcast to be processed is processed, the type of the receiver existing in the broadcast receiver can be determined, and then the broadcast to be processed is divided into the broadcast queues corresponding to the type of the receiver existing.
In one possible implementation, the recipient type may be an application type corresponding to the recipient, the application type including a system application type and a third party application type. The electronic device may be configured with a first broadcast queue and a second broadcast queue, where a receiver type corresponding to the first broadcast queue is a system application type, and a receiver type corresponding to the second broadcast queue is a third party application type. When the broadcast to be processed is processed, whether the system application type exists in the receiver types of all receivers corresponding to the broadcast to be processed and whether the third party application type exists can be judged; if the system application type and the third party application type exist, the to-be-processed broadcast can be distributed to the first broadcast queue and the second broadcast queue, and the to-be-processed broadcast in the first broadcast queue and the second broadcast queue can be transmitted subsequently.
Step S220: and distributing all the broadcast receivers to each broadcast queue according to the corresponding receiver type of each broadcast queue to obtain the broadcast receivers to be processed and broadcast in each broadcast queue.
In this embodiment of the present application, after the to-be-processed broadcast is divided into a plurality of broadcast queues, since the to-be-processed broadcast exists in the plurality of broadcast queues at the same time, in order to avoid that the to-be-processed broadcast is repeatedly sent to the same broadcast receiver, the broadcast receiver of the to-be-processed broadcast may be further divided, so that the broadcast receiver of the to-be-processed broadcast in the broadcast queue corresponds to the receiver type corresponding to the located broadcast queue. And distributing all the broadcast receivers to each broadcast queue according to the receiver type corresponding to each broadcast queue, so as to obtain the broadcast receivers to be processed and broadcast in each broadcast queue, and enabling the broadcast receivers to be processed and broadcast in each broadcast queue to correspond to the receiver type corresponding to each broadcast queue. Therefore, when the to-be-processed broadcast in the broadcast queue is transmitted subsequently, the to-be-processed broadcast is only transmitted to the broadcast receiver in the broadcast queue, so that the to-be-processed broadcast is prevented from being repeatedly transmitted to the same broadcast receiver.
In some embodiments, in a case where the receiver type is an application type corresponding to the receiver, the application type includes a system application type and a third party application type, and the broadcast queue corresponding to the system application type is a first broadcast queue, and the broadcast queue corresponding to the third party application type is a second broadcast queue. When dividing the broadcast receivers corresponding to the broadcast to be processed, distributing the broadcast receivers of the system application type in all the broadcast receivers to the first broadcast queue to obtain the broadcast receivers of the broadcast to be processed in the first broadcast queue; and distributing the broadcast receivers of the third-party application type in all the broadcast receivers to the second broadcast queue to obtain the broadcast receivers to be processed and broadcast in the second broadcast queue. Therefore, the broadcast receiver to be processed in the first broadcast queue can be made to correspond to the receiver type (namely, the system application type) corresponding to the first broadcast queue, and the broadcast receiver to be processed in the second broadcast queue is made to correspond to the receiver type (namely, the third party application type) corresponding to the second broadcast queue.
Step S230: and if the to-be-processed broadcast is an ordered broadcast, transmitting the to-be-processed broadcast in the plurality of broadcast queues in parallel, wherein the to-be-processed broadcast is serially transmitted to broadcast receivers of the to-be-processed broadcast in each broadcast queue.
In the embodiment of the present application, step S230 may refer to the content of other embodiments, which is not described herein.
According to the broadcast processing method provided by the embodiment of the invention, when the broadcast to be processed is processed, the broadcast to be processed is divided into a plurality of broadcast queues according to the types of receivers in all the types of receivers of the broadcast receivers corresponding to the broadcast to be processed, each broadcast queue corresponds to one existing type of receiver, and all the broadcast receivers are divided according to the types of receivers corresponding to the broadcast queues, so that the receivers of the broadcast to be processed in the broadcast queues correspond to the types of receivers corresponding to the broadcast queues, and then the broadcast to be processed in the plurality of broadcast queues is transmitted in parallel under the condition that the broadcast to be processed is the ordered broadcast, therefore, the influence among the receivers of different types of receivers when the ordered broadcast is transmitted can be reduced, and the processing speed of the serial broadcast is accelerated.
Referring to fig. 4, fig. 4 is a flow chart illustrating a broadcast processing method according to another embodiment of the present application. The broadcast processing method is applied to the electronic device, and will be described in detail with respect to the flowchart shown in fig. 4, where the broadcast processing method specifically includes the following steps:
step S310: dividing the broadcast to be processed into a plurality of broadcast queues according to the receiver types of the broadcast receivers of the broadcast to be processed, wherein each broadcast queue corresponds to a different receiver type, and the broadcast receivers of the broadcast to be processed in each broadcast queue correspond to the receiver types corresponding to each broadcast queue.
In the embodiment of the present application, step S310 may refer to the content of other embodiments, which is not described herein.
Step S320: if the broadcasting to be processed is orderly broadcasting, the broadcasting to be processed in each broadcasting queue is sent into a serial sending queue corresponding to each broadcasting queue, and the broadcasting in the serial sending queues is orderly broadcasting.
In this embodiment of the present application, after the to-be-processed broadcast is divided into a plurality of broadcast queues, the to-be-processed broadcast in each broadcast queue may be sent according to the broadcast type of the to-be-processed broadcast and the broadcast receiver corresponding to the to-be-processed broadcast in each broadcast queue. Under the condition that the to-be-processed broadcast is an ordered broadcast, the to-be-processed broadcast in each broadcast queue can be sent into a serial transmission queue corresponding to each broadcast queue. The electronic device may create a serial transmission queue and a parallel transmission queue for each broadcast queue in advance, where the serial transmission queue is used to transmit ordered broadcasts in the broadcast queue, and the parallel transmission queue is used to transmit unordered broadcasts in the broadcast queue.
Step S330: and executing the broadcasting transmission tasks of the ordered broadcasting in each serial transmission queue in parallel, and serially transmitting the broadcasting to be processed in each serial transmission queue to broadcasting receivers of the broadcasting to be processed in each broadcasting queue.
In this embodiment of the present application, for the ordered broadcast in the serial transmission queues corresponding to the plurality of broadcast queues, the broadcast transmission task of the ordered broadcast in each serial transmission queue may be executed in parallel, so that the to-be-processed broadcast in each serial transmission queue may be serially transmitted to the broadcast receiver to be processed broadcast in the broadcast queue corresponding to each serial transmission queue. It can be understood that after the to-be-processed broadcast is sent to the serial transmission queue, the broadcast receiver of the to-be-processed broadcast in the serial transmission queue is the broadcast receiver of the to-be-processed broadcast in the broadcast queue corresponding to the serial transmission queue, for example, the broadcast queue 1 corresponds to the serial transmission queue 1, and after the to-be-processed broadcast in the broadcast queue 1 is sent to the serial transmission queue 1, the broadcast receiver of the to-be-processed broadcast in the serial transmission queue 1 is the broadcast receiver of the to-be-processed broadcast in the broadcast queue 1, thereby executing the transmission task of the orderly broadcast in the serial transmission queue 1, and then the to-be-processed broadcast can be serially transmitted to the broadcast receiver of the to-be-processed broadcast in the broadcast queue 1.
Step S340: and if the broadcasting to be processed is unordered broadcasting, sending the broadcasting to be processed in each broadcasting queue into a parallel sending queue corresponding to each broadcasting queue, wherein the broadcasting in the parallel sending queues is unordered broadcasting.
In this embodiment of the present application, in the case where the broadcast to be processed is an unordered broadcast, the broadcast to be processed in each broadcast queue may be sent to a parallel transmission queue corresponding to each broadcast queue, so that the broadcast to be processed is transmitted to a broadcast receiver of the broadcast to be processed in each broadcast queue through the parallel transmission queue corresponding to each broadcast queue.
Step S350: and preprocessing the unordered broadcast in the parallel transmission queue.
In the embodiment of the present application, when considering that when the unordered broadcast in the parallel transmission queue is instantaneously transmitted to each broadcast receiver, if the number of broadcast receivers is large, resource shortage will be caused, so that before the unordered broadcast in the parallel transmission queue is transmitted, the unordered broadcast is further preprocessed. The unordered broadcasting in each parallel transmission queue can be preprocessed in various modes, so that the condition that the unordered broadcasting instant transmission causes resource shortage is avoided.
In one possible implementation, preprocessing the unordered broadcast in the parallel transmission queue corresponding to each broadcast queue may include: and filtering the broadcast receiver corresponding to each unordered broadcast in the parallel transmission queue according to the receiver information of the broadcast receiver corresponding to each unordered broadcast in the parallel transmission queue. The receiver information may include a packet name, action, etc. corresponding to the broadcast receiver. It will be appreciated that there may be multiple modules listening to the same broadcast at run time for the same application, and thus broadcast receivers of the broadcast may be registered for the multiple modules respectively, but the receiver information corresponding to the modules is consistent, i.e. the broadcast receivers are all in fact the same application. Based on the above, by filtering out the repeated broadcast receivers belonging to the same application program according to the receiver information of the broadcast receivers, the number of the broadcast receivers belonging to the same application program is 1, so that the repeated transmission of unordered broadcast can be reduced, and the condition that the unordered broadcast instantaneous transmission causes resource shortage is avoided.
In one possible implementation, preprocessing the unordered broadcast in the parallel transmission queue corresponding to each broadcast queue may include: determining abnormal broadcasting in the parallel transmission queue according to the transmission times of each unordered broadcasting in the parallel transmission queue in the current time period, wherein the transmission times corresponding to the abnormal broadcasting are greater than preset times; filtering the abnormal broadcast from the parallel transmission queue.
In this embodiment, considering that some malicious broadcasts may be transmitted in a large number of times in a short time, in order to avoid the situation that the unordered broadcast instantaneously transmits to cause resource shortage, the number of times of transmission of each unordered broadcast in the parallel transmission queue in the current time period may also be determined, and according to the number of times of transmission of each unordered broadcast in the current time period, a broadcast with a number of times of transmission greater than a preset number of times is determined from all unordered broadcasts in the parallel transmission queue, and the broadcast is used as an abnormal broadcast in the parallel transmission queue, and the determined abnormal broadcast is filtered from the parallel transmission queue, so that transmission of the abnormal broadcast can be prevented from occupying a large amount of resources. The current time period refers to a time period within a preset time period before the current time, and the preset time period may be 30 seconds, 1 minute, 2 minutes, or the like, which is not limited herein.
In one possible implementation, preprocessing the unordered broadcast in the parallel transmission queue corresponding to each broadcast queue may include: and updating the transmission sequence of each unordered broadcast in the parallel transmission queue according to the priority of the broadcast sender corresponding to each unordered broadcast in the parallel transmission queue. It can be understood that, in the case that there are a plurality of unordered broadcasts in the parallel transmission queue, in order to ensure that unordered broadcasts transmitted by broadcast transmitters with high importance in the parallel transmission queue are preferentially transmitted, unordered broadcasts in the parallel transmission queue may be ordered according to priorities of broadcast transmitters corresponding to respective unordered broadcasts in the parallel transmission queue. Wherein, the higher the priority of the broadcast sender, the earlier the order of the unordered broadcast sent by the broadcast sender in the parallel transmission queue. Alternatively, the priority of the broadcast receiver may be a process priority, such as an adj priority or the like.
It will be appreciated that the various embodiments described above may also be combined with one another, that is, the out-of-order broadcasts in a parallel transmit queue may be pre-processed as provided by one or more of the embodiments described above.
Step S360: and executing broadcast transmission tasks of unordered broadcasts in each parallel transmission queue in parallel, and transmitting the to-be-processed broadcasts in each parallel transmission queue to broadcast receivers of the to-be-processed broadcasts in each broadcast queue in parallel.
In the embodiment of the present application, after the unordered broadcast in the parallel transmission queues is preprocessed, the broadcast transmission task of the unordered broadcast in each parallel transmission queue may be executed in parallel, so that the unordered broadcast in the parallel transmission queue corresponding to each broadcast queue may be transmitted in parallel, and further, the to-be-processed broadcast in each broadcast queue may be transmitted in parallel to the broadcast receiver of the to-be-processed broadcast in each broadcast queue.
In some embodiments, in consideration of the situation that the unordered broadcast instantaneous transmission may cause a resource shortage, thereby causing the electronic device to operate to be stuck, it may also be determined whether the current operation state of the electronic device satisfies the preset state condition before step S360 is performed. The method comprises the steps that a preset state condition is used as a judging basis for judging whether broadcasting transmission tasks in parallel transmission queues are executed currently, if the current running state of the electronic equipment meets the preset state condition, broadcasting transmission tasks of unordered broadcasting in each parallel transmission queue can be executed in parallel, and the broadcasting to be processed in each parallel transmission queue is transmitted to broadcasting receivers of the broadcasting to be processed in each broadcasting queue in parallel; and if the current running state of the electronic equipment meets the preset state condition, currently suspending to execute the broadcasting transmission task of the unordered broadcasting in each parallel transmission queue.
The current running state of the electronic device may include a current system resource state, a running scene, and the like of the electronic device. The operation scene of the electronic equipment can comprise a photographing scene, a WeChat video scene, an application switching scene, a game scene and the like; the system resource status of the electronic device may include status information of a memory resource, status information of a central processing unit, status information of a graphics processor, status information of an input/output resource, status information of a temperature, and the like, which are not limited herein.
In one possible embodiment, the preset status condition includes at least one of the following conditions: the current system resource state meets the preset resource state condition; the current operation scene is a preset scene. The system resource state satisfies a preset resource state condition, for example, the system resource state includes a current availability of the central processing unit, and if the current availability is greater than the preset availability, the system resource state satisfies the preset resource state condition; for another example, the system resource state includes a remaining memory resource, and when the remaining memory resource is greater than the predetermined memory value, the system resource state is indicated to satisfy the predetermined resource state condition.
In some embodiments, the electronic device may further determine a total number of broadcast receivers corresponding to the unordered broadcast to which transmission is currently to be performed in the parallel transmission queues corresponding to all the broadcast queues; in case the total number is larger than the preset number, the broadcast transmission tasks of the unordered broadcast in each of the parallel transmission queues may be suspended from being executed in parallel.
Alternatively, broadcast transmission tasks of out-of-order broadcasts in the partially parallel transmission queue may also be suspended. For example, according to the broadcast receiver type corresponding to the broadcast queue corresponding to each parallel transmission queue, the parallel transmission queues are ordered according to the order of the priority (for example, process priority) corresponding to the broadcast receiver type from high to low, and the last target number of parallel transmission queues is determined from the ordering result, and then the broadcast transmission tasks of unordered broadcast in the target number of parallel transmission queues are suspended.
According to the broadcast processing method provided by the embodiment of the invention, before the broadcast to be processed is sent, the broadcast to be processed in each broadcast queue is divided into a plurality of broadcast queues of different receiver types, and the broadcast to be processed in each broadcast queue is sent into a serial transmission queue or a parallel transmission queue corresponding to each broadcast queue according to the broadcast type of the broadcast to be processed, and then the broadcast transmission tasks in the transmission queues are executed in parallel, so that the influence among receivers of different receiver types in the ordered broadcast transmission process can be reduced, and the processing speed of the serial broadcast can be accelerated. In addition, the unordered broadcasting in the parallel transmission queues corresponding to the broadcasting queues is preprocessed, so that the condition that the unordered broadcasting instant transmission causes resource shortage is avoided.
Referring to fig. 5, fig. 5 is a schematic flow chart of a broadcast processing method according to still another embodiment of the present application. The broadcast processing method is applied to the electronic device, and will be described in detail with respect to the flowchart shown in fig. 5, where the broadcast processing method specifically includes the following steps:
step S410: dividing the broadcast to be processed into a plurality of broadcast queues according to the receiver types of the broadcast receivers of the broadcast to be processed, wherein each broadcast queue corresponds to a different receiver type, and the broadcast receivers of the broadcast to be processed in each broadcast queue correspond to the receiver types corresponding to each broadcast queue.
Step S420: and if the to-be-processed broadcast is an ordered broadcast, transmitting the to-be-processed broadcast in the plurality of broadcast queues in parallel, wherein the to-be-processed broadcast is serially transmitted to broadcast receivers of the to-be-processed broadcast in each broadcast queue.
In the embodiment of the present application, step S410 and step S420 may refer to the content of the foregoing embodiment, and are not described herein.
Step S430: and acquiring all service components used when the application program runs in the running process of the broadcast sender of the to-be-processed broadcast and the application program corresponding to the broadcast receiver.
In the embodiment of the application, in order to further improve the running speed of the electronic device, to avoid blocking during running, all service components used by the broadcast sender of the to-be-processed broadcast and the application programs corresponding to the broadcast receiver in the running process, namely, service components, can be obtained. The service component is also one of four components of the android system; the electronic device may store the component information of all the above service components to quickly load the resources required for the application when the above application is started to run next time.
Step S440: and loading all the service components in parallel when the application program starts to run next time.
In the embodiment of the application, when the next starting operation of the above application is detected, all the service components can be loaded in parallel, that is, when the starting operation of the above application is started, all the service components are loaded in parallel, so that resources required by the operation of the above application can be rapidly loaded, and further, the blocking of the operation of the application is avoided.
In some embodiments, the electronic device may further predict a time when the above application is likely to be used, and load the activity component of the above application in advance when the above application is predicted to be run, so as to increase the running speed of the above application and avoid the blocking of the application during running. The specific manner of the time when the application program of the electronic device may be used is not limited, for example, a corresponding prediction model may be trained according to historical usage data of the electronic device by the user, so as to predict the possibility that the application program will be used in real time through the trained prediction model, thereby predicting the time when the application program will be used.
According to the broadcast processing method, before the broadcast to be processed is sent, the broadcast to be processed is divided into the plurality of broadcast queues of different receiver types, and the broadcast to be processed in the plurality of broadcast queues is sent in parallel, so that the influence among receivers of different receiver types when ordered broadcast is sent can be reduced, the processing speed of serial broadcast is accelerated, and the operation blocking of electronic equipment is avoided. In addition, all service components used by the broadcast application programs corresponding to the sender and the receiver in the running process are stored, and the required service components are loaded in parallel when the application programs start to run next time, so that resources required by the application programs in the running process can be rapidly loaded, and further, the clamping of the application programs in the running process is avoided.
The broadcast processing method according to the foregoing embodiment will be described with reference to fig. 6.
As shown in fig. 6, broadcast and service components in the core components of the system may be proxied. The broadcasting agent can divide the broadcasting into a first broadcasting queue corresponding to the system application type and a second broadcasting queue corresponding to the third party application type according to the receiver type of the broadcasting receiver, and the broadcasting receiver broadcasted in each broadcasting queue corresponds to the receiver type corresponding to each broadcasting queue; the broadcasting after entering each broadcasting queue is sent into a serial transmission queue or a parallel transmission queue corresponding to each broadcasting queue according to the broadcasting type (ordered broadcasting or unordered broadcasting) of the broadcasting, then the ordered broadcasting in the serial transmission queue is transmitted in a serial transmission mode, unordered broadcasting in the parallel transmission queue is transmitted in a parallel transmission mode, and preprocessing is carried out on the broadcasting-free broadcasting in the parallel transmission queue so as to avoid the condition that the unordered broadcasting instantaneous transmission causes resource shortage. In addition, the proxy is also carried out on the service component started when the application program runs, the component information of the service component is stored, and the service component required by concurrent loading is loaded according to the stored component information when the application program starts to be started next time, so that the resource loading speed of the application program is accelerated.
Referring to fig. 7, a block diagram of a broadcast processing apparatus 400 according to an embodiment of the present application is shown. The broadcast processing apparatus 400 is applied to the above-described electronic device, and the broadcast processing apparatus 400 includes: the broadcast dividing module 410 and the broadcast transmitting module 420. The broadcast dividing module 410 is configured to divide the broadcast to be processed into a plurality of broadcast queues according to a receiver type to which a broadcast receiver corresponding to the broadcast to be processed belongs, where each broadcast queue corresponds to a different receiver type, and the broadcast receiver of the broadcast to be processed in each broadcast queue corresponds to the receiver type corresponding to each broadcast queue; the broadcast transmitting module 420 is configured to transmit the broadcast to be processed in the plurality of broadcast queues in parallel if the broadcast to be processed is an ordered broadcast, where the broadcast to be processed is serially transmitted to broadcast receivers of the broadcast to be processed in each broadcast queue.
In some embodiments, the broadcast dividing module 410 may include a first dividing unit and a second dividing unit. The first dividing unit is used for dividing the broadcast to be processed into a plurality of broadcast queues according to the receiver types existing in the receiver types of all the broadcast receivers corresponding to the broadcast to be processed, and each broadcast queue corresponds to a different receiver type; the second dividing unit is configured to allocate all the broadcast receivers to each broadcast queue according to the receiver type corresponding to each broadcast queue, so as to obtain the broadcast receiver to be processed and broadcast in each broadcast queue.
In one possible implementation, the first dividing unit may be specifically configured to: if the system application type and the third party application type exist in the receiver types of all the broadcasting receivers corresponding to the to-be-processed broadcasting, distributing the to-be-processed broadcasting to a first broadcasting queue and a second broadcasting queue; the receiver type corresponding to the first broadcast queue is a system application type, and the receiver type corresponding to the second broadcast queue is a third party application type.
Alternatively, the second dividing unit may be specifically configured to: distributing the broadcast receivers of the system application type in all the broadcast receivers to the first broadcast queue to obtain the broadcast receivers to be processed and broadcast in the first broadcast queue; and distributing the broadcast receivers of the third-party application type in all the broadcast receivers to the second broadcast queue to obtain the broadcast receivers to be processed and broadcast in the second broadcast queue.
In some embodiments, the broadcast transmitting module 420 may include a first feeding unit and a first transmitting unit. The first sending unit is used for sending the to-be-processed broadcast in each broadcast queue into a serial sending queue corresponding to each broadcast queue if the to-be-processed broadcast is an ordered broadcast, wherein the broadcasts in the serial sending queues are all ordered broadcasts; the first transmitting unit is used for executing the broadcasting transmitting task of the orderly broadcasting in each serial transmitting queue in parallel, and serially transmitting the broadcasting to be processed in each serial transmitting queue to the broadcasting receiver of the broadcasting to be processed in each broadcasting queue.
In some embodiments, the broadcast transmitting module 420 may further include a second feeding unit, a preprocessing unit, and a second transmitting unit. The second sending unit is used for sending the to-be-processed broadcast in each broadcast queue into a parallel sending queue corresponding to each broadcast queue if the to-be-processed broadcast is unordered broadcast, wherein the broadcasts in the parallel sending queues are unordered broadcasts; the preprocessing unit is used for preprocessing unordered broadcasting in the parallel transmission queue; the second transmitting unit is used for executing broadcast transmitting tasks of unordered broadcasts in each parallel transmitting queue in parallel, and transmitting the to-be-processed broadcasts in each parallel transmitting queue to broadcast receivers of the to-be-processed broadcasts in each broadcast queue in parallel.
In one possible embodiment, the preprocessing unit may be specifically configured to: and filtering the broadcast receiver corresponding to each unordered broadcast in the parallel transmission queue according to the receiver information of the broadcast receiver corresponding to each unordered broadcast in the parallel transmission queue.
In one possible embodiment, the preprocessing unit may be specifically configured to: and updating the transmission sequence of each unordered broadcast in the parallel transmission queue according to the priority of the broadcast sender corresponding to each unordered broadcast in the parallel transmission queue.
In one possible embodiment, the preprocessing unit may be specifically configured to: determining abnormal broadcasting in the parallel transmission queue according to the transmission times of each unordered broadcasting in the parallel transmission queue in the current time period, wherein the transmission times corresponding to the abnormal broadcasting are greater than preset times; filtering the abnormal broadcast from the parallel transmission queue.
In one possible implementation, the second sending unit may be specifically configured to: and if the current running state of the electronic equipment meets the preset state condition, parallelly executing broadcast transmission tasks of unordered broadcasts in each parallel transmission queue, and parallelly transmitting the to-be-processed broadcasts in each parallel transmission queue to broadcast receivers of the to-be-processed broadcasts in each broadcast queue.
Optionally, the preset state condition includes at least one of the following conditions: the current system resource state meets the preset resource state condition; the current operation scene is a preset scene.
In some embodiments, the broadcast processing module 400 may further include a component acquisition module and a component loading module. The component acquisition module is used for acquiring all service components used when the application program runs in the process of running the application program corresponding to the broadcast sender and the broadcast receiver of the to-be-processed broadcast; the component loading module is used for loading all the service components in parallel when the application program starts to run next time.
It will be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the apparatus and modules described above may refer to the corresponding process in the foregoing method embodiment, which is not repeated herein.
In several embodiments provided herein, the coupling of the modules to each other may be electrical, mechanical, or other.
In addition, each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist alone physically, or two or more modules may be integrated into one module. The integrated modules may be implemented in hardware or in software functional modules.
In summary, according to the scheme provided by the present application, the to-be-processed broadcast is divided into a plurality of broadcast queues according to the receiver types of the broadcast receivers of the to-be-processed broadcast, each broadcast queue corresponds to a different receiver type, the broadcast receivers of the to-be-processed broadcast in each broadcast queue corresponds to the receiver type corresponding to each broadcast queue, and if the to-be-processed broadcast is an ordered broadcast, the to-be-processed broadcast in the plurality of broadcast queues is sent in parallel, wherein the to-be-processed broadcast is serially sent to the broadcast receivers of the to-be-processed broadcast in each broadcast queue. The to-be-processed broadcast is divided into a plurality of broadcast queues of different receiver types, and the to-be-processed broadcasts in the plurality of broadcast queues are transmitted in parallel, so that the influence among the receivers of different receiver types when the ordered broadcast is transmitted can be reduced, and the processing speed of the serial broadcast can be accelerated.
Referring to fig. 8, a block diagram of an electronic device according to an embodiment of the present application is shown. The electronic device 100 may be an electronic device capable of running an application program, such as a smart phone, a tablet computer, a smart watch, an electronic book, etc. The electronic device 100 in this application may include one or more of the following components: a processor 110, a memory 120, and one or more applications, wherein the one or more applications may be stored in the memory 120 and configured to be executed by the one or more processors 110, the one or more applications configured to perform the method as described in the foregoing method embodiments.
Processor 110 may include one or more processing cores. The processor 110 utilizes various interfaces and lines to connect various portions of the overall electronic device 100, perform various functions of the electronic device 100, and process data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 120, and invoking data stored in the memory 120. Alternatively, the processor 110 may be implemented in hardware in at least one of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), programmable logic array (Programmable Logic Array, PLA). The processor 110 may integrate one or a combination of several of a central processing unit (Central Processing Unit, CPU), a graphics processor (Graphics Processing Unit, GPU), and a modem, etc. The CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for being responsible for rendering and drawing of display content; the modem is used to handle wireless communications. It will be appreciated that the modem may not be integrated into the processor 110 and may be implemented solely by a single communication chip.
The Memory 120 may include a random access Memory (Random Access Memory, RAM) or a Read-Only Memory (Read-Only Memory). Memory 120 may be used to store instructions, programs, code, sets of codes, or sets of instructions. The memory 120 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing the various method embodiments described below, etc. The storage data area may also store data created by the electronic device 100 in use (e.g., phonebook, audiovisual data, chat log data), and the like.
Referring to fig. 9, a block diagram of a computer readable storage medium according to an embodiment of the present application is shown. The computer readable medium 800 has stored therein program code which can be invoked by a processor to perform the methods described in the method embodiments described above.
The computer readable storage medium 800 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer readable storage medium 800 comprises a non-volatile computer readable medium (non-transitory computer-readable storage medium). The computer readable storage medium 800 has storage space for program code 810 that performs any of the method steps described above. The program code can be read from or written to one or more computer program products. Program code 810 may be compressed, for example, in a suitable form.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and are not limiting thereof; although the present application has been described in detail with reference to the foregoing embodiments, one of ordinary skill in the art will appreciate that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not drive the essence of the corresponding technical solutions to depart from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims (14)

1. A broadcast processing method, the method comprising:
dividing the broadcasting to be processed into a plurality of broadcasting queues according to the receiver types of broadcasting receivers of the broadcasting to be processed, wherein each broadcasting queue corresponds to a different receiver type, and the broadcasting receivers to be processed in each broadcasting queue correspond to the receiver types corresponding to each broadcasting queue;
if the broadcasting to be processed is orderly broadcasting, the broadcasting to be processed in each broadcasting queue is sent into a serial transmission queue corresponding to each broadcasting queue, and the broadcasting in the serial transmission queues is orderly broadcasting;
And executing the broadcasting transmission tasks of the ordered broadcasting in each serial transmission queue in parallel, and serially transmitting the broadcasting to be processed in each serial transmission queue to broadcasting receivers of the broadcasting to be processed in each broadcasting queue.
2. The method of claim 1, wherein the dividing the pending broadcast into a plurality of broadcast queues according to a receiver type of a broadcast receiver of the pending broadcast comprises:
dividing the broadcast to be processed into a plurality of broadcast queues according to the receiver types of all broadcast receivers corresponding to the broadcast to be processed, wherein each broadcast queue corresponds to a different receiver type;
and distributing all the broadcast receivers to each broadcast queue according to the corresponding receiver type of each broadcast queue to obtain the broadcast receivers to be processed and broadcast in each broadcast queue.
3. The method according to claim 2, wherein the dividing the pending broadcast into a plurality of broadcast queues according to a receiver type existing in the receiver types of all broadcast receivers corresponding to the pending broadcast includes:
If the system application type and the third party application type exist in the receiver types of all the broadcasting receivers corresponding to the to-be-processed broadcasting, distributing the to-be-processed broadcasting to a first broadcasting queue and a second broadcasting queue;
the receiver type corresponding to the first broadcast queue is a system application type, and the receiver type corresponding to the second broadcast queue is a third party application type.
4. The method of claim 3, wherein said assigning all broadcast receivers to each broadcast queue based on the corresponding receiver type of each broadcast queue to obtain the broadcast receiver to be processed for broadcasting in each broadcast queue comprises
Distributing the broadcast receivers of the system application type in all the broadcast receivers to the first broadcast queue to obtain the broadcast receivers to be processed and broadcast in the first broadcast queue;
and distributing the broadcast receivers of the third-party application type in all the broadcast receivers to the second broadcast queue to obtain the broadcast receivers to be processed and broadcast in the second broadcast queue.
5. The method according to any one of claims 1-4, wherein after the partitioning of the pending broadcast into a plurality of broadcast queues according to the recipient type of the broadcast recipient of the pending broadcast, the method further comprises:
If the broadcasting to be processed is unordered broadcasting, the broadcasting to be processed in each broadcasting queue is sent into a parallel sending queue corresponding to each broadcasting queue, and the broadcasting in the parallel sending queues is unordered broadcasting;
preprocessing unordered broadcasting in the parallel transmission queue;
and executing broadcast transmission tasks of unordered broadcasts in each parallel transmission queue in parallel, and transmitting the to-be-processed broadcasts in each parallel transmission queue to broadcast receivers of the to-be-processed broadcasts in each broadcast queue in parallel.
6. The method of claim 5, wherein the preprocessing the out-of-order broadcast in the parallel transmit queue comprises:
and filtering the broadcast receiver corresponding to each unordered broadcast in the parallel transmission queue according to the receiver information of the broadcast receiver corresponding to each unordered broadcast in the parallel transmission queue.
7. The method of claim 5, wherein the preprocessing the out-of-order broadcast in the parallel transmit queue comprises:
and updating the transmission sequence of each unordered broadcast in the parallel transmission queue according to the priority of the broadcast sender corresponding to each unordered broadcast in the parallel transmission queue.
8. The method of claim 5, wherein the preprocessing the out-of-order broadcast in the parallel transmit queue comprises:
determining abnormal broadcasting in the parallel transmission queue according to the transmission times of each unordered broadcasting in the parallel transmission queue in the current time period, wherein the transmission times corresponding to the abnormal broadcasting are greater than preset times;
filtering the abnormal broadcast from the parallel transmission queue.
9. The method of claim 5, wherein said concurrently executing broadcast transmission tasks for unordered broadcasts in each of said concurrent transmission queues concurrently transmits said pending broadcasts in each of said concurrent transmission queues to said broadcast receivers of said pending broadcasts in each of said broadcast queues, comprises:
and if the current running state of the electronic equipment meets the preset state condition, parallelly executing broadcast transmission tasks of unordered broadcasts in each parallel transmission queue, and parallelly transmitting the to-be-processed broadcasts in each parallel transmission queue to broadcast receivers of the to-be-processed broadcasts in each broadcast queue.
10. The method of claim 9, wherein the preset status condition comprises at least one of:
The current system resource state meets the preset resource state condition;
the current operation scene is a preset scene.
11. The method according to any one of claims 1-4, further comprising:
acquiring all service components used when the application program runs in the process of running the application program corresponding to the broadcast sender and the broadcast receiver of the to-be-processed broadcast;
and loading all the service components in parallel when the application program starts to run next time.
12. A broadcast processing apparatus, the apparatus comprising: a broadcast dividing module and a broadcast transmitting module, wherein,
the broadcast dividing module is used for dividing the broadcast to be processed into a plurality of broadcast queues according to the type of the receiver to which the broadcast receiver corresponding to the broadcast to be processed belongs, wherein each broadcast queue corresponds to a different receiver type, and the broadcast receiver to be processed in each broadcast queue corresponds to the type of the receiver corresponding to each broadcast queue;
the broadcast sending module is used for sending the to-be-processed broadcast in each broadcast queue into a serial sending queue corresponding to each broadcast queue if the to-be-processed broadcast is an ordered broadcast, wherein the broadcasts in the serial sending queues are all ordered broadcasts; and executing the broadcasting transmission tasks of the ordered broadcasting in each serial transmission queue in parallel, and serially transmitting the broadcasting to be processed in each serial transmission queue to broadcasting receivers of the broadcasting to be processed in each broadcasting queue.
13. An electronic device, comprising:
one or more processors;
a memory;
one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to perform the method of any of claims 1-11.
14. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a program code, which is callable by a processor for executing the method according to any one of claims 1-11.
CN202210884568.9A 2022-07-25 2022-07-25 Broadcast processing method, device, electronic equipment and storage medium Active CN115277557B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210884568.9A CN115277557B (en) 2022-07-25 2022-07-25 Broadcast processing method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210884568.9A CN115277557B (en) 2022-07-25 2022-07-25 Broadcast processing method, device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN115277557A CN115277557A (en) 2022-11-01
CN115277557B true CN115277557B (en) 2024-01-05

Family

ID=83768401

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210884568.9A Active CN115277557B (en) 2022-07-25 2022-07-25 Broadcast processing method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115277557B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106851592A (en) * 2017-03-10 2017-06-13 广东欧珀移动通信有限公司 A kind of method of adjustment of broadcast recipients, device and terminal
CN106874131A (en) * 2017-03-10 2017-06-20 广东欧珀移动通信有限公司 Broadcast queue's method of adjustment, device and terminal device
CN107070670A (en) * 2017-03-10 2017-08-18 广东欧珀移动通信有限公司 Broadcast transmission person is controlled to send method, device and the terminal device of broadcast message
CN107800546A (en) * 2016-08-31 2018-03-13 华为技术有限公司 The management method and device of a kind of broadcast message
CN110597645A (en) * 2019-09-12 2019-12-20 北京安云世纪科技有限公司 Broadcast processing method and device, electronic equipment and computer readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107800546A (en) * 2016-08-31 2018-03-13 华为技术有限公司 The management method and device of a kind of broadcast message
CN106851592A (en) * 2017-03-10 2017-06-13 广东欧珀移动通信有限公司 A kind of method of adjustment of broadcast recipients, device and terminal
CN106874131A (en) * 2017-03-10 2017-06-20 广东欧珀移动通信有限公司 Broadcast queue's method of adjustment, device and terminal device
CN107070670A (en) * 2017-03-10 2017-08-18 广东欧珀移动通信有限公司 Broadcast transmission person is controlled to send method, device and the terminal device of broadcast message
CN110597645A (en) * 2019-09-12 2019-12-20 北京安云世纪科技有限公司 Broadcast processing method and device, electronic equipment and computer readable storage medium

Also Published As

Publication number Publication date
CN115277557A (en) 2022-11-01

Similar Documents

Publication Publication Date Title
US10891177B2 (en) Message management method and device, and storage medium
CN110808922B (en) Message processing method and device, storage medium and electronic equipment
CN111240837A (en) Resource allocation method, device, terminal and storage medium
EP3592004A1 (en) Broadcast processing method, device, storage medium and terminal device
CN112988362B (en) Task processing method and device, electronic equipment and storage medium
US20170047069A1 (en) Voice processing method and device
CN109766172B (en) Asynchronous task scheduling method and device
CN107832143B (en) Method and device for processing physical machine resources
CN114077568A (en) Inter-core communication method and device, electronic assembly and electronic equipment
CN109062650B (en) Bullet screen message distribution method, device, equipment and storage medium
CN111538572A (en) Task processing method, device, scheduling server and medium
CN114637615A (en) Message processing method and device of message queue, electronic equipment and medium
CN115277557B (en) Broadcast processing method, device, electronic equipment and storage medium
CN113849284A (en) Task running method and device, storage medium and terminal
CN114661433A (en) Event task scheduling method and device, storage medium and electronic equipment
CN106550021B (en) Push method and device for push message
CN109005465B (en) Bullet screen message distribution method, device, equipment and storage medium
CN109067864B (en) Notification message pushing method and device and electronic equipment
CN109101340B (en) Dynamic distribution method, device, equipment and storage medium of barrage message
CN111324387A (en) Application task control method, device, terminal and system
CN115220993B (en) Process monitoring method and device, vehicle and storage medium
CN115794432A (en) Data distribution docking system and method
CN109274509B (en) Broadcast state determination method and device, electronic equipment and storage medium
CN110247808B (en) Information transmission method, device, equipment and readable storage medium
CN109640140B (en) Key processing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant