CN109800567A - Monitor method and device, the terminal device of foreground application starting - Google Patents

Monitor method and device, the terminal device of foreground application starting Download PDF

Info

Publication number
CN109800567A
CN109800567A CN201910043153.7A CN201910043153A CN109800567A CN 109800567 A CN109800567 A CN 109800567A CN 201910043153 A CN201910043153 A CN 201910043153A CN 109800567 A CN109800567 A CN 109800567A
Authority
CN
China
Prior art keywords
application
package name
application package
judging whether
newly added
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910043153.7A
Other languages
Chinese (zh)
Other versions
CN109800567B (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.)
Wangsu Science and Technology Co Ltd
Original Assignee
Wangsu Science and 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 Wangsu Science and Technology Co Ltd filed Critical Wangsu Science and Technology Co Ltd
Priority to CN201910043153.7A priority Critical patent/CN109800567B/en
Publication of CN109800567A publication Critical patent/CN109800567A/en
Application granted granted Critical
Publication of CN109800567B publication Critical patent/CN109800567B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

The present embodiments relate to technical field of data processing, disclose method and device, the terminal device of a kind of monitoring foreground application starting.In the present invention, with the process catalogue of predetermined period scanning system;Newly-increased process is judged whether there is according to the process catalogue of scanning, if so, then obtaining the corresponding application packet name of the process;Judge whether the application packet name adjusted back using Bao Mingyu system miscellaneous function is identical, if so, being determined with foreground application starting.Snoop results of both system process catalogue and system readjustment are considered simultaneously, so that final judging result is more accurate.In addition, since system process catalogue is unrelated with Android system version, moreover, current Android version all supports the call back function of system miscellaneous function, therefore, the good compatibility of this programme substantially.

Description

Method and device for monitoring foreground application starting and terminal equipment
Technical Field
The embodiment of the invention relates to the technical field of data processing, in particular to a method for monitoring the starting of foreground application.
Background
With the development of internet technology, in recent years, more and more terminal devices are equipped with android systems, and various programs can be installed on the android systems to meet personalized requirements of people. When some functions are implemented, for example, when a user opens an application interface and puts in pictures, the system needs to monitor the starting of foreground applications.
The inventor finds that at least the following problems exist in the prior art:
the method for monitoring foreground application starting in the prior art has low accuracy and poor compatibility.
Disclosure of Invention
The embodiment of the invention aims to provide a method and a device for monitoring the starting of foreground application and a terminal device, so that the monitoring accuracy of the starting of the foreground application is high and the compatibility is good.
In order to solve the above technical problem, an embodiment of the present invention provides a method for monitoring foreground application startup, including the following steps:
scanning a process directory of the system at a preset period; judging whether a newly added process exists according to the scanned process directory, and if so, acquiring an application package name corresponding to the process; and judging whether the application package name is the same as the application package name obtained by the system auxiliary function callback, if so, judging that foreground application is started.
An embodiment of the present invention further provides a terminal device, including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the above-described method of listening for foreground application launch.
The embodiment of the invention also provides a device for monitoring the starting of foreground application, which comprises: the scanning module is used for scanning the process catalog of the system in a preset period; the first judgment module is used for judging whether a newly added process exists according to the scanned process directory; the acquisition module is used for acquiring the application package name corresponding to the process when the judgment module judges that the newly added process exists; and the second judgment module is used for judging whether the application package name is the same as the application package name obtained by the system auxiliary function callback, and if so, judging that the foreground application is started.
The embodiment of the invention also provides a computer readable storage medium, which stores a computer program, and the computer program realizes the method for monitoring the foreground application starting when being executed by a processor.
Compared with the prior art, the method and the device can obtain the latest condition of the process directory of the system in time by scanning the process directory of the system at the preset period; when judging that a new process is started according to the scanned process directory, acquiring the application package name corresponding to the process to know which application process is started; and judging whether the application package name is the same as the application package name obtained by the system auxiliary function callback, if so, judging that foreground application is started. Meanwhile, the monitoring results of the system process directory and the system callback are considered, so that the final judgment result is more accurate. In addition, the system process directory is irrelevant to the android system version, and the current android version basically supports the callback function of the system auxiliary function, so that the scheme has good compatibility.
In addition, after acquiring the application package name corresponding to the process, the method further includes: loading the content to be released; after judging that the foreground application is started, the method further comprises the following steps: and throwing the content to be thrown to an interface of the started foreground application. Because the speed of scanning the process directory of the system to obtain the application package name is generally higher than the speed of obtaining the application package name by calling back the system auxiliary function, the released content is loaded after the application package name of the process is obtained, the content to be released can be prepared in advance, the content can be released immediately after the foreground application is judged to be started, the content to be released does not need to be loaded after the foreground application is determined to be started, the releasing speed of the content is improved, and the user experience is improved.
In addition, before loading the content to be delivered, the method further comprises the following steps: judging whether the newly added process is a newly added process in a preset application scene; and if the new process is a new process in the preset application scene, loading the content to be released. The content is only released to the newly added process under the preset scene, so that the scene of releasing the content can be limited, and the user experience is guaranteed.
In addition, the above-mentioned judging whether there is a new process according to the scanned process directory specifically includes: judging whether a newly added main process exists according to the scanned process directory; and if the newly added main process exists, judging that the newly added process exists. Because the same application may create a plurality of processes, in the specific application, the monitoring only on the main process can reduce the workload of the system and improve the calculation speed.
In addition, the above determining whether there is a new process specifically includes: and judging whether the process directory has a newly created folder or not, and if so, judging that a newly added process exists. The system stores the process information in the process directory, so that the newly-added process can be judged as long as the newly-created process folder is detected in the process directory, and the newly-added process can be judged by judging whether the newly-created process folder exists or not, so that the judgment result is accurate and high in speed.
In addition, the above-mentioned judging whether there is a new process according to the scanned process directory specifically includes: judging whether a newly added non-system process exists according to the scanned process directory; and if the newly added non-system process exists, acquiring the application package name corresponding to the process. And only acquiring the application packet name corresponding to the non-system process, namely filtering the system process and not monitoring the system process.
Before determining whether the application package name is the same as the application package name obtained by the system auxiliary function callback, the method further includes: judging whether the application package name is the application package name representing that the application is in the starting process, if so, shortening the period of scanning a system process directory until the real application package name of the process is obtained; judging whether the application package name is the same as the application package name obtained by the system auxiliary function callback, specifically: and judging whether the real application package name is the same as the application package name obtained by the callback of the system auxiliary function. When the application is started, the process directory is scanned to obtain the application package name which identifies the application in the starting process, but not the actual application package name, if the fact that the application is started is monitored, the preset period of the process directory of the scanning system is shortened, and the actual application package name can be obtained as soon as possible after the application is started; the accuracy of the judgment result is ensured by judging whether the real application package name is the same as the application package name obtained by the callback of the system auxiliary function.
In addition, after acquiring the application package name corresponding to the process, the method further includes: and judging whether the application package name is the target application package name, if so, forcibly ending the process, and informing the user of unloading. In practical application, the terminal device may download a rogue application or malicious software, and when monitoring that the application package names are the target application package names, if the application is started, poor user experience may be caused, and user information security may not be guaranteed, so that the process is forcibly ended, and the user is notified to unload, which may guarantee user information security.
Drawings
Fig. 1 is a flowchart of a method for listening to foreground application start according to a first embodiment of the present invention;
fig. 2 is a flowchart of a method for listening to foreground application start according to a second embodiment of the present invention;
fig. 3 is a flowchart of a method for listening to foreground application start according to a third embodiment of the present invention;
FIG. 4 is a flowchart of a method for listening for foreground application startup according to a fourth embodiment of the present invention;
fig. 5 is a schematic structural diagram of an apparatus for listening to foreground application start according to a fifth embodiment of the present invention;
fig. 6 is a schematic structural diagram of a terminal device according to a sixth embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, embodiments of the present invention will be described in detail below with reference to the accompanying drawings. However, it will be appreciated by those of ordinary skill in the art that numerous technical details are set forth in order to provide a better understanding of the present application in various embodiments of the present invention. However, the technical solution claimed in the present application can be implemented without these technical details and various changes and modifications based on the following embodiments. The following embodiments are divided for convenience of description, and should not constitute any limitation to the specific implementation manner of the present invention, and the embodiments may be mutually incorporated and referred to without contradiction.
The first embodiment of the invention relates to a method for monitoring the starting of foreground application. In the embodiment, a process directory of the system is scanned at a preset period; judging whether a newly added process exists or not, and if so, acquiring an application package name corresponding to the process; and judging whether the application package name is the same as the application package name obtained by the system auxiliary function callback, if so, judging that foreground application is started. By simultaneously monitoring the callback of the newly added process and the system auxiliary function in the process directory of the system, the final judgment result has high accuracy and good compatibility. Fig. 1 shows a method for monitoring foreground application start in this embodiment, and details of implementation of the method for monitoring foreground application start in this embodiment are specifically described below.
Step 101: and scanning the process catalog of the system at a preset period.
Specifically, since the linux system kernel stores the process information in the/proc directory, the process directory of the system is scanned at a preset period, that is, a service is created and a thread is started to scan the/proc directory of the system at a preset period. Further, in this embodiment, the scanning period is 150ms, so that on one hand, the state of the newly started process can be obtained in time, and on the other hand, the problem of excessive consumption of system resources due to too short scanning time interval is avoided, that is, the system resources can be effectively saved while the newly started process is obtained in time.
Step 102: and judging whether a new process exists according to the scanned process directory, if so, executing the step 103, otherwise, returning to the step 101.
Specifically, whether a newly added process exists is judged, namely whether a newly added process folder exists in a process directory is judged, the/proc directory comprises a plurality of subdirectories named by numbers, the numbers represent the process number of a process currently running by the system, and a plurality of information files related to the corresponding process are contained in the directory, wherein the process folder refers to the subdirectories named by numbers, and if the newly added process folder exists, the newly added process folder can be judged. Whether a newly added process exists is judged by judging whether a newly created process folder exists, and the judgment result is accurate and fast.
In addition, in the specific implementation, judging whether there is a new process according to the scanned process directory specifically includes: judging whether a newly added main process exists according to the scanned process directory; and if the newly added main process exists, judging that the newly added process exists. Because a plurality of processes may be created by the same application, in practical application, the workload of the system can be reduced by only monitoring the main process, and the calculation speed is increased.
In addition, when a user opens some system applications (for example, when a camera is opened), the user does not want to release contents, so when a/proc directory of the system is scanned and process attributes are read, processes belonging to the system applications can be filtered out, and only whether new non-system processes exist or not can be judged. In practical implementation, processes with user IDs between 1000 and 9999 in the process attribute are filtered out (the processes with user IDs between 1000 and 9999 are system processes), and only whether there is a new process with a user ID out of this range, that is, only whether there is a new non-system process.
Step 103: and acquiring the application package name corresponding to the process.
Specifically, the application package name corresponding to the process can be obtained by reading the process attribute.
Step 104: and judging whether the application package name is the same as the application package name obtained by the system auxiliary function callback, if so, executing the step 105, otherwise, returning to the step 101.
Specifically, since the android system provides the access service, when the application is started, the access service is called back to obtain an application packet name of the application, and it is determined whether the application packet name corresponding to the process is the same as the application packet name obtained by the call-back of the system auxiliary function, and if so, step 105 is executed.
Step 105: and judging that the foreground application is started.
Specifically, it is monitored that the application package name corresponding to the newly added process is the same as the application package name obtained by the system auxiliary function callback, that is, the application package names obtained by the two means are the same, and at this time, it can be determined that a foreground application is started.
In specific implementation, the method adopted by the embodiment can be configured into an application program of the system, so that the system has higher authority for self-starting, monitoring other application starting and the like. That is, the present embodiment can be implemented by configuring an apk file and placing the configured apk file in a system/app directory.
Compared with the prior art, the method has the advantages that the process directory of the system is scanned in a preset period, so that the latest condition of the process directory of the system can be obtained in time; when judging that a new process is started, acquiring the application package name corresponding to the process to know which application process is started; and judging whether the application package name is the same as the application package name obtained by the system auxiliary function callback, if so, judging that foreground application is started. Meanwhile, the monitoring results of the system process directory and the system callback are considered, so that the final judgment result is more accurate. In addition, the system process directory is irrelevant to the android system version, and the current android version basically supports the callback function of the system auxiliary function, so that the scheme has good compatibility.
A second embodiment of the present invention relates to a method for monitoring foreground application startup, which is substantially the same as the first embodiment, and mainly differs from the first embodiment in that: in the embodiment, not only the starting of the foreground application can be monitored, but also the content can be released in the foreground application interface. The flowchart of the present embodiment is shown in fig. 2, and will be described in detail below.
Step 201: and scanning the process catalog of the system at a preset period.
Step 202: and judging whether a new process exists according to the scanned process directory, if so, executing the step 203, otherwise, returning to the step 201.
Step 203: and acquiring the application package name corresponding to the process.
Steps 201 to 203 are substantially the same as steps 201 to 203 in the first embodiment, and are not repeated here.
Step 204: and loading the content to be delivered.
Specifically, after it is monitored that a new process is started, the system may load corresponding content with delivery, such as a picture, a video, and the like to be delivered, according to the obtained name of the application package. In specific implementation, an advertisement publisher may also perform advertisement delivery by using the method provided by the embodiment, that is, the content to be loaded is an advertisement to be delivered.
Step 205: and judging whether the application package name is the same as the application package name obtained by the system auxiliary function callback, if so, executing the step 206, otherwise, returning to the step 201.
Step 206: and judging that the foreground application is started.
Step 205 and step 206 are substantially the same as step 104 and step 105 in the first embodiment, and are not described again to avoid repetition.
Step 207: and throwing the content to be thrown to an interface of the started foreground application.
Specifically, after it is determined that the foreground application is started, the loaded content to be delivered can be delivered to the foreground application interface.
In a specific example, before loading the content to be delivered, it is determined whether the newly added process is a new process in a preset application scenario; and if the new process is a new process in the preset application scene, loading the content to be released. The content is only released to the newly added process in the preset scene, and the scene for releasing the content can be limited, wherein the preset scene can be a current interface such as an app store interface or a system launcher interface, and the app store is taken as an example here. Since the applications opened from the application store are all the applications downloaded in the application store, and generally are not system applications, monitoring is limited to be performed only when the current application interface is the application store interface, and the range of the monitored applications can be limited. Specifically, the accessibility service provided by the android system can be used, the application packet name returned by the callback is monitored through the observer registration mode, that is, the current foreground application packet name can be determined, whether the returned application packet name is the specified application packet name or not is determined, and if the returned application packet name is the specified application packet name, the loading of the tape delivery content is started. And the content waiting for loading of the pictures and the videos is released on the newly started application in the preset application scene, so that the range of the released content is limited, and the user experience is ensured. In addition, if the content to be delivered is the advertisement, the advertisement is loaded and delivered only in the preset application scene by designing the preset application scene, so that the disturbance on normal use of other applications by the user can be reduced as much as possible, and the user experience is guaranteed.
Compared with the prior art, the method and the device have the advantages that the speed of scanning the process directory of the system to obtain the application package name is generally higher than the speed of obtaining the application package name by the system auxiliary function callback, the release content is loaded after the application package name of the process is obtained, the content to be released can be prepared in advance, the release can be immediately performed after the foreground application is judged to be started, the content to be released does not need to be loaded after the foreground application is determined to be started, the release speed of the content is improved, and the user experience is improved.
A third embodiment of the present invention relates to a method for monitoring foreground application startup. The third embodiment is substantially the same as the first embodiment, and mainly differs therefrom in that: in a third embodiment of the present invention, a specific method for obtaining an application package name corresponding to a process is provided. The flowchart of the present embodiment is shown in fig. 3, and will be described in detail below.
Step 301: and scanning the process catalog of the system at a preset period.
Step 302: and judging whether a new process exists according to the scanned process directory, if so, executing the step 303, otherwise, returning to the step 301.
Step 303: and acquiring the application package name corresponding to the process.
Steps 301 to 303 are substantially the same as steps 101 to 103 in the first embodiment, and are not repeated here.
Step 304: and judging whether the application package name is the application package name representing that the application is in the starting process, if so, executing a step 307, and otherwise, executing a step 305.
Specifically, the application package name representing that the application is in the process of starting is usually pre-initialized, that is, if the application package name corresponding to the process acquired in step 303 is pre-initialized, step 307 is executed, otherwise, step 305 is executed.
Step 305: and judging whether the application package name is the same as the application package name obtained by the system auxiliary function callback, if so, executing the step 306, otherwise, ending.
Step 306: and judging that the foreground application is started.
Step 306 is substantially the same as step 105 in the first embodiment, and is not repeated here.
Step 307: the period for scanning the system catalog is shortened.
That is, in the present embodiment, it is determined whether the real-process application package name is the same as the application package name obtained by the system support function callback. Before judging whether the application package name is the same as the application package name obtained by the system auxiliary function callback, judging whether the application package name is pre-initialized, if so, shortening the period of scanning a system process directory, for example, shortening the period from 150ms to 10ms until obtaining the real application package name of the process; and judging whether the real application package name is the same as the application package name obtained by the callback of the system auxiliary function.
Compared with the prior art, the method has the advantages that the process directory is scanned to identify the application package name of the application in the starting process when the application is started, the actual application package name is not applied, and if the fact that the application is started is monitored, the period for scanning the process directory of the system is shortened, so that the actual application package name can be obtained as soon as possible after the application is started; the accuracy of the judgment result is ensured by judging whether the real application package name is the same as the application package name obtained by the callback of the system auxiliary function.
A fourth embodiment of the present invention relates to a method for monitoring foreground application startup, and the fourth embodiment is substantially the same as the first embodiment, and mainly differs in that: in the present embodiment, if the application package name is the target application package name, the process is forcibly terminated. The flowchart of the present embodiment is shown in fig. 4, and will be described in detail below.
Step 401: and scanning the process catalog of the system at a preset period.
Step 402: and judging whether a new process exists according to the scanned process directory, if so, executing the step 403, otherwise, returning to the step 401.
Step 403: and acquiring the application package name corresponding to the process.
Steps 401 to 403 are substantially the same as steps 101 to 103 in the first embodiment, and are not repeated here to avoid repetition.
Step 404: and judging whether the application package name is the target application package name, if so, executing step 407, and otherwise, executing step 405.
Specifically, in practical applications, a terminal device may download a rogue application or malware, when monitoring that the application package names are the target application package names, if the application is started at will, a poor user experience may be caused, and user information security may not be guaranteed, so that application roll names corresponding to some known rogue applications or malware may be set as the target application package names in advance, and when monitoring that a process with the target application is started, the process is forcibly ended, and the user is notified to uninstall the application, thereby guaranteeing the user experience.
Step 405: and judging whether the application package name is the same as the application package name obtained by the system auxiliary function callback, if so, executing the step 405, otherwise, returning to the step 401.
Step 406: and judging that the foreground application is started.
Steps 405 to 406 are substantially the same as steps 104 to 105 in the first embodiment, and are not repeated here.
Step 407: and forcibly ending the process and informing the user of unloading.
Specifically, kill instructions may be used to kill the process of the malicious application and alert the user that the application is a malicious application, notifying the user to uninstall.
Compared with the prior art, in the embodiment, in the practical application, the terminal device may download the rogue application or the malicious software, when the application package names are monitored to be the target application package names, if the application is started, poor user experience can be caused, and the user information safety cannot be guaranteed, so that the process is forcibly ended, and the user is informed to unload the application, so that the user information safety can be guaranteed.
The steps of the above methods are divided for clarity, and the implementation may be combined into one step or split some steps, and the steps are divided into multiple steps, so long as the same logical relationship is included, which are all within the protection scope of the present patent; it is within the scope of the patent to add insignificant modifications to the algorithms or processes or to introduce insignificant design changes to the core design without changing the algorithms or processes.
A fifth embodiment of the present invention relates to an apparatus for monitoring foreground application startup, as shown in fig. 5, including:
a scanning module 501, configured to scan a process directory of a system at a preset period;
a first judging module 502, configured to judge whether there is a new process according to the scanned process directory;
an obtaining module 503, configured to obtain an application package name corresponding to the process when the determining module determines that the newly added process exists;
the second determining module 504 is configured to determine whether the application package name is the same as the application package name obtained by the system auxiliary function callback, and if so, determine that a foreground application is started.
In one example, after obtaining the name of the application package corresponding to the process, the method further includes: loading the content to be released; after judging that the foreground application is started, the method further comprises the following steps: and throwing the content to be thrown to an interface of the started foreground application.
In one example, before scanning the process directory of the system at a preset period, the method further includes: and judging whether the current foreground application is a preset application, if so, executing the process catalog of the scanning system in a preset period.
In one example, the method for determining whether there is a new process according to the scanned process directory specifically includes: judging whether a newly added main process exists according to the scanned process directory; and if the newly added main process exists, judging that the newly added process exists.
In one example, the determination of whether there is a new process is specifically as follows: and judging whether a newly added process folder exists in the process directory, and if so, judging that a newly added process exists.
In one example, before determining whether the application package name is the same as the application package name obtained by the system auxiliary function callback, the method further includes: judging whether the application package name is the application package name representing that the application is in the starting process, if so, shortening the period of scanning the system process directory until the real application package name is obtained; judging whether the application package name is the same as the application package name obtained by the system auxiliary function callback, specifically: and judging whether the real application package name is the same as the application package name obtained by the callback of the system auxiliary function.
In one example, after obtaining the name of the application package corresponding to the process, the method further includes: and judging whether the application package name is the target application package name, if so, forcibly ending the process, and informing the user of unloading.
It should be noted that this embodiment is a system example corresponding to the first to third embodiments, and may be implemented in cooperation with the first to third embodiments. The related technical details mentioned in the first to third embodiments are still valid in this embodiment, and are not described herein again in order to reduce repetition. Accordingly, the related-art details mentioned in the present embodiment can also be applied to the first to third embodiments.
It should be noted that each module referred to in this embodiment is a logical module, and in practical applications, one logical unit may be one physical unit, may be a part of one physical unit, and may be implemented by a combination of multiple physical units. In addition, in order to highlight the innovative part of the present invention, elements that are not so closely related to solving the technical problems proposed by the present invention are not introduced in the present embodiment, but this does not indicate that other elements are not present in the present embodiment.
A sixth embodiment of the present invention relates to a terminal device, as shown in fig. 6, including at least one processor 601; and the number of the first and second groups,
a memory 602 communicatively coupled to the at least one processor 601; wherein,
the memory 602 stores instructions executable by the at least one processor 601 to enable the at least one processor 601 to perform the above-described method of listening for foreground application launch.
Where the memory 602 and the processor 601 are coupled by a bus, the bus may comprise any number of interconnected buses and bridges that couple one or more of the various circuits of the processor 601 and the memory 602 together. The bus may also connect various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. A bus interface provides an interface between the bus and the transceiver. The transceiver may be one element or a plurality of elements, such as a plurality of receivers and transmitters, providing a means for communicating with various other apparatus over a transmission medium. The data processed by the processor 601 is transmitted over a wireless medium via an antenna, which further receives the data and transmits the data to the processor 601.
The processor 601 is responsible for managing the bus and general processing and may also provide various functions including timing, peripheral interfaces, voltage regulation, power management, and other control functions. While memory 602 may be used to store data used by processor 601 in performing operations.
A fifth embodiment of the present invention relates to a computer-readable storage medium storing a computer program. The computer program realizes the above-described method embodiments when executed by a processor.
That is, as can be understood by those skilled in the art, all or part of the steps in the method according to the above embodiments may be implemented by a program instructing related hardware, where the program is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps in the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It will be understood by those of ordinary skill in the art that the foregoing embodiments are specific examples for carrying out the invention, and that various changes in form and details may be made therein without departing from the spirit and scope of the invention in practice.

Claims (10)

1. A method for monitoring foreground application starting, comprising:
scanning a process directory of the system at a preset period;
judging whether a newly added process exists according to the scanned process directory, and if so, acquiring an application package name corresponding to the process;
and judging whether the application package name is the same as the application package name obtained by the system auxiliary function callback, if so, judging that foreground application is started.
2. The method for monitoring foreground application startup according to claim 1, further comprising, after the obtaining the application package name corresponding to the process:
loading the content to be released;
after the foreground application is judged to be started, the method further comprises the following steps:
and the content to be delivered is delivered to the interface of the started foreground application.
3. The method for listening to foreground application startup according to claim 2, wherein before loading the content to be delivered, further comprising:
judging whether the newly added process is a newly added process in a preset application scene;
and if the new process is the new process in the preset application scene, the content to be released is loaded.
4. The method for monitoring foreground application startup according to claim 1, wherein the determining whether there is a new process according to the scanned process directory specifically includes:
judging whether a newly added main process exists according to the scanned process directory;
and if the newly added main process exists, judging that the newly added process exists.
5. The method for monitoring foreground application startup according to claim 1, wherein the determining whether there is a new process specifically comprises:
and judging whether the process directory has a newly added process folder or not, and if so, judging that a newly added process exists.
6. The method for monitoring foreground application startup according to any one of claims 1 to 5, wherein judging whether there is a new process according to the scanned process directory specifically includes:
judging whether a newly added non-system process exists according to the scanned process directory;
and if the newly added non-system process exists, acquiring the application package name corresponding to the process.
7. The method for monitoring foreground application startup according to any one of claims 1 to 5, wherein before the determining whether the application package name is the same as an application package name obtained by a system auxiliary function callback, the method further comprises:
judging whether the application package name is an application package name representing that the application is in the starting process, if so, shortening the preset period of the process directory of the scanning system until a real application package name is obtained;
the judging whether the application package name is the same as the application package name obtained by the system auxiliary function callback is specifically as follows:
and judging whether the real application package name is the same as the application package name obtained by the system auxiliary function callback.
8. The method for monitoring foreground application startup according to any one of claims 1 to 5, further comprising, after the obtaining the application package name corresponding to the process:
and judging whether the application package name is a target application package name, if so, forcibly ending the process, and informing a user of unloading.
9. An apparatus for listening for foreground application launches, comprising:
the scanning module is used for scanning the process catalog of the system in a preset period;
the first judgment module is used for judging whether a newly added process exists according to the scanned process directory;
the obtaining module is used for obtaining the application package name corresponding to the process when the judging module judges that the newly added process exists;
and the second judgment module is used for judging whether the application package name is the same as the application package name obtained by the system auxiliary function callback, and if so, judging that the foreground application is started.
10. A terminal device, comprising:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a method of listening for foreground application launch as claimed in any one of claims 1 to 7.
CN201910043153.7A 2019-01-17 2019-01-17 Method and device for monitoring foreground application starting and terminal equipment Expired - Fee Related CN109800567B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910043153.7A CN109800567B (en) 2019-01-17 2019-01-17 Method and device for monitoring foreground application starting and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910043153.7A CN109800567B (en) 2019-01-17 2019-01-17 Method and device for monitoring foreground application starting and terminal equipment

Publications (2)

Publication Number Publication Date
CN109800567A true CN109800567A (en) 2019-05-24
CN109800567B CN109800567B (en) 2021-09-17

Family

ID=66559568

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910043153.7A Expired - Fee Related CN109800567B (en) 2019-01-17 2019-01-17 Method and device for monitoring foreground application starting and terminal equipment

Country Status (1)

Country Link
CN (1) CN109800567B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112650473A (en) * 2019-10-12 2021-04-13 武汉斗鱼鱼乐网络科技有限公司 Attribute monitoring method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102542479A (en) * 2010-12-31 2012-07-04 上海博泰悦臻电子设备制造有限公司 Method and device for displaying advertisings on electronic equipment
CN104142844A (en) * 2014-08-18 2014-11-12 广东欧珀移动通信有限公司 Method and device for clearing processes of mobile terminal
CN104268475A (en) * 2014-09-30 2015-01-07 北京奇虎科技有限公司 Application running system
CN106708501A (en) * 2016-10-25 2017-05-24 腾讯科技(深圳)有限公司 Activity monitoring method and device
CN108171536A (en) * 2017-12-13 2018-06-15 北京奇艺世纪科技有限公司 Startup advertisement methods of exhibiting and device, startup advertisement put-on method and system
CN109670868A (en) * 2018-12-12 2019-04-23 网宿科技股份有限公司 Advertisement placement method, system, terminal device, advertising platform and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102542479A (en) * 2010-12-31 2012-07-04 上海博泰悦臻电子设备制造有限公司 Method and device for displaying advertisings on electronic equipment
CN104142844A (en) * 2014-08-18 2014-11-12 广东欧珀移动通信有限公司 Method and device for clearing processes of mobile terminal
CN104268475A (en) * 2014-09-30 2015-01-07 北京奇虎科技有限公司 Application running system
CN106708501A (en) * 2016-10-25 2017-05-24 腾讯科技(深圳)有限公司 Activity monitoring method and device
CN108171536A (en) * 2017-12-13 2018-06-15 北京奇艺世纪科技有限公司 Startup advertisement methods of exhibiting and device, startup advertisement put-on method and system
CN109670868A (en) * 2018-12-12 2019-04-23 网宿科技股份有限公司 Advertisement placement method, system, terminal device, advertising platform and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
THINBUG: ""如何检测Linux上程序的启动?"", 《HTTPS://WWW.THINBUG.COM/Q/6075013》 *
明朗晨光: ""Android--判断App处于前台还是后台的方案"", 《HTTPS://BLOG.CSDN.NET/U011386173/ARTICLE/DETAILS/79095757》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112650473A (en) * 2019-10-12 2021-04-13 武汉斗鱼鱼乐网络科技有限公司 Attribute monitoring method and device
CN112650473B (en) * 2019-10-12 2022-05-10 武汉斗鱼鱼乐网络科技有限公司 Attribute monitoring method and device

Also Published As

Publication number Publication date
CN109800567B (en) 2021-09-17

Similar Documents

Publication Publication Date Title
CN107832100B (en) APK plug-in loading method and terminal thereof
CN103826215B (en) A kind of method and apparatus for carrying out Root authority management on the terminal device
US8938811B2 (en) Information processing apparatus, method, program, and integrated circuit
EP3509270B1 (en) Data backup method and device, storage medium and electronic apparatus
CN110225078B (en) Application service updating method, system and terminal equipment
CN110968331B (en) Method and device for running application program
CN109254913B (en) Device sharing method and device, electronic device and computer storage medium
CN108563472B (en) Service plug-in loading method and device based on multi-open application
CN105260655A (en) Application program starting protection method, device and system
CN106934272B (en) Application information verification method and device
CN109800567B (en) Method and device for monitoring foreground application starting and terminal equipment
CN112948098B (en) Service unit offline method based on micro-service unit architecture and related device
EP3754486B1 (en) Selectively installing applications based on manifest files
CN112256351B (en) Method for realizing Feign component, method and device for calling micro-service
CN109784041B (en) Event processing method and device, storage medium and electronic device
CN106899630B (en) Thumbnail display method and device for pictures in network disk
CN110865848B (en) Component interception method and terminal equipment
CN107783837B (en) Method and device for performing storage expansion and electronic equipment
US9348667B2 (en) Apparatus for managing application program and method therefor
CN110968471A (en) Program crash problem reporting method, storage medium, electronic device and system
CN111427603B (en) Application program upgrading method and device
CN114816482A (en) Method and device for upgrading block storage service, computer equipment and storage medium
US11050621B2 (en) Client, server and differential upgrade method
CN111339520B (en) Hardware dog-based online control method, electronic equipment and storage medium
CN108762771B (en) Plug-in unloading method and electronic terminal

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20210917

Termination date: 20220117