Broadcast processing method and apparatus

By identifying and processing deadlock recipients, setting their status to the final state and creating proxy broadcasts, the problem of broadcast distribution deadlock in Android system is solved, and normal broadcast recovery and system stability are achieved.

WO2025147840A1PCT designated stage expired Publication Date: 2025-07-17HONOR DEVICE CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/071272
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-01-09
Publication Date
2025-07-17

AI Technical Summary

Technical Problem

During the broadcast distribution process of Android system, deadlocks cause the broadcast to be unable to be distributed normally, affecting system efficiency and stability.

Method used

By identifying the deadlock receiver and setting its status to the final state, a proxy broadcast is created that is the same as the first broadcast, the deadlock receiver is added to the queue corresponding to the proxy broadcast, and redistribute the proxy broadcast at an appropriate time, restoring the normal distribution of the broadcast.

Benefits of technology

Without affecting the normal distribution of the broadcast, the deadlock situation is restored, the system robustness and stability is improved, and the blocking effect of the deadlock on other broadcast receivers is avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024071272_17072025_PF_FP_ABST
    Figure CN2024071272_17072025_PF_FP_ABST
Patent Text Reader

Abstract

Embodiments of the present application relate to the technical field of terminals, and provide a broadcast processing method and apparatus. The method comprises: when a first broadcast process queue is in a blocked state, acquiring a target broadcast receiver from among first broadcast receivers, and setting the state of the target broadcast receiver as a final state; and creating a second broadcast, and distributing the second broadcast to the target broadcast receiver. In this way, upon identifying that a blockage is present in the distribution process of a first broadcast, an electronic device can set the state of a broadcast receiver causing the blockage as the final state, and create the second broadcast that is the same as the first broadcast; and the target broadcast receiver is added to a broadcast receiver queue corresponding to the second broadcast, the second broadcast is redistributed to the target broadcast receiver, and the blockage is recovered without affecting normal broadcast distribution.
Need to check novelty before this filing date? Find Prior Art

Description

Broadcast processing method and device Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to a broadcast processing method and device. Background Art

[0002] As one of the four major components of the Android system, broadcast is a mechanism for passing messages between components (for example, transferring data, sending notifications, etc.). 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 publishers, message subscribers, and message center correspond to the sender (i.e., broadcast sender), receiver (i.e., broadcast receiver), and activity manager service (AMS) in the broadcast mechanism, respectively.

[0003] The sender sends a broadcast (i.e., a broadcast message) to the AMS. The AMS determines the broadcast receivers corresponding to the broadcast message and assigns the broadcast receivers to groups in the broadcast process queue. The AMS then distributes the broadcast to the corresponding broadcast receivers in the order of the groups. It is understood that the AMS can distribute broadcasts to broadcast receivers based on the binder mechanism.

[0004] When an exception occurs during the broadcast distribution process, the broadcast receivers in the broadcast process queue will not be able to receive the broadcast. Therefore, how to recover from the exception in the broadcast distribution process is an urgent problem to be solved.

[0005] Summary of the Invention

[0006] The embodiments of the present application provide a broadcast processing method and apparatus, which are applied in the field of terminal technology and can recover from a deadlock in a broadcast distribution process to ensure normal broadcast distribution.

[0007] In the first aspect, an embodiment of the present application proposes a broadcast processing method, which includes: receiving a first broadcast sent by a broadcast sender, the broadcast receiver queue corresponding to the first broadcast includes the first broadcast receiver, the number of broadcast receivers in the first broadcast receiver is N, and N is greater than or equal to 1; allocating the first broadcast receiver to a first broadcast process queue; when the first broadcast process queue is in a blocked state, obtaining a target broadcast receiver from the first broadcast receiver, and setting the state of the target broadcast receiver to a final state; creating a second broadcast, wherein the second broadcast is the same as the first broadcast, and the broadcast receiver queue corresponding to the second broadcast includes the target broadcast receiver; and distributing the second broadcast to the target broadcast receiver.

[0008] The target broadcast receiver may be the deadlock receiver described in the embodiment of the present application, and the second broadcast may be the proxy broadcast described in the embodiment of the present application.

[0009] It can be understood that when the state of the target broadcast receiver is the final state, the first broadcast is not distributed to the target broadcast receiver.

[0010] Based on this, when the electronic device recognizes that there is a congestion in the distribution process of the first broadcast, it can set the state of the broadcast receiver that caused the congestion to the final state, create a second broadcast that is identical to the first broadcast, add the target broadcast receiver to the broadcast receiver queue corresponding to the second broadcast, and redistribute the second broadcast to the target broadcast receiver, thereby restoring the congestion without affecting the normal distribution of the broadcast.

[0011] In one possible implementation, the first broadcast process queue includes one or more of the following: a normal group, a load group, an emergency group, and a first group. The first group is used to store broadcast receivers corresponding to a preset broadcast. The preset broadcast is a broadcast with preset attributes. After creating the second broadcast, the method also includes: allocating the target broadcast receivers to the first group. The second broadcast has preset attributes.

[0012] The preset attribute may be the proxy attribute described in the embodiment of the present application, and the proxy attribute may be used to distinguish the first broadcast from the second broadcast.

[0013] It is understandable that the electronic device can simultaneously create the first group when creating the first broadcast process queue, and assign the target broadcast receivers to the first group to achieve separate management and broadcast distribution of the target broadcast receivers.

[0014] In one possible implementation, the first broadcast receiver also includes: a second broadcast receiver, the first broadcast process queue also includes a second group, and the first broadcast receiver is assigned to the first broadcast process queue, including: assigning the second broadcast receiver to the second group, the first broadcast does not have a preset attribute, and the second group is different from the first group.

[0015] The second group may be any one of a normal group, a load group, and an emergency group.

[0016] In the case that the first broadcast does not have a preset attribute, the electronic device may allocate the second broadcast receivers to the second group according to the broadcast attribute of the first broadcast.

[0017] In a possible implementation, the final status includes one or more of the following: a skipped status, a sent complete status, or a sent failed status.

[0018] It is understood that when the electronic device is in any of the states of skipping, sending completed, or sending failed, the electronic device will not distribute the first broadcast to the target broadcast receiver. This can reduce possible abnormal situations in the process of distributing the first broadcast to the target broadcast receiver.

[0019] In a possible implementation, during the broadcast distribution process of the second broadcast, the state of the target broadcast receiver is in the delivery state.

[0020] When the target broadcast receiver is in the delivery state, the electronic device can distribute the second broadcast to the target broadcast receiver, thereby improving abnormal conditions in the broadcast distribution process without affecting the broadcast distribution.

[0021] In one possible implementation, before distributing the second broadcast to the target broadcast receiver, the method also includes: calculating a first time, where the first time is determined based on the second time and a preset time interval, and the second time is the time when the second broadcast enters the modern broadcast queue; and distributing the second broadcast to the target broadcast receiver when the first time arrives.

[0022] The first time may be the second ready time described in the embodiment of the present application, the second time may be the queue entry time described in the embodiment of the present application, and the preset time interval may be the proxy broadcast advance time interval described in the embodiment of the present application. The preset time interval may be a value such as 500 milliseconds.

[0023] By determining the first time, the electronic device can distribute the second broadcast to the target broadcast receiver as early as possible, thereby ensuring normal broadcast distribution.

[0024] In one possible implementation, the first broadcast process queue includes: a third group, which is different from the first group, and obtains the target broadcast receiver from the broadcast receiver corresponding to the first broadcast, including: when the target broadcast receiver is blocked for a period longer than the first period, obtaining the target broadcast receiver, wherein the target broadcast receiver is located at the head of the queue in the third group, and the application process corresponding to the target broadcast receiver is in a non-frozen state within the first period.

[0025] The third group may be any one of a normal group, a load group, and an emergency group.

[0026] It is understandable that when the electronic device detects that the broadcast receiver at the head of the queue in any group (such as the third group) is in a blocked state for a long time, it can determine that there is a deadlock in the broadcast process queue and mark the target broadcast receiver at the head of the queue as the broadcast receiver that caused the exception (such as deadlock).

[0027] In a possible implementation, the first broadcast process queue includes: a fourth group, the fourth group is different from the first group, and the first broadcast receiver also includes: a third broadcast receiver, and obtaining the target broadcast receiver from the broadcast receiver corresponding to the first broadcast includes: when the priority of the target broadcast receiver is higher than the priority of the third broadcast receiver, obtaining the target broadcast receiver, wherein the third broadcast receiver and the target broadcast receiver are both in the fourth group, the third broadcast receiver is located in the first position in the fourth group, and the target broadcast receiver is located in the second position in the fourth group, and the second position is after the first position.

[0028] The fourth group may be any one of a normal group, a load group, and an emergency group.

[0029] It is understandable that the electronic device can determine that there is a deadlock in the broadcast process queue when it detects that a low-priority broadcast receiver is located in front of a high-priority broadcast receiver in any group (such as the fourth group), and mark the target broadcast receiver at the high priority as the broadcast receiver that caused the exception (such as deadlock).

[0030] In a possible implementation, the fourth group also includes a fourth broadcast receiver, which is located at the third position in the fourth group, and the third position is after the second position. The method also includes: after distributing the first broadcast to the third broadcast receiver, distributing the first broadcast to the fourth broadcast receiver.

[0031] If the target broadcast receiver is abnormal, the electronic device can distribute the first broadcast to the third broadcast receiver located in front of the target broadcast receiver, and then distribute the first broadcast to the fourth broadcast receiver located behind the target broadcast receiver. It is understood that the abnormality of the target broadcast receiver will not affect the broadcast distribution process of other broadcast receivers.

[0032] In a second aspect, embodiments of the present application provide a broadcast processing device, which may be an electronic device or a chip or system-on-chip within an electronic device. The broadcast processing device may include an acquisition unit and a processing unit. The acquisition unit is configured to perform data acquisition steps 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 device is an electronic device, the processing unit may be a processor. The broadcast processing device may also include a storage unit, which may be a memory. The storage unit is configured 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 device is a chip or system-on-chip within an electronic device, the processing unit may be a processor. 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. The storage unit may be a storage unit within the chip (e.g., a register, cache, etc.) or a storage unit within the electronic device located external to the chip (e.g., a read-only memory, random access memory, etc.).

[0033] Specifically, an embodiment of the present application provides a broadcast processing device, which involves an acquisition unit and a processing unit. The processing unit is used to receive a first broadcast sent by a broadcast sender. The broadcast receiver queue corresponding to the first broadcast includes the first broadcast receiver. The number of broadcast receivers in the first broadcast receiver is N, and N is greater than or equal to 1; the processing unit is also used to assign the first broadcast receiver to the first broadcast process queue; when the first broadcast process queue is in a blocked state, the acquisition unit is used to obtain the target broadcast receiver from the first broadcast receiver, and the processing unit is also used to set the state of the target broadcast receiver to the final state; the processing unit is also used to create a second broadcast, wherein the second broadcast is the same as the first broadcast, and the broadcast receiver queue corresponding to the second broadcast includes the target broadcast receiver; the processing unit is also used to distribute the second broadcast to the target broadcast receiver.

[0034] In one possible implementation, the first broadcast process queue includes one or more of the following: ordinary groups, load groups, emergency groups and first groups. The first group is used to store broadcast receivers corresponding to the preset broadcast. The preset broadcast is a broadcast with preset attributes. The processing unit is also used to assign target broadcast receivers to the first group. The second broadcast has preset attributes.

[0035] In one possible implementation, the first broadcast receiver also includes: a second broadcast receiver, the first broadcast process queue also includes a second group, the processing unit is further used to assign the second broadcast receiver to the second group, the first broadcast does not have a preset attribute, and the second group is different from the first group.

[0036] In a possible implementation, the final status includes one or more of the following: a skipped status, a sent complete status, or a sent failed status.

[0037] In a possible implementation, during the broadcast distribution process of the second broadcast, the state of the target broadcast receiver is in the delivery state.

[0038] In one possible implementation, the processing unit is further used to calculate a first time, where the first time is determined based on a second time and a preset time interval, and the second time is the time when the second broadcast enters the modern broadcast queue; the processing unit is further used to distribute the second broadcast to the target broadcast receiver when the first time arrives.

[0039] In one possible implementation, the first broadcast process queue includes: a third group, which is different from the first group. When the target broadcast receiver is blocked for a period longer than the first period, an acquisition unit is specifically used to acquire the target broadcast receiver, wherein the target broadcast receiver is located at the head of the queue in the third group, and the application process corresponding to the target broadcast receiver is in a non-frozen state within the first period.

[0040] In one possible implementation, the first broadcast process queue includes: a fourth group, which is different from the first group, and the first broadcast receiver also includes: a third broadcast receiver. When the priority of the target broadcast receiver is higher than the priority of the third broadcast receiver, the acquisition unit is specifically used to acquire the target broadcast receiver, wherein the third broadcast receiver and the target broadcast receiver are both in the fourth group, the third broadcast receiver is located in the first position in the fourth group, and the target broadcast receiver is located in the second position in the fourth group, and the second position is after the first position.

[0041] In one possible implementation, the fourth group also includes a fourth broadcast receiver, which is located at the third position in the fourth group, and the third position is after the second position. The method also includes: after distributing the first broadcast to the third broadcast receiver, distributing the first broadcast to the fourth broadcast receiver.

[0042] In a third aspect, an embodiment of the present application provides 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 comprises computer instructions, and the one or more processors call the computer instructions to enable the electronic device to execute the method described in the first aspect or any possible implementation of the first aspect.

[0043] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the method described in the first aspect or any possible implementation of the first aspect.

[0044] In a fifth aspect, an embodiment of the present application provides a computer program product including a computer program. When the computer program product includes computer program code, when the computer program code runs on an electronic device, the electronic device executes the method described in the first aspect or any possible implementation of the first aspect.

[0045] In a sixth aspect, the present application provides a chip system, which is applied to an electronic device. The chip system includes one or more processors, and the one or more processors are used to call computer instructions to enable the electronic device to execute the method described in the first aspect or any possible implementation of the first aspect.

[0046] In one possible implementation, the chip system described above in this application further includes at least one memory, in which instructions are stored. The memory may be a storage unit within the chip system, such as a register, a cache, etc., or a storage unit of the chip system (e.g., a read-only memory, a random access memory, etc.).

[0047] It should be understood that the second to sixth aspects of the present application correspond to the technical solutions of the first aspect of the present application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation methods are similar and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] FIG1 is a schematic diagram of a process for managing broadcast receivers provided in an embodiment of the present application;

[0049] FIG2 is a schematic diagram of a modern broadcast queue provided by an embodiment of the present application;

[0050] FIG3 is a schematic diagram of a broadcast process queue provided in an embodiment of the present application;

[0051] FIG4 is a schematic diagram of another broadcast process queue provided in an embodiment of the present application;

[0052] FIG5 is a schematic diagram of a scenario provided by an embodiment of the present application;

[0053] FIG6 is a schematic diagram of the structure of a terminal device provided in an embodiment of the present application;

[0054] FIG7 is a schematic diagram of a software structure of an electronic device provided in an embodiment of the present application;

[0055] FIG8 is a flow chart of a broadcast processing method provided in an embodiment of the present application;

[0056] FIG9 is a schematic diagram of a first broadcast process queue provided in an embodiment of the present application;

[0057] FIG10 is a flow chart of a broadcast processing method provided in an embodiment of the present application;

[0058] FIG11 is a schematic structural diagram of a broadcast processing device provided in an embodiment of the present application;

[0059] FIG12 is a schematic diagram of the hardware structure of another electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0060] To facilitate a clear description of the technical solutions of the embodiments of the present application, some of the terms and technologies involved in the embodiments of the present application are briefly introduced below:

[0061] 1. Broadcast and broadcast type

[0062] As mentioned above, the broadcast mechanism involves a broadcast sender, a broadcast receiver, and an AMS. A broadcast sender can send a broadcast to an AMS. The AMS can search for the broadcast receiver corresponding to the broadcast and assign the broadcast receiver to a group in the broadcast process queue for AMS processing. It is understood that the broadcast can correspond to multiple broadcast receivers. During processing, the AMS can send the broadcast to its corresponding broadcast receivers in sequence, thus achieving broadcast distribution.

[0063] Generally speaking, broadcasts from a broadcast sender to an AMS, and from an AMS to a broadcast receiver, are both implemented using the binder mechanism. The binder mechanism is an inter-process communication (IPC) mechanism. For more information about its specific meaning, refer to the relevant technical documentation and will not be explained here.

[0064] Broadcasts can be divided into types: ordinary broadcasts and ordered broadcasts.

[0065] Normal broadcast: This can be understood as a broadcast that does not need to be distributed in a specific order. For example, broadcasts to broadcast receivers of the same priority level can be distributed in no specific order.

[0066] Normal broadcast can be understood as a disordered broadcast. During the distribution process of normal broadcast, all broadcast receivers that have registered for the broadcast can monitor the normal broadcast.

[0067] Ordered broadcast: This can be understood as a broadcast that is distributed according to a specific index order. During ordered broadcast distribution, electronic devices distribute ordered broadcasts to broadcast receivers in the order of their indexes in the broadcast receiver queue. Each broadcast receiver is assigned an index value; the smaller the index value, the earlier the ordered broadcast is distributed to the broadcast receiver.

[0068] For example, the broadcast receivers of an ordered broadcast may 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 broadcasting the ordered broadcast, the electronic device may distribute the ordered broadcast to broadcast receiver 1 in index order (e.g., in ascending order of index value), and then distribute the ordered broadcast to broadcast receiver 2.

[0069] It is understood that each broadcast receiver has the opportunity to influence the outcome of the broadcast distribution, such as terminating delivery to other non-distributed broadcast receivers.

[0070] 2. Broadcast Registration

[0071] Broadcast registration methods include: static registration and dynamic registration.

[0072] Static registration involves registering the broadcast receiver's information in the application's manifest file, which is then parsed during application installation to complete the registration. This static registration process can be performed in the PMS, which can store the correspondence between broadcasts and broadcast receivers during static registration.

[0073] Dynamic registration refers to registering the relevant information of the broadcast receiver with AMS by calling a function method (for example, by calling Context.registerReceiver()). The dynamic registration process can be in AMS, and AMS can store the corresponding relationship between the broadcast and the broadcast receiver when the broadcast is dynamically registered.

[0074] The embodiment of the present application does not specifically limit the broadcast registration method.

[0075] 3. Broadcast process queue (BPQ)

[0076] The broadcast process queue can be used to manage the order in which broadcast receivers receive broadcasts. The broadcast process queue can be divided into three groups according to the broadcast attributes: normal group, urgent group, and offload group.

[0077] The emergency group is used to store receivers for emergency broadcasts, which can be understood as broadcasts with emergency attributes. The payload group is used to store receivers for payload broadcasts, which can be understood as broadcasts with payload attributes. The normal group is used to store other broadcast receivers, which can be understood as receivers other than emergency and payload broadcasts.

[0078] During the broadcast distribution process, the broadcast may be first distributed to the broadcast receivers in the emergency group, then distributed to the broadcast receivers in the normal group, and then distributed to the broadcast receivers in the load group.

[0079] After receiving a broadcast from a broadcast sender, the AMS creates a broadcast process queue for each application process based on the user identification (UID) of the broadcast receiver's corresponding application process. The AMS then assigns the broadcast receiver to the corresponding group in the broadcast process queue based on the broadcast attributes. The enqueuing process is illustrated below with reference to the embodiment corresponding to Figure 1, which is a schematic diagram of a process for managing broadcast receivers provided in an embodiment of the present application.

[0080] As shown in Figure 1, the AMS receives broadcast A and determines that broadcast A can correspond to 8 broadcast receivers. The 8 broadcast receivers are sorted according to the priority order of the broadcast receivers. The broadcast receiver queue corresponding to broadcast A may include: broadcast receiver 1 corresponding to index 0, broadcast receiver 2 corresponding to index 1, broadcast receiver 3 corresponding to index 2, broadcast receiver 4 corresponding to index 3, broadcast receiver 5 corresponding to index 4, broadcast receiver 6 corresponding to index 5, broadcast receiver 7 corresponding to index 6, and broadcast receiver 8 corresponding to index 7, etc. Among them, index 0 can be understood as an index value of 0, index 1 can be understood as an index value of 1, and so on.

[0081] Among them, the priority values ​​corresponding to broadcast receiver 1, broadcast receiver 2, and broadcast receiver 3 can all be 1000. The priority values ​​corresponding to broadcast receiver 4 and broadcast receiver 5 can all be 100. The priority values ​​corresponding to broadcast receiver 6, broadcast receiver 7, and broadcast receiver 8 can all be 0. A broadcast receiver with a priority value of 1000 has a higher priority, and a broadcast receiver with a priority value of 0 has a lower priority. It can be understood that a higher priority value indicates that the broadcast can be sent to the broadcast receiver sooner.

[0082] 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 all be 3, meaning they need to wait for three broadcast receivers to be delivered. The blocking status flags for broadcast receivers 6, 7, and 8 can all be 5, meaning they need to wait for five broadcast receivers to be delivered.

[0083] When broadcast A enters the modern broadcast queue of AMS, each broadcast receiver is encapsulated into a separate some args object (or simply args object). The some args object can include broadcast information such as the broadcast index and the index of the broadcast receiver.

[0084] For example, the AMS can encapsulate broadcast receiver 1 in a some args object, namely, some args A1. Some args A1 may include: arg1 = the index of broadcast A (labeled as arg1), argi1 = the index of broadcast receiver 1 (such as index 0). In other words, some args A1 can be understood as the broadcast receiver with receiver index 1 in broadcast A. The contents of some argsA2 and some argsA8 can be similar to those in some args A1 and are not further described here.

[0085] AMS matches broadcast receivers to corresponding broadcast process queues based on their corresponding application processes. For example, AMS determines that broadcast receivers 1 and 2 are both from application process 1, so it creates broadcast process queue 1 for application process 1 and allocates some args A1 for broadcast receiver 1 and some args A2 for broadcast receiver 2 to broadcast process queue 1. AMS determines that broadcast receivers 3, 4, and 5 are all from application process 2, so it creates broadcast process queue 2 for application process 2 and allocates 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. AMS determines that broadcast receivers 6, 7, and 8 are all from application process 3, so it creates broadcast process queue 3 for application process 3 and allocates 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.

[0086] It can be understood that since broadcast A does not have an emergency attribute or a load attribute, the above 8 broadcast receivers corresponding to broadcast A can all be allocated to the common group of the broadcast process queue.

[0087] Similarly, when receiving broadcast B, broadcast C, broadcast D, etc., AMS can also obtain the broadcast receiver corresponding to any broadcast, and set the broadcast receiver corresponding to any broadcast in the corresponding broadcast process queue group. For example, AMS sets some args B1 corresponding to broadcast B in the normal group of broadcast process queue 1, sets some args C5 corresponding to broadcast C in the emergency group of broadcast process queue 1, and sets 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 emergency group of broadcast process queue 2, and sets 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, etc.

[0088] After the broadcast receivers are assigned to the broadcast process queue, the AMS may distribute the broadcast to the corresponding broadcast receivers in sequence according to the order of the broadcast receivers in the broadcast process queue and the order of the groups.

[0089] 4. Broadcast queue modern impl (BQMI)

[0090] In the latest version of Android (Android 14), modern broadcast queues 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, represented by a Broadcast Process Queue instance. This allows broadcasts sent by applications / systems to be scheduled based on the recipient process. Furthermore, modern broadcast queues can control each broadcast process queue to pause, delay, or preempt broadcast delivery to the corresponding broadcast receiver.

[0091] The following is a schematic illustration of the broadcast distribution process under a modern broadcast queue in conjunction with the embodiment corresponding to Figure 2. Figure 2 is a schematic diagram of a process for broadcast distribution based on a modern broadcast queue provided by an embodiment of the present application.

[0092] As shown in Figure 2, the broadcast distribution process is divided into three stages: enqueue stage, delivery stage, and dispatch stage.

[0093] The enqueue phase includes: when the broadcast enters the modern broadcast queue in the activity manager service, AMS encapsulates each broadcast receiver into a separate some args object, matches it to the corresponding broadcast process queue according to the application process of the broadcast receiver, and then allocates the some args object to the corresponding group of the broadcast process queue according to the broadcast attributes.

[0094] The delivery phase includes: AMS determines the ready time, and delivers the broadcast process queue to the ready (runnable) queue according to the ready time, obtains a broadcast process queue from the ready queue, and obtains a running resource in the running (running) queue for broadcast distribution.

[0095] Dispatch phase: AMS dispatches the broadcast to the broadcast receiver specified in the broadcast process queue based on the acquired running resources.

[0096] As shown in Figure 2, modern broadcast queues involve: temporary area queues, ready queues, running queues, etc.

[0097] The temporary storage area queue includes: the broadcast process queue that has been created in the modern broadcast queue.

[0098] As shown in the temporary storage area queues in Figure 2, 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.

[0099] When a broadcast enters the AMS's modern broadcast queue, AMS can create a broadcast process queue based on the application process of the broadcast receiver. AMS can encapsulate each broadcast receiver into a separate some args object and assign it to the corresponding group in the broadcast process queue based on the broadcast attributes. For details, see the corresponding description in Figure 1.

[0100] The contents of the broadcast process queue 1 and some args A1 in FIG2 can be found in the description of FIG1 , which will not be repeated here.

[0101] The ready queue includes a broadcast process queue arranged according to the ready time. The ready time can be understood as the time used for broadcast distribution to broadcast receivers.

[0102] The AMS can determine the ready time of each broadcast process queue based on the broadcast type, application process status, and other factors, and sort the broadcast process queues by ready time to obtain a ready queue. For the ready queue shown in Figure 2, the AMS can determine, based on the order of ready time, to broadcast the broadcast recipients in broadcast process queue 1 first, then broadcast the broadcast recipients in broadcast process queue 2, and then broadcast the broadcast recipients in broadcast process queue 3, and so on.

[0103] The run queue includes multiple running resources, and the distribution processing of a broadcast process queue can occupy one running resource. As shown in Figure 2, the AMS obtains broadcast process queue 1 from the ready queue. When distributing a broadcast to the broadcast receivers in broadcast process queue 1, it needs to obtain a running resource from the run queue and occupy a running resource for broadcast distribution. After the broadcast distribution is completed, the occupied running resource can be released. The run queue shown in Figure 2 can provide five running resources, including: four normal running resources and one expedited running resource.

[0104] It is understandable that the temporary storage queue, ready queue, running queue, and the contents contained in each queue described in Figure 2 are only used as an example and do not constitute a limitation on the modern broadcast queue described in the embodiments of the present application.

[0105] 5. Deadlock

[0106] Deadlock can be understood as an abnormal situation in the broadcast distribution process. Deadlock can be understood as a phenomenon in which two or more broadcast receivers in a group wait for each other due to disorder, caused by the first-in, first-out principle followed by each group in the broadcast process queue conflicting with the priority and order properties of each broadcast receiver in the group.

[0107] In one implementation, the deadlock situation is schematically illustrated in conjunction with the broadcast process queue described in FIG3 , which is a schematic diagram of a broadcast process queue provided in an embodiment of the present application.

[0108] As shown in Figure 3, the common groups of broadcast process queue 2 may include: some args A4, some args A3, and some args A5, etc. Some args A4 can be understood as the broadcast receiver with a receiver index of 4 in broadcast A (i.e., broadcast receiver 4), some args A3 can be understood as the broadcast receiver with a receiver index of 3 in broadcast A (i.e., broadcast receiver 3), and some args A5 can be understood as the broadcast receiver with a receiver index of 5 in broadcast A (i.e., broadcast receiver 5). The contents contained in the other groups in broadcast process queue 2 except the common groups, and the contents contained in broadcast process queue 3 can be seen in Figure 1 and will not be repeated here.

[0109] Referring to the priority descriptions for broadcast receiver 4 and broadcast receiver 3 in Figure 1 , the priority of broadcast receiver 3 is higher than that of broadcast receiver 4. Therefore, when the AMS distributes broadcasts according to the priority order of the broadcast receivers, the AMS may determine to distribute broadcast A to broadcast receiver 3 first, and then distribute broadcast A to broadcast receiver 4.

[0110] Referring to the ordered description of broadcast receiver 4 and broadcast receiver 3 in Figure 1 , the index of broadcast receiver 3 is located before that of broadcast receiver 4. Therefore, when the AMS distributes broadcasts according to the order of the broadcast receivers, the AMS can determine to distribute broadcast A to broadcast receiver 3 first, and then distribute broadcast A to broadcast receiver 4.

[0111] In the common group of broadcast process queue 2 shown in Figure 3, broadcast receiver 4 is queued first, followed by broadcast receiver 3. Therefore, when the AMS follows the first-in, first-out principle in the broadcast process queue group for broadcast distribution, it can determine that broadcast A should be distributed to broadcast receiver 4 first, and then to broadcast receiver 3.

[0112] However, in reality, when the AMS distributes broadcast A to broadcast receiver 4, because there are high-priority broadcast receivers or broadcast receivers ranked earlier (such as broadcast receiver 3) in the same group that have not yet been distributed, the AMS determines that broadcast receiver 4 needs to wait for the broadcast of the high-priority broadcast receiver or the distribution of the broadcast receiver ranked earlier. When the AMS distributes broadcast A to broadcast receiver 3, because there are broadcast receivers that entered the queue earlier in the same group (such as broadcast receiver 4) that have not yet been distributed, the AMS determines that broadcast receiver 3 needs to wait for the distribution of the broadcast receivers that entered the queue earlier in the group. Broadcast receivers 3 and 4 are both in a mutually waiting state, making it impossible for the broadcast receivers in the group to be distributed normally, resulting in a deadlock. The deadlock in the group will cause a chain reaction, resulting in the inability of other broadcast receivers in broadcast process queue 2, as well as broadcast receivers in broadcast process queue 3 located behind broadcast process queue 2, to perform broadcast distribution, affecting the entire broadcast distribution mechanism.

[0113] Combined with the description in Figure 3, the reasons for the disorder of broadcast receivers may include one or more of the following, for example: the priority of the broadcast receiver is temporarily adjusted, a low-priority broadcast receiver is directly added to the head of the queue, or the broadcast receiver carries a replace attribute, causing the broadcast receiver to be replaced, etc.

[0114] Deadlock can also be understood as a phenomenon in which the broadcast receiver at the head of any group in the broadcast process queue corresponding to the application process in a non-frozen state is in a blocked state for a long time, resulting in the inability to distribute other broadcast receivers in the group normally.

[0115] Frozen processes: Background processes that cannot access CPU resources. Frozen processes may be marked with the cached flag. Non-frozen processes can include one or more of the following: foreground processes, visible processes, and resident processes.

[0116] The blocked state of the head broadcast receiver may include: a broadcast receiver of the same high priority level has not yet been fully dispatched to it, a broadcast receiver with a higher index than the head ordered broadcast receiver has not yet been fully dispatched to it, or the corresponding process of the deferrable broadcast receiver is in a frozen state. It is understood that when a broadcast is an ordered broadcast, the corresponding broadcast receiver can be called an ordered broadcast receiver.

[0117] In another implementation, the deadlock situation is schematically illustrated in conjunction with the broadcast process queue described in FIG4 , which is a schematic diagram of another broadcast process queue provided in an embodiment of the present application.

[0118] As shown in Figure 4, the common groups of broadcast process queue 1 may include: some args A1, some args A2, and some args B1, etc. Some args A1 can be understood as the broadcast receiver with a receiver index of 1 in broadcast A (i.e., broadcast receiver 1), some args A2 can be understood as the broadcast receiver with a receiver index of 2 in broadcast A (i.e., broadcast receiver 2), and some args B1 can be understood as the broadcast receiver with a receiver index of 1 in broadcast B. The contents contained in the other groups in broadcast process queue 1 except the common groups, and the contents contained in broadcast process queue 2 can be seen in Figure 1 and will not be repeated here.

[0119] If application process 1 is not frozen and broadcast receiver 1, the first broadcast receiver in the normal group of broadcast process queue 1, remains blocked for longer than the time threshold, a deadlock will occur in the normal group. This deadlock in the normal group will trigger a chain reaction, preventing broadcast distribution for other broadcast receivers in broadcast process queue 1, as well as for broadcast receivers in broadcast process queue 2 behind broadcast process queue 1, thus affecting the entire broadcast distribution mechanism.

[0120] 6. Other terms

[0121] In the embodiments of this application, terms such as "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. For example, the terms "first chip" and "second chip" are used solely to distinguish between different chips and do not define their order. Those skilled in the art will understand that terms such as "first" and "second" do not define the quantity or execution order, and do not necessarily define differences.

[0122] It should be noted that in the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described in this application as "exemplary" or "for example" should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0123] In the embodiments of the present application, "at least one" refers to one or more, and "more" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items 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, c can be single or multiple.

[0124] 7. Electronic devices

[0125] The electronic devices of the embodiments of the present application may include handheld devices, vehicle-mounted devices, etc. with broadcast processing functions. For example, some electronic devices include: mobile phones, tablet computers, PDAs, laptop computers, mobile internet devices (MIDs), wearable devices, virtual reality (VR) devices, augmented reality (AR) devices, wireless terminals in industrial control, wireless terminals in self-driving cars, 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 wireless modems, in-vehicle devices, wearable devices, terminal devices in 5G networks or future evolved public land mobile communication networks. The terminal equipment in the network (PLMN), etc., is not limited to this in the embodiments of the present application.

[0126] The electronic devices in the embodiments of the present 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.

[0127] In the embodiments of the present application, the electronic device or each network device includes a hardware layer, an operating system layer running on the hardware layer, and an application layer running on the operating system layer. The hardware layer includes hardware such as a central processing unit (CPU), a memory management unit (MMU), and memory (also known as main memory). The operating system can be any one or more computer operating systems that implement business processing through processes, such as the Linux operating system, the Unix operating system, the Android operating system, the iOS operating system, or the Windows operating system. The application layer includes applications such as browsers, address books, word processing software, and instant messaging software.

[0128] As mentioned above, deadlock can occur in a variety of broadcast distribution scenarios. For example, deadlock during broadcast distribution can cause Wi-Fi network connection failures, instant messaging delays, alarm delays, and other application / functional failures, reducing the efficiency of modern broadcast mechanisms or even completely rendering them ineffective.

[0129] In conjunction with the embodiment corresponding to FIG5 , the deadlock situation is illustrated by taking the failure of WIFI network connection as an example. FIG5 is a schematic diagram of a scenario provided in an embodiment of the present application.

[0130] When the electronic device receives a message from the user turning on the WLAN setting function, it may display a WIFI setting interface as shown in a of Figure 5. The WIFI setting interface may display at least one available WIFI, such as WIFI1, WIFI2, and WIFI3.

[0131] In response to a user triggering operation on button 501 for connecting to WIFI1, the electronic device generates a WIFI status change broadcast, and the electronic device obtains a broadcast receiver corresponding to the WIFI status change broadcast. The broadcast receiver corresponding to the WIFI status change broadcast may include one or more of the following, for example: a user interface (UI) process corresponding to the WIFI settings interface, a process corresponding to a system application (such as an app store), or a process corresponding to a third-party application (such as a social application).

[0132] The electronic device assigns broadcast receivers, such as the UI process and processes corresponding to system applications (such as the App Store), to the broadcast process queue. If a deadlock occurs in any group of the broadcast process queue, the Wi-Fi status change broadcast will not be sent to the broadcast receivers, such as the UI process, and the electronic device will be unable to connect to Wi-Fi 1.

[0133] Understandably, when a deadlock occurs, the electronic device cannot promptly detect the deadlock anomaly in the broadcast process queue, resulting in the system not being able to immediately detect the deadlock when the problem occurs. If the system detects that the broadcast processing time exceeds 10 minutes, for example, it will throw an exception and store the anomaly in the error file. Meanwhile, the broadcast distribution process continues to operate in the erroneous deadlock state until all functions fail.

[0134] In view of this, an embodiment of the present application provides a broadcast processing method, so that when an electronic device recognizes that a deadlock exists in the distribution process of a first broadcast, it can set the state of the broadcast receiver (or called a deadlock receiver) that causes the deadlock to a final state, and create a proxy broadcast identical to the first broadcast, add the deadlock receiver to the broadcast receiver queue corresponding to the proxy broadcast, and redistribute the proxy broadcast to the deadlock receiver, thereby recovering the deadlock without affecting the normal distribution of the broadcast.

[0135] In order to better understand the embodiment of the present application, the structure of the terminal device of the embodiment of the present application is introduced below. For example, Figure 6 is a schematic diagram of the structure of a terminal device provided by the embodiment of the present application.

[0136] 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, an earphone interface 170D, a sensor module 180, a button 190, an indicator 192, a camera 193, and a display screen 194, etc.

[0137] It is understood that the structures illustrated in the embodiments of this application do not constitute specific limitations on the terminal device. In other embodiments of this application, the terminal device may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0138] Processor 110 may include one or more processing units. The different processing units may be independent devices or integrated into one or more processors. Processor 110 may also include a memory for storing instructions and data. For example, processor 110 may be used to execute the data processing steps in the broadcast processing method.

[0139] 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.

[0140] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks) applied on the terminal device.

[0141] The terminal device implements display functions through a GPU, display screen 194, and an application processor. The GPU is a microprocessor for broadcast processing, connecting the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering.

[0142] 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 display screens 194, where N is a positive integer greater than 1. For example, display screen 194 may be used to display a Wi-Fi setup interface or other interface as described in FIG. 4 .

[0143] The terminal device can realize the shooting function through the ISP, camera 193, video codec, GPU, display 194 and application processor.

[0144] 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 computer executable program code, which includes instructions. The internal memory 121 can 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 the broadcast processing method.

[0145] The terminal device can implement audio functions such as music playback and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0146] The sensor module 180 may include a touch sensor (not shown in FIG6 ). The touch sensor may be disposed on the display screen 194 , and the touch sensor and the display screen 194 form a touch screen, or “touch screen.” The touch sensor is configured to receive any touch operation of the user on the display screen 194 .

[0147] The software system of the terminal device can adopt a layered architecture, event-driven architecture, micro-kernel architecture, microservice architecture, or cloud architecture, etc., which will not be described here.

[0148] For example, Figure 7 is a schematic diagram of the software structure of an electronic device provided in an embodiment of the present application. As shown in Figure 6, the layered architecture divides the software into several layers, each with clear roles and divisions of labor. The layers communicate with each other through software interfaces.

[0149] In some embodiments, the Android system is divided into multiple layers, including the application (APP) layer, the application framework (FWK) layer, and the kernel layer from top to bottom, etc., which is not limited in the embodiments of the present application.

[0150] The application layer may include a series of application packages. The application layer may include at least one application, such as a system application, a third-party application (not shown in FIG7 ), etc., which is not limited in the embodiments of the present application.

[0151] Both the application layer and the application framework layer can implement broadcast event triggering. Taking the application layer as an example, the application layer can notify the AMS of the broadcast that needs to be distributed through the application context (contextimpl) interface. The communication method between the application layer and the AMS can use methods such as binder calls, which are not limited in the embodiments of this application.

[0152] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes predefined interfaces and can include a range of system services. System services are modular components that focus on specific functions. Functionality provided by the application framework API communicates with system services to access the underlying hardware.

[0153] The application framework layer may include: a system server process and a configuration management module.

[0154] 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 perform binder cross-process communication with other processes; (3) Create a system service manager, which is used to create, start and manage the life cycle of system services; (4) Create a main thread looper and enter a loop to wait for messages; (5) Start various system services, such as AMS and PMS.

[0155] AMS and PMS can run in the system service process. AMS is used to manage all activities and processes in the application. It can start, pause, stop and destroy activities, as well as manage the life cycle of the application. AMS can also allocate system resources such as memory, processes and threads to different applications. PMS is mainly responsible for the installation, management and uninstallation of applications. When a new application is installed, PMS will identify all components of the application (for example, services, broadcast receivers, etc.) and assign corresponding permissions to these components. PMS can also view the status of installed applications to ensure the integrity and security of the applications.

[0156] In an embodiment of the present application, the PMS may include the corresponding relationship between the broadcast and the broadcast receiver generated during the static registration of the broadcast; and the AMS may include the corresponding relationship between the broadcast and the broadcast receiver generated during the dynamic registration of the broadcast.

[0157] It is understandable that the system service process may also include other services, which are not described in detail in this application.

[0158] The configuration management module can be used to store and process the maintenance and testing information transmitted by the system service process, and to maintain and test the deadlock problems that occur when the system service process manages the application framework layer.

[0159] AMS can run modern broadcast queues and deadlock recovery modules. The process of broadcast distribution based on modern broadcast queues can be seen in the following descriptions ①-⑧. The process of deadlock recovery based on deadlock recovery modules can be seen in the following descriptions Description in .

[0160] As shown in Figure 7, the process of broadcast distribution based on modern broadcast queues can be as follows:

[0161] ① The application layer or application framework layer triggers broadcast events.

[0162] ②The application layer or application framework layer sends the broadcast to AMS for scheduling management.

[0163] ③ The AMS collects broadcast receivers. For example, the AMS can collect broadcast receivers that dynamically register for broadcasts from the AMS and statically register for broadcasts from the PMS. The AMS sorts all collected broadcast receivers according to their priority.

[0164] ④ AMS assigns broadcast receivers to broadcast process queues. For example, AMS assigns broadcast receivers to groups in the broadcast process queue based on the application process corresponding to the broadcast receiver and the broadcast attributes. The specific distribution process can be seen in the description of Figures 1 and 2 and will not be repeated here.

[0165] ⑤AMS schedules broadcast delivery from the broadcast process queue. For example, AMS determines the delivery order of broadcasts according to the order of packets in the broadcast process queue.

[0166] ⑥AMS determines whether to cold start or hot start the application process corresponding to the broadcast receiver. If the application process is not closed, AMS hot 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 ⑦.

[0167] ⑦AMS distributes the broadcast to the broadcast receivers, for example, by calling the binder to pass the broadcast to the broadcast receiver in the application layer.

[0168] ⑧AMS instructs the zygote process to create an application process.

[0169] The process of deadlock recovery based on the deadlock recovery module can be as follows:

[0170] ⑨ The AMS searches for deadlocked receivers. For example, the AMS may traverse the blocked broadcast process queues in the temporary storage area, mark broadcast receivers that meet preset conditions as deadlocked receivers, and mark the deadlocked receivers' states as final. The specific process by which the AMS marks broadcast receivers that meet preset conditions as deadlocked receivers can be found in the description of S803 and will not be repeated here.

[0171] 10. The AMS constructs a proxy broadcast. For example, the AMS obtains the first broadcast corresponding to the deadlocked receiver and constructs a proxy broadcast with the same broadcast attributes as the first broadcast. The broadcast receiver corresponding to this proxy broadcast can be called a proxy receiver. The proxy receiver can be the deadlocked receiver described above. The specific process involved in constructing the proxy broadcast can be found in S806 and will not be repeated here.

[0172] The AMS groups proxy receivers. For example, the AMS can create a new proxy group when creating a broadcast process queue. A proxy group, also known as a first group, is used to temporarily store proxy receivers.

[0173] The AMS schedules proxy receivers. When the AMS determines that the proxy group is not empty, it may determine a second ready time for the proxy receiver at the head of the proxy group and distribute the proxy broadcast to the proxy receiver when the second ready time arrives. The specific process of the AMS calculating the second ready time can be found in S814 and is not further described here.

[0174] The AMS determines to skip the deadlocked receiver. Since the AMS has marked the state of the deadlocked receiver as final in step 9, the AMS can skip the deadlocked receiver and distribute the first broadcast to the broadcast receivers behind the deadlocked receiver when performing broadcast distribution.

[0175] In a possible implementation, the application framework layer may further 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 (not shown in FIG. 7 ).

[0176] The kernel layer creates application processes. This layer includes the Zygote process. The Zygote process is started by the initialization (init) process in user space and is the first Android Runtime process running in the Android operating system. The Zygote process primarily creates system service processes and other application processes.

[0177] In possible implementations, the electronic device may further include a hardware abstraction layer, a driver layer, and other software layers, etc. In the embodiments of the present application, the software layers involved in the software architecture, the modules included in the layers, and the functions of the modules are not specifically limited.

[0178] The following specific embodiments are used to describe in detail the technical solution of the present application and how the technical solution of the present application solves the above technical problems. The following specific embodiments can be implemented independently or in combination with each other. For the same or similar concepts or processes, some embodiments may not be described in detail.

[0179] For example, Figure 8 is a flowchart of a broadcast processing method provided by an embodiment of the present application. In the embodiment corresponding to Figure 8, the electronic device may include one or more of the following: AMS, modern broadcast queue, work thread, or broadcast process queue.

[0180] Among them, AMS, modern broadcast queues, and broadcast process queues can all run in the same thread, which can be the main thread in the AMS thread pool. The worker thread can be a child thread in the AMS thread pool. The main thread and the worker thread are different. The names of the main thread and the worker thread are for illustrative purposes only and do not constitute a limitation on the embodiments of this application.

[0181] Prior to S801, the AMS may obtain the first broadcast recipient corresponding to the first broadcast. Based on the attributes of the first broadcast and the application process corresponding to the first broadcast recipient, the AMS may assign the first broadcast recipient to the corresponding broadcast process queue. For example, the AMS may assign at least two of the first broadcast recipients to the first broadcast process queue. A proxy group is added to the first broadcast process queue. The meaning and use of the proxy group can be found in the description of S805 and will not be further elaborated here.

[0182] The first broadcast may be sent by a broadcast sender to the AMS. Accordingly, the AMS may receive the first broadcast sent by the broadcast sender to the AMS. It is understood that the broadcast sender may be an operating system, an application, or a component in an electronic device, and this application does not limit this.

[0183] There is a second correspondence between the first broadcast and the first broadcast receiver, and the second correspondence may be obtained from the AMS and the PMS. The number of the first broadcast receivers may be one or more, which is not limited in the embodiments of the present application.

[0184] For example, the broadcast sender calls the contextimpl interface to pass the first broadcast and its broadcast attributes to the AMS via a broadcast sending instruction. Upon detecting the first broadcast, the AMS can collect the first broadcast receivers from the AMS or PMS using a broadcast receiver collecting instruction. The broadcast sending instruction can include broadcastIntentWithFeature(), and the broadcast receiver collecting instruction can include collectReceiverComponents().

[0185] As shown in FIG8 , the broadcast processing method may include: an enqueueing phase described in S801 - S807 , a delivery phase described in S808 - S812 , and a dispatching phase described in S813 .

[0186] S801: In response to a deadlock trigger, a working thread searches for a deadlock receiver.

[0187] A deadlocked receiver can be understood as a broadcast receiver that causes a deadlock in the broadcast process queue. A deadlocked receiver can be marked with a deadlock flag or not. In a possible implementation, a worker thread can search the broadcast process queue for broadcast receiver 3 that causes the deadlock and add a deadlock flag to broadcast receiver 3. For ease of subsequent description, broadcast receiver 3 that causes the deadlock can be referred to as a deadlocked receiver.

[0188] It is understandable that the name of the deadlock receiver is only an example. In some embodiments, the deadlock receiver may also be called an abnormal broadcast receiver, or a target broadcast receiver, etc., which is not limited in the embodiments of the present application.

[0189] Based on the description of deadlock in the broadcast mechanism in Figures 3 and 4, the worker thread can find the deadlock receiver in the following two ways when it detects that the broadcast process queue is in the blocked state:

[0190] In one implementation, when a low-priority broadcast receiver is ahead of a high-priority broadcast receiver in any group of the broadcast process queue in the blocked state, the worker thread can determine that a deadlock is triggered and mark the high-priority broadcast receiver as a deadlocked receiver.

[0191] The first broadcast receivers include: a high-priority broadcast receiver and a low-priority broadcast receiver. Determining whether two broadcast receivers are distributed by the same broadcast can be based on a hash code of the broadcast monitored by the broadcast receivers. For example, the hash code of the broadcast monitored by the high-priority broadcast receiver is the same as the hash code of the broadcast monitored by the low-priority broadcast receiver, and the two broadcast receivers are on the same electronic device.

[0192] In another implementation, when the working thread detects that the application process corresponding to the broadcast process queue is in a non-frozen state and the time length of the head broadcast receiver in the queue being in the blocked state is greater than the third threshold, the working thread can determine that a deadlock is triggered and mark the head broadcast receiver as a deadlock receiver.

[0193] Exemplarily, the working thread may search for the deadlock receiver in the temporary storage queue by calling an instruction for searching for the deadlock receiver. The instruction for searching for the deadlock receiver may include: findDeadlockReceiver().

[0194] S802: The working thread notifies the modern broadcast queue to set the state of the deadlocked receiver to the final state.

[0195] The worker thread may send information of the deadlock receiver to the modern broadcast queue while notifying the modern broadcast queue to set the state of the deadlock receiver to the final state.

[0196] The deadlock receiver information may include: attribute information of the first broadcast and an index value corresponding to the deadlock receiver. It is understood that the attribute information of the first broadcast and the index value corresponding to the deadlock receiver can be used to uniquely identify the deadlock receiver in the modern broadcast queue.

[0197] Exemplarily, the worker thread may notify the modern broadcast queue to mark the deadlocked receiver by calling an instruction for decoupling the deadlocked receiver. The instruction for decoupling the deadlocked receiver may include: finishReceiverActiveLocked().

[0198] S803. The modern broadcast queue sets the state of the deadlocked receiver to the final state.

[0199] The state of a broadcast receiver can be used to indicate the broadcast receiver's distribution status. For example, when the broadcast receiver's state is in any of the terminal states, it can be understood that the current broadcast queue will not distribute the broadcast to the broadcast receiver. Alternatively, when the broadcast receiver's state is in the pending state, it can be understood that the broadcast receiver is waiting for the broadcast to be delivered.

[0200] It is understandable that when the worker thread sets the state of the deadlock receiver to the final state, the subsequent worker thread will not distribute the first broadcast to the deadlock receiver when performing broadcast distribution.

[0201] The final state can be understood as the final state of the broadcast receiver. The final state can include one or more of the following: skipped state, sent complete state, or sent failed state. It is understood that the AMS can set the state of the deadlocked receiver to the skipped state in the final state, so that subsequent electronic devices can determine the actual distribution status of the broadcast receiver based on the status of the broadcast receiver.

[0202] In this way, the AMS can set the deadlocked receiver's state to final, thereby removing the deadlocked receiver's blocking restrictions on other broadcast receivers and resuming normal delivery of the first broadcast. For example, when a subsequent worker thread detects that the deadlocked receiver's state is final, it can skip the deadlocked receiver and distribute the first broadcast to the next broadcast receiver in the deadlocked receiver's group.

[0203] S804: The modern broadcast queue creates a proxy broadcast, and the broadcast receiver queue corresponding to the proxy broadcast includes the proxy receiver.

[0204] The proxy broadcast may include the same attribute information as the first broadcast. The attribute information of the first broadcast may include one or more of the following: the package name of the broadcast sender, the permissions of the first broadcast, the optional parameters of the first broadcast, the identifier of the first broadcast, the order attribute of the first broadcast, or the priority attribute of the first broadcast.

[0205] Proxy broadcasts can have a proxy attribute (also known as a preset attribute) that can be used to distinguish proxy broadcasts from primary broadcasts. The proxy attribute can have a value of true or false. For example, the proxy attribute of a proxy broadcast can be true, while the proxy attribute of a primary broadcast can be false.

[0206] It is understandable that the proxy attribute being false can be understood as the broadcast not containing the proxy attribute. The proxy broadcast name is only used as an example, for example, the proxy broadcast can also be called the second broadcast, etc., which is not limited in this application.

[0207] The proxy receiver can be the deadlock receiver described in S801, or it can be the same as the deadlock receiver described in S801. The difference is that the proxy receiver's state is different from the deadlock receiver's. That is, the deadlock receiver's state is terminal, while the proxy receiver's state can be delivered. The broadcast receiver queue corresponding to the proxy broadcast contains only one proxy receiver.

[0208] Exemplarily, a modern broadcast queue may determine that the deadlocked receiver is a proxy receiver based on the attribute information of the first broadcast and the index value corresponding to the deadlocked receiver, and establish a corresponding relationship between the proxy broadcast and the proxy receiver. For example, a modern broadcast queue may construct a proxy broadcast by calling an instruction for constructing a broadcast, and the instruction for constructing a broadcast may include: newBroadcastRecordEx().

[0209] S805. The modern broadcast queue determines a first broadcast process queue according to the application process where the proxy receiver is located, and assigns the proxy receiver to a proxy group of the first broadcast process queue according to the proxy attribute of the proxy broadcast.

[0210] A proxy group may be added to the first broadcast process queue, and the proxy group is used to store proxy receivers corresponding to the proxy broadcast.

[0211] Exemplarily, a modern broadcast queue determines whether a first broadcast process queue exists based on the application process where the proxy receiver is located. When the first broadcast process queue does not exist, the modern broadcast queue creates a first broadcast process queue with a proxy group. During the enqueue phase, the modern broadcast queue can group broadcast receivers based on broadcast attributes. For example, when the modern broadcast queue determines that the proxy attribute of the proxy broadcast is true, the proxy receiver corresponding to the proxy broadcast is assigned to the proxy group. When the modern broadcast queue determines that the proxy attribute of the broadcast is false, the broadcast receiver can be assigned to one of the normal, urgent, and load groups based on other attributes of the broadcast.

[0212] The first broadcast process queue is described in conjunction with the embodiment corresponding to Figure 9, which is a schematic diagram of a first broadcast process queue provided in an embodiment of the present application. In the embodiment corresponding to Figure 9, the first broadcast can be Broadcast A described in Figure 3, and the first broadcast receivers include: Broadcast Receiver 3, Broadcast Receiver 4, and Broadcast Receiver 5.

[0213] Typically, as shown in a in FIG9 , a modern broadcast queue can allocate some args A3 corresponding to broadcast receiver 3, some args A4 corresponding to broadcast receiver 4, and some args A5 corresponding to broadcast receiver 5 to the common group of the first broadcast process queue according to the attributes of broadcast A.

[0214] If the AMS determines, based on steps S801-S804, that broadcast receiver 3 is a deadlocked receiver, it can create a proxy broadcast with the same broadcast attributes as broadcast A. The AMS adds broadcast receiver 3, corresponding to the proxy broadcast, to the proxy group in the first broadcast process queue. As shown in Figure 9 (b), the proxy group contains some args A3 corresponding to broadcast receiver 3.

[0215] It can be understood that the first broadcast process queue can also include at least one broadcast receiver among the first broadcast receivers. The process of determining the first broadcast process queue and the grouping of the first broadcast receivers in the first broadcast process queue by the modern broadcast queue can be referred to the description in Figures 1-2, and will not be repeated here.

[0216] S806. The current broadcast queue notifies the broadcast process queue and the proxy receiver receives the group in the first broadcast process queue.

[0217] S807: The broadcast process queue adds the proxy receiver to the group in the first broadcast process queue.

[0218] Exemplarily, the broadcast process queue may add the proxy receiver to the proxy group in the first broadcast process queue by calling the getProxyQueue() instruction.

[0219] It is understood that during the delivery phase, the AMS can complete the update of the ready queue. For example, a modern broadcast queue can update the ready queue by calling the instruction for updating the ready queue. The instruction for updating the ready queue may include: updaterunableList().

[0220] S808. The modern broadcast queue notifies the working thread to perform preparation work for entering the running queue.

[0221] Preparations for entering the run queue may include determining whether the broadcast distribution can be performed at the ready time and whether there are sufficient running resources in the run queue for the broadcast distribution. Modern broadcast queues notify the worker thread to perform preparations for entering the run queue and update the run queue by calling an instruction for updating the run queue. The instruction for updating the run queue may include MSG_UPDATE_RUNNING_LIST.

[0222] S809: The working thread performs preparation work for entering the running queue.

[0223] When the worker thread determines that broadcast distribution can be performed when the ready time arrives and there are sufficient running resources in the running queue for broadcast distribution, it allocates the first broadcast process queue to the running queue and executes the step shown in S815.

[0224] S810. The working thread notifies the broadcast process queue to update the ready time.

[0225] For example, the worker thread can notify the broadcast process queue to update the ready time by calling getrunnableAt().

[0226] S811. The broadcast process queue calculates the second ready time of the proxy receiver.

[0227] Exemplarily, the broadcast process queue may determine whether the proxy group in the first broadcast process queue is not empty. When it is determined that the proxy group in the first broadcast process queue is not empty, the broadcast process queue may calculate the second ready time of the proxy receiver (and the first ready time of the first broadcast receiver). Alternatively, when it is determined that the proxy group in the first broadcast process queue is empty, the broadcast process queue may calculate the first ready time corresponding to the first broadcast receiver.

[0228] Second ready time = enqueue time - agent broadcast advance time interval.

[0229] The proxy broadcast advance time interval setting can be used to achieve early distribution of the proxy broadcast, such as a value of 500 milliseconds, etc. The enqueue time can be the time when the proxy broadcast enters the modern broadcast queue.

[0230] In a possible implementation, when the first ready time is earlier than the second ready time, the AMS may first broadcast the message to the first broadcast receiver, and then broadcast the message to the proxy receiver. The steps for calculating the first ready time by the broadcast process queue can be found in the description of calculating the ready time in the embodiment corresponding to FIG2 , and are not repeated here. The broadcast process queue can update the ready time by calling updateRunnableAt().

[0231] S812: The broadcast process queue sends the second ready time to the working thread.

[0232] S813: When the second ready time arrives, the worker thread distributes the proxy broadcast to the proxy receiver.

[0233] The worker thread may distribute the proxy broadcast to the proxy receiver according to the second ready time. The worker thread may perform the broadcast distribution by calling a broadcast distribution instruction, which may include: dispatchReceivers().

[0234] It can be understood that since the status of the deadlock receiver in the first broadcast receiver has been set to the completed state, when the working thread distributes the first broadcast, it can distribute the first broadcast to the broadcast receiver before the deadlock receiver and the broadcast receiver after the deadlock receiver in sequence.

[0235] Based on this, electronic devices can not only perform deadlock detection but also implement deadlock recovery. Compared to the traditional processing mechanism that does not take any measures or directly terminates the system or process when a deadlock is detected, the embodiment of the present application can release the deadlock restriction of the deadlocked receiver in its broadcast process queue by setting the state of the deadlocked receiver to the final state. In addition, by re-queuing the deadlocked receiver and re-delivering the distribution, the normal distribution of the broadcast can be restored without the user's perception. In this way, the system can continue to operate smoothly, the robustness of the broadcast mechanism is enhanced, and the overall reliability and stability of the system are improved.

[0236] It can be understood that the deadlock recovery steps described in Figure 8 can not only achieve deadlock recovery in one broadcast process queue, but also achieve deadlock recovery in multiple broadcast process queues. The specific process is similar to that in Figure 8 and will not be repeated here.

[0237] To more clearly illustrate the content provided by the embodiment of the present application, FIG10 is a flowchart of a broadcast processing method provided by the embodiment of the present application. As shown in FIG10 , the broadcast processing method may include the following steps:

[0238] S1001. An electronic device receives a first broadcast sent by a broadcast sender.

[0239] The broadcast receiver queue corresponding to the first broadcast includes the first broadcast receiver, and the number of the first broadcast receivers is N, where N is greater than or equal to 1.

[0240] S1002: The electronic device assigns a first broadcast receiver to a first broadcast process queue.

[0241] S1003: When the first broadcast process queue is in a blocked state, the electronic device obtains a target broadcast receiver from the first broadcast receivers and sets the state of the target broadcast receiver to a final state.

[0242] The target broadcast receiver may be the deadlock receiver described in the embodiments of the present application.

[0243] The process of the electronic device acquiring the target broadcast receiver from the first broadcast receiver can refer to the description of searching for deadlocked receivers in S801, which will not be repeated here.

[0244] The final state may also be called the final state, and the final state may include one or more of the following: a skip state, a sending completion state, or a sending failure state.

[0245] S1004: The electronic device creates a second broadcast.

[0246] The second broadcast may be the proxy broadcast described in the embodiment of the present application, wherein the second broadcast is the same as the first broadcast, and the broadcast receiver queue corresponding to the second broadcast includes the target broadcast receiver.

[0247] The process of creating the second broadcast can refer to the description of creating the proxy broadcast in S804, which will not be repeated here.

[0248] S1005: The electronic device distributes the second broadcast to target broadcast receivers.

[0249] The target broadcast receiver described in S1004-S1005 may also be the proxy receiver described in the embodiment of the present application. The proxy receiver is the same as the deadlock receiver, so both can be described as the target broadcast receiver.

[0250] Based on this, when the electronic device recognizes that there is a congestion in the distribution process of the first broadcast, it can set the state of the broadcast receiver that caused the congestion to the final state, create a second broadcast that is identical to the first broadcast, add the target broadcast receiver to the broadcast receiver queue corresponding to the second broadcast, and redistribute the second broadcast to the target broadcast receiver, thereby restoring the congestion without affecting the normal distribution of the broadcast.

[0251] It should be noted that the sequential relationship between the steps described in the embodiments of the present application is only an example and does not constitute a limitation to the embodiments of the present application.

[0252] It should be noted that the module names involved in the embodiments of the present application can be defined as other names as long as the functions of each module can be achieved, and there is no specific restriction on the names of the modules.

[0253] 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 the present application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0254] The broadcast processing method according to an embodiment of the present application has been described above in conjunction with Figures 4-10. The apparatus for executing the above method provided in an embodiment of the present application is described below. Those skilled in the art will appreciate that the method and apparatus may be combined and referenced with each other, and the relevant apparatus provided in an embodiment of the present application may execute the steps in the above-described list sorting method.

[0255] Figure 11 is a structural diagram of a broadcast processing device provided in an embodiment of the present application. The broadcast processing device can be an electronic device in an embodiment of the present application, or a chip or chip system in an electronic device.

[0256] As shown in FIG11 , a broadcast processing apparatus 1100 can be used in a communication device, circuit, hardware component, or chip. The broadcast processing apparatus 1100 includes an acquisition unit 1101 and a processing unit 1102. The acquisition unit 1101 is configured to support the acquisition step of the broadcast processing method; the processing unit 1102 is configured to support the broadcast processing apparatus 1100 in performing the information processing step.

[0257] In a possible implementation, the broadcast processing device 1100 may further include a communication unit 1103, and the communication unit 1103 is used to support the broadcast processing device 1100 in executing steps such as receiving or sending a message.

[0258] The broadcast processing devices described in the embodiments of the present application may include the units described in the embodiment corresponding to Figure 11.

[0259] Specifically, the processing unit 1102 and the obtaining unit 1101 may be integrated together, and the processing unit 1102 and the obtaining unit 1101 may communicate with each other.

[0260] In a possible implementation, the broadcast processing apparatus 1100 may further include a storage unit 1104. The storage unit 1104 may include one or more memories, and the memories may be devices in one or more devices or circuits for storing programs or data.

[0261] The storage unit 1104 can exist independently and be connected to the processing unit 1102 via a communication bus. The storage unit 1104 can also be integrated with the processing unit 1102.

[0262] Taking the example where the broadcast processing device 1100 can be a chip or chip system of an electronic device in an embodiment of the present application, the storage unit 1104 can store computer-executable instructions of the method of the electronic device, so that the processing unit 1102 executes the method of the electronic device in the above embodiment. The storage unit 1104 can be a register, a cache, or a random access memory (RAM), etc. The storage unit 1104 can be integrated with the processing unit 1102. The storage unit 1104 can be a read-only memory (ROM) or other type of static storage device that can store static information and instructions. The storage unit 1104 can be independent of the processing unit 1102.

[0263] In one possible implementation, the broadcast processing apparatus 1100 may further include a communication unit 1103. The communication unit 1103 is configured to support interaction between the broadcast processing apparatus 1100 and other devices. For example, when the broadcast processing apparatus 1100 is an electronic device, the communication unit 1103 may be a communication interface or interface circuit. When the broadcast processing apparatus 1100 is a chip or system-on-chip within the electronic device, the communication unit 1103 may be a communication interface. For example, the communication interface may be an input / output interface, pin, or circuit.

[0264] The device of this embodiment can be used to execute the steps executed in the above method embodiment. Its implementation principles and technical effects are similar and will not be described in detail here.

[0265] FIG12 is a schematic diagram of the hardware structure of another electronic device provided in an embodiment of the present application.

[0266] The electronic device includes a processor 1201, a communication line 1204 and at least one communication interface (the communication interface 1203 is used as an example in FIG. 12 ).

[0267] 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 for controlling the execution of the program of the present application.

[0268] Communications link 1204 may include circuitry that transmits information between the aforementioned components.

[0269] The communication interface 1203 uses any transceiver or other device for communicating with other devices or communication networks, such as Ethernet, wireless local area networks (WLAN), etc.

[0270] Possibly, the electronic device may further include a memory 1202 .

[0271] The memory 1202 may be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (RAM) or other type of dynamic storage device that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, an optical disc storage (including a compact disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory may be independent and connected to the processor via a communication line 1204. The memory may also be integrated with the processor.

[0272] The memory 1202 is used to store computer-executable instructions for executing the solution of the present application, and the execution is controlled by the processor 1201. The processor 1201 is used to execute the computer-executable instructions stored in the memory 1202, thereby implementing the method provided by the embodiment of the present application.

[0273] Possibly, the computer-executable instructions in the embodiments of the present application may also be referred to as application code, and the embodiments of the present application do not specifically limit this.

[0274] In a specific implementation, as an embodiment, the processor 1201 may include one or more CPUs, such as CPU0 and CPU1 in FIG12 .

[0275] In a specific implementation, as an embodiment, an electronic device may include multiple processors, such as processor 1201 and processor 1205 in FIG12 . Each of these processors may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. The processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).

[0276] The broadcast processing method provided in the embodiment of the present application can be applied to electronic devices with communication functions. The electronic devices include terminal devices. The specific device form of the terminal device can refer to the above related descriptions and will not be repeated here.

[0277] An embodiment of the present application provides a terminal device, which includes: a processor and a memory; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, so that the terminal device executes the above method.

[0278] The present embodiment provides a chip. The chip includes a processor configured to invoke a computer program stored in a memory to execute the technical solution of the above embodiment. The implementation principles and technical effects are similar to those of the above-mentioned related embodiments and will not be further described here.

[0279] The embodiments of the present application also provide a computer-readable storage medium. The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the above-mentioned method is implemented. The methods described in the above embodiments can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. If implemented in software, the functions can be stored as one or more instructions or codes on a computer-readable medium or transmitted on a computer-readable medium. Computer-readable media 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 that can be accessed by a computer.

[0280] In one possible implementation, computer-readable media may include RAM, ROM, compact disc read-only memory (CD-ROM) or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium designed to carry or store the desired program code in the form of instructions or data structures and accessible by a computer. Moreover, any connection is appropriately referred to as a computer-readable medium. For example, if a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL) or wireless technologies such as infrared, radio and microwave are used to transmit software from a website, server or other remote source, the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technologies such as infrared, radio and microwave are included in the definition of medium. Disk and optical disk as used herein include optical disk, laser disk, optical disk, digital versatile disk (DVD), floppy disk and Blu-ray disk, where disks generally reproduce data magnetically, while optical disks reproduce data optically using lasers. Combinations of the above should also be included within the scope of computer-readable media.

[0281] An embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is executed, the computer executes the above method.

[0282] The present application embodiment is described with reference to the flow chart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present application.It should be understood that each flow process and / or box in the flow chart and / or block diagram and the combination of the flow process and / or box in the flow chart and / or block diagram can be realized by computer program instructions.These computer program instructions can be provided to the processing unit of general-purpose computer, special-purpose computer, embedded processing machine or other programmable device to produce a machine, so that the instruction executed by the processing unit of computer or other programmable data processing device produces the device for realizing the function specified in one flow chart flow or multiple flows and / or one block or multiple blocks of block diagram.

[0283] The above specific implementation methods further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above are only specific implementation methods of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent replacements, improvements, etc. made on the basis of the technical solutions of the present invention should be included in the scope of protection of the present invention.

Claims

1. A broadcast processing method, characterized in that, including: receiving a first broadcast sent by a broadcast sender, where a first broadcast receiver queue corresponding to the first broadcast includes first broadcast receivers, and the number of broadcast receivers in the first broadcast receivers is N, and N is greater than or equal to 1; allocating the first broadcast receivers to a first broadcast process queue; when the first broadcast process queue is in a blocked state, obtaining a target broadcast receiver from the first broadcast receivers, and setting the state of the target broadcast receiver to a final state; creating a second broadcast, where the second broadcast is the same as the first broadcast, and a broadcast receiver queue corresponding to the second broadcast includes the target broadcast receiver; distributing the second broadcast to the target broadcast receiver.

2. The method according to claim 1, characterized in that, The first broadcast process queue includes one or more of the following: a normal packet, a load packet, an emergency packet, and a first packet. The first packet is used to store broadcast receivers corresponding to a preset broadcast, and the preset broadcast is a broadcast with a preset attribute. After creating the second broadcast, the method further includes: allocating the target broadcast receiver to the first packet, and the second broadcast has the preset attribute.

3. The method according to claim 2, wherein The first broadcast receivers further include: second broadcast receivers, and the first broadcast process queue further includes a second packet. The allocating the first broadcast receivers to the first broadcast process queue includes: allocating the second broadcast receivers to the second packet, the first broadcast does not have the preset attribute, and the second packet is different from the first packet.

4. The method according to any one of claims 1 to 3, characterized in that, The final state includes one or more of the following: a skipped state, a sent completed state, or a sent failed state.

5. The method according to any one of claims 1 to 4, characterized in that During the process of broadcasting and distributing the second broadcast, the state of the target broadcast receiver is in a delivery state.

6. The method according to any one of claims 1-5, characterized in that, Before distributing the second broadcast to the target broadcast receiver, the method further includes: calculating a first time, where the first time is determined based on a second time and a preset time interval, and the second time is the time when the second broadcast enters a modern broadcast queue; distributing the second broadcast to the target broadcast receiver when the first time arrives.

7. The method according to any one of claims 1 to 6, characterized in that, The first broadcast process queue includes: a third packet, and the third packet is different from the first packet. The obtaining a target broadcast receiver from the broadcast receivers corresponding to the first broadcast includes: when the blocked duration of the target broadcast receiver is greater than a first duration, obtaining the target broadcast receiver, where the target broadcast receiver is located at the head of the queue in the third packet, and the application process corresponding to the target broadcast receiver is in a non-frozen state within the first duration.

8. The method according to any one of claims 1 to 6, characterized in that The first broadcast process queue includes: a fourth packet, and the fourth packet is different from the first packet. The first broadcast receivers further include: third broadcast receivers. The obtaining a target broadcast receiver from the broadcast receivers corresponding to the first broadcast includes: When the priority of the target broadcast receiver is higher than that of the third broadcast receiver, obtain the target broadcast receiver, where both the third broadcast receiver and the target broadcast receiver are in the fourth group, the third broadcast receiver is in the first position in the fourth group, the target broadcast receiver is in the second position in the fourth group, and the second position is after the first position.

9. The method according to claim 8, wherein The fourth group further includes a fourth broadcast receiver, the fourth broadcast receiver is in the third position in the fourth group, and the third position is after the second position. The method further includes: After distributing the first broadcast to the third broadcast receiver, distribute the first broadcast to the fourth broadcast receiver.

10. An electronic device, characterized in that, The electronic device includes: one or more processors and a memory; The memory is coupled to the one or more processors, and the memory is used to store computer program code. The computer program code includes computer instructions, and the one or more processors call the computer instructions to cause the electronic device to execute the method according to any one of claims 1 to 9.

11. A chip system, characterized in that, The chip system is applied to an electronic device. The chip system includes one or more processors, and the one or more processors are used to call computer instructions to cause the electronic device to execute the method according to any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes computer instructions, and when the computer instructions run on an electronic device, the electronic device is caused to execute the method according to any one of claims 1 to 9.

13. A computer program product, characterized in that, The computer program product includes computer program code, and when the computer program code runs on an electronic device, the electronic device is caused to execute the method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Mobile terminal operation system card slack abnormity detection recovery method and mobile terminal

    CN105208590A

  • Broadcast receiver adjusting method and device and terminal

    CN106851592A

  • Management method and device for broadcast receiver, and terminal

    CN106933685A

  • Broadcast receiver queue adjustment method and device and terminal

    CN106936827A