CN116302142A - Lifecycle event management method, lifecycle event management device, storage medium, and electronic apparatus - Google Patents

Lifecycle event management method, lifecycle event management device, storage medium, and electronic apparatus Download PDF

Info

Publication number
CN116302142A
CN116302142A CN202111565125.5A CN202111565125A CN116302142A CN 116302142 A CN116302142 A CN 116302142A CN 202111565125 A CN202111565125 A CN 202111565125A CN 116302142 A CN116302142 A CN 116302142A
Authority
CN
China
Prior art keywords
application
event
parasitic
host application
life cycle
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.)
Pending
Application number
CN202111565125.5A
Other languages
Chinese (zh)
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.)
Beijing Youzhuju Network Technology Co Ltd
Original Assignee
Beijing Youzhuju Network Technology 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 Beijing Youzhuju Network Technology Co Ltd filed Critical Beijing Youzhuju Network Technology Co Ltd
Priority to CN202111565125.5A priority Critical patent/CN116302142A/en
Priority to PCT/CN2022/126729 priority patent/WO2023116167A1/en
Publication of CN116302142A publication Critical patent/CN116302142A/en
Pending legal-status Critical Current

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/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • 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/445Program loading or initiating
    • 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/445Program loading or initiating
    • G06F9/44594Unloading
    • 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
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The disclosure relates to a lifecycle event management method, a lifecycle event management apparatus, a storage medium, and an electronic device, and relates to the field of computer technology, the method comprising the steps of: and acquiring a life cycle event sent by the operating system to the parasitic application running on the host application, forwarding the life cycle event to the parasitic application and the host application respectively, controlling the parasitic application to execute the life cycle event and controlling the host application to execute a business function matched with the life cycle event. Therefore, the original life cycle function call logic of the parasitic application can be blocked by intercepting the life cycle event which is triggered by the operating system and needs to be executed by the parasitic application, and the intercepted life cycle event is forwarded to the parasitic application and the host application, so that the host application can sense the life cycle event executed by the parasitic application when the life cycle event is executed by the parasitic application, and the host application simultaneously executes the business function matched with the life cycle event.

Description

Lifecycle event management method, lifecycle event management device, storage medium, and electronic apparatus
Technical Field
The present disclosure relates to the field of computer technology, and in particular, to a lifecycle event management method, apparatus, storage medium, and electronic device.
Background
With the popularization of applications of mobile terminals such as smart phones, the applications that smart phones can support are more and more, and the functions are more and more powerful. In the related art, in order to make the use of an application program more convenient for a user, a parasitic application has been developed. The parasitic application is an application program that can be used on the host application without downloading an installation, and the host application provides an operating environment required for the parasitic application to operate, such as running the parasitic application through a sandbox, without installing a registration in the system. However, since the parasitic application runs in a sandbox environment of the host application, how to manage the lifecycle of the parasitic application becomes a technical problem to be solved.
Disclosure of Invention
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
In a first aspect, the present disclosure provides a lifecycle event management method, comprising:
acquiring a life cycle event sent by an operating system to a parasitic application running on a host application;
forwarding the lifecycle events to the parasitic application and the host application, respectively;
controlling the parasitic application to execute the life cycle event and controlling the host application to execute a business function matched with the life cycle event.
In a second aspect, the present disclosure provides a lifecycle event management apparatus comprising:
an acquisition module configured to acquire lifecycle events sent by an operating system to a parasitic application running on a host application;
a forwarding module configured to forward the lifecycle event to the parasitic application and the host application, respectively;
and the control module is configured to control the parasitic application to execute the life cycle event and control the host application to execute the business function matched with the life cycle event.
In a third aspect, the present disclosure provides a computer readable medium having stored thereon a computer program which when executed by a processing device performs the steps of the method of the first aspect.
In a fourth aspect, the present disclosure provides an electronic device comprising:
a storage device having a computer program stored thereon;
processing means for executing said computer program in said storage means to carry out the steps of the method of the first aspect.
Based on the technical scheme, the original life cycle function call logic of the parasitic application can be blocked by intercepting the life cycle event which is triggered by the operating system and needs to be executed by the parasitic application, and the intercepted life cycle event is forwarded to the parasitic application and the host application, so that the host application can sense the life cycle event executed by the parasitic application when the parasitic application executes the life cycle event, and the host application simultaneously executes the business function matched with the life cycle event.
Additional features and advantages of the present disclosure will be set forth in the detailed description which follows.
Drawings
The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by reference to the following detailed description when taken in conjunction with the accompanying drawings. The same or similar reference numbers will be used throughout the drawings to refer to the same or like elements. It should be understood that the figures are schematic and that elements and components are not necessarily drawn to scale. In the drawings:
FIG. 1 is a flow diagram of a lifecycle event management method, provided in accordance with an exemplary embodiment;
FIG. 2 is a flow chart of a lifecycle event management method, provided in accordance with another exemplary embodiment;
FIG. 3 is a schematic diagram providing lifecycle event management, according to an exemplary embodiment;
FIG. 4 is a flow chart providing a lifecycle event management method, according to yet another exemplary embodiment;
FIG. 5 is a schematic diagram of a modular connection providing a lifecycle event management apparatus, according to yet another exemplary embodiment;
fig. 6 is a schematic diagram of an electronic device according to an exemplary embodiment.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure have been shown in the accompanying drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order and/or performed in parallel. Furthermore, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "including" and variations thereof as used herein are intended to be open-ended, i.e., including, but not limited to. The term "based on" is based at least in part on. The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments. Related definitions of other terms will be given in the description below.
It should be noted that the terms "first," "second," and the like in this disclosure are merely used to distinguish between different devices, modules, or units and are not used to define an order or interdependence of functions performed by the devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the various devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
For ease of understanding, the following description is directed to terms related to embodiments of the present disclosure.
Operating system: an Operating System (OS) is a computer program that manages computer hardware and software resources. The operating system needs to handle basic transactions such as managing and configuring memory, prioritizing the supply and demand of system resources, controlling input devices and output devices, operating networks, and managing file systems. The operating system also provides an operator interface for the user to interact with the system. In the disclosed embodiments, the operating system may be an Android (Android) operating system, an apple operating system (iphone Operation System, IOS), a hong operating system, and so forth.
Host application: the host application may be simply referred to as a host, and may be used to represent an application body that provides a running environment for the integrated module, for example, taking a host application running in a client as a social application, where the module of the applet engine is integrated, the social application may have the ability to open and expose the applet. For another example, taking a host application running in a client as an installation-free platform, the installation-free platform is integrated with an installation-free framework (engine) that can run other native applications.
Parasitic application: a parasitic application refers to an application program that runs depending on the running environment provided by the host application, subject to the host application.
Lifecycle events: lifecycle events, also called lifecycle functions, refer to a series of executive functions that pass from creation to destruction of an object.
An Instrumentation object: an Instrumentation object is an object used to monitor the interaction of an application with a system that is instantiated before all components of the application.
Hook function: a hook function is a piece of program that processes messages, and is suspended into the system by a system call. Whenever a particular message is sent, the hooking function captures the message before the destination window is not reached, i.e., the hooking function gains control first. In this case, the hook function may process (change) the message, may continue to transfer the message without processing the message, or may forcibly end the transfer of the message.
Fig. 1 is a flow diagram of a lifecycle event management method, provided in accordance with an exemplary embodiment. The lifecycle event management method disclosed in this embodiment may be executed by an electronic device, and in particular, may be executed by a lifecycle event management apparatus, where the apparatus may be implemented in software and/or hardware and configured in the electronic device. Referring to fig. 1, a lifecycle event management method provided by an embodiment of the present disclosure may include the following steps.
S110, acquiring life cycle events sent by an operating system to a parasitic application running on a host application.
Here, the lifecycle event may be a lifecycle function such as callActivityOnCreate, callActivityOnstart, callActivityOnResume, callActivityOnPause, callActivityOnStop, callActivityOnDestroy.
Wherein the installation-free framework (engine) of the host application receives a lifecycle event triggered by the operating system that requires execution of the parasitic application, and then intercepts the lifecycle event in the installation-free framework. It should be appreciated that each page of the parasitic application provides a lifecycle function (processing function) at a critical point in time from open to closed by the operating system. In general, an operating system triggered lifecycle event passes the lifecycle event to the installation-free framework of the host application through Instrumentation of the operating system, and then the host application passes the lifecycle event to the parasitic application through Instrumentation of its installation-free framework, and the parasitic application invokes the lifecycle function of the corresponding lifecycle event, executing the corresponding lifecycle event. However, in the embodiments of the present disclosure, in the installation-free framework of the host application, lifecycle events sent by the operating system to the parasitic application are intercepted and no longer forwarded directly to the parasitic application.
It will be appreciated that acquiring a lifecycle event that an operating system triggered spurious application needs to execute refers to interrupting the spurious application's original lifecycle function call logic. The electronic device may proxy, via a proxy program, the Instrumentation of the installation-free framework of the host application to obtain in the installation-free framework lifecycle events that the parasitic application triggered by the operating system needs to execute.
And S120, forwarding the life cycle event to the parasitic application and the host application respectively.
After intercepting the lifecycle event that the parasitic application triggered by the operating system needs to execute, the electronic device forwards the lifecycle event to the parasitic application and the host application, so that the host application can sense the lifecycle event that the parasitic application needs to execute.
S130, controlling the parasitic application to execute the life cycle event and controlling the host application to execute the business function matched with the life cycle event.
Here, after forwarding the lifecycle event to the parasitic application and the host application, respectively, the parasitic application calls a corresponding lifecycle function in response to the lifecycle event, and the host application executes a business function matched with the lifecycle event. In some embodiments, the service functions may have a one-to-one correspondence with the lifecycle events, and when the host application senses the lifecycle events to be executed by the parasitic application, the corresponding service functions are determined according to the lifecycle events.
Illustratively, the business function may include one of a popup window matching the lifecycle event, a floating window matching the lifecycle event, and a countdown component matching the lifecycle event.
The popup window refers to a window which opens a webpage and an application program is automatically popped up. For example, when the lifecycle event is displaying advertisement content in a page of the parasitic application, the host application displays a pop-window in the host application in response to the lifecycle event, the content of the pop-window being "click-through-free" to coordinate with the lifecycle event of the parasitic application.
A floating window refers to floating a movable window on the surface of an application in order to open different applications. For example, when the lifecycle event is an interface that temporarily exits the parasitic application, the host application displays a hover window in response to the lifecycle event through which the user can return back to the parasitic application to coordinate with the lifecycle event of the parasitic application.
The countdown component refers to a countdown clock. For example, when the lifecycle event is that the parasitic application exits the current page, the host application displays a countdown component to count down the time of the page exit in response to the lifecycle event.
Therefore, the original life cycle function call logic of the parasitic application can be blocked by intercepting the life cycle event which is triggered by the operating system and needs to be executed by the parasitic application, and the intercepted life cycle event is forwarded to the parasitic application and the host application, so that the host application can sense the life cycle event executed by the parasitic application when the life cycle event is executed by the parasitic application, and the host application simultaneously executes the business function matched with the life cycle event.
Fig. 2 is a flow chart of a lifecycle event management method, provided in accordance with another exemplary embodiment. The lifecycle event management method disclosed in this embodiment may be executed by an electronic device, and in particular, may be executed by a lifecycle event management apparatus, where the apparatus may be implemented in software and/or hardware and configured in the electronic device. Referring to fig. 2, lifecycle event management provided by embodiments of the present disclosure may include the following steps.
S210, obtaining an Instrumentation object of the host application.
Here, the host Application's Instrumentation object may track the lifecycle of applications and activities. For example, callActivityOnCreate, callApplicationOnCreate, newActivity, callActivityOnNewIntent, etc. call the corresponding method of the Instrumentation object first in all lifecycle calls of Application and Activity.
In some embodiments, the Instrumentation object of the host application may be hooked through a hook function running in the virtual machine.
The virtual machine may be a JVM (Java Virtual Machine ) or an ART virtual machine.
It should be appreciated that the Instrumentation object of the host application may be hooked directly by a hook function running in the virtual machine without knowing the source code of the installation-free framework of the host application.
S220, constructing a first proxy object based on the Instrumentation object.
Here, since the first proxy object is built based on the Instrumentation object, the first proxy object inherits the method that the Instrumentation object has in place, i.e., the first proxy object has a function that the Instrumentation object sends a lifecycle event to the parasitic application. It should be noted that the first proxy object is constructed by adding a predetermined judgment method on the basis of the Instrumentation object. For example, the first proxy object is configured to receive a lifecycle event that needs to be executed by a parasitic application triggered by an operating system, and forward the lifecycle event to the parasitic application and/or the host application if the lifecycle event meets a preset condition.
S230, replacing the Instrumentation object of the host application with the first proxy object.
Here, replacing the Instrumentation object in the install-free framework of the host application with the first proxy object is to insert the first proxy object into the install-free framework where the Instrumentation object is located. In this way, the first proxy object can be guaranteed to be effective, and interference to the Instrumentation logic of the installation-free framework itself can be avoided.
It is understood that steps S210 to S230 are actually performing HOOK processing on the Instrumentation object of the host application so that the Instrumentation object after the HOOK processing can execute a preset method.
S240, acquiring a life cycle event sent to the parasitic application by the operating system through the first proxy object.
Here, since the first proxy object is constructed based on the Instrumentation object, the first proxy object inherits the method of the Instrumentation object, and thus the first proxy object may receive a lifecycle event that the parasitic application triggered by the operating system needs to execute.
S250, forwarding the life cycle event to the parasitic application and the host application through the first proxy object.
Here, after receiving a lifecycle event sent by the operating system and requiring execution of the parasitic application, the first proxy object forwards the lifecycle event to the parasitic application and the host application at the same time.
It will be appreciated that the first proxy object is configured to receive a lifecycle event that the parasitic application triggered by the operating system needs to execute, and forward the lifecycle event to the parasitic application and the host application.
S260, controlling the parasitic application to execute the life cycle event and controlling the host application to execute the business function matched with the life cycle event.
Here, the specific embodiment of step S260 may refer to step S130, which is not described in detail herein.
The above embodiment will be described in detail with reference to fig. 3.
Fig. 3 is a schematic diagram providing lifecycle event management, according to an exemplary embodiment. As shown in fig. 3, the operating system sends a lifecycle event that the parasitic application needs to execute to a first proxy object running in the virtual machine, and after receiving the lifecycle event, the first proxy object forwards the lifecycle event to the parasitic application through an installation-free framework (engine) of the host application. At the same time, the first proxy object forwards the lifecycle event to the host application to enable the host application to perceive the lifecycle event of the spurious application execution.
Therefore, through the first proxy object constructed based on the Instrumentation object of the host application, the life cycle event which is required to be executed by the parasitic application can be forwarded to the parasitic application and the host application, so that the host application can sense the life cycle event executed by the parasitic application and execute the business function matched with the life cycle event when the parasitic application executes the life cycle event.
In some embodiments, the electronic device may further acquire an Instrumentation object of the operating system, and construct a second proxy object based on the Instrumentation object of the operating system, where the second proxy object is configured to receive a lifecycle event sent by the operating system to the host application and forward the lifecycle event to the host application, and then replace the Instrumentation object of the operating system with the second proxy object, so as to acquire the lifecycle event sent by the operating system to the host application through the second proxy object, and determine whether to send the lifecycle event to the host application according to an running state of the host application.
The construction process of the second proxy object is consistent with the first proxy object and will not be described in detail herein.
Wherein the Instrumentation object of the operating system is used to communicate with the host application, and the host application invokes the lifecycle function through the operating system Instrumentation object. By performing HOOK processing on an Instrumentation object of an operating system and adding a preset judging method to the Instrumentation object of the operating system to construct a second proxy object, the second proxy object can be enabled to receive a life cycle event sent by the operating system to a host application and can also determine whether to send the life cycle event needing to be executed by the host application to the host application according to the running state of the host application.
Fig. 4 is a flow chart of a method of lifecycle event management according to yet another exemplary embodiment. As shown in fig. 4, the lifecycle management method may include the following steps.
In step S410, lifecycle events sent by the operating system to the parasitic application running on the host application are obtained.
Here, the specific embodiment of step S410 may refer to step S110, and will not be described in detail herein.
Step S420, determining whether the current running state of the parasitic application matches a preset running state, where the preset running state is a running state required by the parasitic application when executing the acquired lifecycle event.
Here, the preset running state refers to a running state required by the parasitic application when executing the acquired lifecycle event, that is, the preset running state is used to characterize whether the parasitic application has an execution environment for executing the lifecycle event. If the current running state of the parasitic application is not consistent with the preset running state, the parasitic application does not have an execution environment for executing the life cycle event currently; if the current running state of the parasitic application accords with the preset running state, the parasitic application is indicated to have an executing environment for executing the life cycle event.
In some embodiments, the current running state of the parasitic application may be obtained by the first proxy object, and the obtained current running state is compared with the preset running state corresponding to the obtained lifecycle event, so as to determine whether the current running state matches the preset running state.
It will be appreciated that different lifecycle events correspond to different preset operating states. For example, when a page is created or closed, the execution environments required by the page are different, and the corresponding preset running states are different.
Step S430, stopping sending the life cycle event to the parasitic application and sending the result of stopping sending the life cycle event to the parasitic application to the host application, in the case that the current running state does not match the preset running state.
Here, if the current running state of the parasitic application does not match the preset running state corresponding to the lifecycle event, it means that the parasitic application does not have an execution environment for executing the lifecycle event, and therefore, the forwarding of the lifecycle event to the parasitic application is stopped to block the logic of the parasitic application calling the lifecycle event. Meanwhile, the result of stopping forwarding the life cycle event to the parasitic application can be forwarded to the host application, so that the host application can sense the result of failure of the parasitic application to call the corresponding life cycle event. For example, when executing a lifecycle event of closing a page, the page needs to conform to a preset running state of the closing page, and if not, a lifecycle function corresponding to the lifecycle event cannot be called.
Step S440, controlling the host application to execute a business function matching with a result of stopping forwarding the lifecycle event to the parasitic application.
Here, after sensing that the parasitic application has failed to invoke the corresponding lifecycle event, the host application may perform a business function that matches the result of stopping forwarding the lifecycle event to the parasitic application. Wherein the business function that matches the result of stopping forwarding the lifecycle event to the parasitic application may be a pop-up window, a floating window, a countdown component, etc. that matches the result of stopping forwarding the lifecycle event to the parasitic application.
Therefore, under the condition that the current running state of the parasitic application is inconsistent with the preset running state corresponding to the life cycle event, the life cycle event is intercepted, the original calling logic of the parasitic application can be blocked, and the host application can perceive the failure result of the parasitic application to call the life cycle function, so that the corresponding business function is executed, and the preset functional requirement is realized.
Fig. 5 is a schematic diagram of module connections of a lifecycle event management apparatus according to yet another exemplary embodiment. As shown in fig. 5, the lifecycle management apparatus may include an acquisition module 501, a forwarding module 502, and a control module 503. Wherein:
an acquisition module 501 configured to acquire lifecycle events sent by an operating system to a parasitic application running on a host application;
a forwarding module 502 configured to forward the lifecycle event to the parasitic application and the host application, respectively;
a control module 503 configured to control the parasitic application to execute the lifecycle event and to control the host application to execute a business function that matches the lifecycle event.
Optionally, the obtaining module 501 includes:
a first acquisition unit configured to acquire an Instrumentation object of the host application;
a first program creation unit configured to construct a first proxy object based on the Instrumentation object;
a first program replacement unit configured to replace an Instrumentation object of the host application with the first proxy object;
and the first event acquisition unit is configured to acquire a life cycle event sent to the parasitic application by the operating system through the first proxy object.
The forwarding module 502 is specifically configured to: forwarding, by the first proxy object, the lifecycle event to the parasitic application and the host application, respectively.
Optionally, the first obtaining unit is specifically configured to: the host application's Instrumentation object is hooked by a hook function running in the virtual machine.
Optionally, the apparatus further comprises:
the judging module is configured to judge whether the current running state of the parasitic application accords with a preset running state, wherein the preset running state is a running state required by the parasitic application when the acquired life cycle event is executed;
the forwarding the lifecycle event to the parasitic application and the host application, respectively, includes:
the forwarding module 502 is specifically configured to: stopping sending the life cycle event to the parasitic application and sending a result of stopping sending the life cycle event to the parasitic application to the host application under the condition that the current running state is not consistent with the preset running state;
the control module 503 is specifically configured to: controlling the host application to perform a business function that matches the result of stopping forwarding the lifecycle event to the parasitic application.
Optionally, the apparatus further comprises:
a second acquisition unit configured to acquire an Instrumentation object of the operating system;
a second program creation unit configured to construct a second proxy object based on an Instrumentation object of the operating system, where the second proxy object is configured to receive a lifecycle event sent by the operating system to the host application and forward the lifecycle event to the host application;
a second program replacement unit configured to replace an Instrumentation object of the operating system with the second proxy object;
and the second event acquisition unit is configured to acquire the life cycle event sent to the host application by the operating system through the second proxy object, and determine whether to send the life cycle event to the host application according to the running state of the host application.
Optionally, the service function includes one of:
a popup window matching the lifecycle event, a floating window matching the lifecycle event, a countdown component matching the lifecycle event.
The detailed description of the respective functional modules of the apparatus in the foregoing embodiments has been given in the section of the method, and will not be repeated here.
Referring now to fig. 6, a schematic diagram of an electronic device 600 suitable for use in implementing embodiments of the present disclosure is shown. The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 6 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
As shown in fig. 6, the electronic device 600 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 601, which may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
In general, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, and the like; an output device 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, magnetic tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While fig. 6 shows an electronic device 600 having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a non-transitory computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via communication means 609, or from storage means 608, or from ROM 602. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by the processing device 601.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some implementations, the electronic device may communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol ), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the internet (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 networks.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring a life cycle event sent by an operating system to a parasitic application running on a host application; forwarding the lifecycle events to the parasitic application and the host application, respectively; controlling the parasitic application to execute the life cycle event and controlling the host application to execute a business function matched with the life cycle event.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including, but not limited to, an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming 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. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, 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 the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present disclosure may be implemented in software or hardware. The name of a module does not in some cases define the module itself.
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by persons skilled in the art that the scope of the disclosure referred to in this disclosure is not limited to the specific combinations of features described above, but also covers other embodiments which may be formed by any combination of features described above or equivalents thereof without departing from the spirit of the disclosure. Such as those described above, are mutually substituted with the technical features having similar functions disclosed in the present disclosure (but not limited thereto).
Moreover, although operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are example forms of implementing the claims. The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.

Claims (10)

1. A lifecycle event management method, comprising:
acquiring a life cycle event sent by an operating system to a parasitic application running on a host application;
forwarding the lifecycle events to the parasitic application and the host application, respectively;
controlling the parasitic application to execute the life cycle event and controlling the host application to execute a business function matched with the life cycle event.
2. The lifecycle event management method of claim 1, wherein the acquiring the lifecycle event sent by the operating system to the parasitic application running on the host application comprises:
obtaining an Instrumentation object of the host application;
constructing a first proxy object based on the Instrumentation object;
replacing an Instrumentation object of the host application with the first proxy object;
acquiring a life cycle event sent to the parasitic application by the operating system through the first proxy object;
said forwarding said lifecycle event to said parasitic application and said host application, respectively, comprising:
forwarding, by the first proxy object, the lifecycle event to the parasitic application and the host application, respectively.
3. The lifecycle event management method of claim 2, wherein the obtaining the Instrumentation object of the host application comprises:
the host application's Instrumentation object is hooked by a hook function running in the virtual machine.
4. A lifecycle event management method according to any one of claims 1 to 3, further comprising:
judging whether the current running state of the parasitic application accords with a preset running state or not, wherein the preset running state is a running state required by the parasitic application when executing the acquired life cycle event;
the forwarding the lifecycle event to the parasitic application and the host application, respectively, includes:
stopping sending the life cycle event to the parasitic application and sending a result of stopping sending the life cycle event to the parasitic application to the host application under the condition that the current running state is not consistent with the preset running state;
the controlling the parasitic application to execute the life cycle event and the host application to execute business functions matched with the life cycle event comprises
Controlling the host application to perform a business function that matches the result of stopping forwarding the lifecycle event to the parasitic application.
5. A lifecycle event management method according to any one of claims 1 to 3, further comprising:
acquiring an Instrumentation object of the operating system;
constructing a second proxy object based on the Instrumentation object of the operating system, wherein the second proxy object is used for receiving a life cycle event sent by the operating system to the host application and forwarding the life cycle event to the host application;
replacing an Instrumentation object of the operating system with the second proxy object;
and acquiring a life cycle event sent to the host application by the operating system through the second proxy object, and determining whether to send the life cycle event to the host application according to the running state of the host application.
6. The lifecycle event management method as recited in claim 1, wherein the business function comprises one of:
a popup window matching the lifecycle event, a floating window matching the lifecycle event, a countdown component matching the lifecycle event.
7. A lifecycle event management apparatus, comprising:
an acquisition module configured to acquire lifecycle events sent by an operating system to a parasitic application running on a host application;
a forwarding module configured to forward the lifecycle event to the parasitic application and the host application, respectively;
and the control module is configured to control the parasitic application to execute the life cycle event and control the host application to execute the business function matched with the life cycle event.
8. The lifecycle event management apparatus of claim 7, wherein the acquisition module comprises:
an acquisition unit configured to acquire an Instrumentation object of the host application;
a program creation unit configured to construct a first proxy object based on the Instrumentation object;
a program replacement unit configured to replace an Instrumentation object of the host application with the first proxy object;
an event acquisition unit configured to acquire, by the first proxy object, a lifecycle event transmitted by the operating system to the parasitic application;
the forwarding module is specifically configured to: forwarding, by the first proxy object, the lifecycle event to the parasitic application and the host application, respectively.
9. A computer readable medium on which a computer program is stored, characterized in that the program, when being executed by a processing device, carries out the steps of the method according to any one of claims 1-6.
10. An electronic device, comprising:
a storage device having a computer program stored thereon;
processing means for executing said computer program in said storage means to carry out the steps of the method according to any one of claims 1-6.
CN202111565125.5A 2021-12-20 2021-12-20 Lifecycle event management method, lifecycle event management device, storage medium, and electronic apparatus Pending CN116302142A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202111565125.5A CN116302142A (en) 2021-12-20 2021-12-20 Lifecycle event management method, lifecycle event management device, storage medium, and electronic apparatus
PCT/CN2022/126729 WO2023116167A1 (en) 2021-12-20 2022-10-21 Lifecycle event management method and apparatus, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111565125.5A CN116302142A (en) 2021-12-20 2021-12-20 Lifecycle event management method, lifecycle event management device, storage medium, and electronic apparatus

Publications (1)

Publication Number Publication Date
CN116302142A true CN116302142A (en) 2023-06-23

Family

ID=86776633

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111565125.5A Pending CN116302142A (en) 2021-12-20 2021-12-20 Lifecycle event management method, lifecycle event management device, storage medium, and electronic apparatus

Country Status (2)

Country Link
CN (1) CN116302142A (en)
WO (1) WO2023116167A1 (en)

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9141450B2 (en) * 2009-08-25 2015-09-22 Adobe Systems Incorporated Embedded application communication
CN105550017A (en) * 2015-12-11 2016-05-04 北京奇虎科技有限公司 Method, apparatus and system for performing virtual input control for application
CN110321189B (en) * 2019-04-03 2022-10-11 上海连尚网络科技有限公司 Method and equipment for presenting hosted program in hosted program
CN112492091B (en) * 2019-08-21 2022-03-25 腾讯科技(深圳)有限公司 Application processing method and device, terminal and storage medium
CN112836153A (en) * 2019-11-25 2021-05-25 百度在线网络技术(北京)有限公司 Page processing method and device for hosted application, electronic device and readable storage medium

Also Published As

Publication number Publication date
WO2023116167A1 (en) 2023-06-29

Similar Documents

Publication Publication Date Title
CN111090536B (en) Method, device, medium and electronic equipment for acquiring memory leakage information
CN109582310B (en) Data processing method and device, electronic equipment and computer readable storage medium
CN111581555B (en) Document loading method, device, equipment and storage medium
CN110471738B (en) Theme switching method and device of application program, electronic equipment and storage medium
CN113835992B (en) Memory leakage processing method and device, electronic equipment and computer storage medium
CN111367516A (en) Application interface generation method and device and electronic equipment
CN111400068B (en) Interface control method and device, readable medium and electronic equipment
CN111538717B (en) Data processing method, device, electronic equipment and computer readable medium
CN114968776A (en) Application program detection method and device
CN116302142A (en) Lifecycle event management method, lifecycle event management device, storage medium, and electronic apparatus
CN111625326B (en) Task pipeline execution method and device and electronic equipment
CN113515299A (en) Software development kit SDK hot upgrading method, device, equipment and storage medium
CN111240801A (en) Method, device, medium and electronic equipment for generating heap memory snapshot file
CN113392120A (en) Method and device for acquiring execution information of SQLite
CN114398233B (en) Load abnormality detection method and device, server and storage medium
CN112905167B (en) Application operation method and device and electronic equipment
CN110750242B (en) File deployment method, system, medium and electronic equipment
CN113448550B (en) Method and device for realizing collection management of classes, electronic equipment and computer medium
CN110099122B (en) Method and apparatus for sending network request
CN114816609A (en) Method and device for displaying window, electronic equipment and computer readable storage medium
CN116776396A (en) Data processing method, device, equipment, vehicle and storage medium
CN117093284A (en) Plug-in calling method, device, medium and electronic equipment
CN116339846A (en) Process management method and device, storage medium and electronic equipment
CN117311838A (en) File processing method, device, equipment and storage medium based on dynamic plug-in
CN116594630A (en) File generation method, device, medium and electronic equipment

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