Method for detecting whether application system based on multilayer architecture normally operates
Technical Field
The invention relates to the technical field of application system running state detection, in particular to a method for detecting whether an application system based on a multilayer architecture normally runs.
Background
The monitoring of the running state of the current application system is realized by utilizing a system running detection platform and adopting a manual regular inspection mode. The first mode is advanced, can effectively monitor the running state of the application system and timely remind operation and maintenance management personnel when abnormity occurs, but the system is huge and the construction cost is high. In the second mode, the running state of the application system can be effectively monitored, but the labor is consumed, and the condition of delayed discovery exists after the fault occurs. At present, the two modes have a common problem that whether the application condition of the application system is normal or not cannot be detected.
In the prior art, detection of an application system based on a multi-layer architecture mainly detects whether a support environment of the application system meets specified indexes, such as whether a hard disk is over-armed, whether a running environment process exists, and the like, but whether the application system can normally provide services cannot be detected, and the application condition of the application system cannot be detected.
Disclosure of Invention
In order to solve the technical problems, the invention provides a method for detecting whether an application system based on a multi-layer architecture normally operates, which can timely inform an operation and maintenance manager of a related application system to remove faults and ensure the normal operation timeliness of the application system when the WEB service, database service and application condition of the application system are abnormal. The method can effectively reduce the cost required by system maintenance.
The technical scheme adopted by the invention is as follows:
a method for detecting whether an application system based on a multi-layer architecture normally operates comprises the following steps:
step 1: configuring a target object needing an application system, wherein the target object comprises an application system list, a detection object definition, an application system list, an operation maintenance personnel notification mode definition, an email or short message template and an application condition detection function;
step 2: the acquisition module acquires web service, database service and application state data of the application system of the target object at regular time, the acquisition analysis program analyzes according to the data condition acquired by the acquisition module, and the message sending module is called to give an alarm when the abnormality is found;
and step 3: and the message sending module receives the alarm information and sends the alarm information to related operation and maintenance personnel.
The invention discloses a method for detecting whether an application system based on a multilayer architecture normally operates, which has the following technical effects:
(1): the method of the invention can not only judge whether the database service, the application service and the like of the application system operate normally, but also detect whether the application of the application system is normal.
(2): the method provided by the invention has the advantages that the implementation of the detection platform for building the running state of the application system is simple, and the overall construction cost is low.
(3): the method of the invention can inform the relevant application system operation and maintenance manager to remove the fault in time when the application system WEB service, the database service and the application condition are abnormal, thereby ensuring the normal operation timeliness of the application system, effectively reducing the manpower and material resources investment required by daily detection and maintenance and reducing the cost investment of the detection of the operation state of the application system.
Drawings
The invention is further illustrated by the following examples in conjunction with the accompanying drawings:
FIG. 1 is a flow chart of an embodiment of the method of the present invention.
Detailed Description
A method for detecting whether an application system based on a multi-layer architecture normally operates comprises the following steps:
step 1: configuring a target object needing an application system, wherein the target object comprises an application system list, a detection object definition, an operation and maintenance personnel list, an operation and maintenance personnel notification mode definition, an email or short message template and an application condition detection function;
the application system list comprises an application system code, an application system name and an application system detection address;
the detection object definition comprises an application system code and a detection object serial number;
the operation maintenance personnel list comprises maintenance personnel codes, maintenance personnel names, maintenance personnel e-mails, mobile phones and application system codes;
the operation and maintenance personnel notification mode definition comprises an operator code, whether to notify by mail or not, whether to notify by short message or not and an application system code;
the mail or short message template comprises a mail or short message code, a mail or short message content template and an application system code;
and the application condition detection function is created in a corresponding application system database as a database object, the returned result is agreed as a character string and is limited to be '0' or '1', the '0' represents that the application condition is abnormal, and the '1' represents that the application condition is normal.
The physical relationship between the detection object definition and the application system list is one-to-one, so that the detection sequence of each application system is unique and can be detected only once when periodic detection is carried out each time;
the entity relationship between the detection object definition and the operation and maintenance personnel notification mode definition is many-to-many, so that when each detected object has a problem, a plurality of operation and maintenance personnel can receive the notification, and each operation and maintenance personnel can also receive the problem notification of a plurality of detected objects;
the entity relationship between the application system list and the operation and maintenance personnel list is many-to-many, so that each application system can have a plurality of operation and maintenance personnel, and each operation and maintenance personnel can maintain a plurality of application systems;
the entity relationship between the application system list and the mail or short message template is one-to-one, so that each application system only corresponds to one mail or short message template, and each mail or short message template also only corresponds to one application system.
Step 2: the acquisition analysis program acquires web service, database service and application state data of the target object about the application system by calling the acquisition module at regular time, analyzes according to the data condition acquired by the acquisition module, and calls the message sending module to give an alarm when the abnormality is found.
Regularly accessing the detection address configured by each application system, and judging whether the web service, the database service and the application condition of each application system are normal or not, wherein the default interval is 10 minutes; and analyzing and judging the detection and judgment sequence of each application system according to the conditions of web service, database service and final application. Aiming at an application system, a front detection target finds abnormality, a message sending module is immediately called to push corresponding abnormality notification information, a rear detection target does not perform judgment and analysis any more, a target object of the application system is jumped out, and analysis and judgment of a related detection target entering a next application system are analyzed and judged.
The acquisition module is a uniform running program package of the service application corresponding to the detection address of each application system and is respectively deployed in the web server environment of each application system, and the configuration file of the application corresponds to the background database connection information of each application system in relation to the database connection configuration parameter information; the service application has the main functions of connecting a background database of a corresponding application system, inquiring an application condition detection function, returning a function value, and returning to the value of "-1" if the background database is connected and abnormal.
And step 3: and the message sending module receives the alarm information and sends the alarm information to related operation and maintenance personnel.
The message sending module is used for receiving the alarm information, sending the alarm information to relevant operation and maintenance personnel in the modes of mobile phone short messages, mails and the like, informing the operation and maintenance personnel of the abnormal application system in a limited range, forming information content by the messages according to the mails or the short message templates and the acquired and analyzed parameter values of the abnormal messages, and carrying out customized pushing according to the sending mode of the selected items of the mails and the short messages defined by the informing mode of the operation and maintenance personnel.
The method is suitable for an application system based on a multilayer architecture, the development mode of the application system is the multilayer architecture, and the multilayer architecture at least comprises four layers of an interface layer, a service layer, a business logic layer, a data access layer and the like.
Example (b):
the acquisition and analysis program detects and judges whether the related targets of each application system are normal, as shown in fig. 1, the specific steps are as follows:
s1: a background data table of the combined query acquisition and analysis program comprises an application system list and a detection object definition, which are ordered according to the sequence number attribute sequence of the detection object definition table;
s2: reading the joint query result, and taking the attribute of the application system inventory table of the ith (i =1.. N (N is the total number of the detected application systems), i > N is over): system name, detection address;
s3: accessing the detection address and returning information according to analysis, if 500 errors are met or the access is overtime, calling a message sending module interface, transmitting (system code, [ web service failure ]), sending alarm information to related operation and maintenance personnel to prompt the web service of the application system to have failure, and entering S2 after i = i + 1; otherwise, entering the next step;
s4: acquiring whether a feedback value in a return message is equal to '-1', if so, calling a message sending module interface, transmitting (a system code, a database service fault), sending an alarm message to related operation and maintenance personnel to prompt an application system database service fault, and entering S2 after i = i + 1; otherwise, entering the next step;
s5: and judging whether the feedback value in the returned message is equal to '0', if so, calling a message sending module interface, transmitting (system code, [ application condition abnormity ]), and sending alarm information to related operation and maintenance personnel to prompt the application condition abnormity of the application system. Whether equal to "0" or not, proceeds to S2 after i = i + 1.