CN110196790A - The method and apparatus of abnormal monitoring - Google Patents

The method and apparatus of abnormal monitoring Download PDF

Info

Publication number
CN110196790A
CN110196790A CN201810156740.2A CN201810156740A CN110196790A CN 110196790 A CN110196790 A CN 110196790A CN 201810156740 A CN201810156740 A CN 201810156740A CN 110196790 A CN110196790 A CN 110196790A
Authority
CN
China
Prior art keywords
monitored
code
exception
abnormal
class
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.)
Pending
Application number
CN201810156740.2A
Other languages
Chinese (zh)
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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201810156740.2A priority Critical patent/CN110196790A/en
Publication of CN110196790A publication Critical patent/CN110196790A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/26Functional testing
    • G06F11/263Generation of test inputs, e.g. test vectors, patterns or sequences ; with adaptation of the tested hardware for testability with external testers

Abstract

The invention discloses the method and apparatus of abnormal monitoring, are related to field of computer technology.One specific embodiment of this method, which comprises determining that in the source code of system to be monitored, needs monitored monitored object;The monitored object includes: class and/or method;In the system to be monitored starting, abnormal monitoring code is injected in Xiang Suoshu monitored object;Abnormal monitoring is carried out to the system to be monitored based on the abnormal monitoring code.The embodiment can dynamic acquisition system to be monitored occurs in the case where the source code of lossless system to be monitored various exceptions, realize the management on large to magnanimity system;By the way of hardware and software platform management, convenient for searching and retrieving the various exceptions that system to be monitored occurs;Can give notice in time information when system to be monitored occurs abnormal;The exception information that system to be monitored occurs can be visualized.

Description

The method and apparatus of abnormal monitoring
Technical field
The present invention relates to field of computer technology more particularly to a kind of method and apparatus of abnormal monitoring.
Background technique
New online system, due to by enough tests, not there is many codes that can dish out various exceptions.Original operation Normal system, for some reason, it is also possible to quote a large amount of exception.How to find that system occurs various different in time It often, is a technical problem urgently to be solved.
In the prior art, the various problems occurred mostly by system user of service discovery system, and feed back to opening for system Hair personnel.The developer of system checks by searching for manual methods such as the logs of system, different to occur in searching system Normal position.
In realizing process of the present invention, at least there are the following problems in the prior art for inventor's discovery:
1) aftersensation is known after, can not obtain the exception of system appearance in time;
2) pure artificial treatment cannot achieve automatic monitoring;
3) low efficiency;
4) it can not achieve the management on large to magnanimity system.
Summary of the invention
In view of this, the embodiment of the present invention provides a kind of method and apparatus of abnormal monitoring, it can be in lossless system to be monitored The various exceptions that dynamic acquisition system to be monitored occurs in the case where the source code of system, realize the extensive pipe to magnanimity system Reason;By the way of hardware and software platform management, convenient for searching and retrieving the various exceptions that system to be monitored occurs;It can be in system to be monitored There is information of giving notice in time when exception in system;The exception information that system to be monitored occurs can be visualized.
To achieve the above object, according to an aspect of an embodiment of the present invention, a kind of method of abnormal monitoring is provided, is wrapped It includes:
It determines and needs monitored monitored object in the source code of system to be monitored;The monitored object includes: class, and/ Or method;
In the system to be monitored starting, abnormal monitoring code is injected in Xiang Suoshu monitored object;
Abnormal monitoring is carried out to the system to be monitored based on the abnormal monitoring code.
Optionally it is determined that needing monitored monitored object in the source code of system to be monitored, comprising:
All classes in the source code are traversed, there will be the class of default class name as class to be monitored;Traversal it is described to The corresponding all methods of the class of monitoring, using the method with presetting method name as method to be monitored;With described to be monitored Class and the method to be monitored are as the monitored object.
Optionally, abnormal monitoring is carried out to the system to be monitored based on the monitor code, comprising:
The exception information of the system to be monitored is captured using the monitor code, determines the generation of the exception information occur Code mark;Based on the marking code, determine in the system to be monitored abnormal code position occur.
Optionally it is determined that after occurring abnormal position in the system to be monitored, further includes:
Exception record is periodically sent to predeterminated position, by the default storage position of exception record write-in of predeterminated position It sets;The exception record includes: all exception informations, and code position corresponding with each exception information.
Optionally, the exception record of predeterminated position is written after preset memory locations, further includes:
The exception record in the preset memory locations is analyzed and processed according to predetermined manner.
Optionally, after being analyzed and processed according to predetermined manner to the exception record in the preset memory locations, also Include:
Visualize the exception record after analysis processing;And/or according to the exception after analysis processing Record information of giving notice.
Another aspect according to an embodiment of the present invention provides a kind of device of abnormal monitoring, comprising: injection module;Institute It states injection module and comprises determining that unit, injection unit and monitoring unit;Wherein,
The determination unit, which determines in the source code of system to be monitored, needs monitored monitored object;The monitored object It include: class and/or method;
The injection unit injects abnormal monitoring code when the system to be monitored starts in Xiang Suoshu monitored object;
The monitoring unit is based on the abnormal monitoring code and carries out abnormal monitoring to the system to be monitored.
Optionally, the determination unit, which determines in the source code of system to be monitored, needs monitored monitored object, comprising:
All classes in the source code are traversed, there will be the class of default class name as class to be monitored;Traversal it is described to The corresponding all methods of the class of monitoring, using the method with presetting method name as method to be monitored;With described to be monitored Class and the method to be monitored are as the monitored object.
Optionally, the monitoring unit is based on the monitor code and carries out abnormal monitoring to the system to be monitored, comprising:
The exception information of the system to be monitored is captured using the monitor code, determines the generation of the exception information occur Code mark;Based on the marking code, determine in the system to be monitored abnormal code position occur.
Optionally, the device of the abnormal monitoring of the embodiment of the present invention further include: reporting module and collection module;Described in determination After occurring abnormal position in system to be monitored, exception record is periodically sent to predeterminated position by the reporting module, Preset memory locations are written in the exception record of predeterminated position by the collection module;The exception record includes: all exceptions Information, and code position corresponding with each exception information.
Optionally, the device of the abnormal monitoring of the embodiment of the present invention further include: analysis module;The exception of predeterminated position is remembered After record write-in preset memory locations, the analysis module is according to predetermined manner to the exception record in the preset memory locations It is analyzed and processed.
Optionally, the device of the abnormal monitoring of the embodiment of the present invention further include: display module and/or notification module;According to After predetermined manner is analyzed and processed the exception record in the preset memory locations, the display module is visualized The exception record after analysis processing;And/or the notification module is according to the exception record hair after analysis processing It puts up a notice information.
Other side according to an embodiment of the present invention provides a kind of electronic equipment of abnormal monitoring, comprising:
One or more processors;
Storage device, for storing one or more programs,
When one or more of programs are executed by one or more of processors, so that one or more of processing The method that device realizes the abnormal monitoring that first aspect of the embodiment of the present invention provides.
Still another aspect according to an embodiment of the present invention provides a kind of computer-readable medium, is stored thereon with computer Program realizes the method for the abnormal monitoring that first aspect of the embodiment of the present invention provides when described program is executed by processor.
One embodiment in foregoing invention have the following advantages that or the utility model has the advantages that
(1) abnormal monitoring code is injected into monitored object, and monitoring system is treated based on abnormal monitoring code and carries out exception Monitoring, can dynamic acquisition system to be monitored occurs in the case where the source code of lossless system to be monitored various exceptions, it is real Now to the management on large of magnanimity system;
(2) class with default class name and the method with presetting method name are regard as monitored object, presets class name and in advance Equipment, method name can carry out selection setting according to the actual situation, can be realized personalized monitoring;
(3) determine occur abnormal code position in system to be monitored according to the marking code for exception information occur, it can Quickly positioning abnormal position;
(4) exception record is periodically sent to predeterminated position, by the default storage of exception record write-in of predeterminated position Position can be realized exception record and report the asynchronous process analyzed with exception record, improves treatment effeciency;
(5) it by the way of hardware and software platform management, gives notice information according to the exception record after analysis processing, Neng Gou There is information of giving notice in time when exception in system to be monitored;The exception information that system to be monitored occurs is visualized, is convenient for Search and retrieve the various exceptions that system to be monitored occurs.
Further effect possessed by above-mentioned non-usual optional way adds hereinafter in conjunction with specific embodiment With explanation.
Detailed description of the invention
Attached drawing for a better understanding of the present invention, does not constitute an undue limitation on the present invention.Wherein:
Fig. 1 is the schematic diagram of the main flow of the method for abnormal monitoring according to an embodiment of the present invention;
Fig. 2 is the schematic diagram of the main flow of the method for the record according to an embodiment of the present invention that catchs the exception;
Fig. 3 is the schematic diagram of the main flow of the method for the abnormal monitoring of alternative embodiment according to the present invention;
Fig. 4 is the schematic diagram of the main modular of the device of abnormal monitoring according to an embodiment of the present invention;
Fig. 5 is the configuration diagram of the device of the abnormal monitoring of alternative embodiment according to the present invention;
Fig. 6 is that the embodiment of the present invention can be applied to exemplary system architecture figure therein;
Fig. 7 is adapted for the structural representation of the computer system for the terminal device or server of realizing the embodiment of the present invention Figure.
Specific embodiment
Below in conjunction with attached drawing, an exemplary embodiment of the present invention will be described, including the various of the embodiment of the present invention Details should think them only exemplary to help understanding.Therefore, those of ordinary skill in the art should recognize It arrives, it can be with various changes and modifications are made to the embodiments described herein, without departing from scope and spirit of the present invention.Together Sample, for clarity and conciseness, descriptions of well-known functions and structures are omitted from the following description.
Compared with the abnormal conditions for needing artificial lookup system to occur in the prior art, the present invention is in the source of system to be monitored In code inject abnormal monitoring code, can not only in the case where the source code of lossless system to be monitored dynamic acquisition it is to be monitored The various exceptions that system occurs, moreover it is possible to realize the management on large to magnanimity system.In addition, the embodiment of the present invention uses hardware and software platform The mode of management, convenient for searching and retrieving the various exceptions that system to be monitored occurs.
It should be noted that in the absence of conflict, each embodiment and each technical characteristic that the present invention refers to It can be combined with each other.
Fig. 1 is the schematic diagram of the main flow of the method for abnormal monitoring according to an embodiment of the present invention, as shown in Figure 1, different The method often monitored, comprising:
Step S101, it determines and needs monitored monitored object in the source code of system to be monitored;The monitored object packet It includes: class and/or method;
Step S102, when the system to be monitored starts, abnormal monitoring code is injected in Xiang Suoshu monitored object;
Step S103, abnormal monitoring is carried out to the system to be monitored based on the abnormal monitoring code.
The system to be monitored that the embodiment of the present invention refers to, can be various systems, such as operate in JVM (Java Virtual Machine, Java Virtual Machine) in system.Abnormal monitoring code is injected into monitored object in system starting, Can be to running system monitoring by the abnormal monitoring code of injection, when system occurs abnormal, timely capture systems go out Existing exception information.Abnormal monitoring is carried out to system based on abnormal monitoring code, it can be the source code of lossless system the case where The various exceptions that lower dynamic acquisition system occurs realize the management on large to magnanimity system.
It determines and needs monitored monitored object in the source code of system to be monitored, may include: the traversal source code In all classes, will have the class of default class name as class to be monitored;The corresponding all methods of the class to be monitored are traversed, Using the method with presetting method name as method to be monitored;Using the class to be monitored and the method to be monitored as The monitored object.In the embodiment of the present invention, using the class with default class name and the method with presetting method name as monitoring Object.Those skilled in the art can select default class name and presetting method name according to practical application scene and monitoring demand Setting is selected, to realize personalized monitoring, extends the application range of the embodiment of the present invention.
By taking the source file of system to be monitored is Java source file as an example.After being compiled, each class of Java source file (or interface) all individually occupies a Class file, and Class file is a kind of binary stream file of octet, each number It is closely arranged from front to back in order according to item and dos command line DOS.The main task of injection abnormal monitoring code seeks to find those Then instruction comprising exception throws and capture dynamically adds abnormal monitoring code around these instructions in JVM.Due to two into Stream file processed is more demanding to the profession of user of service, it is not easy to understand, therefore can be by other development libraries.
For simpler source file, the step of injecting abnormal monitoring code can be realized by AspectJ. AspectJ is the frame towards section, it extends Java language, and (Java language is that one kind can write cross-platform The object oriented program language of software).AspectJ defines AOP (Aspect Oriented Programming, face To tangent plane programming) grammer, so it has a special compiler for generating the Class text in accordance with Java byte code specification Part.
For more complex source file, the step of injecting abnormal monitoring code can be realized by ASM.ASM is one Java bytecode manipulates frame.It can be used to the function of dynamic generation class or the existing class of enhancing.
Fig. 2 is the schematic diagram of the main flow of the method for the record according to an embodiment of the present invention that catchs the exception.Such as Fig. 2 institute Show, the method for injection abnormal monitoring code includes:
1) entrance class is created, to carry out dynamic modification to the source code of system before JVM operation main function (principal function);
2) static function premain is realized, i.e., one public static of creation in the entrance class of creation Premain function;
3) it realizes a ClassFileTransformer, that is, creates one and inherit in ClassFileTransformer Self defined class, effect is to look for needing to be added into source code the class and method (these classes and method of abnormal monitoring code It is pre-configured with by developer, configuration mode can use regular expression, such as com.jd.wms.*;)
4) subclass of a MethodAdapter class is realized;
5) the heavy duty visitTryCatchBlock function inside the subclass of MethodAdapter class;Heavy duty The process of visitTryCatchBlock function is actually that the abnormal monitoring code for the information that is used to catch the exception is added to need Carry out the class of abnormal monitoring and the process of method;
6) it is caught the exception information using visitTryCatchBlock function, and positions the corresponding exception bits of exception information It sets.In actual application, exception record can be formed according to the exception information of capture and its corresponding abnormal position, it will be abnormal Record is sent in specified file;
7) circular test sees it is to have to need to capture there are also abnormal;
If 8) without then, terminating;Otherwise, it gos to step 7).
Abnormal monitoring is carried out to the system to be monitored based on the monitor code, may include: to utilize the monitoring generation The exception information of system to be monitored described in Code acquisition determines the marking code of the exception information occur;Based on the code mark Know, determines in the system to be monitored abnormal code position occur.With the exception for needing manually to search system in the prior art Position is compared, and is determined occur abnormal code position in system according to the marking code for exception information occur, can quickly be positioned Abnormal position, high-efficient, accuracy is good.
It determines after there is abnormal position in the system to be monitored, can also include: periodically by exception record It is sent to predeterminated position, preset memory locations are written into the exception record of predeterminated position;The exception record includes: all different Normal information, and code position corresponding with each exception information.Predeterminated position or preset memory locations herein can To carry out selection setting according to the actual situation, as long as exception record can be stored.For example, predeterminated position can be for receiving Collect the server cluster of exception information and its abnormal position, preset memory locations can be for carrying out at analysis to exception record The disk of the system of reason.
In some embodiments, the operating condition of system to be monitored can be monitored in real time, if there is exception in system to be monitored, Catch the exception information in time, and exception record is sent to designated position in real time, then at regular intervals will be in the designated position Exception record be sent to above-mentioned predeterminated position.Compared with exception record is sent to above-mentioned predeterminated position in real time, periodically Transmission can substantially reduce the transmission frequency, reduce the occupancy to system resources in computation.
Exception record is written after preset memory locations, exception record can be obtained from the predeterminated position, to be analyzed Processing.By the way that exception record is first sent to predeterminated position, preset memory locations then are written into the exception record of predeterminated position, It can be realized exception record and report the asynchronous process analyzed with exception record, improve treatment effeciency.
It can also include: according to predetermined manner to institute after preset memory locations are written in the exception record of predeterminated position The exception record stated in preset memory locations is analyzed and processed.Predetermined manner herein can be selected according to the actual situation Design, the embodiment of the present invention are not specifically limited in this embodiment.For example, classification processing is carried out to the exception record in predeterminated position, with Obtain the abnormal conditions of each classification;For another example discriminatory analysis is carried out to the exception record in predeterminated position, to determine that certain is a kind of Whether the quantity of the exception record of type is more than preset quantity threshold value, to judge whether to need to issue alarm notification;For another example root It is generated according to the exception record in predeterminated position and visualizes file, each exception record is visually showed into user.
After being analyzed and processed according to predetermined manner to the exception record in the preset memory locations, it can also wrap It includes: visualizing the exception record after analysis processing;And/or according to the exception record after analysis processing It gives notice information.By the way of hardware and software platform management, give notice information according to the exception record after analysis processing, it can It gives notice in time when system to be monitored occurs abnormal information.The mode for information of giving notice can carry out according to the actual situation Selection design, as long as can notify wait notify object.Such as pass through SMS, mail, IM (instant Message, instant message) etc..The exception information that system to be monitored occurs is visualized, convenient for searching and retrieving system to be monitored The various exceptions that system occurs.For example, the exception record after analysis is handled is sent to Web (webpage) program, pass through Web program It is visualized.
Fig. 3 is the schematic diagram of the main flow of the method for the abnormal monitoring of alternative embodiment according to the present invention.Such as Fig. 3 institute Show, the method for abnormal monitoring includes:
Abnormal monitoring code is injected in system to be monitored starting;
When capturing exception information, predeterminated position periodically is written into exception record;
The exception record in predetermined position is stored in file system;File system herein, can be for exception record The disk for the system being analyzed and processed;
It is analyzed and processed according to exception record of the predetermined manner to deposit file system;
Summarize alarm according to predetermined period transmission, while will analyze that treated exception record is sent to Solr or ES etc Search engine in.Solr is an independent enterprise-level search application server, it externally provides and is similar to Web-service Api interface.User can be requested by Http (Hyper Text Transfer Protocol, hypertext transfer protocol), The XML file of certain format is submitted to search engine server, generates index;It can also be operated by Http Get and propose to search Request, and obtain XML (Extensible Markup Language, extensible markup language, the son of standard generalized markup language Collection, is a kind of for marking electronic document to make it have structural markup language) format returns the result.Es is ElasticSearch is the search server based on Lucene.It provides the full text of a distributed multi-user ability Search engine is based on RESTful web interface.ES is developed with Java language, and as opening under Apache license terms Source code publication is put, is Enterprise search engine currently popular.Designed in cloud computing, capable of reaching real-time search, stablize, Reliably, quickly, easy to install and use;
User, which logs in, show after search engine and analyzes treated exception record.
Another aspect according to an embodiment of the present invention provides a kind of device of abnormal monitoring.
Fig. 4 is the schematic diagram of the main modular of the device of abnormal monitoring according to an embodiment of the present invention.As shown in figure 4, different The device 400 often monitored includes: injection module 401;The injection module 401 comprises determining that unit 4011, injection unit 4012 With monitoring unit 4013;Wherein,
Monitored monitored object is needed in the source code of the determining system to be monitored of the determination unit 4011;The monitoring Object includes: class and/or method;
The injection unit 4012 injects abnormal monitoring generation in Xiang Suoshu monitored object when the system to be monitored starts Code;
The monitoring unit 4013 is based on the abnormal monitoring code and carries out abnormal monitoring to the system to be monitored.
Optionally, monitored monitored object is needed in the source code of the determining system to be monitored of the determination unit 4011, Include:
All classes in the source code are traversed, there will be the class of default class name as class to be monitored;Traversal it is described to The corresponding all methods of the class of monitoring, using the method with presetting method name as method to be monitored;With described to be monitored Class and the method to be monitored are as the monitored object.
Optionally, the monitoring unit 4013 is based on the monitor code and carries out abnormal monitoring to the system to be monitored, Include:
The exception information of the system to be monitored is captured using the monitor code, determines the generation of the exception information occur Code mark;Based on the marking code, determine in the system to be monitored abnormal code position occur.
Optionally, the device 400 of the abnormal monitoring of the embodiment of the present invention further include: reporting module 402 and collection module 403;It determines after there is abnormal position in the system to be monitored, the reporting module periodically sends exception record To predeterminated position, preset memory locations are written in the exception record of predeterminated position by the collection module;The exception record includes: All exception informations, and code position corresponding with each exception information.
Optionally, the device 400 of the abnormal monitoring of the embodiment of the present invention further include: analysis module 404;By predeterminated position Exception record is written after preset memory locations, and the analysis module is according to predetermined manner to different in the preset memory locations Often record is analyzed and processed.
Optionally, the device 400 of the abnormal monitoring of the embodiment of the present invention further include: display module 405 and/or notification module 406;After being analyzed and processed according to predetermined manner to the exception record in the preset memory locations, the display module can Depending on changing the exception record after showing analysis processing;And/or the notification module is according to described different after analysis processing Often record information of giving notice.
Fig. 5 is the configuration diagram of the device of the abnormal monitoring of alternative embodiment according to the present invention.As shown in figure 5, each Application server is the system to be monitored in the embodiment of the present invention.Application server 1, application server 2 ..., application service Injection module and reporting module are respectively arranged in device n.Injecting codes packet injects abnormal monitoring code in figure, answers for supervising sky With the operating condition of server, when application server occurs abnormal, the information that catchs the exception in time, positioning exception information are corresponding Abnormal position.It is provided with exception information in reporting module and reports program, for periodically by the exception record of corresponding server It is sent to and predeterminated position, i.e., the exception information in figure collects server cluster.Exception information collects server cluster will wherein Exception record be sent in monitoring/Analysis server cluster, monitoring/Analysis server cluster to received exception record carry out Various classification, working process.By treated, exception record is sent to Web displaying server set to monitoring/Analysis server cluster Group, visually to show each abnormal problem to user.Meanwhile monitoring/Analysis server cluster is to received exception record After carrying out various classification, working process, advice method is determined, such as pass through SMS, mail, IM (instant Message, instant message) etc., notification information is then sent by notice system.
Other side according to an embodiment of the present invention provides a kind of electronic equipment of abnormal monitoring, comprising:
One or more processors;
Storage device, for storing one or more programs,
When one or more of programs are executed by one or more of processors, so that one or more of processing The method that device realizes the abnormal monitoring that first aspect of the embodiment of the present invention provides.
Fig. 6 is shown can be using the exemplary of the device of the method or abnormal monitoring of the abnormal monitoring of the embodiment of the present invention System architecture 600.
As shown in fig. 6, system architecture 600 may include terminal device 601,602,603, network 604 and server 605. Network 604 between terminal device 601,602,603 and server 605 to provide the medium of communication link.Network 604 can be with Including various connection types, such as wired, wireless communication link or fiber optic cables etc..
User can be used terminal device 601,602,603 and be interacted by network 604 with server 605, to receive or send out Send message etc..Various telecommunication customer end applications, such as the application of shopping class, net can be installed on terminal device 601,602,603 (merely illustrative) such as the application of page browsing device, searching class application, instant messaging tools, mailbox client, social platform softwares.
Terminal device 601,602,603 can be the various electronic equipments with display screen and supported web page browsing, packet Include but be not limited to smart phone, tablet computer, pocket computer on knee and desktop computer etc..
Server 605 can be to provide the server of various services, such as utilize terminal device 601,602,603 to user The shopping class website browsed provides the back-stage management server (merely illustrative) supported.Back-stage management server can be to reception To the data such as information query request analyze etc. processing, and by processing result (such as target push information, product letter Breath -- merely illustrative) feed back to terminal device.
It should be noted that the method for abnormal monitoring provided by the embodiment of the present invention is generally executed by server 605, phase Ying Di, the device of abnormal monitoring are generally positioned in server 605.
It should be understood that the number of terminal device, network and server in Fig. 6 is only schematical.According to realization need It wants, can have any number of terminal device, network and server.
Below with reference to Fig. 7, it illustrates the computer systems 700 for the terminal device for being suitable for being used to realize the embodiment of the present invention Structural schematic diagram.Terminal device shown in Fig. 7 is only an example, function to the embodiment of the present invention and should not use model Shroud carrys out any restrictions.
As shown in fig. 7, computer system 700 includes central processing unit (CPU) 701, it can be read-only according to being stored in Program in memory (ROM) 702 or be loaded into the program in random access storage device (RAM) 703 from storage section 708 and Execute various movements appropriate and processing.In RAM 703, also it is stored with system 700 and operates required various programs and data. CPU 701, ROM 702 and RAM 703 are connected with each other by bus 704.Input/output (I/O) interface 705 is also connected to always Line 704.
I/O interface 705 is connected to lower component: the importation 706 including keyboard, mouse etc.;It is penetrated including such as cathode The output par, c 707 of spool (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.;Storage section 708 including hard disk etc.; And the communications portion 709 of the network interface card including LAN card, modem etc..Communications portion 709 via such as because The network of spy's net executes communication process.Driver 710 is also connected to I/O interface 705 as needed.Detachable media 711, such as Disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on as needed on driver 710, in order to read from thereon Computer program be mounted into storage section 708 as needed.
Particularly, disclosed embodiment, the process described above with reference to flow chart may be implemented as counting according to the present invention Calculation machine software program.For example, embodiment disclosed by the invention includes a kind of computer program product comprising be carried on computer Computer program on readable medium, the computer program include the program code for method shown in execution flow chart.? In such embodiment, which can be downloaded and installed from network by communications portion 709, and/or from can Medium 711 is dismantled to be mounted.When the computer program is executed by central processing unit (CPU) 701, system of the invention is executed The above-mentioned function of middle restriction.
It should be noted that computer-readable medium shown in the present invention can be computer-readable signal media or meter Calculation machine readable storage medium storing program for executing either the two any combination.Computer readable storage medium for example can be --- but not Be limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or any above combination.Meter The more specific example of calculation machine readable storage medium storing program for executing can include but is not limited to: have the electrical connection, just of one or more conducting wires Taking formula computer disk, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type may be programmed read-only storage Device (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory device, Or above-mentioned any appropriate combination.In the present invention, computer readable storage medium can be it is any include or storage journey The tangible medium of sequence, the program can be commanded execution system, device or device use or in connection.And at this In invention, computer-readable signal media may include in a base band or as carrier wave a part propagate data-signal, Wherein carry computer-readable program code.The data-signal of this propagation can take various forms, including but unlimited In electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be that computer can Any computer-readable medium other than storage medium is read, which can send, propagates or transmit and be used for By the use of instruction execution system, device or device or program in connection.Include on computer-readable medium Program code can transmit with any suitable medium, including but not limited to: wireless, electric wire, optical cable, RF etc. are above-mentioned Any appropriate combination.
Flow chart and block diagram in attached drawing are illustrated according to the system of various embodiments of the invention, method and computer journey The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation A part of one module, program segment or code of table, a part of above-mentioned module, program segment or code include one or more Executable instruction for implementing the specified logical function.It should also be noted that in some implementations as replacements, institute in box The function of mark can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are practical On can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it wants It is noted that the combination of each box in block diagram or flow chart and the box in block diagram or flow chart, can use and execute rule The dedicated hardware based systems of fixed functions or operations is realized, or can use the group of specialized hardware and computer instruction It closes to realize.
Being described in the embodiment of the present invention involved unit or module can be realized by way of software, can also be with It is realized by way of hardware.Described unit or module also can be set in the processor, for example, can be described as: A kind of processor includes: injection module, and injection module includes determination unit, injection unit and monitoring unit;Determination unit determines Monitored monitored object is needed in the source code of system to be monitored;Injection unit is when the system to be monitored starts, to institute State injection abnormal monitoring code in monitored object;Monitoring unit is based on the abnormal monitoring code and carries out to the system to be monitored Abnormal monitoring.Wherein, the title of these units or module does not constitute the restriction to the unit itself, example under certain conditions Such as, determination unit is also described as " injecting abnormal monitoring into the monitored object in the system to be monitored starting The unit of code ".
As on the other hand, the present invention also provides a kind of computer-readable medium, which be can be Included in equipment described in above-described embodiment;It is also possible to individualism, and without in the supplying equipment.Above-mentioned calculating Machine readable medium carries one or more program, when said one or multiple programs are executed by the equipment, makes The equipment comprises determining that in the source code of system to be monitored and needs monitored monitored object;The monitored object includes: Class and/or method;In the system to be monitored starting, abnormal monitoring code is injected in Xiang Suoshu monitored object;Based on described Abnormal monitoring code carries out abnormal monitoring to the system to be monitored.
Technical solution according to an embodiment of the present invention, has the following beneficial effects:
(1) abnormal monitoring code is injected into monitored object, and monitoring system is treated based on abnormal monitoring code and carries out exception Monitoring, can dynamic acquisition system to be monitored occurs in the case where the source code of lossless system to be monitored various exceptions, it is real Now to the management on large of magnanimity system;
(2) class with default class name and the method with presetting method name are regard as monitored object, presets class name and in advance Equipment, method name can carry out selection setting according to the actual situation, can be realized personalized monitoring;
(3) determine occur abnormal code position in system to be monitored according to the marking code for exception information occur, it can Quickly positioning abnormal position;
(4) exception record is periodically sent to predeterminated position, by the default storage of exception record write-in of predeterminated position Position can be realized exception record and report the asynchronous process analyzed with exception record, improves treatment effeciency;
(5) it by the way of hardware and software platform management, gives notice information according to the exception record after analysis processing, Neng Gou There is information of giving notice in time when exception in system to be monitored;The exception information that system to be monitored occurs is visualized, is convenient for Search and retrieve the various exceptions that system to be monitored occurs.
Above-mentioned specific embodiment, does not constitute a limitation on the scope of protection of the present invention.Those skilled in the art should be bright It is white, design requirement and other factors are depended on, various modifications, combination, sub-portfolio and substitution can occur.It is any Made modifications, equivalent substitutions and improvements etc. within the spirit and principles in the present invention, should be included in the scope of the present invention Within.

Claims (14)

1. a kind of method of abnormal monitoring characterized by comprising
It determines and needs monitored monitored object in the source code of system to be monitored;The monitored object includes: class, and/or side Method;
In the system to be monitored starting, abnormal monitoring code is injected in Xiang Suoshu monitored object;
Abnormal monitoring is carried out to the system to be monitored based on the abnormal monitoring code.
2. the method as described in claim 1, which is characterized in that determine and need monitored prison in the source code of system to be monitored Control object, comprising:
All classes in the source code are traversed, there will be the class of default class name as class to be monitored;It traverses described to be monitored The corresponding all methods of class, using the method with presetting method name as method to be monitored;With the class to be monitored and The method to be monitored is as the monitored object.
3. method according to claim 2, which is characterized in that carried out based on the monitor code to the system to be monitored different Often monitoring, comprising:
The exception information of the system to be monitored is captured using the monitor code, determines the code mark of the exception information occur Know;Based on the marking code, determine in the system to be monitored abnormal code position occur.
4. method as claimed in claim 3, which is characterized in that determine occur in the system to be monitored abnormal position it Afterwards, further includes:
Exception record is periodically sent to predeterminated position, preset memory locations are written into the exception record of predeterminated position;Institute Stating exception record includes: all exception informations, and code position corresponding with each exception information.
5. method as claimed in claim 4, which is characterized in that by the exception record of predeterminated position write-in preset memory locations it Afterwards, further includes:
The exception record in the preset memory locations is analyzed and processed according to predetermined manner.
6. method as claimed in claim 5, which is characterized in that according to predetermined manner to the exception in the preset memory locations After record is analyzed and processed, further includes:
Visualize the exception record after analysis processing;And/or according to the exception record after analysis processing It gives notice information.
7. a kind of device of abnormal monitoring characterized by comprising injection module;The injection module comprises determining that unit, Injection unit and monitoring unit;Wherein,
The determination unit, which determines in the source code of system to be monitored, needs monitored monitored object;The monitored object packet It includes: class and/or method;
The injection unit injects abnormal monitoring code when the system to be monitored starts in Xiang Suoshu monitored object;
The monitoring unit is based on the abnormal monitoring code and carries out abnormal monitoring to the system to be monitored.
8. device as claimed in claim 7, which is characterized in that the determination unit determines to be needed in the source code of system to be monitored Monitored object to be monitored, comprising:
All classes in the source code are traversed, there will be the class of default class name as class to be monitored;It traverses described to be monitored The corresponding all methods of class, using the method with presetting method name as method to be monitored;With the class to be monitored and The method to be monitored is as the monitored object.
9. device as claimed in claim 8, which is characterized in that the monitoring unit is based on the monitor code to described wait supervise Control system carries out abnormal monitoring, comprising:
The exception information of the system to be monitored is captured using the monitor code, determines the code mark of the exception information occur Know;Based on the marking code, determine in the system to be monitored abnormal code position occur.
10. device as claimed in claim 9, which is characterized in that further include: reporting module and collection module;Determine it is described to After occurring abnormal position in monitoring system, exception record is periodically sent to predeterminated position by the reporting module, institute It states collection module and preset memory locations is written into the exception record of predeterminated position;The exception record includes: all abnormal letters Breath, and code position corresponding with each exception information.
11. device as claimed in claim 10, which is characterized in that further include: analysis module;By the exception record of predeterminated position Be written preset memory locations after, the analysis module according to predetermined manner to the exception record in the preset memory locations into Row analysis processing.
12. device as claimed in claim 11, which is characterized in that further include: display module and/or notification module;According to pre- If after mode is analyzed and processed the exception record in the preset memory locations, the display module, which visualizes, to be divided The exception record after analysis processing;And/or the notification module is issued according to the exception record after analysis processing Notification information.
13. a kind of electronic equipment of abnormal monitoring characterized by comprising
One or more processors;
Storage device, for storing one or more programs,
When one or more of programs are executed by one or more of processors, so that one or more of processors are real Now such as method as claimed in any one of claims 1 to 6.
14. a kind of computer-readable medium, is stored thereon with computer program, which is characterized in that described program is held by processor Such as method as claimed in any one of claims 1 to 6 is realized when row.
CN201810156740.2A 2018-02-24 2018-02-24 The method and apparatus of abnormal monitoring Pending CN110196790A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810156740.2A CN110196790A (en) 2018-02-24 2018-02-24 The method and apparatus of abnormal monitoring

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810156740.2A CN110196790A (en) 2018-02-24 2018-02-24 The method and apparatus of abnormal monitoring

Publications (1)

Publication Number Publication Date
CN110196790A true CN110196790A (en) 2019-09-03

Family

ID=67743997

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810156740.2A Pending CN110196790A (en) 2018-02-24 2018-02-24 The method and apparatus of abnormal monitoring

Country Status (1)

Country Link
CN (1) CN110196790A (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111949481A (en) * 2020-08-11 2020-11-17 安徽继远检验检测技术有限公司 Anomaly tracking detection system based on micro-service
CN112486823A (en) * 2020-11-30 2021-03-12 建信金融科技有限责任公司 Error code checking method and device, electronic equipment and readable storage medium
CN112783716A (en) * 2019-11-11 2021-05-11 北京沃东天骏信息技术有限公司 Monitoring method and device
CN112948726A (en) * 2021-03-29 2021-06-11 建信金融科技有限责任公司 Method, device and system for processing abnormal information
CN113094225A (en) * 2020-01-09 2021-07-09 北京搜狗科技发展有限公司 Abnormal log monitoring method and device and electronic equipment
CN113259022A (en) * 2021-05-17 2021-08-13 深圳英智源智能系统有限公司 Receiving and sending sharing monitoring method, unit, system and storage medium
CN113254023A (en) * 2021-05-14 2021-08-13 网易(杭州)网络有限公司 Object reading method and device and electronic equipment
CN113377629A (en) * 2020-03-09 2021-09-10 北京沃东天骏信息技术有限公司 Method and device for monitoring user abnormal codes
CN113760720A (en) * 2021-01-07 2021-12-07 北京沃东天骏信息技术有限公司 Code abnormal information display method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101276271A (en) * 2007-03-29 2008-10-01 北京邮电大学 Method and interceptor system facing to tangent plane programming
US20150106348A1 (en) * 2013-10-15 2015-04-16 Oracle International Corporation Monitoring business transaction failures involving database procedure calls
CN106909498A (en) * 2015-12-22 2017-06-30 阿里巴巴集团控股有限公司 A kind of java applet injects the method and system of failure

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101276271A (en) * 2007-03-29 2008-10-01 北京邮电大学 Method and interceptor system facing to tangent plane programming
US20150106348A1 (en) * 2013-10-15 2015-04-16 Oracle International Corporation Monitoring business transaction failures involving database procedure calls
CN106909498A (en) * 2015-12-22 2017-06-30 阿里巴巴集团控股有限公司 A kind of java applet injects the method and system of failure

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112783716A (en) * 2019-11-11 2021-05-11 北京沃东天骏信息技术有限公司 Monitoring method and device
CN112783716B (en) * 2019-11-11 2024-04-05 北京沃东天骏信息技术有限公司 Monitoring method and device
CN113094225A (en) * 2020-01-09 2021-07-09 北京搜狗科技发展有限公司 Abnormal log monitoring method and device and electronic equipment
CN113094225B (en) * 2020-01-09 2024-03-01 北京搜狗科技发展有限公司 Abnormal log monitoring method and device and electronic equipment
CN113377629A (en) * 2020-03-09 2021-09-10 北京沃东天骏信息技术有限公司 Method and device for monitoring user abnormal codes
CN111949481A (en) * 2020-08-11 2020-11-17 安徽继远检验检测技术有限公司 Anomaly tracking detection system based on micro-service
CN112486823B (en) * 2020-11-30 2023-06-09 建信金融科技有限责任公司 Error code verification method and device, electronic equipment and readable storage medium
CN112486823A (en) * 2020-11-30 2021-03-12 建信金融科技有限责任公司 Error code checking method and device, electronic equipment and readable storage medium
CN113760720A (en) * 2021-01-07 2021-12-07 北京沃东天骏信息技术有限公司 Code abnormal information display method and device
CN112948726A (en) * 2021-03-29 2021-06-11 建信金融科技有限责任公司 Method, device and system for processing abnormal information
CN113254023B (en) * 2021-05-14 2023-08-11 网易(杭州)网络有限公司 Object reading method and device and electronic equipment
CN113254023A (en) * 2021-05-14 2021-08-13 网易(杭州)网络有限公司 Object reading method and device and electronic equipment
CN113259022A (en) * 2021-05-17 2021-08-13 深圳英智源智能系统有限公司 Receiving and sending sharing monitoring method, unit, system and storage medium

Similar Documents

Publication Publication Date Title
CN110196790A (en) The method and apparatus of abnormal monitoring
US11886464B1 (en) Triage model in service monitoring system
US10942960B2 (en) Automatic triage model execution in machine data driven monitoring automation apparatus with visualization
CN109344076A (en) A kind of automatic interface testing method and its device based on JMeter and Jenkins
CN109992454A (en) The method, apparatus and storage medium of fault location
CN110427304A (en) O&M method, apparatus, electronic equipment and medium for banking system
CN109656744A (en) The method and apparatus for realizing data check and injection are explained based on Java
CN109933509A (en) A kind of method and apparatus for realizing automatic test defect management
CN109002440A (en) Method, apparatus and system for big data multidimensional analysis
CN112231274B (en) Log summarizing method and device, electronic equipment and storage medium
CN109145027A (en) Data statistical approach, device, equipment and computer readable storage medium
CN110019437A (en) A kind of method and system exporting data
CN108170843A (en) For obtaining the method and apparatus of data
CN109829121A (en) A kind of method and apparatus clicking behavioral data and reporting
CN109582317A (en) Method and apparatus for debugging boarding application
CN110083457A (en) A kind of data capture method, device and data analysing method, device
CN110162448A (en) The method and apparatus of log collection
CN109684027A (en) The method and apparatus of dynamically track Java Virtual Machine operation
CN109960212A (en) Task sending method and device
CN110059064A (en) Journal file processing method, device and computer readable storage medium
CN112346774A (en) Method and device for generating application installation package
CN109788010A (en) A kind of method and apparatus of data localization access
CN109582580A (en) For debugging system, the method and apparatus of the page
CN110399187A (en) A kind for the treatment of method and apparatus of language resource
CN115202973A (en) Application running state determining method and device, electronic equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination