CN116185669A - Broadcast distribution method and related equipment - Google Patents

Broadcast distribution method and related equipment Download PDF

Info

Publication number
CN116185669A
CN116185669A CN202310470038.4A CN202310470038A CN116185669A CN 116185669 A CN116185669 A CN 116185669A CN 202310470038 A CN202310470038 A CN 202310470038A CN 116185669 A CN116185669 A CN 116185669A
Authority
CN
China
Prior art keywords
broadcast
target
broadcast receiver
ams
electronic device
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202310470038.4A
Other languages
Chinese (zh)
Other versions
CN116185669B (en
Inventor
忻振文
孙文涌
韩风
于佳欣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202310470038.4A priority Critical patent/CN116185669B/en
Publication of CN116185669A publication Critical patent/CN116185669A/en
Application granted granted Critical
Publication of CN116185669B publication Critical patent/CN116185669B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/542Event management; Broadcasting; Multicasting; Notifications
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Circuits Of Receivers In General (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The application discloses a broadcast distribution method and related equipment. According to the broadcast distribution method, the AMS may receive a broadcast transmitted by the broadcast transmitter, and aggregate target broadcast receivers for the same target process. For a target process corresponding to a plurality of target broadcast receivers, the AMS may transmit the received broadcast thereto. The target process corresponding to the plurality of target broadcast receivers then transmits the broadcast to each of its corresponding target broadcast receivers based on its corresponding target broadcast receiver information. By the method, for the target process corresponding to the target broadcast receivers, the AMS does not need to send the broadcast received by the AMS to the target broadcast receivers on the basis of the binder mechanism, but only sends the broadcast to the target process on the basis of one binder communication, so that the number of times of binder communication is reduced, the occupation of system resources such as CPU (Central processing Unit), memory and the like is reduced, and resource consumption and waste are avoided.

Description

Broadcast distribution method and related equipment
Technical Field
The present disclosure relates to the field of terminal technologies, and in particular, to a broadcast distribution method and related devices.
Background
As one of the four components of the Android system, broadcast (Broadcast) is a mechanism for messaging (e.g., transferring data, sending notifications, etc.) between components. These components may be in the same process or in different processes. That is, the broadcasting mechanism can be understood as an inter-process communication mechanism. The broadcast mechanism utilizes a watcher schema, based on a message publish/subscribe event model. The model includes a message publisher, a message subscriber, and a message center. The message publisher, message subscriber, and message center correspond to a sender (i.e., broadcast sender), a receiver (i.e., broadcast receiver), and an activity manager service (Activity Manager Service, AMS), respectively, in a broadcast mechanism.
The sender transmits a broadcast (i.e., a broadcast message) to the AMS, which then determines the receiver corresponding to the broadcast message and distributes the broadcast to the receiver corresponding to the broadcast. It is understood that the AMS may implement distribution of a broadcast to receivers based on a binder mechanism. Specifically, when the AMS distributes the same broadcast to different receivers belonging to the same process, the AMS sequentially transmits the same broadcast to the different receivers based on a binder mechanism. Under the condition that the corresponding receivers are more in broadcasting, the number of times of the binder communication (i.e. the communication based on the binder mechanism) between the AMS and the receivers is more, and each binder communication occupies system resources such as a CPU and a memory, so that resource consumption and waste are caused, and the execution of other important tasks is affected.
Therefore, how to efficiently perform broadcast distribution to reduce the occupied system resources is a problem to be solved at present.
Disclosure of Invention
The application provides a broadcast distribution method and related equipment. According to the broadcast distribution method, after the AMS receives a broadcast, it may aggregate with respect to a target broadcast receiver in the same target process. For a target process corresponding to a plurality of target broadcast receivers, the AMS may transmit a broadcast received by the AMS to the target process, and target broadcast receiver information corresponding to the target process. The target process may send the broadcast to each target broadcast receiver corresponding to the target process (i.e., each target broadcast receiver in the target process) based on its corresponding target broadcast receiver information. The method can reduce the frequency of the binder communication in the broadcast distribution process to a certain extent, thereby reducing the occupation of system resources.
In a first aspect, the present application provides a broadcast distribution method. The method can be applied to an electronic device. According to the method, the electronic device may receive a first broadcast transmitted by a broadcast transmitter through the activity manager service AMS, and may determine a target broadcast receiver and a target process based on the first correspondence and the first broadcast through the AMS. In case that there are a plurality of target broadcast receivers in a first process among the target processes, the electronic device may transmit the first broadcast and the first target broadcast receiver information to the first process through the AMS, and may also transmit the first broadcast to each target broadcast receiver in the first process based on the first target broadcast receiver information through the first process, respectively. Wherein the target process is a process to which the target broadcast receiver belongs. The first target broadcast receiver information includes related information of a plurality of target broadcast receivers in the first process.
In the scheme provided by the application, a broadcast sender in the electronic device can send a broadcast to an AMS in the electronic device, and after the AMS receives the broadcast, the AMS can aggregate with respect to a target broadcast receiver in the same target process. For a target process corresponding to a plurality of target broadcast receivers, the AMS may transmit a broadcast received by the AMS to the target process, and target broadcast receiver information corresponding to the target process. The target process may send the broadcast to each target broadcast receiver to which the target process corresponds based on its corresponding target broadcast receiver information. By the method, for the target process corresponding to the target broadcast receivers, the AMS does not need to send the broadcast received by the AMS to the target broadcast receivers on the basis of the binder mechanism, but only sends the broadcast to the target process on the basis of one binder communication, so that the number of times of binder communication is reduced, the occupation of system resources such as CPU (Central processing Unit), memory and the like is reduced, and resource consumption and waste are avoided.
With reference to the first aspect, in one possible implementation manner, the first correspondence is a correspondence between a broadcast receiver registered in the AMS and a broadcast type. The electronic device determining, by the AMS, the target broadcast receiver based on the first correspondence and the first broadcast may specifically include: the electronic device may determine, through the AMS, a broadcast receiver of the same type as the first broadcast as a target broadcast receiver, corresponding to the broadcast type, based on a correspondence of the broadcast receiver and the broadcast type.
In the scheme provided in the present application, the broadcast type corresponding to the target broadcast receiver may be the same as the type of the first broadcast. Thus, the electronic device can quickly find the target broadcast receiver based on the corresponding relation between the broadcast receiver and the broadcast type.
With reference to the first aspect, in one possible implementation manner, the first correspondence is a correspondence between broadcast receivers registered in the AMS and broadcasts. The determining, by the electronic device, the target broadcast receiver based on the first correspondence and the first broadcast by the AMS may specifically include: the electronic device may determine that a broadcast receiver corresponding to the broadcast is a first broadcast as a target broadcast receiver based on a correspondence between the broadcast receiver and the broadcast through the AMS.
In the solution provided in the present application, the broadcast corresponding to the target broadcast receiver may be the first broadcast. Thus, the AMS in the electronic device can quickly find the target broadcast receiver based on the correspondence between the broadcast receiver and the broadcast.
With reference to the first aspect, in one possible implementation manner, the first target broadcast receiver information is a list including registration names of respective target broadcast receivers in the first process.
In the solution provided in the present application, the first target broadcast receiver information may be in a list form, where a registration name of one or more target broadcast receivers in the first process may be included. In this way, a first process in the electronic device can quickly send a first broadcast to one or more target broadcast receivers in the first process according to the registration names in the list.
With reference to the first aspect, in one possible implementation manner, the determining, by the electronic device, the target process by the AMS may specifically include: the electronic device determines a target process based on a binder server address carried when the target broadcast receiver is registered through the AMS. The binder server address may contain process information.
In the scheme provided in the present application, the process information included in the binder server address carried when the broadcast receiver is registered in the AMS may be related information (e.g., a process name, a process file address, etc.) of a process registering the broadcast receiver.
With reference to the first aspect, in one possible implementation manner, the process to which the target broadcast receiver belongs is a process to which an application program registering the target broadcast receiver belongs.
It is understood that the process to which the target broadcast receiver belongs may refer to a process to register the target broadcast receiver, and may also be understood as a process to which a subject initiating registration of the target broadcast receiver belongs. The body may be an application program, or may be a specific component, which is not limited in this application.
With reference to the first aspect, in a possible implementation manner, the method may further include: in case that only one target broadcast receiver exists in the first process, the electronic device may transmit the first broadcast to the one target broadcast receiver in the first process through the AMS.
In the scheme provided in the present application, in case that the first process corresponds to only one target broadcast receiver (i.e., only one target broadcast receiver exists in the first process), the AMS may directly transmit the first broadcast to the one target broadcast receiver in the first process without determining the first target broadcast receiver information and without first transmitting the first broadcast to the first process. The method can simplify the flow and improve the broadcast transmission efficiency.
In some embodiments of the present application, in case that the first process corresponds to only one target broadcast receiver, the AMS may transmit the first broadcast to one target broadcast receiver in the first process based on the native interface.
With reference to the first aspect, in a possible implementation manner, the method may further include: in case that only one target broadcast receiver exists in the first process, the electronic device may transmit the first broadcast and the first target broadcast receiver information to the first process through the AMS, and may also transmit the first broadcast to the target broadcast receiver in the first process based on the first target broadcast receiver information through the first process.
In the scheme provided by the present application, the AMS may not determine whether the target process corresponds to a plurality of target broadcast receivers or to one target broadcast receiver, and may determine target broadcast receiver information corresponding to each target process and transmit the first broadcast and the corresponding target broadcast receiver information to the target process. In this way, the electronic device may directly send the target broadcast receiver information and the first broadcast corresponding to the target process without judging whether the target broadcast receivers in the target process are one or more through the AMS, thereby simplifying the flow to a certain extent and improving the broadcast sending efficiency.
In some embodiments of the present application, in case that the first process corresponds to only one target broadcast receiver, the AMS may transmit the first broadcast and the first target broadcast receiver information to the first process based on the newly added interface.
With reference to the first aspect, in one possible implementation manner, the electronic device sends, to the first process, the first broadcast and the first target broadcast receiver information through the AMS, and may specifically include: the electronic device may transmit the first broadcast and the first target broadcast receiver information to the first process based on the newly added interface through the AMS.
In the scheme provided by the present application, in case that the first process corresponds to a plurality of target broadcast receivers, the AMS may transmit the first broadcast and the first target broadcast receiver information to the first process based on the newly added interface.
In a second aspect, the present application provides an electronic device. The electronic device may include one or more memories, one or more processors. The memory is used for storing a computer program. The processor is configured to invoke a computer program to cause the electronic device to perform: receiving a first broadcast transmitted by a broadcast transmitter through an activity manager service AMS, and determining a target broadcast receiver and a target process based on a first correspondence and the first broadcast through the AMS; in case that a plurality of target broadcast receivers exist in a first process among the target processes, the first broadcast and the first target broadcast receiver information may be transmitted to the first process through the AMS, and the first broadcast may be transmitted to the plurality of target broadcast receivers in the first process based on the first target broadcast receiver information, respectively, through the first process. Wherein the target process is a process to which the target broadcast receiver belongs. The first target broadcast receiver information includes related information of each target broadcast receiver in the first process.
With reference to the second aspect, in one possible implementation manner, the first correspondence is a correspondence between a broadcast receiver registered in the AMS and a broadcast type. The processor is configured to invoke a computer program to cause the electronic device to, when determining, by the AMS, the target broadcast receiver based on the first correspondence and the first broadcast, specifically cause the electronic device to perform: the AMS determines a broadcast receiver of the same type as the first broadcast as a target broadcast receiver based on a correspondence between the broadcast receiver and the broadcast type.
With reference to the second aspect, in one possible implementation manner, the first correspondence is a correspondence between broadcast receivers registered in the AMS and broadcasts. The processor is configured to invoke a computer program to cause the electronic device to, when determining, by the AMS, the target broadcast receiver based on the first correspondence and the first broadcast, specifically cause the electronic device to perform: the AMS determines that the corresponding broadcast receiver, which is the first broadcast, is the target broadcast receiver based on the correspondence between the broadcast receiver and the broadcast.
With reference to the second aspect, in one possible implementation manner, the first target broadcast receiver information is a list including registration names of a plurality of target broadcast receivers in the first process.
With reference to the second aspect, in one possible implementation manner, the processor is configured to invoke a computer program to cause the electronic device to determine, by the AMS, a target process, and specifically cause the electronic device to perform: the target process is determined by the AMS based on the binder server address carried at the time of registration of the target broadcast receiver. The binder server address may contain process information.
With reference to the second aspect, in one possible implementation manner, the process to which the target broadcast receiver belongs is a process to which an application program registering the target broadcast receiver belongs.
With reference to the second aspect, in one possible implementation manner, the processor may be further configured to invoke a computer program to cause the electronic device to perform: in case that only one target broadcast receiver exists in the first process, the first broadcast may be transmitted to the one target broadcast receiver in the first process through the AMS.
With reference to the second aspect, in one possible implementation manner, the processor may be further configured to invoke a computer program to cause the electronic device to perform: the first broadcast and the first target broadcast receiver information may be transmitted to the first process by the AMS, and the first broadcast may also be transmitted to the target broadcast receiver in the first process based on the first target broadcast receiver information by the first process.
With reference to the second aspect, in one possible implementation manner, the processor is configured to invoke a computer program to cause an electronic device to send, through an AMS, a first broadcast and first target broadcast receiver information to a first process, and specifically cause the electronic device to perform: the first broadcast and the first target broadcast receiver information may be transmitted to the first process based on the newly added interface by the AMS.
In a third aspect, the present application provides a computer storage medium. The computer storage medium comprises computer instructions which, when run on an electronic device, cause the electronic device to perform a method as described in the first aspect or any implementation of the first aspect.
In a fourth aspect, embodiments of the present application provide a chip. The chip may be applied to an electronic device, the chip comprising one or more processors for invoking computer instructions to cause the electronic device to perform the method as described in the first aspect or any implementation of the first aspect.
In a fifth aspect, embodiments of the present application provide a computer program product comprising instructions. The computer program product, when run on an electronic device, causes the electronic device to perform the method as described in the first aspect or any implementation of the first aspect.
It will be appreciated that the electronic device provided in the second aspect, the computer storage medium provided in the third aspect, the chip provided in the fourth aspect, and the computer program product provided in the fifth aspect are each for performing the method as described in the first aspect or any implementation of the first aspect. Thus, reference may be made to the advantages of any one of the possible implementation manners of the first aspect, and the description is omitted here.
Drawings
Fig. 1 is a schematic diagram of a broadcast registration and distribution flow provided in an embodiment of the present application;
fig. 2 is a schematic diagram of broadcast distribution provided in an embodiment of the present application;
fig. 3A and 3B are flowcharts of a set of broadcast distribution methods provided in an embodiment of the present application;
fig. 4 is a schematic diagram of a convergence target broadcast receiver according to an embodiment of the present application;
fig. 5 is a schematic diagram of still another broadcast distribution provided in an embodiment of the present application;
fig. 6 is a schematic diagram of still another broadcast distribution provided in an embodiment of the present application;
fig. 7 is a schematic diagram of still another broadcast distribution provided in an embodiment of the present application;
fig. 8 is a schematic diagram of still another broadcast distribution provided in an embodiment of the present application;
fig. 9 is a flowchart of yet another broadcast distribution method according to an embodiment of the present application;
Fig. 10 is a flowchart of yet another broadcast distribution method according to an embodiment of the present application;
fig. 11 is a schematic hardware structure of an electronic device according to an embodiment of the present application;
fig. 12 is a schematic software structure of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Wherein, in the description of the embodiments of the present application, "/" means or is meant unless otherwise indicated, for example, a/B may represent a or B; the text "and/or" is merely an association relation describing the associated object, and indicates that three relations may exist, for example, a and/or B may indicate: the three cases where a exists alone, a and B exist together, and B exists alone, and in addition, in the description of the embodiments of the present application, "plural" means two or more than two.
It should be understood that the terms first, second, and the like in the description and in the claims and drawings of the present application are used for distinguishing between different objects and not necessarily for describing a particular sequential or chronological order. Furthermore, the terms "comprise" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those listed steps or elements but may include other steps or elements not listed or inherent to such process, method, article, or apparatus.
Reference in the specification to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly understand that the embodiments described herein may be combined with other embodiments.
First, some of the terms and related techniques referred to in the present application are explained for easy understanding by those skilled in the art.
1. Broadcasting
According to the above, the broadcasting mechanism involves a broadcast sender, a broadcast receiver, and an AMS.
The broadcast registration and distribution flow is described below based on fig. 1.
As shown in fig. 1, a receiver (i.e., a broadcast receiver) may register in the AMS (i.e., broadcast registration). The sender may send a broadcast to the AMS. The AMS may find a corresponding receiver of a broadcast (i.e., broadcast receiver) based on the related information of the registered broadcast receiver (BroadcastReceiver) and transmit the broadcast to a corresponding message queue (i.e., broadcast enqueue) to be processed by the AMS. And the AMS sequentially transmits the broadcast to its corresponding receivers (i.e., broadcast receivers) when processing, i.e., broadcast distribution is achieved. It is understood that, as shown in fig. 1, there may be a plurality of broadcast receivers belonging to the same process among broadcast receivers corresponding to the same broadcast, and the AMS may distribute the same broadcast to each broadcast receiver in turn, each of which is an inter-process communication (e.g., a binder communication). In general, the registration of the receiver in the AMS, the transmission of the broadcast by the sender to the AMS, and the transmission of the broadcast by the AMS to the receiver are all implemented based on the binder mechanism.
It should be noted that the broadcast receivers corresponding to the same broadcast may be in the same process or in different processes. Also, the same broadcast may correspond to a plurality of broadcast receivers. This means that in case of a plurality of broadcast receivers corresponding to the same broadcast, one or more of the broadcast receivers corresponding to the same broadcast may be in the same process. The AMS may send the broadcast to each of its corresponding broadcast receivers in turn based on the binder mechanism. For multiple broadcast receivers in the same process, the AMS may also sequentially transmit broadcasts to them based on a binder mechanism.
For example, as shown in fig. 2, after the system-side AMS receives the broadcast G1 transmitted by the broadcast transmitter based on the binder mechanism, it may be determined that the broadcast receivers corresponding to the broadcast G1 include receiver1, receiver2, receiver3, receiver4, receiver5, receiver6, receiver7, and receiver8. The receiver1, the receiver2, the receiver3 and the receiver4 are broadcast receivers registered by the application program a, and the process corresponding to the application program a is the process a_1.receiver5, receiver6, receiver7, and receiver8 are broadcast receivers registered by application B, and the process corresponding to application B is process b_1. Based on the binder mechanism, the AMS may send the broadcast G1 to the receivers 1, 2, 3, 4, 5, 6, 7, and 8, respectively, through a broadcast distributor. Also, the AMS transmits the broadcast G1 every time based on a binder mechanism, i.e., the AMS transmits the broadcast G1 every time in a process of one binder communication. That is, 8 times of binder communication are performed in total in the process of transmitting the broadcast G1 by the AMS, which severely occupies system resources such as CPU and memory.
2. Binder mechanism
The binder mechanism is an inter-process communication (Interprocess Communication, IPC) mechanism. The binder mechanism includes some system components. These components are Client, server, service Manager (SM), and binder driver (i.e., binder driver), respectively.
Client refers to a Client process, and the party that initiates a process request may be referred to as the Client process. Server refers to a Server process, and processes that are requested to execute a certain service may be referred to as Server processes. The SM is used for managing the server process. Each server process registers the owned spanned binder in the SM and stores the reference of the corresponding binder. The Client can query the SM for the desired service and the SM can then return a reference to a binder accordingly. The binder driver is a kernel module responsible for communication between individual processes.
The binder mechanism may include three processes: registration of services, acquisition of services, and use of services. Registration service: the Server first registers a Service (Service) with the SM. Acquisition service: before Client uses a certain Service, it is necessary to acquire corresponding Service information from SM. Use of the service: the Client establishes a path with a Server providing Service according to the obtained Service information, and then can interact with the Server.
In one possible implementation, the application may change the broadcast registration manner. An application may register a virtual broadcast receiver with the operating system for a broadcast type (i.e., register a virtual broadcast receiver with the AMS). The virtual broadcast receiver can receive the broadcast but cannot actually process the corresponding service. In case that the broadcast received by the AMS corresponds to a plurality of broadcast receivers registered by the same application, the AMS may transmit the broadcast to a virtual broadcast receiver corresponding to the broadcast type in the application based on a binder mechanism. After the virtual broadcast receiver receives the broadcast, the broadcast may be transmitted to a broadcast receiver corresponding to the broadcast in the application program, and then processed by the broadcast receiver. In this implementation, the application program does not register the broadcast receiver of the actual processing service, but registers the virtual broadcast receiver, and the virtual broadcast receiver transmits the received broadcast to the actual broadcast receiver based on the correspondence between the broadcast type and the broadcast receiver of the actual processing service. It will be appreciated that this approach reduces the number of binder communications by changing the manner of registration on the application side, but the application needs to register multiple virtual broadcast receivers to receive multiple types of broadcasts and no longer has to register the broadcast receiver that actually handles the broadcast with the operating system. Notably, this approach requires the application to change the way the broadcast receiver is registered with the operating system, an improvement on the application side. This means that the number of binder communications can be reduced in various scenarios in the case where various applications change the way in which the broadcast receiver is registered with the operation.
The embodiment of the application provides a broadcast distribution method and related equipment. According to the broadcast distribution method, the AMS may receive a broadcast transmitted by a broadcast transmitter, aggregate target broadcast receivers for the same target process, and transmit the received broadcast to a target process corresponding to a plurality of target broadcast receivers. The target process corresponding to the plurality of target broadcast receivers then transmits the broadcast to each of its corresponding target broadcast receivers based on its corresponding target broadcast receiver information. By the method, for the target process corresponding to the target broadcast receivers, the AMS does not need to send the broadcast received by the AMS to the target broadcast receivers on the basis of the binder mechanism, but only sends the broadcast to the target process on the basis of one binder communication, so that the number of times of binder communication is reduced, the occupation of system resources such as CPU (Central processing Unit), memory and the like is reduced, and resource consumption and waste are avoided.
The following describes a broadcast distribution method provided in the embodiments of the present application.
A broadcast sender in the electronic device may send a broadcast to an AMS in the electronic device. Accordingly, the AMS may receive a broadcast transmitted by the broadcast transmitter. After the AMS receives the broadcast, the target broadcast receiver and the target process may be determined. The target broadcast receiver corresponds to the received broadcast as the broadcast transmitted by the broadcast transmitter. The target process refers to a process to which the target broadcast receiver belongs. The AMS may determine a target process corresponding to a plurality of target broadcast receivers and obtain target broadcast receiver information corresponding to the target process corresponding to the plurality of target broadcast receivers. For a target process corresponding to a plurality of target broadcast receivers, the AMS may transmit a broadcast, in which a broadcast transmitter transmits to the AMS, and target broadcast receiver information corresponding to the target process corresponding to the plurality of target broadcast receivers transmits to the target process corresponding to the plurality of target broadcast receivers. After the target process corresponding to the plurality of target broadcast receivers receives the broadcast and its corresponding target broadcast receiver information, its corresponding target broadcast receiver may be determined based on its corresponding target broadcast receiver information and the broadcast may be transmitted to each of its corresponding target broadcast receivers. And for a target process corresponding to one target broadcast receiver, the AMS may transmit a broadcast transmitted from the broadcast transmitter to the AMS to the target broadcast receiver in the target process corresponding to one target broadcast receiver. It is understood that the target broadcast receiver information is used to designate the target broadcast receiver in the target process.
Specifically, referring to fig. 3A, fig. 3A is a flowchart of a broadcast distribution method according to an embodiment of the present application. The broadcast distribution method may include, but is not limited to, the steps of:
s301: the AMS receives the broadcast_1 transmitted by the broadcast transmitter.
A broadcast sender in the electronic device may send broadcast_1 to an AMS in the electronic device. Accordingly, the AMS may receive the broadcast_1 transmitted to the AMS by the broadcast transmitter.
It will be appreciated that the broadcast sender may be an operating system in the electronic device, or may be an application, component, etc. in the electronic device, as this application is not limited in this regard.
S302: the AMS determines a target broadcast receiver and a target process based on the broadcast_1 and the first correspondence. The target broadcast receiver is a broadcast receiver for receiving broadcast_1. The target process is a process to which the target broadcast receiver belongs. The correspondence between the target process and the target broadcast receiver is a one-to-one correspondence or a one-to-many correspondence.
After the AMS receives the broadcast_1 transmitted by the broadcast transmitter, it may determine a target broadcast receiver corresponding to the broadcast_1, i.e., a broadcast receiver for receiving the broadcast_1, based on the first correspondence relationship, and determine a corresponding target process.
In some embodiments of the present application, the first correspondence may specifically include: correspondence between broadcast receiver and broadcast type. In this case, the AMS may acquire a correspondence between a broadcast receiver registered in the AMS and a broadcast type, and find a broadcast receiver of the same type as broadcast_1 as the corresponding broadcast type, that is, a target broadcast receiver, based on the correspondence. That is, the type of broadcast that the target broadcast receiver corresponds to receives is the same as the type of broadcast_1. It will be appreciated that the correspondence between broadcast receivers and broadcast types may be used to indicate the type of broadcast that the broadcast receiver corresponds to receiving. I.e. the correspondence may be used to indicate which type of broadcast the broadcast receiver may receive.
It will be appreciated that the broadcast types corresponding to the different broadcast receivers may be the same or different. In some embodiments of the present application, one broadcast receiver may correspond to one or more broadcast types.
Illustratively, as shown in table 1, the broadcast type corresponding to the broadcast receiver1 is L1, i.e., the type of broadcast received by the broadcast receiver1 is L1, the broadcast type corresponding to the broadcast receiver2 is L2, i.e., the type of broadcast received by the broadcast receiver2 is L2, the broadcast type corresponding to the broadcast receiver3 is L1, namely, the type of the broadcast corresponding to the receiver3 is L1, the type of the broadcast corresponding to the broadcast receiver4 is L3, namely, the type of the broadcast corresponding to the receiver4 is L3, the type of the broadcast corresponding to the broadcast receiver5 is L2, namely, the type of the broadcast corresponding to the receiver5 is L2. In this case, if the AMS determines that the type of the broadcast_1 is L1, the AMS may search for a corresponding broadcast receiver of the broadcast type L1, such as receiver1 and receiver3 shown in table 1, and the AMS may determine that the target broadcast receiver includes receiver1 and receiver3.
TABLE 1
Figure SMS_1
In one possible implementation, the AMS may have a correspondence between the broadcast receiver and the broadcast type stored therein. Specifically, in the course of registration of the broadcast receiver in the AMS, the AMS may record the type of broadcast received by the registered broadcast receiver.
In one possible implementation, the correspondence between the broadcast receiver and the broadcast type may also be saved in other modules. In this case, the AMS may acquire the correspondence based on the storage address of the correspondence.
In some embodiments of the present application, the first correspondence may specifically include: correspondence between broadcast receiver and broadcast. Specifically, the correspondence between the broadcast receiver and the broadcast may refer to: correspondence between a broadcast receiver and a particular broadcast or broadcasts. In this case, the AMS may acquire a correspondence between a broadcast receiver registered in the AMS and a broadcast, and find a corresponding broadcast receiver, that is, a target broadcast receiver, of broadcast_1 based on the correspondence. That is, the specific broadcast corresponding to the target broadcast receiver is broadcast_1.
It will be appreciated that the broadcasts corresponding to the different broadcast receivers may be the same or different. In some embodiments of the present application, one broadcast receiver may correspond to one or more specific broadcasts.
For example, as shown in table 2, the broadcast corresponding to the broadcast receiver1 is broadcast_1, the broadcast corresponding to the broadcast receiver2 is broadcast_2, the broadcast corresponding to the broadcast receiver3 is broadcast_1, the broadcast corresponding to the broadcast receiver4 is broadcast_3 and broadcast_4, and the broadcast corresponding to the broadcast receiver5 is broadcast_2 and broadcast_3. In this case, the AMS may find a broadcast receiver corresponding to the broadcast_1, such as receiver1 and receiver3 shown in table 2, and the AMS may determine that the target broadcast receiver includes receiver1 and receiver3.
TABLE 2
Figure SMS_2
Similarly, in one possible implementation, the AMS may have a correspondence between broadcast receivers and broadcasts stored therein. Specifically, in the process of the broadcast receiver registering in the AMS, the AMS may record a broadcast corresponding to the registered broadcast receiver. In yet another possible implementation, the correspondence between the broadcast receiver and the broadcast may also be maintained in other modules. In this case, the AMS may acquire the correspondence based on the storage address of the correspondence.
In some embodiments of the present application, the AMS may acquire a correspondence between the broadcast receiver and a process to which the target broadcast receiver belongs, and search for the process to which the target broadcast receiver belongs based on the correspondence, thereby determining the target process.
It is understood that the process to which the broadcast receiver belongs refers to a process of registering the broadcast receiver, i.e., a process of initiating registration of the broadcast receiver. It will be appreciated that the processes to which different broadcast receivers belong may be the same or different. One broadcast receiver may correspond to one process, i.e., one broadcast receiver belongs to one process.
For example, as shown in table 3, the process corresponding to the broadcast receiver1 is process_1, i.e., the process to which the receiver1 belongs is process_1, the process corresponding to the broadcast receiver2 is process_1, i.e., the process to which the receiver2 belongs is process_1, the process corresponding to the broadcast receiver3 is process_2, namely, the process to which the receiver3 belongs is the process_2, the process corresponding to the broadcast receiver4 is the process_3, namely, the process to which the receiver4 belongs is the process_3, the process corresponding to the broadcast receiver5 is the process_2, namely, the process to which the receiver5 belongs is the process_2. In this case, if the target broadcast receiver includes the receivers receiver1 and receiver3, the AMS may search for the processes corresponding to the receivers receiver1 and receiver 3. As shown in table 3, if the process corresponding to receiver1 is process_1 and the process corresponding to receiver3 is process_2, the AMS may determine that the target process includes process_1 and process_2.
TABLE 3 Table 3
Figure SMS_3
In some embodiments of the present application, the process of initiating the registration of the broadcast receiver may also be understood as a process where the subject initiating the registration of the broadcast receiver is located. In one possible implementation, the process to which the broadcast receiver belongs is a process (i.e., an application process) corresponding to an application program that registers the broadcast receiver.
For example, as shown in table 4, the application corresponding to the broadcast receiver1 is application_1, that is, the application corresponding to the broadcast receiver2 is application_1 when the application_1 initiates registration, that is, the application corresponding to the broadcast receiver2 is application_1 when the application corresponding to the broadcast receiver3 is application_2 when the application corresponding to the broadcast receiver2 initiates registration, that is, the receiver3 initiates registration by the application_2, the application program corresponding to the broadcast receiver4 is the application_3, that is, the receiver4 initiates registration by the application_3, and the application program corresponding to the broadcast receiver5 is the application_2, that is, the receiver5 initiates registration by the application_2. And the process corresponding to the application_1 is the process_1, the process corresponding to the application_2 is the process_2, and the process corresponding to the application_3 is the process_3. In this case, if the target broadcast receiver includes the receivers receiver1 and receiver3, the AMS may search for the processes corresponding to the receivers receiver1 and receiver 3. It can be understood that the processes corresponding to the receiver1 and the receiver3 are the processes corresponding to the application programs registering the receiver1 and the receiver 3. As shown in table 4, the application corresponding to the receiver1 is the application_1, the process corresponding to the application_1 is the process_1, the application corresponding to the receiver3 is the application_2, and the process corresponding to the application_2 is the process_2, and the AMS may determine that the target process includes the process_1 and the process_2.
TABLE 4 Table 4
Figure SMS_4
It is understood that the broadcast receiver may initiate registration by an application, a specific component within the application, etc., and register with the AMS. It is understood that the body that initiates the registration of the broadcast receiver may be another module, and in particular, reference may be made to a related art document, which is not limited in this application.
In one possible implementation, the AMS may have a correspondence between the broadcast receiver and the process to which it belongs stored therein. Specifically, the AMS may record a procedure of initiating registration of the broadcast receiver in the course of registration of the broadcast receiver in the AMS. The process of initiating the registration of the broadcast receiver is the process to which the registered broadcast receiver belongs.
In one possible implementation, the correspondence between the broadcast receiver and the belonging process may also be saved in other modules. In this case, the AMS may acquire the correspondence based on the storage address of the correspondence.
In some embodiments of the present application, the AMS may determine a correspondence between the broadcast receiver and the belonging process based on a binder server address carried when the broadcast receiver is registered in the AMS. It can be understood that the binder server address carried when the broadcast receiver registers in the AMS contains process information. The process information may be used to represent a process to which the broadcast receiver belongs.
S303: the AMS gathers the target broadcast receivers belonging to the same target process, determines a first type target process and a second type target process, and obtains target broadcast receiver information corresponding to the first type target process. The first type of target process is a target process corresponding to a plurality of target broadcast receivers. The second type of target process is a target process corresponding to only one target broadcast receiver.
After the AMS determines the target broadcast receiver and the target process, it may aggregate for the target broadcast receivers belonging to the same target process, i.e., determine the target broadcast receiver in each target process. That is, the AMS may determine which processes to which the target broadcast receiver belongs are the same target process. Further, the AMS may determine a target process (i.e., a first type of target process) corresponding to a plurality of target broadcast receivers and a target process (i.e., a second type of target process) corresponding to only one target broadcast receiver. The AMS may also determine target broadcast receiver information corresponding to a target process having a plurality of target broadcast receivers, i.e., target broadcast receiver information corresponding to a first type of target process. It can be understood that the target broadcast receiver information is related information of the target broadcast receiver in the target process. The target broadcast receiver information may be used to designate the target broadcast receiver. That is, the target broadcast receiver information corresponding to the target process may be used to represent the target broadcast receiver in the target process.
For example, as shown in fig. 4, the AMS may determine receiver1, receiver2, receiver3, receiver4, receiver 5, and receiver 6 as target broadcast receivers based on broadcast_1 transmitted by the broadcast transmitter. The process to which receiver1 belongs is process_1, the process to which receiver2 belongs is process_2, the process to which receiver3 belongs is process_1, the process to which receiver4 belongs is process_3, the process to which receiver 5 belongs is process_3, and the process to which receiver 6 belongs is process_3. This means that the target process includes process_1, process_2, and process_3. The AMS may aggregate target broadcast receivers of the same target process, thereby determining that the target broadcast receivers corresponding to the process_1 are receiver1 and receiver3, the target broadcast receiver corresponding to the process_2 is receiver2, and the target broadcast receivers corresponding to the process_3 are receiver4, receiver 5, and receiver 6. Since the process_1 and the process_3 each correspond to a plurality of target broadcast receivers, and the process_2 corresponds to only one target broadcast receiver, the AMS may determine that the process_1 and the process_3 are the first type target processes and the process_2 is the second type target process. Further, the AMS may determine target broadcast receiver information corresponding to the process_1 and target broadcast receiver information corresponding to the process_3.
It is understood that the target broadcast receiver information may be an identification of the target broadcast receiver, and may also be a registration name of the target broadcast receiver, which is not limited in this application. It is understood that the target broadcast receiver information may be embodied as a list, a collection, or the like, and the present application is not limited to a specific form thereof.
Illustratively, the target process includes process_1, process_2, and process_3. The target broadcast receivers corresponding to the process_1 are receiver1 and receiver3, the target broadcast receiver corresponding to the process_2 is receiver2, and the target broadcast receivers corresponding to the process_3 are receiver4, receiver5 and receiver6. That is, the processes to which the target broadcast receivers receiver1 and receiver3 belong are the process_1, the process to which the target broadcast receiver2 belongs is the process_2, and the processes to which the target broadcast receivers receiver4, receiver5, and receiver6 belong are the process_3. The target broadcast receiver information corresponding to the process_1 and the process_3 is the target broadcast receiver information_1 and the target broadcast receiver information_3, respectively. It can be understood that the target broadcast receiver information_1 includes related information of the receivers 1 and 3, and the target broadcast receiver information_3 includes related information of the receivers 4, 5, and 6.
In one possible implementation, as shown in fig. 4 and table 5, the target broadcast receiver information_1 is a target broadcast receiver list corresponding to the process_1, and the target broadcast receiver list includes registration names of target broadcast receivers in the process_1, namely, receivers 1 and 3. Similarly, the target broadcast receiver information_3 is a target broadcast receiver list corresponding to the process_3, and the target broadcast receiver list includes the registration names of the target broadcast receivers in the process_3, namely, the receiver4, the receiver 5 and the receiver6.
TABLE 5
Figure SMS_5
It will be appreciated that the target broadcast receiver list may also include an identification of the target broadcast receivers in their corresponding target processes, which identification may be in the form of a number, a string, etc., as the application is not limited in this regard.
In still another possible implementation manner, as shown in table 6, the target broadcast receiver information_1 is a target broadcast receiver set corresponding to the process_1, where the target broadcast receiver set includes registration names of target broadcast receivers in the process_1, that is, receivers 1 and 3. Similarly, the target broadcast receiver information_3 is a target broadcast receiver set corresponding to the process_3, and the target broadcast receiver set includes the registration names of the target broadcast receivers in the process_3, namely, the receiver4, the receiver 5 and the receiver6.
TABLE 6
Figure SMS_6
It will be appreciated that the set of target broadcast receivers may also include an identification of the target broadcast receiver in its corresponding target process, which identification may be embodied in the form of a number, a string, etc., as this application is not limited in this regard.
S304: for each first type of target process, the AMS transmits thereto broadcast_1 and its corresponding target broadcast receiver information.
The AMS may transmit broadcast_1 and its corresponding target broadcast receiver information to each first type target process. It may be appreciated that, in the case that there are a plurality of first type target processes, the present application does not limit the order in which the AMS transmits the corresponding information (broadcast_1 and the target broadcast receiver information corresponding to the first type target process) to the plurality of first type target processes.
Illustratively, receiver 1, receiver 3, receiver4, receiver 5, and receiver 6 are targeted broadcast receivers. The processes to which receiver 1 and receiver 3 belong are process_1, and the processes to which receiver4, receiver 5, and receiver 6 belong are process_3. Then process _1 and process _3 are target processes of the first type. The AMS may transmit the broadcast_1 to the process_1, and target broadcast receiver information (i.e., target broadcast receiver information_1) corresponding to the process_1. Similarly, the AMS may transmit the broadcast_1 to the process_3, and target broadcast receiver information (i.e., target broadcast receiver information_3) corresponding to the process_3. It is understood that the present application does not limit the order in which the AMS transmits the corresponding information to the process_1 and the process_3.
It is understood that the AMS may transmit broadcast_1 and its corresponding target broadcast receiver information to each first type target process based on the newly added interface. It is understood that the newly added interface is an interface for transmitting broadcast and target broadcast receiver information. In some embodiments of the present application, the newly added interface may be a custom interface, which is not limited in specific form in the present application. In some embodiments of the present application, the newly added interface may be a batchschedule register receiver.
In some embodiments of the present application, the AMS may transmit the broadcast_1 and target broadcast receiver information corresponding to the first type target process through a broadcast distributor. A broadcast distributor in the AMS may be used to distribute broadcasts to target processes. The distribution process is a cross-process communication. The broadcast distributor may be a software module.
For example, as shown in fig. 5, the AMS may transmit the broadcast_1 and the target broadcast receiver information_1 to the process_1 through a broadcast distributor, and transmit the broadcast_1 and the target broadcast receiver information_3 to the process_3 through the broadcast distributor. It is appreciated that the above-described transmissions are all implemented based on a binder mechanism.
Accordingly, the first type target process may receive the broadcast_1 transmitted by the AMS and target broadcast receiver information corresponding to the first type target process.
S305: the first type target process determines target broadcast receivers in the first type target process based on the corresponding target broadcast receiver information, and sends the broadcast_1 to each target broadcast receiver in the first type target process.
After the first type target process receives the broadcast_1 transmitted by the AMS and the target broadcast receiver information corresponding to the first type target process, the target broadcast receiver in the first type target process may be determined based on the target broadcast receiver information corresponding to the first type target process, and the broadcast_1 may be transmitted to each target broadcast receiver in the first type target process.
It can be appreciated that the present application does not limit the order in which the first type of target process transmits broadcast_1 to the target broadcast receiver therein. In some embodiments of the present application, the specific form of the target broadcast receiver information is a list. In this case, the first type target process may transmit the broadcast_1 to the corresponding target broadcast receiver in the order of the target broadcast receivers shown in the list. Of course, the first type target process may send the broadcast_1 to the corresponding target broadcast receiver not according to the sequence of the target broadcast receivers shown in the list, so long as the list can be traversed finally.
For example, after the process_1 receives the broadcast_1 and the target broadcast receiver information_1 transmitted by the AMS, the registration names of the broadcast receivers included in the target broadcast receiver information_1, that is, the receiver1 and the receiver 3, may be determined, thereby determining that the target broadcast receivers in the process_1 are the receiver1 and the receiver 3. Process_1 may send broadcast_1 to receiver1 and receiver 3, respectively. Similarly, after the process_3 receives the broadcast_1 and the target broadcast receiver information_3 transmitted by the AMS, the registration names of the broadcast receivers included in the target broadcast receiver information_3, that is, the receivers 4, 5 and 6, may be determined, so that the target broadcast receivers in the process_3 are determined to be the receivers 4, 5 and 6. Process_3 may send broadcast_1 to receiver4, receiver 5, and receiver6, respectively.
It can be appreciated that the present application does not limit the order in which the process_1 sends the broadcast_1 to the receiver1 and the receiver 3, and does not limit the order in which the process_3 sends the broadcast_1 to the receiver4, the receiver 5, and the receiver6. In some embodiments of the present application, the specific form of the target broadcast receiver information_1 is a list. In this case, process_1 may send broadcast_1 to receiver1 and receiver 3 in list order. As shown in table 5, the list order of the target broadcast receiver information_1 is from top to bottom as receiver1 and receiver 3. That is, process_1 may first send broadcast_1 to receiver1 and then broadcast_1 to receiver 3. Similarly, the specific form of the target broadcast receiver information_3 may be a list, which is not limited in this application.
In some embodiments of the present application, the first type target process may transmit broadcast_1 to each target broadcast receiver in the first type target process through a broadcast distributor. It will be appreciated that a broadcast distributor in a first class of targeted processes may be used to distribute broadcasts to targeted broadcast receivers in the processes. The distribution process is performed within the same process, not cross-process communication. The broadcast distributor may be a software module.
For example, as shown in fig. 6, after the AMS aggregates the target broadcast receivers (i.e., receiver1, receiver2, receiver3, receiver4, receiver5, and receiver 6) for the same target process, it is determined that each of the process_1 and the process_3 corresponds to a plurality of target broadcast receivers, and the process_2 corresponds to only one target broadcast receiver. The AMS may obtain the target broadcast receiver information_1 and the target broadcast receiver information_3. The target broadcast receiver information_1 is target broadcast receiver information corresponding to the process_1. The target broadcast receiver information_3 is target broadcast receiver information corresponding to the process_3. The AMS may transmit the broadcast_1 and the target broadcast receiver information_1 to the process_1 based on the binder mechanism, the broadcast distributor in the process_1 may receive the broadcast_1 and the target broadcast receiver information_1, determine that the target broadcast receivers in the process_1 are receiver1 and receiver3 based on the target broadcast receiver information_1, and transmit the broadcast_1 to the receiver1 and the receiver3, respectively. Similarly, the AMS may transmit the broadcast_1 and the target broadcast receiver information_3 to the process_3 based on the binder mechanism, the broadcast distributor in the process_3 may receive the broadcast_1 and the target broadcast receiver information_3, determine that the target broadcast receivers in the process_3 are the receivers 4, 5, and 6 based on the target broadcast receiver information_3, and transmit the broadcast_1 to the receivers 4, 5, and 6, respectively. In addition, the AMS may also transmit broadcast_1 to receiver2 based on a binder mechanism.
Accordingly, each target broadcast receiver in the first type target process may receive the broadcast_1 sent by the first type target process.
S306: the AMS transmits broadcast_1 to a target broadcast receiver in each second type target process.
The AMS may directly transmit the broadcast_1 to the target broadcast receiver in each of the second-type target processes, without first transmitting the broadcast_1 to the second-type target processes, but directly to the corresponding target broadcast receiver.
It is understood that the AMS may transmit broadcast_1 to a target broadcast receiver in each second type of target process based on a native interface. In some embodiments of the present application, the native interface may be a scheduleRegisteredreceiver.
In some embodiments of the present application, the AMS may transmit the broadcast_1 to the second type target process through the broadcast distributor.
For example, as shown in fig. 5, the AMS may transmit broadcast_1 to receiver2 through a broadcast distributor. It is understood that the transmission is implemented based on a binder mechanism.
In some embodiments of the present application, the AMS may transmit the broadcast_1 and target broadcast receiver information corresponding to the first type target process through a broadcast distributor, and transmit the broadcast_1 to the second type target process through the broadcast distributor, and the first type target process may also transmit the broadcast_1 to each target broadcast receiver of the first type target process through the broadcast distributor.
For example, as shown in fig. 7, the AMS may transmit the broadcast_1 and the target broadcast receiver information_1 to the process_1 through a broadcast distributor, transmit the broadcast_1 to the second type of target process through the broadcast distributor, and transmit the broadcast_1 and the target broadcast receiver information_3 to the process_3 through the broadcast distributor. It is appreciated that the above-described transmissions are all implemented based on a binder mechanism. The broadcast distributor in process_1 may send broadcast_1 to receiver1 and receiver3, respectively. The broadcast distributor in process_3 may send broadcast_1 to receiver4, receiver5, and receiver6, respectively.
For example, as shown in fig. 8, after the AMS receives the broadcast G1 transmitted by the broadcast transmitter based on the binder mechanism, it may be determined that the broadcast receivers corresponding to the broadcast G1 include receiver1, receiver2, receiver3, receiver4, receiver5, receiver6, receiver7, and receiver8. That is, the target broadcast receiver includes receiver1, receiver2, receiver3, receiver4, receiver5, receiver6, receiver7, and receiver8. The receiver1, the receiver2, the receiver3 and the receiver4 are broadcast receivers registered by the application program a, and the process corresponding to the application program a is the process a_1.receiver5, receiver6, receiver7, and receiver8 are broadcast receivers registered by application B, and the process corresponding to application B is process b_1. The AMS may aggregate target broadcast receivers for the same target process, thereby obtaining target broadcast receiver information corresponding to the process a_1 and target broadcast receiver information corresponding to the process b_1. It can be understood that the target broadcast receiver information corresponding to the process a_1 includes relevant information of the receiver1, the receiver2, the receiver3 and the receiver4, and the target broadcast receiver information corresponding to the process b_1 includes relevant information of the receiver5, the receiver6, the receiver7 and the receiver8. Based on the binder mechanism, the AMS may transmit target broadcast receiver information corresponding to the broadcast G1 and the process a_1 to the process a_1 through the broadcast distributor, and transmit target broadcast receiver information corresponding to the broadcast G1 and the process b_1 to the process b_1 through the broadcast distributor. The broadcast distributor in the process a_1 may determine that the target broadcast receiver in the process a_1 includes receiver1, receiver2, receiver3, and receiver4 based on the target broadcast receiver information corresponding to the process a_1, and transmit the broadcast G1 to the receiver1, receiver2, receiver3, and receiver4, respectively. Similarly, the broadcast distributor in process b_1 may determine that the target broadcast receiver in process b_1 includes receiver5, receiver6, receiver7, and receiver8 based on the target broadcast receiver information corresponding to process b_1, and send broadcast G1 to receiver5, receiver6, receiver7, and receiver8, respectively.
Accordingly, the target broadcast receiver in the second type target process may receive the broadcast_1 transmitted by the AMS.
It is understood that in some embodiments of the present application, the target processes include only the first type of target process. In this case, the electronic apparatus does not need to perform step S306. In some embodiments of the present application, the target processes include only the second type of target process. In this case, the electronic apparatus does not need to perform step S304 and step S305.
In some embodiments of the present application, the target processes include a first type of target process and a second type of target process. In this case, the present application does not limit the order in which the electronic device performs step S304 and step S306.
It may be understood that, in the case that the target process includes one or more first type target processes and one or more second type target processes, the AMS may send corresponding information (i.e., broadcast_1 and corresponding target broadcast receiver information) to the one or more first type target processes, then send broadcast_1 to the target broadcast receivers in the one or more second type target processes, or may send corresponding information to the one or more first type target processes after sending broadcast_1 to the target broadcast receivers in the one or more second type target processes, and the order in which the AMS sends broadcast_1 and corresponding target broadcast receiver information to the first type target processes and the AMS sends broadcast_1 to the target broadcast receivers in the second type target processes is not limited in this application. This means that the order in which the electronic apparatus performs step S304 and step S305 is not limited.
Illustratively, the target process includes process_1, process_2, and process_3. The target broadcast receivers corresponding to the process_1 are receiver1 and receiver3, the target broadcast receiver corresponding to the process_2 is receiver2, and the target broadcast receivers corresponding to the process_3 are receiver4, receiver5 and receiver6. That is, the processes to which the target broadcast receivers receiver1 and receiver3 belong are the process_1, the process to which the target broadcast receiver2 belongs is the process_2, and the processes to which the target broadcast receivers receiver4, receiver5, and receiver6 belong are the process_3. The target broadcast receiver information corresponding to the process_1 and the process_3 is the target broadcast receiver information_1 and the target broadcast receiver information_3, respectively. In one possible implementation, the AMS may transmit the target broadcast receiver information_1 and broadcast_1 to the process_1, transmit the broadcast_1 to the receiver2, and transmit the target broadcast receiver information_3 and broadcast_1 to the process_3. In yet another possible implementation, the AMS may transmit the target broadcast receiver information_1 and broadcast_1 to the process_1, then transmit the target broadcast receiver information_3 and broadcast_1 to the process_3, and then transmit the broadcast_1 to the receiver 2. In yet another possible implementation, the AMS may transmit broadcast_1 to receiver2, then transmit target broadcast receiver information_1 and broadcast_1 to process_1, and then transmit target broadcast receiver information_3 and broadcast_1 to process_3. In yet another possible implementation, the AMS may transmit broadcast_1 to receiver2, then transmit target broadcast receiver information_3 and broadcast_1 to process_3, and then transmit target broadcast receiver information_1 and broadcast_1 to process_1. In yet another possible implementation, the AMS may transmit the target broadcast receiver information_3 and broadcast_1 to the process_3, then transmit the target broadcast receiver information_1 and broadcast_1 to the process_1, and then transmit the broadcast_1 to the receiver 2. In yet another possible implementation, the AMS may transmit the target broadcast receiver information_3 and broadcast_1 to the process_3, transmit the broadcast_1 to the receiver2, and transmit the target broadcast receiver information_1 and broadcast_1 to the process_1.
In some embodiments of the present application, as shown in fig. 3B, after the electronic device performs step S301 and step S302, step S307 to step S311 may also be performed. Step S307 to step S311 are as follows:
s307: the AMS aggregates target broadcast receivers belonging to the same target process and determines whether each target process corresponds to a plurality of target broadcast receivers or corresponds to one target broadcast receiver.
S308: the AMS determines target broadcast receiver information corresponding to the target process.
S309: the AMS transmits broadcast_1 and its corresponding target broadcast receiver information to the target process.
S310: the target process determines target broadcast receivers in the target process based on the corresponding target broadcast receiver information thereof, and transmits the broadcast_1 to each target broadcast receiver in the target process.
S311: the AMS transmits broadcast_1 to a target broadcast receiver in a target process.
It is understood that the electronic device may perform step S308-step S310 in the case where the target process corresponds to a plurality of target receivers, and may perform step S311 in the case where the target process corresponds to one target broadcast receiver.
According to steps S307 to S311, the AMS may further aggregate target broadcast receivers belonging to the same target process after performing steps S301 and S302, and determine whether each target process corresponds to a plurality of target broadcast receivers or one target broadcast receiver. In case that the target process corresponds to a plurality of target broadcast receivers, the AMS may determine target broadcast receiver information corresponding to the target process and transmit broadcast_1 and its corresponding target broadcast receiver information to the target process. After the target process receives the broadcast_1 and its corresponding target broadcast receiver information, the target broadcast receiver in the target process may be determined based on its corresponding target broadcast receiver information, and broadcast_1 may be transmitted to each of the target broadcast receivers in the target process. And in case that the target process corresponds to one target broadcast receiver, the AMS may transmit broadcast_1 to the target broadcast receiver in the target process.
It is to be understood that the description related to fig. 3B may be described above with respect to fig. 3A, and will not be repeated here.
A further broadcast distribution method provided by the embodiments of the present application is described below.
A broadcast sender in the electronic device may send a broadcast to an AMS in the electronic device. Accordingly, the AMS may receive a broadcast transmitted by the broadcast transmitter. After the AMS receives the broadcast, the target broadcast receiver may be determined. The type of broadcast is the same as the type of broadcast that the target broadcast receiver correspondingly receives. The AMS may determine a process to which a target broadcast receiver belongs, i.e., a target process, and determine target broadcast receivers belonging to the same target process, thereby obtaining target broadcast receiver information corresponding to each target process. The AMS may transmit the broadcast it receives, and target broadcast receiver information corresponding to a target process to the target process. After the target process receives the broadcast and its corresponding target broadcast receiver information, it may determine its corresponding target broadcast receiver based on its corresponding target broadcast receiver information and transmit the broadcast to its corresponding target broadcast receiver.
Specifically, referring to fig. 9, fig. 9 is a flowchart of yet another broadcast distribution method according to an embodiment of the present application. The broadcast distribution method may include, but is not limited to, the steps of:
S901: the AMS receives the broadcast_1 transmitted by the broadcast transmitter.
S902: the AMS determines a target broadcast receiver and a target process based on the broadcast_1 and a correspondence relationship between the broadcast receiver and the broadcast. The target broadcast receiver is the broadcast receiver corresponding to broadcast_1. The target process is a process to which the target broadcast receiver belongs. The correspondence between the target process and the target broadcast receiver is a one-to-one correspondence or a one-to-many correspondence.
It can be appreciated that the specific implementation manner of step S901 and step S902 may refer to the related descriptions of step S301 and step S302, which are not described herein.
S903: the AMS aggregates the target broadcast receivers belonging to the same target process, to obtain target broadcast receiver information corresponding to each target process. The target broadcast receiver information corresponding to the target process is related information of the target broadcast receiver in the target process.
After the AMS determines the target broadcast receiver and the process to which the target broadcast receiver belongs (i.e., the target process), it may aggregate for the target broadcast receivers belonging to the same process, i.e., determine the target broadcast receiver in each target process. That is, the AMS may determine which processes to which the target broadcast receiver belongs are the same target process. Accordingly, after the AMS determines the target broadcast receiver in each target process, the AMS may obtain target broadcast receiver information corresponding to each target process.
For example, the receiver1, the receiver2, and the receiver3 are target broadcast receivers, the processes to which the receiver1 and the receiver3 belong are the process_1, the process to which the receiver2 belongs is the process_2, and the process_1 and the process_2 are target processes. In this case, the target broadcast receiver information corresponding to the process_1 may be related information of the receiver1 and the receiver3, and the target broadcast receiver information corresponding to the process_1 may be used to represent the receiver1 and the receiver3. And the target broadcast receiver information corresponding to the process_2 may be related information of the receiver2, and the target broadcast receiver information corresponding to the process_2 may be used to represent the receiver2.
According to the above, the target broadcast receiver information may be an identification of the target broadcast receiver, and may also be a registration name of the target broadcast receiver, which is not limited in this application. And, the target broadcast receiver information may be embodied as a list, a collection, or the like, and the present application is not limited to a specific form thereof.
Illustratively, the target process includes process_1, process_2, and process_3. The target broadcast receiver corresponding to the process_1 includes a receiver1 and a receiver3, the target broadcast receiver corresponding to the process_2 includes a receiver2, and the target broadcast receiver corresponding to the process_3 includes a receiver4, a receiver5 and a receiver6. That is, the processes to which the target broadcast receivers receiver1 and receiver3 belong are the process_1, the process to which the target broadcast receiver2 belongs is the process_2, and the processes to which the target broadcast receivers receiver4, receiver5, and receiver6 belong are the process_3. The target broadcast receiver information corresponding to the process_1, the process_2, and the process_3 is the target broadcast receiver information_1, the target broadcast receiver information_2, and the target broadcast receiver information_3, respectively. It will be understood that the target broadcast receiver information_1 includes related information of the receiver1 and the receiver3, the target broadcast receiver information_2 includes related information of the receiver2, and the target broadcast receiver information_3 includes related information of the receiver4, the receiver5, and the receiver6.
In one possible implementation, as shown in table 7, the target broadcast receiver information_1 is a target broadcast receiver list corresponding to the process_1, where the target broadcast receiver list includes registration names of target broadcast receivers in the process_1, that is, receivers 1 and 3. Similarly, the target broadcast receiver information_2 is a target broadcast receiver list corresponding to the process_2, and the target broadcast receiver list includes the registration names of the target broadcast receivers in the process_2, namely, receiver2. Similarly, the target broadcast receiver information_3 is a target broadcast receiver list corresponding to the process_3, and the target broadcast receiver list includes the registration names of the target broadcast receivers in the process_3, namely, the receiver4, the receiver 5 and the receiver6.
TABLE 7
Figure SMS_7
It will be appreciated that the target broadcast receiver list may also include an identification of the target broadcast receivers in their corresponding target processes, which identification may be in the form of a number, a string, etc., as the application is not limited in this regard.
In still another possible implementation manner, as shown in table 8, the target broadcast receiver information_1 is a target broadcast receiver set corresponding to the process_1, where the target broadcast receiver set includes registration names of target broadcast receivers in the process_1, that is, receivers 1 and 3. Similarly, the target broadcast receiver information_2 is a target broadcast receiver set corresponding to the process_2, and the target broadcast receiver set includes the registration name of the target broadcast receiver in the process_2, that is, receiver2. Similarly, the target broadcast receiver information_3 is a target broadcast receiver set corresponding to the process_3, and the target broadcast receiver set includes the registration names of the target broadcast receivers in the process_3, namely, the receiver4, the receiver 5 and the receiver6.
TABLE 8
Figure SMS_8
It will be appreciated that the set of target broadcast receivers may also include an identification of the target broadcast receiver in its corresponding target process, which identification may be embodied in the form of a number, a string, etc., as this application is not limited in this regard.
S904: the AMS transmits broadcast_1 and its corresponding target broadcast receiver information to each target process.
For each target process, the AMS may transmit broadcast_1 and its corresponding target broadcast receiver information thereto.
Illustratively, the target process includes process_1, process_2, and process_3. The target broadcast receiver information corresponding to the process_1, the process_2, and the process_3 is the target broadcast receiver information_1, the target broadcast receiver information_2, and the target broadcast receiver information_3, respectively. The AMS may transmit the broadcast_1 and the target broadcast receiver information_1 to the process_1. Similarly, the AMS may transmit the broadcast_1 and the target broadcast receiver information_2 to the process_2. Similarly, the AMS may transmit the broadcast_1 and the target broadcast receiver information_1 to the process_1.
It can be appreciated that the present application does not limit the order in which the AMS transmits corresponding information (i.e., broadcast_1 and target broadcast receiver information corresponding to the target process) to different target processes.
Accordingly, the target process may receive the broadcast_1 transmitted by the AMS and target broadcast receiver information corresponding to the target process.
S905: the target process determines target broadcast receivers in the target process based on the corresponding target broadcast receiver information, and transmits the broadcast_1 to each target broadcast receiver in the target process.
It can be understood that, for any one target process, after the target process receives the broadcast_1 transmitted by the AMS and the target broadcast receiver information corresponding to the target process, the target broadcast receiver in the target process may be determined based on the target broadcast receiver information corresponding to the target process, and the broadcast_1 may be transmitted to each target broadcast receiver in the target process.
For example, after the process_1 receives the broadcast_1 and the target broadcast receiver information_1 sent by the AMS, the registration names of the broadcast receivers, that is, the receiver1 and the receiver 3, included in the target broadcast receiver information_1 may be determined, so as to determine that the target broadcast receivers in the process_1 are the receiver1 and the receiver 3. Process_1 may send broadcast_1 to receiver1 and receiver 3, respectively. Similarly, after the process_2 receives the broadcast_1 and the target broadcast receiver information_2 sent by the AMS, the registration name of the broadcast receiver included in the target broadcast receiver information_2, that is, receiver2, may be determined, so as to determine that the target broadcast receiver in the process_1 is receiver2. Process_2 may send broadcast_1 to receiver2. Similarly, after the process_3 receives the broadcast_1 and the target broadcast receiver information_3 sent by the AMS, the registration names of the broadcast receivers included in the target broadcast receiver information_3, that is, the receivers 4, 5 and 6, may be determined, so as to determine that the target broadcast receivers in the process_3 are the receivers 4, 5 and 6. Process_3 may send broadcast_1 to receiver4, receiver 5, and receiver6, respectively.
It is understood that the present application does not limit the order in which the target process transmits the broadcast_1 to the plurality of target broadcast receivers therein in the case where the target process corresponds to the plurality of target broadcast receivers. In some embodiments of the present application, the target process may transmit broadcast_1 to the target broadcast receivers in the target process based on the order of the target broadcast receivers shown in the target broadcast receiver list.
A further broadcast distribution method provided by the embodiments of the present application is described below.
Referring to fig. 10, fig. 10 is a flowchart of yet another broadcast distribution method according to an embodiment of the present application. The broadcast distribution method may include, but is not limited to, the steps of:
s1001: the electronic device receives a first broadcast transmitted by a broadcast transmitter through the AMS.
The electronic device transmits a first broadcast to an AMS in the electronic device through a broadcast transmitter in the electronic device. Accordingly, the electronic device may receive the first broadcast transmitted by the broadcast transmitter through the AMS.
In some embodiments of the present application, the first broadcast may be broadcast_1 mentioned above. In some embodiments of the present application, the first broadcast may be the broadcast G1 mentioned above.
S1002: the electronic device determines a target broadcast receiver and a target process based on the first correspondence and the first broadcast through the AMS. Wherein the target process is a process to which the target broadcast receiver belongs.
After the electronic device receives the first broadcast transmitted by the broadcast transmitter through the AMS, the target broadcast receiver and the target process may be determined by the AMS based on the first correspondence and the first broadcast. Wherein the target broadcast receiver is a broadcast receiver for receiving the first broadcast. The target process is a process to which the target broadcast receiver belongs. It can be appreciated that the first correspondence, the target broadcast receiver, and the related description of the target process may refer to the above, and will not be described herein.
It can be appreciated that the target broadcast receiver may be registered in the AMS before the electronic device performs step S1002. The specific implementation of the broadcast receiver registration may refer to related art documents, and will not be described herein.
S1003: in case that a plurality of target broadcast receivers exist in a first process among the target processes, the electronic device transmits a first broadcast and first target broadcast receiver information to the first process through the AMS, and transmits the first broadcast to the plurality of target broadcast receivers in the first process based on the first target broadcast receiver information through the first process, respectively. Wherein the first target broadcast receiver information includes related information of a plurality of target broadcast receivers in the first process.
It is understood that there may be one or more target processes determined by the electronic device through the AMS. The target process determined by the electronic device through the AMS may include a first process. In case that there are a plurality of target broadcast receivers in the first process (i.e., the first process corresponds to the plurality of target broadcast receivers), the electronic device may determine first target broadcast receiver information through the AMS, transmit the first broadcast and the first target broadcast receiver information to the first process, and after the first process receives the first broadcast and the first target broadcast receiver information, determine a plurality of target broadcast receivers in the first process based on the first target broadcast receiver information through the first process, and transmit the first broadcast to each of the target broadcast receivers in the first process through the first process, respectively.
In some embodiments of the present application, in a case where only one target broadcast receiver exists in the first process (i.e., one target broadcast receiver corresponds to the first process), the electronic device may transmit the first broadcast to the one target broadcast receiver in the first process through the AMS (as shown in fig. 3A and 3B). In this case, the AMS may implement transmission of the first broadcast based on the native interface. That is, the AMS may transmit the first broadcast to the one target broadcast receiver in the first process based on the native interface. It is understood that the description of the native interface in the broadcast mechanism may refer to the above and related technical documents, and will not be repeated here.
In some embodiments of the present application, whether one target broadcast receiver exists or a plurality of target broadcast receivers exist in the first process, the electronic device may transmit the first broadcast and the first target broadcast receiver information to the first process through the AMS, and after the first process receives the first broadcast and the first target broadcast receiver information, determine the plurality of target broadcast receivers in the first process based on the first target broadcast receiver information through the first process, and transmit the first broadcast to each of the target broadcast receivers in the first process through the first process, respectively (as shown in fig. 9). In this case, the AMS may implement transmission of the first broadcast and the first target broadcast receiver information based on the newly added interface. That is, the AMS may transmit the first broadcast and the first target broadcast receiver information to the first process based on the newly added interface. It can be appreciated that the related description of the newly added interface can be referred to above, and will not be repeated here.
Note that the AMS and the first process do not belong to the same process. The electronic device transmits corresponding information (e.g., a first broadcast) to the first process or one target broadcast receiver in the first process through the AMS is cross-process communication (i.e., inter-process communication). The cross-process communication may be performed based on a binder mechanism, and reference may be made to the above for details, which are not described herein. And the process by which the electronic device transmits the first broadcast to the target broadcast receiver in the first process through the first process is in-process communication.
It can be understood that the first target broadcast receiver is target broadcast receiver information corresponding to the first process. In some embodiments of the present application, the first process may be process_1, and the first target broadcast receiver information is target broadcast receiver information_1. In some embodiments of the present application, the first process may be process_2, and the first target broadcast receiver information is target broadcast receiver information_2. The first process may be process_3 and the first target broadcast receiver information is target broadcast receiver information_3.
It is understood that the first target broadcast receiver information may be in the form of a list, a set, or the like, and the first target broadcast receiver information may include a registration name, an identification, or the like of the target broadcast receiver in the first process, and the above may be referred to in particular.
The following describes the apparatus according to the embodiments of the present application.
Fig. 11 is a schematic hardware structure of an electronic device according to an embodiment of the present application.
As shown in fig. 11, the electronic device may include a processor, an external memory interface, an internal memory, an audio module, a speaker, a receiver, a microphone, an earphone interface, a display screen.
The structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic apparatus. In some embodiments of the present application, the electronic device may include more components than illustrated. For example, the electronic device may include sensors such as a touch sensor, an acceleration sensor, and a gyro sensor. In some embodiments of the present application, an electronic device may include fewer components than shown, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware. The connection relationships between the modules illustrated in the embodiments of the present application are merely illustrative, and do not limit the structure of the electronic device.
The processor may include one or more processing units. For example, the processors may include an application processor (Application Processor, AP), a modem processor, a graphics processor (Graphics Processing Unit, GPU), an image signal processor (Image Signal Processor, ISP), a controller, a video codec, a digital signal processor (Digital Signal Processor, DSP), a baseband processor, and/or a Neural network processor (Neural-network Processing Unit, NPU), etc. A memory may also be provided in the processor for storing instructions and data.
The electronic device may implement display functions through a GPU, a display screen, an application processor, and the like. The GPU is a microprocessor for image processing and is connected with the display screen and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor may include one or more GPUs that execute program instructions to generate or change display information. The display screen is used for displaying images, videos, and the like. In some embodiments of the present application, an electronic device may include 1 or more display screens.
In this application, the ability of the electronic device to display a user interface depends on the display functionality provided by the GPU, the display screen, and the application processor.
The internal memory may be used to store computer-executable program code that includes instructions. The processor executes the instructions stored in the internal memory to perform various functional applications of the electronic device and data processing. The internal memory may include a stored program area and a stored data area. The storage program area may store, among other things, an operating system, an application program required for at least one function (e.g., a sound playing function, an image playing function, etc.), and the like. The storage data area may store data created during use of the electronic device (e.g., audio data, phonebook, etc.), and so forth.
It is understood that the internal Memory may include one or more random access memories (Random Access Memory, RAM) and one or more Non-Volatile memories (NVM). Such as at least one disk storage device, flash memory device, universal flash memory (Universal Flash Storage, UFS), etc. Random access memory may be read directly from and written to by a processor, may be used to store executable programs (e.g., machine instructions) for an operating system or other on-the-fly programs, may also be used to store data for users and applications, and the like. The nonvolatile memory may also store executable programs, store data of users and application programs, and the like, and may be loaded into the random access memory in advance for the processor to directly read and write.
In the present application, codes implementing the broadcast distribution method described in the embodiments of the present application may be stored on a nonvolatile memory. In implementing the method, the electronic device may load executable code stored in the non-volatile memory into the random access memory.
The external memory interface may be used to connect an external memory card, such as a Micro SD card, to enable expansion of the memory capabilities of the electronic device. The external memory card may communicate with the processor through an external memory interface to implement a data storage function. For example, files such as music and video are stored in an external memory card.
The electronic device may implement audio functions through an audio module, speaker, receiver, microphone, headphone interface, application processor, and the like.
The audio module is used for converting digital audio information into analog audio signals for output and also used for converting analog audio input into digital audio signals. Speakers, also known as "horns," are used to convert audio electrical signals into sound signals. A receiver, also called an "earpiece", is used to convert the audio electrical signal into a sound signal. Microphones, also known as "microphones" and "microphones", are used to convert sound signals into electrical signals. The earphone interface is used for connecting a wired earphone.
The display screen is used for displaying images, videos, and the like. In some embodiments of the present application, an electronic device may include 1 or more display screens. The electronic device may implement display functions through a graphics processor, a display screen, an application processor, and the like.
Fig. 12 is a schematic software structure of an electronic device according to an embodiment of the present application.
As shown in fig. 12, the software system of the electronic device may employ a layered architecture, an event driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the application, a layered Android (Android) system is taken as an example, and a software structure of an electronic device is illustrated.
The layered architecture divides the software into several layers, each with distinct roles and branches. The layers communicate with each other through a software interface. In some embodiments, the software framework of the electronic device may include an application layer, an application framework layer, a system library, a Runtime (run time), a Hardware Abstraction Layer (HAL), and a kernel layer.
The application layer may include a series of application packages. For example, the application package may include applications for cameras, gallery, settings, phone calls, maps, navigation, WLAN, bluetooth, music, video, and short messages.
The application framework layer provides an application programming interface (Application Programming Interface, API) and programming framework for application programs of the application layer. The application framework layer includes a number of predefined functions. The application framework layer may include a series of system services. System services are modular components that focus on specific functions. The functionality provided by the application framework APIs may communicate with system services to access underlying hardware. For example, the application framework layer may include a window manager, a content provider, a view system, a telephony manager, a resource manager, a notification manager, and the like. The window manager is used for managing window programs. The window manager can acquire the size of the display screen, judge whether a status bar exists, lock the screen, intercept the screen and the like. The content provider is used to store and retrieve data and make such data accessible to applications. Such data may include video, images, audio, calls made and received, browsing history and bookmarks, phonebooks, etc. The view system includes visual controls, such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, a display interface including a text message notification icon may include a view displaying text and a view displaying a picture. The telephony manager is used to provide the communication functions of the electronic device 100. Such as the management of call status (including on, hung-up, etc.). The resource manager provides various resources for the application program, such as localization strings, icons, pictures, layout files, video files, and the like. The notification manager enables the application to display notification information in the status bar, can be used to communicate notification type messages, and can automatically disappear after fast stay without user interaction. Such as notification manager is used to inform that the download is complete, message alerts, etc. The notification manager may also be a notification in the form of a chart or scroll bar text that appears on the system top status bar, such as a notification of a background running application, or a notification that appears on the screen in the form of a dialog window. For example, a text message is prompted in a status bar, a prompt tone is emitted, the electronic device vibrates, and an indicator light blinks, etc.
The system library may include a plurality of functional modules. For example: surface Manager (Surface Manager), media Libraries (Media Libraries), three-dimensional graphics processing Libraries (e.g., openGL ES), two-dimensional graphics engines (e.g., SGL), etc. The specific meaning and function of these functional modules may be referred to in the related art documents, and will not be described herein. The specific meaning and function of these functional modules may be referred to in the related art documents, and will not be described herein.
The Runtime (run time) is responsible for the scheduling and management of the system. Run time includes a core library and virtual machines. The core library consists of two parts: one part is a function which needs to be called by java language, and the other part is a core library of android. The application layer and the application framework layer run in a virtual machine. The virtual machine executes java files of the application program layer and the application program framework layer as binary files. The virtual machine is used for executing the functions of object life cycle management, stack management, thread management, security and exception management, garbage collection and the like.
A Hardware Abstraction Layer (HAL) is an interface layer located between the operating system kernel and upper layer software, which aims at abstracting the hardware. The hardware abstraction layer is a device kernel driven abstraction interface for enabling application programming interfaces that provide higher level Java API frameworks with access to the underlying devices. The HAL may provide a standard interface that displays device hardware functionality to a higher level Java API framework. The HAL comprises a plurality of library modules, such as a camera HAL, an audio HAL, etc. Wherein each library module implements an interface for a particular type of hardware component. To load library modules for the hardware component when the system framework layer API requires access to the hardware of the portable device, the operating system will load the library modules for the hardware component.
The kernel layer is a layer between hardware and software. The kernel layer is the basis of the Android operating system. The kernel layer is responsible for the functions of hardware such as drivers, network, power supply, system security, memory management and the like. The kernel layer is an intermediate layer between hardware and software that acts to pass requests of an application to the hardware. The kernel layer may include display drivers, camera drivers, audio drivers, sensor drivers, and the like.
It should be noted that, the software architecture schematic diagram of the electronic device shown in fig. 12 provided in the present application is only an example, and is not limited to specific module division in different layers of the Android operating system, and the description of the software architecture of the Android operating system in the conventional technology may be referred to specifically. In addition, the broadcast distribution method provided by the application can also be realized based on other operating systems, and the application is not exemplified one by one.
The above embodiments are only for illustrating the technical solution of the present application, and are not limiting thereof; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.

Claims (10)

1. A broadcast distribution method, the method comprising:
the electronic device receives a first broadcast transmitted by a broadcast transmitter through an activity manager service AMS;
the electronic device determines a target broadcast receiver and a target process based on a first correspondence and the first broadcast through the AMS;
in case that a plurality of target broadcast receivers exist in a first process among the target processes, the electronic device transmits the first broadcast and first target broadcast receiver information to the first process through the AMS; the electronic device respectively transmits the first broadcast to a plurality of target broadcast receivers in the first process based on the first target broadcast receiver information through the first process;
wherein, the target process is the process to which the target broadcast receiver belongs; the first target broadcast receiver information includes related information of each target broadcast receiver in the first process.
2. The method of claim 1, wherein the method further comprises:
in case that only one target broadcast receiver exists in the first process, the electronic device transmits the first broadcast to one target broadcast receiver in the first process through the AMS.
3. The method of claim 1, wherein the method further comprises:
in case that only one target broadcast receiver exists in the first process, the electronic device transmits the first broadcast and the first target broadcast receiver information to the first process through the AMS; the electronic device sends the first broadcast to target broadcast receivers in the first process based on the first target broadcast receiver information through the first process.
4. The method of any of claims 1-3, wherein the electronic device determining the target process by the AMS specifically comprises: the electronic equipment determines the target process through the AMS based on a binder server address carried by the target broadcast receiver when registering; the binder server address contains process information.
5. A method according to any of claims 1-3, wherein the first target broadcast receiver information is a list comprising registered names of respective target broadcast receivers in the first process.
6. The method of any of claims 1-3, wherein the electronic device sends the first broadcast and first target broadcast receiver information to the first process through the AMS, specifically comprising: the electronic device transmits the first broadcast and the first target broadcast receiver information to the first process based on a newly added interface through the AMS.
7. The method of any one of claims 1-3, wherein the first correspondence is a correspondence of a broadcast receiver registered in the AMS and a broadcast type; the electronic device determining, by the AMS, the target broadcast receiver based on the first correspondence and the first broadcast, specifically including:
the electronic device determines, through the AMS, a broadcast receiver of the same type as the first broadcast as the target broadcast receiver, which corresponds to the broadcast receiver, based on a correspondence of the broadcast receiver registered in the AMS and a broadcast type.
8. The method of any one of claims 1-3, wherein the first correspondence is a correspondence of broadcast receivers registered in the AMS to broadcasts; the electronic device determining, by the AMS, the target broadcast receiver based on the first correspondence and the first broadcast, specifically including:
the electronic device determines, through the AMS, that a broadcast receiver corresponding to the first broadcast is the target broadcast receiver based on a correspondence between the broadcast receivers registered in the AMS and the broadcast.
9. An electronic device comprising one or more memories, one or more processors, characterized in that the memories are used for storing computer programs; the processor is configured to invoke the computer program to cause the electronic device to perform the method of any of claims 1-8.
10. A computer storage medium, comprising: computer instructions; when executed on an electronic device, the computer instructions cause the electronic device to perform the method of any of claims 1-8.
CN202310470038.4A 2023-04-27 2023-04-27 Broadcast distribution method and related equipment Active CN116185669B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310470038.4A CN116185669B (en) 2023-04-27 2023-04-27 Broadcast distribution method and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310470038.4A CN116185669B (en) 2023-04-27 2023-04-27 Broadcast distribution method and related equipment

Publications (2)

Publication Number Publication Date
CN116185669A true CN116185669A (en) 2023-05-30
CN116185669B CN116185669B (en) 2023-09-22

Family

ID=86452655

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310470038.4A Active CN116185669B (en) 2023-04-27 2023-04-27 Broadcast distribution method and related equipment

Country Status (1)

Country Link
CN (1) CN116185669B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117076158A (en) * 2023-09-28 2023-11-17 荣耀终端有限公司 Broadcast distribution processing method and related equipment

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106201740A (en) * 2016-06-29 2016-12-07 北京金山安全软件有限公司 Broadcast message management method, device and equipment
CN106648937A (en) * 2016-12-29 2017-05-10 北京奇虎科技有限公司 Broadcast agent method and device for Android applications
US20200004614A1 (en) * 2017-03-10 2020-01-02 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Broadcast Transmission Method, Terminal, and Storage Medium
CN111917562A (en) * 2020-07-31 2020-11-10 广州市百果园信息技术有限公司 Broadcast message forwarding method, device, equipment and storage medium
EP3591924B1 (en) * 2017-03-10 2021-01-13 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Control method, device, storage medium, and electronic apparatus for broadcast sending
EP3418892B1 (en) * 2016-03-30 2021-09-01 Huawei Technologies Co., Ltd. Method and device for managing and controlling broadcast, and terminal
CN115712515A (en) * 2022-11-24 2023-02-24 抖音视界有限公司 Broadcast information receiving method and device, computer equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3418892B1 (en) * 2016-03-30 2021-09-01 Huawei Technologies Co., Ltd. Method and device for managing and controlling broadcast, and terminal
CN106201740A (en) * 2016-06-29 2016-12-07 北京金山安全软件有限公司 Broadcast message management method, device and equipment
CN106648937A (en) * 2016-12-29 2017-05-10 北京奇虎科技有限公司 Broadcast agent method and device for Android applications
US20200004614A1 (en) * 2017-03-10 2020-01-02 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Broadcast Transmission Method, Terminal, and Storage Medium
EP3591924B1 (en) * 2017-03-10 2021-01-13 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Control method, device, storage medium, and electronic apparatus for broadcast sending
CN111917562A (en) * 2020-07-31 2020-11-10 广州市百果园信息技术有限公司 Broadcast message forwarding method, device, equipment and storage medium
CN115712515A (en) * 2022-11-24 2023-02-24 抖音视界有限公司 Broadcast information receiving method and device, computer equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117076158A (en) * 2023-09-28 2023-11-17 荣耀终端有限公司 Broadcast distribution processing method and related equipment
CN117076158B (en) * 2023-09-28 2024-03-12 荣耀终端有限公司 Broadcast distribution processing method and related equipment

Also Published As

Publication number Publication date
CN116185669B (en) 2023-09-22

Similar Documents

Publication Publication Date Title
CN108536538A (en) Processor core dispatching method, device, terminal and storage medium
CN110990075B (en) Method, device, equipment and storage medium for starting fast application
WO2022089207A1 (en) Cross-device application interaction method, electronic device, and server
AU2019256257B2 (en) Processor core scheduling method and apparatus, terminal, and storage medium
CN113032766B (en) Application authority management method and device
EP4102368A1 (en) Cross-device application calling method and electronic device
CN110413822B (en) Offline image structured analysis method, device and system and storage medium
CN116185669B (en) Broadcast distribution method and related equipment
WO2023103759A1 (en) Service calling method, system and apparatus, and device and storage medium
CN111679790A (en) Remote software development storage space distribution method and device
US20230259250A1 (en) Control method and apparatus, and electronic device
CN114237840A (en) Resource interaction method, device, terminal and storage medium
CN113835571A (en) Terminal device, information display method and storage medium
CN115048642B (en) Communication method between trusted applications in multi-trusted execution environment and electronic equipment
CN114915618B (en) Upgrade package downloading method and device
CN113220446A (en) Image or video data processing method and terminal equipment
CN113642010B (en) Method for acquiring data of extended storage device and mobile terminal
CN115981576B (en) Method for sharing data, electronic device and storage medium
CN117076158B (en) Broadcast distribution processing method and related equipment
CN117216428B (en) Webpage resource request method, terminal equipment and computer readable storage medium
US20240036891A1 (en) Sub-application running method and apparatus, electronic device, program product, and storage medium
CN115250261B (en) Information display method and electronic equipment
CN117992251A (en) Broadcast distribution method and electronic equipment
CN116800814A (en) Data relay method, server, terminal equipment and storage medium
CN114500496A (en) Target data downloading method and device

Legal Events

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