CN106708604B - Processing method and device for asynchronous call mechanism of android application - Google Patents

Processing method and device for asynchronous call mechanism of android application Download PDF

Info

Publication number
CN106708604B
CN106708604B CN201611249874.6A CN201611249874A CN106708604B CN 106708604 B CN106708604 B CN 106708604B CN 201611249874 A CN201611249874 A CN 201611249874A CN 106708604 B CN106708604 B CN 106708604B
Authority
CN
China
Prior art keywords
application
component
android
message
virtual machine
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.)
Active
Application number
CN201611249874.6A
Other languages
Chinese (zh)
Other versions
CN106708604A (en
Inventor
任太胜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Hongxiang Technical Service Co Ltd
Original Assignee
Beijing Qihoo 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 Qihoo Technology Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201611249874.6A priority Critical patent/CN106708604B/en
Publication of CN106708604A publication Critical patent/CN106708604A/en
Application granted granted Critical
Publication of CN106708604B publication Critical patent/CN106708604B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • 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/547Remote procedure calls [RPC]; Web services
    • 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/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances

Landscapes

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

Abstract

The invention discloses a processing method and a device for an asynchronous calling mechanism of an android application, wherein the processing method comprises the following steps: constructing a virtual machine environment, and putting the body-divided applications of one or more designated android applications in the android system into a virtual machine, so that the body-divided application of each designated android application can run in parallel with the corresponding designated android application; and carrying out proxy processing on the asynchronous call event of the sub-body application of the specified android application in the virtual machine, so that the sub-body application of the specified android application in the virtual machine can execute the operation corresponding to the asynchronous call event. According to the method and the device, the proxy processing is carried out on the asynchronous call event of the body-splitting application of the designated android application in the virtual machine, so that the body-splitting application of the designated android application in the virtual machine can execute the operation corresponding to the asynchronous call event, the parallel operation of the designated android application and the corresponding body-splitting application in an android system can be perfectly realized, and even the realization of an asynchronous call mechanism is very smooth.

Description

Processing method and device for asynchronous call mechanism of android application
Technical Field
The invention relates to the technical field of internet, in particular to a processing method and a processing device for an asynchronous calling mechanism of an android application.
Background
In the prior art, parallel operation of multiple identical android applications cannot be realized in an android system, and the reason is as follows: when each android application is installed in an android system, configuration information in a configuration file in an installation package of the android application is registered in the android system, the android system acquires the existence and running related information of the android application through the registration information, and on the basis that one android application is installed in the android system, if the android system wants to install the split application of the android application into the android system again, the android system cannot accept the registration of the split application due to the fact that the same registration information is received, so that the split application is unknown to the android system, and the split system cannot normally interact with the android system, and the split system cannot normally run.
However, the requirement for the parallel operation of multiple identical android applications exists in a user group, and it is common that a user wants to log in two QQ applications through different accounts on an intelligent terminal of the user, so that the two QQ applications operate in parallel, and the user can use different QQ applications to perform chat sessions with friends in different social circles according to the requirement of the user, so that the system and the method conform to many application scenarios.
Disclosure of Invention
In view of the above, the present invention has been made to provide a processing method and apparatus for an asynchronous call mechanism of an android application that overcomes or at least partially solves the above problems.
According to an aspect of the present invention, there is provided a method for processing an asynchronous call mechanism of an android application, including:
constructing a virtual machine environment, and putting the body-divided applications of one or more designated android applications in the android system into a virtual machine, so that the body-divided application of each designated android application can run in parallel with the corresponding designated android application;
and carrying out proxy processing on the asynchronous call event of the sub-body application of the specified android application in the virtual machine, so that the sub-body application of the specified android application in the virtual machine can execute the operation corresponding to the asynchronous call event.
Optionally, the method further comprises: declaring an agent component in advance in the android system;
the proxy processing of the asynchronous call event of the self-body application of the specified android application in the virtual machine comprises the following steps:
monitoring an asynchronous calling event in the android system;
intercepting an asynchronous call event when the asynchronous call event occurs in an android system, and judging whether a target component in an execution message corresponding to the asynchronous call event is a component of a self-body application of a designated android application in a virtual machine or not;
if so, replacing a target component in the execution message corresponding to the asynchronous call event with the proxy component, recording the execution message corresponding to the asynchronous call event before replacement as an original execution message, and releasing the asynchronous call event after replacement;
otherwise, the asynchronous calling event is directly released.
Optionally, the proxying the asynchronous call event of the avatar application with respect to the specified android application in the virtual machine further includes:
and when the android system is excited and then sends out an execution message corresponding to the asynchronous call event, the target component in the execution message is the replaced proxy component, and the proxy component receives the execution message.
Optionally, the method further comprises: pre-declaring a reservation process adapted to different component types in an android system;
the proxy processing of the asynchronous call event of the divided body application related to the specified android application in the virtual machine further comprises:
when the agent component receives an execution message sent by the android system, searching for an original execution message corresponding to the recorded execution message;
selecting a reserved process adapted to the component type to which the target component in the original execution message belongs;
and sending the original execution message to the selected reserved process, so that the target component in the original execution message runs in the selected reserved process.
Optionally, the monitoring an asynchronous call event in the android system; when an asynchronous call event occurs in the android system, intercepting the asynchronous call event, and judging whether a target component in an execution message corresponding to the asynchronous call event is a component of a sub-body application of a designated android application in a virtual machine or not comprises the following steps:
monitoring an event calling a method for acquiring an IntentSender object in the android system;
when an event calling a method for acquiring an IntentSender object is monitored, intercepting the corresponding IntentSender object, extracting an Intent message from the IntentSender object, and judging whether a target component indicated by the Intent message is a component of a sub-body application of a specified android application in a virtual machine.
Optionally, before the proxy processing of the asynchronous call event of the avatar application with respect to the specified android application in the virtual machine, the method further comprises: acquiring relevant information of components registered by the body-separating application of each appointed android application and storing the relevant information into a configuration management table;
judging whether the target component indicated by the Intent message is a component of a split application of a designated android application in the virtual machine comprises the following steps: judging whether the relevant information of the target component in the Intent message is matched with the relevant information of the component recorded in the configuration management table; if so, determining that the target component indicated by the Intent message is a component of the split-body application of the specified android application in the virtual machine; otherwise it is not.
Optionally, the obtaining and storing the related information of the component registered by the avatar application of each specified android application into the configuration management table includes:
acquiring an installation package duplicate of each designated android application, storing the installation package duplicate to a designated directory, and using the installation package duplicate as an installation package of the body-splitting application of each designated android application;
and analyzing the configuration file in the installation package of the body-divided application of each appointed android application, acquiring the related information of the registered component in the corresponding configuration file of the body-divided application of each appointed android application, and storing the related information into the configuration management table.
Optionally, the replacing the target component in the execution message corresponding to the asynchronous call event with the proxy component, recording the execution message corresponding to the asynchronous call event before replacement as an original execution message, and releasing the asynchronous call event after replacement includes:
replacing the intercepted target component indicated by the Intent message in the IntentSender object with the proxy component, and taking and recording the Intent message extracted from the IntentSender object as an original Intent message;
releasing the replaced IntentSender object, so that the IntentSender object is transmitted to the corresponding processing party, and the corresponding processing party triggers the android system to send out the corresponding replaced Intent message at preset time.
Optionally, when the android system is activated and then sends out an execution message corresponding to the asynchronous call event, a target component in the execution message is the replaced proxy component, and the receiving of the execution message by the proxy component includes:
and when the android system is excited, sending out a correspondingly replaced Intent message, wherein the target component indicated by the Intent message is the proxy component, and the proxy component receives the Intent message.
Optionally, when the agent component receives an execution message sent by the android system, searching for the recorded original execution message corresponding to the execution message includes:
when the agent component receives the Intent message, searching the recorded original Intent message corresponding to the Intent message;
the sending the original execution message to the selected reserved process, so that the target component in the original execution message runs in the selected reserved process includes: and sending the original Intent message to the selected reserved process, loading the target component in the reserved process according to the target component indicated by the original Intent message, and instantiating the target component, so that the target component executes operation according to the action indicated by the original Intent message.
Optionally, the proxying the asynchronous call event of the avatar application with respect to the specified android application in the virtual machine includes:
asynchronous call events for the avatar application with respect to a specified android application in the virtual machine are proxied through a resident service in the virtual machine.
According to another aspect of the present invention, there is provided a processing apparatus for an asynchronous call mechanism of an android application, including:
the system comprises an environment construction unit, a virtual machine environment and a virtual machine environment, wherein the environment construction unit is suitable for constructing a virtual machine environment and placing the split applications of one or more designated android applications in the android system into a virtual machine, so that the split application of each designated android application can run in parallel with the corresponding designated android application;
the resident service unit is suitable for carrying out proxy processing on asynchronous call events of the split applications of the designated android application in the virtual machine, so that the split applications of the designated android application in the virtual machine can execute operations corresponding to the asynchronous call events.
Optionally, the apparatus further comprises: the information configuration unit is suitable for declaring the agent component in advance in the android system;
the resident service unit is suitable for monitoring asynchronous calling events in the android system; intercepting an asynchronous call event when the asynchronous call event occurs in an android system, and judging whether a target component in an execution message corresponding to the asynchronous call event is a component of a self-body application of a designated android application in a virtual machine or not; if so, replacing a target component in the execution message corresponding to the asynchronous call event with the proxy component, recording the execution message corresponding to the asynchronous call event before replacement as an original execution message, and releasing the asynchronous call event after replacement; otherwise, the asynchronous calling event is directly released.
Optionally, the resident service unit is further adapted to, when the android system is activated and an execution message corresponding to the asynchronous call event is sent, determine that a target component in the execution message is the replaced proxy component, and receive the execution message by the proxy component.
Optionally, the information configuration unit is further adapted to declare in advance a reservation process adapted to different component types in the android system;
the resident service unit is also suitable for searching the recorded original execution message corresponding to the execution message when the agent component receives the execution message sent by the android system; selecting a reserved process adapted to the component type to which the target component in the original execution message belongs; and sending the original execution message to the selected reserved process, so that the target component in the original execution message runs in the selected reserved process.
Optionally, the resident service unit is adapted to monitor an event in the android system calling a method for acquiring an IntentSender object; when an event calling a method for acquiring an IntentSender object is monitored, intercepting the corresponding IntentSender object, extracting an Intent message from the IntentSender object, and judging whether a target component indicated by the Intent message is a component of a sub-body application of a specified android application in a virtual machine.
Optionally, the resident service unit is further adapted to, before the proxy processing is performed on the asynchronous call event of the avatar application of the specified android application in the virtual machine, obtain relevant information of a component registered in the avatar application of each specified android application and store the relevant information in a configuration management table;
the resident service unit is suitable for judging whether the relevant information of the target component in the Intent message is matched with the relevant information of the component recorded in the configuration management table; if so, determining that the target component indicated by the Intent message is a component of the split-body application of the specified android application in the virtual machine; otherwise it is not.
Optionally, the resident service unit is adapted to obtain an installation package copy of each designated android application and store the installation package copy to a designated directory as an installation package of the avatar application of each designated android application; and analyzing the configuration file in the installation package of the body-divided application of each appointed android application, acquiring the related information of the registered component in the corresponding configuration file of the body-divided application of each appointed android application, and storing the related information into the configuration management table.
Optionally, the resident service unit is adapted to replace the intercepted target component indicated by the Intent message in the intentre sender object with the proxy component, and take and record the Intent message extracted from the intentre sender object as the original Intent message; releasing the replaced IntentSender object, so that the IntentSender object is transmitted to the corresponding processing party, and the corresponding processing party triggers the android system to send out the corresponding replaced Intent message at preset time.
Optionally, when the android system is activated, a correspondingly replaced Intent message is sent out, the target component indicated by the Intent message is the proxy component, and the proxy component receives the Intent message.
Optionally, the resident service unit is adapted to, when the agent component receives the Intent message, search for an original Intent message corresponding to the recorded Intent message; and sending the original Intent message to the selected reserved process, loading the target component in the reserved process according to the target component indicated by the original Intent message, and instantiating the target component, so that the target component executes operation according to the action indicated by the original Intent message.
Optionally, the resident service unit is adapted to perform proxy processing on an asynchronous call event of an avatar application of a specified android application in the virtual machine through a resident service in the virtual machine.
As can be seen from the above, according to the technical scheme of the present invention, in order to implement parallel operation of multiple identical android applications in an android system, a virtual machine environment is constructed in the android system, a split application of a specified android application is put into the virtual machine to operate, and in order to overcome the problem that the split application is unknown to the android system and the split application cannot respond to an asynchronous call event in the android system, the scheme performs proxy processing on the asynchronous call event of the split application of the specified android application in the virtual machine, so that the split application of the specified android application in the virtual machine can execute an operation corresponding to the asynchronous call event, and can perfectly implement parallel operation of the specified android application in the android system and the corresponding split application thereof, and even implement an asynchronous call mechanism very smoothly.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
FIG. 1 illustrates a flow diagram of a method for processing an asynchronous call mechanism for an android application, according to one embodiment of the invention;
FIG. 2 illustrates an architecture diagram of a processing device for the asynchronous call mechanism of an android application, according to one embodiment of the invention;
FIG. 3 illustrates a schematic diagram of a processing device for an asynchronous call mechanism for an android application, according to an embodiment of the invention;
FIG. 4 is a schematic diagram of a processing device for an asynchronous call mechanism of an android application, according to another embodiment of the invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
FIG. 1 illustrates a flow diagram of a method for processing an asynchronous call mechanism for an android application, according to one embodiment of the invention. As shown in fig. 1, the method includes:
step S110, constructing a virtual machine environment, and putting the body-divided applications of one or more designated android applications in the android system into the virtual machine, so that the body-divided application of each designated android application can run in parallel with the corresponding designated android application.
Wherein, the specified android application refers to application software which can normally run in an android system and is similar to QQ chat, UC browser and the like. And the body-divided application of the designated android application is used as a copy body of the designated android application and can be regarded as the body-divided of the designated android application. In the prior art, the reason that the split application of each designated android application and the corresponding designated android application cannot run in parallel is that the android system cannot recognize the same registration information declared by two identical applications, so that the split application of the designated android application cannot be successfully registered in the android system under the condition that the designated android application is installed, and for the android system, the split application of the designated android application is unknown, and the android system cannot normally interact with the split application.
Step S120, performing proxy processing on the asynchronous call event of the avatar application of the designated android application in the virtual machine, so that the avatar application of the designated android application in the virtual machine can execute an operation corresponding to the asynchronous call event.
The asynchronous call event means that the occurrence time of the asynchronous call event is not synchronous with the call implementation time or has a close relationship with the call implementation time, and after the asynchronous call event occurs, the execution of the operation corresponding to the specified asynchronous call event can be determined at any time in the future.
It can be seen that, in order to implement parallel operation of multiple identical android applications in the android system, the method shown in fig. 1 constructs a virtual machine environment in the android system, puts the split application of the specified android application into the virtual machine to operate, and in order to overcome the problem that the split application is unknown to the android system and the split application cannot respond to an asynchronous call event in the android system, the method performs proxy processing on the asynchronous call event of the split application of the specified android application in the virtual machine, so that the split application of the specified android application in the virtual machine can execute an operation corresponding to the asynchronous call event, and can perfectly implement parallel operation of the specified android application and the corresponding split application in the android system, and even implement an asynchronous call mechanism very smoothly.
In one embodiment of the invention, since the avatar application is unknown to the android system, when an asynchronous call event occurs with respect to the avatar application, the true original purpose of the event is to asynchronously call a component in the avatar application and perform some operation, since an execution message of the operation corresponding to the asynchronous call event is sent by the android system at a specific time point, and since the component of the avatar application is not registered in the android system, when the component in the avatar application is the target component of the execution message, the android system does not know who the execution message is to be sent, which results in failure of the asynchronous call event. Therefore, according to the scheme, when the asynchronous call event occurs, certain processing needs to be performed on the asynchronous call event, so that the target component of the asynchronous call event is temporarily replaced by a component recognized by the android system, the android system can successfully send out an execution message, and when the execution message is sent to the component for replacement, the component for replacement can forward the execution message to the real target component, so that the target component can roundly receive the execution message of the operation corresponding to the asynchronous call event and further execute the corresponding operation, and the asynchronous call event is successful.
Namely, the method shown in fig. 1 further comprises: declaring an agent component in advance in the android system; the proxy processing of the asynchronous call event of the self-body-splitting application related to the specified android application in the virtual machine includes: monitoring an asynchronous calling event in the android system; intercepting an asynchronous call event when the asynchronous call event occurs in an android system, and judging whether a target component in an execution message corresponding to the asynchronous call event is a component of a self-body application of a designated android application in a virtual machine or not; if so, replacing a target component in the execution message corresponding to the asynchronous call event with the proxy component, recording the execution message corresponding to the asynchronous call event before replacement as an original execution message, and releasing the asynchronous call event after replacement; otherwise, the asynchronous calling event is directly released.
Further, the proxy processing of the asynchronous call event of the avatar application with respect to the specified android application in the virtual machine further includes: and when the android system is excited and then sends out an execution message corresponding to the asynchronous call event, the target component in the execution message is the replaced proxy component, and the proxy component receives the execution message.
And further, pre-declaring a reservation process adapted to different component types in the android system; the proxy processing of the asynchronous call event of the divided body application related to the specified android application in the virtual machine further comprises: when the agent component receives an execution message sent by the android system, searching for an original execution message corresponding to the recorded execution message; selecting a reserved process adapted to the component type to which the target component in the original execution message belongs; and sending the original execution message to the selected reserved process, so that the target component in the original execution message runs in the selected reserved process. In the step, the declared reservation process is matched with the component type, that is, for a reservation process, all components conforming to the component type adapted to the reservation process can be run in the reservation process.
The scheme respectively declares the reserved processes for the components of different component types in advance, provides the corresponding reserved processes for the components when the components need to be operated in the split application, is different from the mode that the specific processes are declared for the specific components in the prior art, is more flexible and convenient in the management mode of the reserved processes, and is very reliable and effective for the operation of the split system which is not registered in the android system.
In Android, we often use PendingIntent to express a meaning of "stay for post-processing". From this point of view, PendingIntent can be understood as a special asynchronous handling mechanism. However, PendingIntent has some misleading implications in terms of nomenclature alone, because it neither inherits nor contains Intent, and its core can roughly be summarized into four words- "asynchronously fired".
It is clear that such asynchronous fires are often to be performed across processes. For example, the process a serves as an initiator and can "acquire" a PendingIntent object from the system, then the process a can "transfer" the PendingIntent object to the process B through the binder mechanism, and then the process B "calls back" the send () action of the PendingIntent object at a suitable future time to complete the firing.
In the Android system, the most suitable component for centralized management is ams (activity manager service), so it is obligatory to unleasedly assume the responsibility of managing all pendingintents. In short, when the initiator acquires PendingIntent, it is actually necessary to provide several intents at the same time. These intent and Pendingintent are just companion relationships, not aggregated relationships, that would be cached in the AMS. Later, once the handler passes the "firing" semantics of PendingIntent to the AMS, the AMS attempts to find and deliver a number of intents corresponding to this PendingIntent. The new PendingIntent (target) creates a PendingIntent object, the importance of which is self-explanatory. However, the internal core of this object is derived from the getIntentSender () function above. The IIntertSender core is what we really need to care about. It is said that the IIntertSender object here is a binder agent, and its corresponding binder entity is the PendingIntentRecord object in the AMS. At the time the PendingIntent object is constructed, the IIntetSender agent is passed in as a parameter and recorded in the PendingIntent's mTarget domain. Later, when PendingIntent executes asynchronous firing, it is internal to pass semantics to the AMS on this mTarget domain.
We said earlier that PendingIntent is often passed to another process via the binder mechanism. The binder mechanism can ensure that the mTarget domain of the PendingIntent obtained by the target process is also a legal IIntentSender agent, and the InntentSender agent and the IIntentSender agent of the initiating end correspond to the same PendingIntentRecord entity.
Based on this, in one embodiment of the present invention, the monitoring of the asynchronous call event in the android system; when an asynchronous call event occurs in the android system, intercepting the asynchronous call event, and judging whether a target component in an execution message corresponding to the asynchronous call event is a component of a sub-body application of a designated android application in a virtual machine or not comprises the following steps: monitoring an event calling a method for acquiring an IntentSender object in the android system; when an event calling a method for acquiring an IntentSender object is monitored, intercepting the corresponding IntentSender object, extracting an Intent message from the IntentSender object, and judging whether a target component indicated by the Intent message is a component of a sub-body application of a specified android application in a virtual machine.
Wherein, prior to the proxy processing of the asynchronous call event for the avatar application with respect to the specified android application in the virtual machine, the method further comprises: acquiring relevant information of components registered by the body-separating application of each appointed android application and storing the relevant information into a configuration management table; judging whether the target component indicated by the Intent message is a component of a split application of a designated android application in the virtual machine comprises the following steps: judging whether the relevant information of the target component in the Intent message is matched with the relevant information of the component recorded in the configuration management table; if so, determining that the target component indicated by the Intent message is a component of the split-body application of the specified android application in the virtual machine; otherwise it is not.
The registration mode of the divided applications may be a static registration mode, and the registration information is written in a Manifest file, that is, the obtaining and storing the relevant information of the components registered by the divided applications of each designated android application into the configuration management table includes: acquiring an installation package duplicate of each designated android application, storing the installation package duplicate to a designated directory, and using the installation package duplicate as an installation package of the body-splitting application of each designated android application; and analyzing the configuration file in the installation package of the body-divided application of each appointed android application, acquiring the related information of the registered component in the corresponding configuration file of the body-divided application of each appointed android application, and storing the related information into the configuration management table.
In an embodiment of the present invention, the replacing the target component in the execution message corresponding to the asynchronous call event with the proxy component, recording the execution message corresponding to the asynchronous call event before replacement as an original execution message, and releasing the asynchronous call event after replacement includes: replacing the intercepted target component indicated by the Intent message in the IntentSender object with the proxy component, and taking and recording the Intent message extracted from the IntentSender object as an original Intent message; releasing the replaced IntentSender object, so that the IntentSender object is transmitted to the corresponding processing party, and the corresponding processing party triggers the android system to send out the corresponding replaced Intent message at preset time.
And when the android system is excited and then sends out an execution message corresponding to the asynchronous call event, a target component in the execution message is the replaced proxy component, and the step of receiving the execution message by the proxy component comprises the following steps: and when the android system is excited, sending out a correspondingly replaced Intent message, wherein the target component indicated by the Intent message is the proxy component, and the proxy component receives the Intent message.
Specifically, when the agent component receives an execution message sent by the android system, searching for the recorded original execution message corresponding to the execution message includes: when the agent component receives the Intent message, searching the recorded original Intent message corresponding to the Intent message; the sending the original execution message to the selected reserved process, so that the target component in the original execution message runs in the selected reserved process includes: and sending the original Intent message to the selected reserved process, loading the target component in the reserved process according to the target component indicated by the original Intent message, and instantiating the target component, so that the target component executes operation according to the action indicated by the original Intent message.
In an embodiment of the present invention, the proxying the asynchronous call event of the avatar application with respect to the specified android application in the virtual machine includes: asynchronous call events for the avatar application with respect to a specified android application in the virtual machine are proxied through a resident service in the virtual machine.
FIG. 2 illustrates an architecture diagram of a processing device for the asynchronous call mechanism of an android application, according to one embodiment of the invention. As shown in fig. 2, the dashed box represents a processing apparatus of an asynchronous call mechanism of an android application, and the interaction of the apparatus and the AMS service in the android system forms an entire architecture system, and the apparatus registers a plurality of components with the android system: the device comprises a component 1, a component 2 and a component 3 … …, wherein the device runs a body-separated application a and a body-separated application b in a virtual machine, some components and processes are arranged in the body-separated application a, and are not registered with an android system, and some components and processes are arranged in the body-separated application b, and are not registered with the android system. Asynchronous call events include: the process a1 in the sub-body application a acquires the IntentSender from the system AMS and then transmits the IntentSender to the process b1 in the sub-body application b, and in response to a certain future event, such as a user clicking a designated control, the process b1 activates the system AMS, and the system AMS sends an execution message to the target component a 1. Where component a1 is targeted to be preset when process a1 gets the IntentSender from the system AMS, but the sending of the execute message fails because the system does not recognize component a 1. To solve this problem, when process a1 gets IntentSender from system AMS, it intercepts to replace the target component it sets from a1 with component 1 that the system knows, and saves the mapping of the replacement. When the system is activated and sends out the execution message, it is started that the component 1, finds out the true target component a1 from the mapping relation just stored, and passes the corresponding execution message to the component a1, so that the component a1 can execute the operation corresponding to the asynchronous call event.
Fig. 3 is a schematic diagram illustrating a processing apparatus for an asynchronous call mechanism of an android application according to an embodiment of the present invention, and as shown in fig. 3, the processing apparatus 300 for the asynchronous call mechanism of the android application includes:
the environment construction unit 310 is adapted to construct a virtual machine environment, and place the split applications of one or more designated android applications in the android system into the virtual machine, so that the split application of each designated android application can run in parallel with the corresponding designated android application.
The resident service unit 320 is suitable for performing proxy processing on the asynchronous call event of the avatar application of the specified android application in the virtual machine, so that the avatar application of the specified android application in the virtual machine can execute the operation corresponding to the asynchronous call event.
It can be seen that, in order to realize parallel operation of a plurality of same android applications in the android system, the device shown in fig. 3 constructs a virtual machine environment in the android system, puts the split application of the designated android application into the virtual machine to operate, and in order to overcome the problem that the split application is unknown to the android system and the split application cannot respond to the asynchronous call event in the android system, the scheme performs proxy processing on the asynchronous call event of the split application of the designated android application in the virtual machine, so that the split application of the designated android application in the virtual machine can execute the operation corresponding to the asynchronous call event, and can perfectly realize parallel operation of the designated android application and the corresponding split application in the android system, and even the realization of an asynchronous call mechanism is very smooth.
Fig. 4 is a schematic diagram illustrating a processing apparatus for an asynchronous call mechanism of an android application according to another embodiment of the present invention, and as shown in fig. 4, the processing apparatus 400 for the asynchronous call mechanism of the android application includes: an environment construction unit 310, a resident service unit 320 and an information configuration unit 330;
the above description has described some of the functions of the environment construction unit 310 and the resident service unit 320.
The information configuration unit is suitable for declaring the agent component in advance in the android system; the resident service unit 320 is suitable for monitoring asynchronous calling events in the android system; intercepting an asynchronous call event when the asynchronous call event occurs in an android system, and judging whether a target component in an execution message corresponding to the asynchronous call event is a component of a self-body application of a designated android application in a virtual machine or not; if so, replacing a target component in the execution message corresponding to the asynchronous call event with the proxy component, recording the execution message corresponding to the asynchronous call event before replacement as an original execution message, and releasing the asynchronous call event after replacement; otherwise, the asynchronous calling event is directly released.
In an embodiment of the present invention, the resident service unit 320 is further adapted to, when the execution message corresponding to the asynchronous call event is sent after the android system is activated, a target component in the execution message is the replaced proxy component, and the proxy component receives the execution message.
In an embodiment of the present invention, the information configuring unit 330 is further adapted to declare in advance a reservation procedure adapted to different component types in the android system; the resident service unit 320 is further adapted to, when the agent component receives an execution message sent by the android system, search for an original execution message corresponding to the recorded execution message; selecting a reserved process adapted to the component type to which the target component in the original execution message belongs; and sending the original execution message to the selected reserved process, so that the target component in the original execution message runs in the selected reserved process.
Specifically, the resident service unit 320 is adapted to monitor an event in the android system calling a method for acquiring an IntentSender object; when an event calling a method for acquiring an IntentSender object is monitored, intercepting the corresponding IntentSender object, extracting an Intent message from the IntentSender object, and judging whether a target component indicated by the Intent message is a component of a sub-body application of a specified android application in a virtual machine.
In an embodiment of the present invention, the resident service unit 320 is further adapted to, before the proxy processing of the asynchronous call event of the avatar application related to the specified android application in the virtual machine, obtain and store the relevant information of the component registered by the avatar application of each specified android application into the configuration management table; the resident service unit 320 is adapted to determine whether the related information of the target component in the Intent message matches the related information of the component recorded in the configuration management table; if so, determining that the target component indicated by the Intent message is a component of the split-body application of the specified android application in the virtual machine; otherwise it is not.
In an embodiment of the present invention, the resident service unit 320 is adapted to obtain an installation package copy of each designated android application and store the installation package copy to a designated directory as an installation package of an individual application of each designated android application; and analyzing the configuration file in the installation package of the body-divided application of each appointed android application, acquiring the related information of the registered component in the corresponding configuration file of the body-divided application of each appointed android application, and storing the related information into the configuration management table.
In an embodiment of the present invention, the resident service unit 320 is adapted to replace the intercepted target component indicated by the Intent message in the IntentSender object with the proxy component, and take and record the Intent message extracted from the IntentSender object as the original Intent message; releasing the replaced IntentSender object, so that the IntentSender object is transmitted to the corresponding processing party, and the corresponding processing party triggers the android system to send out the corresponding replaced Intent message at preset time.
And sending out a correspondingly replaced Intent message after the android system is excited, wherein the target component indicated by the Intent message is the proxy component, and the proxy component receives the Intent message. The resident service unit 320 is adapted to, when the agent component receives the Intent message, search for the recorded original Intent message corresponding to the Intent message; and sending the original Intent message to the selected reserved process, loading the target component in the reserved process according to the target component indicated by the original Intent message, and instantiating the target component, so that the target component executes operation according to the action indicated by the original Intent message.
In one embodiment of the present invention, the resident service unit 320 is adapted to proxy an asynchronous call event of an avatar application with respect to a specified android application in the virtual machine through a resident service in the virtual machine.
It should be noted that the embodiments of the apparatus shown in fig. 3-4 are the same as the embodiments of the method shown in fig. 1-2, and the detailed description is given above and will not be repeated herein.
In summary, in the technical solution of the present invention, in order to implement parallel operation of multiple identical android applications in an android system, a virtual machine environment is constructed in the android system, a split application of a specified android application is put into the virtual machine to operate, and in order to overcome a problem that the split application is unknown to the android system and the split application cannot respond to an asynchronous call event in the android system, the scheme performs proxy processing on the asynchronous call event of the split application of the specified android application in the virtual machine, so that the split application of the specified android application in the virtual machine can execute an operation corresponding to the asynchronous call event, and can perfectly implement parallel operation of the specified android application in the android system and its corresponding split application, and even implement an asynchronous call mechanism very smoothly.
It should be noted that:
the algorithms and displays presented herein are not inherently related to any particular computer, virtual machine, or other apparatus. Various general purpose devices may be used with the teachings herein. The required structure for constructing such a device will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functionality of some or all of the components of the processing apparatus of the asynchronous call mechanism for android applications according to embodiments of the present invention. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
The invention discloses A1 and a processing method of an asynchronous calling mechanism of an android application, wherein the processing method comprises the following steps:
constructing a virtual machine environment, and putting the body-divided applications of one or more designated android applications in the android system into a virtual machine, so that the body-divided application of each designated android application can run in parallel with the corresponding designated android application;
and carrying out proxy processing on the asynchronous call event of the sub-body application of the specified android application in the virtual machine, so that the sub-body application of the specified android application in the virtual machine can execute the operation corresponding to the asynchronous call event.
A2, the method of a1, wherein the method further comprises: declaring an agent component in advance in the android system;
the proxy processing of the asynchronous call event of the self-body application of the specified android application in the virtual machine comprises the following steps:
monitoring an asynchronous calling event in the android system;
intercepting an asynchronous call event when the asynchronous call event occurs in an android system, and judging whether a target component in an execution message corresponding to the asynchronous call event is a component of a self-body application of a designated android application in a virtual machine or not;
if so, replacing a target component in the execution message corresponding to the asynchronous call event with the proxy component, recording the execution message corresponding to the asynchronous call event before replacement as an original execution message, and releasing the asynchronous call event after replacement;
otherwise, the asynchronous calling event is directly released.
A3, the method as in a2, wherein the proxying asynchronous call events for the avatar application with respect to a specified android application in the virtual machine further comprises:
and when the android system is excited and then sends out an execution message corresponding to the asynchronous call event, the target component in the execution message is the replaced proxy component, and the proxy component receives the execution message.
A4, the method of A3, wherein the method further comprises: pre-declaring a reservation process adapted to different component types in an android system;
the proxy processing of the asynchronous call event of the divided body application related to the specified android application in the virtual machine further comprises:
when the agent component receives an execution message sent by the android system, searching for an original execution message corresponding to the recorded execution message;
selecting a reserved process adapted to the component type to which the target component in the original execution message belongs;
and sending the original execution message to the selected reserved process, so that the target component in the original execution message runs in the selected reserved process.
A5, the method according to any one of A2-A4, wherein the monitoring asynchronous call events in an android system; when an asynchronous call event occurs in the android system, intercepting the asynchronous call event, and judging whether a target component in an execution message corresponding to the asynchronous call event is a component of a sub-body application of a designated android application in a virtual machine or not comprises the following steps:
monitoring an event calling a method for acquiring an IntentSender object in the android system;
when an event calling a method for acquiring an IntentSender object is monitored, intercepting the corresponding IntentSender object, extracting an Intent message from the IntentSender object, and judging whether a target component indicated by the Intent message is a component of a sub-body application of a specified android application in a virtual machine.
A6, the method as in a5, wherein before the proxying the asynchronous call event for the avatar application with respect to the specified android application in the virtual machine, the method further comprises: acquiring relevant information of components registered by the body-separating application of each appointed android application and storing the relevant information into a configuration management table;
judging whether the target component indicated by the Intent message is a component of a split application of a designated android application in the virtual machine comprises the following steps: judging whether the relevant information of the target component in the Intent message is matched with the relevant information of the component recorded in the configuration management table; if so, determining that the target component indicated by the Intent message is a component of the split-body application of the specified android application in the virtual machine; otherwise it is not.
A7, the method as in a6, wherein the obtaining and saving the relevant information of the components registered by the avatar application of each designated android application into the configuration management table includes:
acquiring an installation package duplicate of each designated android application, storing the installation package duplicate to a designated directory, and using the installation package duplicate as an installation package of the body-splitting application of each designated android application;
and analyzing the configuration file in the installation package of the body-divided application of each appointed android application, acquiring the related information of the registered component in the corresponding configuration file of the body-divided application of each appointed android application, and storing the related information into the configuration management table.
A8, the method as in a5, wherein the replacing the target component in the execution message corresponding to the asynchronous call event with the proxy component, recording the execution message corresponding to the asynchronous call event before replacement as the original execution message, and releasing the asynchronous call event after replacement comprises:
replacing the intercepted target component indicated by the Intent message in the IntentSender object with the proxy component, and taking and recording the Intent message extracted from the IntentSender object as an original Intent message;
releasing the replaced IntentSender object, so that the IntentSender object is transmitted to the corresponding processing party, and the corresponding processing party triggers the android system to send out the corresponding replaced Intent message at preset time.
A9, the method as in A8, where when the android system is activated and an execution message corresponding to the asynchronous call event is sent, a target component in the execution message is the replaced proxy component, and the receiving, by the proxy component, the execution message includes:
and when the android system is excited, sending out a correspondingly replaced Intent message, wherein the target component indicated by the Intent message is the proxy component, and the proxy component receives the Intent message.
A10, the method as in a9, where, when the agent component receives an execution message sent by the android system, finding the recorded original execution message corresponding to the execution message includes:
when the agent component receives the Intent message, searching the recorded original Intent message corresponding to the Intent message;
the sending the original execution message to the selected reserved process, so that the target component in the original execution message runs in the selected reserved process includes: and sending the original Intent message to the selected reserved process, loading the target component in the reserved process according to the target component indicated by the original Intent message, and instantiating the target component, so that the target component executes operation according to the action indicated by the original Intent message.
A11, the method according to any one of a1-a10, wherein the proxying asynchronous call events for the avatar application with respect to a specified android application in the virtual machine comprises:
asynchronous call events for the avatar application with respect to a specified android application in the virtual machine are proxied through a resident service in the virtual machine.
The invention also discloses B12 and a processing device of the asynchronous call mechanism of the android application, wherein the processing device comprises:
the system comprises an environment construction unit, a virtual machine environment and a virtual machine environment, wherein the environment construction unit is suitable for constructing a virtual machine environment and placing the split applications of one or more designated android applications in the android system into a virtual machine, so that the split application of each designated android application can run in parallel with the corresponding designated android application;
the resident service unit is suitable for carrying out proxy processing on asynchronous call events of the split applications of the designated android application in the virtual machine, so that the split applications of the designated android application in the virtual machine can execute operations corresponding to the asynchronous call events.
B13, the apparatus of B12, wherein the apparatus further comprises: the information configuration unit is suitable for declaring the agent component in advance in the android system;
the resident service unit is suitable for monitoring asynchronous calling events in the android system; intercepting an asynchronous call event when the asynchronous call event occurs in an android system, and judging whether a target component in an execution message corresponding to the asynchronous call event is a component of a self-body application of a designated android application in a virtual machine or not; if so, replacing a target component in the execution message corresponding to the asynchronous call event with the proxy component, recording the execution message corresponding to the asynchronous call event before replacement as an original execution message, and releasing the asynchronous call event after replacement; otherwise, the asynchronous calling event is directly released.
B14, the device of B13, wherein,
the resident service unit is further adapted to, when the android system is activated and an execution message corresponding to the asynchronous call event is sent out, a target component in the execution message is the replaced proxy component, and the proxy component receives the execution message.
B15, the apparatus according to B14, wherein the information configuration unit is further adapted to declare in advance reservation procedures adapted to different component types in the android system;
the resident service unit is also suitable for searching the recorded original execution message corresponding to the execution message when the agent component receives the execution message sent by the android system; selecting a reserved process adapted to the component type to which the target component in the original execution message belongs; and sending the original execution message to the selected reserved process, so that the target component in the original execution message runs in the selected reserved process.
B16, the device of any one of B13-B15, wherein,
the resident service unit is suitable for monitoring an event for calling a method for acquiring an IntentSender object in the android system; when an event calling a method for acquiring an IntentSender object is monitored, intercepting the corresponding IntentSender object, extracting an Intent message from the IntentSender object, and judging whether a target component indicated by the Intent message is a component of a sub-body application of a specified android application in a virtual machine.
The device according to B17 and B16, wherein the resident service unit is further adapted to obtain and save the relevant information of the component registered in the avatar application of each designated android application into the configuration management table before the proxy processing of the asynchronous call event of the avatar application related to the designated android application in the virtual machine;
the resident service unit is suitable for judging whether the relevant information of the target component in the Intent message is matched with the relevant information of the component recorded in the configuration management table; if so, determining that the target component indicated by the Intent message is a component of the split-body application of the specified android application in the virtual machine; otherwise it is not.
B18, the device of B17, wherein,
the resident service unit is suitable for acquiring installation package copies of the designated android applications and storing the installation package copies to the designated directory to serve as installation packages of the personal applications of the designated android applications; and analyzing the configuration file in the installation package of the body-divided application of each appointed android application, acquiring the related information of the registered component in the corresponding configuration file of the body-divided application of each appointed android application, and storing the related information into the configuration management table.
B19, the device of B16, wherein,
the resident service unit is suitable for replacing the intercepted target component indicated by the Intent message in the IntentSender object with the proxy component, and taking and recording the Intent message extracted from the IntentSender object as an original Intent message; releasing the replaced IntentSender object, so that the IntentSender object is transmitted to the corresponding processing party, and the corresponding processing party triggers the android system to send out the corresponding replaced Intent message at preset time.
B20, the device of B19, wherein,
and when the android system is excited, sending out a correspondingly replaced Intent message, wherein the target component indicated by the Intent message is the proxy component, and the proxy component receives the Intent message.
B21, the device of B20, wherein,
the resident service unit is suitable for searching the recorded original Intent message corresponding to the Intent message when the agent component receives the Intent message; and sending the original Intent message to the selected reserved process, loading the target component in the reserved process according to the target component indicated by the original Intent message, and instantiating the target component, so that the target component executes operation according to the action indicated by the original Intent message.
B22, the device of any one of B12-B21, wherein,
the resident service unit is suitable for carrying out proxy processing on asynchronous calling events of the split application of the designated android application in the virtual machine through the resident service in the virtual machine.

Claims (20)

1. A processing method of an asynchronous calling mechanism of an android application comprises the following steps:
constructing a virtual machine environment, and putting the body-divided applications of one or more designated android applications in the android system into a virtual machine, so that the body-divided application of each designated android application can run in parallel with the corresponding designated android application;
carrying out proxy processing on asynchronous call events of the split applications of the designated android application in the virtual machine, so that the split applications of the designated android application in the virtual machine can execute operations corresponding to the asynchronous call events;
wherein the method further comprises: declaring an agent component in advance in the android system;
the proxy processing of the asynchronous call event of the self-body application of the specified android application in the virtual machine comprises the following steps:
monitoring an asynchronous calling event in the android system;
intercepting an asynchronous call event when the asynchronous call event occurs in an android system, and judging whether a target component in an execution message corresponding to the asynchronous call event is a component of a self-body application of a designated android application in a virtual machine or not;
if so, replacing a target component in the execution message corresponding to the asynchronous call event with the proxy component, recording the execution message corresponding to the asynchronous call event before replacement as an original execution message, and releasing the asynchronous call event after replacement;
otherwise, the asynchronous calling event is directly released.
2. The method of claim 1, wherein the proxying asynchronous call events for the avatar application with respect to the specified android application in the virtual machine further comprises:
and when the android system is excited and then sends out an execution message corresponding to the asynchronous call event, the target component in the execution message is the replaced proxy component, and the proxy component receives the execution message.
3. The method of claim 2, wherein the method further comprises: pre-declaring a reservation process adapted to different component types in an android system;
the proxy processing of the asynchronous call event of the divided body application related to the specified android application in the virtual machine further comprises:
when the agent component receives an execution message sent by the android system, searching for an original execution message corresponding to the recorded execution message;
selecting a reserved process adapted to the component type to which the target component in the original execution message belongs;
and sending the original execution message to the selected reserved process, so that the target component in the original execution message runs in the selected reserved process.
4. The method of claim 3, wherein the listening for asynchronous call events in the android system; when an asynchronous call event occurs in the android system, intercepting the asynchronous call event, and judging whether a target component in an execution message corresponding to the asynchronous call event is a component of a sub-body application of a designated android application in a virtual machine or not comprises the following steps:
monitoring an event calling a method for acquiring an IntentSender object in the android system;
when an event calling a method for acquiring an IntentSender object is monitored, intercepting the corresponding IntentSender object, extracting an Intent message from the IntentSender object, and judging whether a target component indicated by the Intent message is a component of a sub-body application of a specified android application in a virtual machine.
5. The method of claim 4, wherein prior to the proxying the asynchronous call event for the avatar application with respect to the specified android application in the virtual machine, the method further comprises: acquiring relevant information of components registered by the body-separating application of each appointed android application and storing the relevant information into a configuration management table;
judging whether the target component indicated by the Intent message is a component of a split application of a designated android application in the virtual machine comprises the following steps: judging whether the relevant information of the target component in the Intent message is matched with the relevant information of the component recorded in the configuration management table; if so, determining that the target component indicated by the Intent message is a component of the split-body application of the specified android application in the virtual machine; otherwise it is not.
6. The method of claim 5, wherein the obtaining and saving the relevant information of the components registered by the split application of each designated android application to the configuration management table comprises:
acquiring an installation package duplicate of each designated android application, storing the installation package duplicate to a designated directory, and using the installation package duplicate as an installation package of the body-splitting application of each designated android application;
and analyzing the configuration file in the installation package of the body-divided application of each appointed android application, acquiring the related information of the registered component in the corresponding configuration file of the body-divided application of each appointed android application, and storing the related information into the configuration management table.
7. The method of claim 4, wherein the replacing the target component in the execution message corresponding to the asynchronous call event with the proxy component, recording the execution message corresponding to the asynchronous call event before replacement as an original execution message, and releasing the asynchronous call event after replacement comprises:
replacing the intercepted target component indicated by the Intent message in the IntentSender object with the proxy component, and taking and recording the Intent message extracted from the IntentSender object as an original Intent message;
releasing the replaced IntentSender object, so that the IntentSender object is transmitted to the corresponding processing party, and the corresponding processing party triggers the android system to send out the corresponding replaced Intent message at preset time.
8. The method of claim 7, wherein when the android system is activated and an execution message corresponding to the asynchronous call event is sent out, a target component in the execution message is the replaced proxy component, and the receiving of the execution message by the proxy component includes:
and when the android system is excited, sending out a correspondingly replaced Intent message, wherein the target component indicated by the Intent message is the proxy component, and the proxy component receives the Intent message.
9. The method of claim 8, wherein when the agent component receives an execution message sent by an android system, finding an original execution message corresponding to the recorded execution message comprises:
when the agent component receives the Intent message, searching the recorded original Intent message corresponding to the Intent message;
the sending the original execution message to the selected reserved process, so that the target component in the original execution message runs in the selected reserved process includes: and sending the original Intent message to the selected reserved process, loading the target component in the reserved process according to the target component indicated by the original Intent message, and instantiating the target component, so that the target component executes operation according to the action indicated by the original Intent message.
10. The method of any of claims 1-9, wherein the proxying asynchronous call events for the avatar application with respect to the specified android application in the virtual machine comprises:
asynchronous call events for the avatar application with respect to a specified android application in the virtual machine are proxied through a resident service in the virtual machine.
11. A processing apparatus for an asynchronous call mechanism for an android application, comprising:
the system comprises an environment construction unit, a virtual machine environment and a virtual machine environment, wherein the environment construction unit is suitable for constructing a virtual machine environment and placing the split applications of one or more designated android applications in the android system into a virtual machine, so that the split application of each designated android application can run in parallel with the corresponding designated android application;
the resident service unit is suitable for carrying out proxy processing on asynchronous call events of the split applications of the designated android application in the virtual machine, so that the split applications of the designated android application in the virtual machine can execute operations corresponding to the asynchronous call events;
wherein the apparatus further comprises: the information configuration unit is suitable for declaring the agent component in advance in the android system;
the resident service unit is suitable for monitoring asynchronous calling events in the android system; intercepting an asynchronous call event when the asynchronous call event occurs in an android system, and judging whether a target component in an execution message corresponding to the asynchronous call event is a component of a self-body application of a designated android application in a virtual machine or not; if so, replacing a target component in the execution message corresponding to the asynchronous call event with the proxy component, recording the execution message corresponding to the asynchronous call event before replacement as an original execution message, and releasing the asynchronous call event after replacement; otherwise, the asynchronous calling event is directly released.
12. The apparatus of claim 11, wherein,
the resident service unit is further adapted to, when the android system is activated and an execution message corresponding to the asynchronous call event is sent out, a target component in the execution message is the replaced proxy component, and the proxy component receives the execution message.
13. The apparatus of claim 12, wherein the information configuring unit is further adapted to declare in advance, in the android system, reservation procedures adapted to different component types;
the resident service unit is also suitable for searching the recorded original execution message corresponding to the execution message when the agent component receives the execution message sent by the android system; selecting a reserved process adapted to the component type to which the target component in the original execution message belongs; and sending the original execution message to the selected reserved process, so that the target component in the original execution message runs in the selected reserved process.
14. The apparatus of claim 13, wherein,
the resident service unit is suitable for monitoring an event for calling a method for acquiring an IntentSender object in the android system; when an event calling a method for acquiring an IntentSender object is monitored, intercepting the corresponding IntentSender object, extracting an Intent message from the IntentSender object, and judging whether a target component indicated by the Intent message is a component of a sub-body application of a specified android application in a virtual machine.
15. The apparatus of claim 14, wherein the resident service unit is further adapted to, before the proxy processing of the asynchronous call event of the avatar application with respect to the designated android application in the virtual machine, obtain and save relevant information of the component registered by the avatar application of each designated android application into a configuration management table;
the resident service unit is suitable for judging whether the relevant information of the target component in the Intent message is matched with the relevant information of the component recorded in the configuration management table; if so, determining that the target component indicated by the Intent message is a component of the split-body application of the specified android application in the virtual machine; otherwise it is not.
16. The apparatus of claim 15, wherein,
the resident service unit is suitable for acquiring installation package copies of the designated android applications and storing the installation package copies to the designated directory to serve as installation packages of the personal applications of the designated android applications; and analyzing the configuration file in the installation package of the body-divided application of each appointed android application, acquiring the related information of the registered component in the corresponding configuration file of the body-divided application of each appointed android application, and storing the related information into the configuration management table.
17. The apparatus of claim 14, wherein,
the resident service unit is suitable for replacing the intercepted target component indicated by the Intent message in the IntentSender object with the proxy component, and taking and recording the Intent message extracted from the IntentSender object as an original Intent message; releasing the replaced IntentSender object, so that the IntentSender object is transmitted to the corresponding processing party, and the corresponding processing party triggers the android system to send out the corresponding replaced Intent message at preset time.
18. The apparatus of claim 17, wherein,
and when the android system is excited, sending out a correspondingly replaced Intent message, wherein the target component indicated by the Intent message is the proxy component, and the proxy component receives the Intent message.
19. The apparatus of claim 18, wherein,
the resident service unit is suitable for searching the recorded original Intent message corresponding to the Intent message when the agent component receives the Intent message; and sending the original Intent message to the selected reserved process, loading the target component in the reserved process according to the target component indicated by the original Intent message, and instantiating the target component, so that the target component executes operation according to the action indicated by the original Intent message.
20. The apparatus of any one of claims 11-19,
the resident service unit is suitable for carrying out proxy processing on asynchronous calling events of the split application of the designated android application in the virtual machine through the resident service in the virtual machine.
CN201611249874.6A 2016-12-29 2016-12-29 Processing method and device for asynchronous call mechanism of android application Active CN106708604B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611249874.6A CN106708604B (en) 2016-12-29 2016-12-29 Processing method and device for asynchronous call mechanism of android application

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611249874.6A CN106708604B (en) 2016-12-29 2016-12-29 Processing method and device for asynchronous call mechanism of android application

Publications (2)

Publication Number Publication Date
CN106708604A CN106708604A (en) 2017-05-24
CN106708604B true CN106708604B (en) 2020-02-11

Family

ID=58904125

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611249874.6A Active CN106708604B (en) 2016-12-29 2016-12-29 Processing method and device for asynchronous call mechanism of android application

Country Status (1)

Country Link
CN (1) CN106708604B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107273118A (en) * 2017-05-31 2017-10-20 湖南机友科技有限公司 The implementation method and device opened a kind of application program more

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106020943A (en) * 2016-05-04 2016-10-12 北京小米移动软件有限公司 Application program dual-opening method and device

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106020943A (en) * 2016-05-04 2016-10-12 北京小米移动软件有限公司 Application program dual-opening method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
".NET中的异步调用";tijichen;《CSDN,https://blog.csdn.net/tijichen/article/details/180298》;20041113;正文 *
"Android应用分身功能介绍";maetelibom;《CSDN,https://blog.csdn.net/maetelibom/article/details/52084085》;20160801;第5部分 *

Also Published As

Publication number Publication date
CN106708604A (en) 2017-05-24

Similar Documents

Publication Publication Date Title
US10565034B2 (en) Event-driven serverless function orchestration
US9602339B2 (en) System and method for supporting a server-side event model in a distributed data grid
US10521280B2 (en) Event-driven serverless function orchestration
US9367369B2 (en) Automated merger of logically associated messages in a message queue
JP2017528845A (en) System and method for partition identifier determination in a multi-tenant application server environment
US10191789B2 (en) Tracing system operations across remote procedure linkages to identify request originators
CN107450971A (en) Task processing method and device
CN107832329A (en) Page resource acquisition methods and terminal device
CN103699835B (en) A kind of access control method towards android system resource
US20090150869A1 (en) System and method of monitoring dynamic scopes in synchronous and asynchronous calls
CN106331065A (en) Proxy application for host system with service container and system
CN110012062B (en) Multi-computer-room task scheduling method and device and storage medium
CN101192192B (en) Task abnormity diagnosis method and system for real-time operating system
CN112313627B (en) Mapping mechanism of event to serverless function workflow instance
CN109656584A (en) A kind of method for burn-recording and device of program
CN104408110B (en) The method, apparatus and system of request of data
US20160087759A1 (en) Tuple recovery
CN104750536B (en) A kind of method and apparatus realized virtual machine and examined oneself
CN106708604B (en) Processing method and device for asynchronous call mechanism of android application
US9015533B1 (en) Error handling for asynchronous applications
CN108549594B (en) Method and device for determining user loss reason
WO2019117767A1 (en) Method, function manager and arrangement for handling function calls
CN107391274A (en) The processing method and processing device of deferred information
US20140164523A1 (en) Automated enabling of instant messaging communications in a client system
US9753841B1 (en) Generation of baseline test cases for composite software application

Legal Events

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

Effective date of registration: 20211203

Address after: 300450 No. 9-3-401, No. 39, Gaoxin 6th Road, Binhai Science Park, high tech Zone, Binhai New Area, Tianjin

Patentee after: 3600 Technology Group Co.,Ltd.

Address before: 100088 room 112, block D, 28 new street, new street, Xicheng District, Beijing (Desheng Park)

Patentee before: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20230712

Address after: 1765, floor 17, floor 15, building 3, No. 10 Jiuxianqiao Road, Chaoyang District, Beijing 100015

Patentee after: Beijing Hongxiang Technical Service Co.,Ltd.

Address before: 300450 No. 9-3-401, No. 39, Gaoxin 6th Road, Binhai Science Park, high tech Zone, Binhai New Area, Tianjin

Patentee before: 3600 Technology Group Co.,Ltd.