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

Monitoring method and device for application program Download PDF

Info

Publication number
CN102831043A
CN102831043A CN2011101645132A CN201110164513A CN102831043A CN 102831043 A CN102831043 A CN 102831043A CN 2011101645132 A CN2011101645132 A CN 2011101645132A CN 201110164513 A CN201110164513 A CN 201110164513A CN 102831043 A CN102831043 A CN 102831043A
Authority
CN
China
Prior art keywords
monitoring
class file
hook
class
application
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN2011101645132A
Other languages
Chinese (zh)
Other versions
CN102831043B (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/HK1174109A1/en
Application granted granted Critical
Publication of CN102831043B publication Critical patent/CN102831043B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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 stability require increasingly highly, we can not guarantee fully that system is no problem, can only accomplish to reduce as much as possible problem.Yet, when system goes wrong, need the very first time to find; And solve with the fastest speed, drop to influence minimum to the client, and this just needs application program monitoring system; So that the operation conditions of real-time supervisory system is analyzed runtime data.
In order to realize the monitoring of application programs, several kinds of solutions below providing in the prior art:
1) initiatively report health data: in service logic, add monitoring logic (program), illegal such as certain value in discovery procedure, then initiatively error message is sent to Surveillance center;
2) (Spring is the framework of increasing income, and it is created for the complicacy that solves the enterprise application exploitation to adopt Spring.) (AOP is the abbreviation of Aspect Oriented Programming to wait the AOP that framework provides; Mean: programme towards method; Add a kind of technology of function for the program dynamic unity) function; Come out the logical separation of system monitoring,, then send error message to Surveillance center if abnormal conditions appear in the method for being tackled;
3) adopting JMX (Java Management Extensions) framework, is MBean (Managed Bean) with service encapsulates, regularly grasps data by Surveillance center, and perhaps timed sending data are to Surveillance center.
Yet above-mentioned solution has following problem:
1) using the logical code of monitoring is coupled with normal business logic codes; When needs upgrade the monitoring logic code; Need write again and comprise application monitoring logic and business logic codes; Monitoring logic code and business logic codes after upgrading are coupled again, form new program code.Like this, increase the complexity and the maintenance cost of code, and revised difficulty, need be from new issue;
2) AOP through Spring realizes that the blocker that is used for monitoring also will be configured to file, is coupled with the configuration file of using.Like this, when needs upgrade the monitoring logic code, need reconfigure blocker, and the blocker after will upgrading and configuration file be coupled again, form new file.Like this, increase the complexity and the maintenance cost of code, and revised difficulty, need be from new issue.
Summary of the invention
The application's fundamental purpose is to provide a kind of method for monitoring application program and device, to solve code complexity and maintenance cost problem of higher in the prior art at least.
An aspect according to the application provides a kind of method for monitoring application program, and it comprises: in class file, add the monitoring hook, wherein, the monitoring hook is associated with watchdog routine; When carrying out the monitoring hook of class file; Calling the related watchdog routine application programs of monitoring hook monitors; Wherein, said watchdog routine lays respectively in the different class files with application code, and this two class file is independent of the class file that has comprised said monitoring hook.
The step that in class file, adds the monitoring hook comprises: whether the inspection class file exists the monitored item of coupling when system start-up; If exist, then in class file, add the monitoring hook.
The step that in class file, adds the monitoring hook comprises: the bytecode of loading classes file; To monitor hook joins in the bytecode.
Whether the inspection class file exists the step of the monitored item of coupling to comprise when system start-up: the configuration file that reads all monitored item; Judge when loading the bytecode of said class file whether the application information in the said class file matees with monitored item, and wherein, said monitored item comprises the character string of name, class name, method name and parameter list; If coupling is then judged the monitored item that there is coupling in said class file.
After the watchdog routine pass coupling program of calling monitoring hook correspondence was monitored, method for monitoring application program also comprised: the monitored item of class file being arranged to not comprise coupling; Reload class file.
After the watchdog routine application programs of calling the association of monitoring hook was monitored, method for monitoring application program also comprised: revise the related watchdog routine of said monitoring hook; Reload said class file, and when carrying out the monitoring hook of said class file, call the related watchdog routine of said monitoring hook said application program is monitored.
According to the application on the other hand, a kind of Application Monitoring device is provided, it comprises: the unit is set, is used for adding the monitoring hook at class file, wherein, said monitoring hook is associated with watchdog routine; Monitoring unit; Be used for when carrying out the monitoring hook of said class file; Calling the related watchdog routine of said monitoring hook monitors said application program; Wherein, said watchdog routine lays respectively in the different class files with application code, and this two class file is independent of the class file that has comprised said monitoring hook.
The unit is set to be comprised: the inspection module is used for when system start-up, checking whether class file exists the monitored item of coupling; Add module, be used for when there is the monitored item of coupling in class file, adding the monitoring hook at class file.
Adding module comprises: load submodule, be used for the bytecode of loading classes file; Add submodule, be used for the monitoring hook is joined bytecode.
The inspection module comprises: reading submodule is used to read the configuration file of all monitored item; Judge submodule, be used for when loading the bytecode of said class file, judging whether the application information of said class file matees with monitored item, and wherein, said monitored item comprises the character string of name, class name, method name and parameter list; If coupling is then judged the monitored item that there is coupling in said class file.
Monitoring unit comprises: modified module is used to revise the related watchdog routine of said monitoring hook; Monitoring module is used to reload said class file, and when carrying out the monitoring hook of said class file, calls the related watchdog routine of said monitoring hook said application program is monitored.
Through the application's technical scheme, can reach following beneficial effect:
1) the application separates with watchdog routine through making business logic codes, solves code complexity and maintenance cost problem of higher in the prior art, has reduced the cost and the complexity of code maintenance;
Automatically in class file, add the monitoring hook according to the monitoring configuration when 2) the application is through operation; Thereby when having realized business logic codes and watchdog routine separated; Minimized change, further reduced the cost and the complexity of code maintenance existing code;
3) the application only needs separately watchdog routine to be upgraded, and need not revise business logic codes, thereby has realized Application Monitoring neatly, has improved monitoring efficiency, has saved monitoring period.
Certainly, arbitrary product of enforcement the application might not reach above-described all advantages simultaneously.
Description of drawings
Accompanying drawing described herein is used to provide the further understanding to the application, constitutes the application's a part, and the application's illustrative examples and explanation thereof are used to explain the application, do not constitute the improper qualification to the application.In the accompanying drawings:
Fig. 1 is a kind of preferred construction figure according to the Application Monitoring device of the application embodiment;
Fig. 2 is the another kind of preferred construction figure according to the Application Monitoring device of the application embodiment;
Fig. 3 is a kind of preferred process flow diagram according to the method for monitoring application program of the application embodiment;
Fig. 4 is a kind of preferred process flow diagram according to the startup watchdog routine of the application embodiment;
Fig. 5 is a kind of preferred process flow diagram according to the interpolation monitoring hook of the application embodiment.
Embodiment
Hereinafter will and combine embodiment to specify the application with reference to accompanying drawing.Need to prove that under the situation of not conflicting, embodiment and the characteristic among the embodiment among the application can make up each other.
Before the further details of each embodiment that describes the application, a suitable counting system structure of the principle that can be used for realizing the application will be described with reference to figure 1.In the following description, except as otherwise noted, otherwise each embodiment of the application will be described with reference to the symbolic representation of action of carrying out by one or more computing machines and operation.Thus, be appreciated that and be called as processing unit that this type action that computing machine carries out and operation comprise computing machine sometimes represent the manipulation of the electric signal of data with structured form.This manipulation transforms safeguard it on data or the position in the accumulator system of computing machine, the operation of computing machine is reshuffled or changed to this mode of all understanding with those skilled in the art.The data structure of service data is the physical location of storer with defined particular community of form of data.Yet, although in above-mentioned context, describe the application, it and do not mean that restrictive, as the each side that skilled person understands that back civilian described action and operation also available hardware realize.
Turn to accompanying drawing, wherein identical reference number refers to identical element, and the application's principle is shown in the suitable computing environment and realizes.Below describe embodiment, and should not think to limit the application here about the alternative embodiment clearly do not described based on described the application.
Fig. 1 shows the synoptic diagram of an example computer architecture that can be used for these equipment.For purposes of illustration, the architecture of being painted is merely an example of proper environment, is not that usable range or function to the application proposes any limitation.Should this computing system be interpreted as yet arbitrary assembly shown in Figure 1 or its combination are had any dependence or demand.
The application's principle can use other general or dedicated computing or communication environment or configuration to operate.The example that is applicable to the application's well-known computing system, environment and configuration includes but not limited to; Personal computer, server, multicomputer system, system, minicomputer, mainframe computer and the DCE that comprises arbitrary said system or equipment based on little processing.
In its most basic configuration, the system 100 among Fig. 1 comprises at least: as server 102 and one or more client 104 of Application Monitoring device.Server 102 can include but not limited to microprocessor MCU or PLD FPGA etc. treating apparatus, be used to store data memory storage and with the transmitting device of client communication; Client 104 can comprise: microprocessor MCU, with the transmitting device of server communication, with the display device of user interactions.In this instructions and claims, " Application Monitoring device " also can be defined as can executive software, firmware or microcode are realized any nextport hardware component NextPort of function or the combination of nextport hardware component NextPort.System 100 even can be distributed is to realize distributed function.
Employed like the application, term " module ", " assembly " or " unit " can refer to the software object or the routine of execution on server 102.Different assembly described herein, module, unit, engine and service can be implemented as object or the process of on server 102, carrying out (for example, as independent thread).Although system and method described herein realizes with software that preferably the realization of the combination of hardware or software and hardware also maybe and be conceived.
Embodiment 1
As shown in Figure 2, Application Monitoring device (preferred, as can be positioned on the server 102 of Fig. 1) comprising: unit 202 is set, is used for adding the monitoring hook at class file, wherein, the monitoring hook is associated with watchdog routine; Monitoring unit 204; Be used for when carrying out the monitoring hook of said class file; Calling the related watchdog routine of said monitoring hook monitors said application program; Wherein, said watchdog routine lays respectively in the different class files with application code, and this two class file is independent of the class file that has comprised said monitoring hook.
The two is not coupled present embodiment watchdog routine and business logic codes and writes, and wherein watchdog routine lays respectively in the different class files with business logic codes, and this two class file is independent of the class file that has comprised the monitoring hook.In the business logic codes operational process, can load the monitoring hook; And call watchdog routine through the monitoring hook, thus realized separating of business logic codes and watchdog routine, like this; The hybrid code that need not design more complicated be coupled business logic codes and watchdog routine; When needs upgrade different watchdog routines, only need to load different monitoring hooks, and do not need to write again above-mentioned hybrid code; Thereby code complexity and maintenance cost problem of higher in the solution prior art have reduced the cost and the complexity of code maintenance.
In order to add the monitoring hook exactly, the application provides a kind of unit that preferably is provided with, and wherein, unit 202 is set comprises: inspection module 2021 is used for when system start-up, checking whether class file exists the monitored item of coupling; Add module 2022, be used for when there is the monitored item of coupling in class file, adding the monitoring hook at class file.In the present embodiment,, can confirm currently whether need carry out the monitoring of application program exactly, improve configuration flexibility through the coupling of monitored item.
The application also provides a kind of preferred implementation of monitoring hook that adds, and particularly, adds module 2022 and comprises: load submodule, be used for the bytecode of loading classes file; Add submodule, be used for the monitoring hook is joined bytecode.In the present embodiment, because the execution efficient of bytecode is very high, therefore, the mode of the bytecode through revising class file in this preferred embodiment can improve the execution efficient that the monitoring hook adds.
In order to check exactly whether class file exists the monitored item of coupling, the application provides a kind of preferred inspection module 2021, and it comprises: reading submodule is used to read the configuration file of all monitored item; Judge submodule, be used for when loading the bytecode of said class file, judging whether the application information of said class file matees with monitored item, and wherein, said monitored item comprises the character string of name, class name, method name and parameter list; If coupling is then judged the monitored item that there is coupling in class file.Through above-mentioned coupling one by one, can judge the monitored item that there is coupling in class file exactly to the pointer configuration item.
The application also provides a kind of modification to watchdog routine, and in this scheme, monitoring unit 204 comprises: modified module 2041 is used to revise the related watchdog routine of said monitoring hook; Monitoring module 2042 is used to reload said class file, and when carrying out the monitoring hook of said class file, calls the related watchdog routine of said monitoring hook said application program is monitored.In the present embodiment, when needs upgrade different watchdog routines, only need to upgrade separately the related watchdog routine of monitoring hook; And reload have the monitoring hook class file; And need as prior art, not write the hybrid code of be coupled business logic codes and watchdog routine again, thus solve code complexity and maintenance cost problem of higher in the prior art, reduced the cost and the complexity of code maintenance; Improve monitoring efficiency, saved monitoring period.
The application also provides a kind of deletion scheme to watchdog routine; In this scheme, after the watchdog routine application programs of calling monitoring hook correspondence was monitored, the Application Monitoring device was arranged to said class file not comprise the monitored item of coupling; Like this; When reloading class file, do not monitor calling of hook, and directly carry out other programs.In this way; Can when not need application programs to monitor, realize through deletion monitoring hook, and need as prior art, not write the hybrid code of be coupled business logic codes and watchdog routine again; Minimized change to existing code; Thereby further reduced the cost and the complexity of code maintenance, improved monitoring efficiency, saved monitoring period.
Describe the detailed process that starts watchdog routine and interpolation monitoring hook in detail below in conjunction with accompanying drawing.
At first, as shown in Figure 4, in order to add the monitoring hook exactly, start watchdog routine and comprise the steps:
S402 starts JVM;
Preferably, unit 202 being set adds in the start-up parameter of JVM "-javaagent:momtor.jar "
S404 starts monitoring module;
1) inspection module 2021 reads the monitoring configuration file, and loads all monitored item;
The content of monitored item comprises:
Point: be the character string of a bag name+class name+method name+parameter list, be used for specifying the method that needs monitoring;
Advice: be the realization class of a Monitor interface, when implementing appointed method, can call this realization class, thereby whether analyze current runtime data normal, undesired then the transmission unusually to Surveillance center;
The profile instance of monitored item can be referring to following code:
2) after the monitoring module initialization is accomplished, can register a ClassFileTransformer (class file converter), be named as monitorTransformer, be used for the bytecode of class file is made amendment, so that add corresponding monitoring hook (Hook) to JVM.
S406 starts application system.
Secondly, as shown in Figure 5, realize monitoring the interpolation of hook through the bytecode of revising type (Class) file, particularly, the method for the interpolation of the application embodiment monitoring hook may further comprise the steps:
S502, virtual machine (JVM) loads the Class file;
S504, class file converter (monitorTransformer) carries out pre-service to the Class file, and is preferred, travels through all monitored item, finds out the monitored item of this Class file of coupling;
S506 judges whether to contain the Point configuration item of coupling; If coupling then goes to S508; If do not match, then go to S514
Preferably, travel through all monitoring configuration items, check whether this Class has the monitored item of coupling; The rule of inspection is all application programs that need monitor (or being called method) of searching loop Class file, and with the Point configuration of configuration item, promptly " bag name+class name+method name+parameter list " matees;
S508 lists the application program that all need be monitored;
S510 joins the monitoring hook in the bytecode of the application program that needs monitoring; Preferably, Hook is divided into the before|after|around type, that is, the Before type refers to before this application call and calls Hook; The After type refers to after this application call and calls Hook; The Around type refers to and when this application exception, calls Hook;
S512 returns to virtual machine with amended bytecode;
S514, initialization Class file.
Like this, when code implemented HOOK, this Hook can call in system, and Hook will call the monitoring logic that has defined, thus the system monitoring when realizing system moved.
Present embodiment only need independently be provided with a plurality of application programs that need monitoring through the monitoring configuration item in the class file at one; And hook is monitored in adding in this class file; When the application program operation of needs monitoring, load the monitoring hook in this class file automatically like this, and call corresponding watchdog routine through this monitoring hook.Therefore,, can avoid system in different class files, to travel through the monitoring configuration item, improve the speed of system searching class file because present embodiment is not in a plurality of class files, through the monitoring configuration item the corresponding application program that needs monitoring to be set.
Embodiment 2
Fig. 3 is a kind of preferred process flow diagram according to the method for monitoring application program of the application embodiment, and it comprises the steps:
S302 adds the monitoring hook in class file, wherein, the monitoring hook is associated with watchdog routine;
S304; When carrying out the monitoring hook of said class file; Calling the related watchdog routine of said monitoring hook monitors said application program; Wherein, said watchdog routine lays respectively in the different class files with application code, and this two class file is independent of the class file that has comprised said monitoring hook.
The two is not coupled present embodiment watchdog routine and business logic codes and writes, and wherein watchdog routine lays respectively in the different class files with business logic codes, and this two class file is independent of the class file that has comprised the monitoring hook.In the business logic codes operational process, can load the monitoring hook; And call watchdog routine through the monitoring hook, thus realized separating of business logic codes and watchdog routine, like this; The hybrid code that need not design more complicated be coupled business logic codes and watchdog routine; When needs upgrade different watchdog routines, only need to load different monitoring hooks, and do not need to write again above-mentioned hybrid code; Thereby code complexity and maintenance cost problem of higher in the solution prior art have reduced the cost and the complexity of code maintenance.
In order to add the monitoring hook exactly, the application provides a kind of preferred step that in class file, adds the monitoring hook, and it comprises: whether the inspection class file exists the monitored item of coupling when system start-up; If exist, then in class file, add the monitoring hook.In the present embodiment,, can confirm currently whether need carry out the monitoring of application program exactly, improve configuration flexibility through the coupling of monitored item.
The application also provides a kind of preferred implementation of monitoring hook that adds, and particularly, the step that in class file, adds the monitoring hook comprises: the bytecode of loading classes file; To monitor hook joins in the bytecode.In the present embodiment, because the execution efficient of bytecode is very high, therefore, the mode of the bytecode through revising class file in this preferred embodiment can improve the execution efficient that the monitoring hook adds.
In order to check exactly whether class file exists the monitored item of coupling, the application provides a kind of and has checked when system start-up preferably whether class file exists the step of the monitored item of coupling, and it comprises: the configuration file that reads all monitored item; Judge when loading the bytecode of said class file whether the application information in the said class file matees with monitored item, and wherein, said monitored item comprises the character string of name, class name, method name and parameter list; If coupling is then judged the monitored item that there is coupling in said class file.Through above-mentioned coupling one by one, can judge the monitored item that there is coupling in class file exactly to the pointer configuration item.
The application also provides a kind of deletion scheme to watchdog routine, and in this scheme, after the watchdog routine application programs of calling the association of monitoring hook was monitored, method for monitoring application program also comprised: the monitored item of class file being arranged to not comprise coupling; Reload class file.Like this, when reloading class file, do not monitor calling of hook, and directly carry out other programs.In this way; Can be when not needing application programs to monitor, realize through deletion monitoring hook, and do not need to write again the hybrid code of business logic codes and watchdog routine of being coupled; Minimized change to existing code; Thereby further reduced the cost and the complexity of code maintenance, improved monitoring efficiency, saved monitoring period.
The application also provides a kind of modification to watchdog routine, and in this scheme, after the watchdog routine application programs of calling the association of monitoring hook was monitored, method for monitoring application program also comprised: revise the related watchdog routine of monitoring hook; Reload said class file, and when carrying out the monitoring hook of said class file, call the related watchdog routine of said monitoring hook said application program is monitored.In the present embodiment; When needs upgrade different watchdog routines, only need to revise also to load different monitoring hooks, and do not need to write again the hybrid code of business logic codes and watchdog routine of being coupled; Thereby code complexity and maintenance cost problem of higher in the solution prior art; Reduce the cost and the complexity of code maintenance, improved monitoring efficiency, saved monitoring period.
Describe the detailed process that starts watchdog routine and interpolation monitoring hook in detail below in conjunction with accompanying drawing.
At first, as shown in Figure 4, in order to add the monitoring hook exactly, start watchdog routine and comprise the steps:
S402 starts JVM;
Preferably, unit 202 being set adds in the start-up parameter of JVM "-javaagent:monitor.jar "
S404 starts monitoring module;
1) inspection module 2021 reads the monitoring configuration file, and loads all monitored item;
The content of monitored item comprises:
Point: be the character string of a bag name+class name+method name+parameter list, be used for specifying the method that needs monitoring;
Advice: be the realization class of a Monitor interface, when implementing appointed method, can call this realization class, thereby whether analyze current runtime data normal, undesired then the transmission unusually to Surveillance center;
The profile instance of monitored item can be referring to following code:
Figure BDA0000069238590000081
2) after the monitoring module initialization is accomplished, can register a ClassFileTransformer (class file converter), be named as monitorTransformer, be used for the bytecode of class file is made amendment, so that add corresponding monitoring hook (Hook) to JVM.
S406 starts application system.
Secondly, as shown in Figure 5, realize monitoring the interpolation of hook through the bytecode of revising type (Class) file, particularly, the method for the interpolation of the application embodiment monitoring hook may further comprise the steps:
S502, virtual machine (JVM) loads the Class file;
S504, class file converter (monitorTransformer) carries out pre-service to the Class file, and is preferred, travels through all monitored item, finds out the monitored item of this Class file of coupling;
S506 judges whether to contain the Point configuration item of coupling; If coupling then goes to S508; If do not match, then go to S514
Preferably, travel through all monitoring configuration items, check whether this Class has the monitored item of coupling; The rule of inspection is all application programs that need monitor (or being called method) of searching loop Class file, and with the Point configuration of configuration item, promptly " bag name+class name+method name+parameter list " matees;
S508 lists the application program that all need be monitored;
S510 joins the monitoring hook in the bytecode of the application program that needs monitoring; Preferably, Hook is divided into the before|after|around type, that is, the Before type refers to before this application call and calls Hook; The After type refers to after this application call and calls Hook; The Around type refers to and when this application exception, calls Hook;
S512 returns to virtual machine with amended bytecode;
S514, initialization Class file.
Like this, when code implemented HOOK, this Hook can call in system, and Hook will call the monitoring logic that has defined, thus the system monitoring when realizing system moved.In addition; Present embodiment only need independently be provided with a plurality of application programs that need monitoring through the monitoring configuration item in the class file at one; And hook is monitored in adding in this class file; In the application program operational process of needs monitoring, load the monitoring hook in this class file automatically like this, and call corresponding watchdog routine through this monitoring hook.Therefore,, can avoid system in different class files, to travel through the monitoring configuration item, improve the speed of system searching class file because present embodiment is not in a plurality of class files, through the monitoring configuration item the corresponding application program that needs monitoring to be set.
The service code that the application will use the logical and application of monitoring separates fully; The dynamic class bytecode of revising when system start-up; So that insert a monitoring hook (Hook), the logic of calling application monitoring in the hook program, thus business is had no influence.The technical scheme of being put down in writing through each embodiment of the application; Can be with the configuration unified management of using monitoring; And separate fully with the configuration file of business, the service logic exploitation separates with the exploitation of monitoring logic fully, makes the existence of the imperceptible supervisory system of operation system.
Obviously, it is apparent to those skilled in the art that each module of above-mentioned the application or each step can realize with the general calculation device; They can concentrate on the single calculation element; Perhaps be distributed on the network that a plurality of calculation element forms, alternatively, they can be realized with the executable program code of calculation element; Thereby; Can they be stored in the memory storage and carry out, and in some cases, can carry out step shown or that describe with the order that is different from here by calculation element; Perhaps they are made into each integrated circuit modules respectively, perhaps a plurality of modules in them or step are made into the single integrated circuit module and realize.Like this, the application is not restricted to any specific hardware and software combination.
The preferred embodiment that the above is merely the application is not limited to the application, and for a person skilled in the art, the application can have various changes and variation.All within the application's spirit and principle, any modification of being done, be equal to replacement, improvement etc., all should be included within the application's the protection domain.

Claims (11)

1. a method for monitoring application program is characterized in that, comprising:
In class file, add the monitoring hook, wherein, said monitoring hook is associated with watchdog routine;
When carrying out the monitoring hook of said class file; Calling the related watchdog routine of said monitoring hook monitors said application program; Wherein, Said watchdog routine lays respectively in the different class files with application code, and this two class file is independent of the class file that has comprised said monitoring hook.
2. method according to claim 1 is characterized in that, the step that in class file, adds the monitoring hook comprises:
Check when system start-up whether said class file exists the monitored item of coupling;
If exist, then in said class file, add said monitoring hook.
3. method according to claim 2 is characterized in that, the step that in said class file, adds said monitoring hook comprises:
Load the bytecode of said class file;
Said monitoring hook is joined in the said bytecode.
4. method according to claim 2 is characterized in that, checks when system start-up whether said class file exists the step of the monitored item of coupling to comprise:
Read the configuration file of all monitored item;
Judge when loading the bytecode of said class file whether the application information in the said class file matees with monitored item, and wherein, said monitored item comprises the character string of name, class name, method name and parameter list;
If coupling is then judged the monitored item that there is coupling in said class file.
5. method according to claim 1 is characterized in that, after the watchdog routine of calling said monitoring hook association is monitored said application program, also comprises:
Said class file is arranged to not comprise the monitored item of coupling;
Reload said class file.
6. method according to claim 1 is characterized in that, after the watchdog routine of calling said monitoring hook association is monitored said application program, also comprises:
Revise the related watchdog routine of said monitoring hook;
Reload said class file, and when carrying out the monitoring hook of said class file, call the related watchdog routine of said monitoring hook said application program is monitored.
7. an Application Monitoring device is characterized in that, comprising:
The unit is set, is used for adding the monitoring hook at class file, wherein, said monitoring hook is associated with watchdog routine;
Monitoring unit; Be used for when carrying out the monitoring hook of said class file; Calling the related watchdog routine of said monitoring hook monitors said application program; Wherein, said watchdog routine lays respectively in the different class files with application code, and this two class file is independent of the class file that has comprised said monitoring hook.
8. device according to claim 7 is characterized in that, the said unit that is provided with comprises:
The inspection module is used for when system start-up, checking whether said class file exists the monitored item of coupling;
Add module, be used for when there is the monitored item of coupling in said class file, adding said monitoring hook at said class file.
9. device according to claim 8 is characterized in that, said interpolation module comprises:
Load submodule, be used to load the bytecode of said class file;
Add submodule, be used for said monitoring hook is joined said bytecode.
10. device according to claim 8 is characterized in that, said inspection module comprises:
Reading submodule is used to read the configuration file of all monitored item;
Judge submodule, be used for when loading the bytecode of said class file, judging whether the application information of said class file matees with monitored item, and wherein, said monitored item comprises the character string of name, class name, method name and parameter list; If coupling is then judged the monitored item that there is coupling in said class file.
11. device according to claim 7 is characterized in that, said monitoring unit comprises:
Modified module is used to revise the related watchdog routine of said monitoring hook;
Monitoring module is used to reload said class file, and when carrying out the monitoring hook of said class file, calls the related watchdog routine of said monitoring hook said application program is monitored.
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 HK1174109A1 (en) 2011-06-17 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 true CN102831043A (en) 2012-12-19
CN102831043B 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 (2)

Country Link
CN (1) CN102831043B (en)
HK (1) HK1174109A1 (en)

Cited By (32)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104239786A (en) * 2014-10-13 2014-12-24 北京奇虎科技有限公司 ROOT-free active defense configuration method and device
CN104462943A (en) * 2014-11-21 2015-03-25 用友软件股份有限公司 Non-intrusive performance monitoring device and method for service system
CN104660606A (en) * 2015-03-05 2015-05-27 中南大学 Method for remotely monitoring safety of application program
CN104809045A (en) * 2015-04-27 2015-07-29 腾讯科技(深圳)有限公司 Operation method and device of monitoring script
CN105122232A (en) * 2013-03-14 2015-12-02 亚马逊科技公司 Inventory service for distributed infrastructure
CN105550595A (en) * 2015-12-22 2016-05-04 北京奇虎科技有限公司 Private data access method and system for intelligent communication equipment
CN105683988A (en) * 2013-09-27 2016-06-15 迈克菲公司 Managed software remediation
CN106326099A (en) * 2015-07-01 2017-01-11 阿里巴巴集团控股有限公司 Method and device used in program tracking and electronic device
CN106484592A (en) * 2016-09-28 2017-03-08 北京奇虎科技有限公司 A kind of method for detecting abnormality and device
CN106897607A (en) * 2015-12-17 2017-06-27 北京奇虎科技有限公司 A kind of method for monitoring application program and device
CN107038103A (en) * 2017-04-14 2017-08-11 上海交通大学 Android program monitoring system and method based on bytecode pitching pile
CN107291587A (en) * 2016-04-11 2017-10-24 北京京东尚科信息技术有限公司 Computer applied algorithm monitoring method and device
CN108228165A (en) * 2018-01-05 2018-06-29 武汉斗鱼网络科技有限公司 The method and electronic equipment of recalls information between a kind of logging program interface
CN108563575A (en) * 2018-04-16 2018-09-21 百度在线网络技术(北京)有限公司 Applied program testing method, device, terminal and computer readable storage medium
CN108874620A (en) * 2018-05-23 2018-11-23 北京五八信息技术有限公司 A kind of event monitoring method, apparatus, equipment and storage medium applied to APP
CN109471768A (en) * 2017-09-08 2019-03-15 阿里巴巴集团控股有限公司 Monitoring method, device and the electronic equipment of traffic issues
CN109561121A (en) * 2017-09-26 2019-04-02 北京国双科技有限公司 Monitor the method and device of deployment
CN109684027A (en) * 2017-10-18 2019-04-26 北京京东尚科信息技术有限公司 The method and apparatus of dynamically track Java Virtual Machine operation
CN110221961A (en) * 2019-04-26 2019-09-10 平安科技(深圳)有限公司 Global hook self-repairing method, device, equipment and storage medium
CN110647438A (en) * 2019-08-13 2020-01-03 平安科技(深圳)有限公司 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
CN111026598A (en) * 2018-10-09 2020-04-17 迈普通信技术股份有限公司 Data acquisition method and device
CN111309402A (en) * 2018-12-11 2020-06-19 阿里巴巴集团控股有限公司 Data monitoring and application program processing method, device and equipment
US10817611B1 (en) 2019-12-18 2020-10-27 Capital One Services, Llc Findings remediation management framework system and method
CN112559290A (en) * 2020-12-14 2021-03-26 平安国际融资租赁有限公司 Service call monitoring method and device, computer equipment and storage medium
CN112860522A (en) * 2021-03-02 2021-05-28 北京梧桐车联科技有限责任公司 Program operation monitoring method, device and equipment
CN113010174A (en) * 2019-12-19 2021-06-22 北京沃东天骏信息技术有限公司 Service monitoring method and device
CN113051122A (en) * 2019-12-26 2021-06-29 百度在线网络技术(北京)有限公司 Performance data acquisition method, performance data acquisition device, electronic equipment and medium
CN113312624A (en) * 2021-06-21 2021-08-27 厦门服云信息科技有限公司 Java Web application memory Trojan detection method, terminal device and storage medium
CN113326209A (en) * 2021-08-03 2021-08-31 航天中认软件测评科技(北京)有限责任公司 Hierarchical segmentation monitoring and intervention method for large-scale parallel test task
CN113868090A (en) * 2021-10-09 2021-12-31 维沃移动通信有限公司 Application program monitoring method and device
CN114706734A (en) * 2022-06-02 2022-07-05 支付宝(杭州)信息技术有限公司 Monitoring method and monitoring system for business application

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

Cited By (48)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105122232A (en) * 2013-03-14 2015-12-02 亚马逊科技公司 Inventory service for distributed infrastructure
US10305929B2 (en) 2013-09-27 2019-05-28 Mcafee, Llc Managed software remediation
CN105683988A (en) * 2013-09-27 2016-06-15 迈克菲公司 Managed software remediation
CN104239786B (en) * 2014-10-13 2017-08-04 北京奇虎科技有限公司 Exempt from ROOT Initiative Defenses collocation method and device
CN104239786A (en) * 2014-10-13 2014-12-24 北京奇虎科技有限公司 ROOT-free active defense configuration method and device
CN104462943A (en) * 2014-11-21 2015-03-25 用友软件股份有限公司 Non-intrusive performance monitoring device and method for service system
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
CN104660606A (en) * 2015-03-05 2015-05-27 中南大学 Method for remotely monitoring safety of application program
CN104809045B (en) * 2015-04-27 2021-01-05 腾讯科技(深圳)有限公司 Running method and device of monitoring script
CN104809045A (en) * 2015-04-27 2015-07-29 腾讯科技(深圳)有限公司 Operation method and device of monitoring script
CN106326099A (en) * 2015-07-01 2017-01-11 阿里巴巴集团控股有限公司 Method and device used in program tracking and electronic device
CN106897607A (en) * 2015-12-17 2017-06-27 北京奇虎科技有限公司 A kind of method for monitoring application program and device
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
CN106484592A (en) * 2016-09-28 2017-03-08 北京奇虎科技有限公司 A kind of method for detecting abnormality and device
CN106484592B (en) * 2016-09-28 2020-01-24 北京奇虎科技有限公司 Anomaly detection method and device
CN107038103A (en) * 2017-04-14 2017-08-11 上海交通大学 Android program monitoring system and method based on bytecode pitching pile
CN109471768A (en) * 2017-09-08 2019-03-15 阿里巴巴集团控股有限公司 Monitoring method, device and the electronic equipment of traffic issues
CN109471768B (en) * 2017-09-08 2023-04-18 阿里巴巴集团控股有限公司 Service problem monitoring method and device and electronic equipment
CN109561121A (en) * 2017-09-26 2019-04-02 北京国双科技有限公司 Monitor the method and device of deployment
CN109561121B (en) * 2017-09-26 2021-10-15 北京国双科技有限公司 Method and device for monitoring deployment
CN109684027A (en) * 2017-10-18 2019-04-26 北京京东尚科信息技术有限公司 The method and apparatus of dynamically track Java Virtual Machine operation
CN108228165B (en) * 2018-01-05 2021-02-02 武汉斗鱼网络科技有限公司 Method for recording calling information between program interfaces and electronic equipment
CN108228165A (en) * 2018-01-05 2018-06-29 武汉斗鱼网络科技有限公司 The method and electronic equipment of recalls information between a kind of logging program interface
CN108563575A (en) * 2018-04-16 2018-09-21 百度在线网络技术(北京)有限公司 Applied program testing method, device, terminal and computer readable storage medium
CN108874620A (en) * 2018-05-23 2018-11-23 北京五八信息技术有限公司 A kind of event monitoring method, apparatus, equipment and storage medium applied to APP
CN111026598A (en) * 2018-10-09 2020-04-17 迈普通信技术股份有限公司 Data acquisition method and device
CN111309402A (en) * 2018-12-11 2020-06-19 阿里巴巴集团控股有限公司 Data monitoring and application program processing method, device and equipment
CN111309402B (en) * 2018-12-11 2023-06-27 阿里巴巴集团控股有限公司 Data monitoring and application program processing method, device and equipment
CN110221961A (en) * 2019-04-26 2019-09-10 平安科技(深圳)有限公司 Global hook self-repairing method, device, equipment and storage medium
CN110647438A (en) * 2019-08-13 2020-01-03 平安科技(深圳)有限公司 Event monitoring method and device, computer equipment and storage medium
WO2021027365A1 (en) * 2019-08-13 2021-02-18 平安科技(深圳)有限公司 Event monitoring method, device, computer apparatus, 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
CN113010174A (en) * 2019-12-19 2021-06-22 北京沃东天骏信息技术有限公司 Service monitoring method and device
CN113051122A (en) * 2019-12-26 2021-06-29 百度在线网络技术(北京)有限公司 Performance data acquisition method, performance data acquisition device, electronic equipment and medium
CN113051122B (en) * 2019-12-26 2023-09-15 百度在线网络技术(北京)有限公司 Performance data acquisition method, device, electronic equipment and medium
CN112559290A (en) * 2020-12-14 2021-03-26 平安国际融资租赁有限公司 Service call monitoring method and device, computer equipment and storage medium
CN112559290B (en) * 2020-12-14 2024-04-05 平安国际融资租赁有限公司 Service call monitoring method, device, computer equipment and storage medium
CN112860522A (en) * 2021-03-02 2021-05-28 北京梧桐车联科技有限责任公司 Program operation monitoring method, device and equipment
CN113312624A (en) * 2021-06-21 2021-08-27 厦门服云信息科技有限公司 Java Web application memory Trojan detection method, terminal device and storage medium
CN113312624B (en) * 2021-06-21 2023-06-30 厦门服云信息科技有限公司 Java Web application memory Trojan horse detection method, terminal equipment and storage medium
CN113326209A (en) * 2021-08-03 2021-08-31 航天中认软件测评科技(北京)有限责任公司 Hierarchical segmentation monitoring and intervention method for large-scale parallel test task
CN113868090A (en) * 2021-10-09 2021-12-31 维沃移动通信有限公司 Application program monitoring method and device
CN114706734A (en) * 2022-06-02 2022-07-05 支付宝(杭州)信息技术有限公司 Monitoring method and monitoring system for business application

Also Published As

Publication number Publication date
HK1174109A1 (en) 2013-05-31
CN102831043B (en) 2015-05-20

Similar Documents

Publication Publication Date Title
CN102831043B (en) Monitoring method and device for application program
US9634965B2 (en) System and method for providing a job manager for use with a cloud platform environment
CN109739573B (en) Processing method and device for realizing API (application program interface) call and system for realizing API
US10440138B2 (en) Provisioning IaaS services
US8386636B2 (en) Business process system management method
US20180173586A1 (en) Method for fault handling in a distributed it environment
US20070156913A1 (en) Method for enabling extension points through plug-ins
US10802954B2 (en) Automated-application-release-management subsystem that provides efficient code-change check-in
CN104375861A (en) Installation-free operation method and device for application programs based on Android platform and terminal
US8499294B2 (en) Persisting the changes for managed components in an application server
US10795646B2 (en) Methods and systems that generate proxy objects that provide an interface to third-party executables
CN109614167B (en) Method and system for managing plug-ins
JP2011516987A (en) Method and apparatus for managing mobile device software
CN104750528A (en) Management method and device for components in Android program
US20180136970A1 (en) Methods and systems for configuration-file inheritance
Xu et al. Caople: A programming language for microservices saas
CN101141306A (en) Equipment parameter loading method and apparatus
US11531674B2 (en) System and method for supporting rollback of changes made to target systems via an integration platform
Valetto et al. A uniform programming abstraction for effecting autonomic adaptations onto software systems
CN113760481A (en) Distributed timed task scheduling system and method
CN111290818A (en) Operation method for creating application program and operation method for application program
CN112445683A (en) Multi-switch detection bypass method, storage medium, device and system
Pascual et al. Towards an aspect-oriented reconfigurable middleware for pervasive systems: implementation and evaluation
EP2372544A1 (en) Distributed system
EP3872630A2 (en) Request processing method and apparatus, electronic device, and computer storage medium

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