[go: up one dir, main page]

CN102831043B - Monitoring method and device for application program - Google Patents

Monitoring method and device for application program Download PDF

Info

Publication number
CN102831043B
CN102831043B CN201110164513.2A CN201110164513A CN102831043B CN 102831043 B CN102831043 B CN 102831043B CN 201110164513 A CN201110164513 A CN 201110164513A CN 102831043 B CN102831043 B CN 102831043B
Authority
CN
China
Prior art keywords
class file
monitoring
hook
watchdog routine
monitoring hook
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201110164513.2A
Other languages
Chinese (zh)
Other versions
CN102831043A (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.)
Alibaba Singapore Holdings Pte Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201110164513.2A priority Critical patent/CN102831043B/en
Publication of CN102831043A publication Critical patent/CN102831043A/en
Priority to HK13101052.8A priority patent/HK1174109B/en
Application granted granted Critical
Publication of CN102831043B publication Critical patent/CN102831043B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Debugging And Monitoring (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a monitoring method and a device for an application program. The method comprises the following steps of: adding a monitoring hook in a class file, wherein the monitoring hook is associated with a monitoring program; and invoking the monitoring program associated with the monitoring hook to monitor the application program when carrying out the monitoring hook of the class file, wherein codes of the monitoring program and the application program are in different class files, and the class files are independent from the class file containing the monitoring hook. According to the invention, problems of code complexity and higher maintenance cost in the prior art are solved by separating a service logic code from the monitoring program, and the maintenance cost and the complexity of the codes are lowered.

Description

Method for monitoring application program and device
Technical field
The application relates to internet arena, in particular to a kind of method for monitoring application program and device.
Background technology
Nowadays internet, applications becomes increasingly complex, to the availability of system and the requirement of stability more and more higher, we can not ensure that system is no problem completely, can only accomplish to reduce problem as much as possible.But, when system goes wrong, need the very first time to find, and solve with the fastest speed, dropping to minimum on the impact of client, and this just needs application program monitoring system, so that the operation conditions of real-time supervisory system, analyzes runtime data.
In order to realize the monitoring of application programs, in prior art, provide following several solution:
1) Active report health data: add monitoring logic (program) in service logic, such as when certain value in discovery procedure is illegal, is then initiatively sent to Surveillance center by error message;
2) (Spring is an Open Framework, and it creates in order to the complicacy solving enterprise's application and development to adopt Spring.) etc. the AOP that provides of framework (AOP is the abbreviation of Aspect Oriented Programming, mean: programme towards method, for program dynamic unity adds a kind of technology of function) function, the logical separation of system monitoring out, if abnormal conditions appear in the method be blocked, then send error message to Surveillance center;
3) adopting JMX (Java Management Extensions) framework, is MBean (Managed Bean) by service encapsulates, capture data, or timed sending data is to Surveillance center by Surveillance center's timing.
But above-mentioned solution has following problem:
1) logical code and the normal business logic codes of applying monitoring are coupled, when needs upgrade monitoring logic code, need again to write and comprise application monitoring logic and business logic codes, monitoring logic code after renewal is re-started with business logic codes and is coupled, form new program code.Like this, add complexity and the maintenance cost of code, and amendment difficulty, need from new issue;
2) realized by the AOP of Spring, also will be configured in file for the blocker monitored, be coupled with the configuration file of application.Like this, when needs upgrade monitoring logic code, need to reconfigure blocker, and the blocker after upgrading is re-started with configuration file be coupled, form new file.Like this, add complexity and the maintenance cost of code, and amendment difficulty, need from new issue.
Summary of the invention
The fundamental purpose of the application is to provide a kind of method for monitoring application program and device, at least to solve the higher problem of code complexity and maintenance cost in prior art.
According to an aspect of the application, provide a kind of method for monitoring application program, it comprises: in class file, add monitoring hook, and wherein, monitoring hook is associated with watchdog routine; When performing the monitoring hook of class file, the watchdog routine application programs calling the association of monitoring hook is monitored, wherein, described watchdog routine and application code lay respectively in different class files, and this two class file is independent of the class file containing described monitoring hook.
The step adding monitoring hook in class file comprises: check when system starts whether class file exists the monitored item of coupling; If exist, then in class file, add monitoring hook.
The step adding monitoring hook in class file comprises: the bytecode of loading classes file; Monitoring hook is joined in bytecode.
Check that when system starts the step whether class file exists the monitored item of coupling comprises: the configuration file reading all monitored item; Judge whether the application information in described class file mates with monitored item when loading the bytecode of described class file, wherein, described monitored item comprises the character string of bag name, class name, method name and parameter list; If coupling, then judge that described class file exists the monitored item of coupling.
After calling watchdog routine pass coupling program corresponding to monitoring hook and monitoring, method for monitoring application program also comprises: class file is arranged to the monitored item not comprising coupling; Reload class file.
After the watchdog routine application programs calling the association of monitoring hook is monitored, method for monitoring application program also comprises: the watchdog routine revising the association of described monitoring hook; Reload described class file, and when performing the monitoring hook of described class file, the watchdog routine calling the association of described monitoring hook is monitored to described application program.
According to the another aspect of the application, provide a kind of Application Monitoring device, it comprises: setting unit, and for adding monitoring hook in class file, wherein, described monitoring hook is associated with watchdog routine; Monitoring unit, for when performing the monitoring hook of described class file, the watchdog routine calling the association of described monitoring hook is monitored described application program, wherein, described watchdog routine and application code lay respectively in different class files, and this two class file is independent of the class file containing described monitoring hook.
Setting unit comprises: checking module, for checking when system starts whether class file exists the monitored item of coupling; Add module, for adding monitoring hook when class file exists the monitored item of coupling in class file.
Add module to comprise: load submodule, for the bytecode of loading classes file; Add submodule, for being joined in bytecode by monitoring hook.
Checking module comprises: reading submodule, for reading the configuration file of all monitored item; Judge submodule, for judging whether the application information in described class file mates with monitored item when loading the bytecode of described class file, wherein, described monitored item comprises the character string of bag name, class name, method name and parameter list; If coupling, then judge that described class file exists the monitored item of coupling.
Monitoring unit comprises: modified module, for revising the watchdog routine of described monitoring hook association; Monitoring module, for reloading described class file, and when performing the monitoring hook of described class file, the watchdog routine calling the association of described monitoring hook is monitored described application program.
By the technical scheme of the application, following beneficial effect can be reached:
1) the application is separated with watchdog routine by making business logic codes, solves the problem that code complexity and maintenance cost in prior art are higher, reduces cost and the complexity of code maintenance;
2) automatically in class file, monitoring hook is added according to monitoring configuration when the application is by running, thus achieving while business logic codes is separated with watchdog routine, minimize the change to existing code, reduce further cost and the complexity of code maintenance;
3) the application only needs to upgrade watchdog routine separately, and does not need to revise business logic codes, thus achieves Application Monitoring neatly, improves monitoring efficiency, saves monitoring period.
Certainly, the arbitrary product implementing the application might not need to reach above-described all advantages simultaneously.
Accompanying drawing explanation
Accompanying drawing described herein is used to provide further understanding of the present application, and form a application's part, the schematic description and description of the application, for explaining the application, does not form the improper restriction to the application.In the accompanying drawings:
Fig. 1 is the preferred structural drawing of one of the Application Monitoring device according to the embodiment of the present application;
Fig. 2 is the preferred structural drawing of another kind of the Application Monitoring device according to the embodiment of the present application;
Fig. 3 is according to the preferred process flow diagram of the one of the method for monitoring application program of the embodiment of the present application;
Fig. 4 is the preferred process flow diagram of one of the startup watchdog routine according to the embodiment of the present application;
Fig. 5 is the preferred process flow diagram of one of the interpolation monitoring hook according to the embodiment of the present application.
Embodiment
Hereinafter also describe the application in detail with reference to accompanying drawing in conjunction with the embodiments.It should be noted that, when not conflicting, the embodiment in the application and the feature in embodiment can combine mutually.
Before the further details of each embodiment describing the application, the counting system structure that of the principle that can be used for realizing the application is suitable is described with reference to Fig. 1.In the following description, except as otherwise noted, the symbol otherwise with reference to the action performed by one or more computing machine and operation represents each embodiment describing the application.Thus, be appreciated that processing unit that this kind of action performed sometimes referred to as computing machine and operation comprise computing machine is to the manipulation of electric signal representing data with structured form.It is safeguarded in this manipulation transforms data or the position in the accumulator system of computing machine, and this reshuffles or changes the operation of computing machine in the mode that those skilled in the art understands.The data structure of service data is the physical location of the storer of the particular community that the form with data defines.But although describe the application in above-mentioned context, it does not also mean that restrictive, as understood by those skilled in the art, hereinafter described action and each side of operation also can realize with hardware.
Turn to accompanying drawing, wherein identical reference number refers to identical element, and the principle of the application is shown in a suitable computing environment and realizes.Below describe the embodiment based on described the application, and should not think about the alternative embodiment clearly do not described herein and limit the application.
Fig. 1 shows the schematic diagram of the example computer architecture that can be used for these equipment.For purposes of illustration, the architecture of painting is only an example of proper environment, not proposes any limitation to the usable range of the application or function.This computing system should be interpreted as, to the arbitrary assembly shown in Fig. 1 or its combination, there is any dependence or demand yet.
The principle of the application can use other universal or special calculating or communication environment or configuration to operate.Be applicable to the well-known computing system of the application, the example of environment and configuration includes but not limited to, personal computer, server, multicomputer system, system based on micro-process, minicomputer, mainframe computer and comprise the distributed computing environment of arbitrary said system or equipment.
In the configuration that it is the most basic, the system 100 in Fig. 1 at least comprises: as server 102 and one or more client 104 of Application Monitoring device.Server 102 can include but not limited to Micro-processor MCV or programmable logic device (PLD) FPGA etc. treating apparatus, for storing the memory storage of data and the transmitting device with client communication; Client 104 can comprise: Micro-processor MCV, with the transmitting device of server communication, display device with user interactions.In the present specification and claims, " Application Monitoring device " also can be defined as executive software, firmware or microcode can coming any nextport hardware component NextPort of practical function or the combination of nextport hardware component NextPort.System 100 can be even distributed, to realize distributed function.
As used in this application, term " module ", " assembly " or " unit " can refer to the software object that performs on server 102 or routine.Different assembly described herein, module, unit, engine and service can be implemented as on server 102, perform (such as, as independent thread) object or process.Although system and method described herein preferably realizes with software, the realization of the combination of hardware or software and hardware also may and conceived.
Embodiment 1
As shown in Figure 2, Application Monitoring device (preferred, can be positioned on the server 102 of Fig. 1) comprising: setting unit 202, and for adding monitoring hook in class file, wherein, monitoring hook is associated with watchdog routine; Monitoring unit 204, for when performing the monitoring hook of described class file, the watchdog routine calling the association of described monitoring hook is monitored described application program, wherein, described watchdog routine and application code lay respectively in different class files, and this two class file is independent of the class file containing described monitoring hook.
Both the present embodiment watchdog routine and business logic codes are not carried out coupling and are write, and wherein watchdog routine and business logic codes lay respectively in different class files, and this two class file is independent of the class file containing monitoring hook.Monitoring hook can be loaded in business logic codes operational process, and call watchdog routine by monitoring hook, thus achieve being separated of business logic codes and watchdog routine, like this, the hybrid code of design comparison complexity is not needed to come coupling business logical code and watchdog routine, when needing to upgrade different watchdog routines, only need to load different monitoring hooks, and do not need again to write above-mentioned hybrid code, thus code complexity and the higher problem of maintenance cost in solution prior art, reduce cost and the complexity of code maintenance.
In order to add monitoring hook exactly, this application provides a kind of preferred setting unit, wherein, setting unit 202 comprises: checking module 2021, for checking when system starts whether class file exists the monitored item of coupling; Add module 2022, for adding monitoring hook when class file exists the monitored item of coupling in class file.In the present embodiment, by the coupling of monitored item, the current monitoring the need of carrying out application program can being determined exactly, improve the dirigibility of configuration.
Present invention also provides a kind of preferred implementation adding monitoring hook, specifically, add module 2022 and comprise: load submodule, for the bytecode of loading classes file; Add submodule, for being joined in bytecode by monitoring hook.In the present embodiment, because the execution efficiency of bytecode is very high, therefore, the execution efficiency of monitoring hook interpolation can be improved in this preferred embodiment by the mode of the bytecode of amendment class file.
In order to check whether class file exists the monitored item of coupling exactly, this application provides a kind of preferred checking module 2021, it comprises: reading submodule, for reading the configuration file of all monitored item; Judge submodule, for judging whether the application information in described class file mates with monitored item when loading the bytecode of described class file, wherein, described monitored item comprises the character string of bag name, class name, method name and parameter list; If coupling, then judge that class file exists the monitored item of coupling.By the above-mentioned coupling one by one to pointer configuration item, can judge that class file exists the monitored item of coupling exactly.
Present invention also provides a kind of modification to watchdog routine, in this scenario, monitoring unit 204 comprises: modified module 2041, for revising the watchdog routine of described monitoring hook association; Monitoring module 2042, for reloading described class file, and when performing the monitoring hook of described class file, the watchdog routine calling the association of described monitoring hook is monitored described application program.In the present embodiment, when needing to upgrade different watchdog routines, only need the watchdog routine upgrading separately the association of monitoring hook, and reload the class file with monitoring hook, and do not need again to write as prior art the hybrid code of business logic codes and watchdog routine of being coupled, thus solve the higher problem of code complexity and maintenance cost in prior art, reduce cost and the complexity of code maintenance, improve monitoring efficiency, save monitoring period.
Present invention also provides a kind of deletion scheme to watchdog routine, in this scenario, after calling watchdog routine application programs corresponding to monitoring hook and monitoring, described class file is arranged to the monitored item not comprising coupling by Application Monitoring device, like this, when reloading class file, not carrying out monitoring calling of hook, and directly performing other programs.In this way, can when not needing application programs to monitor, realize by deleting monitoring hook, and do not need again to write as prior art the hybrid code of business logic codes and watchdog routine of being coupled, minimize the change to existing code, thus reduce further cost and the complexity of code maintenance, improve monitoring efficiency, save monitoring period.
The detailed process starting watchdog routine and add monitoring hook is described in detail below in conjunction with accompanying drawing.
First, as shown in Figure 4, in order to add monitoring hook exactly, starting watchdog routine and comprising the steps:
S402, starts JVM;
Preferably, setting unit 202 adds in the start-up parameter of JVM "-javaagent:momtor.jar "
S404, starts monitoring module;
1) checking module 2021 reads monitoring configuration file, and loads all monitored item;
The content of monitored item comprises:
Point: the character string being a bag name+class name+method name+parameter list, is used to specify the method needing monitoring;
Advice: be a Monitor interface realize class, when performing to the method for specifying, can be called this and realize class, thus whether analyze current runtime data normal, abnormal then send abnormal to Surveillance center;
The profile instance of monitored item can see following code:
2) after monitoring module initialization completes, a ClassFileTransformer (class file converter) can be registered to JVM, be named as monitorTransformer, for modifying to the bytecode of class file, to add corresponding monitoring hook (Hook).
S406, starts application system.
Secondly, as shown in Figure 5, realize by the bytecode revising class (Class) file the interpolation monitoring hook, specifically, the method for the interpolation monitoring hook of the embodiment of the present application comprises the following steps:
S502, virtual machine (JVM) loads Class file;
S504, class file converter (monitorTransformer) carries out pre-service to Class file, preferably, travels through all monitored item, finds out the monitored item of this Class file of coupling;
S506, judges whether the Point configuration item containing coupling; If coupling, then go to S508; If do not mate, then go to S514
Preferably, travel through all monitoring configuration items, check whether this Class has the monitored item of coupling; Whether the rule checked is all application programs (or being called method) needing monitoring of searching loop Class file, configure with the Point of configuration item, i.e. " bag name+class name+method name+parameter list " coupling;
S508, lists all application programs needing monitoring;
S510, joins in the bytecode of the application program needing monitoring by monitoring hook; Preferably, Hook is divided into before|after|around type, that is, Before type refers to and call Hook before this application call; After type refers to calls Hook after this application call; Around type refers to calls Hook when this application exception;
S512, returns to virtual machine by amended bytecode;
S514, initialization Class file.
Like this, when code performs HOOK, system can call this Hook, Hook will call the monitoring logic defined, thus realizes system monitoring during system cloud gray model.
The present embodiment only needs the application program being arranged the monitoring of multiple needs in independently class file by monitoring configuration item, and monitoring hook is added in this class file, automatically load the monitoring hook in this class file like this when needing the application program of monitoring to run, and call corresponding watchdog routine by this monitoring hook.Therefore, because the present embodiment is not arrange the corresponding application program needing monitoring by monitoring configuration item in multiple class file, can avoids system in different class files, travel through monitoring configuration item, improve the speed of system searching class file.
Embodiment 2
Fig. 3 is that it comprises the steps: according to the preferred process flow diagram of the one of the method for monitoring application program of the embodiment of the present application
S302, adds monitoring hook in class file, and wherein, monitoring hook is associated with watchdog routine;
S304, when performing the monitoring hook of described class file, the watchdog routine calling the association of described monitoring hook is monitored described application program, wherein, described watchdog routine and application code lay respectively in different class files, and this two class file is independent of the class file containing described monitoring hook.
Both the present embodiment watchdog routine and business logic codes are not carried out coupling and are write, and wherein watchdog routine and business logic codes lay respectively in different class files, and this two class file is independent of the class file containing monitoring hook.Monitoring hook can be loaded in business logic codes operational process, and call watchdog routine by monitoring hook, thus achieve being separated of business logic codes and watchdog routine, like this, the hybrid code of design comparison complexity is not needed to come coupling business logical code and watchdog routine, when needing to upgrade different watchdog routines, only need to load different monitoring hooks, and do not need again to write above-mentioned hybrid code, thus code complexity and the higher problem of maintenance cost in solution prior art, reduce cost and the complexity of code maintenance.
In order to add monitoring hook exactly, this application provides a kind of step preferably adding monitoring hook in class file, it comprises: check when system starts whether class file exists the monitored item of coupling; If exist, then in class file, add monitoring hook.In the present embodiment, by the coupling of monitored item, the current monitoring the need of carrying out application program can being determined exactly, improve the dirigibility of configuration.
Present invention also provides a kind of preferred implementation adding monitoring hook, specifically, the step adding monitoring hook in class file comprises: the bytecode of loading classes file; Monitoring hook is joined in bytecode.In the present embodiment, because the execution efficiency of bytecode is very high, therefore, the execution efficiency of monitoring hook interpolation can be improved in this preferred embodiment by the mode of the bytecode of amendment class file.
In order to check whether class file exists the monitored item of coupling exactly, this application provides a kind of preferred when system starts inspection class file whether there is the step of the monitored item of coupling, it comprises: the configuration file reading all monitored item; Judge whether the application information in described class file mates with monitored item when loading the bytecode of described class file, wherein, described monitored item comprises the character string of bag name, class name, method name and parameter list; If coupling, then judge that described class file exists the monitored item of coupling.By the above-mentioned coupling one by one to pointer configuration item, can judge that class file exists the monitored item of coupling exactly.
Present invention also provides a kind of deletion scheme to watchdog routine, in this scenario, after the watchdog routine application programs calling the association of monitoring hook is monitored, method for monitoring application program also comprises: class file is arranged to the monitored item not comprising coupling; Reload class file.Like this, when reloading class file, not carrying out monitoring calling of hook, and directly performing other programs.In this way, can when not needing application programs to monitor, realize by deleting monitoring hook, and do not need again to write the hybrid code of business logic codes and watchdog routine of being coupled, minimize the change to existing code, thus reduce further cost and the complexity of code maintenance, improve monitoring efficiency, save monitoring period.
Present invention also provides a kind of modification to watchdog routine, in this scenario, after the watchdog routine application programs calling the association of monitoring hook is monitored, method for monitoring application program also comprises: the watchdog routine of amendment monitoring hook association; Reload described class file, and when performing the monitoring hook of described class file, the watchdog routine calling the association of described monitoring hook is monitored to described application program.In the present embodiment, when needing to upgrade different watchdog routines, only need revise and load different monitoring hooks, and do not need again to write the hybrid code of business logic codes and watchdog routine of being coupled, thus code complexity and the higher problem of maintenance cost in solution prior art, reduce cost and the complexity of code maintenance, improve monitoring efficiency, save monitoring period.
The detailed process starting watchdog routine and add monitoring hook is described in detail below in conjunction with accompanying drawing.
First, as shown in Figure 4, in order to add monitoring hook exactly, starting watchdog routine and comprising the steps:
S402, starts JVM;
Preferably, setting unit 202 adds in the start-up parameter of JVM "-javaagent:monitor.jar "
S404, starts monitoring module;
1) checking module 2021 reads monitoring configuration file, and loads all monitored item;
The content of monitored item comprises:
Point: the character string being a bag name+class name+method name+parameter list, is used to specify the method needing monitoring;
Advice: be a Monitor interface realize class, when performing to the method for specifying, can be called this and realize class, thus whether analyze current runtime data normal, abnormal then send abnormal to Surveillance center;
The profile instance of monitored item can see following code:
2) after monitoring module initialization completes, a ClassFileTransformer (class file converter) can be registered to JVM, be named as monitorTransformer, for modifying to the bytecode of class file, to add corresponding monitoring hook (Hook).
S406, starts application system.
Secondly, as shown in Figure 5, realize by the bytecode revising class (Class) file the interpolation monitoring hook, specifically, the method for the interpolation monitoring hook of the embodiment of the present application comprises the following steps:
S502, virtual machine (JVM) loads Class file;
S504, class file converter (monitorTransformer) carries out pre-service to Class file, preferably, travels through all monitored item, finds out the monitored item of this Class file of coupling;
S506, judges whether the Point configuration item containing coupling; If coupling, then go to S508; If do not mate, then go to S514
Preferably, travel through all monitoring configuration items, check whether this Class has the monitored item of coupling; Whether the rule checked is all application programs (or being called method) needing monitoring of searching loop Class file, configure with the Point of configuration item, i.e. " bag name+class name+method name+parameter list " coupling;
S508, lists all application programs needing monitoring;
S510, joins in the bytecode of the application program needing monitoring by monitoring hook; Preferably, Hook is divided into before|after|around type, that is, Before type refers to and call Hook before this application call; After type refers to calls Hook after this application call; Around type refers to calls Hook when this application exception;
S512, returns to virtual machine by amended bytecode;
S514, initialization Class file.
Like this, when code performs HOOK, system can call this Hook, Hook will call the monitoring logic defined, thus realizes system monitoring during system cloud gray model.In addition, the present embodiment only needs the application program being arranged the monitoring of multiple needs in independently class file by monitoring configuration item, and monitoring hook is added in this class file, in the application program operational process needing monitoring, automatically load the monitoring hook in this class file like this, and call corresponding watchdog routine by this monitoring hook.Therefore, because the present embodiment is not arrange the corresponding application program needing monitoring by monitoring configuration item in multiple class file, can avoids system in different class files, travel through monitoring configuration item, improve the speed of system searching class file.
The service code of the logical and application of application monitoring is separated by the application completely, class bytecode is revised dynamically when system starts, to insert a monitoring hook (Hook), in hook program, call the logic of application monitoring, thus on business without any impact.By the technical scheme described in each embodiment of the application, can by the configuration unified management of application monitoring, and be separated completely with the configuration file of business, service logic exploitation is separated completely with the exploitation of monitoring logic, makes the existence of the imperceptible supervisory system of operation system.
Obviously, those skilled in the art should be understood that, each module of above-mentioned the application or each step can realize with general calculation element, they can concentrate on single calculation element, or be distributed on network that multiple calculation element forms, alternatively, they can realize with the executable program code of calculation element, thus, they can be stored and be performed by calculation element in the storage device, and in some cases, step shown or described by can performing with the order be different from herein, or they are made into each integrated circuit modules respectively, or the multiple module in them or step are made into single integrated circuit module to realize.Like this, the application is not restricted to any specific hardware and software combination.
The foregoing is only the preferred embodiment of the application, be not limited to the application, for a person skilled in the art, the application can have various modifications and variations.Within all spirit in the application and principle, any amendment done, equivalent replacement, improvement etc., within the protection domain that all should be included in the application.

Claims (9)

1. a method for monitoring application program, is characterized in that, comprising:
In class file, add monitoring hook, wherein, described monitoring hook is associated with watchdog routine;
When performing the monitoring hook of described class file, the watchdog routine calling the association of described monitoring hook is monitored described application program, wherein, described watchdog routine and application code lay respectively in different class files, and the class file at the class file at described watchdog routine place and described application code place is independent of the class file containing described monitoring hook;
Wherein, the step adding monitoring hook in class file comprises: check when system starts whether described class file exists the monitored item of coupling; If exist, then in described class file, add described monitoring hook.
2. method according to claim 1, is characterized in that, the step adding described monitoring hook in described class file comprises:
Load the bytecode of described class file;
Described monitoring hook is joined in described bytecode.
3. method according to claim 1, is characterized in that, checks that the step whether described class file exists the monitored item of coupling comprises when system starts:
Read the configuration file of all monitored item;
Judge whether the application information in described class file mates with monitored item when loading the bytecode of described class file, wherein, described monitored item comprises the character string of bag name, class name, method name and parameter list;
If coupling, then judge that described class file exists the monitored item of coupling.
4. method according to claim 1, is characterized in that, after the watchdog routine calling the association of described monitoring hook is monitored described application program, also comprises:
Described class file is arranged to the monitored item not comprising coupling;
Reload described class file.
5. method according to claim 1, is characterized in that, after the watchdog routine calling the association of described monitoring hook is monitored described application program, also comprises:
Revise the watchdog routine of described monitoring hook association;
Reload described class file, and when performing the monitoring hook of described class file, the watchdog routine calling the association of described monitoring hook is monitored to described application program.
6. an Application Monitoring device, is characterized in that, comprising:
Setting unit, for adding monitoring hook in class file, wherein, described monitoring hook is associated with watchdog routine;
Monitoring unit, for when performing the monitoring hook of described class file, the watchdog routine calling the association of described monitoring hook is monitored described application program, wherein, described watchdog routine and application code lay respectively in different class files, and the class file at the class file at described watchdog routine place and described application code place is independent of the class file containing described monitoring hook;
Wherein, described setting unit comprises: checking module, for checking when system starts whether described class file exists the monitored item of coupling; Add module, for adding described monitoring hook when described class file exists the monitored item of coupling in described class file.
7. device according to claim 6, is characterized in that, described interpolation module comprises:
Load submodule, for loading the bytecode of described class file;
Add submodule, for being joined in described bytecode by described monitoring hook.
8. device according to claim 6, is characterized in that, described checking module comprises:
Reading submodule, for reading the configuration file of all monitored item;
Judge submodule, for judging whether the application information in described class file mates with monitored item when loading the bytecode of described class file, wherein, described monitored item comprises the character string of bag name, class name, method name and parameter list; If coupling, then judge that described class file exists the monitored item of coupling.
9. device according to claim 6, is characterized in that, described monitoring unit comprises:
Modified module, for revising the watchdog routine of described monitoring hook association;
Monitoring module, for reloading described class file, and when performing the monitoring hook of described class file, the watchdog routine calling the association of described monitoring hook is monitored described application program.
CN201110164513.2A 2011-06-17 2011-06-17 Monitoring method and device for application program Active CN102831043B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201110164513.2A CN102831043B (en) 2011-06-17 2011-06-17 Monitoring method and device for application program
HK13101052.8A HK1174109B (en) 2013-01-24 Method and device for monitoring application

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110164513.2A CN102831043B (en) 2011-06-17 2011-06-17 Monitoring method and device for application program

Publications (2)

Publication Number Publication Date
CN102831043A CN102831043A (en) 2012-12-19
CN102831043B true CN102831043B (en) 2015-05-20

Family

ID=47334192

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110164513.2A Active CN102831043B (en) 2011-06-17 2011-06-17 Monitoring method and device for application program

Country Status (1)

Country Link
CN (1) CN102831043B (en)

Families Citing this family (35)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10333801B2 (en) * 2013-03-14 2019-06-25 Amazon Technologies, Inc. Inventory service for distributed infrastructure
WO2015047443A1 (en) 2013-09-27 2015-04-02 Mcafee, Inc. Managed software remediation
CN104239786B (en) * 2014-10-13 2017-08-04 北京奇虎科技有限公司 ROOT-free active defense configuration method and device
CN104462943B (en) * 2014-11-21 2017-12-01 用友网络科技股份有限公司 Non-intrusion type performance monitoring apparatus and method in operation system
CN104660606B (en) * 2015-03-05 2017-10-20 中南大学 A kind of long-distance monitoring method of application security
CN104809045B (en) * 2015-04-27 2021-01-05 腾讯科技(深圳)有限公司 Running method and device of monitoring script
CN106326099B (en) * 2015-07-01 2019-10-29 阿里巴巴集团控股有限公司 A kind of method, apparatus and electronic equipment for program tracking
CN106897607B (en) * 2015-12-17 2020-03-13 北京奇虎科技有限公司 Application program monitoring method and device
CN105550595A (en) * 2015-12-22 2016-05-04 北京奇虎科技有限公司 Private data access method and system for intelligent communication equipment
CN107291587A (en) * 2016-04-11 2017-10-24 北京京东尚科信息技术有限公司 Computer applied algorithm monitoring method and device
CN106484592B (en) * 2016-09-28 2020-01-24 北京奇虎科技有限公司 An abnormality detection method and device
CN107038103A (en) * 2017-04-14 2017-08-11 上海交通大学 Android program monitoring system and method based on bytecode pitching pile
CN109471768B (en) * 2017-09-08 2023-04-18 阿里巴巴集团控股有限公司 Service problem monitoring method and device and electronic equipment
CN109561121B (en) * 2017-09-26 2021-10-15 北京国双科技有限公司 Method and device for monitoring deployment
CN109684027B (en) * 2017-10-18 2020-11-24 北京京东尚科信息技术有限公司 Method and device for dynamically tracking running of Java virtual machine
CN108228165B (en) * 2018-01-05 2021-02-02 武汉斗鱼网络科技有限公司 Method for recording calling information between program interfaces and electronic equipment
CN108563575B (en) * 2018-04-16 2019-12-10 百度在线网络技术(北京)有限公司 application program testing method and device, terminal and computer readable storage medium
CN108874620B (en) * 2018-05-23 2021-11-23 北京五八信息技术有限公司 Event monitoring method, device and equipment applied to APP and storage medium
CN111026598A (en) * 2018-10-09 2020-04-17 迈普通信技术股份有限公司 Data acquisition method and device
CN111309402B (en) * 2018-12-11 2023-06-27 阿里巴巴集团控股有限公司 Data monitoring and application program processing method, device and equipment
CN110221961B (en) * 2019-04-26 2024-05-28 平安科技(深圳)有限公司 Global hook automatic repair method, device, equipment and storage medium
CN110647438B (en) * 2019-08-13 2022-03-15 平安科技(深圳)有限公司 Event monitoring method and device, computer equipment and storage medium
CN110647468A (en) * 2019-09-23 2020-01-03 凡普数字技术有限公司 Method and device for monitoring code and storage medium
US10817611B1 (en) 2019-12-18 2020-10-27 Capital One Services, Llc Findings remediation management framework system and method
CN113010174B (en) * 2019-12-19 2024-06-18 北京沃东天骏信息技术有限公司 Method and device for monitoring service
CN113051122B (en) * 2019-12-26 2023-09-15 百度在线网络技术(北京)有限公司 Performance data acquisition method, device, electronic equipment and medium
CN112559290B (en) * 2020-12-14 2024-04-05 平安国际融资租赁有限公司 Service call monitoring method, device, computer equipment and storage medium
CN112860522B (en) * 2021-03-02 2024-11-26 北京梧桐车联科技有限责任公司 Program operation monitoring method, device and equipment
CN113312624B (en) * 2021-06-21 2023-06-30 厦门服云信息科技有限公司 Java Web application memory Trojan horse detection method, terminal equipment and storage medium
CN113326209B (en) * 2021-08-03 2021-10-08 航天中认软件测评科技(北京)有限责任公司 Hierarchical segmentation monitoring and intervention method for large-scale parallel test task
CN113868090B (en) * 2021-10-09 2024-12-27 维沃移动通信有限公司 Application program monitoring method and device
CN114328090A (en) * 2021-12-16 2022-04-12 安天科技集团股份有限公司 A program monitoring method, device, electronic device and storage medium
CN114416486B (en) * 2022-01-21 2025-07-18 京东科技信息技术有限公司 Application program performance monitoring method, device, equipment and program product
CN114706734B (en) * 2022-06-02 2022-09-20 支付宝(杭州)信息技术有限公司 Monitoring method and monitoring system for business application
CN118550798B (en) * 2024-07-26 2024-11-22 东方通信股份有限公司 Performance data monitoring method, device, equipment, medium and program product

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1804795A (en) * 2004-10-22 2006-07-19 国际商业机器公司 Process and sysyem for autonomous probe enablement
CN101227630A (en) * 2008-01-29 2008-07-23 中兴通讯股份有限公司 Method for monitoring application program based on window platform
CN101553769A (en) * 2005-10-11 2009-10-07 努雅公司 Method and system for tracking and monitoring computer applications

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1804795A (en) * 2004-10-22 2006-07-19 国际商业机器公司 Process and sysyem for autonomous probe enablement
CN101553769A (en) * 2005-10-11 2009-10-07 努雅公司 Method and system for tracking and monitoring computer applications
CN101227630A (en) * 2008-01-29 2008-07-23 中兴通讯股份有限公司 Method for monitoring application program based on window platform

Also Published As

Publication number Publication date
CN102831043A (en) 2012-12-19
HK1174109A1 (en) 2013-05-31

Similar Documents

Publication Publication Date Title
CN102831043B (en) Monitoring method and device for application program
US11853748B2 (en) Methods and systems that share resources among multiple, interdependent release pipelines
US11561849B1 (en) Intelligently adaptive log level management of a service mesh
CN109739573B (en) Processing method and device for realizing API (application program interface) call and system for realizing API
US8555238B2 (en) Programming and development infrastructure for an autonomic element
US8910138B2 (en) Hot pluggable extensions for access management system
US9400641B2 (en) Adaptable middleware layer
US10795646B2 (en) Methods and systems that generate proxy objects that provide an interface to third-party executables
US20170161044A1 (en) Automated-application-release-management subsystem that incorporates script tasks within application-release-management pipelines
US20190163616A1 (en) Automated-application-release-management subsystem that provides efficient code-change check-in
CN109614167B (en) Method and system for managing plug-ins
US20130227577A1 (en) Automated Administration Using Composites of Atomic Operations
CN103500111A (en) A zookeeper-based information configuration method and device
CN111580926A (en) Model publishing method, model deployment method, apparatus, device and storage medium
US12360776B2 (en) Multi-tenant Java agent instrumentation system
US20180136951A1 (en) Policy enabled application-release-management subsystem
CN114640610B (en) Cloud-protogenesis-based service management method and device and storage medium
CN112860282A (en) Upgrading method and device of cluster plug-in and server
CN103345386A (en) Software production method, device and operation system
CN112685020A (en) Method and device for dynamically creating service interface, electronic equipment and storage medium
US6961940B2 (en) Dynamically adapting events to capabilities of a management system
CN115437644A (en) Application program management method, device, medium and product under multi-operation environment
Nastic Self-provisioning infrastructures for the next generation serverless computing
US20190163355A1 (en) Persona-based dashboard in an automated-application-release-management subsystem
CN106775916B (en) Method and device for reducing application installation packages and electronic equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 1174109

Country of ref document: HK

C14 Grant of patent or utility model
GR01 Patent grant
REG Reference to a national code

Ref country code: HK

Ref legal event code: GR

Ref document number: 1174109

Country of ref document: HK

TR01 Transfer of patent right

Effective date of registration: 20240221

Address after: # 01-21, Lai Zan Da Building 1, 51 Belarusian Road, Singapore

Patentee after: Alibaba Singapore Holdings Ltd.

Country or region after: Singapore

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Patentee before: ALIBABA GROUP HOLDING Ltd.

Country or region before: Cayman Islands

TR01 Transfer of patent right