CN112463544A - Program operation monitoring method, device, equipment and storage medium - Google Patents

Program operation monitoring method, device, equipment and storage medium Download PDF

Info

Publication number
CN112463544A
CN112463544A CN202011496512.3A CN202011496512A CN112463544A CN 112463544 A CN112463544 A CN 112463544A CN 202011496512 A CN202011496512 A CN 202011496512A CN 112463544 A CN112463544 A CN 112463544A
Authority
CN
China
Prior art keywords
memory
program
preset
data
target program
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
CN202011496512.3A
Other languages
Chinese (zh)
Other versions
CN112463544B (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.)
Shenzhen Ruan Niu Technology Group Co ltd
Original Assignee
Afirstsoft 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 Afirstsoft Co Ltd filed Critical Afirstsoft Co Ltd
Priority to CN202011496512.3A priority Critical patent/CN112463544B/en
Publication of CN112463544A publication Critical patent/CN112463544A/en
Application granted granted Critical
Publication of CN112463544B publication Critical patent/CN112463544B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/302Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/544Buffers; Shared memory; Pipes
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention relates to the field of memory monitoring, and discloses a method, a device, equipment and a storage medium for monitoring program operation. The method comprises the following steps: accessing a target program to be monitored through a preset program interface, and acquiring a virtual address of the target program; scanning memory data in a preset shared memory area, inquiring all mapping virtual addresses in the memory data, and generating a mapping virtual address set; judging whether the virtual address exists in the mapping virtual address set or not; if yes, sending the memory occupation information of the target program to a preset management port; if the shared memory area does not exist, circularly scanning the memory data in the shared memory area according to the preset reset duration.

Description

Program operation monitoring method, device, equipment and storage medium
Technical Field
The present invention relates to the field of memory monitoring, and in particular, to a method, an apparatus, a device, and a storage medium for monitoring program operation.
Background
At present, the monitoring and control of a program mainly aims at the judgment between the starting and the exiting, and in the monitoring process of the program starting, the monitoring program in the prior art needs to perform memory opening-up to realize the monitoring of the memory, but the memory resource is occupied, and a program monitoring technology capable of reducing the occupation of the memory resource is needed.
Disclosure of Invention
The invention mainly aims to solve the technical problem that the monitoring program occupies too much memory when monitoring the program.
The first aspect of the present invention provides a program operation monitoring method, including the steps of:
accessing a target program to be monitored through a preset program interface, and acquiring a virtual address of the target program;
scanning memory data in a preset shared memory area, inquiring all mapping virtual addresses in the memory data, and generating a mapping virtual address set;
judging whether the virtual address exists in the mapping virtual address set or not;
if yes, sending the memory occupation information of the target program to a preset management port;
if the shared memory area does not exist, circularly scanning the memory data in the shared memory area according to the preset reset duration.
Optionally, in a first implementation manner of the first aspect of the present invention, before accessing, through a preset program interface, an object program to be monitored and acquiring a virtual address of the object program, the method further includes:
calling a preset state query function, and reading a state setting value of a preset shared memory area;
judging whether the state setting value is zero or not;
if not, sending the information that the target program cannot occupy the memory to a preset management port;
if the value is zero, accessing a preset program interface.
Optionally, in a second implementation manner of the first aspect of the present invention, after the sending the memory usage information of the target program to a preset management port, the method further includes:
scanning the memory data in the shared memory area at regular time according to preset monitoring duration;
judging whether the memory occupied data corresponding to the target program in the memory data is removed;
and if the target program is removed, sending the closing information of the target program to the management port.
Optionally, in a third implementation manner of the first aspect of the present invention, the determining whether the memory usage data corresponding to the target program in the memory data is removed includes:
calling a preset process query function, and reading a return value corresponding to memory occupied data in the memory data; if the return value is null, determining that the memory occupied data is removed;
and if the return value is not null, determining that the memory usage data is not removed.
Optionally, in a fourth implementation manner of the first aspect of the present invention, the periodically scanning, according to a preset monitoring duration, memory data in the shared memory area includes:
reading and storing a target identification value corresponding to the memory occupation data;
and reading all the memory identification values in the shared memory area at regular time according to preset monitoring duration to obtain a memory identification value set.
Optionally, in a fifth implementation manner of the first aspect of the present invention, the determining whether the memory usage data corresponding to the target program in the memory data is removed includes:
judging whether the target identification value exists in the memory identification value set or not;
if so, confirming that the memory occupied data corresponding to the target program is not removed; and if the target program does not exist, confirming that the memory occupation data corresponding to the target program is removed.
Optionally, in a sixth implementation manner of the first aspect of the present invention, the cyclically scanning, according to a preset reset duration, memory data in the shared memory area includes:
reading a preset reset duration, a preset cycle threshold value N and a cycle statistic value M, wherein M, N is a positive integer, and N is not less than M;
scanning memory data in the shared memory area according to the reset duration, and adding 1 to the assignment of the cycle statistic value M to obtain a new cycle statistic value M;
judging whether the cycle statistic value M is equal to the cycle threshold value N;
if so, stopping circularly scanning the memory data in the shared memory area;
and if not, re-timing based on the reset duration.
A second aspect of the present invention provides an operation monitoring apparatus for a program, including:
the system comprises an acquisition module, a monitoring module and a monitoring module, wherein the acquisition module is used for accessing a target program to be monitored through a preset program interface and acquiring a virtual address of the target program;
the system comprises a query module, a mapping module and a storage module, wherein the query module is used for scanning memory data in a preset shared memory area, querying all mapping virtual addresses in the memory data and generating a mapping virtual address set;
the judging module is used for judging whether the virtual address exists in the mapping virtual address set or not;
the sending module is used for sending the memory occupation information of the target program to a preset management port if the memory occupation information exists;
and the circulating module is used for circularly scanning the memory data in the shared memory area according to the preset reset duration if the memory data does not exist.
A third aspect of the present invention provides an operation monitoring apparatus of a program, including: a memory having instructions stored therein and at least one processor, the memory and the at least one processor interconnected by a line; the at least one processor calls the instructions in the memory to cause the operation monitoring device of the program to execute the operation monitoring method of the program.
A fourth aspect of the present invention provides a computer-readable storage medium having stored therein instructions, which, when executed on a computer, cause the computer to execute the operation monitoring method of the program described above.
Drawings
Fig. 1 is a schematic diagram of a first embodiment of a program operation monitoring method in the embodiment of the present invention;
fig. 2 is a schematic diagram of a second embodiment of the program operation monitoring method according to the embodiment of the present invention;
fig. 3 is a schematic diagram of a third embodiment of the program operation monitoring method in the embodiment of the present invention;
fig. 4 is a schematic diagram of an embodiment of an operation monitoring apparatus of a program in the embodiment of the present invention;
fig. 5 is a schematic diagram of another embodiment of the operation monitoring device of the program in the embodiment of the present invention;
fig. 6 is a schematic diagram of an embodiment of the operation monitoring device of the program in the embodiment of the present invention.
Detailed Description
The embodiment of the invention provides a method, a device, equipment and a storage medium for monitoring program operation.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be practiced otherwise than as specifically illustrated or described herein. Furthermore, the terms "comprises," "comprising," or "having," and any variations thereof, are intended to cover non-exclusive inclusions, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
For convenience of understanding, a specific flow of the embodiment of the present invention is described below, and referring to fig. 1, a first embodiment of the method for monitoring the operation of the program in the embodiment of the present invention includes:
101. accessing a target program to be monitored through a preset program interface, and acquiring a virtual address of the target program;
in this embodiment, the interface API is an existing setting for program reading in the Windows system, and when accessing the target program, the target program is accessed through inter-process communication IPC, or the target program may be queried and accessed according to the registry, and the logical address of the target program in the entire Windows system, that is, the virtual address {0x0vffv2000-0x7FFFFFFF }.
102. Scanning memory data in a preset shared memory area, inquiring all mapping virtual addresses in the memory data, and generating a mapping virtual address set;
in this embodiment, when scanning the shared memory data, the IPC-CREAT function may be used, or the IPC-EXCL function may be used for scanning, and also, based on the name of the target data, ftok () may be called by pathname id to open inter-process communication, or functions such as write (), send (), read (), msgsnd () and the like may be used to query the shared memory location and read the memory data. Looking up all mapping addresses of the memory in a management table of the memory data, wherein the mapping address set forms a {0x005230-0x7FFFFFFF, 0x 0055637-0 x7FFFFgfggF, 0x0ggg5230-0x7FFFFF } mapping virtual address set.
103. Judging whether a virtual address exists in the mapping virtual address set or not;
in this embodiment, the virtual address is {0x0vffv2000-0x7FFFFFFF }, and the presence of matching data in the set of mapped virtual addresses {0x005230-0x7 fffffffff, 0x 0055635-0 x7FFFFgfggF, 0x0ggg5230-0x7 fffffffff } is determined using a rule of thumb.
In another embodiment, characters of the virtual address may be set to perform floating point value conversion, each address in the mapping virtual address set also performs floating point value conversion, and finally, it is determined whether the floating point value of the virtual address has a floating point value that is the same as the mapping virtual address set, and if not, it is determined that the virtual address of the target program does not exist in the mapping virtual address set.
104. If yes, sending the memory occupation information of the target program to a preset management port;
in this embodiment, if the same judgment is obtained, the { id object program has already started the memory occupation } is sent to a preset management port, where the management port may be a wireless connection or a limited connection, and is intended to display the whole information for connecting a display screen, to remind a user of monitoring the information, and may call a voice reminding function or call a mobile phone vibration module to remind the user of monitoring the information in the reminding process.
105. If the shared memory area does not exist, circularly scanning the memory data in the shared memory area according to the preset reset duration.
In this embodiment, the preset reset duration is 15 seconds, a timer of 15 seconds is set, the mapping virtual address set in the shared memory area is scanned every 15 seconds, and whether a virtual address {0x0vffv2000-0x7FFFFFFF } exists is determined by reading according to the new mapping virtual address set.
In the embodiment of the invention, the mapping address of each memory data in the shared memory is read, whether the virtual address of the target program exists or not is judged according to different data of the mapping address, if the addresses are not matched, the memory is not occupied, and if the addresses are matched, the memory is occupied, so that the monitoring program can occupy less memory resources to complete the program monitoring task.
Referring to fig. 2, a second embodiment of the method for monitoring program operation according to the embodiment of the present invention includes:
201. calling a preset state query function, and reading a state setting value of a preset shared memory area;
in this embodiment, the call function queries the state setting value of shmflg.
202. Judging whether the state setting value is zero or not;
in this embodiment, there are two types of status values, one is SHM-RDONLY indicating that it is readable but not memory writable, and the other is 0 indicating that the shared memory is writable and readable.
203. If not, sending the information that the target program cannot occupy the memory to a preset management port;
in this embodiment, if not, it is determined to be SHM-RDONLY and { the memory cannot be occupied } is sent to the display port.
204. If the number of the access points is zero, accessing a preset program interface;
in this embodiment, if the state value is 0, the API interface is directly accessed to read the target program.
205. Accessing a target program to be monitored through a preset program interface, and acquiring a virtual address of the target program;
206. scanning memory data in a preset shared memory area, inquiring all mapping virtual addresses in the memory data, and generating a mapping virtual address set;
207. judging whether a virtual address exists in the mapping virtual address set or not;
208. if yes, sending the memory occupation information of the target program to a preset management port;
205-208 are already described in the first embodiment, reference may be made to the foregoing description, and no further description is provided herein.
209. Scanning memory data in the shared memory area at regular time according to preset monitoring duration;
in this embodiment, after it is determined that the target program opens up the memory in the memory area, the returned Key value of the memory area, that is, the returned value, may be obtained, each returned value is unique, and the scanning of the memory data is to query the Key value returned by the memory.
210. Calling a preset process query function, and reading a return value corresponding to memory occupied data in the memory data;
in this embodiment, a return value is queried by calling the ftok () query function.
211. If the return value is null, determining that the memory occupied data is removed;
in this embodiment, if the returned value is IPC-CREAT or IPC-EXCL is "NULL", it indicates that the memory has been removed, and the next step is to newly open a memory, and the opening process can be cancelled.
212. Sending the closing information of the target program to the management port;
in this embodiment, the port that sends { memory usage has been removed } to the display device, i.e., the management device, is not removed.
213. If the return value is not null, determining that the memory occupied data is not removed;
in this embodiment, if the returned value is IPC-CREAT or IPC-EXCL, it indicates that the memory is not removed.
214. If the shared memory area does not exist, circularly scanning the memory data in the shared memory area according to the preset reset duration.
The present embodiment has been described in the first embodiment, and reference may be made to the foregoing description, which is not repeated herein.
In the embodiment of the invention, the mapping address of each memory data in the shared memory is read, whether the virtual address of the target program exists or not is judged according to different data of the mapping address, if the addresses are not matched, the memory is not occupied, and if the addresses are matched, the memory is occupied, so that the monitoring program can occupy less memory resources to complete the program monitoring task.
Referring to fig. 3, a third embodiment of the method for monitoring program operation according to the embodiment of the present invention includes:
301. accessing a target program to be monitored through a preset program interface, and acquiring a virtual address of the target program;
302. scanning memory data in a preset shared memory area, inquiring all mapping virtual addresses in the memory data, and generating a mapping virtual address set;
303. judging whether a virtual address exists in the mapping virtual address set or not;
304. if yes, sending the memory occupation information of the target program to a preset management port;
the embodiments 301-304 have been described in the first embodiment, and reference may be made to the foregoing description, which is not repeated herein.
305. Reading and storing a target identification value corresponding to the memory occupied data;
in this embodiment, after the monitoring target program is occupied in the memory area after the opening program, a specific key value is given.
306. Reading all memory identification values in the shared memory area regularly according to preset monitoring duration to obtain a memory identification value set;
in this embodiment, all the distributed key values in the shared memory area are read, and all the key values are combined into an integral memory identification value set.
307. Judging whether the target identification value exists in the memory identification value set or not;
in this embodiment, whether the key value of the target program is data in the key value set is determined.
308. If so, confirming that the memory occupied data corresponding to the target program is not removed;
in this embodiment, the target program is marked as "1233", that is, the corresponding occupied data is not removed.
309. If the target program does not exist, confirming that the memory occupied data corresponding to the target program is removed;
in this embodiment, the target program is marked as "153", that is, the corresponding memory usage data has been successfully removed.
310. If the target program is removed, sending the closing information of the target program to the management port;
the embodiment has been described in the second embodiment, and reference may be made to the foregoing description, which is not repeated herein.
311. If the preset reset time length does not exist, reading the preset reset time length, the preset cycle threshold value N and the cycle statistic value M, wherein M, N is a positive integer, and N is not less than M;
in this embodiment, the reset time period is 50 seconds, the cycle threshold is 60 times, and the initial value of the cycle statistic is 40.
312. Scanning memory data in the shared memory area according to the reset duration, and adding 1 to the value assignment of the cycle statistic value M to obtain a new cycle statistic value M;
in this embodiment, all the memory data in the shared memory area are scanned every 50 seconds, and 1 is added on the basis of 40, and the cycle count value is 41. And scanning all memory data in the shared memory area once every 50 seconds, adding 1 on the basis of 41, wherein the cycle statistic value is 42, and cycling until the cycle statistic value is equal to the cycle threshold value.
313. Judging whether the circulation statistic value M is equal to a circulation threshold value N;
in this embodiment, if the loop statistic 40 is not equal to the loop threshold 60, the loop continues, and if so, the scanning is stopped.
314. If so, stopping circularly scanning the memory data in the shared memory area;
in this embodiment, when the loop statistic 60 is equal to the loop threshold 60, the loop is exited to complete the monitoring process.
315. And if not, re-timing based on the reset time length.
In this embodiment, loop statistics 56 are not equal to loop threshold 60 and loop monitoring continues.
In the embodiment of the invention, the mapping address of each memory data in the shared memory is read, whether the virtual address of the target program exists or not is judged according to different data of the mapping address, if the addresses are not matched, the memory is not occupied, and if the addresses are matched, the memory is occupied, so that the monitoring program can occupy less memory resources to complete the program monitoring task.
With reference to fig. 4, the above describes a method for monitoring the operation of a program in an embodiment of the present invention, and a device for monitoring the operation of a program in an embodiment of the present invention is described below, where an embodiment of the device for monitoring the operation of a program in an embodiment of the present invention includes:
an obtaining module 401, configured to access, through a preset program interface, an object program to be monitored, and obtain a virtual address of the object program;
a query module 402, configured to scan memory data in a preset shared memory area, query all mapping virtual addresses in the memory data, and generate a mapping virtual address set;
a determining module 403, configured to determine whether the virtual address exists in the mapping virtual address set;
a sending module 404, configured to send the memory usage information of the target program to a preset management port if the memory usage information exists;
and a loop module 405, configured to scan the memory data in the shared memory area in a loop according to a preset reset duration if the memory data does not exist.
In the embodiment of the invention, the mapping address of each memory data in the shared memory is read, whether the virtual address of the target program exists or not is judged according to different data of the mapping address, if the addresses are not matched, the memory is not occupied, and if the addresses are matched, the memory is occupied, so that the monitoring program can occupy less memory resources to complete the program monitoring task.
Referring to fig. 5, another embodiment of the device for monitoring the operation of the program according to the embodiment of the present invention includes:
an obtaining module 401, configured to access, through a preset program interface, an object program to be monitored, and obtain a virtual address of the object program;
a query module 402, configured to scan memory data in a preset shared memory area, query all mapping virtual addresses in the memory data, and generate a mapping virtual address set;
a determining module 403, configured to determine whether the virtual address exists in the mapping virtual address set;
a sending module 404, configured to send the memory usage information of the target program to a preset management port if the memory usage information exists;
and a loop module 405, configured to scan the memory data in the shared memory area in a loop according to a preset reset duration if the memory data does not exist.
The device for monitoring the operation of the program further includes a state detection module 406, where the state detection module 406 is specifically configured to:
calling a preset state query function, and reading a state setting value of a preset shared memory area;
judging whether the state setting value is zero or not;
if not, sending the information that the target program cannot occupy the memory to a preset management port;
if the value is zero, accessing a preset program interface.
The device for monitoring the operation of the program further includes a removal monitoring module 407, where the removal monitoring module 407 includes:
the scanning unit 4071 is configured to scan the memory data in the shared memory area at regular time according to a preset monitoring duration;
a determining unit 4072, configured to determine whether the memory occupied data corresponding to the target program in the memory data is removed;
an information sending unit 4073, configured to send, if the target program is removed, the shutdown information of the target program to the management port.
The determining unit 4072 is specifically configured to:
calling a preset process query function, and reading a return value corresponding to memory occupied data in the memory data;
if the return value is null, determining that the memory occupied data is removed;
and if the return value is not null, determining that the memory usage data is not removed.
Wherein the scanning unit 4071 is specifically configured to:
reading and storing a target identification value corresponding to the memory occupation data;
and reading all the memory identification values in the shared memory area at regular time according to preset monitoring duration to obtain a memory identification value set.
The determining unit 4072 may further specifically be configured to:
judging whether the target identification value exists in the memory identification value set or not;
if so, confirming that the memory occupied data corresponding to the target program is not removed; and if the target program does not exist, confirming that the memory occupation data corresponding to the target program is removed.
Wherein the circulation module 405 is specifically configured to:
reading a preset reset duration, a preset cycle threshold value N and a cycle statistic value M, wherein M, N is a positive integer, and N is not less than M;
scanning memory data in the shared memory area according to the reset duration, and adding 1 to the assignment of the cycle statistic value M to obtain a new cycle statistic value M;
judging whether the cycle statistic value M is equal to the cycle threshold value N;
if so, stopping circularly scanning the memory data in the shared memory area;
and if not, re-timing based on the reset duration.
In the embodiment of the invention, the mapping address of each memory data in the shared memory is read, whether the virtual address of the target program exists or not is judged according to different data of the mapping address, if the addresses are not matched, the memory is not occupied, and if the addresses are matched, the memory is occupied, so that the monitoring program can occupy less memory resources to complete the program monitoring task.
Fig. 4 and 5 describe the operation monitoring apparatus of the program in the embodiment of the present invention in detail from the perspective of the modular functional entity, and the operation monitoring device of the program in the embodiment of the present invention is described in detail from the perspective of hardware processing.
Fig. 6 is a schematic structural diagram of an operation monitoring device 600 of a program according to an embodiment of the present invention, where the operation monitoring device 600 of the program may generate a relatively large difference due to different configurations or performances, and may include one or more processors (CPUs) 610 (e.g., one or more processors) and a memory 620, and one or more storage media 630 (e.g., one or more mass storage devices) for storing applications 633 or data 632. Memory 620 and storage medium 630 may be, among other things, transient or persistent storage. The program stored in the storage medium 630 may include one or more modules (not shown), and each module may include a series of instruction operations in the operation monitoring apparatus 600 for the program. Further, the processor 610 may be configured to communicate with the storage medium 630 and execute a series of instruction operations in the storage medium 630 on the program execution monitoring apparatus 600.
The program-based operation monitoring device 600 may also include one or more power supplies 640, one or more wired or wireless network interfaces 650, one or more input-output interfaces 660, and/or one or more operating systems 631, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, and the like. Those skilled in the art will appreciate that the configuration of the program operation monitoring device illustrated in FIG. 6 does not constitute a limitation of a program-based operation monitoring device, and may include more or fewer components than those illustrated, or some components may be combined, or a different arrangement of components.
The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium, and which may also be a volatile computer-readable storage medium, having stored therein instructions, which, when executed on a computer, cause the computer to perform the steps of the method for monitoring the operation of the program.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses, and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A method for monitoring the operation of a program, comprising the steps of:
accessing a target program to be monitored through a preset program interface, and acquiring a virtual address of the target program;
scanning memory data in a preset shared memory area, inquiring all mapping virtual addresses in the memory data, and generating a mapping virtual address set;
judging whether the virtual address exists in the mapping virtual address set or not;
if yes, sending the memory occupation information of the target program to a preset management port;
if the shared memory area does not exist, circularly scanning the memory data in the shared memory area according to the preset reset duration.
2. The program operation monitoring method according to claim 1, further comprising, before the accessing a target program to be monitored through a preset program interface and acquiring the virtual address of the target program:
calling a preset state query function, and reading a state setting value of a preset shared memory area;
judging whether the state setting value is zero or not;
if not, sending the information that the target program cannot occupy the memory to a preset management port;
if the value is zero, accessing a preset program interface.
3. The method for monitoring the operation of the program according to claim 1, further comprising, after the sending the memory usage information of the target program to a preset management port:
scanning the memory data in the shared memory area at regular time according to preset monitoring duration;
judging whether the memory occupied data corresponding to the target program in the memory data is removed;
and if the target program is removed, sending the closing information of the target program to the management port.
4. The program operation monitoring method according to claim 3, wherein the determining whether the memory usage data corresponding to the target program in the memory data is removed includes:
calling a preset process query function, and reading a return value corresponding to memory occupied data in the memory data;
if the return value is null, determining that the memory occupied data is removed;
and if the return value is not null, determining that the memory usage data is not removed.
5. The method for monitoring the operation of the program according to claim 3, wherein the step of scanning the memory data in the shared memory area periodically according to the preset monitoring duration comprises:
reading and storing a target identification value corresponding to the memory occupation data;
and reading all the memory identification values in the shared memory area at regular time according to preset monitoring duration to obtain a memory identification value set.
6. The program operation monitoring method according to claim 5, wherein the determining whether the memory usage data corresponding to the target program in the memory data is removed includes:
judging whether the target identification value exists in the memory identification value set or not;
if so, confirming that the memory occupied data corresponding to the target program is not removed; and if the target program does not exist, confirming that the memory occupation data corresponding to the target program is removed.
7. The method for monitoring the operation of the program according to claim 1, wherein the cyclically scanning the memory data in the shared memory area according to the preset reset duration includes:
reading a preset reset duration, a preset cycle threshold value N and a cycle statistic value M, wherein M, N is a positive integer, and N is not less than M;
scanning memory data in the shared memory area according to the reset duration, and adding 1 to the assignment of the cycle statistic value M to obtain a new cycle statistic value M;
judging whether the cycle statistic value M is equal to the cycle threshold value N;
if so, stopping circularly scanning the memory data in the shared memory area;
and if not, re-timing based on the reset duration.
8. An operation monitoring device of a program, characterized by comprising:
the system comprises an acquisition module, a monitoring module and a monitoring module, wherein the acquisition module is used for accessing a target program to be monitored through a preset program interface and acquiring a virtual address of the target program;
the system comprises a query module, a mapping module and a storage module, wherein the query module is used for scanning memory data in a preset shared memory area, querying all mapping virtual addresses in the memory data and generating a mapping virtual address set;
the judging module is used for judging whether the virtual address exists in the mapping virtual address set or not;
the sending module is used for sending the memory occupation information of the target program to a preset management port if the memory occupation information exists;
and the circulating module is used for circularly scanning the memory data in the shared memory area according to the preset reset duration if the memory data does not exist.
9. An operation monitoring device of a program, characterized by comprising: a memory having instructions stored therein and at least one processor, the memory and the at least one processor interconnected by a line;
the at least one processor calls the instructions in the memory to cause an operation monitoring device of the program to execute an operation monitoring method of the program according to any one of claims 1 to 7.
10. A computer-readable storage medium, having stored thereon a computer program, wherein the computer program, when executed by a processor, implements a method of monitoring the operation of a program according to any one of claims 1-7.
CN202011496512.3A 2020-12-17 2020-12-17 Program running monitoring method, device, equipment and storage medium Active CN112463544B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011496512.3A CN112463544B (en) 2020-12-17 2020-12-17 Program running monitoring method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011496512.3A CN112463544B (en) 2020-12-17 2020-12-17 Program running monitoring method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112463544A true CN112463544A (en) 2021-03-09
CN112463544B CN112463544B (en) 2023-05-02

Family

ID=74803621

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011496512.3A Active CN112463544B (en) 2020-12-17 2020-12-17 Program running monitoring method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112463544B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110161614A1 (en) * 2009-12-30 2011-06-30 International Business Machines Corporation Pre-leak detection scan to identify non-pointer data to be excluded from a leak detection scan
WO2012119446A1 (en) * 2011-09-20 2012-09-13 华为技术有限公司 Memory monitoring method and device
CN104751050A (en) * 2015-04-13 2015-07-01 成都睿峰科技有限公司 Client application program management method
CN106560798A (en) * 2015-09-30 2017-04-12 杭州华为数字技术有限公司 Internal memory access method and apparatus, and computer system
CN107562586A (en) * 2017-08-16 2018-01-09 努比亚技术有限公司 A kind of internal-memory detection method, equipment and computer-readable storage medium
US10552308B1 (en) * 2017-06-23 2020-02-04 Square, Inc. Analyzing attributes of memory mappings to identify processes running on a device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110161614A1 (en) * 2009-12-30 2011-06-30 International Business Machines Corporation Pre-leak detection scan to identify non-pointer data to be excluded from a leak detection scan
WO2012119446A1 (en) * 2011-09-20 2012-09-13 华为技术有限公司 Memory monitoring method and device
CN104751050A (en) * 2015-04-13 2015-07-01 成都睿峰科技有限公司 Client application program management method
CN106560798A (en) * 2015-09-30 2017-04-12 杭州华为数字技术有限公司 Internal memory access method and apparatus, and computer system
US10552308B1 (en) * 2017-06-23 2020-02-04 Square, Inc. Analyzing attributes of memory mappings to identify processes running on a device
CN107562586A (en) * 2017-08-16 2018-01-09 努比亚技术有限公司 A kind of internal-memory detection method, equipment and computer-readable storage medium

Also Published As

Publication number Publication date
CN112463544B (en) 2023-05-02

Similar Documents

Publication Publication Date Title
CN108683720B (en) Container cluster service configuration method and device
CN111464355A (en) Method and device for controlling expansion capacity of Kubernetes container cluster and network equipment
CN107104824B (en) Network topology determination method and device
CN109800204B (en) Data distribution method and related product
CN107783829B (en) Task processing method and device, storage medium and computer equipment
CN108415925B (en) Electronic device, data call log generation and query method and storage medium
CN110912782B (en) Data acquisition method, device and storage medium
CN110633135A (en) Asynchronous task allocation method and device, computer equipment and storage medium
CN108446171B (en) Electronic device, distributed system execution task allocation method and storage medium
CN112463544A (en) Program operation monitoring method, device, equipment and storage medium
CN115658156A (en) Timed task implementation method and device based on linux system
CN109254858A (en) Data sharing method, device, equipment and the storage medium of active window
CN114722927A (en) Collapse clustering method and device, electronic equipment and storage medium
CN112130900B (en) User information management method, system, equipment and medium for BMC
CN114662102A (en) File processing method and device and storage medium
CN111352710B (en) Process management method and device, computing equipment and storage medium
CN113849135A (en) Log access method and device and server
CN112650677A (en) Interface calling method, device, server and storage medium
CN109150993B (en) Method for obtaining network request tangent plane, terminal device and storage medium
CN112579616A (en) Task processing method and device, storage medium and electronic equipment
CN111984341B (en) Project monitoring method and device, electronic equipment and storage medium
CN117193979B (en) Independent interrupt stack-based task processing method, device, terminal equipment and medium
CN111221847A (en) Monitoring data storage method and device and computer readable storage medium
CN114356517B (en) Method, system, electronic equipment and storage medium for managing serial bus resources
CN113419864B (en) Application memory management method, device, equipment and storage medium

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
CP03 Change of name, title or address

Address after: 1301-1310, building 2, jinlitong financial center building, 1100 Xingye Road, Haiwang community, Xin'an street, Bao'an District, Shenzhen, Guangdong 518000

Patentee after: Shenzhen Ruan Niu Technology Group Co.,Ltd.

Address before: No.2903, 15-3, Haitian Road, building C, excellence Times Plaza, n23, Haiwang community, Xin'an street, Bao'an District, Shenzhen City, Guangdong Province

Patentee before: AFIRSTSOFT CO.,LTD.

CP03 Change of name, title or address