CN106919446A - The choosing method and device of destination application - Google Patents
The choosing method and device of destination application Download PDFInfo
- Publication number
- CN106919446A CN106919446A CN201610399246.XA CN201610399246A CN106919446A CN 106919446 A CN106919446 A CN 106919446A CN 201610399246 A CN201610399246 A CN 201610399246A CN 106919446 A CN106919446 A CN 106919446A
- Authority
- CN
- China
- Prior art keywords
- activity
- event
- created
- application program
- application
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
- G06F9/4881—Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/48—Indexing scheme relating to G06F9/48
- G06F2209/482—Application
Abstract
The invention relates to the choosing method and device of a kind of destination application, the execution number of times of the object event of the activity according to application program, it is determined that the quantity of the activity for having created, quantity according to the activity for having created chooses destination application afterwards;Namely the application is the quantity for having created activity in application program by monitoring, to choose destination application, thus, it is possible to solve it is traditional by whether judging current application program in task list or process list, caused by the inaccurate problem of the destination application chosen.
Description
Technical field
The application is related to field of computer technology, more particularly to a kind of destination application choosing method and device.
Background technology
In conventional art, intended application journey is chosen from the application program for having turned on window or having run of mobile terminal
The method of sequence has two kinds:
First, whether current application program is judged in the task list (Running TaskInfo) being currently running, if
It is not that current application program is then chosen for destination application, however, because foregoing task list is carried by operating system
What application programming interface (Application Programming Interface, API) function of confession was obtained, for not
The operating system (e.g., Android5.0) of the api function is provided, then task list cannot be obtained, so as to also cannot just choose mesh
Mark application program, it can thus be seen that the applicability of the method is poor.
Second, whether current application program is judged in process (Running Process) list being currently running, if not
It is that current application program is then chosen for destination application, there is resident business yet with some application programs
(Service) during, it may be always present in process list, therefore it is probably not according to the destination application that the method is chosen
Accurately, and then computer resource is wasted.
The content of the invention
The embodiment of the present application provides the choosing method and device of a kind of destination application, can improve intended application journey
Accuracy and applicability that sequence is chosen.
First aspect, there is provided a kind of choosing method of destination application, the method includes:
Obtain and have turned on window or the application program run on mobile terminal;
Monitor the object event performed to the activity of the application program;
Execution number of times according to the object event, it is determined that the quantity of the activity for having created;
If the quantity of the activity for having created meets pre-conditioned, the application program is chosen for into target should
Use program.
Second aspect, there is provided a kind of selecting device of destination application, the device includes:
Acquiring unit, for obtaining the application program for window being had turned on mobile terminal or having been run;
Monitoring unit, the target that the activity for monitoring the application program obtained to the acquiring unit is performed
Event;
Determining unit, the execution number of times of the object event for being monitored according to the monitoring unit, it is determined that having created
Activity quantity;
Unit is chosen, if the quantity of the activity for having been created described in determining unit determination meets default bar
Part, then be chosen for destination application by the application program.
The choosing method and device of the destination application that the application is provided, the target of the activity according to application program
The execution number of times of event, it is determined that the quantity of the activity for having created, quantity according to the activity for having created is selected afterwards
Take destination application;Namely the application is to have created the quantity of activity in application program by monitoring to choose target
Application program, thus, it is possible to solve it is traditional by whether judging current application program in task list or process list,
Caused by the inaccurate problem of destination application chosen.
Brief description of the drawings
The life cycle schematic diagram of the activity that Fig. 1 is provided for the application;
The choosing method flow chart of the destination application that Fig. 2 is provided for a kind of embodiment of the application;
The selecting device schematic diagram of the destination application that Fig. 3 is provided for the application another embodiment.
Specific embodiment
Below in conjunction with the accompanying drawings, embodiments of the invention are described.
The choosing method and device of the destination application that the application is provided, it is adaptable to have turned on window from mobile terminal
Or the scene of destination application is chosen in the application program run, it is particularly suited for according to having been created in application program
The quantity of activity, chooses the scene of destination application.Mobile terminal herein can for mobile phone or panel computer etc.,
The operating system of mobile terminal can be Android (Android) system;Destination application refers to that window is had turned on mobile terminal
The application program on foreground is not switched in mouth or the application program run, it would generally be comprised in appointing for mobile terminal
In business administration interface, wherein, the Home key or length that task management interface can be double-clicked on mobile terminal by user press movement eventually
Menu key triggering on end.
It should be noted that above-mentioned activity refers to the responsible component with user mutual in application program, it is generally
It is a single screen, some controls can be shown on the screen, it is also possible to monitor and process the event of user, its Life Cycle
Phase can be as shown in Figure 1.In Fig. 1, starting (onStart ()) event is used to increase an activity newly, and terminates (onStop
()) event be used for reduce an activity.From figure 1 it appears that the quantity of activity final in application program with
Whether the application program is closely bound up on foreground, once the application program switches to backstage from foreground, then in application program
The quantity of activity will be 0.And quantity of the application exactly according to activity in application program chooses intended application
Program.
To be illustrated come the choosing method to an object of the application application program by way of embodiment below.
The choosing method flow chart of the destination application that Fig. 2 is provided for a kind of embodiment of the application.The execution of the method
Main body can be the equipment with disposal ability:Server or system or device, as shown in Fig. 2 the method specifically can be with
Including:
Step 210, to obtain and have turned on window or the application program run on mobile terminal.
It is understood that the above-mentioned window or the number of the application program run of having turned on can be one or more.
One or more application programs for window being had turned on mobile terminal or having been run can be comprised in task management
In interface, the menu that the Home key or length that the task management interface can be double-clicked on mobile terminal by user are pressed on mobile terminal
Key is triggered.It should be noted that at a time, these are had turned in window or one or more application programs for having run
Only one of which application program can be switched to foreground, and other application program then operates in backstage, and these operate in its of backstage
Its application program can also expend the resources such as the internal memory of computer.
Step 220, the object event that monitoring is performed to the activity of application program.
Herein, object event can include the beginning event (onStart ()) and End Event shown in Fig. 1
(onStop())。
In one implementation, step 220 is specifically as follows:
Step A:The activity life cycles for creating application program monitor the example of class.
When the operating system of mobile terminal is Android, activity life cycles monitoring class herein can be
The ActivityLifecycleCallbacks classes of Android, each in application program can be monitored by such example
The life cycle of activity.
Step B:The object event performed to activity by the example, monitoring.
It should be noted that the example of ActivityLifecycleCallbacks classes includes two methods:
OnActivityStarted () and onActivityStopped (), can be monitored by two methods and activity is performed
Beginning event and End Event.Specifically, onStart () event in Fig. 1 is performed to activity, will be corresponding
Trigger the onActivityStarted () in the example of ActivityLifecycleCallbacks classes;Held when to activity
OnStop () event gone in Fig. 1, in will accordingly triggering the example of ActivityLifecycleCallbacks classes
onActivityStopped().It is possible thereby to illustrate, the execution number of times of onActivityStarted () and holding for onStart ()
Places number is identical, and the execution number of times of onActivityStopped () and the execution number of times of onStop () are identicals.Namely
By the execution number of times for counting the execution number of times of onActivityStarted () to determine the beginning event of activity, accordingly
, by the execution number of times for counting the execution number of times of onActivityStopped () to determine the End Event of activity.
Step 230, the execution number of times according to object event, it is determined that the quantity of the activity for having created.
In a kind of specific implementation, execution number of times and the end of the beginning event of activity can be respectively counted
The execution number of times of event, afterwards by the difference of the execution number of times for performing number of times and End Event of the beginning event of activity
As the quantity of the activity for having created.
In another specific implementation, it is also possible to determine what is created by the count value of counter
The quantity of activity, for details, reference can be made to and as follows realize code:
Code is realized above-mentioned, a counter mActivityCount can be initialized, when
When the onActivityStarted () of the example of ActivityLifecycleCallbacks classes is performed, namely work as
When the beginning event of activity is performed, counter mActivityCount adds one;When
When the onActivityStopped () of the example of ActivityLifecycleCallbacks classes is performed, namely work as
When the End Event of activity is performed, counter mActivityCount subtracts one;Afterwards using the count value of counter as
The quantity of the activity for having created.
Step 240, if the quantity of the activity for having created meets pre-conditioned, application program is chosen for into target should
Use program.
Herein, the quantity of the activity that will can have been created is judged as meeting pre-conditioned for 0, namely the application is by
The quantity of the activity of establishment is that 0 application program is chosen for destination application, and it can be seen from content described above,
The quantity of the activity for having created is that 0 application program is the application program for switching to backstage, namely the application chooses
Destination application can be to have turned on the application program that foreground is not switched in window or the application program run, so
And because these application programs for not being switched to foreground will also tend to the resources such as committed memory, therefore, under a kind of scene,
Select after above-mentioned destination application, the relevant information of the destination application can be sent to the resource pipe of computer
Reason module, so that the resource management module can discharge the resources such as the internal memory of destination application, it is possible thereby to reach saving meter
The purpose of calculation machine resource.
Certainly, in actual applications, other treatment can also be done to the destination application chosen, the application does not make to this
Limit.
To sum up, the application is to have created the quantity of activity in application program by monitoring to choose intended application journey
Sequence, and the quantity that the content according to Fig. 1 can be seen that final activity in application program is with the application program
No is closely bound up on foreground, once the application program switches to backstage from foreground, then in application program activity number
Amount will be 0, therefore the choosing method of the destination application provided according to the application can improve destination application selection
Accuracy;Further, since activity is the application component for being bound in Android system exist, so as to according to this
Applying for the choosing method of the destination application for providing can improve the applicability of destination application selection.
With the choosing method of above-mentioned destination application accordingly, a kind of intended application journey that the embodiment of the present application is also provided
The selecting device of sequence, as shown in figure 3, the device includes:
Acquiring unit 301, for obtaining the application program for window being had turned on mobile terminal or having been run.
Monitoring unit 302, the target thing that the activity for monitoring the application program obtained to acquiring unit 301 is performed
Part.
Monitoring unit 302 specifically for:
The activity life cycles for creating application program monitor the example of class;
The object event performed to activity by the example, monitoring.
Determining unit 303, the execution number of times of the object event for being monitored according to monitoring unit 302, it is determined that created
The quantity of activity.
Alternatively, object event can include beginning event and End Event;
Determining unit 303 specifically for:
Using the difference of the execution number of times of the event of beginning and the execution number of times of End Event as the activity's for having created
Quantity.
Alternatively, object event can include beginning event and End Event;
Determining unit 303 specifically for:
Initialization counter;
If beginning event is performed, counter is added one;
If End Event is performed, counter is subtracted one;
According to the count value of counter, it is determined that the quantity of the activity for having created.
Unit 304 is chosen, for if it is determined that the default bar of quantity satisfaction of the activity for having created that unit 303 determines
Part, then be chosen for destination application by application program.
In one implementation, if the quantity of the activity for having created is the first numerical value, it is judged as what is created
The quantity of activity meets pre-conditioned.
The function of each functional module of the embodiment of the present application device, can be by each step of above method embodiment come real
It is existing, therefore, the specific work process of the device that the application is provided is not repeated again herein.
The selecting device of the destination application that the application is provided, acquiring unit 301 to be obtained and have turned on window on mobile terminal
Mouth or the application program run;Monitoring unit 302 monitors the object event performed to the activity of application program;It is determined that
Unit 303 according to the execution number of times of object event, it is determined that the quantity of the activity for having created;If the activity's for having created
Quantity meets pre-conditioned, then choose unit 304 and application program is chosen for into destination application.Thus, it is possible to improve target
Accuracy and applicability that application program is chosen.
Professional should further appreciate that, each example described with reference to the embodiments described herein
Object and algorithm steps, can be realized with electronic hardware, computer software or the combination of the two, hard in order to clearly demonstrate
The interchangeability of part and software, generally describes the composition and step of each example according to function in the above description.
These functions are performed with hardware or software mode actually, depending on the application-specific and design constraint of technical scheme.
Professional and technical personnel can realize described function to each specific application using distinct methods, but this realization
It is not considered that exceeding scope of the present application.
The method that is described with reference to the embodiments described herein can use hardware, computing device the step of algorithm
Software module, or the two combination is implemented.Software module can be placed in random access memory (RAM), internal memory, read-only storage
(ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technical field
In any other form of storage medium well known to interior.
Above-described specific embodiment, purpose, technical scheme and beneficial effect to the application have been carried out further
Describe in detail, should be understood that the specific embodiment that the foregoing is only the application, be not used to limit the application
Protection domain, all any modification, equivalent substitution and improvements within spirit herein and principle, done etc. all should include
Within the protection domain of the application.
Claims (10)
1. a kind of choosing method of destination application, it is characterised in that the method includes:
Obtain and have turned on window or the application program run on mobile terminal;
Monitor the object event performed to the activity of the application program;
Execution number of times according to the object event, it is determined that the quantity of the activity for having created;
If the quantity of the activity for having created meets pre-conditioned, the application program is chosen for intended application journey
Sequence.
2. method according to claim 1, it is characterised in that the monitoring is performed to the activity of the application program
Object event, specially:
The activity life cycles for creating the application program monitor the example of class;
The object event performed to the activity by the example, monitoring.
3. method according to claim 1 and 2, it is characterised in that the object event includes beginning event and end
Event;
The execution number of times according to the object event, it is determined that the quantity of the activity for having created, specially:
The difference of the execution number of times of the beginning event and the execution number of times of the End Event has been created as described
The quantity of activity.
4. method according to claim 1 and 2, it is characterised in that the object event includes beginning event and end
Event;
The execution number of times according to the object event, it is determined that the quantity of the activity for having created, specially:
Initialization counter;
If the beginning event is performed, the counter is added one;
If the End Event is performed, the counter is subtracted one;
According to the count value of the counter, it is determined that the quantity of the activity for having created.
5. the method according to claim any one of 1-4, it is characterised in that if the quantity of the activity for having created
It is the first numerical value, then is judged as that the quantity of the activity for having created meets pre-conditioned.
6. a kind of selecting device of destination application, it is characterised in that the device includes:
Acquiring unit, for obtaining the application program for window being had turned on mobile terminal or having been run;
Monitoring unit, the target thing that the activity for monitoring the application program obtained to the acquiring unit is performed
Part;
Determining unit, the execution number of times of the object event for being monitored according to the monitoring unit, it is determined that created
The quantity of activity;
Unit is chosen, if the quantity of the activity for having been created described in determining unit determination meets pre-conditioned,
The application program is then chosen for destination application.
7. device according to claim 6, it is characterised in that the monitoring unit specifically for:
The activity life cycles for creating the application program monitor the example of class;
The object event performed to the activity by the example, monitoring.
8. the device according to claim 6 or 7, it is characterised in that the object event includes beginning event and end
Event;
The determining unit specifically for:
The difference of the execution number of times of the beginning event and the execution number of times of the End Event has been created as described
The quantity of activity.
9. the device according to claim 6 or 7, it is characterised in that the object event includes beginning event and end
Event;
The determining unit specifically for:
Initialization counter;
If the beginning event is performed, the counter is added one;
If the End Event is performed, the counter is subtracted one;
According to the count value of the counter, it is determined that the quantity of the activity for having created.
10. the device according to claim any one of 6-9, it is characterised in that if the number of the activity for having created
It is the first numerical value to measure, then be judged as that the quantity of the activity for having created meets pre-conditioned.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610399246.XA CN106919446A (en) | 2016-06-07 | 2016-06-07 | The choosing method and device of destination application |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610399246.XA CN106919446A (en) | 2016-06-07 | 2016-06-07 | The choosing method and device of destination application |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106919446A true CN106919446A (en) | 2017-07-04 |
Family
ID=59453244
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610399246.XA Pending CN106919446A (en) | 2016-06-07 | 2016-06-07 | The choosing method and device of destination application |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106919446A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109697115A (en) * | 2017-10-20 | 2019-04-30 | 伊姆西Ip控股有限责任公司 | For dispatching the method, apparatus and computer-readable medium of application |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104346202A (en) * | 2014-09-30 | 2015-02-11 | 北京金山安全软件有限公司 | Setting method and device of terminal application program and terminal |
CN104360925A (en) * | 2014-11-21 | 2015-02-18 | 北京奇虎科技有限公司 | Method and device for counting and recording use frequency of application program |
US20150309843A1 (en) * | 2012-12-07 | 2015-10-29 | Tencent Technology (Shenzhen) Company Limited | Resource optimization method and apparatus |
-
2016
- 2016-06-07 CN CN201610399246.XA patent/CN106919446A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20150309843A1 (en) * | 2012-12-07 | 2015-10-29 | Tencent Technology (Shenzhen) Company Limited | Resource optimization method and apparatus |
CN104346202A (en) * | 2014-09-30 | 2015-02-11 | 北京金山安全软件有限公司 | Setting method and device of terminal application program and terminal |
CN104360925A (en) * | 2014-11-21 | 2015-02-18 | 北京奇虎科技有限公司 | Method and device for counting and recording use frequency of application program |
Non-Patent Citations (1)
Title |
---|
TIGERGANG: "如何判断一个Android应用程序转到后台并回到前台", 《HTTPS://WWW.JIANSHU.COM/P/6ABB22937E6F》 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109697115A (en) * | 2017-10-20 | 2019-04-30 | 伊姆西Ip控股有限责任公司 | For dispatching the method, apparatus and computer-readable medium of application |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2017222613A1 (en) | End-to-end techniques to create pm (performance measurement) thresholds at nfv (network function virtualization) infrastructure | |
CN106951335B (en) | Process daemon method and mobile terminal | |
JP2013543626A5 (en) | ||
KR101763804B1 (en) | Method for verifying mobile application and terminal using the same | |
CN106407092B (en) | Interface operation data report and device, interface operation data statistical approach and device | |
JP6657442B2 (en) | Method and apparatus for exchanging information with online billing | |
CN108182146B (en) | Method and system for detecting memory leakage | |
CN111552416A (en) | Method, device and equipment for starting task management interface | |
WO2017222609A1 (en) | End-to-end techniques to collect pm (performance measurement) data from a nvf (network function virtualization) infrastructure | |
CN107577578A (en) | Count method, apparatus, equipment and the storage medium of NFS operation word time delay | |
CN107704317B (en) | Intelligent device and application management method thereof and device with storage function | |
CN106919446A (en) | The choosing method and device of destination application | |
CN107506293B (en) | Software performance data acquisition method and device | |
CN109257196A (en) | A kind of abnormality eliminating method and equipment | |
CN104063093A (en) | Method and device for preventing touch screen from being operated by mistake and mobile equipment | |
CN106482742B (en) | The acquisition methods and device of step counting data | |
CN106528151A (en) | Software development kit management method and device | |
CN105468344B (en) | A kind of float layer setting method, device and electronic equipment | |
CN106294457B (en) | Network information pushing method and device | |
KR101781527B1 (en) | Method for verifying mobile application and terminal using the same | |
CN106575177B (en) | The control method and terminal of touch screen report point quantity | |
CN111352793A (en) | Method and device for monitoring application use data | |
CN107948940A (en) | Method, apparatus, mobile terminal and the storage medium that flow expends are monitored in advance | |
CN111797025B (en) | Application-oriented data processing method and device | |
CN108874569B (en) | Event response and file generation method and device and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20170704 |
|
RJ01 | Rejection of invention patent application after publication |