An application monitoring method, apparatus and computing device
By setting up containers in the operating system and comparing application package names, the problem of not being able to comprehensively monitor the application status in existing technologies is solved, enabling real-time monitoring and status determination of all applications in computing devices.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-27
- Publication Date
- 2026-03-27
AI Technical Summary
Existing operating systems cannot effectively monitor the opening and closing of all applications; they can only monitor the state changes of one or a limited number of applications.
First and second containers are set up in the operating system. The execution path of the process ID is obtained at predetermined intervals to obtain the application package name. The start and stop status of the application is determined by comparing the package name in the container. The installation and uninstallation of the application are monitored in real time by combining the application package name data list.
It enables real-time monitoring of all applications on computing devices, can determine the on/off status of applications, and detect whether applications have been closed and restarted.
Smart Images

Figure CN114510395B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer and operating system, in particular to an application program monitoring method, an application program monitoring device and a computing device. BACKGROUND
[0002] At present, the operating system provides a control method for the application program, which is to control the application program behavior to ensure the system running safety, such as controlling the networking, remote, traffic and other aspects of the application program, to meet the user's demand for security. However, the existing operating system cannot monitor the opening and closing of all application programs, and can only monitor the opening and closing of one or a limited number of application programs.
[0003] Therefore, an application program monitoring method is needed to solve the problems in the above technical solutions. SUMMARY
[0004] Therefore, the present application provides an application program monitoring method to try to solve or at least alleviate the above problems.
[0005] According to one aspect of the present application, an application program monitoring method is provided, which is executed in an operating system of a computing device, and the operating system is arranged with a first container and a second container. The method comprises the steps of: acquiring the execution path of each process number in the operating system every predetermined time, and acquiring the corresponding application package name based on the execution path of each process number; writing each application package name acquired last time as a previous running application package name into the first container; writing each application package name acquired this time as a current running application package name into the second container; and comparing the current running application package name in the second container with the previous running application package name in the first container to obtain the application programs currently in the opening state and the closing state.
[0006] Optionally, in the application program monitoring method according to the present application, the step of comparing the current running application package name in the second container with the previous running application package name in the first container comprises: if the current running application package name in the second container does not exist in the first container, it is determined that the application program corresponding to the current running application package name is currently in the opening state; and if the previous running application package name in the first container does not exist in the second container, it is determined that the application program corresponding to the previous running application package name is currently in the closing state.
[0007] Optionally, in the application program monitoring method according to the present application, the step of writing the last acquired application package name as the previous running application package name into the first container and writing the current acquired application package name as the current running application package name into the second container comprises: writing the first acquired application package name as the previous running application package name into the first container; writing the current acquired application package name as the current running application package name into the second container after every predetermined time; and overwriting the data in the second container into the first container as the new previous running application package name after every time the application program currently in the on state and the off state is obtained, so as to write the next acquired application package name into the second container and compare it with the new previous running application package name in the first container.
[0008] Optionally, in the application program monitoring method according to the present application, the step of acquiring the execution path of each process number in the operating system and acquiring the corresponding application package name based on the execution path of each process number comprises: traversing each process number in the virtual file system of the operating system to acquire the execution path of each process number; and querying the buffer to acquire the corresponding application package name based on the execution path of each process number.
[0009] Optionally, in the application program monitoring method according to the present application, before the step of acquiring the corresponding application package name based on the execution path of each process number, the step of establishing an application package name data list in the buffer comprises: including the association relationship between a plurality of application package names and execution paths in the application package name data list, so as to acquire the application package name corresponding to the execution path of each process number by querying the application package name data list.
[0010] Optionally, in the application program monitoring method according to the present application, the step of establishing an application package name data list in the buffer comprises: acquiring all application package names and corresponding execution paths of the installed applications in the computing device and writing them into the buffer to establish the application package name data list.
[0011] Optionally, in the application program monitoring method according to the present application, the step of establishing an application package name data list in the buffer further comprises: monitoring the installation and uninstallation operations of the application program in real time to acquire the newly installed and / or uninstalled application package names and corresponding execution paths; and updating the application package name data list based on the newly installed and / or uninstalled application package names and corresponding execution paths.
[0012] Optionally, in the application program monitoring method according to the application, the step of obtaining the corresponding application package name based on the execution path of each process number and writing each application package name obtained last time into the first container as a previously running application package name and writing each application package name obtained this time into the second container as a currently running application package name comprises: obtaining the corresponding application package name based on the execution path of each process number and the start time; writing each application package name obtained last time and the corresponding start time into the first container as a previously running application package name and a corresponding previously start time respectively; and writing each application package name obtained this time and the corresponding start time into the second container as a currently running application package name and a corresponding currently start time respectively; and the method further comprises the step of comparing the corresponding currently start time of the currently running application package name in the second container with the corresponding previously start time of the currently running application package name in the first container to determine whether an application program that has been closed and restarted within the predetermined time.
[0013] Optionally, in the application program monitoring method according to the application, the step of determining the application program that has been closed and restarted within the predetermined time comprises: if the corresponding currently start time of the currently running application package name is inconsistent with the corresponding previously start time, determining that the application program corresponding to the currently running application package name has been closed and restarted within the predetermined time.
[0014] Optionally, in the application program monitoring method according to the application, before obtaining the corresponding application package name based on the execution path of each process number, the method comprises the step of judging whether an application package name data list exists, and if not, establishing the application package name data list in a buffer area.
[0015] Optionally, in the application program monitoring method according to the application, the predetermined time is 2 seconds.
[0016] According to an aspect of the application, there is provided an application program monitoring device residing in an operating system of a computing device, wherein the operating system is arranged with a first container and a second container, the device comprising: an obtaining module adapted to obtain the execution path of each process number in the operating system every predetermined time and obtain the corresponding application package name based on the execution path of each process number; a first writing module adapted to write each application package name obtained last time into the first container as a previously running application package name; a second writing module adapted to write each application package name obtained this time into the second container as a currently running application package name; and a comparing module adapted to compare the currently running application package name in the second container with the previously running application package name in the first container to obtain the application program currently in an open state or a closed state.
[0017] According to an aspect of the present application, there is provided a computing device comprising: at least one processor; and a memory storing program instructions configured to be executed by the at least one processor, the program instructions comprising instructions for performing the application monitoring method as described above.
[0018] According to an aspect of the present application, there is provided a readable storage medium storing program instructions which, when read and executed by a computing device, cause the computing device to perform the method as described above.
[0019] According to the technical solution of the present application, an application monitoring method is provided, by which the package name of the currently running application is obtained every predetermined time, and compared with the package name of the application running at the last time point obtained last time, the application currently in the open state and the application in the closed state can be determined. And by comparing the current open time of the currently running application with the previous open time, it can be determined whether the application has been closed and restarted. In this way, the opening and closing of all applications installed in the computing device can be monitored in real time.
[0020] The above description is only a summary of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented according to the content of the specification, and in order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the following specific embodiments of the present application are described. BRIEF DESCRIPTION OF DRAWINGS
[0021] To the accomplishment of the foregoing and related ends, certain illustrative aspects are described herein in connection with the following description and the annexed drawings. These aspects are indicative of various ways in which the principles disclosed herein can be practiced and all aspects and equivalents thereof are intended to be within the scope of the claimed subject matter. The foregoing and other objects, features, and advantages of the disclosure will be apparent from the following description of certain aspects as taken in connection with the accompanying drawings in which like reference numbers in the drawings represent like elements throughout. The detailed description set forth below in connection with the appended drawings is intended as a description of certain aspects and is not intended to represent the only ways in which the concepts described herein can be practiced. The below detailed description sets forth various aspects of the application in connection with the accompanying drawings.
[0022] Figure 1 A schematic diagram of a computing device 100 according to an embodiment of the present application is shown;
[0023] Figure 2 A flowchart of an application monitoring method 200 according to an embodiment of the present application is shown; and
[0024] Figure 3 A schematic diagram of an application monitoring apparatus 300 according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0025] Exemplary embodiments of the present disclosure will now be described in more detail 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 implemented 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.
[0026] Figure 1 This is a schematic block diagram of an example computing device 100.
[0027] like Figure 1 As shown, in the basic configuration 102, the computing device 100 typically includes system memory 106 and one or more processors 104. Memory bus 108 can be used for communication between processor 104 and system memory 106.
[0028] Depending on the desired configuration, processor 104 can be any type of processor, including but not limited to: microprocessor (UP), microcontroller (UC), digital information processor (DSP), or any combination thereof. Processor 104 may include one or more levels of cache such as L1 cache 110 and L2 cache 112, processor core 114, and registers 116. Example processor core 114 may include an arithmetic logic unit (ALU), floating-point unit (FPU), digital signal processing core (DSP core), or any combination thereof. Example memory controller 118 may be used with processor 104, or in some implementations, memory controller 118 may be an internal part of processor 104.
[0029] Depending on the desired configuration, system memory 106 can be any type of memory, including but not limited to volatile memory (such as RAM), non-volatile memory (such as ROM, flash memory, etc.), or any combination thereof. System memory 106 may include operating system 120, one or more applications 122, and program data 124. In some embodiments, application 122 may be arranged to execute instructions on the operating system using program data 124 by one or more processors 104.
[0030] The computing device 100 also includes a storage device 132, which includes a removable storage device 136 and a non-removable storage device 138.
[0031] The computing device 100 can also include a storage interface bus 134. The storage interface bus 134 enables communication between the storage devices 132 (e.g., removable storage 136 and non-removable storage 138) and the basic configuration 102 via the bus / interface controller 130. The operating system 120, the application programs 122, and the data 124 are likely stored on the removable storage 136 and / or the non-removable storage 138 during operation of the computing device 100, and are likely loaded into the system memory 106 via the storage interface bus 134 at boot-up by the one or more processors 104.
[0032] The computing device 100 can also include a bus / interface bus 140 that facilitates communication from various interface devices (e.g., output devices 142, peripheral interfaces 144, and communication devices 146) to the basic configuration 102 via the bus / interface controller 130. Example output devices 142 include graphical
[0033] The network communication link can be one example of a communication media. Communication media can typically be embodied by computer readable instructions, data structures, program modules, and other data in a modulated data signal, such as a carrier wave or other transport mechanism, and can include any information delivery media. A "modulated data signal" can be a signal that has one or more of its characteristics set or changed in such a manner as to encode information in the signal. By way of example, and not limitation, communication media can include wired media such as a wired network or direct-wired connection, and wireless media such as acoustic, radio frequency (RF), microwave, infrared (IR) and other wireless media. The term computer readable media as used herein can include both storage media and communication media.
[0034] The computing device 100 can be implemented as a personal computer including desktop and notebook configurations. Of course, the computing device 100 can also be implemented as part of a small form factor portable (or mobile) electronic device such as a cell phone, a digital camera, a personal digital assistant (PDA), a personal media player device, a wireless web browsing device, a personal headset, an application-specific device, or a hybrid device that can include any of the above functions. The computing device 100 can even be implemented as a server, such as a file server, a database server, an application server, and a web server, among others. Embodiments of the present application are not limited in this regard.
[0035] In an embodiment according to the present application, the operating system of the computing device 100 is configured to execute the application monitoring method 200 according to the present application. In this regard, the operating system of the computing device 100 contains a plurality of program instructions for executing the application monitoring method 200 according to the present application, which can be read and executed by the processor so that the computing device 100 monitors the opening and closing of all applications installed in the computing device by executing the application monitoring method 200 according to the present application.
[0036] According to an embodiment of the present application, the operating system of the computing device 100 hosts an application monitoring apparatus 300, which contains a plurality of program instructions for executing the application monitoring method 200 according to the present application, so that the application monitoring method 200 according to the present application can be executed in the application monitoring apparatus 300 of the operating system.
[0037] Figure 2 A flowchart of the application monitoring method 200 according to an embodiment of the present application is shown. The application monitoring method 200 can be executed in the application monitoring apparatus 300 of the operating system of a computing device, such as the aforementioned computing device 100. It should be noted that the operating system of the present application is arranged with a first container and a second container.
[0038] As shown in FIG. 2, the method 200 begins at step S210. Figure 2
[0039] In step S210, the execution path of each process number in the virtual file system of the operating system is obtained every predetermined time, and the corresponding application package name is obtained based on the execution path of each process number.
[0040] It should be noted that each process number corresponds to a process of a running application, and by obtaining the package name of the application corresponding to the execution path of the process number, the running application can be determined, which is the application in the opening state.
[0041] In one implementation, the virtual file system can be implemented as / proc directory, but the present application is not limited thereto. The specific directory of the virtual file system can be determined according to the type of the operating system.
[0042] In one embodiment, every predetermined time, each process number in the virtual file system of the operating system is traversed, and the execution path of each process number is obtained, and then, based on the execution path of each process number, the application package name corresponding to the execution path of the process number is queried from the buffer. In one implementation, by starting a thread and initializing a timer, the timer is used to implement the traversal of all process numbers in the virtual file system every predetermined time. Here, the predetermined time is, for example, 2 seconds, but the present application is not limited thereto.
[0043] In step S220, each application package name obtained last time is written into the first container as the previously running application package name. In this way, the application corresponding to each previously running application package name in the first container is the application running at the last time point.
[0044] In step S230, each application package name obtained this time is written into the second container as the currently running application package name. In this way, the application corresponding to each previously running application package name in the second container is the application running at the current time point.
[0045] Finally, in step S240, the currently running application package name in the second container is compared with the previously running application package name in the first container to obtain the application currently in the open state and the closed state.
[0046] Specifically, when comparing the currently running application package name in the second container with the previously running application package name in the first container, if the currently running application package name in the second container does not exist in the first container, it can be determined that the application corresponding to the currently running application package name is currently in the open state (i.e., changed from the previous closed state to the current open state). If the previously running application package name in the first container does not exist in the second container, it can be determined that the application corresponding to the previously running application package name is currently in the closed state (i.e., changed from the previous open state to the current closed state).
[0047] According to one embodiment of the present application, steps S210-S230 can be further implemented as:
[0048] In step S210, every predetermined time, the execution path of each process number in the operating system is obtained, the corresponding application package name is obtained based on the execution path of each process number, and the open time of the application corresponding to the application package name is obtained.
[0049] In step S220, each application package name and corresponding start time acquired last time are written into the first container as previous running application package name and corresponding previous start time respectively.
[0050] In step S230, each application package name and corresponding start time acquired this time are written into the second container as current running application package name and corresponding current start time respectively.
[0051] In this way, not only the application package names are stored in the first container and the second container, but also the start times corresponding to the application package names are stored. The application package names and corresponding start times are stored in the containers in association.
[0052] Based on the fact that the start times corresponding to the application package names are stored in the first container and the second container, in the application program monitoring method 200 of the present application, the current start time corresponding to the current running application package name in the second container can be compared with the previous start time corresponding to the same package name (i.e. the current running application package name) in the first container to determine whether the application program corresponding to the current running application package name has been closed and restarted within a predetermined time.
[0053] It can be understood that if the current start time corresponding to the current running application package name is inconsistent with the previous start time, it is determined that the application program corresponding to the current running application package name has been closed and restarted within a predetermined time. Conversely, if the current start time corresponding to the current running application package name is consistent with the previous start time, it is determined that the application program corresponding to the current running application package name has not been closed and restarted within a predetermined time.
[0054] In an embodiment of the present application, the writing of each application package name acquired last time into the first container as previous running application package name and the writing of each application package name acquired this time into the second container as current running application package name can be implemented by the following method:
[0055] Each application package name (and corresponding start time) acquired first time is written into the first container as previous running application package name (and corresponding previous start time). Each application package name (and corresponding start time) acquired at the current time point (this time) after waiting for a predetermined time each time is written into the second container as current running application package name (and corresponding current start time).
[0056] After comparing the current running application package name in the second container with the previous running application package name in the first container to obtain the application currently in the open state and the application in the closed state in each pass, the current running application package name in the second container is overwritten to the first container, so that each current running application package name obtained this time in the second container is written into the first container as a new previous running application package name (as the basis for the next comparison) to replace the original application package name in the first container, so that (for the next time) each application package name obtained last time is written into the first container as a previous running application package name. Next, at a new time point after waiting for a predetermined time again, each application package name obtained next time can be written into the second container as a new current running application package name, and each new current running application package name written in the second container is compared with the new previous running application package name in the first container to obtain the application in the open state and the application in the closed state at the new time point.
[0057] In addition, after comparing the current open time corresponding to the current running application package name in the second container with the previous open time corresponding to the same package name in the first container to determine the application that completes closing and restarting within a predetermined time, the current open time corresponding to the current running application package name in the second container is overwritten to the first container, so that each current running application package name obtained this time in the second container and the corresponding current open time are written into the first container as a new previous running application package name and the corresponding new previous open time, as the basis for comparing the application open time next time to determine the application that completes closing and restarting within the next predetermined time.
[0058] It should be noted that, before obtaining the corresponding application package name based on the execution path of each process number, the application package name data list including the association relationship between the plurality of application package names and the execution paths is established in the buffer. Here, the plurality of application package names cover the package names of all applications installed in the computing device 100, and each item in the application package name data list includes an application package name and the corresponding execution path. In this way, after obtaining the execution path of each process number, the application package name corresponding to the execution path of each process number can be obtained by querying the application package name data list in the buffer.
[0059] In one embodiment, the application package name data list is established by obtaining all application package names and the corresponding execution paths of the installed applications in the computing device and writing them into the buffer.
[0060] Specifically, the application package name data list can be established in the buffer by the following method:
[0061] First, a buffer for storing data at high speed is established, for example, by establishing a cache.db database with fields for application package names and their associated files. Subsequently, all application package names installed in the computing device 100, and the associated files for each application package name, can be obtained and written to the cache.db database. Further, the associated files for each application package name are filtered (non-executable path data is filtered out) so that only the executable paths corresponding to the application package names are obtained after filtering. Finally, a package_app_file list is established in the buffer based on all the installed application package names and their corresponding executable paths obtained.
[0062] Here, in an implementation, all the application package names installed in the computing device 100 and their corresponding associated files can be obtained by using the dpkg-query command. When filtering the associated files of the application package names, files that are not executable paths, such as.svg,.png,.qm,.htm,.gif,.jpg, and desktop paths, can be filtered out, and only the executable paths corresponding to the application package names can be retained, so as to reduce the amount of cached data, avoid high memory usage when writing data to the buffer, and reduce the system burden.
[0063] Further, the installer interface is also called to monitor the installation and uninstallation of applications in real time, so as to obtain newly installed and / or uninstalled application package names, and obtain the executable paths corresponding to the newly installed and / or uninstalled application package names, and update the package_app_file list based on the newly installed and / or uninstalled application package names and their corresponding executable paths. Here, the newly installed and / or uninstalled application package names are obtained by calling the installer interface, and then the dpkg-query command is used to query the associated files of the newly installed and / or uninstalled application package names, the executable paths corresponding to the newly installed and / or uninstalled application package names are obtained by filtering the associated files, and finally, the package_app_file list is updated based on the newly installed and / or uninstalled application package names and their corresponding executable paths.
[0064] Here, the newly installed application package names and their corresponding executable paths are written to the package_app_file list, which can achieve the updating of the package_app_file list; the uninstalled application package names and their corresponding executable paths are deleted from the package_app_file list, which can achieve the updating of the package_app_file list.
[0065] In one embodiment, before the application package name corresponding to each execution path of each process number is obtained based on the execution path of each process number, it is determined whether the application package name data list of the buffer exists. If the application package name data list of the buffer does not exist, the buffer and the application package name data list are re-established by the above method. In this way, the situation that the application package name corresponding to the execution path of the process number cannot be obtained due to the deletion of the application package name data list by mistake is avoided.
[0066] Figure 3 A schematic diagram of an application monitoring device 300 according to one embodiment of the present application is shown. The application monitoring device 300 resides in the operating system of a computing device (for example, the computing device 100 described above) and is adapted to perform the application monitoring method 200 of the present application.
[0067] As shown in Figure 3 The application monitoring device 300 comprises, in sequence, an obtaining module 310, a first writing module 320, a second writing module 330 and a comparing module 340. The obtaining module 310 is adapted to obtain the execution path of each process number in the virtual file system of the operating system at every predetermined time and obtain the application package name corresponding to each execution path of each process number. The first writing module 320 is used to write each application package name obtained last time as the previously running application package name into the first container. The second writing module 330 is used to write each application package name obtained this time as the currently running application package name into the second container. The comparing module 340 is adapted to compare the currently running application package name in the second container with the previously running application package name in the first container to obtain the application programs currently in the open state and the closed state.
[0068] It should be noted that the obtaining module 310 is used to perform the above-mentioned step S210, the first writing module 320 is used to perform the above-mentioned step S220, the second writing module 330 is used to perform the above-mentioned step S230, and the comparing module 340 is used to perform the above-mentioned step S240. Here, the specific execution logic of the obtaining module 310, the first writing module 320, the second writing module 330 and the comparing module 340 is described above in the method 200 with respect to steps S210-S240, and will not be described again here.
[0069] According to the application monitoring method of the present application, by obtaining the package name of the currently running application at every predetermined time and comparing it with the package name of the application running at the last time point obtained last time, the application programs currently in the open state and the closed state can be determined. Furthermore, by comparing the current opening time of the currently running application with the previous opening time, it can be determined whether the application program has been closed and restarted. In this way, the opening and closing of all application programs installed in the computing device are monitored in real time.
[0070] The various techniques described herein can be implemented in connection with hardware or software or, where appropriate, with a combination of both. Thus, the methods and apparatus of the application, or certain aspects or portions thereof, can take the form of program code (i.e., instructions) embodied in tangible media, such as removable hard disks, USB flash drives, optical tapes, CD-ROMs, or any other machine-readable storage medium, wherein, when the program code is loaded into and executed by a machine, such as a computer, the machine becomes an apparatus for practicing the subject application.
[0071] Where the program code is executed on a programmable computer, the computing device generally includes a processor, a storage medium readable by the processor (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device. The storage medium is configured to store program code which, when executed by the processor, carries out the application monitoring methods of the application.
[0072] In the context of this document, a "storage medium" can be any physical medium that stores data and / or instructions for use by an instruction execution system. The storage medium can have stored therein computer software or a computer program, including one or more computer instructions, that are executable by a computer under the control of an operating system and that implement an application.
[0073] In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the application can be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been described in detail in order to avoid obscuring the understanding of this description.
[0074] In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the application can be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been described in detail in order to avoid obscuring the understanding of this description.
[0075] Similarly, it should be understood that, in order to streamline this disclosure and aid in understanding one or more aspects of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof in the above description of exemplary embodiments of the invention. However, this method of disclosure should not be construed as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Therefore, the claims following the detailed description are hereby expressly incorporated into that detailed description, wherein each claim itself is a separate embodiment of the invention.
[0076] Those skilled in the art will understand that modules, units, or components of the devices disclosed in the examples herein can be arranged in the devices described in this embodiment, or alternatively, can be located in one or more devices different from the devices in this example. The modules in the foregoing examples can be combined into a single module or, in addition, can be divided into multiple sub-modules.
[0077] Those skilled in the art will understand that modules in the device of the embodiments can be adaptively changed and placed in one or more devices different from that embodiment. Modules, units, or components in the embodiments can be combined into a single module, unit, or component, and further, they can be divided into multiple sub-modules, sub-units, or sub-components. Except where at least some of such features and / or processes or units are mutually exclusive, any combination can be used to combine all features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all processes or units of any method or device so disclosed. Unless expressly stated otherwise, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) may be replaced by an alternative feature that serves the same, equivalent, or similar purpose.
[0078] Furthermore, those skilled in the art will understand that although some embodiments described herein include certain features included in other embodiments but not others, combinations of features from different embodiments are meant to be within the scope of the invention and form different embodiments.
[0079] Furthermore, some of the embodiments described herein are methods or combinations of method elements that can be implemented by a processor of a computer system or by other means of performing the functions. Therefore, a processor having the necessary instructions for implementing the methods or method elements forms means for implementing the methods or method elements. Furthermore, the elements described herein in the apparatus embodiments are examples of means for implementing the functions performed by elements for the purposes of carrying out the invention.
[0080] As used herein, unless otherwise indicated, the use of the ordinal adjectives "first", "second", "third", etc., are to add specificity and difference to a term, and are not intended to indicate a temporal or chronological order or sequence. Except to the extent necessary or implicit from the discussion herein, as readily apparent to those of ordinary skill in the art, no portion of the specification is indicative of an ordering.
[0081] While the present application has been described in connection with limited number of embodiments, those skilled in the art will appreciate that numerous modifications and variations therefrom can be made without departing from the scope of the present application as set forth in the limitations to follow. Moreover, the language used in this specification has been chosen for readability and instructional purposes and can not have been selected to delineate or circumscribe the subject application. Accordingly, the disclosure of the present application is intended to be illustrative, but not limiting, of the scope of the application, which is set forth with particularity in the appended claims.
Claims
1. An application monitoring method, executed in an operating system of a computing device, the operating system having a first container and a second container arranged thereon, the method comprising the steps of: Every predetermined time, an execution path of each process number in the operating system is acquired, and a corresponding application package name is acquired based on the execution path of each process number, including: traversing each process number in a virtual file system of the operating system to obtain an execution path of each process number; inquiring from a buffer based on the execution path of each process number to obtain a corresponding application package name; writing each application package name obtained last time as a previous running application package name into the first container; writing each application package name obtained this time as a current running application package name into the second container; and comparing the current running application package name in the second container with the previous running application package name in the first container to obtain an application currently in an open state and a closed state. The step of comparing the current running application package name in the second container with the previous running application package name in the first container comprises:
2. The method of claim 1, wherein, if the current running application package name in the second container does not exist in the first container, determining that the application corresponding to the current running application package name is currently in the open state; if the previous running application package name in the first container does not exist in the second container, determining that the application corresponding to the previous running application package name is currently in the closed state. The step of writing each application package name obtained last time as a previous running application package name into the first container and writing each application package name obtained this time as a current running application package name into the second container comprises:
3. The method of claim 1, wherein, writing each application package name obtained first time as a previous running application package name into the first container; after every predetermined time, writing each application package name obtained this time as a current running application package name into the second container; and after each time obtaining an application currently in an open state and a closed state, overwriting the current running application package name in the second container into the first container as a new previous running application package name, so as to write each application package name obtained next time into the second container and compare with the new previous running application package name in the first container. Before obtaining a corresponding application package name based on the execution path of each process number, comprising the step of:
4. The method of any one of claims 1-3, wherein, establishing an application package name data list in the buffer, wherein the application package name data list comprises an association between a plurality of application package names and execution paths, so as to obtain an application package name corresponding to the execution path of each process number by inquiring the application package name data list. The step of establishing an application package name data list in the buffer comprises:
5. The method of claim 4, wherein, obtaining all application package names and corresponding execution paths of the computing device installed and writing into the buffer to establish an application package name data list. The step of establishing an application package name data list in the buffer further comprises:
6. The method of claim 5, wherein, real-time monitoring of the installation and uninstallation operations of the application to obtain newly installed and / or uninstalled application package names and corresponding execution paths; updating the application package name data list based on the newly installed and / or uninstalled application package names and corresponding execution paths. 7. The method of any one of claims 1-3, wherein, The step of obtaining the application package name corresponding to each process number based on the execution path of each process number, and obtaining the start time corresponding to the application package name, comprises: The step of obtaining the application package name corresponding to each process number based on the execution path of each process number, and obtaining the start time corresponding to the application package name, comprises: The step of obtaining the application package name corresponding to each process number based on the execution path of each process number, and obtaining the start time corresponding to the application package name, comprises: The step of obtaining the application package name corresponding to each process number based on the execution path of each process number, and obtaining the start time corresponding to the application package name, comprises: The method further comprises the steps of: The step of determining the application that is closed and restarted within the predetermined time comprises:
8. The method of claim 7, wherein, The step of determining the application that is closed and restarted within the predetermined time comprises: 9.An application monitoring apparatus residing in an operating system of a computing device, wherein the operating system is arranged with a first container and a second container, the apparatus comprising: An obtaining module adapted to obtain the execution path of each process number in the operating system every predetermined time, and obtain the application package name corresponding to each process number based on the execution path of each process number, and further adapted to traverse each process number in the virtual file system of the operating system to obtain the execution path of each process number, and obtain the application package name corresponding to each process number from the buffer based on the execution path of each process number; A first writing module adapted to write each application package name obtained last time as the previous running application package name into the first container; A second writing module adapted to write each application package name obtained this time as the current running application package name into the second container; And A comparison module adapted to compare the current running application package name in the second container with the previous running application package name in the first container to obtain the application that is currently in the start state or the close state. 10.A computing device comprising: at least one processor; and a memory storing program instructions configured to be executed by the at least one processor, wherein the program instructions comprise instructions for performing the method of any one of claims 1-8. 11.A readable storage medium storing program instructions, which, when read and executed by a computing device, cause the computing device to perform the method of any one of claims 1-8.
Citation Information
Patent Citations
Application program abnormal log processing method and system
CN106776093A
Application program management and control method, device and equipment
CN109800566A