CN114124665A - Application program exception handling method and device, computer equipment and storage medium - Google Patents

Application program exception handling method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN114124665A
CN114124665A CN202111414439.5A CN202111414439A CN114124665A CN 114124665 A CN114124665 A CN 114124665A CN 202111414439 A CN202111414439 A CN 202111414439A CN 114124665 A CN114124665 A CN 114124665A
Authority
CN
China
Prior art keywords
service
website
application program
command
service application
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111414439.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.)
Qinhuangdao Taihe'an Technology Co ltd
Original Assignee
Qinhuangdao Taihe'an 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 Qinhuangdao Taihe'an Technology Co ltd filed Critical Qinhuangdao Taihe'an Technology Co ltd
Priority to CN202111414439.5A priority Critical patent/CN114124665A/en
Publication of CN114124665A publication Critical patent/CN114124665A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0659Management of faults, events, alarms or notifications using network fault recovery by isolating or reconfiguring faulty entities
    • H04L41/0661Management of faults, events, alarms or notifications using network fault recovery by isolating or reconfiguring faulty entities by reconfiguring faulty entities

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a method and a device for processing application program exception, computer equipment and a storage medium; the method and the device for detecting the website service can obtain the website service detection script, wherein the website service detection script comprises a service restart command, and the service restart command is used for restarting a website service application program in a website server; when the service detection time preset by the website service application program is reached, executing a process service detection command to obtain a target return value of the process service detection command; determining an operating state of the web service application based on the target return value; if the website service application program is in an abnormal working state, restarting the website service application program based on the service restart command so as to process the abnormality of the website service application program and enable the website service application program to be in a normal working state. The scheme can improve the efficiency of processing the application program abnormity.

Description

Application program exception handling method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method and an apparatus for processing an application exception, a computer device, and a storage medium.
Background
With the development of communication technology, more and more kinds of servers emerge, wherein nginx (engine x) is a high-performance HTTP and reverse proxy server.
In the research and practice process of the related technology, the inventor of the application finds that when a nginx service (an application program, namely software for providing a web service in the nginx server) in the nginx server is abnormally crashed, so that a webpage cannot be accessed, an administrator has to log in the nginx server, check each service, locate problems and solve the problems.
Disclosure of Invention
The embodiment of the application program exception handling method and device, computer equipment and storage medium can improve the efficiency of handling application program exceptions.
The embodiment of the application provides a method for processing application program exception, which comprises the following steps:
the method comprises the steps of obtaining a website service detection script, wherein the website service detection script comprises a service restart command, and the service restart command is used for restarting a website service application program in a website server;
when the service detection time preset by the website service application program is reached, executing a process service detection command to obtain a target return value of the process service detection command;
determining an operating state of the web service application based on the target return value;
if the website service application program is in an abnormal working state, restarting the website service application program based on the service restart command so as to process the abnormality of the website service application program and enable the website service application program to be in a normal working state.
Correspondingly, an embodiment of the present application provides an apparatus for processing an application exception, including:
the system comprises a first acquisition unit, a second acquisition unit and a control unit, wherein the first acquisition unit is used for acquiring a website service detection script, and the website service detection script comprises a service restart command which is used for restarting a website service application program in a website server;
the execution unit is used for executing a process service detection command when service detection time preset by the website service application program is reached, and obtaining a target return value of the process service detection command;
the determining unit is used for determining the working state of the website service application program based on the target return value;
and the restarting unit is used for restarting the website service application program based on the service restarting command if the website service application program is in an abnormal working state so as to process the abnormality of the website service application program and enable the website service application program to be in a normal working state.
In an embodiment, the first obtaining unit includes:
a first acquisition subunit configured to acquire, when input of a service detection code for a web service application in a web server is detected, input code content information;
and the storage subunit is used for storing the code content information to the website server to obtain the website service detection script.
In one embodiment, the execution unit includes:
the first execution subunit is configured to execute a process detection command when service detection time preset by the website service application program arrives, to obtain an execution result of the process detection command, where the process detection command is used to determine whether a service process of the website service application program exists;
and the second execution subunit is used for executing the operation execution result command to obtain a target return value if the service process of the website service application program exists based on the execution result.
In one embodiment, the determining unit includes:
the second obtaining subunit is configured to obtain a preset return value, and compare the target return value with the preset return value to obtain a comparison result;
a first determining subunit, configured to determine, based on the comparison result, that the website service application program is in a normal working state if the target return value is the same as the preset return value;
and the second determining subunit is configured to determine that the website service application program is in an abnormal working state if the target return value is different from the preset return value.
In one embodiment, the reboot unit includes:
the configuration subunit is used for configuring an execution environment of the service restart command;
and the third execution subunit is used for executing the service restart command based on the execution environment to restart the website service application program when the website service application program is in an abnormal working state.
Accordingly, embodiments of the present application further provide a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor executes steps in the method for processing an application exception provided in any of the embodiments of the present application.
Correspondingly, an embodiment of the present application further provides a storage medium, where the storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute steps in the method for processing an application exception provided in any embodiment of the present application.
The method and the device for detecting the website service can obtain the website service detection script, wherein the website service detection script comprises a service restart command, and the service restart command is used for restarting a website service application program in a website server; when the service detection time preset by the website service application program is reached, executing a process service detection command to obtain a target return value of the process service detection command; determining an operating state of the web service application based on the target return value; if the website service application program is in an abnormal working state, restarting the website service application program based on the service restart command so as to process the abnormality of the website service application program and enable the website service application program to be in a normal working state. According to the embodiment of the application, when the website service application program, such as nginx service, is abnormally crashed, the website service application program (such as nginx service) can be automatically restarted, so that the website can continuously provide services, and the efficiency of processing the abnormality of the website service application program can be improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a flowchart of a method for processing application exceptions according to an embodiment of the present disclosure;
FIG. 2 is a block diagram of a method for handling application exceptions according to an embodiment of the present disclosure;
FIG. 3 is another apparatus diagram of a method for handling application exceptions according to an embodiment of the present application;
FIG. 4 is another apparatus diagram of a method for handling application exceptions according to an embodiment of the present application;
FIG. 5 is another apparatus diagram of a method for handling application exceptions according to an embodiment of the present application;
FIG. 6 is a diagram of another apparatus for handling application exceptions according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of a computer device provided in an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The embodiment of the application provides a method and a device for processing application program exception, computer equipment and a storage medium. Specifically, the embodiment of the application provides a processing device for application program exception of a computer device. The computer device may be a terminal or a server, the server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a network service, cloud communication, middleware service, a domain name service, a security service, a CDN, a big data and artificial intelligence platform, and the like. The terminal may be, but is not limited to, a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, and the like. The terminal and the server may be directly or indirectly connected through wired or wireless communication, and the application is not limited herein.
Taking a computer device as a website server as an example, the website server may obtain a website service detection script, where the website service detection script includes a service restart command, where the service restart command is used to restart a website service application program in the website server; when the service detection time preset by the website service application program is reached, executing a process service detection command to obtain a target return value of the process service detection command; determining an operating state of the web service application based on the target return value; if the website service application program is in an abnormal working state, restarting the website service application program based on the service restart command so as to process the abnormality of the website service application program and enable the website service application program to be in a normal working state.
As can be seen from the above, according to the embodiment of the present application, when the web service application, for example, the nginx service, is abnormally crashed, the web service application (for example, the nginx service) is automatically restarted, so that the website continuously provides the service, and the efficiency of processing the abnormality of the web service application can be improved.
The present embodiment can be described in detail below, and it should be noted that the following description of the embodiment is not intended to limit the preferred order of the embodiment.
The embodiment of the application provides a processing method for application program exception, which can be executed by a terminal or a server, or can be executed by the terminal and the server together; in the embodiments of the present application, a method for processing an application exception is described as an example in which the application exception is executed by a web server, and specifically, is executed by an application exception processing apparatus integrated in the web server. As shown in fig. 1, a specific flow of the processing method for the application exception may be as follows:
101. and acquiring a website service detection script, wherein the website service detection script comprises a service restart command, and the service restart command is used for restarting a website service application program in a website server.
The web service detection script refers to a script (an executable file written according to a certain format using a specific descriptive language) for detecting whether a web service application is in a normal working state, and the web service detection script may include a service restart command, a process service detection command, and the like.
In one embodiment, the step of "obtaining a website service detection script" may include:
when detecting that a service detection code for a website service application program in a website server is input, acquiring input code content information;
and storing the code content information to the website server to obtain a website service detection script.
In an embodiment, the code content information may be a script written by an administrator for performing abnormal crash detection on a web service application program in the web server, and the script may be stored in the web server after writing.
In an embodiment, taking the example that the website service detection Script is a Shell Script (Shell Script) and the service restart command is a systemctl restart nginx command as an example, the Shell Script can be written, and a function func1 is defined in the first step, and the function content is that the nginx service is restarted by executing the systemctl restart nginx command.
The systemctl restart nginx command is used for restarting the nginx service, namely, the operation of a website service application program in a website server is restarted, and the progress of the nginx service can be automatically restarted after the systemctl restart nginx command is executed.
The shell script is similar to batch processing under Windows/Dos, namely various commands are put into a file in advance, a program file which is convenient to execute at one time is convenient, and the program file is mainly convenient for an administrator to set or manage. But it is more powerful than batch processing under Windows and more efficient than programs compiled with other programming programs, using commands under Linux/Unix.
102. And when the service detection time preset by the website service application program is reached, executing the process service detection command to obtain a target return value of the process service detection command.
In an example, a website service detection script (such as a shell script) is stored in a server where a website service application program (such as a nginx service) is located, namely in the website server, a crontab task planning command can be used, for example, the execution of the command can be set once per second, the state of the nginx service is monitored, and when the nginx service is abnormally crashed, the nginx service can be automatically restarted.
Wherein, crontab is a command for periodically executing some operations, and writes the required operations to/etc/crontab.
In an embodiment, the step of executing the process service detection command to obtain the target return value of the process service detection command when the service detection time preset by the web service application program reaches includes:
when the service detection time preset by the website service application program is reached, executing a process detection command to obtain an execution result of the process detection command, wherein the process detection command is used for determining whether a service process of the website service application program exists or not;
and based on the execution result, if the service process of the website service application program exists, executing the operation execution result command to obtain a target return value.
In one example, the process detect command may be a ps-C nginx-no-header command, and the operation execution result command may be echo $? And (4) commanding. The ps-C nginx-no-header command is to check the health status of the nginx service to see if the ngin service process exists. After the ps-C nginx-no-header command is executed, then the echo $? And commanding to obtain a target return value.
The ps-C nginx-no-header command is used for checking the health state of the nginx service, the ps-C nginx-no-header command operation can check whether the process of the nginx exists, if the process of the nginx exists, the command is successfully executed, and if the process of the nginx does not exist, the command is failed to be executed. echo $? Is a command used to determine the exit status of the last executed command, and can be understood as first executing an arbitrary operation command and then executing echo? And operating the command.
103. An operating state of the web service application is determined based on the target return value.
The working state of the web service application program may include a normal working state and an abnormal working state, where the abnormal working state is a working state in which the web service application program is abnormally crashed.
In one embodiment, the step of "determining the operating state of the web service application based on the target return value" may comprise:
acquiring a preset return value, and comparing the target return value with the preset return value to obtain a comparison result;
based on the comparison result, if the target return value is the same as the preset return value, determining that the website service application program is in a normal working state;
and if the target return value is different from the preset return value, determining that the website service application program is in an abnormal working state.
In one example, with the process detection command as ps-C nginx-no-header command, the operation execution result command is echo $? For illustration, a command ps-C nginx-no-header can be executed to check the health status of the nginx service, check whether the ngin service process exists, and if yes, execute the command ps-C nginx-no-header, and then execute echo $? And commanding to obtain a target return value, if the target return value is the same as the preset return value, determining that the nginx service is normal, namely the website service application program is in a normal working state, and if the target return value is different from the preset return value, determining that the nginx service is abnormal, namely the website service application program is in an abnormal working state. That is, assuming that the preset return value is 0, if the obtained target return value is 0, it represents that the nginx service is normal, and if the obtained target return value is not 0, it represents that the nginx service is abnormal.
Wherein, echo $? Command operations need to be used in conjunction with ps-C nginx-no-header commands. Carry out echo $? Then, a number, i.e. a target return value, is returned, where the value represents the exit status value of the previous command, for example, when the value is 0, the previous command is successfully executed, and when the value is not 0, the previous command fails to be executed.
104. And if the website service application program is in the abnormal working state, restarting the website service application program based on the service restart command.
The website service application program is restarted based on the service restart command so as to process the abnormity of the website service application program, and the website service application program is in a normal working state.
In an embodiment, the step of restarting the web service application based on the service restart command if the web service application is in an abnormal operating state may include:
configuring an execution environment of the service restart command;
and when the website service application program is in an abnormal working state, executing the service restart command based on the execution environment so as to restart the website service application program.
In one example, the service restart command, the process detection command, and the operation execution result command may be commands on a centros 7 System (Community Enterprise Operating System), namely, a systemctl restart command, a ps-C nginx-no-header command, and an echo $? Commands may be commands on the centros 7 system, with nginx service installed, and system restart command, ps-C nginx-no-header command, and echo $? And (5) commanding operation.
In an example, when the web service application is in an abnormal working state, the web service application can be restarted according to the service restart command, and the problem that the web service application is abnormal, such as sudden crash, can be solved by automatically restarting the web service application. Because sometimes the website service application program can cause the process to crash when a large number of requests exist and cannot provide the service, the process of the website service for the program can be reloaded only by restarting, and the process can be restarted to work again.
As can be seen from the above, according to the embodiment of the present application, when the web service application, for example, the nginx service, is abnormally crashed, the web service application (for example, the nginx service) is automatically restarted, so that the website continuously provides the service, and the efficiency of processing the abnormality of the web service application can be improved.
In order to better implement the above method, correspondingly, an embodiment of the present application further provides an application exception handling device, where the application exception handling device may be specifically integrated in a server configured on a cloud platform, and referring to fig. 2, the application exception handling device may include a first obtaining unit 201, an executing unit 202, a determining unit 203, and a restarting unit 204, as follows:
(1) a first acquisition unit 201;
the first obtaining unit 201 is configured to obtain a website service detection script, where the website service detection script includes a service restart command, where the service restart command is used to restart a website service application in a website server.
In an embodiment, as shown in fig. 3, the first obtaining unit 201 includes:
a first acquiring subunit 2011, configured to, when detecting that a service detection code for a web service application in a web server is input, acquire input code content information;
a storage subunit 2012, configured to store the code content information in the website server, so as to obtain a website service detection script.
(2) An execution unit 202;
and the execution unit 202 is configured to execute the process service detection command when the service detection time preset by the website service application reaches, so as to obtain a target return value of the process service detection command.
In one embodiment, as shown in fig. 4, the execution unit 202 includes:
the first execution subunit 2021, configured to execute a process detection command when service detection time preset by the web service application reaches, to obtain an execution result of the process detection command, where the process detection command is used to determine whether a service process of the web service application exists;
a second execution subunit 2022, configured to execute the operation execution result command to obtain a target return value if a service process of the web service application exists based on the execution result.
(3) A determination unit 203;
a determining unit 203, configured to determine an operating state of the web service application based on the target return value.
In an embodiment, as shown in fig. 5, the determining unit 203 includes:
a second obtaining subunit 2031, configured to obtain a preset return value, and compare the target return value with the preset return value to obtain a comparison result;
a first determining subunit 2032, configured to determine, based on the comparison result, that the website service application is in a normal working state if the target return value is the same as the preset return value;
a second determining subunit 2033, configured to determine that the web service application is in an abnormal operating state if the target return value is different from the preset return value.
(4) A restart unit 204;
a restarting unit 204, configured to restart the website service application based on the service restart command if the website service application is in an abnormal operating state, so as to handle an abnormality occurring in the website service application, so that the website service application is in a normal operating state.
In one embodiment, as shown in fig. 6, the restart unit includes:
a configuration subunit 2041, configured to configure an execution environment of the service restart command;
a third executing subunit 2042, configured to execute the service restart command based on the execution environment when the web service application is in an abnormal operating state, so as to restart the web service application.
As can be seen from the above, the first obtaining unit 201 of the device for processing an application program exception according to the embodiment of the present application obtains a website service detection script, where the website service detection script includes a service restart command, where the service restart command is used to restart a website service application program in a website server; then, when the service detection time preset by the website service application program reaches, the execution unit 202 executes a process service detection command to obtain a target return value of the process service detection command; determining, by the determining unit 203, an operating state of the web service application based on the target return value; if the web service application is in an abnormal operating state, the restart unit 204 restarts the web service application based on the service restart command to process the abnormality of the web service application, so that the web service application is in a normal operating state. According to the scheme, when the website service application program, such as nginx service, is abnormally crashed, the website service application program (such as nginx service) can be automatically restarted, so that a website can continuously provide services, and the efficiency of processing the abnormality of the website service application program can be improved.
In addition, an embodiment of the present application further provides a computer device, where the computer device may be a device such as a terminal or a server, and as shown in fig. 7, a schematic structural diagram of the computer device according to the embodiment of the present application is shown, specifically:
the computer device may include components such as a processor 301 of one or more processing cores, memory 302 of one or more storage media, a power supply 303, and an input unit 304. Those skilled in the art will appreciate that the computer device configuration illustrated in FIG. 7 does not constitute a limitation of computer devices, and may include more or fewer components than those illustrated, or some components may be combined, or a different arrangement of components. Wherein:
the processor 301 is a control center of the computer device, connects various parts of the entire computer device by various interfaces and lines, and performs various functions of the computer device and processes data by running or executing software programs and/or modules stored in the memory 302 and calling data stored in the memory 302, thereby monitoring the computer device as a whole. Optionally, processor 301 may include one or more processing cores; preferably, the processor 301 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 301.
The memory 302 may be used to store software programs and modules, and the processor 301 executes various functional applications and data processing by operating the software programs and modules stored in the memory 302. The memory 302 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data created according to use of the computer device, and the like. Further, the memory 302 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 302 may also include a memory controller to provide the processor 301 with access to the memory 302.
The computer device further includes a power supply 303 for supplying power to the various components, and preferably, the power supply 303 may be logically connected to the processor 301 through a power management system, so as to manage charging, discharging, and power consumption management functions through the power management system. The power supply 303 may also include any component of one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
The computer device may also include an input unit 304, the input unit 304 being operable to receive input numeric or character information and to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
Although not shown, the computer device may further include a display unit and the like, which are not described in detail herein. Specifically, in this embodiment, the processor 301 in the computer device loads the executable file corresponding to the process of one or more application programs into the memory 302 according to the following instructions, and the processor 301 runs the application programs stored in the memory 302, thereby implementing various functions as follows:
the method comprises the steps of obtaining a website service detection script, wherein the website service detection script comprises a service restart command, and the service restart command is used for restarting a website service application program in a website server; when the service detection time preset by the website service application program is reached, executing a process service detection command to obtain a target return value of the process service detection command; determining an operating state of the web service application based on the target return value; if the website service application program is in an abnormal working state, restarting the website service application program based on the service restart command so as to process the abnormality of the website service application program and enable the website service application program to be in a normal working state.
As can be seen from the above, according to the embodiment of the present application, when the web service application, for example, the nginx service, is abnormally crashed, the web service application (for example, the nginx service) is automatically restarted, so that the website continuously provides the service, and the efficiency of processing the abnormality of the web service application can be improved.
It will be understood by those skilled in the art that all or part of the steps in the methods of the above embodiments may be performed by instructions or by instructions controlling associated hardware, and the instructions may be stored in a storage medium and loaded and executed by a processor.
To this end, the present application provides a storage medium, in which a plurality of instructions are stored, where the instructions can be loaded by a processor to execute the steps in any one of the methods for processing an application exception provided in the present application. For example, the instructions may perform the steps of:
the method comprises the steps of obtaining a website service detection script, wherein the website service detection script comprises a service restart command, and the service restart command is used for restarting a website service application program in a website server; when the service detection time preset by the website service application program is reached, executing a process service detection command to obtain a target return value of the process service detection command; determining an operating state of the web service application based on the target return value; if the website service application program is in an abnormal working state, restarting the website service application program based on the service restart command so as to process the abnormality of the website service application program and enable the website service application program to be in a normal working state.
Wherein the storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
Since the instructions stored in the storage medium can execute the steps in any method for processing an application program exception provided in the embodiment of the present application, the beneficial effects that can be achieved by any method for processing an application program exception provided in the embodiment of the present application can be achieved, which are detailed in the foregoing embodiments and will not be described again here.
According to an aspect of the application, there is provided, among other things, a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and executes the computer instructions, so that the computer device executes the processing method of the application program exception provided in the summary and the embodiment of the invention.
The foregoing detailed description is directed to a method, an apparatus, a computer device, and a storage medium for processing application program exceptions provided in the embodiments of the present application, and a specific example is applied in the present application to explain the principles and embodiments of the present application, and the description of the foregoing embodiments is only used to help understand the method and the core idea of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (10)

1. A method for processing application program exception is characterized by comprising the following steps:
the method comprises the steps of obtaining a website service detection script, wherein the website service detection script comprises a service restart command, and the service restart command is used for restarting a website service application program in a website server;
when the service detection time preset by the website service application program is reached, executing a process service detection command to obtain a target return value of the process service detection command;
determining an operating state of the web service application based on the target return value;
if the website service application program is in an abnormal working state, restarting the website service application program based on the service restart command so as to process the abnormality of the website service application program and enable the website service application program to be in a normal working state.
2. The method of claim 1, wherein the process service detection command comprises a process detection command and an operation execution result command;
when the service detection time preset by the website service application program is reached, executing a process service detection command to obtain a target return value of the process service detection command, wherein the method comprises the following steps:
when the service detection time preset by the website service application program is reached, executing a process detection command to obtain an execution result of the process detection command, wherein the process detection command is used for determining whether a service process of the website service application program exists or not;
and based on the execution result, if the service process of the website service application program exists, executing the operation execution result command to obtain a target return value.
3. The method of claim 1, wherein determining the operational status of the web service application based on the target return value comprises:
acquiring a preset return value, and comparing the target return value with the preset return value to obtain a comparison result;
based on the comparison result, if the target return value is the same as the preset return value, determining that the website service application program is in a normal working state;
and if the target return value is different from the preset return value, determining that the website service application program is in an abnormal working state.
4. The method of claim 1, wherein obtaining the web service detection script comprises:
when detecting that a service detection code for a website service application program in a website server is input, acquiring input code content information;
and storing the code content information to the website server to obtain a website service detection script.
5. The method of claim 1, wherein restarting the web service application based on the service restart command if the web service application is in an abnormal operating state comprises:
configuring an execution environment of the service restart command;
and when the website service application program is in an abnormal working state, executing the service restart command based on the execution environment so as to restart the website service application program.
6. An apparatus for processing application exceptions, comprising:
the website service detection script comprises a service restart command, wherein the service restart command is used for restarting a website service application program in a website server;
the execution unit is used for executing a process service detection command when service detection time preset by the website service application program is reached, and obtaining a target return value of the process service detection command;
the determining unit is used for determining the working state of the website service application program based on the target return value;
and the restarting unit is used for restarting the website service application program based on the service restarting command if the website service application program is in an abnormal working state so as to process the abnormality of the website service application program and enable the website service application program to be in a normal working state.
7. The apparatus of claim 6, wherein the obtaining unit comprises:
a first acquisition subunit configured to acquire, when input of a service detection code for a web service application in a web server is detected, input code content information;
and the storage subunit is used for storing the code content information to the website server to obtain the website service detection script.
8. The apparatus of claim 6, wherein the execution unit comprises:
the first execution subunit is configured to execute a process detection command when service detection time preset by the website service application program arrives, to obtain an execution result of the process detection command, where the process detection command is used to determine whether a service process of the website service application program exists;
and the second execution subunit is used for executing the operation execution result command to obtain a target return value if the service process of the website service application program exists based on the execution result.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps in the method of handling application exceptions of any one of claims 1 to 5 when executing the program.
10. A storage medium storing a plurality of instructions adapted to be loaded by a processor to perform the steps of the method for handling application exceptions of any one of claims 1 to 5.
CN202111414439.5A 2021-11-25 2021-11-25 Application program exception handling method and device, computer equipment and storage medium Pending CN114124665A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111414439.5A CN114124665A (en) 2021-11-25 2021-11-25 Application program exception handling method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111414439.5A CN114124665A (en) 2021-11-25 2021-11-25 Application program exception handling method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114124665A true CN114124665A (en) 2022-03-01

Family

ID=80373369

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111414439.5A Pending CN114124665A (en) 2021-11-25 2021-11-25 Application program exception handling method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114124665A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170083399A1 (en) * 2013-12-30 2017-03-23 Limited Liability Company Mail.Ru Systems and methods for assisting user in software application crashes
CN106844137A (en) * 2016-12-08 2017-06-13 腾讯科技(深圳)有限公司 The monitoring method and device of server
WO2018019242A1 (en) * 2016-07-29 2018-02-01 深圳创维数字技术有限公司 Self-recovery method and self-recovery system for web server
CN112148477A (en) * 2020-08-28 2020-12-29 杭州安恒信息技术股份有限公司 Service process processing method, electronic device and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170083399A1 (en) * 2013-12-30 2017-03-23 Limited Liability Company Mail.Ru Systems and methods for assisting user in software application crashes
WO2018019242A1 (en) * 2016-07-29 2018-02-01 深圳创维数字技术有限公司 Self-recovery method and self-recovery system for web server
CN106844137A (en) * 2016-12-08 2017-06-13 腾讯科技(深圳)有限公司 The monitoring method and device of server
CN112148477A (en) * 2020-08-28 2020-12-29 杭州安恒信息技术股份有限公司 Service process processing method, electronic device and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
小刚刚技术博客: "Nginx服务崩溃自动重启脚本(监控进程服务并自动重启进程服务)脚本", pages 1 - 3, Retrieved from the Internet <URL:http://blog.biteuf.net/post/154.html> *

Similar Documents

Publication Publication Date Title
US10152382B2 (en) Method and system for monitoring virtual machine cluster
CN107016480B (en) Task scheduling method, device and system
US9003239B2 (en) Monitoring and resolving deadlocks, contention, runaway CPU and other virtual machine production issues
US9912535B2 (en) System and method of performing high availability configuration and validation of virtual desktop infrastructure (VDI)
WO2023115999A1 (en) Device state monitoring method, apparatus, and device, and computer-readable storage medium
CN111352779A (en) On-off test method of AC power supply of MOC card and related assembly
CN113672340A (en) Incremental backup method, system and device of virtual machine and readable storage medium
CN110673936A (en) Breakpoint continuous operation method and device for arranging service, storage medium and electronic equipment
CN110908837A (en) Application program exception handling method and device, electronic equipment and storage medium
US7546604B2 (en) Program reactivation using triggering
CN110502399B (en) Fault detection method and device
CN111522744A (en) Service testing method, device and computer readable storage medium
KR20210054480A (en) Backup recovery method for large scale cloud data center autonomous operation
US9846476B1 (en) System and method of identifying the idle time for lab hardware thru automated system
CN114124665A (en) Application program exception handling method and device, computer equipment and storage medium
CN112241141B (en) Hardware configuration method, system, device and medium of PLC control system
CN113656378A (en) Server management method, device and medium
CN115840691A (en) Remote repair of crash processes
CN114706622A (en) Method, apparatus, device, medium and product for starting model service
CN114153503A (en) BIOS control method, device and medium
CN114968505A (en) Task processing system, method, device, apparatus, storage medium, and program product
CN113448758A (en) Task processing method and device and terminal equipment
CN110289977B (en) Fault detection method, system, equipment and storage medium for logistics warehouse system
CN112328423A (en) Processing method, device and storage medium for search service loophole
CN115993929B (en) Storage device management method, storage device management device, electronic device and storage 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