Broadcast processing method and apparatus
By setting up parallel groups in the broadcast process queue and pre-distributing parallel broadcast receivers, the problem of serial broadcast receivers blocking parallel broadcast receivers is solved, thus improving the efficiency of broadcast distribution and system stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HONOR DEVICE CO LTD
- Filing Date
- 2024-06-29
- Publication Date
- 2026-04-21
AI Technical Summary
During broadcast distribution, if a serial broadcast receiver is enqueued before a parallel broadcast receiver, the distribution process of the parallel broadcast receiver will be delayed, causing system lag.
By pre-setting parallel broadcast receivers in independent parallel groups and pre-completing the broadcast distribution of parallel broadcast receivers when a serial broadcast receiver is detected to be enqueued, the impact of serial broadcast receiver blocking on parallel broadcast receivers is reduced.
It effectively reduces anomalies during broadcast distribution, improves system stability and response speed, and avoids system lag.
Smart Images

Figure CN120768706B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminal technology, and in particular to a broadcast processing method and apparatus. Background Technology
[0002] As one of the four major components of the Android system, broadcast is a mechanism for message passing (e.g., passing data, sending notifications) between components. These components can be in the same process or different processes. In other words, the broadcast mechanism can be understood as an inter-process communication mechanism. The broadcast mechanism utilizes the observer pattern and is based on a message publish / subscribe event model. This model includes message publishers, message subscribers, and a message center. The message publisher, message subscriber, and message center correspond to the sender (broadcast sender), receiver (broadcast receiver), and Activity Manager Service (AMS) in the broadcast mechanism, respectively.
[0003] The sender sends a broadcast (i.e. a broadcast message) to AMS. AMS determines the broadcast receiver corresponding to the broadcast message and assigns the broadcast receiver to each group in the broadcast process queue. AMS then distributes the broadcast to the corresponding broadcast receiver in the order of the groups.
[0004] When an anomaly occurs in a broadcast distribution process within the broadcast process queue, it will cause delays in the broadcast distribution process for some broadcast receivers, potentially leading to system freezes. Therefore, improving the handling of anomalies in the broadcast distribution process is a pressing issue that needs to be addressed. Summary of the Invention
[0005] This application provides a broadcast processing method and apparatus, applied in the field of terminal technology, which enables electronic devices to improve abnormal situations in the broadcast distribution process by distributing broadcasts to parallel broadcast receivers in advance.
[0006] In a first aspect, embodiments of this application propose a broadcast processing method applied to an electronic device, comprising: obtaining a first broadcast receiver and a second broadcast receiver, wherein both the first broadcast receiver and the second broadcast receiver belong to a first broadcast process queue, the first broadcast receiver is a broadcast receiver of the first broadcast, and the second broadcast receiver is a broadcast receiver of the second broadcast; when the second broadcast receiver belongs to a parallel broadcast receiver, distributing the second broadcast to the second broadcast receiver at a first moment, and distributing the first broadcast to the first broadcast receiver at a second moment, wherein the first moment is earlier than the second moment.
[0007] In this way, when the electronic device detects the presence of a parallel broadcast receiver (such as a second broadcast receiver) in the first broadcast process queue, it can reduce the impact of abnormal situations in the first broadcast process queue on the broadcast distribution process of the second broadcast receiver by pre-distributing the broadcast to the second broadcast receiver.
[0008] In one possible implementation, the first broadcast receiver enters the first broadcast process queue at the third time, and the second broadcast receiver enters the first broadcast process queue at the fourth time, with the third time being earlier than the fourth time.
[0009] Understandably, when a serial broadcast receiver joins the queue before a parallel broadcast receiver, the broadcast distribution process of the serial broadcast receiver may block the broadcast distribution process of subsequent parallel broadcast receivers, directly causing the broadcast distribution process of the parallel broadcast receivers to become more time-consuming, with a large amount of distribution time wasted waiting for the serial broadcast. Therefore, electronic devices can execute the broadcast distribution process of the parallel broadcast receivers in advance when they detect that a serial broadcast receiver has joined the queue before the parallel broadcast receivers.
[0010] In one possible implementation, the method further includes: creating a first broadcast process queue, which includes: a normal group, a load group, an emergency group, and a first group, the first group being used to store parallel broadcast receivers; before distributing the second broadcast to the second broadcast receiver at the first moment, the method further includes: setting the second broadcast receiver to the first group, and setting the first broadcast receiver to the normal group or the load group.
[0011] The first group can be the parallel group described in the embodiments of this application.
[0012] Understandably, since parallel broadcast receivers rarely block the first broadcast process queue, they can be placed in parallel groups, allowing electronic devices to directly execute the broadcast distribution process of the parallel broadcast receivers. Furthermore, parallel groups are structurally completely independent of the three subgroups within the broadcast process queue of the native system: ordinary groups, urgent groups, and load groups.
[0013] In one possible implementation, before obtaining the first broadcast receiver and the second broadcast receiver, the method further includes: after detecting an operation to start an electronic device, reading a first parameter from a configuration file in the system server process; and creating a first broadcast process queue, including: creating the first broadcast process queue when the first parameter is detected.
[0014] The first parameter can be the enable value described in the embodiments of this application. When the electronic device does not detect the enable value, the electronic device can create a broadcast process queue containing normal packets, emergency packets, and load packets.
[0015] In this way, electronic devices can maintain the security of the system by detecting the enable value, enabling electronic devices to perform the creation of the first broadcast process queue when parallel group creation is supported.
[0016] In one possible implementation, the first moment is determined based on the enqueue time of the second broadcast receiver and a first preset time interval, where the enqueue time is the time when the second broadcast receiver enters the queue of the first broadcast process.
[0017] The first moment can be the first ready time described in the embodiments of this application. The first preset time interval can also be the time when the electronic device is started up, which is read from the configuration file in the system server process.
[0018] In this way, electronic devices can set a first ready time so that a second broadcast receiver can distribute the broadcast in advance.
[0019] In one possible implementation, the first broadcast receiver is a serial broadcast receiver, and the second broadcast receiver is a parallel broadcast receiver, including: when the second broadcast is an unordered broadcast and the registration method of the second broadcast receiver is dynamic registration, the second broadcast receiver is a parallel broadcast receiver; the first broadcast receiver is a serial broadcast receiver, including: when the first broadcast is an unordered broadcast and the registration method of the first broadcast receiver is static registration, or when the first broadcast is an ordered broadcast, the first broadcast receiver is a serial broadcast receiver.
[0020] In this way, electronic devices can accurately identify whether a broadcast receiver is a serial broadcast receiver or a parallel broadcast receiver by using broadcast attributes and the registration method of the broadcast receiver.
[0021] In one possible implementation, the first broadcast is different from the second broadcast, or the first broadcast is the same as the second broadcast.
[0022] When the first broadcast and the second broadcast are different, the receiver of the first broadcast can... Figure 8 Among the target broadcast receivers, the serial broadcast receivers (such as some args B1 or some args B2) and the second broadcast receivers can belong to the parallel broadcast receivers (such as some args X2).
[0023] When the first broadcast and the second broadcast are the same, the receiver of the first broadcast can be Figure 8 In the target broadcast receiver, the serial broadcast receiver (such as some args B1 or some args B2) can be the second broadcast receiver. Figure 8Parallel broadcast receivers in the target broadcast receiver (such as some args B3 or some args B4).
[0024] It is understood that this application does not limit whether the first broadcast and the second broadcast are the same broadcast.
[0025] In one possible implementation, the first broadcast process queue also includes: a third broadcast receiver corresponding to the third broadcast, where the third broadcast receiver is a parallel broadcast receiver; the method further includes:
[0026] The third broadcast receivers are distributed to the third broadcast at the first moment.
[0027] In this way, if the first broadcast process queue also includes other parallel broadcast receivers (such as the third broadcast receiver), the electronic device can simultaneously execute the broadcast distribution process of the second broadcast receiver and the broadcast distribution process of the third broadcast receiver at the first moment.
[0028] Secondly, embodiments of this application provide a broadcast processing apparatus, which may be an electronic device, or a chip or chip system within an electronic device. The broadcast processing apparatus may include: an acquisition unit, a display unit, and a processing unit. When the broadcast processing apparatus is an electronic device, the acquisition unit is used to perform a data acquisition step to enable the electronic device to implement a broadcast processing method described in the first aspect or any possible implementation of the first aspect. When the broadcast processing apparatus is an electronic device, the display unit may be a display screen. The display unit is used to perform a display step to enable the electronic device to implement a broadcast processing method described in the first aspect or any possible implementation of the first aspect. When the broadcast processing apparatus is an electronic device, the processing unit may be a processor. The broadcast processing apparatus may further include a storage unit, which may be a memory. The storage unit is used to store instructions, and the processing unit executes the instructions stored in the storage unit to enable the electronic device to implement a broadcast processing method described in the first aspect or any possible implementation of the first aspect. When the broadcast processing apparatus is a chip or chip system within an electronic device, the processing unit may be a processor. The processing unit executes the instructions stored in the storage unit to cause the electronic device to implement a broadcast processing method described in the first aspect or any possible implementation of the first aspect. The storage unit may be a storage unit within the chip (e.g., a register, cache, etc.) or a storage unit located outside the chip within the electronic device (e.g., a read-only memory, random access memory, etc.).
[0029] Specifically, the acquisition unit is used to acquire the first broadcast receiver and the second broadcast receiver. Both the first broadcast receiver and the second broadcast receiver belong to the first broadcast process queue. The first broadcast receiver is the broadcast receiver of the first broadcast, and the second broadcast receiver is the broadcast receiver of the second broadcast. When the second broadcast receiver is a parallel broadcast receiver, the processing unit is used to distribute the second broadcast to the second broadcast receiver at a first moment and distribute the first broadcast to the first broadcast receiver at a second moment. The first moment is earlier than the second moment.
[0030] Thirdly, embodiments of this application provide an electronic device, the electronic device comprising: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code including computer instructions, and the one or more processors call the computer instructions to cause the electronic device to perform the methods described in the first aspect or any possible implementation of the first aspect.
[0031] Fourthly, embodiments of this application provide a computer-readable storage medium including computer instructions that, when executed on an electronic device, cause the electronic device to perform the methods described in the first aspect or any possible implementation thereof.
[0032] Fifthly, embodiments of this application provide a computer program product including a computer program, wherein when the computer program product includes computer program code, when the computer program code is run on an electronic device, the electronic device performs the method described in the first aspect or any possible implementation thereof.
[0033] In a sixth aspect, this application provides a chip system applied to an electronic device, the chip system including one or more processors, the one or more processors being configured to invoke computer instructions to cause the electronic device to perform the methods described in the first aspect or any possible implementation thereof.
[0034] In one possible implementation, the chip system described above in this application further includes at least one memory storing instructions. The memory can be an internal storage unit of the chip system, such as a register or cache, or it can be a storage unit of the chip system itself (e.g., read-only memory, random access memory, etc.).
[0035] It should be understood that the second to sixth aspects of this application correspond to the technical solutions of the first aspect of this application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation are similar, and will not be repeated here. Attached Figure Description
[0036] Figure 1 A schematic diagram illustrating a process for managing broadcast receivers, provided as an embodiment of this application;
[0037] Figure 2 This application provides a schematic diagram of a broadcast distribution process based on a modern broadcast queue.
[0038] Figure 3 A schematic diagram illustrating a broadcast distribution process provided in an embodiment of this application;
[0039] Figure 4 A schematic diagram illustrating another broadcast distribution process provided in this application embodiment;
[0040] Figure 5 A schematic diagram of a scenario provided for an embodiment of this application;
[0041] Figure 6 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application;
[0042] Figure 7 A schematic diagram of the software structure of an electronic device provided in an embodiment of this application;
[0043] Figure 8 A schematic diagram of module interaction for a broadcast processing method provided in an embodiment of this application;
[0044] Figure 9 This application provides another illustration of a broadcast distribution process.
[0045] Figure 10 A flowchart illustrating a broadcast processing method provided in an embodiment of this application;
[0046] Figure 11 A flowchart illustrating another broadcast processing method provided in an embodiment of this application;
[0047] Figure 12 This is a schematic diagram of the hardware structure of another electronic device provided in an embodiment of this application. Detailed Implementation
[0048] To facilitate a clear description of the technical solutions in the embodiments of this application, some terms and technologies involved in the embodiments of this application will be briefly introduced below:
[0049] 1. Broadcasting and types of broadcasting
[0050] As described above, the broadcast mechanism involves a broadcast sender, a broadcast receiver, and an AMS (Advanced Management System). A broadcast sender can send a broadcast to the AMS. The AMS can find the corresponding broadcast receiver and assign it to a group in the broadcast process queue for processing. It can be understood that a broadcast can correspond to multiple broadcast receivers. During processing, the AMS can send the broadcast to its corresponding broadcast receivers sequentially, thus achieving broadcast distribution.
[0051] Generally, both the broadcast sender sending a broadcast to AMS and the AMS sending a broadcast to the broadcast receiver are implemented based on the binder mechanism. The binder mechanism is an inter-process communication (IPC) mechanism, and its specific meaning can be found in relevant technical documents, which will not be elaborated here.
[0052] Broadcasts can be categorized by type, including general broadcasts and scheduled broadcasts.
[0053] Regular broadcast: This can be understood as a type of broadcast that does not require a specific order of distribution. For example, broadcasts to receivers of the same priority can be distributed without following a specific order.
[0054] Ordinary broadcast can be understood as a type of unordered broadcast. During the distribution of ordinary broadcast, all broadcast receivers registered for that broadcast can listen to it.
[0055] Ordered broadcasting: This can be understood as a type of broadcasting that needs to be distributed according to a specific index order. During the distribution of ordered broadcasting, electronic devices distribute the broadcast to receivers sequentially according to their index order in the receiver queue. Each receiver can correspond to an index value; the smaller the index value of a receiver, the earlier the ordered broadcast can be distributed to that receiver.
[0056] For example, the broadcast receivers of an ordered broadcast can include broadcast receiver 1 and broadcast receiver 2. In the broadcast receiver queue, the index value of broadcast receiver 1 is 0, and the index value of broadcast receiver 2 is 1. Based on this, when distributing an ordered broadcast, the electronic device can distribute the ordered broadcast to broadcast receiver 1 in ascending order (such as from smallest to largest index value), and then distribute the ordered broadcast to broadcast receiver 2.
[0057] Understandably, each broadcast receiver has the opportunity to influence the outcome of broadcast distribution, such as by terminating delivery to other undistributed broadcast receivers.
[0058] 2. Broadcast registration
[0059] Broadcast registration includes two methods: static registration and dynamic registration.
[0060] Static registration refers to registering broadcast receiver information in the application's manifest file, and then parsing this file during application installation to complete the registration. The static registration process can be performed within the Product Management System (PMS), which can store the mapping between broadcasts and broadcast receivers during static registration.
[0061] Dynamic registration refers to registering the relevant information of a broadcast receiver with the AMS by calling a function method (e.g., by calling Context.registerReceiver()). Since the dynamic registration process can take place within the AMS, the AMS can store the mapping between broadcasts and broadcast receivers during dynamic registration.
[0062] The broadcast registration method is not specifically limited in this embodiment.
[0063] 3. Broadcast process queue (BPQ)
[0064] The broadcast process queue can be used to manage the order in which broadcast receivers receive broadcasts. The broadcast process queue can be internally divided into three groups based on broadcast attributes: normal group, urgent group, and offload group.
[0065] The emergency group stores receivers for emergency broadcasts, which can be understood as broadcasts with an emergency attribute. The load group stores receivers for load broadcasts, which can be understood as broadcasts with a load attribute. The normal group stores other broadcast receivers, which can be understood as broadcast receivers other than those for emergency broadcasts and load broadcasts.
[0066] During the broadcast distribution process, broadcasts can be first distributed to broadcast receivers in the emergency group, then to broadcast receivers in the normal group, and finally to broadcast receivers in the load group.
[0067] After AMS receives a broadcast from the broadcast sender, it creates a broadcast process queue for each application process based on the user identification (UID) of the application process corresponding to the broadcast receiver. Then, it assigns the broadcast receivers to the corresponding groups within the broadcast process queues according to the broadcast attributes. The following section combines... Figure 1 The corresponding implementation example illustrates the queuing process. Figure 1 This is a schematic diagram illustrating a process for managing broadcast receivers, as provided in an embodiment of this application.
[0068] like Figure 1 As shown, AMS receives broadcast A and determines that broadcast A can correspond to 8 broadcast receivers. These 8 broadcast receivers are then sorted according to their priority. The broadcast receiver queue corresponding to broadcast A can include: broadcast receiver 1 at index 0, broadcast receiver 2 at index 1, broadcast receiver 3 at index 2, broadcast receiver 4 at index 3, broadcast receiver 5 at index 4, broadcast receiver 6 at index 5, broadcast receiver 7 at index 6, and broadcast receiver 8 at index 7, etc. Here, index 0 can be understood as an index value of 0, index 1 as an index value of 1, and so on.
[0069] In this context, the priority values for broadcast receivers 1, 2, and 3 can all be 1000. The priority values for broadcast receivers 4 and 5 can all be 100. The priority values for broadcast receivers 6, 7, and 8 can all be 0. Broadcast receivers with a priority value of 1000 have higher priority, while those with a priority value of 0 have lower priority. In other words, a higher priority value indicates that the broadcast can be sent to the broadcast receiver earlier.
[0070] The blocking status flags for broadcast receivers 1, 2, and 3 can all be 0, meaning they do not need to wait for other broadcast receivers. The blocking status flags for broadcast receivers 4 and 5 can both be 3, meaning they need to wait for the distribution from three other broadcast receivers to complete. The blocking status flags for broadcast receivers 6, 7, and 8 can be 5, meaning they need to wait for the distribution from all five other broadcast receivers to complete.
[0071] As broadcast A enters the modern broadcast queue of AMS, each broadcast receiver is encapsulated into a separate some args object (or simply an args object). The some args object can include broadcast information such as the index of the broadcast and the index of the broadcast receiver.
[0072] For example, AMS can encapsulate a broadcast receiver 1 into a `some args` object, i.e., `some args A1`. `some args A1` can include: `arg1` = the index of broadcast A (marked as `arg1`), and `argi1` = the index of broadcast receiver 1 (e.g., index 0). In other words, `some args A1` can be understood as the broadcast receiver in broadcast A with receiver index 1. The contents of `some args A2` and `some args A8` can be similar to those in `some args A1`, and will not be elaborated further here.
[0073] AMS matches the broadcast receiver to the corresponding broadcast process queue based on the application process to which the broadcast receiver belongs. For example, if AMS determines that broadcast receiver 1 and broadcast receiver 2 both come from application process 1, it creates broadcast process queue 1 for application process 1 and assigns some args A1 for broadcast receiver 1 and some args A2 for broadcast receiver 2 to broadcast process queue 1. If AMS determines that broadcast receiver 3, broadcast receiver 4, and broadcast receiver 5 all come from application process 2, it creates broadcast process queue 2 for application process 2 and assigns some args A3 for broadcast receiver 3, some args A4 for broadcast receiver 4, and some args A5 for broadcast receiver 5 to broadcast process queue 2. If AMS determines that broadcast receiver 6, broadcast receiver 7, and broadcast receiver 8 all come from application process 3, it creates broadcast process queue 3 for application process 3 and assigns some args A6 for broadcast receiver 6, some args A7 for broadcast receiver 7, and some args A8 for broadcast receiver 8 to broadcast process queue 3.
[0074] It is understandable that, since broadcast A does not have an urgent or load attribute, the above 8 broadcast receivers corresponding to broadcast A can all be assigned to the normal group in the broadcast process queue.
[0075] Similarly, when AMS receives broadcasts C, D, etc., it can retrieve the broadcast receiver corresponding to any broadcast and set that receiver in the appropriate broadcast process queue group. For example, AMS sets some args C4 corresponding to broadcast C in the normal group of broadcast process queue 1, some args C5 corresponding to broadcast C in the urgent group of broadcast process queue 1, and some args D8 corresponding to broadcast D in the load group of broadcast process queue 1. AMS sets some args C6 corresponding to broadcast C in the urgent group of broadcast process queue 2, and some args D4 corresponding to broadcast D in the load group of broadcast process queue 2. AMS sets some args D6 corresponding to broadcast D in the load group of broadcast process queue 3, and so on.
[0076] After broadcast receivers are assigned to the broadcast process queue, AMS can distribute broadcasts to the corresponding broadcast receivers in the order of the broadcast receivers in the broadcast process queue and the grouping order.
[0077] 4. Modern Broadcast Queue (BQMI)
[0078] The latest version of the native Android system (Android 14) uses modern broadcast queues to replace the original broadcast queues as the caching and scheduling mechanism for the entire broadcast system. Modern broadcast queues provide a separate broadcast queue for each process, as illustrated by the example of a broadcast process queue. This allows modern broadcast queues to schedule broadcasts sent by applications / systems according to their recipient processes. Furthermore, modern broadcast queues can also control each broadcast process queue to pause, delay, or deliver broadcasts to their respective receivers ahead of schedule.
[0079] The following is combined with Figure 2 The corresponding embodiment illustrates the broadcast distribution process under a modern broadcast queue. Figure 2 This is a schematic diagram illustrating a broadcast distribution process based on a modern broadcast queue, provided as an embodiment of this application.
[0080] like Figure 2 As shown, the broadcast distribution process is divided into three stages: the queuing stage, the delivery stage, and the distribution stage.
[0081] The enqueueing phase includes: When a broadcast enters the Modern Broadcast Queue in the Activity Manager service, AMS encapsulates each broadcast receiver into a separate `someargs` object, matches it to the corresponding broadcast process queue based on the broadcast receiver's application process, and then assigns the `someargs` object to the corresponding group in the broadcast process queue based on the broadcast attributes. For details on the enqueueing process, please refer to [link to relevant documentation]. Figure 1 The description in the text.
[0082] The delivery phase includes: AMS determining the ready time, delivering the broadcast process queue to the runnable queue according to the ready time, obtaining a broadcast process queue from the runnable queue, and obtaining a running resource from the running queue for broadcast distribution.
[0083] Dispatch phase: AMS dispatches the broadcast to the specified broadcast receiver in the broadcast process queue based on the acquired running resources.
[0084] like Figure 2 As shown, modern broadcast queues include: temporary queues, ready queues, running queues, etc.
[0085] The temporary queue includes: the queue of broadcast processes that have already been created in the modern broadcast queue.
[0086] like Figure 2 The temporary storage queues shown indicate that application 1, identified by UID1, can have three broadcast process queues: broadcast process queue 1 corresponding to application process 1, broadcast process queue 2 corresponding to application process 2, and broadcast process queue 3 corresponding to application process 3. Application 2, identified by UID2, can have two broadcast process queues: broadcast process queue 4 corresponding to application process 4 and broadcast process queue 5 corresponding to application process 5. Application 3, identified by UID3, can have one broadcast process queue: broadcast process queue 6 corresponding to application process 6.
[0087] During the process of a broadcast entering AMS's modern broadcast queue, AMS can create a broadcast process queue based on the application process in which the broadcast receiver resides. AMS can encapsulate each broadcast receiver into a separate `someargs` object and allocate these `someargs` objects to the appropriate group within the broadcast process queue according to their broadcast attributes. See details... Figure 1 The corresponding description.
[0088] Figure 2 The contents of the broadcast process queue 1 and some args A1 can be found in [link to relevant documentation]. Figure 1 The description in the text will not be repeated here.
[0089] The ready queue includes a queue of broadcast processes arranged according to their ready time. Ready time can be understood as the time allotted for distributing broadcasts to the broadcast receivers in the broadcast process queue.
[0090] AMS can determine the ready time of each broadcast process queue based on broadcast type, application process status, etc., and arrange the broadcast process queues according to their ready time to obtain the ready queue. For example Figure 2 As shown in the ready queue, AMS can determine the order of broadcast distribution to broadcast receivers in broadcast process queue 1, broadcast distribution to broadcast receivers in broadcast process queue 2, and then broadcast distribution to broadcast receivers in broadcast process queue 3, etc., according to the order of ready time.
[0091] The run queue contains multiple running resources; the dispatching and processing of a broadcast process queue can occupy one running resource. For example... Figure 2 As shown, AMS obtains broadcast process queue 1 from the ready queue. When distributing the broadcast to the broadcast receiver in broadcast process queue 1, it needs to obtain a running resource from the running queue and occupy a running resource for broadcast distribution. When the broadcast distribution is completed, the occupied running resource can be released. Figure 2 The run queue shown can provide 5 running resources, including 4 normal running resources and 1 expedited running resource.
[0092] Figure 2 The active threads described herein can be active threads within the broadcast receiver application process.
[0093] Understandable Figure 2 The temporary queue, ready queue, running queue, and the contents of each queue described herein are merely examples and do not constitute a limitation on the modern broadcast queues described in the embodiments of this application.
[0094] 5. Serial broadcast receivers and parallel broadcast receivers
[0095] Serial broadcast receivers can include: broadcast receivers corresponding to ordered broadcasts, and broadcast receivers generated during the static registration process of unordered broadcasts. It can be understood that broadcast receivers generated during the static or dynamic registration process of ordered broadcasts can both be called serial broadcast receivers.
[0096] Parallel broadcast receivers, also known as concurrent broadcast receivers, can include broadcast receivers generated during the dynamic registration process of unordered broadcasts.
[0097] The following is combined with Figure 3 as well as Figure 4 The corresponding embodiments illustrate the broadcast distribution process of serial broadcast receivers and the broadcast distribution process of parallel broadcast receivers.
[0098] like Figure 3 As shown in A, the broadcast queue also includes broadcast B. The broadcast receivers of broadcast B can include: serial broadcast receiver 1 (such as some argsB1), serial broadcast receiver 2 (such as some argsB2), parallel broadcast receiver 3 (such as some argsB3), and parallel broadcast receiver 4 (such as some argsB4), etc.
[0099] When AMS distributes broadcasts to serial broadcast receiver 1, serial broadcast receiver 2, parallel broadcast receiver 3, and parallel broadcast receiver 4, AMS can first distribute broadcast B to serial broadcast receiver 1.
[0100] After a broadcast receiver process (such as a broadcast receiver within a broadcast receiver process) detects that serial broadcast receiver 1 has received broadcast B, it can send a callback response message 1 to AMS. Response message 1 indicates that broadcast receiver 1 has received broadcast B. In response to response message 1, AMS can continue to send broadcast B to serial broadcast receiver 2.
[0101] After the broadcast receiver process detects that serial broadcast receiver 2 has received broadcast B, it can send a callback response message 2 to AMS. Response message 2 indicates that broadcast receiver 2 has received broadcast B. In response to response message 2, AMS can simultaneously send broadcast B to parallel broadcast receiver 3 and parallel broadcast receiver 4.
[0102] like Figure 3 As shown in Figure B, after the broadcast distribution by serial broadcast receiver 1 is completed, AMS performs the broadcast distribution by serial broadcast receiver 2. After the broadcast distribution by serial broadcast receiver 2 is completed, AMS simultaneously performs the broadcast distribution by parallel broadcast receiver 3 and parallel broadcast receiver 4.
[0103] It should be noted that for statically registered serial broadcast receivers, when the application process corresponding to the serial broadcast receiver has not yet started, the electronic device can start the application process and notify AMS that the broadcast reception processing has been completed after the application process is finished.
[0104] Combination Figure 3 A and Figure 3 Based on B's description, it can be understood that the broadcast distribution process of a serial broadcast receiver is relatively long, while the broadcast distribution process of a parallel broadcast receiver is relatively short. Therefore, a serial broadcast receiver can also be understood as a long-task broadcast receiver, and a parallel broadcast receiver can also be understood as a short-task broadcast receiver.
[0105] The following is combined with Figure 4 The corresponding embodiment illustrates the abnormal situation in the broadcast distribution process when serial broadcast receivers and parallel broadcast receivers exist in the same broadcast process queue.
[0106] If the broadcast queue of an electronic device also includes broadcast B, AMS can also set serial broadcast receiver 1, serial broadcast receiver 2, parallel broadcast receiver 3, and parallel broadcast receiver 4 in the normal group of broadcast process queue 2 according to the broadcast attributes.
[0107] like Figure 4 As shown, the ordinary packets in broadcast process queue 2 can include, in sequence: some args A3, some args A4, some args A5, some args B1, some args B2, some args B3, and some args B4. The packet arrangement of other broadcast receivers in broadcast process queue 2 can be found in [link to relevant documentation]. Figure 1 The description in the text.
[0108] Under normal circumstances, combined Figure 1 as well as Figure 2 As described in the text, electronic devices can sequentially perform broadcast distribution in the emergency group, the normal group, and the load group according to the queuing order of the broadcast receivers, that is, broadcast distribution in the order of some argsC6, some args A3, some argsA4, some argsA5, some argsB1, some argsB2, some argsB3, some argsB4, and some argsD4.
[0109] It is understandable that some argsB1 and some argsB2 are serial broadcast receivers, while some args A3, some argsA4, some argsA5, some argsB3, and some argsB4 are parallel broadcast receivers.
[0110] During the distribution process of a serial broadcast receiver, the broadcast receiver process (i.e., the application process corresponding to the broadcast receiver) needs to determine that the serial broadcast receiver has received the broadcast and then notify AMS that the broadcast reception process has been completed before AMS can execute the broadcast distribution for the next broadcast receiver.
[0111] However, when serial broadcast receivers enqueue before parallel broadcast receivers, the longer broadcast distribution process for serial broadcast receivers will affect the broadcast distribution of subsequent parallel broadcast receivers. For example, if there is a blockage during the broadcast distribution process of serial broadcast receivers, this blockage will cause a significant delay in the broadcast distribution time of parallel broadcast receivers. A large amount of distribution time is wasted waiting for the broadcast distribution of serial broadcast receivers, making it difficult for parallel broadcast receivers to receive the broadcast in a timely manner, resulting in system lag.
[0112] Understandable Figure 4 This illustration depicts a scenario in a normal block where serial broadcast receivers are enqueued before parallel broadcast receivers. This situation, where serial broadcast receivers enqueue before parallel broadcast receivers, can occur in any block of the broadcast process queue, and is not limited to this in the embodiments of this application.
[0113] 6. Other terms
[0114] In the embodiments of this application, terms such as "first" and "second" are used to distinguish identical or similar items with substantially the same function and purpose. For example, "first chip" and "second chip" are used only to distinguish different chips and do not limit their order of execution. Those skilled in the art will understand that terms such as "first" and "second" do not limit the quantity or execution order, and that "first" and "second" do not necessarily imply that they are different.
[0115] It should be noted that, in the embodiments of this application, the terms "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design scheme described as "exemplary" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0116] In this application embodiment, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, a--c, bc, or abc, where a, b, and c can be single or multiple.
[0117] 7. Electronic equipment
[0118] The electronic devices in this application embodiment may include handheld devices, vehicle-mounted devices, etc., with broadcast processing functions. For example, some electronic devices include: mobile phones, tablets, PDAs, laptops, mobile internet devices (MIDs), wearable devices, virtual reality (VR) devices, augmented reality (AR) devices, wireless terminals in industrial control, wireless terminals in self-driving vehicles, wireless terminals in remote medical surgery, wireless terminals in smart grids, wireless terminals in transportation safety, wireless terminals in smart cities, wireless terminals in smart homes, cellular phones, cordless phones, session initiation protocol (SIP) phones, wireless local loop (WLL) stations, personal digital assistants (PDAs), handheld devices with wireless communication capabilities, computing devices or other processing devices connected to a wireless modem, in-vehicle devices, wearable devices, terminal devices in 5G networks, or future evolution of public land mobile communication networks. Terminal devices in a network (PLMN), etc., are not limited to this in the embodiments of this application.
[0119] The electronic devices in the embodiments of this application may also be referred to as: terminal equipment, user equipment (UE), mobile station (MS), mobile terminal (MT), access terminal, user unit, user station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication equipment, user agent, or user device, etc.
[0120] In this embodiment, the electronic device or various network devices include a hardware layer, an operating system layer running on top of the hardware layer, and an application layer running on top of the operating system layer. The hardware layer includes hardware such as a central processing unit (CPU), a memory management unit (MMU), and memory (also called main memory). The operating system can be any one or more computer operating systems that implement business processing through processes, such as Linux, Unix, Android, iOS, or Windows. The application layer includes applications such as browsers, address books, word processing software, and instant messaging software.
[0121] Combination Figure 5 The corresponding embodiment is illustrated by taking the broadcast distribution process involved in the Wi-Fi network connection process as an example. Figure 5 This is a schematic diagram of a scenario provided for an embodiment of this application.
[0122] In response to the user opening the control center, the electronic device displays as follows: Figure 5 The interface shown. Figure 5 An interface can be set up for the control center, which may include a button 501 for turning on Wi-Fi.
[0123] In response to a user's click on button 501, the electronic device generates a Wi-Fi status change broadcast (or broadcast M). The electronic device transmits broadcast M to the AMS (Advanced Management System). The AMS collects broadcast receivers for broadcast M based on registered receiver information to determine the corresponding broadcast receiver. Before the AMS collects broadcast receivers, the receiving application can register for broadcast M. For example, the receiving application can determine the broadcast receivers corresponding to broadcast M, such as broadcast receiver A and broadcast receiver B, through two dynamic broadcast registration processes. During the queuing phase, the AMS can create a broadcast process queue A for application process A corresponding to broadcast receiver A, and then set broadcast receiver A and broadcast receiver B into the ordinary group of broadcast process queue A.
[0124] After a successful network connection, the electronic device generates a network connection status change broadcast (or broadcast N). The electronic device then transmits broadcast N to the AMS (Advanced Management System). The AMS collects broadcast receivers for broadcast N based on registered receiver information to determine the corresponding broadcast receiver. Before the AMS collects broadcast receivers, the receiving application can register broadcast N. For example, the receiving application can determine the broadcast receivers corresponding to broadcast N, such as broadcast receiver C and broadcast receiver D, through two static registration processes. During the enqueue phase, the AMS can add broadcast receivers C and D to the ordinary packets of the broadcast process queue A.
[0125] Broadcast receivers A and B can both be serial broadcast receivers, while broadcast receivers C and D can both be parallel broadcast receivers. Broadcast receivers A, B, C, and D can all be set in the normal group of broadcast process queue A.
[0126] When a serial broadcast receiver (such as broadcast receiver A and / or broadcast receiver B) is enqueued before a parallel broadcast receiver (such as broadcast receiver C and / or broadcast receiver D) in the broadcast process queue A, the broadcast distribution process of the serial broadcast receiver will affect the broadcast distribution of the parallel broadcast receiver, causing a delay in the network connection process. In severe cases, this can prevent the parallel broadcast receiver from receiving broadcast N, leading to network connection failure.
[0127] Understandably, the broadcast distribution process can be applied to... Figure 5 The network connection scenarios described can also be widely applied to instant messaging or alarm clock scenarios. In this case, the situation where serial broadcast receivers enqueue before parallel broadcast receivers may lead to problems such as instant messaging message delays, network connection failures, and alarm clock delays. Applications / functions that rely on broadcast mechanisms will malfunction, reducing the efficiency of modern broadcast mechanisms.
[0128] In view of this, embodiments of this application provide a broadcast processing method. The broadcast process queue may include a first broadcast receiver and a second broadcast receiver. If the electronic device detects that the second broadcast receiver is a parallel broadcast receiver, it may prioritize the broadcast distribution of the parallel broadcast receiver to reduce the impact of abnormal situations occurring during the broadcast distribution process of the serial broadcast receiver on the broadcast distribution process of the parallel broadcast receiver, improve the abnormal situation in the broadcast distribution process, and improve the broadcast distribution efficiency.
[0129] To better understand the embodiments of this application, the structure of the terminal device of this application embodiment is described below. For example, Figure 6 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application.
[0130] The terminal device may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, an indicator 192, a camera 193, and a display screen 194, etc.
[0131] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the terminal device. In other embodiments of this application, the terminal device may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0132] Processor 110 may include one or more processing units. These processing units may be independent devices or integrated within one or more processors. Processor 110 may also include memory for storing instructions and data. For example, processor 110 may be used to execute data processing steps in a broadcast processing method.
[0133] The wireless communication function of the terminal device can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor, and baseband processor.
[0134] The wireless communication module 160 can provide solutions for wireless communication applications on terminal devices, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks).
[0135] The terminal device implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor that performs broadcast processing, connecting the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering.
[0136] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. In some embodiments, the terminal device may include one or N displays screens 194, where N is a positive integer greater than 1. For example, display screen 194 can be used to display... Figure 5 The control center settings interface or other interfaces described in the document.
[0137] Terminal devices can achieve shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.
[0138] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the terminal device. The internal memory 121 can be used to store executable program code, including instructions. The internal memory 121 may include a program storage area and a data storage area. For example, the internal memory 121 can be used to store executable program code in a broadcast processing method.
[0139] The terminal device can implement audio functions such as music playback and recording through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, and an application processor.
[0140] The sensor module 180 may include a touch sensor ( Figure 6 (Not shown in the image). A touch sensor can be located on the display screen 194, and the touch sensor and the display screen 194 together form a touch screen, or "touchscreen". The touch sensor is used to receive any touch operation from the user on the display screen 194.
[0141] The software system of terminal devices can adopt layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture, etc., which will not be elaborated here.
[0142] For example, Figure 7 This is a schematic diagram of the software structure of an electronic device provided in an embodiment of this application. Figure 7 As shown, the layered architecture divides the software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces.
[0143] In some embodiments, the Android system is divided into multiple layers, from top to bottom: the application (APP) layer, the application framework (FWK) layer, and the kernel layer, etc. This application embodiment does not limit this.
[0144] The application layer can include a series of application packages. The application layer can include at least one application, such as system applications, third-party applications, etc. Figure 7 (not shown in the text), etc., are not limited in this application embodiment.
[0145] Both the application layer and the application framework layer can implement broadcast event triggering. Taking broadcast event triggering at the application layer as an example, the application layer can notify the AMS that a broadcast needs to be distributed through the application context (contextimpl) interface. The communication method between the application layer and the AMS can be through methods such as binder calls; this embodiment is not limited to this.
[0146] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes a set of predefined interfaces. It may also include a series of system services. System services are modular components focused on specific functionalities. The functionality provided by the application framework API allows communication with these system services to access the underlying hardware.
[0147] The application framework layer may include: system server processes and configuration management modules.
[0148] The system service process is responsible for starting and managing the entire application framework layer. After the system service process is created, it can mainly handle the following: (1) initialize some system settings, virtual machine configuration, etc.; (2) start the binder thread pool so that it can communicate with other processes through binder cross-process communication; (3) create the system service manager, which is used to create, start and manage the life cycle of system services; (4) create the main thread looper and enter the loop to wait for messages; (5) start various system services, such as AMS, PMS, etc.
[0149] The system service process can run AMS and PMS. AMS manages all activities and processes within an application. It can start, pause, stop, and destroy activities, as well as manage the application's lifecycle. AMS can also allocate system resources such as memory, processes, and threads to different applications. PMS is primarily responsible for the installation, management, and uninstallation of applications. When a new application is installed, PMS identifies all components of the application (e.g., services, broadcast receivers, etc.) and assigns appropriate permissions to these components. PMS can also view the status of installed applications, ensuring their integrity and security.
[0150] In this embodiment of the application, the PMS may include the correspondence between broadcasts and broadcast receivers generated during static broadcast registration; the AMS may include the correspondence between broadcasts and broadcast receivers generated during dynamic broadcast registration.
[0151] It is understood that the system service process may also include other services, which will not be elaborated in this application.
[0152] The configuration management module can be used for the configuration initialization of system service processes, as well as the storage and processing of maintenance and testing information transmitted by system service processes. It also enables the maintenance and testing of exceptions that occur during the management of the system service process application framework layer.
[0153] Modern broadcast queues can be run in AMS. The process of broadcast distribution based on modern broadcast queues can be seen in the descriptions below ①-⑧. The broadcast distribution process for parallel broadcast receivers in modern broadcast queues can be seen in the following... The description in the text.
[0154] like Figure 7 As shown, the process of broadcast distribution based on modern broadcast queues can be described as follows:
[0155] ① Broadcast events are triggered at the application layer or application framework layer.
[0156] ② The application layer or application framework layer sends broadcasts to AMS for scheduling and management.
[0157] ③ AMS collects broadcast receivers. For example, AMS can collect broadcast receivers that are dynamically registered for broadcasts from AMS, and broadcast receivers that are statically registered for broadcasts from PMS. AMS sorts all collected broadcast receivers according to their priority.
[0158] ④ AMS assigns broadcast receivers to broadcast process queues. For example, AMS assigns broadcast receivers to groups within the broadcast process queue based on the application process corresponding to the broadcast receiver and the broadcast attributes. For details on the distribution process, please refer to [link to relevant documentation]. Figure 1 as well as Figure 2 The description in the text will not be repeated here.
[0159] ⑤ AMS schedules broadcast delivery from the broadcast process queue. For example, AMS determines the delivery order of broadcasts according to the group order in the broadcast process queue.
[0160] ⑥AMS determines whether to cold start or warm start the application process corresponding to the broadcast receiver. If the application process is not closed, AMS warm starts the application process and then executes ⑦. Alternatively, if the application is not started, AMS can create the application process by executing ⑧ and then execute ⑦.
[0161] ⑦ AMS distributes broadcasts to broadcast receivers. For example, a broadcast can be passed to a broadcast receiver in the application layer via a binder call.
[0162] ⑧ AMS creates application processes. For example, AMS can instruct the zygote process to create application processes.
[0163] The broadcast distribution process to parallel broadcast receivers in a modern broadcast queue can be described as follows:
[0164] ⑨ The AMS performs parallel broadcast receiver identification. For example, the AMS can determine whether a broadcast receiver is a parallel broadcast receiver based on the broadcast type and the broadcast receiver's registration method (including dynamic registration and static registration). The specific process for identifying whether a broadcast receiver is a parallel broadcast receiver can be found in the description in S806 below, and will not be repeated here.
[0165] ⑩ AMS groups parallel broadcast receivers. For example, AMS can add a parallel group when creating the broadcast process queue. The parallel group can also be called the first group. The parallel group can be used to temporarily store parallel broadcast receivers. After the parallel group is created, AMS can set the parallel broadcast receivers into the parallel group.
[0166] Optionally, AMS can also verify the enable value before creating the broadcast process queue. If the enable value is detected, a broadcast process queue with parallel packets is created; otherwise, a broadcast process queue without parallel packets is created.
[0167] AMS performs parallel broadcast receiver scheduling. When a parallel packet is determined to be non-empty, AMS can determine the first ready time for the parallel broadcast receiver at the head of the queue, and distribute the broadcast to the parallel broadcast receiver when the first ready time arrives. The specific process of AMS calculating the first ready time can be found in the description in S811, and will not be repeated here.
[0168] In possible implementations, the application framework layer may also include one or more of the following: a display compositor, a window manager, a content provider, a resource manager, a view system, or a notification manager, etc. Figure 7 (Not shown in the image).
[0169] The kernel layer can create application processes. The kernel layer can include the zygote process. The zygote process is started by the init process, the first process in user space, and is the first Android runtime process running on the Android operating system. The zygote process's main functions include creating system service processes and other application processes.
[0170] In possible implementations, the electronic device may also include a hardware abstraction layer, a driver layer, and other software layers. This application does not specifically limit the software layers involved in the software architecture, the modules contained within those layers, or the functions of those modules.
[0171] Combination Figure 7 The description of the software architecture in this application is followed by a detailed explanation of the technical solution and how it solves the aforementioned technical problems, using specific embodiments. These specific embodiments can be implemented independently or in combination with each other. Similar or identical concepts or processes may not be described again in some embodiments.
[0172] For example, Figure 8 This is a schematic diagram illustrating the module interaction of a broadcast processing method provided in an embodiment of this application. Figure 8 In corresponding embodiments, the electronic device may include one or more of the following: AMS, modern broadcast queue, worker thread, or broadcast process queue.
[0173] In this context, AMS, the modern broadcast queue, and the broadcast process queue can all run in the same thread, which can be the main thread in the AMS thread pool. Worker threads can be child threads within the AMS thread pool. The main thread and worker threads are distinct; their names are merely illustrative and do not constitute a limitation on the embodiments of this application.
[0174] like Figure 8 As shown, the broadcast processing method may include: the enqueue phase described in S802-S812, the delivery phase described in S813-S817, and the dispatch phase described in S818.
[0175] S801. When the electronic device is detected to be powered on, AMS parses the configuration file and saves the enable value and the first preset time interval.
[0176] The configuration file can be pre-set in the configuration management module. The configuration file includes parameters such as the enable value and the first preset time interval.
[0177] An enable value can be understood as a switch (or flag), used to indicate whether the electronic device supports the broadcast processing method provided in the embodiments of this application. The verification process of the enable value can be found in the description in S804, and will not be repeated here.
[0178] The first preset time interval can be a value such as 500 milliseconds.
[0179] For example, in response to user operations such as powering on or restarting, the Linux kernel starts. The kernel can notify the system server process by starting init(), which in turn initializes the system server, initializes the resource manager in the system server process, initializes the configuration management module in the resource manager, and the configuration management module reads the configuration file and saves the enable values and the first preset time interval in the configuration file.
[0180] S802. When AMS receives the first broadcast, AMS obtains the target broadcast receiver corresponding to the first broadcast.
[0181] The first broadcast can be sent to the AMS by a broadcaster. Correspondingly, the AMS can receive the first broadcast sent to the AMS by the broadcaster. It is understood that the broadcaster can be the operating system in the electronic device, or it can be an application, component, etc., in the electronic device; this application does not limit this.
[0182] The number of target broadcast receivers can be one or more. In this embodiment of the application, two broadcast receivers are included as an example for illustration. This example does not constitute a limitation on the embodiment of the application.
[0183] It is understandable that electronic devices can identify broadcast receiver A and broadcast receiver B through two broadcast registration processes.
[0184] In one implementation, the receiving application performs static broadcast registration. The first correspondence between the first broadcast and the target broadcast receiver generated during the static broadcast registration process can be set in the PMS (Planner Management System). In this case, after the AMS receives the first broadcast sent by the broadcast sender, it can perform scheduling management and retrieve the target broadcast receiver corresponding to the first broadcast from the PMS based on this first correspondence.
[0185] In another implementation, the receiving application performs dynamic broadcast registration. The initial correspondence between the first broadcast and the target broadcast receiver generated during this registration process can be set in the AMS (Application Management System). In this case, after receiving the first broadcast from the broadcast sender, the AMS can retrieve the target broadcast receiver corresponding to the first broadcast from the AMS based on this initial correspondence.
[0186] It is understood that the first correspondence may include: the correspondence between broadcasters and broadcast receivers, such as the correspondence between the first broadcaster and the target broadcast receiver.
[0187] In possible implementations, this first correspondence can also be stored in other modules. In this case, AMS can obtain the first correspondence based on the corresponding interface or specific storage address, which is not limited in this embodiment.
[0188] For example, the broadcast sender passes the first broadcast and its broadcast properties to the AMS by calling the contextimpl interface, using instructions for sending the broadcast. The AMS can then collect target broadcast receivers from either the AMS or PMS using instructions for collecting broadcast receivers when it detects the first broadcast. The instructions for sending the broadcast can include: broadcastIntentWithFeature(), and the instructions for collecting broadcast receivers can include: collectReceiverComponents().
[0189] The broadcast attributes of the first broadcast may include attributes indicating whether the first broadcast is an ordered broadcast or a normal broadcast. The registration methods for broadcast receivers may include dynamic registration and / or static registration.
[0190] Optionally, when AMS receives the first broadcast, AMS can also first perform broadcast verification and assign values to default broadcast attributes using instructions for broadcast verification. Instructions for broadcast verification may include: broadcastIntentLockedTraced().
[0191] S803 and AMS send enqueue commands to the modern broadcast queue.
[0192] The enqueue instruction is used to instruct a modern broadcast queue to assign a target broadcast receiver to a group within the broadcast process queue. The enqueue instruction can carry: the broadcast attributes of the first broadcast, and information about the target broadcast receiver.
[0193] The information of the target broadcast receiver may include one or more of the following: the application process in which the target broadcast receiver is located, and the registration method of the target broadcast receiver (such as dynamic registration or static registration).
[0194] For example, AMS can instruct the modern broadcast queue to enqueue the target broadcast receiver by invoking an enqueue instruction. The enqueue instruction can include: `enqueueBroadcastLocked()`.
[0195] S804. The modern broadcast queue creates a first broadcast process queue based on the application process of the target broadcast receiver. The first broadcast process queue may include: normal packets, urgent packets, load packets, and parallel packets.
[0196] Understandably, in response to the enqueue instruction in S803, a modern broadcast queue can create a first broadcast process queue based on the application process of the target broadcast receiver. At this time, the first broadcast process queue may include: normal packets, urgent packets, load packets, and parallel packets.
[0197] Parallel packets can be used to temporarily store parallel broadcast receivers. This is understandable because the broadcast distribution process of parallel broadcast receivers rarely blocks the first broadcast process queue; therefore, parallel broadcast receivers can be placed in parallel packets, allowing electronic devices to pre-distribute broadcasts to the broadcast receivers within the parallel packets.
[0198] Furthermore, parallel groups are structurally completely independent of the three subgroups—normal groups, urgent groups, and load groups—within the native system's first broadcast process queue. This ensures relative independence from modern broadcast delivery mechanisms, minimizes coupling with the native system, and reduces the impact on the native system's broadcast delivery. Creating parallel groups also incurs lower memory overhead, placing a smaller burden on the system when dealing with a large number of broadcast messages.
[0199] For example, in S803 and later, modern broadcast queues can create normal packets, urgent packets, and load packets in the first broadcast process queue by calling getOrCreatProcessQueue(), and add parallel packets (such as mPendingParallel) in the first broadcast process queue by calling a packet creation method.
[0200] Prior to S804, the modern broadcast queue could verify the enable value. For example, when the modern broadcast queue detected an enable value (or detected an enable value of 1), the steps shown in S804 were executed. When the modern broadcast queue did not detect an enable value (or detected an enable value of 0), a second broadcast process queue could be created, which included: normal packets, urgent packets, and load packets. Subsequently, the modern broadcast queue could assign target broadcast receivers to any packet in the second broadcast process queue.
[0201] S805, Modern Broadcast Queue Broadcast Process Queue Notification, the grouping status of the target broadcast receiver in the first broadcast process queue.
[0202] For example, modern broadcast queues can notify the broadcast process queue by calling enqueueorplaceBroadcast().
[0203] S806, the broadcast process queue identifies parallel broadcast receivers from the target broadcast receivers based on the broadcast attributes of the first broadcast and the registration method of the target broadcast receivers.
[0204] When the broadcast attribute of the first broadcast is ordered broadcast, or when the broadcast attribute of the first broadcast is unordered broadcast and the registration method of the target broadcast receiver is static registration, the target broadcast receiver is determined to be a serial broadcast receiver.
[0205] When the broadcast attribute of method A is unordered broadcast and the registration method of the target broadcast receiver is dynamic registration, the target broadcast receiver is a parallel broadcast receiver.
[0206] Optionally, after S806, the broadcast process queue can obtain the enqueue time of any broadcast receiver among the target broadcast receivers and detect whether there is a situation in the first broadcast process queue where a serial broadcast receiver is enqueued before a parallel broadcast receiver. Here, the enqueue time can be understood as the time when a broadcast receiver enters the modern broadcast process queue (or broadcast process queue), at which time the broadcast receiver has not yet been distributed to any group in the broadcast process queue.
[0207] If the broadcast process queue detects that the enqueue time of a serial broadcast receiver is earlier than the enqueue time of a parallel broadcast receiver, the step shown in S807 is executed; or, if the broadcast process queue does not detect that the enqueue time of a serial broadcast receiver is earlier than the enqueue time of a parallel broadcast receiver, the electronic device can, based on... Figures 1-2 The description in the document is broadcast and distributed.
[0208] For example, the target broadcast receivers may include two broadcast receivers, such as a serial broadcast receiver A and a parallel broadcast receiver A. The enqueue time for the serial broadcast receiver A can be time A, and the enqueue time for the parallel broadcast receiver A can be time B. If the broadcast process queue detects that time A is earlier than time B, the broadcast process queue can, based on S807, place the parallel broadcast receiver A in the parallel group of the first broadcast process queue, and place the serial broadcast receiver A in another group of the first broadcast process queue. Other groups may include: normal groups, urgent groups, and load groups.
[0209] Understandably, electronic devices can directly assign identified parallel broadcast receivers to parallel groups for early broadcast distribution, simplifying the broadcast distribution process. Alternatively, if the queuing time of a serial broadcast receiver is detected to be earlier than that of a parallel broadcast receiver, the parallel broadcast receiver can be assigned to a parallel group for early broadcast distribution, thus increasing the flexibility of the broadcast distribution process.
[0210] It should be noted that the verification step of the serial broadcast receiver preceding the parallel broadcast receiver can be called verification step 1, and this verification step 1 can exist in... Figure 8In the process of identifying the target broadcast receiver corresponding to the first broadcast described in the document, optionally, when the electronic device detects the second broadcast, the electronic device can also identify the parallel broadcast receiver among the broadcast receivers corresponding to the second broadcast, and perform verification step 1 based on the target broadcast receiver and the broadcast receiver corresponding to the second broadcast. This is not limited in the embodiments of this application.
[0211] S807, the broadcast process queue adds parallel broadcast receivers from the target broadcast receivers to the parallel group of the first broadcast process queue, and adds serial broadcast receivers from the target broadcast receivers to other groups of the first broadcast process queue.
[0212] It is understood that other groups may include: normal groups, emergency groups, and load groups. The process of adding serial broadcast receivers among the target broadcast receivers to other groups in the first broadcast process queue can be found in [reference needed]. Figures 1-2 The description in the text will not be repeated here.
[0213] Combination Figure 4 The description in the first broadcast is Figure 4 In the case of broadcast B described in the document, the target broadcast receivers include: serial broadcast receiver 1, serial broadcast receiver 2, parallel broadcast receiver 3, and parallel broadcast receiver 4. If the first broadcast process queue is broadcast process queue 2, the modern broadcast queue can determine that serial broadcast receiver 1 and serial broadcast receiver 2 are both serial broadcast receivers, and parallel broadcast receiver 3 and parallel broadcast receiver 4 are both parallel broadcast receivers, based on the broadcast attributes of the first broadcast and the registration method of the target broadcast receivers.
[0214] Furthermore, such as Figure 9 As shown, the broadcast process queue can place serial broadcast receiver 1 (some args B1) and serial broadcast receiver 2 (some args B2) in the normal group of broadcast process queue 2, and place parallel broadcast receiver 3 (some args B3) and parallel broadcast receiver 4 (some args B4) in the parallel group. It can be understood that since some args A3, some args A4, and some args A5 in broadcast process queue 2 can all be parallel broadcast receivers, the broadcast process queue can also place some args A3, some args A4, and some args A5 in the parallel group.
[0215] Compared to Figure 4 ,like Figure 9As shown in broadcast process queue 2, a normal group may include some args B1 and some args B2, an urgent group may include some args C6, a load group may include some args D4, and a parallel group may include some args A3, some args A4, some args A5, some args B3, and some args B4. Thus, the electronic device can first broadcast some args B3 and some args B4 from the parallel group, and then broadcast some args B1 and some args B2 from the normal group.
[0216] For example, in the broadcast process queue, the target broadcast receiver can be added to the group in the first broadcast process queue by calling getParallelQueue and addLast(), such as setting parallel broadcast reception in the parallel group.
[0217] S808, Modern Broadcast Queue Notifies Worker Threads to Perform Preparations for Entering the Run Queue.
[0218] The preparation work for entering the run queue may include: worker threads determining whether broadcast distribution can be performed at the ready time, and whether there are sufficient running resources in the run queue for broadcast distribution. Modern broadcast queues notify worker threads to perform the preparation work for entering the run queue by invoking instructions to update the run queue. Instructions for updating the run queue may include: MSG_UPDATE_RUNNING_LIST.
[0219] S809. The worker thread performs preparation work for entering the run queue.
[0220] When the ready time is determined to arrive and there are sufficient running resources in the running queue for broadcasting, the worker thread can allocate the first broadcast process queue to the running queue and execute the steps shown in S810.
[0221] S810, the worker thread notifies the broadcast process queue to update the ready time.
[0222] For example, worker threads can notify the broadcast process queue to update its ready time by calling getrunnableAt().
[0223] S811, Calculate the ready time of the broadcast process queue (including the first ready time corresponding to the parallel broadcast receiver).
[0224] The steps for calculating the readiness time of serial broadcast receivers in the broadcast process queue for the target broadcast receiver can be found in [link to relevant documentation]. Figure 2 The descriptions in the corresponding embodiments will not be repeated here.
[0225] The broadcast process queue can determine the ready time of parallel broadcast receivers, that is, the first ready time can be = enqueue time - first preset time interval.
[0226] Setting the first preset time interval can enable advance distribution to parallel broadcast receivers in parallel groups; for example, the first preset time interval can be a value such as 500 milliseconds.
[0227] Enqueue time can be the time when a parallel broadcast receiver enters a modern broadcast queue (or broadcast process queue).
[0228] For example, the broadcast process queue can determine whether the parallel packets in the first broadcast process queue are not empty. When it is determined that the parallel packets in the first broadcast process queue are not empty, the broadcast process queue can calculate the first ready time for the parallel broadcast receivers and the other ready times for the serial broadcast receivers. Alternatively, when it is determined that the parallel packets in the first broadcast process queue are empty, the broadcast process queue can calculate the other ready times for the serial broadcast receivers.
[0229] The broadcast process queue can be updated with its ready time by calling updaterunnableAt().
[0230] S812, the broadcast process queue sends the ready time (including the first ready time) to the worker thread.
[0231] In this context, a worker thread can be understood as a worker thread within the receiver application (or the receiver application process).
[0232] S813. When the first ready time arrives, the worker thread distributes the first broadcast to the parallel broadcast receivers among the target broadcast receivers.
[0233] The worker thread can distribute the first broadcast to the parallel broadcast receivers in the parallel group when the second continuation time is determined to have arrived. It can then further distribute the first broadcast to other broadcast receivers in the normal group or load group. The worker thread can distribute broadcast A by calling dispatchReceivers().
[0234] Understandable Figure 8 The steps described herein are merely examples and do not constitute a limitation on the embodiments of this application.
[0235] Based on this, when an electronic device detects that a parallel broadcast receiver is included in the broadcast process queue, the electronic device can identify the parallel broadcast receiver and then reduce the impact on the broadcast distribution process of the parallel broadcast receiver when the serial broadcast receiver is blocked during the broadcast distribution process by distributing the parallel broadcast receiver in advance.
[0236] Understandable Figure 8 The abnormal situation described in the article, where the serial broadcast receiver is enqueued before the parallel broadcast receiver, exists in the broadcast distribution process corresponding to broadcast B. This abnormal situation can also exist in different broadcast distribution processes within the same broadcast process queue. This application does not limit this.
[0237] For example, when AMS detects a second broadcast, the electronic device can also, based on the descriptions in S803-S807, set the broadcast receiver corresponding to the second broadcast to the first broadcast process queue. The broadcast receiver corresponding to the second broadcast can include a serial broadcast receiver, such as some args X1, which can be set... Figure 9 Between some args B2 and some args B3, Figure 9 Not shown in the diagram. It is understood that if some args X1 is enqueued before some args B3, it will also affect the broadcast distribution process of some args B3 and some args B4. Therefore, electronic devices can be based on... Figure 8 The description in the text pre-distributes some args B2 and some args B3 to the parallel broadcast receivers, reducing the impact of the serial broadcast receivers of long tasks on the parallel broadcast receivers.
[0238] For example, the second broadcast may also include parallel broadcast receivers, such as some args X2. The first broadcast process queue includes some args X1, some args B1, and some args B2. If some args B1 or some args B2 is enqueued before some args X1, it will also affect the broadcast distribution process of some args X1. Therefore, electronic devices can be based on... Figure 8 The description in the text pre-distributes some args X1 to the parallel broadcast receiver, reducing the impact of the serial broadcast receiver on the parallel broadcast receiver for long tasks.
[0239] To more clearly illustrate the content provided in the embodiments of this application, the following example of the broadcast distribution process involved in the WIFI network connection process is used to illustrate the broadcast processing method provided in the embodiments of this application. This example does not constitute a limitation on the embodiments of this application.
[0240] Figure 10 This is a flowchart illustrating a broadcast processing method provided in an embodiment of this application. Figure 10 As shown, the broadcast processing method may include the following steps:
[0241] S1001. In response to the user's power-on operation, the electronic device reads the enable value and the first preset time interval from the configuration file.
[0242] The meanings of the enable value and the first preset time interval can be found in the description in S801, and will not be repeated here.
[0243] S1002. In response to the user's operation of connecting to WIFI, the electronic device obtains broadcast M and the broadcast receiver corresponding to broadcast M. After the network connection status changes, it obtains broadcast N and the broadcast receiver corresponding to broadcast N.
[0244] The user's operation of connecting to WIFI can be used by the user for... Figure 5 Clicking button 501 in the image.
[0245] Broadcast M can be Figure 5 The WIFI status change broadcast described in the document can include broadcast receivers A and B.
[0246] Broadcast N can be Figure 5 The network connection status change broadcast described in the document can include broadcast receivers C and D.
[0247] S1003. The electronic device creates a broadcast process queue A and adds a parallel group to the broadcast process queue.
[0248] The broadcast process queue A may include: normal packets, emergency packets, load packets and parallel packets. The meaning of parallel packets can be found in the description in S804.
[0249] S1004. The electronic device identifies the broadcast receivers corresponding to broadcast M and the parallel broadcast receivers among the broadcast receivers corresponding to broadcast N.
[0250] For example, an electronic device can determine that broadcast receivers A and B are serial broadcast receivers based on the attributes of broadcast M and the registration method of the broadcast receivers corresponding to broadcast M. Similarly, an electronic device can determine that broadcast receivers C and D are parallel broadcast receivers based on the attributes of broadcast N and the registration method of the broadcast receivers corresponding to broadcast N.
[0251] S1005. The electronic device sets the broadcast receivers corresponding to broadcast M and broadcast receivers corresponding to broadcast N into the broadcast process queue A.
[0252] For example, when broadcast receivers A and B are serial broadcast receivers, and broadcast receivers C and D are parallel broadcast receivers, the electronic device can place broadcast receivers C and D in a parallel group within the broadcast process queue A, and based on... Figure 1 as well as Figure 2 The broadcast distribution process described herein places broadcast receiver A and broadcast receiver B in the normal group of broadcast process queue A.
[0253] S1006. The electronic device broadcasts to the parallel broadcast receivers in the parallel groups of the broadcast process queue A, and broadcasts to the broadcast receivers in other groups of the broadcast process queue A.
[0254] The electronic device calculates the ready time 1 of the broadcast receivers in the parallel group based on the enqueue time of broadcast M and the first preset time interval. If there are no broadcast receivers in other groups in the broadcast process queue with a ready time earlier than ready time 1, broadcast N can be directly sent to broadcast receivers C and D. Then, broadcast distribution is performed to the broadcast receivers in other groups in the broadcast process queue A, such as distributing broadcast M to broadcast receivers A and B respectively.
[0255] Optionally, if the broadcast process queue A also includes a broadcast receiver corresponding to broadcast P, and the ready time of the broadcast receiver corresponding to broadcast P is earlier than the ready time 1, then the broadcast receiver corresponding to broadcast P can be given priority for broadcast distribution.
[0256] S1007. Application process A in an electronic device first receives broadcast N and then receives broadcast M.
[0257] For example, application process A processes received messages through a broadcast receiver. That is, when the broadcast receiver receives a RECEIVER message, it executes the code in the receiver's overridden onReceive() method.
[0258] Based on this, electronic devices can prioritize broadcasting to parallel broadcast receivers when they detect that the broadcast process queue includes parallel broadcast receivers. This reduces the impact of blockages in the broadcast distribution process of serial broadcast receivers on the broadcast distribution process of parallel broadcast receivers, improves broadcast distribution efficiency, and enhances the timeliness of broadcast delivery.
[0259] Combination Figures 1-10 The description in the text, Figure 11This is a flowchart illustrating another broadcast processing method provided in an embodiment of this application. Figure 11 As shown, the broadcast processing method may include the following steps:
[0260] S1101, The electronic device acquires the first broadcast receiver and the second broadcast receiver.
[0261] Both the first broadcast receiver and the second broadcast receiver belong to the first broadcast process queue. The first broadcast receiver is the broadcast receiver of the first broadcast, and the second broadcast receiver is the broadcast receiver of the second broadcast.
[0262] S1102. When the second broadcast receiver is a parallel broadcast receiver, the second broadcast is distributed to the second broadcast receiver at the first moment, and the first broadcast is distributed to the first broadcast receiver at the second moment.
[0263] The first moment is earlier than the second moment.
[0264] The first broadcast receiver can be a serial broadcast receiver, and the second broadcast receiver can be a parallel broadcast receiver.
[0265] In this way, when the electronic device detects the presence of a parallel broadcast receiver (such as a second broadcast receiver) in the first broadcast process queue, it can reduce the impact of abnormal situations in the first broadcast process queue on the broadcast distribution process of the second broadcast receiver by pre-distributing the broadcast to the second broadcast receiver.
[0266] It should be noted that the module names involved in the embodiments of this application can all be defined as other names, as long as they can achieve the function of each module, and no specific restrictions are placed on the module names.
[0267] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the embodiments of this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0268] The broadcast processing method of the embodiments of this application has been described above. The apparatus for performing the above method provided in the embodiments of this application is described below. Those skilled in the art will understand that the methods and apparatus can be combined with and referenced by each other, and the related apparatus provided in the embodiments of this application can perform the steps in the above list sorting method.
[0269] The broadcast processing method provided in this application can be applied to electronic devices with communication functions. Electronic devices include terminal devices, and the specific device form of the terminal device can be referred to the above-described related information, which will not be repeated here.
[0270] This application provides a terminal device, which includes a processor and a memory; the memory stores computer execution instructions; the processor executes the computer execution instructions stored in the memory, causing the terminal device to perform the above-described method.
[0271] Figure 12 This is a schematic diagram of the hardware structure of another electronic device provided in an embodiment of this application.
[0272] The electronic device includes a processor 1201, a communication line 1204, and at least one communication interface. Figure 12 (The example is illustrated using communication interface 1203).
[0273] The processor 1201 may be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits used to control the execution of the program of the present application.
[0274] Communication line 1204 may include circuitry for transmitting information between the aforementioned components.
[0275] Communication interface 1203 uses any transceiver-like device for communicating with other devices or communication networks, such as Ethernet, wireless local area networks (WLAN), etc.
[0276] Possibly, the electronic device may also include a memory 1202.
[0277] The memory 1202 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed discs, laser discs, optical discs, digital universal discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto. The memory may exist independently and be connected to the processor via communication line 1204. The memory may also be integrated with the processor.
[0278] The memory 1202 stores computer execution instructions for implementing the scheme of this application, and the processor 1201 controls the execution. The processor 1201 executes the computer execution instructions stored in the memory 1202 to implement the method provided in the embodiments of this application.
[0279] It is possible that the computer execution instructions in the embodiments of this application may also be referred to as application code, and the embodiments of this application do not specifically limit this.
[0280] In a specific implementation, as one embodiment, the processor 1201 may include one or more CPUs, for example... Figure 12 CPU0 and CPU1 in the CPU.
[0281] In a specific implementation, as one example, an electronic device may include multiple processors, for example... Figure 12 Processors 1201 and 1205 are described herein. Each of these processors may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. A processor here may refer to one or more devices, circuits, and / or processing cores used to process data (e.g., computer program instructions).
[0282] The broadcast processing method provided in this application can be applied to electronic devices with communication functions. Electronic devices include terminal devices, and the specific device form of the terminal device can be referred to the above-described related information, which will not be repeated here.
[0283] This application provides a terminal device, which includes a processor and a memory; the memory stores computer execution instructions; the processor executes the computer execution instructions stored in the memory, causing the terminal device to perform the above-described method.
[0284] This application provides a chip. The chip includes a processor, which calls a computer program in memory to execute the technical solutions in the above embodiments. Its implementation principle and technical effects are similar to those in the related embodiments described above, and will not be repeated here.
[0285] This application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, it implements the methods described above. The methods described in the above embodiments can be implemented wholly or partially by software, hardware, firmware, or any combination thereof. If implemented in software, the functionality can be stored as one or more instructions or code on or transmitted over the computer-readable medium. The computer-readable medium can include computer storage media and communication media, and can also include any medium that can transfer a computer program from one place to another. The storage medium can be any target medium accessible by a computer.
[0286] In one possible implementation, a computer-readable medium may include RAM, ROM, compact disc read-only memory (CD-ROM) or other optical disc storage, disk storage or other magnetic storage devices, or any other medium targeted to carry or to store the required program code in the form of instructions or data structures, and accessible by a computer. Furthermore, any connection is appropriately referred to as a computer-readable medium. For example, if software is transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave, then coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. As used herein, disks and optical discs include optical discs, laser discs, optical discs, Digital Versatile Discs (DVDs), floppy disks, and Blu-ray discs, where disks typically reproduce data magnetically, while optical discs optically reproduce data using lasers. Combinations of the above should also be included within the scope of computer-readable media.
[0287] This application provides a computer program product, which includes a computer program that, when run, causes a computer to perform the above-described method.
[0288] This application describes embodiments of methods, apparatus (systems), and computer program products according to embodiments of this application with reference to flowchart illustrations and / or block diagrams. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, special-purpose computer, embedded processor, or other programmable device to produce a machine, such that the instructions, which execute via the processing unit of the computer or other programmable data processing device, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0289] The above specific embodiments further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solution of the present invention should be included within the scope of protection of the present invention.
Claims
1. A broadcast processing method, characterized in that, Applied to electronic devices, including: Obtain the first broadcast receiver and the second broadcast receiver. Both the first broadcast receiver and the second broadcast receiver belong to the first broadcast process queue. The first broadcast receiver is the broadcast receiver of the first broadcast, and the second broadcast receiver is the broadcast receiver of the second broadcast. Create the first broadcast process queue, which includes: normal group, load group, emergency group and first group, the first group being used to store parallel broadcast receivers; When the second broadcast is an out-of-order broadcast and the registration method of the second broadcast receiver is dynamic registration, the second broadcast receiver belongs to the parallel broadcast receiver, the second broadcast receiver is set in the first group, and the first broadcast receiver is set in the normal group or the load group; The second broadcast is distributed to the second broadcast receiver at a first time, and the first broadcast is distributed to the first broadcast receiver at a second time, the first time being earlier than the second time.
2. The method according to claim 1, characterized in that, The first broadcast receiver enters the first broadcast process queue at a third time, and the second broadcast receiver enters the first broadcast process queue at a fourth time, wherein the third time is earlier than the fourth time.
3. The method according to claim 1 or 2, characterized in that, Before obtaining the first broadcast receiver and the second broadcast receiver, the method further includes: after detecting the operation of starting the electronic device, reading the first parameter from the configuration file from the system server process; Creating the first broadcast process queue includes: creating the first broadcast process queue when the first parameter is detected.
4. The method according to claim 1, characterized in that, The first moment is determined based on the enqueue time of the second broadcast receiver and the first preset time interval, wherein the enqueue time is the time when the second broadcast receiver enters the first broadcast process queue.
5. The method according to claim 1, characterized in that, The first broadcast receiver is a serial broadcast receiver. The first broadcast receiver being a serial broadcast receiver includes: when the first broadcast is an unordered broadcast and the first broadcast receiver's registration method is static registration, or when the first broadcast is an ordered broadcast, the first broadcast receiver is a serial broadcast receiver.
6. The method according to claim 1, characterized in that, The first broadcast is different from the second broadcast, or the first broadcast is the same as the second broadcast.
7. The method according to claim 1, characterized in that, The first broadcast process queue also includes: a third broadcast receiver corresponding to the third broadcast, wherein the third broadcast receiver belongs to the parallel broadcast receiver, and the method further includes: The third broadcast receiver is distributed to the third broadcast at the first moment.
8. An electronic device, characterized in that, The electronic device includes: one or more processors and memory; The memory is coupled to the one or more processors, the memory being used to store computer program code, the computer program code including computer instructions, the one or more processors invoking the computer instructions to cause the electronic device to perform the method as described in any one of claims 1 to 7.
9. A chip system, characterized in that, The chip system is applied to an electronic device, the chip system including one or more processors, the one or more processors being used to invoke computer instructions to cause the electronic device to perform the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes computer instructions that, when executed on an electronic device, cause the electronic device to perform the method as described in any one of claims 1 to 7.
11. A computer program product, characterized in that, The computer program product includes computer program code that, when run on an electronic device, causes the electronic device to perform the method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Broadcast receiver adjusting method and device and terminal
CN106851592A
Broadcast transmitting method, device and terminal
CN106851593A