CN116257434A - Application program health detection method and device - Google Patents

Application program health detection method and device Download PDF

Info

Publication number
CN116257434A
CN116257434A CN202211726636.5A CN202211726636A CN116257434A CN 116257434 A CN116257434 A CN 116257434A CN 202211726636 A CN202211726636 A CN 202211726636A CN 116257434 A CN116257434 A CN 116257434A
Authority
CN
China
Prior art keywords
health
application
detection
script
command
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
CN202211726636.5A
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.)
Guangxi Jiaokong Zhiwei Technology Development Co ltd
Original Assignee
Guangxi Jiaokong Zhiwei Technology Development 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 Guangxi Jiaokong Zhiwei Technology Development Co ltd filed Critical Guangxi Jiaokong Zhiwei Technology Development Co ltd
Priority to CN202211726636.5A priority Critical patent/CN116257434A/en
Publication of CN116257434A publication Critical patent/CN116257434A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/302Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention provides a method and a device for detecting the health of an application program, which belong to the technical field of computers and are applied to detecting the application program, and comprise the following steps: executing a timing scheduler based on the health detection script information to construct a command script executor; acquiring configuration information based on the command script executor to generate a command execution tool; invoking the command execution tool to execute an application detection script so as to detect the state and environment of each application program to be detected and generate a detection result; and determining the health grade of each application program to be tested according to the detection result. According to the method and the device for detecting the health of the application program, provided by the invention, the intelligent detection of the health state of the application program can be realized by constructing the command execution environment and executing the environment monitoring script, and the method is simple and high in monitoring efficiency.

Description

Application program health detection method and device
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for detecting health of an application program.
Background
With the development of technology, a large number of application programs are deployed in a rail transit system, and the environment of the application programs is more complex, so as to realize increasingly complex functions.
In order to ensure the normal operation of the rail transit system, the operation environment of each application program deployed in the system and the operation state of the application program need to be checked and maintained regularly to determine whether the application is available or not so as to realize real-time monitoring.
However, in the environment of various applications deployed and in the process of detecting the application, there is a problem that the inspection period is long, resulting in inefficiency.
Disclosure of Invention
The application program health detection method and device provided by the invention are used for solving the problem that the detection period is long in the environment of various deployed applications and the detection process of the application in the prior art, so that the defect of low efficiency is caused, the intelligent detection of the health state of the application program is realized, and the method is simple and the monitoring efficiency is high.
The invention provides an application program health detection method, which is applied to detection of application programs and comprises the following steps:
executing a timing scheduler based on the health detection script information to construct a command script executor;
acquiring configuration information based on the command script executor to generate a command execution tool;
invoking the command execution tool to execute an application detection script so as to detect the state and environment of each application program to be detected and generate a detection result;
and determining the health grade of each application program to be tested according to the detection result.
According to the method for detecting health of an application program provided by the invention, based on health detection script information, a timing scheduler is executed to construct a command script executor, comprising:
constructing a script work frame based on the health detection script information, setting the execution time of a command script, and generating a time rule definition tool to construct a timing trigger based on the time rule definition tool;
the timing scheduler is executed based on the scripting work framework and the timing triggers to construct a command script executor.
According to the application program health detection method provided by the invention, the configuration information comprises the following steps: the configuration of the connection information of the server or the configuration values of the configuration items of the script replacement field configuration table in the database, the configuration information is acquired based on the command script executor so as to generate a command execution tool, and the method comprises the following steps:
based on the command script executor, acquiring the connection information configuration under the condition that the connection information configuration exists; calling the configuration value in the condition that the connection information configuration does not exist;
and analyzing the connection information configuration or the configuration value to generate the command execution tool.
According to the method for detecting the health of the application program provided by the invention, the command execution tool is called to execute the application detection script so as to detect the state and the environment of each application program to be detected, and a detection result is generated, and the method comprises the following steps:
calling the connection information configuration or the configuration value to replace a placeholder in a command template so as to acquire a script command of the application detection script;
under the condition that the script command is used for indicating a storage path of the application detection script, acquiring the application detection script from the storage path according to the script command;
and calling the command execution tool based on the Jsch framework, and executing the application detection script to generate detection results of all application programs to be detected.
According to the method for detecting the health of the application program provided by the invention, the health grade of each application program to be detected is determined according to the detection result, and the method comprises the following steps:
invoking health rules in a health check function table in the database, analyzing and diagnosing the detection result, and determining the health state value of each application program to be detected;
and determining the health grade of each application program to be tested according to the health state value, and storing the health state value into a viewing history command table of the database.
According to the method for detecting the health of the application program provided by the invention, after determining the health grade of each application program to be detected, under the condition that the health grade of any application program to be detected is a fault, the method further comprises the following steps:
acquiring maintenance measure information of any application program to be tested in a fault maintenance table in the database;
generating a maintenance command based on the maintenance measure information;
invoking the command execution tool to execute the maintenance command; the maintenance command is further used for updating the state of the health check function table, and storing the updated state of the health check function table to the viewing history command table.
According to the method for detecting the health of the application program provided by the invention, before the timing scheduler is executed based on the health detection script information to construct the command script executor, the method further comprises the following steps:
under the condition that the script configuration of the health detection maintenance strategy in the database is changed, acquiring health detection script information in the database;
and adding the health detection script information into a resource management work group.
The invention also provides a server, wherein the server is provided with a detection application program; the system also comprises a memory and a program or an instruction stored in the memory and capable of running on the detection application program, wherein the program or the instruction executes the application program health detection method when the program or the instruction is executed by the detection application program.
The invention also provides an application program health detection device, which comprises:
the execution module is used for executing the timing scheduler based on the health detection script information to construct a command script executor;
the acquisition module is used for acquiring configuration information based on the command script executor so as to generate a command execution tool;
the detection module is used for calling the command execution tool and executing an application detection script so as to detect the state and environment of each application program to be detected and generate a detection result;
and the determining module is used for determining the health grade of each application program to be tested according to the detection result.
The invention also provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the application program health detection method according to any one of the above when executing the program.
The present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements an application health detection method as described in any of the above.
The invention also provides a computer program product comprising a computer program which when executed by a processor implements the method of application health detection as described in any of the above.
According to the method and the device for detecting the health of the application program, provided by the invention, the intelligent detection of the health state of the application program can be realized by constructing the command execution environment and executing the environment monitoring script, and the method is simple and high in monitoring efficiency.
Drawings
In order to more clearly illustrate the invention or the technical solutions of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are some embodiments of the invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart of an application health detection method according to the present invention;
FIG. 2 is a second flowchart of the method for detecting health of an application according to the present invention;
FIG. 3 is a schematic diagram of an application health detection device according to the present invention;
fig. 4 is a schematic structural diagram of an electronic device provided by the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In the description of the present application, it should be understood that the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implying a number of technical features which is being indicated. Thus, a feature defining "a first", "a second", etc. may explicitly or implicitly include one or more such feature. In the description of the present application, unless otherwise indicated, the meaning of "a plurality" is two or more.
The following describes an application health detection method and apparatus provided in an embodiment of the present invention with reference to fig. 1 to 4.
According to the application program health detection method provided by the embodiment of the invention, the execution main body can be the electronic equipment or the software or the functional module or the functional entity capable of realizing the application program health detection method in the electronic equipment, and the electronic equipment in the embodiment of the invention comprises but is not limited to a detection application program on a server. The execution body is not limited to the present invention.
Fig. 1 is a flow chart of an application program health detection method provided by the present invention, as shown in fig. 1, including but not limited to the following steps:
first, in step S1, a timing scheduler is executed based on health detection script information to construct a command script executor.
The health detection script information contains health detection maintenance strategies of all application programs to be detected, and instructs the script executor to build an execution environment for executing the detection programs.
Specifically, the timing scheduler is executed according to the health detection maintenance policy in the health detection script information to construct a command script executor that applies the detection script.
Optionally, before the timing scheduler is executed based on the health detection script information to construct the command script executor, the method further includes:
under the condition that the script configuration of the health detection maintenance strategy in the database is changed, acquiring health detection script information in the database;
and adding the health detection script information into a resource management work group.
Wherein the database may be a relational database management system (Structured Query Language, mySQL) database, the resource management workgroup may be a ShellJob workgroup, and the timing scheduler may be a timing scheduling API.
Specifically, a timing scheduling API of a Schedule module in a spring open source framework is utilized to detect the change condition of a health detection maintenance strategy in a database according to a preset frequency, and when the health detection maintenance strategy is changed, the corresponding script configuration is changed, at the moment, health detection script information in the database can be obtained, and the health detection script information is added into a ShellJob working group; the preset frequency can be flexibly set according to practical situations, for example, once every minute, or once every 30 seconds.
According to the application program health detection method provided by the invention, the health detection maintenance strategy in the work group can be updated in time by adding the new health detection script information into the resource management work group, so that the accuracy and instantaneity of the health state of each application program are ensured, and a foundation is provided for the health state detection of the application program.
Optionally, the executing the timing scheduler to construct the command script executor based on the health detection script information includes:
constructing a script work frame based on the health detection script information, setting the execution time of a command script, and generating a time rule definition tool to construct a timing trigger based on the time rule definition tool;
the timing scheduler is executed based on the scripting work framework and the timing triggers to construct a command script executor.
The script work framework may be JobDetail information; the time rule definition tool may be a cron expression and correspondingly the timing trigger may be a CronTrigger.
Specifically, based on the health detection script information, jobDetail information is constructed, the execution time of a command script is set, and a cron expression is generated, so that a Crontrigger is constructed according to the cron expression; based on JobDetail information and CronTrigger triggers, a timing scheduler is executed to build command script executors.
According to the application program health detection method provided by the invention, the execution environment is built for executing the detection program by building the script work frame and defining the time rule.
Further, in step S2, based on the command script executor, configuration information is acquired to generate a command execution tool.
The command script executor may be a specific task scheduler.
And under the condition that the command script executor builds an execution environment, the configuration information of each application program is called, and a command execution tool for executing the application detection script is generated according to the configuration information.
Optionally, the configuration information includes: the configuration of the connection information of the server or the configuration values of the configuration items of the script replacement field configuration table in the database, the configuration information is acquired based on the command script executor so as to generate a command execution tool, and the method comprises the following steps:
based on the command script executor, acquiring the connection information configuration under the condition that the connection information configuration exists; calling the configuration value in the condition that the connection information configuration does not exist;
and analyzing the connection information configuration or the configuration value to generate the command execution tool.
The script replacement field configuration table may be a shell_config table, the configuration item may be a host_config_json item, and the command execution tool may be a remote connection tool (Secure Shell, ssh) command execution tool sshEXECUtil.
Acquiring connection information configuration of a server under the condition that an execution environment is built by a command script executor; if the connection information configuration does not exist, calling a host_config_json item configuration value of a shell_config table in the database;
and analyzing the connection information configuration or host_config_json item configuration value to generate a ssh command execution tool sshEXECUtil.
According to the application program health detection method provided by the invention, the command execution tool for executing the application detection script is generated by calling the configuration information, so that a foundation is provided for the health state detection of the application program.
Further, in step S3, the command execution tool is called, and an application detection script is executed to detect the state and environment of each application program to be detected, so as to generate a detection result.
And calling sshEXECUtil to execute an application detection script, detecting the state and environment of each application program to be detected, and generating the running state and running environment related parameters of each application program to be detected as a detection result.
Optionally, the calling the command execution tool executes an application detection script to detect the state and the environment of each application program to be detected, and generates a detection result, including:
calling the connection information configuration or the configuration value to replace a placeholder in a command template so as to acquire a script command of the application detection script;
under the condition that the script command is used for indicating a storage path of the application detection script, acquiring the application detection script from the storage path according to the script command;
and calling the command execution tool based on the Jsch framework, and executing the application detection script to generate detection results of all application programs to be detected.
For example, the placeholder may be $ { }.
Acquiring a command template, calling a connection information configuration or replacing a placeholder in the command template by parameters in a configuration item of a shell_config table in a database, and obtaining a script command of an application detection script for detecting an application to be detected at this time; in the case that the script command is used for designating a storage path of the application detection script, acquiring the application detection script in the storage path; and calling sshEXECUtil to execute an application detection script by adopting a Jsch framework, and generating the running states and running environment related parameters of all the application programs to be detected.
According to the application program health detection method provided by the invention, each application program to be detected is detected by executing the application detection script, so that the detection result of each application program to be detected is obtained, and data support is provided for subsequent health grade judgment and operation and maintenance strategies.
Further, in step S4, the health level of each application program to be tested is determined according to the detection result.
The health class includes: health, sub-health, and failure.
According to the running state and running environment related parameters of each application program to be tested in the detection result and the normal running range of each parameter, the health grade of each application program to be tested can be determined to be healthy, sub-healthy or faulty.
Optionally, the determining the health level of each application program under test according to the detection result includes:
invoking health rules in a health check function table in the database, analyzing and diagnosing the detection result, and determining the health state value of each application program to be detected;
and determining the health grade of each application program to be tested according to the health state value, and storing the health state value into a viewing history command table of the database.
The health check function table may be a shell_command table, and the health status value may represent the degree to which the parameter of each application program to be tested deviates from the normal range; the view history command table may be a shell_history table.
And calling a health rule in the shell_command in the database, analyzing and diagnosing the detection result, determining the health state value of each application program to be detected, further determining the health grade of each application program to be detected as healthy, sub-healthy or fault according to the health state value, and storing the health state value into a shell_history table.
The health level can be displayed back to the system user and can also be used to alert the operation and maintenance personnel.
In addition, spring MVC can be utilized to develop various data supply interfaces to provide real-time data of health states of various applications, so that operation and maintenance personnel can know the states of the various applications more accurately and intuitively.
According to the application program health detection method provided by the invention, the parameters of each application program to be detected are calculated and compared according to the health rule to obtain a unified evaluation standard, so that the health grade of each application program to be detected is judged, the health state of each application program to be detected can be more quickly, accurately and intuitively observed by operation and maintenance personnel, and a basis is provided for alarming and maintaining the health state.
Optionally, in the case that the health level of any application program to be tested is a fault, after determining the health level of each application program to be tested, the method further includes:
acquiring maintenance measure information of any application program to be tested in a fault maintenance table in the database;
generating a maintenance command based on the maintenance measure information;
invoking the command execution tool to execute the maintenance command; the maintenance command is further used for updating the state of the health check function table, and storing the updated state of the health check function table to the viewing history command table.
The fault maintenance table may be a shell_main table.
Aiming at the existing application program operation and maintenance method, the application fault is generally waited, and operation and maintenance personnel can not know after the application program operation and maintenance method is used, so that effective prevention can not be realized, and the user experience is seriously influenced. And under the conditions that the manpower is unskilled and the specific reasons are not known, the difficulty in troubleshooting the application program is increased.
Under the condition that the health state of any application program to be tested is determined to be a fault according to the health state value of each application program to be tested, the maintenance measure information of any application program to be tested in the shell_main table in the database is obtained;
generating a maintenance command based on the maintenance measure information;
and calling the command execution tool sshEXECUtil to execute the maintenance command, updating the state of the health check function table by using the maintenance command, and storing the updated state of the health check function table into the view history command table.
According to the application program health detection method provided by the invention, automatic intelligent maintenance of common application problems is realized according to the application health detection result and in combination with a maintenance strategy of system configuration, so that the maintenance time of operation and maintenance personnel is reduced, in addition, key state information such as detection, automatic maintenance and the like is archived, so that later analysis and summary are facilitated, important practice information is provided for later improvement work, the maintained history is subjected to table building and storage by adopting a MySQL database, and later information is convenient to use and analyze.
FIG. 2 is a second flowchart of the method for detecting health of an application program according to the present invention, as shown in FIG. 2, comprising:
firstly, calling a timing scheduler, detecting script configuration change at regular time every minute, and acquiring health detection script information in a database under the condition that the script configuration changes;
secondly, adding health detection script information into a ShellJob working group;
then, in the ShellJob working group, jobDetail information is constructed based on the health detection script information, and the execution time of the command script is set to generate a cron expression;
constructing a CronTrigger trigger based on the cron expression;
then, based on JobDetail information and a CronTrigger trigger, executing a timing scheduler, acquiring a timing period in a database, and generating a timing period algorithm to construct a specific task scheduler;
based on a specific task scheduler, acquiring the connection information configuration of a server under the condition that the connection information configuration exists, and calling a host_config_json item configuration value of a shell_config table in a database under the condition that the connection information configuration does not exist;
analyzing the connection information configuration to generate a ssh command execution tool sshEXECUtil;
calling a configuration item of a shell_config table in a database to replace a placeholder in a command template to obtain a script command of an application detection script;
under the condition that the script command is used for specifying a storage path of the script, acquiring an application detection script from the storage path;
based on a Jsch frame, calling an ssh command execution tool sshEXECUtil, and executing an application detection script to generate detection results of all application programs to be detected;
then, calling a health rule in shell_command in a database, analyzing and diagnosing a detection result, and determining a health state value of each application program to be detected;
furthermore, under the condition that the health grade of any application program to be tested is determined to be a fault according to each health state value, the maintenance measure information of any application program to be tested in a shell_main table in the database is obtained;
generating a maintenance command based on the maintenance measure information;
invoking a command execution tool sshEXECUtil to execute a maintenance command;
and finally, updating the state of the shell_command by using each health state value, and storing the maintenance command and the updated state of the shell_command into a shell_history table.
The application program health detection method provided by the invention is mainly characterized by reducing the cost, reducing the maintenance difficulty, facilitating centralized management and automatically maintaining:
(1) The maintenance cost is reduced, and the personnel cost, the time cost and the like for on-line maintenance of each intelligent operation and maintenance application line are reduced.
(2) Compared with the prior complex maintenance strategies, the maintenance difficulty is reduced, clear interface maintenance management is provided, and most health detection strategies are predefined and scripted.
(3) The intelligent operation and maintenance system is convenient for centralized management, provides clear interface management, and provides centralized and integrated management and monitoring for the health condition of each application of intelligent operation and maintenance.
(4) And the automatic maintenance is performed, and an automatic maintenance strategy can be implemented for some conventional sub-health or fault state applications while the health detection is performed on each intelligent operation and maintenance application.
According to the application program health detection method provided by the invention, a specific timing scheduling program is constructed through a corresponding algorithm according to the configured scheduling time in a mode of inputting the key information such as the script information, maintenance measures or strategies of health detection into a database.
The server provided by the invention is described below, and the server described below and the application program health detection method described above can be referred to correspondingly.
The invention also provides a server, wherein the server is provided with a detection application program; the system also comprises a memory and a program or instructions stored on the memory and capable of running on the detection application program, wherein the program or instructions execute the application program health detection method according to any embodiment when the program or instructions are executed by the detection application program.
The server provided by the invention can realize intelligent detection of the health state of the application program by constructing the command execution environment and executing the environment monitoring script, and has the advantages of simple method and high monitoring efficiency.
The application health detection device provided by the invention is described below, and the application health detection device described below and the application health detection method described above can be referred to correspondingly.
Fig. 3 is a schematic structural diagram of an application health detection device provided by the present invention, as shown in fig. 3, including:
an execution module 301 for executing the timing scheduler based on the health detection script information to construct a command script executor;
an obtaining module 302, configured to obtain configuration information based on the command script executor, so as to generate a command execution tool;
the detection module 303 is configured to invoke the command execution tool and execute an application detection script to detect a state and an environment of each application program to be detected, so as to generate a detection result;
and the determining module 304 is configured to determine the health level of each application program to be tested according to the detection result.
During the device operation, the execution module 301 executes the timing scheduler based on the health detection script information to construct a command script executor; the obtaining module 302 obtains configuration information based on the command script executor to generate a command execution tool; the detection module 303 invokes the command execution tool to execute an application detection script to detect the state and environment of each application program to be detected, and generate a detection result; the determining module 304 determines the health level of each application program to be tested according to the detection result.
According to the application program health detection device, the command execution environment is constructed, the environment monitoring script is executed, intelligent detection of the health state of the application program can be achieved, and the method is simple and high in monitoring efficiency.
The server provided by the invention is described below, and the server described below and the application program health detection method described above can be referred to correspondingly.
The invention also provides an application program detection operation and maintenance system, which comprises a detection application program and at least one application program to be detected, wherein the detection application program is used for executing the application program health detection method according to any one of the above application programs to be detected on the at least one application program to be detected.
When the application program detection operation and maintenance system is started, the system tracks the operation history in real time, and realizes the backtracking, checking and the like of history detection, detection state and automatic maintenance.
Firstly, inquiring shell_history and an association table thereof to acquire information such as history detection, detection state and the like;
second, all queried information is encapsulated in a specific data structure.
According to the application program detection operation and maintenance system, the intelligent detection of the health state of the application program can be realized by constructing the command execution environment and the execution environment monitoring script, so that the method is simple and the monitoring efficiency is high.
Fig. 4 is a schematic structural diagram of an electronic device according to the present invention, as shown in fig. 4, the electronic device may include: processor 410, communication interface (Communications Interface) 420, memory 430 and communication bus 440, wherein processor 410, communication interface 420 and memory 430 communicate with each other via communication bus 440. The processor 410 may invoke logic instructions in the memory 430 to perform an application health detection method comprising: executing a timing scheduler based on the health detection script information to construct a command script executor; acquiring configuration information based on the command script executor to generate a command execution tool; invoking the command execution tool to execute an application detection script so as to detect the state and environment of each application program to be detected and generate a detection result; and determining the health grade of each application program to be tested according to the detection result.
Further, the logic instructions in the memory 430 described above may be implemented in the form of software functional units and may be stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In another aspect, the present invention also provides a computer program product, the computer program product including a computer program, the computer program being storable on a non-transitory computer readable storage medium, the computer program, when executed by a processor, being capable of executing the application health detection method provided by the above methods, the method comprising: executing a timing scheduler based on the health detection script information to construct a command script executor; acquiring configuration information based on the command script executor to generate a command execution tool; invoking the command execution tool to execute an application detection script so as to detect the state and environment of each application program to be detected and generate a detection result; and determining the health grade of each application program to be tested according to the detection result.
In yet another aspect, the present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, is implemented to perform the application health detection method provided by the above methods, the method comprising: executing a timing scheduler based on the health detection script information to construct a command script executor; acquiring configuration information based on the command script executor to generate a command execution tool; invoking the command execution tool to execute an application detection script so as to detect the state and environment of each application program to be detected and generate a detection result; and determining the health grade of each application program to be tested according to the detection result.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (13)

1. An application health detection method, which is applied to detecting an application, is characterized by comprising the following steps:
executing a timing scheduler based on the health detection script information to construct a command script executor;
acquiring configuration information based on the command script executor to generate a command execution tool;
invoking the command execution tool to execute an application detection script so as to detect the state and environment of each application program to be detected and generate a detection result;
and determining the health grade of each application program to be tested according to the detection result.
2. The method of claim 1, wherein the executing the timing scheduler to construct the command script executor based on the health detection script information comprises:
constructing a script work frame based on the health detection script information, setting the execution time of a command script, and generating a time rule definition tool to construct a timing trigger based on the time rule definition tool;
the timing scheduler is executed based on the scripting work framework and the timing triggers to construct a command script executor.
3. The application health detection method according to claim 1 or 2, wherein the configuration information includes: the configuration of the connection information of the server or the configuration values of the configuration items of the script replacement field configuration table in the database, the configuration information is acquired based on the command script executor so as to generate a command execution tool, and the method comprises the following steps:
based on the command script executor, acquiring the connection information configuration under the condition that the connection information configuration exists; calling the configuration value in the condition that the connection information configuration does not exist;
and analyzing the connection information configuration or the configuration value to generate the command execution tool.
4. The application health detection method as set forth in claim 3, wherein the calling the command execution tool to execute an application detection script to detect a state and an environment of each application to be detected to generate a detection result includes:
calling the connection information configuration or the configuration value to replace a placeholder in a command template so as to acquire a script command of the application detection script;
under the condition that the script command is used for indicating a storage path of the application detection script, acquiring the application detection script from the storage path according to the script command;
and calling the command execution tool based on the Jsch framework, and executing the application detection script to generate detection results of all application programs to be detected.
5. The method for detecting health of application programs according to claim 4, wherein determining the health level of each application program under test according to the detection result comprises:
invoking health rules in a health check function table in the database, analyzing and diagnosing the detection result, and determining the health state value of each application program to be detected;
and determining the health grade of each application program to be tested according to the health state value, and storing the health state value into a viewing history command table of the database.
6. The method for detecting the health of an application program according to claim 5, wherein, in the case that the health level of any application program under test is a failure, after said determining the health level of each application program under test, further comprises:
acquiring maintenance measure information of any application program to be tested in a fault maintenance table in the database;
generating a maintenance command based on the maintenance measure information;
invoking the command execution tool to execute the maintenance command; the maintenance command is further used for updating the state of the health check function table, and storing the updated state of the health check function table to the viewing history command table.
7. The application health detection method according to claim 1 or 2, characterized by further comprising, before the execution of the timing scheduler to construct a command script executor based on the health detection script information:
under the condition that the script configuration of the health detection maintenance strategy in the database is changed, acquiring health detection script information in the database;
and adding the health detection script information into a resource management work group.
8. A server, wherein a detection application is provided in the server; further comprising a memory and a program or instruction stored on the memory and executable on the detection application, which program or instruction when executed by the detection application performs the application health detection method according to any one of claims 1 to 7.
9. An application health detection apparatus, comprising:
the execution module is used for executing the timing scheduler based on the health detection script information to construct a command script executor;
the acquisition module is used for acquiring configuration information based on the command script executor so as to generate a command execution tool;
the detection module is used for calling the command execution tool and executing an application detection script so as to detect the state and environment of each application program to be detected and generate a detection result;
and the determining module is used for determining the health grade of each application program to be tested according to the detection result.
10. An application detection operation and maintenance system, comprising a detection application and at least one application to be detected, wherein the detection application is configured to execute the application health detection method according to any one of claims 1-7 on the at least one application to be detected.
11. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the application health detection method of any of claims 1-7 when the program is executed by the processor.
12. A non-transitory computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when executed by a processor, implements the application health detection method according to any one of claims 1-7.
13. A computer program product comprising a computer program which, when executed by a processor, implements the application health detection method according to any one of claims 1-7.
CN202211726636.5A 2022-12-29 2022-12-29 Application program health detection method and device Pending CN116257434A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211726636.5A CN116257434A (en) 2022-12-29 2022-12-29 Application program health detection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211726636.5A CN116257434A (en) 2022-12-29 2022-12-29 Application program health detection method and device

Publications (1)

Publication Number Publication Date
CN116257434A true CN116257434A (en) 2023-06-13

Family

ID=86680160

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211726636.5A Pending CN116257434A (en) 2022-12-29 2022-12-29 Application program health detection method and device

Country Status (1)

Country Link
CN (1) CN116257434A (en)

Similar Documents

Publication Publication Date Title
CN108388489B (en) Server fault diagnosis method, system, equipment and storage medium
CN112015647A (en) Configuration item monitoring method and device, computer equipment and storage medium
CA3127100C (en) Anomaly detection for predictive maintenance and deriving outcomes and workflows based on data quality
CN111563022A (en) Centralized storage monitoring method and device
JPWO2019049523A1 (en) Risk assessment device, risk assessment system, risk assessment method, and risk assessment program
CN116107794B (en) Ship software fault automatic diagnosis method, system and storage medium
JPWO2019049521A1 (en) Risk assessment device, risk assessment system, risk assessment method, and risk assessment program
US20170302506A1 (en) Methods and apparatus for fault detection
CN108052455A (en) A kind of software testing system and its test method
CN116257434A (en) Application program health detection method and device
CA3141565A1 (en) Method and system for automatically monitoring business systems
US9372746B2 (en) Methods for identifying silent failures in an application and devices thereof
CN113626288A (en) Fault processing method, system, device, storage medium and electronic equipment
JP6482742B1 (en) Risk assessment device, risk assessment system, risk assessment method, and risk assessment program
US20230350790A1 (en) System and method for auto-generation of test scripts
CN113037550B (en) Service fault monitoring method, system and computer readable storage medium
KR102458214B1 (en) Pipe damage diagnosing apparatus and method
US9311210B1 (en) Methods and apparatus for fault detection
CN114564369B (en) Application program abnormity monitoring method and device, electronic equipment and storage medium
RU2777950C1 (en) Detection of emergency situations for predictive maintenance and determination of end results and technological processes based on the data quality
JP2020009080A (en) System and method for monitoring device state
Yamany et al. A multi-agent framework for building an automatic operational profile
CN113961389A (en) GPU server maintenance system
CN116702999A (en) Method for carrying out safety early warning on industrial equipment based on Internet of things platform technology
CN117687853A (en) Firmware detection method, device, 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