WO2023131109A1 - 一种注册广播的方法及装置 - Google Patents

一种注册广播的方法及装置 Download PDF

Info

Publication number
WO2023131109A1
WO2023131109A1 PCT/CN2023/070074 CN2023070074W WO2023131109A1 WO 2023131109 A1 WO2023131109 A1 WO 2023131109A1 CN 2023070074 W CN2023070074 W CN 2023070074W WO 2023131109 A1 WO2023131109 A1 WO 2023131109A1
Authority
WO
WIPO (PCT)
Prior art keywords
broadcast
message
functional module
registration message
broadcast message
Prior art date
Application number
PCT/CN2023/070074
Other languages
English (en)
French (fr)
Inventor
袁科杰
陈峥
金炼城
Original Assignee
北京有竹居网络技术有限公司
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 北京有竹居网络技术有限公司 filed Critical 北京有竹居网络技术有限公司
Publication of WO2023131109A1 publication Critical patent/WO2023131109A1/zh

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
    • 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/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • 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
    • 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

Definitions

  • the present application relates to the field of data processing, in particular to a method and device for registering broadcast.
  • An application program (Application, APP) needs to receive broadcast messages from the operating system during running.
  • the application program needs to register the broadcast with the operating system. Only after the application program registers the broadcast with the operating system can it receive the broadcast message sent by the operating system.
  • application program may also be referred to as "application”.
  • an application when an application registers a broadcast with the operating system, the core process of the operating system registers on its behalf.
  • an operating system such as the Android operating system has a maximum limit on the number of registered broadcasts for a single process. For example, a single process is limited to register up to 50 broadcasts, which results in a core process that can only register up to 50 broadcasts.
  • the number of applications is too large to exceed the maximum number of broadcasts that can be registered by the core process, some applications will fail to successfully register for broadcasts, thereby affecting the normal operation of the applications.
  • the technical problem to be solved by this application is: in the installation-free framework, when the number of applications is too large due to the core process registering the broadcast for the application, some applications cannot successfully register the broadcast, and a method and device for registering the broadcast are provided.
  • the embodiment of the present application provides a method for registering broadcast, the method includes:
  • a functional module running in a first process in the installation-free framework obtains a first broadcast registration message sent by the first process, the first process is a process corresponding to the first application, and the first broadcast registration message is used for registering for the first application to broadcast;
  • the functional module determines a second broadcast registration message according to the first broadcast registration message, and the second broadcast registration message is used to register broadcast for the first application;
  • the function module sends the second broadcast registration message to an operating system.
  • the functional module determines a second broadcast registration message according to the first broadcast registration message, including:
  • the functional module determines the first broadcast registration message as the second broadcast registration message.
  • the functional module determines a second broadcast registration message according to the first broadcast registration message, including:
  • the functional module replaces the description information of the first broadcast listener in the first broadcast registration message with the first character string to obtain the second broadcast registration message, and the first broadcast listener corresponds to the first process broadcast listener.
  • the method also includes:
  • the functional module obtains the first broadcast message sent by the first process
  • the functional module determines a second broadcast message according to the first broadcast message
  • the function module sends the second broadcast message to an operating system.
  • the functional module determines the second broadcast message according to the first broadcast message, including:
  • the functional module determines the first broadcast message as the second broadcast message.
  • the functional module determines the second broadcast message according to the first broadcast message, including:
  • the functional module replaces the description information of the second broadcast listener in the first broadcast message with a second character string to obtain the second broadcast message, and the second broadcast listener receives the first The broadcast listener corresponding to the process that broadcasts the message.
  • the method further includes:
  • the functional module sends a request message to the core process of the operating system, and the request message is used to request the core process to activate the process receiving the second broadcast message;
  • the function module receives a confirmation message sent by the core process, and the confirmation message is used to indicate that the process receiving the second broadcast message is in a running state.
  • the method also includes:
  • the functional module obtains the third broadcast message sent by the operating system
  • the functional module determines a fourth broadcast message according to the third broadcast message
  • the function module sends the fourth broadcast message to the first process.
  • the functional module determines a fourth broadcast message according to the third broadcast message, including:
  • the function module determines the third broadcast message as a fourth broadcast message.
  • the first character string is included in the third broadcast message
  • the function module determines a fourth broadcast message according to the third broadcast message, including:
  • the functional module replaces the first character string in the third broadcast message with the description information of the first broadcast listener to obtain the fourth broadcast message, and the first broadcast listener is the broadcast corresponding to the first process listener.
  • the embodiment of the present application provides a device for registering a broadcast, which is applied to a functional module running in the first process in the installation-free framework, and the device includes:
  • a first obtaining unit configured to obtain a first broadcast registration message sent by the first process, the first process is a process corresponding to the first application, and the first broadcast registration message is used for the first application register broadcast;
  • a first determining unit configured to determine a second broadcast registration message according to the first broadcast registration message, where the second broadcast registration message is used to register broadcast for the first application;
  • a first sending unit configured to send the second broadcast registration message to an operating system.
  • the first determination unit is configured to:
  • the first determination unit is configured to:
  • the device also includes:
  • a second acquiring unit configured to acquire the first broadcast message sent by the first process
  • a second determining unit configured to determine a second broadcast message according to the first broadcast message
  • the second sending unit is configured to send the second broadcast message to the operating system.
  • the second determining unit is configured to:
  • the functional module determines the first broadcast message as the second broadcast message.
  • the second determining unit is configured to: the functional module replaces the description information of the second broadcast listener in the first broadcast message with a second character string to obtain the second broadcast message,
  • the second broadcast listener is a broadcast listener corresponding to a process directed to receive the first broadcast message.
  • the device also includes:
  • the third sending unit is configured to: before sending the second broadcast message to the operating system, if the process receiving the second broadcast message is another process independent of the first process, send the message to the operating system
  • the core process sends a request message, where the request message is used to request the core process to activate the process receiving the second broadcast message;
  • the receiving unit is configured to receive an acknowledgment message sent by the core process, where the acknowledgment message is used to indicate that the process receiving the second broadcast message is in a running state.
  • the device also includes:
  • a third acquiring unit configured to acquire a third broadcast message sent by the operating system
  • a third determining unit configured to determine a fourth broadcast message according to the third broadcast message
  • a fourth sending unit configured to send the fourth broadcast message to the first process.
  • the third determining unit is configured to:
  • the third broadcast message includes the first character string
  • the third determining unit is configured to:
  • the fourth broadcast message is obtained by replacing the first character string in the third broadcast message with the description information of the first broadcast listener, where the first broadcast listener is a broadcast listener corresponding to the first process.
  • an embodiment of the present application provides a device, where the device includes a processor and a memory;
  • the processor is configured to execute instructions stored in the memory, so that the device executes the method described in any one of the above first aspects.
  • an embodiment of the present application provides a computer-readable storage medium, which is characterized by including instructions, and the instructions instruct a device to execute the method described in any one of the above first aspects.
  • an embodiment of the present application provides a computer program product, which, when running on a computer, causes the computer to execute the method described in any one of the above first aspects.
  • the embodiment of the present application has the following advantages:
  • An embodiment of the present application provides a broadcast registration method. Specifically, when a first application needs to register a broadcast, a first process corresponding to the first application may send a first broadcast registration message. Then, the first broadcast registration message sent by the first process may be acquired by a functional module running in the first process in the installation-free framework, and the first broadcast registration message is used to register broadcast for the first application. After the functional module acquires the first broadcast registration message, it may determine the second broadcast registration message according to the first broadcast registration message, wherein the second broadcast registration message is also used to register broadcast for the first application. Then, the function module sends the second broadcast registration message to the operating system. Since the functional modules run in the first process, using this solution is equivalent to registering the broadcast for the first process by the first process itself. Therefore, using this solution, it is possible to avoid the problem that some applications cannot successfully register for broadcast due to the core process registering broadcast for the application, so that each application can normally register for broadcast, thereby ensuring the normal operation of each application.
  • FIG. 1 is a schematic flowchart of a method for registering broadcast provided by an embodiment of the present application
  • FIG. 2 is a schematic flowchart of a method for sending a broadcast message provided in an embodiment of the present application
  • FIG. 3 is a schematic flowchart of a method for receiving a broadcast message provided by an embodiment of the present application
  • FIG. 4 is a schematic structural diagram of a device for registering a broadcast provided by an embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of a device provided by an embodiment of the present application.
  • FIG. 1 the figure is a schematic flowchart of a method for registering broadcast provided by an embodiment of the present application.
  • the method shown in FIG. 1 may, for example, include the following steps: S101-S103.
  • the functional module running in the first process in the installation-free framework obtains the first broadcast registration message sent by the first process, the first process is a process corresponding to the first application, and the first broadcast registration message is used to To register broadcast for the first application.
  • the first application is an installation-free application, for example, the first application may be a game application.
  • a first broadcast registration message for registering broadcasting for the first application may be sent by the first process of the first application.
  • the first process does not send the first broadcast registration message to the core process, but obtains the first broadcast registration message by a functional module running in the first process in the installation-free framework. And further register the broadcast for the first application by the functional module.
  • the first broadcast registration message includes information about broadcast messages that the first application wishes to monitor, for example, the first broadcast registration message includes multiple keywords ( key), a key is used to identify a type of broadcast message that the first application wants to monitor.
  • the first broadcast registration message may include description information of the first broadcast listener, wherein the first broadcast listener is the first process The corresponding broadcast listener.
  • a broadcast with a predetermined receiver is a directed broadcast.
  • a broadcast without a predetermined receiver is a non-directed broadcast.
  • the process can choose whether to listen to the broadcast.
  • the functional module determines a second broadcast registration message according to the first broadcast registration message, where the second broadcast registration message is used to register broadcast for the first application.
  • S103 The function module sends the second broadcast registration message to an operating system.
  • the first broadcast registration message generated by the first process may include content that cannot be correctly parsed by the operating system. Therefore, the functional module may Determine the second broadcast registration message according to the first broadcast registration message, the second broadcast registration message mentioned here is also used to register the broadcast for the first application, and the operating system needs to parse the second broadcast registration message The content of the operating system can be correctly parsed. In this way, after the functional module sends the second broadcast registration message to the operating system, it can successfully register the broadcast for the first application.
  • the functional module may directly determine the first broadcast registration message as the second broadcast registration message.
  • the functional module may replace the description information of the first broadcast listener in the first broadcast registration message with the first character string to obtain the second broadcast registration message.
  • the functional module may also save the mapping relationship between the description information of the first broadcast listener and the first character string, so that the functional module may obtain the directed broadcast sent to the first process , converting the first character string in the directional broadcast into description information of the first broadcast listener and sending it to the first process.
  • the first process may send broadcast messages to other processes.
  • the broadcast message sent by the first process also needs to be forwarded to the operating system by the core process.
  • the embodiment of the present application also provides a corresponding broadcast sending method.
  • the first process sends a broadcast message, it does not need to be forwarded to the operating system by the core process, but is directly sent to the operating system by the first process, thereby improving the stability of the core process. sex.
  • FIG. 2 the figure is a schematic flowchart of a method for sending a broadcast message provided by an embodiment of the present application.
  • the method shown in FIG. 2 may include, for example, the following S201-S203.
  • S201 The function module acquires the first broadcast message sent by the first process.
  • the functional modules mentioned here are the "functional modules running in the first process in the installation-free framework" mentioned above.
  • the first broadcast message may be a directed broadcast message or a non-directed broadcast message, which is not specifically limited in this embodiment of the present application.
  • the first broadcast message may include description information of a broadcast listener corresponding to a predetermined receiving process of the first broadcast message.
  • the “broadcast listener corresponding to the predetermined receiving process of the first broadcast message” is called “the second broadcast listener”, and the description of the second broadcast listener is included in the first broadcast message information.
  • the function module determines a second broadcast message according to the first broadcast message.
  • S203 The function module sends the second broadcast message to the operating system.
  • the first broadcast message generated by the first process may include content that cannot be correctly parsed by the operating system.
  • the broadcast message determines the second broadcast message, and the content in the second broadcast message that needs to be parsed by the operating system can be correctly parsed by the operating system. In this way, after the functional module sends the second broadcast message to the operating system, the operating system can normally send the second broadcast registration message.
  • the functional module may, for example, The first broadcast message is directly determined as the second broadcast message.
  • the first broadcast message may include description information of the second broadcast listener.
  • the functional module may replace the description information of the second broadcast listener in the first broadcast message with a second character string, so as to obtain the second broadcast message.
  • the first process may pre-generate and save the correspondence between the description information of the second broadcast listener and the second character string. In this way, after the functional module obtains the first broadcast message carrying the description information of the second broadcast listener, it can determine the second character string according to the corresponding relationship, and further convert the first broadcast message to The description information of the second broadcast listener in is replaced with the second character string, so as to obtain the second broadcast message.
  • the function module may also send a request message to the core process of the operating system, and the request message is used to request the core process to pull the process receiving the second broadcast message to live.
  • the so-called activation of the process receiving the second broadcast message refers to making the process receiving the second broadcast message in a running state.
  • the functional module may wait for a confirmation message sent by the core process, where the confirmation message is used to indicate that the process receiving the second broadcast message is in a running state.
  • the functional module receives the confirmation message, it means that the process of receiving the second broadcast message is in the running state. At this time, the process of receiving the second broadcast message can normally receive the second broadcast message. After the functional module receives the confirmation message, it can execute S203. It can be understood that the process of receiving the second broadcast message is the process of receiving the first broadcast message.
  • the request message may include, for example, an identifier of a process receiving the second broadcast message.
  • the acknowledgment message may include, for example, the identifier of the process that receives the second broadcast message.
  • the confirmation message may include, for example, an identifier of the request message.
  • the first process can receive the broadcast message sent by the operating system.
  • the core process needs to forward it.
  • the embodiment of the present application also provides a corresponding broadcast receiving method. The first process can directly receive the broadcast message sent by the operating system without being forwarded by the core process, thereby improving the stability of the core process.
  • FIG. 3 the figure is a schematic flowchart of a method for receiving a broadcast message provided by an embodiment of the present application.
  • the method shown in FIG. 3 can be implemented, for example, through the following S301-S303.
  • S301 The function module acquires a third broadcast message sent by the operating system.
  • the functional modules mentioned here are the "functional modules running in the first process in the installation-free framework" mentioned above.
  • the third broadcast message may be a directed broadcast message sent to the first process, or may be a non-directed broadcast message, which is not specifically limited in this embodiment of the present application.
  • the third broadcast message may include the first character string.
  • the third broadcast message may be sent to the operating system by other processes such as the second process.
  • the specific implementation of the second process sending the third broadcast message to the operating system is similar to the implementation of the first process sending the broadcast message to the operating system.
  • S201-S203 the specific description of S201-S203 above, and will not be described in detail here.
  • the function module determines a fourth broadcast message according to the third broadcast message.
  • S303 The function module sends the fourth broadcast message to the first process.
  • the functional module replaces the description information of the first broadcast listener with the first character string. Therefore, if the third broadcast message is a directed broadcast message sent to the first process, the third broadcast message may include the first character string. At this time, the first process cannot normally receive the third broadcast message. In order to enable the first process to normally receive the third broadcast message, the first character string may be replaced with description information of the first broadcast listener. In other words, if the third broadcast message is a directed broadcast message sent to the first process, then S302 may replace the first character string in the third broadcast message with the description of the first broadcast listener during specific implementation information to obtain the fourth broadcast message.
  • the first process can normally receive the third broadcast message.
  • the third broadcast message may be determined as the fourth broadcast message.
  • the figure is a schematic structural diagram of an apparatus for registering a broadcast provided by an embodiment of the present application.
  • the apparatus 400 is applied to a functional module running in a first process in an installation-free framework.
  • the apparatus 400 may specifically include: a first acquiring unit 401 , a first determining unit 402 and a first sending unit 403 .
  • the first obtaining unit 401 is configured to obtain a first broadcast registration message sent by the first process, the first process is a process corresponding to the first application, and the first broadcast registration message is used for the first application application registration broadcast;
  • the first determining unit 402 is configured to determine a second broadcast registration message according to the first broadcast registration message, and the second broadcast registration message is used to register broadcast for the first application;
  • the first sending unit 403 is configured to send the second broadcast registration message to an operating system.
  • the first determining unit 402 is configured to:
  • the first determining unit 402 is configured to:
  • the device also includes:
  • a second acquiring unit configured to acquire the first broadcast message sent by the first process
  • a second determining unit configured to determine a second broadcast message according to the first broadcast message
  • the second sending unit is configured to send the second broadcast message to the operating system.
  • the second determination unit is configured to:
  • the functional module determines the first broadcast message as the second broadcast message.
  • the second determining unit is configured to: the functional module replaces the description information of the second broadcast listener in the first broadcast message with a second character string to obtain the second broadcast message,
  • the second broadcast listener is a broadcast listener corresponding to a process directed to receive the first broadcast message.
  • the device also includes:
  • the third sending unit is configured to: before sending the second broadcast message to the operating system, if the process receiving the second broadcast message is another process independent of the first process, send the message to the operating system
  • the core process sends a request message, where the request message is used to request the core process to activate the process receiving the second broadcast message;
  • the receiving unit is configured to receive an acknowledgment message sent by the core process, where the acknowledgment message is used to indicate that the process receiving the second broadcast message is in a running state.
  • the device also includes:
  • a third acquiring unit configured to acquire a third broadcast message sent by the operating system
  • a third determining unit configured to determine a fourth broadcast message according to the third broadcast message
  • a fourth sending unit configured to send the fourth broadcast message to the first process.
  • the third determination unit is configured to:
  • the third broadcast message includes the first character string
  • the third determining unit is configured to:
  • the fourth broadcast message is obtained by replacing the first character string in the third broadcast message with the description information of the first broadcast listener, where the first broadcast listener is a broadcast listener corresponding to the first process.
  • the device 400 is a device corresponding to the method provided by the above method embodiment, the specific implementation of each unit of the device 400 is the same concept as the above method embodiment, therefore, about each unit of the device 400 For specific implementation, reference may be made to the description of the above method embodiments, and details are not repeated here.
  • the embodiment of the present application also provides a device, the device includes a processor and a memory;
  • the processor is configured to execute instructions stored in the memory, so that the device executes the method described in any one of the above method embodiments.
  • FIG. 5 it shows a schematic structural diagram of an electronic device 500 suitable for implementing the embodiment of the present application.
  • the electronic equipment in the embodiment of the present application may include but not limited to mobile phones, notebook computers, digital broadcast receivers, PDA (Personal Digital Assistant, personal digital assistant), PAD (portable android device, tablet computer), PMP (Portable Media Player, portable multimedia player), mobile terminals such as vehicle-mounted terminals (such as vehicle-mounted navigation terminals), and fixed terminals such as digital TVs (television, television sets), desktop computers, and the like.
  • PDA Personal Digital Assistant
  • PAD portable android device, tablet computer
  • PMP Portable Media Player, portable multimedia player
  • mobile terminals such as vehicle-mounted terminals (such as vehicle-mounted navigation terminals)
  • fixed terminals such as digital TVs (television, television sets), desktop computers, and the like.
  • the electronic device shown in FIG. 5 is only an example, and should not limit the functions and scope of use of the embodiments of the present application.
  • an electronic device 500 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 501, which may be randomly accessed according to a program stored in a read-only memory (ROM) 502 or loaded from a storage device 508.
  • ROM read-only memory
  • RAM random access memory
  • various appropriate actions and processes are executed by programs in the memory (RAM) 503 .
  • RAM random access memory
  • various programs and data necessary for the operation of the electronic device 500 are also stored.
  • the processing device 501, ROM 502, and RAM 503 are connected to each other through a bus 504.
  • An input/output (I/O) interface 505 is also connected to the bus 504 .
  • the following devices can be connected to the I/O interface 505: input devices 506 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; including, for example, a liquid crystal display (LCD), speaker, vibration an output device 507 such as a computer; a storage device 508 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 509.
  • the communication means 509 may allow the electronic device 500 to perform wireless or wired communication with other devices to exchange data. While FIG. 5 shows electronic device 500 having various means, it is to be understood that implementing or having all of the means shown is not a requirement. More or fewer means may alternatively be implemented or provided.
  • the processes described above with reference to the flowcharts can be implemented as computer software programs.
  • the embodiments of the present application include a computer program product, which includes a computer program carried on a non-transitory computer readable medium, where the computer program includes program code for executing the method shown in the flowchart.
  • the computer program may be downloaded and installed from a network via communication means 509 , or from storage means 508 , or from ROM 502 .
  • the processing device 501 the above-mentioned functions defined in the method of the embodiment of the present application are executed.
  • An embodiment of the present application provides a computer-readable medium, on which a computer program is stored, wherein, when the program is executed by a processor, the method described in any of the foregoing embodiments is implemented.
  • the computer-readable medium mentioned above in this application may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the above two.
  • a computer readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the above. More specific examples of computer-readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code therein. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • a computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device .
  • Program code embodied on a computer readable medium may be transmitted by any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
  • the client and the server can communicate using any currently known or future network protocols such as HTTP (HyperText Transfer Protocol, Hypertext Transfer Protocol), and can communicate with digital data in any form or medium
  • HTTP HyperText Transfer Protocol
  • the communication eg, communication network
  • Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), internetworks (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network of.
  • the above-mentioned computer-readable medium may be included in the above-mentioned electronic device, or may exist independently without being incorporated into the electronic device.
  • the above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the electronic device, the electronic device is made to execute the above-mentioned method.
  • Computer program code for carrying out the operations of this application may be written in one or more programming languages, or combinations thereof, including but not limited to object-oriented programming languages—such as Java, Smalltalk, C++, and Includes conventional procedural programming languages - such as the "C" language or similar programming languages.
  • the program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server.
  • the remote computer can be connected to the user computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (such as through an Internet service provider). Internet connection).
  • LAN local area network
  • WAN wide area network
  • Internet service provider such as AT&T, MCI, Sprint, EarthLink, MSN, GTE, etc.
  • each block in a flowchart or block diagram may represent a module, program segment, or portion of code that contains one or more logical functions for implementing specified executable instructions.
  • the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved.
  • each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations can be implemented by a dedicated hardware-based system that performs the specified functions or operations , or may be implemented by a combination of dedicated hardware and computer instructions.
  • the units involved in the embodiments described in the present application may be implemented by means of software or by means of hardware.
  • the name of the unit/module does not constitute a limitation on the unit itself under certain circumstances, for example, the voice data collection module can also be described as a "data collection module”.
  • FPGAs Field Programmable Gate Arrays
  • ASICs Application Specific Integrated Circuits
  • ASSPs Application Specific Standard Products
  • SOCs System on Chips
  • CPLD Complex Programmable Logical device
  • a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device.
  • a machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium.
  • a machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing.
  • machine-readable storage media would include one or more wire-based electrical connections, portable computer disks, hard disks, Random Access Memory (RAM), Read Only Memory (ROM), Erasable Programmable Read Only Memory (EPROM or flash memory), optical fiber, compact disk read only memory (CD-ROM), optical storage, magnetic storage, or any suitable combination of the foregoing.
  • RAM Random Access Memory
  • ROM Read Only Memory
  • EPROM Erasable Programmable Read Only Memory
  • CD-ROM compact disk read only memory
  • magnetic storage or any suitable combination of the foregoing.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Human Computer Interaction (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

本申请公开了一种注册广播的方法,当第一应用需要注册广播时,由第一应用对应的第一进程发送第一广播注册消息。而后,由免安装框架中运行在第一进程中的功能模块获取第一进程发送的第一广播注册消息,第一广播注册消息用于为第一应用注册广播。功能模块获取第一广播注册消息之后,根据第一广播注册消息确定第二广播注册消息。而后,功能模块将第二广播注册消息发送给操作系统。由于功能模块运行在第一进程,所以利用本方案相当于由第一进程自身为第一进程注册广播。因此,利用本方案可以避免由核心进程给应用注册广播导致部分应用无法成功注册广播的问题,从而使得各个应用均能够正常注册广播,从而保证各个应用均正常运行。

Description

一种注册广播的方法及装置
本申请要求于2022年1月7日提交中国国家知识产权局、申请号为202210017619.8、申请名称为“一种注册广播的方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及数据处理领域,特别是涉及一种注册广播的方法及装置。
背景技术
应用程序(Application,APP)在运行过程中需要接收操作系统的广播消息。应用程序需要向操作系统注册广播,应用程序向操作系统注册广播之后,才能接收到操作系统发送的广播消息。其中,“应用程序”也可以简称“应用”。
在免安装框架中,应用向操作系统注册广播时,由操作系统的核心进程代为注册。但是,操作系统例如安卓(Android)操作系统对单个进程注册广播有最大数量限制,例如,限制单个进程最多注册50个广播,这就导致核心进程最多只能注册50个广播。当应用的数量很多,多到超过核心进程最多能够注册的广播的数量时,则会导致部分应用无法成功注册广播,从而影响应用的正常运行。
因此,急需一种方案,能够解决上述问题。
发明内容
本申请所要解决的技术问题是:在免安装框架中,由核心进程给应用注册广播导致应用的数量很多时,部分应用无法成功注册广播,提供一种注册广播的方法及装置。
第一方面,本申请实施例提供了一种注册广播的方法,所述方法包括:
免安装框架中运行在第一进程中的功能模块获取所述第一进程发送的第一广播注册消息,所述第一进程为与第一应用对应的进程,所述第一广播注册消息用于为所述第一应用注册广播;
所述功能模块根据所述第一广播注册消息确定第二广播注册消息,所述第二广播注册消息用于为所述第一应用注册广播;
所述功能模块将所述第二广播注册消息发送给操作系统。
可选的,所述功能模块根据所述第一广播注册消息确定第二广播注册消息,包括:
所述功能模块将所述第一广播注册消息确定为所述第二广播注册消息。
可选的,所述功能模块根据所述第一广播注册消息确定第二广播注册消息,包括:
所述功能模块将所述第一广播注册消息中的第一广播监听器的描述信息替换成第一字符串,得到所述第二广播注册消息,第一广播监听器为所述第一进程对应的广播监听器。
可选的,所述方法还包括:
所述功能模块获取所述第一进程发送的第一广播消息;
所述功能模块根据所述第一广播消息确定第二广播消息;
所述功能模块将所述第二广播消息发送给操作系统。
可选的,所述功能模块根据所述第一广播消息确定第二广播消息,包括:
所述功能模块将所述第一广播消息确定为所述第二广播消息。
可选的,所述功能模块根据所述第一广播消息确定第二广播消息,包括:
所述功能模块将所述第一广播消息中的第二广播监听器的描述信息替换成第二字符串,得到所述第二广播消息,所述第二广播监听器为定向接收所述第一广播消息的进程对应的广播监听器。
可选的,所述功能模块将所述第二广播消息发送给操作系统之前,所述方法还包括:
若接收所述第二广播消息的进程为独立于所述第一进程的其它进程,
则所述功能模块向所述操作系统的核心进程发送请求消息,所述请求消息用于请求所述核心进程将接收所述第二广播消息的进程拉活;
所述功能模块接收所述核心进程发送的确认消息,所述确认消息用于指示接收所述第二广播消息的进程处于运行状态。
可选的,所述方法还包括:
所述功能模块获取操作系统发送的第三广播消息;
所述功能模块根据所述第三广播消息确定第四广播消息;
所述功能模块将所述第四广播消息发送给所述第一进程。
可选的,所述功能模块根据所述第三广播消息确定第四广播消息,包括:
所述功能模块将所述第三广播消息确定为第四广播消息。
可选的,所述第三广播消息中包括第一字符串,所述功能模块根据所述第 三广播消息确定第四广播消息,包括:
所述功能模块将所述第三广播消息中的第一字符串替换成第一广播监听器的描述信息,得到所述第四广播消息,第一广播监听器为所述第一进程对应的广播监听器。
第二方面,本申请实施例提供了一种注册广播的装置,应用于免安装框架中运行在第一进程中的功能模块,所述装置包括:
第一获取单元,用于获取所述第一进程发送的第一广播注册消息,所述第一进程为与第一应用对应的进程,所述第一广播注册消息用于为所述第一应用注册广播;
第一确定单元,用于根据所述第一广播注册消息确定第二广播注册消息,所述第二广播注册消息用于为所述第一应用注册广播;
第一发送单元,用于将所述第二广播注册消息发送给操作系统。
可选的,所述第一确定单元,用于:
将所述第一广播注册消息确定为所述第二广播注册消息。
可选的,所述第一确定单元,用于:
将所述第一广播注册消息中的第一广播监听器的描述信息替换成第一字符串,得到所述第二广播注册消息,第一广播监听器为所述第一进程对应的广播监听器。
可选的,所述装置还包括:
第二获取单元,用于获取所述第一进程发送的第一广播消息;
第二确定单元,用于根据所述第一广播消息确定第二广播消息;
第二发送单元,用于将所述第二广播消息发送给操作系统。
可选的,所述第二确定单元,用于:
所述功能模块将所述第一广播消息确定为所述第二广播消息。
可选的,所述第二确定单元,用于:所述功能模块将所述第一广播消息中的第二广播监听器的描述信息替换成第二字符串,得到所述第二广播消息,所述第二广播监听器为定向接收所述第一广播消息的进程对应的广播监听器。
可选的,所述装置还包括:
第三发送单元,用于:将所述第二广播消息发送给操作系统之前,若接收所述第二广播消息的进程为独立于所述第一进程的其它进程,则向所述操作系 统的核心进程发送请求消息,所述请求消息用于请求所述核心进程将接收所述第二广播消息的进程拉活;
接收单元,用于接收所述核心进程发送的确认消息,所述确认消息用于指示接收所述第二广播消息的进程处于运行状态。
可选的,所述装置还包括:
第三获取单元,用于获取操作系统发送的第三广播消息;
第三确定单元,用于根据所述第三广播消息确定第四广播消息;
第四发送单元,用于将所述第四广播消息发送给所述第一进程。
可选的,所述第三确定单元,用于:
将所述第三广播消息确定为第四广播消息。
可选的,所述第三广播消息中包括第一字符串,所述第三确定单元,用于:
将所述第三广播消息中的第一字符串替换成第一广播监听器的描述信息,得到所述第四广播消息,第一广播监听器为所述第一进程对应的广播监听器。
第三方面,本申请实施例提供了一种设备,所述设备包括处理器和存储器;
所述处理器用于执行所述存储器中存储的指令,以使得所述设备执行以上第一方面任一项所述的方法。
第四方面,本申请实施例提供了一种计算机可读存储介质,其特征在于,包括指令,所述指令指示设备执行以上第一方面任一项所述的方法。
第五方面,本申请实施例提供了一种计算机程序产品,当所述计算机程序产品在计算机上运行时,使得计算机执行以上第一方面任一项所述的方法。
与现有技术相比,本申请实施例具有以下优点:
本申请实施例提供了一种注册广播的方法,具体地,当第一应用需要注册广播时,可以由第一应用对应的第一进程发送第一广播注册消息。而后,可以由免安装框架中运行在第一进程中的功能模块获取所述第一进程发送的第一广播注册消息,所述第一广播注册消息用于为第一应用注册广播。所述功能模块获取第一广播注册消息之后,可以根据第一广播注册消息确定第二广播注册消息,其中,第二注册广播消息也用于为第一应用注册广播。而后,所述功能模块将所述第二广播注册消息发送给操作系统。由于所述功能模块运行在第一进程,所以利用本方案相当于由第一进程自身为第一进程注册广播。因此,利用本方案,可以避免由核心进程给应用注册广播导致部分应用无法成功注册广 播的问题,从而使得各个应用均能够正常注册广播,从而保证各个应用均正常运行。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请中记载的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施例提供的一种注册广播的方法的流程示意图;
图2为本申请实施例提供的一种发送广播消息的方法的流程示意图;
图3为本申请实施例提供的一种接收广播消息的方法的流程示意图;
图4为本申请实施例提供的一种注册广播的装置的结构示意图;
图5为本申请实施例提供的一种设备的结构示意图。
具体实施方式
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
下面结合附图,详细说明本申请的各种非限制性实施方式。
示例性方法
参见图1,该图为本申请实施例提供的一种注册广播的方法的流程示意图。图1所示的方法,例如可以包括以下步骤:S101-S103。
S101:免安装框架中运行在第一进程中的功能模块获取所述第一进程发送的第一广播注册消息,所述第一进程为第一应用对应的进程,所述第一广播注册消息用于为所述第一应用注册广播。
在本申请实施例中,所述第一应用为免安装应用,所述第一应用例如可以为游戏应用。当第一应用需要注册广播时,可以由第一应用的第一进程发送用于为第一应用注册广播的第一广播注册消息。在本申请实施例中,第一进程不是将第一广播注册消息发送给核心进程,而是由免安装框架中运行在第一进程中的功能模块获取所述第一广播注册消息。并进一步由所述功能模块为第一应 用注册广播。
关于所述第一广播注册消息,需要说明的是,所述第一广播注册消息中包括第一应用希望监听的广播消息的信息,例如,所述第一广播注册消息中包括多个关键词(key),一个key用于标识一类所述第一应用希望监听的广播消息。另外,若第一应用希望监听发送给第一应用的定向广播,则所述第一广播注册消息中可以包括第一广播监听器的描述信息,其中,第一广播监听器为所述第一进程对应的广播监听器。
关于定向广播,需要说明的是,有既定的接收者的广播为定向广播。而没有既定的接受者的广播为非定向广播,对于非定向广播,进程可以选择是否监听该广播。
S102:所述功能模块根据所述第一广播注册消息确定第二广播注册消息,所述第二广播注册消息用于为所述第一应用注册广播。
S103:所述功能模块将所述第二广播注册消息发送给操作系统。
在本申请实施例中,由于所述第一应用为免安装应用,因此,所述第一进程生成的第一广播注册消息中可能包括操作系统无法正确解析的内容,因此,所述功能模块可以根据第一广播注册消息确定第二广播注册消息,此处提及的第二广播注册消息,也用于为所述第一应用注册广播,并且,所述第二广播注册消息中需要操作系统解析的内容所述操作系统均能够正确解析。这样一来,所述功能模块将第二广播注册消息发送给操作系统之后,即可顺利为第一应用注册广播。
在一个示例中,若第一应用无需监听发送给第一应用的定向广播,则所述第一广播注册消息中不包括所述操作系统无法解析的内容,对于这种情况,S102在具体实现时,所述功能模块可以直接将所述第一广播注册消息确定为所述第二广播注册消息。
在又一个示例中,若第一应用需要监听发送给第一应用的定向广播,则所述第一广播注册消息中包括第一广播监听器的描述信息,而所述操作系统无法正确解析所述第一广播监听器的描述信息。对于这种情况,考虑到操作系统能够解析字符串,因此,S102在具体实现时,所述功能模块可以将所述第一广播注册消息中的第一广播监听器的描述信息替换成第一字符串,得到所述第二广播注册消息。对于这种情况,所述功能模块还可以保存所述第一广播监听器的 描述信息和第一字符串之间的映射关系,以便于所述功能模块在获取发送给第一进程的定向广播时,将该定向广播中的第一字符串转换成第一广播监听器的描述信息之后发送给第一进程。关于接收定向广播该映射关系的具体使用方式,可以参考下文的相关描述,此处不做详述。
通过以上描述可知,在为第一应用注册广播时,由所述功能模块将第二广播注册消息发送给操作系统。由于所述功能模块运行在第一进程,所以利用本方案相当于由第一进程自身为第一进程注册广播。因此,利用本方案,可以避免由核心进程给应用注册广播导致部分应用无法成功注册广播的问题,从而使得各个应用均能够正常注册广播,从而保证各个应用均正常运行。
可以理解的是,第一进程可以向其它进程发送广播消息。传统技术中,第一进程发送的广播消息也需要由核心进程代为转发到操作系统。本申请实施例还提供对应的广播发送方法,在第一进程发送广播消息时,无需由核心进程代为转发到操作系统,而是由第一进程直接发送到操作系统,从而提升了核心进程的稳定性。
参见图2,该图为本申请实施例提供的一种发送广播消息的方法的流程示意图。图2所示的方法,例如可以包括如下S201-S203。
S201:功能模块获取第一进程发送的第一广播消息。
此处提及的功能模块,即为前文所述的“免安装框架中运行在第一进程中的功能模块”。
需要说明的是,第一广播消息可以是定向广播消息,也可以是非定向广播消息,本申请实施例不做具体限定。
当所述第一广播消息是定向广播消息时,所述第一广播消息中可以包括所述第一广播消息的既定接收进程对应的广播监听器的描述信息。为方便描述,将“所述第一广播消息的既定接收进程对应的广播监听器”称为“第二广播监听器”,则所述第一广播消息中包括所述第二广播监听器的描述信息。
S202:功能模块根据所述第一广播消息确定第二广播消息。
S203:功能模块将所述第二广播消息发送给操作系统。
如前所述,由于所述第一应用为免安装应用,因此,所述第一进程生成的第一广播消息中可能包括操作系统无法正确解析的内容,因此,所述功能模块可以根据第一广播消息确定第二广播消息,所述第二广播消息中需要操作系统 解析的内容所述操作系统均能够正确解析。这样一来,所述功能模块将第二广播消息发送给操作系统之后,操作系统即可正常将所述第二广播注册消息发送出去。
在一个示例中,若所述第一广播消息不是定向广播消息,则所述第一广播消息中不操包括作系统无法解析的内容,此时,S202在具体实现时,所述功能模块例如可以直接将所述第一广播消息确定为第二广播消息。
在又一个示例中,若所述第一广播消息是定向广播消息,则所述第一广播消息中可以包括第二广播监听器的描述信息。对于这种情况,所述功能模块可以将所述第一广播消息中的第二广播监听器的描述信息替换成第二字符串,从而得到所述第二广播消息。其中:所述第一进程可以预先生成并保存所述第二广播监听器的描述信息和第二字符串之间的对应关系。这样一来,所述功能模块获取到携带所述第二广播监听器的描述信息的第一广播消息之后,则可以根据该对应关系,确定第二字符串,并进一步将所述第一广播消息中的第二广播监听器的描述信息替换成第二字符串,从而得到所述第二广播消息。
在一个示例中,考虑到若接收所述第二广播消息的进程为独立于第一进程的其它进程,则只有在该接收第二广播消息的进程处于运行状态时,该进程才能够正常接收到该第二广播消息。对于这种情况,所述功能模块在执行S203之前,还可以向所述操作系统的核心进程发送请求消息,所述请求消息用于请求所述核心进程将接收所述第二广播消息的进程拉活。所谓将接收所述第二广播消息的进程拉活,即使得接收所述第二广播消息的进程处于运行状态。当所述功能模块发送所述请求消息之后,可以等待所述核心进程发送的确认消息,其中,所述确认消息用于指示接收所述第二广播消息的进程处于运行状态。可以理解的是,所述功能模块接收到该确认消息之后,则说明接收所述第二广播消息的进程处于运行状态。此时,接收所述第二广播消息的进程则可以正常接收到第二广播消息。当所述功能模块接收到所述确认消息之后,即可执行S203。可以理解的是,接收所述第二广播消息的进程,即为接收所述第一广播消息的进程。
关于所述请求消息所携带的内容,本申请实施例不做具体限定。在一个示例中,所述请求消息例如可以包括接收所述第二广播消息的进程的标识。
关于所述确认消息所携带的内容,本申请实施例不做具体限定。在一个示 例中,所述确认消息中例如可以包括接收所述第二广播消息的进程的标识。在又一个示例中,所述确认消息例如可以包括所述请求消息的标识。
可以理解的是,执行S101-S103之后,所述第一进程即可接收操作系统发送的广播消息。传统技术中,第一进程接收来自于操作系统的广播消息时,需要核心进程进行转发。本申请实施例还提供对应的广播接收方法,第一进程可以直接接收操作系统发送的广播消息,无需经过核心进程转发,从而提升核心进程的稳定性。
参见图3,该图为本申请实施例提供的一种接收广播消息的方法的流程示意图。图3所示的方法,例如可以通过如下S301-S303实现。
S301:功能模块获取操作系统发送的第三广播消息。
此处提及的功能模块,即为前文所述的“免安装框架中运行在第一进程中的功能模块”。
需要说明的是,第三广播消息可以是发送给第一进程的定向广播消息,也可以是非定向广播消息,本申请实施例不做具体限定。
当所述第三广播消息是发送给第一进程的定向广播消息时,所述第三广播消息中可以包括第一字符串。
在一个示例中,所述第三广播消息可以是其它进程例如第二进程发送给操作系统的。第二进程向操作系统发送第三广播消息的具体实现,与第一进程向操作系统发送广播消息的实现方式类似,具体可以参考以上S201-S203的具体描述部分,此处不做详述。
S302:功能模块根据所述第三广播消息确定第四广播消息。
S303:功能模块将所述第四广播消息发送给所述第一进程。
通过以上S101-S103可知,第一进程注册广播时,所述功能模块将所述第一广播监听器的描述信息替换成了第一字符串。因此,若所述第三广播消息是发送给第一进程的定向广播消息,则所述第三广播消息中可以包括所述第一字符串。而此时,第一进程无法正常接收该第三广播消息。为了使得第一进程能够正常接收到该第三广播消息,可以将所述第一字符串替换成第一广播监听器的描述信息。换言之,若所述第三广播消息为发送给第一进程的定向广播消息,则S302在具体实现时,可以将所述第三广播消息中的第一字符串替换成第一广播监听器的描述信息,得到所述第四广播消息。
若第三广播消息不是发送给第一进程的定向广播消息,则所述第一进程可以正常接收所述第三广播消息。对于这种情况,S302在具体实现时,可以将所述第三广播消息确定为第四广播消息。
示例性设备
基于以上实施例提供的方法,本申请实施例还提供了一种装置,以下结合附图介绍该装置。
参见图4,该图为本申请实施例提供的一种注册广播的装置的结构示意图。所述装置400应用于免安装框架中运行在第一进程中的功能模块,所述装置400例如可以具体包括:第一获取单元401、第一确定单元402和第一发送单元403。
第一获取单元401,用于获取所述第一进程发送的第一广播注册消息,所述第一进程为与第一应用对应的进程,所述第一广播注册消息用于为所述第一应用注册广播;
第一确定单元402,用于根据所述第一广播注册消息确定第二广播注册消息,所述第二广播注册消息用于为所述第一应用注册广播;
第一发送单元403,用于将所述第二广播注册消息发送给操作系统。
可选的,所述第一确定单元402,用于:
将所述第一广播注册消息确定为所述第二广播注册消息。
可选的,所述第一确定单元402,用于:
将所述第一广播注册消息中的第一广播监听器的描述信息替换成第一字符串,得到所述第二广播注册消息,第一广播监听器为所述第一进程对应的广播监听器。
可选的,所述装置还包括:
第二获取单元,用于获取所述第一进程发送的第一广播消息;
第二确定单元,用于根据所述第一广播消息确定第二广播消息;
第二发送单元,用于将所述第二广播消息发送给操作系统。
可选的,所述第二确定单元,用于:
所述功能模块将所述第一广播消息确定为所述第二广播消息。
可选的,所述第二确定单元,用于:所述功能模块将所述第一广播消息中的第二广播监听器的描述信息替换成第二字符串,得到所述第二广播消息,所 述第二广播监听器为定向接收所述第一广播消息的进程对应的广播监听器。
可选的,所述装置还包括:
第三发送单元,用于:将所述第二广播消息发送给操作系统之前,若接收所述第二广播消息的进程为独立于所述第一进程的其它进程,则向所述操作系统的核心进程发送请求消息,所述请求消息用于请求所述核心进程将接收所述第二广播消息的进程拉活;
接收单元,用于接收所述核心进程发送的确认消息,所述确认消息用于指示接收所述第二广播消息的进程处于运行状态。
可选的,所述装置还包括:
第三获取单元,用于获取操作系统发送的第三广播消息;
第三确定单元,用于根据所述第三广播消息确定第四广播消息;
第四发送单元,用于将所述第四广播消息发送给所述第一进程。
可选的,所述第三确定单元,用于:
将所述第三广播消息确定为第四广播消息。
可选的,所述第三广播消息中包括第一字符串,所述第三确定单元,用于:
将所述第三广播消息中的第一字符串替换成第一广播监听器的描述信息,得到所述第四广播消息,第一广播监听器为所述第一进程对应的广播监听器。
由于所述装置400是与以上方法实施例提供的方法对应的装置,所述装置400的各个单元的具体实现,均与以上方法实施例为同一构思,因此,关于所述装置400的各个单元的具体实现,可以参考以上方法实施例的描述部分,此处不再赘述。
本申请实施例还提供了一种设备,所述设备包括处理器和存储器;
所述处理器用于执行所述存储器中存储的指令,以使得所述设备执行以上方法实施例任一项所述的方法。
下面参考图5,其示出了适于用来实现本申请实施例的电子设备500的结构示意图。本申请实施例中的电子设备可以包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、PDA(Personal Digital Assistant,个人数字助理)、PAD(portable android device,平板电脑)、PMP(Portable Media Player,便携式多媒体播放器)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字TV(television,电视机)、台式计算机等等的固定终端。图5示 出的电子设备仅仅是一个示例,不应对本申请实施例的功能和使用范围带来任何限制。
如图5所示,电子设备500可以包括处理装置(例如中央处理器、图形处理器等)501,其可以根据存储在只读存储器(ROM)502中的程序或者从存储装置508加载到随机访问存储器(RAM)503中的程序而执行各种适当的动作和处理。在RAM503中,还存储有电子设备500操作所需的各种程序和数据。处理装置501、ROM 502以及RAM 503通过总线504彼此相连。输入/输出(I/O)接口505也连接至总线504。
通常,以下装置可以连接至I/O接口505:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置506;包括例如液晶显示器(LCD)、扬声器、振动器等的输出装置507;包括例如磁带、硬盘等的存储装置508;以及通信装置509。通信装置509可以允许电子设备500与其他设备进行无线或有线通信以交换数据。虽然图5示出了具有各种装置的电子设备500,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。
特别地,根据本申请的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本申请的实施例包括一种计算机程序产品,其包括承载在非暂态计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置509从网络上被下载和安装,或者从存储装置508被安装,或者从ROM502被安装。在该计算机程序被处理装置501执行时,执行本申请实施例的方法中限定的上述功能。
本申请实施例提供的电子设备与上述实施例提供的方法属于同一发明构思,未在本实施例中详尽描述的技术细节可参见上述实施例,并且本实施例与上述实施例具有相同的有益效果。
本申请实施例提供一种计算机可读介质,其上存储有计算机程序,其中,所述程序被处理器执行时实现如上述任一实施例所述的方法。
需要说明的是,本申请上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体 的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本申请中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本申请中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。
在一些实施方式中,客户端、服务器可以利用诸如HTTP(HyperText Transfer Protocol,超文本传输协议)之类的任何当前已知或未来研发的网络协议进行通信,并且可以与任意形式或介质的数字数据通信(例如,通信网络)互连。通信网络的示例包括局域网(“LAN”),广域网(“WAN”),网际网(例如,互联网)以及端对端网络(例如,ad hoc端对端网络),以及任何当前已知或未来研发的网络。
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。
上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备执行上述方法。
可以以一种或多种程序设计语言或其组合来编写用于执行本申请的操作的计算机程序代码,上述程序设计语言包括但不限于面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在 用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。
附图中的流程图和框图,图示了按照本申请各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
描述于本申请实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,单元/模块的名称在某种情况下并不构成对该单元本身的限定,例如,语音数据采集模块还可以被描述为“数据采集模块”。
本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、片上系统(SOC)、复杂可编程逻辑设备(CPLD)等等。
在本申请的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可 擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本申请的其它实施方案。本申请旨在涵盖本申请的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本申请的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本申请的真正范围和精神由下面的权利要求指出。
应当理解的是,本申请并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本申请的范围仅由所附的权利要求来限制
以上所述仅为本申请的较佳实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。

Claims (14)

  1. 一种注册广播的方法,其特征在于,所述方法包括:
    免安装框架中运行在第一进程中的功能模块获取所述第一进程发送的第一广播注册消息,所述第一进程为与第一应用对应的进程,所述第一广播注册消息用于为所述第一应用注册广播;
    所述功能模块根据所述第一广播注册消息确定第二广播注册消息,所述第二广播注册消息用于为所述第一应用注册广播;
    所述功能模块将所述第二广播注册消息发送给操作系统。
  2. 根据权利要求1所述的方法,其特征在于,所述功能模块根据所述第一广播注册消息确定第二广播注册消息,包括:
    所述功能模块将所述第一广播注册消息确定为所述第二广播注册消息。
  3. 根据权利要求1所述的方法,其特征在于,所述功能模块根据所述第一广播注册消息确定第二广播注册消息,包括:
    所述功能模块将所述第一广播注册消息中的第一广播监听器的描述信息替换成第一字符串,得到所述第二广播注册消息,第一广播监听器为所述第一进程对应的广播监听器。
  4. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    所述功能模块获取所述第一进程发送的第一广播消息;
    所述功能模块根据所述第一广播消息确定第二广播消息;
    所述功能模块将所述第二广播消息发送给操作系统。
  5. 根据权利要求4所述的方法,其特征在于,所述功能模块根据所述第一广播消息确定第二广播消息,包括:
    所述功能模块将所述第一广播消息确定为所述第二广播消息。
  6. 根据权利要求4所述的方法,其特征在于,所述功能模块根据所述第一广播消息确定第二广播消息,包括:
    所述功能模块将所述第一广播消息中的第二广播监听器的描述信息替换成第二字符串,得到所述第二广播消息,所述第二广播监听器为定向接收所述第一广播消息的进程对应的广播监听器。
  7. 根据权利要求4所述的方法,其特征在于,所述功能模块将所述第二广播消息发送给操作系统之前,所述方法还包括:
    若接收所述第二广播消息的进程为独立于所述第一进程的其它进程,
    则所述功能模块向所述操作系统的核心进程发送请求消息,所述请求消息用于请求所述核心进程将接收所述第二广播消息的进程拉活;
    所述功能模块接收所述核心进程发送的确认消息,所述确认消息用于指示接收所述第二广播消息的进程处于运行状态。
  8. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    所述功能模块获取操作系统发送的第三广播消息;
    所述功能模块根据所述第三广播消息确定第四广播消息;
    所述功能模块将所述第四广播消息发送给所述第一进程。
  9. 根据权利要求8所述的方法,其特征在于,所述功能模块根据所述第三广播消息确定第四广播消息,包括:
    所述功能模块将所述第三广播消息确定为第四广播消息。
  10. 根据权利要求8所述的方法,其特征在于,所述第三广播消息中包括第一字符串,所述功能模块根据所述第三广播消息确定第四广播消息,包括:
    所述功能模块将所述第三广播消息中的第一字符串替换成第一广播监听器的描述信息,得到所述第四广播消息,第一广播监听器为所述第一进程对应的广播监听器。
  11. 一种注册广播的装置,其特征在于,应用于免安装框架中运行在第一进程中的功能模块,所述装置包括:
    第一获取单元,用于获取所述第一进程发送的第一广播注册消息,所述第一进程为与第一应用对应的进程,所述第一广播注册消息用于为所述第一应用注册广播;
    第一确定单元,用于根据所述第一广播注册消息确定第二广播注册消息,所述第二广播注册消息用于为所述第一应用注册广播;
    第一发送单元,用于将所述第二广播注册消息发送给操作系统。
  12. 一种设备,其特征在于,所述设备包括处理器和存储器;
    所述处理器用于执行所述存储器中存储的指令,以使得所述设备执行如权利要求1至10中任一项所述的方法。
  13. 一种计算机可读存储介质,其特征在于,包括指令,所述指令指示设备执行如权利要求1至10中任一项所述的方法。
  14. 一种计算机程序产品,其特征在于,当所述计算机程序产品在计算机上运行时,使得计算机执行如权利要求1至10中任一项所述的方法。
PCT/CN2023/070074 2022-01-07 2023-01-03 一种注册广播的方法及装置 WO2023131109A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210017619.8 2022-01-07
CN202210017619.8A CN116450371A (zh) 2022-01-07 2022-01-07 一种注册广播的方法及装置

Publications (1)

Publication Number Publication Date
WO2023131109A1 true WO2023131109A1 (zh) 2023-07-13

Family

ID=87073226

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/070074 WO2023131109A1 (zh) 2022-01-07 2023-01-03 一种注册广播的方法及装置

Country Status (2)

Country Link
CN (1) CN116450371A (zh)
WO (1) WO2023131109A1 (zh)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110179121A1 (en) * 2010-01-20 2011-07-21 International Business Machines Corporation Broadcast Message Management
CN104461583A (zh) * 2014-12-30 2015-03-25 北京奇虎科技有限公司 一种调用资源类应用的方法、装置和移动终端
CN106953852A (zh) * 2017-03-10 2017-07-14 广东欧珀移动通信有限公司 广播接收器的注册方法、装置和终端设备
CN107070670A (zh) * 2017-03-10 2017-08-18 广东欧珀移动通信有限公司 控制广播发送者发送广播消息的方法、装置和终端设备
CN110096380A (zh) * 2019-05-08 2019-08-06 苏州浪潮智能科技有限公司 Android内部通讯方法、系统、装置及存储介质
CN112163193A (zh) * 2020-09-10 2021-01-01 珠海市魅族科技有限公司 一种广播注册控制方法、装置、设备及介质

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110179121A1 (en) * 2010-01-20 2011-07-21 International Business Machines Corporation Broadcast Message Management
CN104461583A (zh) * 2014-12-30 2015-03-25 北京奇虎科技有限公司 一种调用资源类应用的方法、装置和移动终端
CN106953852A (zh) * 2017-03-10 2017-07-14 广东欧珀移动通信有限公司 广播接收器的注册方法、装置和终端设备
CN107070670A (zh) * 2017-03-10 2017-08-18 广东欧珀移动通信有限公司 控制广播发送者发送广播消息的方法、装置和终端设备
CN110096380A (zh) * 2019-05-08 2019-08-06 苏州浪潮智能科技有限公司 Android内部通讯方法、系统、装置及存储介质
CN112163193A (zh) * 2020-09-10 2021-01-01 珠海市魅族科技有限公司 一种广播注册控制方法、装置、设备及介质

Also Published As

Publication number Publication date
CN116450371A (zh) 2023-07-18

Similar Documents

Publication Publication Date Title
WO2021077833A1 (zh) 信息推送方法、设备、电子设备及计算机可读存储介质
WO2021012952A1 (zh) 消息处理方法、装置及电子设备
WO2020248745A1 (zh) 用户界面中字符的显示方法、装置、电子设备及存储介质
US11861381B2 (en) Icon updating method and apparatus, and electronic device
WO2023093634A1 (zh) 数据存储方法、装置、可读介质及电子设备
WO2022127620A1 (zh) 语音唤醒方法、装置、电子设备及存储介质
WO2023202276A1 (zh) 域名解析请求的处理方法、装置、设备、介质和程序产品
WO2023179509A1 (zh) 数据访问装置、方法、可读介质和电子设备
WO2023193574A1 (zh) 投屏方法、系统、设备及存储介质
WO2023029850A1 (zh) 一种数据处理方法、装置、电子设备和介质
CN112732459A (zh) 统一接收广播消息的方法和设备
CN113760536A (zh) 数据缓存方法、装置、电子设备和计算机可读介质
WO2022116819A1 (zh) 模型训练方法及装置、机器翻译方法及装置、设备、存储介质
CN111968648A (zh) 语音识别方法、装置、可读介质及电子设备
WO2021147466A1 (zh) 消息处理方法、装置及电子设备
WO2023131109A1 (zh) 一种注册广播的方法及装置
WO2023207788A1 (zh) 信息处理方法、装置、电子设备和存储介质
CN112968871A (zh) 应用程序的登录方法、装置、可读介质和电子设备
WO2023045694A1 (zh) 数据传输方法、装置、可读介质及电子设备
WO2023134509A1 (zh) 视频推流方法、装置、终端设备及存储介质
WO2023083367A1 (zh) 文件后台续传方法、装置、存储介质及电子设备
WO2023072070A1 (zh) 显示控制方法、装置和电子设备
US20240120991A1 (en) Method and apparatus for synchronizing time by parsing satellite navigation data
WO2022206254A1 (zh) so文件的修复方法、装置、设备及存储介质
WO2023273576A1 (zh) 异常请求处理方法、装置、电子设备和存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23736974

Country of ref document: EP

Kind code of ref document: A1