CN111796954A - Watchdog control method, device, equipment and storage medium based on JVM - Google Patents

Watchdog control method, device, equipment and storage medium based on JVM Download PDF

Info

Publication number
CN111796954A
CN111796954A CN202010463550.2A CN202010463550A CN111796954A CN 111796954 A CN111796954 A CN 111796954A CN 202010463550 A CN202010463550 A CN 202010463550A CN 111796954 A CN111796954 A CN 111796954A
Authority
CN
China
Prior art keywords
target
watchdog
determining
abnormal
data information
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
CN202010463550.2A
Other languages
Chinese (zh)
Inventor
杨越
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
OneConnect Smart Technology Co Ltd
OneConnect Financial Technology Co Ltd Shanghai
Original Assignee
OneConnect Financial Technology Co Ltd Shanghai
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 OneConnect Financial Technology Co Ltd Shanghai filed Critical OneConnect Financial Technology Co Ltd Shanghai
Priority to CN202010463550.2A priority Critical patent/CN111796954A/en
Publication of CN111796954A publication Critical patent/CN111796954A/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/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0751Error or fault detection not based on redundancy
    • G06F11/0754Error or fault detection not based on redundancy by exceeding limits
    • G06F11/0757Error or fault detection not based on redundancy by exceeding limits by exceeding a time limit, i.e. time-out, e.g. watchdogs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3089Monitoring arrangements determined by the means or processing involved in sensing the monitored data, e.g. interfaces, connectors, sensors, probes, agents
    • G06F11/3093Configuration details thereof, e.g. installation, enabling, spatial arrangement of the probes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Abstract

The application relates to the technical field of cloud monitoring of cloud technology, and provides a watchdog control method based on JVM, which comprises the following steps: waking up a target watchdog associated with a target process; determining a wake-up condition corresponding to waking up the target watchdog; when the awakening condition is determined to be abnormal process, acquiring data information currently recorded by the target watchdog, wherein the data information is stored in a block chain; determining the current corresponding service configuration of the target watchdog according to the data information; and controlling the target watchdog to respond to the service configuration. The application also provides a control device of the watchdog based on the JVM, computer equipment and a storage medium. The method and the device realize real-time monitoring in the service process operation process, timely and accurately determine process abnormity and process abnormal conditions, and ensure the safety of data in the service process.

Description

Watchdog control method, device, equipment and storage medium based on JVM
Technical Field
The application relates to the technical field of cloud monitoring of cloud technology, in particular to a watchdog control method and device based on JVM, computer equipment and a storage medium.
Background
JVM is an abbreviation of Java Virtual Machine (Java Virtual Machine), a specification for computing devices, which is an imaginary computer implemented by emulating and simulating various computer functions on a real computer. The watchdog is designed to monitor the state of a service process of the system, and when a problem occurs in the service process, corresponding processing is performed, such as restarting the service.
The existing design scheme of the watchdog generally utilizes an external monitoring system to perform corresponding detection by setting a corresponding interface, and at the moment, only the service abnormality can be determined, but the specific abnormality cannot be determined. In particular, the gateway will typically determine through heartbeat detection that a new request will not be forwarded to the exception service. Since the reason why the service does not respond cannot be determined, it is highly likely that data errors will be caused if a service restart is performed on data existing in operation. And the specific exception location can be determined after manual log inspection is required.
Disclosure of Invention
The application provides a watchdog control method and device based on JVM, computer equipment and a storage medium, so as to reasonably control the watchdog to perform heartbeat response and ensure the stability of system operation and the safety of system data.
In a first aspect, the present application provides a watchdog control method based on a JVM, where the method includes:
waking up a target watchdog associated with a target process;
determining a wake-up condition corresponding to waking up the target watchdog;
when the awakening condition is determined to be abnormal process, acquiring data information currently recorded by the target watchdog;
determining the current corresponding service configuration of the target watchdog according to the data information;
and controlling the target watchdog to respond to the service configuration.
In a second aspect, the present application further provides a control apparatus for a watchdog based on a JVM, where the apparatus includes:
a wake-up module for waking up a target watchdog associated with a target process;
the condition determining module is used for determining a wake-up condition corresponding to waking up the target watchdog;
the information acquisition module is used for acquiring the data information currently recorded by the target watchdog when the awakening condition is determined to be abnormal in process;
the configuration determining module is used for determining the service configuration currently corresponding to the target watchdog according to the data information;
and the configuration response module is used for controlling the target watchdog to respond to the service configuration.
In a third aspect, the present application further provides a computer device comprising a memory and a processor; the memory is used for storing a computer program; the processor is configured to execute the computer program and implement the above-mentioned control method of the watchdog based on the JVM when executing the computer program.
In a fourth aspect, the present application further provides a computer-readable storage medium storing a computer program, which when executed by a processor causes the processor to implement the method for controlling a JVM-based watchdog as described above.
The application discloses a control method, a device, computer equipment and a storage medium of watchdog based on JVM, when the watchdog is confirmed to be required to be awakened, the corresponding target watchdog is awakened so as to obtain data information currently recorded by the target watchdog, then specific abnormal points of a process corresponding to the target watchdog are accurately confirmed according to the obtained data information, then service configuration corresponding to the target watchdog at the moment is obtained according to the abnormal points, specifically control information corresponding to the target watchdog is obtained, and finally the target watchdog is controlled to perform corresponding operation so as to complete control over the state of the process. The monitoring is carried out in real time in the running process of the service process, the abnormal position can be accurately known when abnormal conditions occur, more accurate judgment and timely processing are carried out, and the safety of data in the service process is guaranteed.
Drawings
In order to more clearly illustrate the technical solutions of 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 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 illustrating a watchdog control method based on a JVM according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating the steps of determining a wake-up condition according to an embodiment of the present application;
FIG. 3 is a flowchart illustrating steps for obtaining a service configuration for a target gatekeeper in an embodiment of the present application;
FIG. 4 is a schematic block diagram of a control apparatus for a watchdog based on a JVM in an embodiment of the present application;
FIG. 5 is a block diagram schematically illustrating a computer device according to 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 some, but not all, embodiments of the present application. 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 flow diagrams depicted in the figures are merely illustrative and do not necessarily include all of the elements and operations/steps, nor do they necessarily have to be performed in the order depicted. For example, some operations/steps may be decomposed, combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
It is to be understood that the terminology used in the description of the present application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the specification of the present application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
Some embodiments of the present application will be described in detail below with reference to the accompanying drawings. The embodiments described below and the features of the embodiments can be combined with each other without conflict.
Referring to fig. 1, fig. 1 is a schematic flowchart illustrating a watchdog control method based on a JVM according to an embodiment of the present application.
Specifically, the method comprises the following steps:
and step S101, waking up a target watchdog associated with the target process.
The watchdog is used for monitoring the program or process currently operated by the system, so as to prevent the program or process from running away and prevent the program or process from endless loop when running online.
In the running process of the program or the process, the watchdog runs constantly to monitor the running of the program in real time, but under the condition that the program runs normally, the watchdog is in a dormant state, namely, the running of the program is only timed, and only when the running of the program or the process is abnormal or a feed dog fed back by a corresponding target process is received, the target watchdog is awakened to perform corresponding operation. When the target process runs normally or abnormally, the operation performed by the target watchdog after being awakened is different, specifically, the operation is different according to different actual situations.
Specifically, when it is determined that the target watchdog associated with the target process needs to be woken up, the target watchdog is woken up to perform subsequent related processing.
Further, before the watchdog is executed, the watchdog needs to be started to monitor the execution of the program, and specifically, before the target watchdog associated with the target process is woken up, the method further includes: when the target process is detected to be started, a thread is called to run a target watchdog related to the second process, and the life cycle of the thread is set to be equal to that of the process.
When a process is run in a JVM (java virtual machine), a corresponding watchdog needs to be started, and in order to implement the running of the watchdog, a thread needs to be created in the process to run the watchdog for monitoring the process. Specifically, when it is detected that a new process is created in the system, an idle thread is called to run a watchdog for monitoring the new process, so that when the new process is abnormal, the abnormal problem of the process can be timely and accurately determined and corresponding feedback can be performed on the process.
And for the created thread, the created thread is used for running the target watchdog to monitor the actual running state of the target process, and the thread running the target process is released when the end of the target process is detected because the life cycle of the thread running the target watchdog is the same as that of the target process.
And S102, determining a wake-up condition corresponding to the wake-up of the target watchdog.
When the watchdog is awakened, the watchdog performs a corresponding operation, which is specifically determined according to an actual running state of a process associated with the watchdog. In the actual running process of the target process, no matter whether the target process runs abnormally or not, the target watchdog can be awakened to carry out corresponding operation. Specifically, when the watchdog is awakened, whether the target process associated with the target watchdog is in a normal operation state or an abnormal operation state is determined. The service configurations corresponding to different wake-up conditions of the target watchdog are different, specifically, the processing modes of the target process in normal operation and abnormal operation are different.
When the target watchdog is awakened due to normal operation of the target process, the currently acquired relevant data needs to be stored after being awakened. When the target watchdog is awakened due to the abnormal operation of the target process, the target watchdog needs to perform corresponding processing on the abnormality of the target process so as to ensure the normal operation of the target process or the system.
When the awakening condition corresponding to the target watchdog is determined, the awakening condition is determined according to the response state of the target watchdog, and specifically, whether the target watchdog receives the feed fed back by the target process within a specified time is detected. When the target watchdog receives the feed dog of the target process within the specified time, determining that the target watchdog is awakened due to the normal operation of the target process; and when the target watchdog does not receive the feed dog of the target process within the specified time, determining that the target watchdog is awakened due to the abnormal operation of the target process.
In practical application, the number of the watchdog in the running state in the system is the same as the number of the currently running processes, and the normal running of the system is ensured by monitoring the processes in real time. When the watchdog is awakened, the condition that the watchdog is awakened is determined, and the watchdog associated with the process is awakened, so that the corresponding watchdog responds to the service configuration according to the generated service configuration.
Step S103, when the awakening condition is determined to be abnormal process, acquiring the data information currently recorded by the target watchdog.
When the fact that the awakening condition for awakening the target watchdog is determined to be abnormal in process is determined, the data information currently recorded by the target watchdog is obtained, so that the data information is analyzed after the corresponding data information is obtained, and the control information corresponding to the target watchdog is obtained.
In the actual application process, when the target watchdog is awakened due to abnormal operation of the process, the target watchdog is required to perform certain processing on the process associated with the target watchdog so as to ensure that the process can normally operate. Specifically, when the target watchdog is awakened due to a process exception, the relevant data information recorded by the process in one monitoring period of the target watchdog is obtained, where the data information includes, but is not limited to, a memory change condition of the target watchdog, a GC frequency, a name and a state of each thread in the current process, a system CPU utilization rate, and the like, and the state includes a CPU occupancy rate of each thread. The acquired data information is analyzed and processed to determine the specific abnormal information currently corresponding to the target process, so that the target watchdog is accurately controlled to perform corresponding operation, and the target process can normally run.
It should be noted that, in some embodiments, in order to further ensure the security of the data information recorded by the target watchdog, the data information recorded by the target watchdog may be stored in a certain node or certain nodes of the blockchain.
And step S104, determining the service configuration corresponding to the target watchdog currently according to the data information.
After the data information currently recorded by the target watchdog is obtained, the obtained data information is analyzed and processed to determine the abnormal state of the process corresponding to the target watchdog, and then the corresponding service configuration is obtained according to the determined abnormal state.
Specifically, after data information currently recorded by the target watchdog is obtained, abnormal points corresponding to the processes are determined according to the data information, and processing manners corresponding to different abnormal points are different, for example, some abnormal points need to restart the processes, and then some abnormal points need to wait for the processes to recover services, so that the data information needs to be analyzed and processed to obtain an appropriate processing manner, and the processes are controlled to run according to the obtained processing manner, such as restarting or waiting.
In practical applications, for the acquired data information, there are different operation instructions for different situations, where the specific operations may include:
1) restarting and restoring the global variable until the last scanning;
2) restarting the service;
3) waiting for service to resume.
And S105, controlling the target watchdog to respond to the service configuration.
After obtaining the corresponding service configuration according to the data information, the target watchdog is controlled to perform corresponding operation on the service configuration, specifically, after obtaining the service configuration, the watchdog responds to an operation instruction included in the service configuration.
As can be seen from the above description, after analyzing and processing the current data information recorded by the watchdog, the exception point of the process associated with the watchdog may be determined, and for different exception points, the system may obtain a corresponding processing manner, such as restart or wait, and after obtaining the service configuration, determine an operation instruction corresponding to the service configuration, and further control the watchdog to control the corresponding process according to the operation instruction.
In the above described control method for a watchdog based on a JVM, when it is determined that the watchdog needs to be woken up, the corresponding target watchdog is woken up to obtain data information currently recorded by the target watchdog, and then a specific abnormal point of a process corresponding to the target watchdog is accurately determined according to the obtained data information, then a service configuration corresponding to the target watchdog at that time, specifically control information corresponding to the target watchdog, is obtained according to the abnormal point, and finally the target watchdog is controlled to perform corresponding operations to complete control of the process state. The monitoring is carried out in real time in the running process of the service process, the abnormal position can be accurately known when abnormal conditions occur, more accurate judgment and timely processing are carried out, and the safety of data in the service process is guaranteed.
Further, referring to fig. 2, fig. 2 is a flowchart illustrating a step of determining a wake-up condition according to an embodiment of the present application.
When the target watchdog associated with the target is awakened, it can be known from the above description that the awakening of the watchdog may be the awakening when the process is in normal operation or the awakening when the process is in abnormal operation, so that the awakening condition corresponding to the awakening of the target watchdog needs to be determined when the target watchdog is awakened to control the operation of the target watchdog, so as to accurately control and respond to the target watchdog at the time.
Specifically, step S102, determining a wake-up condition corresponding to waking up the target watchdog, includes:
step S201, acquiring the timing time recorded when the target watchdog monitors the target process;
step S202, reading preset time which is preset;
step S203, determining a wakeup condition corresponding to the target watchdog to be woken up according to the timing time and the preset time.
Because the watchdog needs to perform corresponding operations after being awakened, and the operations performed by the watchdog are different under different conditions, the specific reason why the watchdog is awakened needs to be effectively determined, and the watchdog can be accurately controlled to respond to the state of the target process.
In practical application, a process needs to perform a dog feeding operation at certain intervals during running, where the dog feeding operation is to give a certain feedback to a watchdog associated with the process to inform the watchdog that the process is in a normal running state. The set interval time can be set according to the actual requirement of the service operated by the process, and is usually defaulted to 5 seconds, namely, the process is operated by feeding dogs once every 5 seconds to determine that the process is in a normal operation state at the moment.
For the watchdog, when receiving a feed, a timing operation is performed to record the time interval between two adjacent feed operations instructed by the process. After the watchdog receives the feed dog, the timing time of the watchdog is recorded, and the timing time of the watchdog is reset to carry out the next timing. In addition, when the timing time does not exceed the preset time interval, scanning the global variable in the current process once to record the global variable on the corresponding disk after serialization, and when the timing time exceeds the preset time interval, indicating that the watchdog does not receive the feed dog when needing to receive the feed dog, namely, the process monitored by the watchdog is in an abnormal state.
The timing time recorded by the watchdog is acquired, the preset time corresponding to the process service is read, the timing time is compared with the preset time, and the awakening condition corresponding to awakening the target watchdog is determined according to the obtained comparison result.
In practical application, according to the actual running state of the process, the actual running state of the process includes normal running and abnormal running, so for the wakeup condition of the watchdog, the watchdog is required to perform corresponding processing on the process when the process is abnormally run when the process is awakened, and corresponding data processing may be required when the process is normally run.
When the specific awakening condition is determined, the specific awakening condition is determined according to a comparison result between the timing time and the preset time, and the method comprises the following steps: when the time is less than or equal to the preset time, determining that the awakening condition corresponding to the target watchdog is data storage; and when the timing time is determined to be greater than the preset time, determining that the awakening condition corresponding to the target watchdog is abnormal in process.
When the target process associated with the target watchdog is in normal operation, the watchdog receives the feed dogs at certain intervals, and when the feed dogs are completed every time, the watchdog resets the time. For example, the preset time is set to be 5 seconds, that is, after the timer is reset, the target watchdog receives the feeding dog operation fed back by the target process within 5 seconds. Obviously, if the target process does not feed back the feed dog to the target watchdog within 5 seconds, it indicates that the target process is in an abnormal running state at this time, that is, the wakeup condition at this time is a process exception.
In practical application, each process in the system is monitored by using the watchdog, so that when the timing time recorded by the watchdog is acquired, the acquired timing time is compared with the corresponding preset time to determine whether the corresponding watchdog needs to be awakened. For each process, when the corresponding watchdog needs to be woken up, the corresponding watchdog is woken up to perform corresponding operation, such as controlling the process to restart or waiting for the process to automatically recover. That is, even when there are a plurality of processes in an abnormal state at this time, a plurality of threads can be called to realize control of each process.
Further, referring to fig. 3, fig. 3 is a flowchart illustrating a procedure of obtaining a service configuration of a target gatekeeper in an embodiment of the present application.
When the wakeup condition that the watchdog is awakened is determined to be process abnormity, the target watchdog is required to perform corresponding operation to process the abnormal state, so that the current corresponding abnormal state of the target process needs to be accurately determined according to the obtained data information.
Specifically, step 104, determining the service configuration currently corresponding to the target watchdog according to the data information includes:
step S301, analyzing and processing the data information, and determining abnormal data corresponding to the target process;
step S302, determining an abnormal point of the target process according to the abnormal data;
and step S303, obtaining the service configuration currently corresponding to the target watchdog according to the abnormal point.
And when the target process corresponding to the target watchdog is determined to be in the abnormal operation state, acquiring the associated data information, and further determining the current abnormal state corresponding to the target watchdog according to the data information, so that the target watchdog can perform corresponding operation to enable the target process to normally operate.
After data information recorded by the target watchdog when monitoring the target process is obtained, analyzing and processing the data information to determine abnormal data corresponding to the target process contained in the data information, then determining an abnormal point of the target process according to the obtained abnormal data, and finally obtaining service configuration corresponding to the target watchdog according to the determined abnormal point. Wherein the service is configured as control information corresponding to the watchdog.
The recorded data information specifically includes: JVM memory change condition, GC (garbage collection) times, thread name and state in the target process, CPU utilization rate and the like. And comparing each data in the recorded data information with the corresponding comparison data to determine which data is abnormal data, and determining the current corresponding abnormal point of the target process according to the data information when determining which data is abnormal data.
In the running process of the target process, the target process may call a plurality of threads to implement the actual requirement of the target process during running, for example, when the target watchdog runs, one thread may be called to implement the running of the target watchdog, so that the data information includes the names of the threads in the target process and the respective corresponding states, such as normal state or lock state, and the running state of the target process may be affected by the states of the threads included in the data information.
In practical applications, as can be seen from the above description, the obtained service configuration, that is, the specific operations, may include:
1. restarting and restoring the global variable until the last scanning;
2. restarting the service;
3. waiting for service to resume.
When the global variable is recovered to the last scanning, the target watchdog can periodically record and store the current variable on the corresponding disk when the target process normally operates, so that when the target process is determined to operate abnormally, if the global variable needs to be recovered to the last scanning, the target watchdog can perform adjacent previous global variable on the corresponding disk, and further realize the recovery of the global variable.
Corresponding operation instructions are obtained according to the obtained different related data, and in general, for the three different operations described above, the corresponding data information may be described as follows:
1. if frequent GC is adopted, the memory leakage is considered to occur, and the target watchdog restarts the service, wherein the frequent GC means that the system frequently performs data recovery to obtain more available memory;
2. if the CPU occupancy rate of a certain thread is equal to 1/C, wherein C is the core number of the system CPU, waiting for 10 minutes, and if the target process does not feed the dogs after 10 minutes, restarting the service by watching the target watchdog;
3. if a certain thread is found to be deadlock, ending the thread;
4. if 90% of threads in the target process are in a WAITING state and the utilization rate of a system CPU is lower than 10%, the service is considered to be possibly in an unexpected situation, at the moment, the service cannot be recovered, the target watchdog restarts the service, and the global variable is recovered to the last scanning time after the service is restarted;
5. if 90% of threads are in a RUNNABLE state and the utilization rate of a system CPU is higher than 50%, the service is considered to be busy at present, the service is waited to be recovered, and if the service is waited for 10 minutes and still does not receive any dog feeding action, the watchdog restarts the service;
6. in addition to the above described cases, the watchdog may restart the service in other cases.
In general, when the target watchdog does not receive the feed dog sent by the target process, it is determined that an exception occurs in the current operation of the target process, and therefore, it is determined how to respond currently according to the actually obtained data information.
Further, when the process runs abnormally, an abnormal point corresponding to the process currently needs to be determined according to data information generated in the running process of the process, and then a corresponding processing mode aiming at the abnormal state is obtained so as to control the target watchdog to respond. When the target process is determined to run normally, the target watchdog still can be awakened to perform corresponding operation and response during running, specifically, when the awakening condition is determined to be data storage, the timing time is reset, and data generated by the process is stored in a node of a block chain associated with the target process; and when the data storage is detected to be completed, controlling the target watchdog to enter a dormant state.
The target process is generated in response to different services or operation requirements, and therefore, when the target process is operating normally, data obtained by service operation is generated or generated, and therefore, when the target watchdog is receiving the feed dog sent by the target process in a feedback manner, the target watchdog stores the relevant data obtained in the current timing period, so as to store the obtained relevant data information in a block chain associated with the target process, such as a certain node/nodes of the block chain.
Specifically, when storing related data, the target watchdog acquires and stores a current global variable of the target process during operation, and in the process of operating the target process, the global variable is acquired in real time, so that when the target watchdog receives a feed dog to store the data, the global variable obtained at the current moment is acquired, and the global variable is stored in a corresponding disk.
Referring to fig. 4, fig. 4 is a schematic block diagram of a control apparatus of a watchdog based on a JVM according to an embodiment of the present application, the apparatus being configured to execute the foregoing control method of the watchdog based on the JVM.
As shown in fig. 4, the control apparatus 400 for a watchdog based on a JVM includes:
a wake-up module 401, configured to wake up a target watchdog associated with a target process;
a condition determining module 402, configured to determine a wake-up condition corresponding to waking up the target watchdog;
an information obtaining module 403, configured to obtain data information currently recorded by the target watchdog when it is determined that the wakeup condition is a process exception;
a configuration determining module 404, configured to determine, according to the data information, a service configuration currently corresponding to the target watchdog;
a configuration response module 405, configured to control the target watchdog to respond to the service configuration.
Further, in an embodiment, the control apparatus 400 of the JVM-based watchdog further includes a thread creating module 406, configured to, when detecting that a target process is started, invoke a thread to run a target watchdog associated with the target process; and setting the life cycle of the thread to be equal to the life cycle of the target process.
Further, in an embodiment, the condition determining module 402 is further specifically configured to:
acquiring the timing time recorded when the target watchdog monitors the target process; reading preset time which is preset; and determining a wake-up condition corresponding to the wake-up of the target watchdog according to the timing time and the preset time.
Further, in an embodiment, the condition determining module 402 is further specifically configured to:
when the timing time is determined to be less than or equal to the preset time, determining that the awakening condition corresponding to the target watchdog is data storage; and when the timing time is determined to be greater than the preset time, determining that the awakening condition corresponding to the target watchdog is abnormal in process.
Further, in an embodiment, the information obtaining module 403 is further specifically configured to:
when the awakening condition is determined to be data storage, resetting the timing time and storing the data generated by the process in a block chain associated with a target process; and when the data storage is detected to be completed, controlling the target watchdog to enter a dormant state.
Further, in an embodiment, the configuration determining module 404 is further specifically configured to:
analyzing and processing the data information, and determining abnormal data corresponding to the target process; determining an abnormal point of the target process according to the abnormal data; and obtaining the service configuration currently corresponding to the target watchdog according to the abnormal point.
Further, in an embodiment, the configuration response module 405 is further specifically configured to:
when the abnormal point is abnormal service, determining that the service configuration corresponding to the target watchdog controls the target process to restart or recover; and when the abnormal point is the thread abnormality, determining that the service configuration corresponding to the target watchdog is configured to end the thread running.
It should be noted that, as will be clear to those skilled in the art, for convenience and brevity of description, the specific working processes of the apparatus and the modules described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The apparatus described above may be implemented in the form of a computer program which is executable on a computer device as shown in fig. 4.
Referring to fig. 5, fig. 5 is a schematic block diagram of a computer device according to an embodiment of the present application. The computer device may be a server.
Referring to fig. 5, the computer device includes a processor, a memory, and a network interface connected through a system bus, wherein the memory may include a nonvolatile storage medium and an internal memory.
The non-volatile storage medium may store an operating system and a computer program. The computer program includes program instructions that, when executed, cause a processor to perform any one of the JVM-based watchdog control methods.
The processor is used for providing calculation and control capability and supporting the operation of the whole computer equipment.
The internal memory provides an environment for the execution of a computer program on a non-volatile storage medium, which when executed by a processor, causes the processor to perform any one of the JVM-based watchdog control methods.
The network interface is used for network communication, such as sending assigned tasks and the like. Those skilled in the art will appreciate that the architecture shown in fig. 5 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
It should be understood that the Processor may be a Central Processing Unit (CPU), and the Processor may be other general purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, etc. Wherein a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Wherein, in one embodiment, the processor is configured to execute a computer program stored in the memory to implement the steps of:
waking up a target watchdog associated with a target process;
determining a wake-up condition corresponding to waking up the target watchdog;
when the awakening condition is determined to be abnormal process, acquiring data information currently recorded by the target watchdog;
determining the current corresponding service configuration of the target watchdog according to the data information;
and controlling the target watchdog to respond to the service configuration.
In one embodiment, the processor, prior to implementing the waking of the target watchdog associated with the target process, is further configured to implement:
when the starting of a target process is detected, calling a thread to run a target watchdog associated with the target process; and setting the life cycle of the thread to be equal to the life cycle of the target process.
In one embodiment, when implementing the wake condition corresponding to the determination to wake up the target watchdog, the processor is further configured to implement:
acquiring the timing time recorded when the target watchdog monitors the target process; reading preset time which is preset; and determining a wake-up condition corresponding to the wake-up of the target watchdog according to the timing time and the preset time.
In an embodiment, when the processor wakes up the target watchdog according to the timing time and a preset time to determine a wake-up condition corresponding to waking up the target watchdog, the processor is further configured to:
when the timing time is determined to be less than or equal to the preset time, determining that the awakening condition corresponding to the target watchdog is data storage; and when the timing time is determined to be greater than the preset time, determining that the awakening condition corresponding to the target watchdog is abnormal in process.
In one embodiment, after implementing the wake condition corresponding to the determination to wake the target watchdog, the processor is further configured to implement:
when the awakening condition is determined to be data storage, resetting the timing time and storing the data generated by the process in a node of a block chain associated with a target process; and when the data storage is detected to be completed, controlling the target watchdog to enter a dormant state.
In an embodiment, when the determining, according to the data information, the service configuration currently corresponding to the target watchdog is implemented, the processor is further configured to implement:
analyzing and processing the data information, and determining abnormal data corresponding to the target process; determining an abnormal point of the target process according to the abnormal data; and obtaining the service configuration currently corresponding to the target watchdog according to the abnormal point.
In one embodiment, when implementing the obtaining of the service configuration currently corresponding to the target watchdog according to the exception point, the processor is further configured to implement:
when the abnormal point is abnormal service, determining that the service configuration corresponding to the target watchdog controls the target process to restart or recover; and when the abnormal point is the thread abnormality, determining that the service configuration corresponding to the target watchdog is configured to end the thread running.
An embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, where the computer program includes program instructions, and the processor executes the program instructions to implement any method for controlling a watchdog based on a JVM provided in an embodiment of the present application.
The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiment, for example, a hard disk or a memory of the computer device. The computer readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the computer device.
Further, the computer-readable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to the use of the blockchain node, and the like.
In addition, the block chain referred to in the application is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
While the invention has been described with reference to specific embodiments, the scope of the invention is not limited thereto, and those skilled in the art can easily conceive various equivalent modifications or substitutions within the technical scope of the invention. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A watchdog control method based on JVM is characterized by comprising the following steps:
waking up a target watchdog associated with a target process;
determining a wake-up condition corresponding to waking up the target watchdog;
when the awakening condition is determined to be abnormal process, acquiring data information currently recorded by the target watchdog;
determining the current corresponding service configuration of the target watchdog according to the data information;
and controlling the target watchdog to respond to the service configuration.
2. The method of claim 1, wherein prior to waking a target watchdog associated with a target process, further comprising:
when the starting of a target process is detected, calling a thread to run a target watchdog associated with the target process; and
setting the life cycle of the thread to be equal to the life cycle of the target process.
3. The method of claim 1, wherein the determining the wake-up condition for waking up the target watchdog comprises:
acquiring the timing time recorded when the target watchdog monitors the target process;
reading preset time which is preset;
and determining a wake-up condition corresponding to the wake-up of the target watchdog according to the timing time and the preset time.
4. The method according to claim 3, wherein the waking up the target watchdog according to the timing time and a preset time to determine a wake-up condition corresponding to the waking up of the target watchdog comprises:
when the timing time is determined to be less than or equal to the preset time, determining that the awakening condition corresponding to the target watchdog is data storage;
and when the timing time is determined to be greater than the preset time, determining that the awakening condition corresponding to the target watchdog is abnormal in process.
5. The method of claim 4, wherein after determining the wake-up condition corresponding to waking up the target watchdog, further comprising:
when the awakening condition is determined to be data storage, resetting the timing time and storing the data generated by the process in a node of a block chain associated with a target process;
and when the data storage is detected to be completed, controlling the target watchdog to enter a dormant state.
6. The method of claim 1, wherein the determining the service configuration currently corresponding to the target watchdog according to the data information comprises:
analyzing and processing the data information, and determining abnormal data corresponding to the target process;
determining an abnormal point of the target process according to the abnormal data;
and obtaining the service configuration currently corresponding to the target watchdog according to the abnormal point.
7. The method of claim 6, wherein obtaining the service configuration currently corresponding to the target watchdog according to the exception point comprises:
when the abnormal point is abnormal service, determining that the service configuration corresponding to the target watchdog controls the target process to restart or recover;
and when the abnormal point is the thread abnormality, determining that the service configuration corresponding to the target watchdog is configured to end the thread running.
8. A control apparatus for a watchdog based on a JVM, the apparatus comprising:
a wake-up module for waking up a target watchdog associated with a target process;
the condition determining module is used for determining a wake-up condition corresponding to waking up the target watchdog;
the information acquisition module is used for acquiring the data information currently recorded by the target watchdog when the awakening condition is determined to be abnormal in process;
the configuration determining module is used for determining the service configuration currently corresponding to the target watchdog according to the data information;
and the configuration response module is used for controlling the target watchdog to respond to the service configuration.
9. A computer device, wherein the computer device comprises a memory and a processor;
the memory is used for storing a computer program;
the processor for executing the computer program and implementing the steps of the control method of the JVM-based watchdog of any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which, when executed by a processor, causes the processor to implement the steps of the method for controlling a JVM-based watchdog according to any one of claims 1 to 7.
CN202010463550.2A 2020-05-27 2020-05-27 Watchdog control method, device, equipment and storage medium based on JVM Pending CN111796954A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010463550.2A CN111796954A (en) 2020-05-27 2020-05-27 Watchdog control method, device, equipment and storage medium based on JVM

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010463550.2A CN111796954A (en) 2020-05-27 2020-05-27 Watchdog control method, device, equipment and storage medium based on JVM

Publications (1)

Publication Number Publication Date
CN111796954A true CN111796954A (en) 2020-10-20

Family

ID=72806645

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010463550.2A Pending CN111796954A (en) 2020-05-27 2020-05-27 Watchdog control method, device, equipment and storage medium based on JVM

Country Status (1)

Country Link
CN (1) CN111796954A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113064762A (en) * 2021-04-09 2021-07-02 上海新炬网络信息技术股份有限公司 Service self-recovery method based on multiple detection
CN114760075A (en) * 2022-06-14 2022-07-15 南京信息工程大学 Multi-network information emergency safety system based on block chain and watchdog WDGM
CN115858229A (en) * 2023-02-24 2023-03-28 南京芯驰半导体科技有限公司 Watchdog management method, watchdog and computer readable storage medium

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113064762A (en) * 2021-04-09 2021-07-02 上海新炬网络信息技术股份有限公司 Service self-recovery method based on multiple detection
CN113064762B (en) * 2021-04-09 2024-02-23 上海新炬网络信息技术股份有限公司 Service self-recovery method based on various detection
CN114760075A (en) * 2022-06-14 2022-07-15 南京信息工程大学 Multi-network information emergency safety system based on block chain and watchdog WDGM
CN114760075B (en) * 2022-06-14 2022-09-06 南京信息工程大学 Multi-network information emergency safety system based on block chain and watchdog WDGM
CN115858229A (en) * 2023-02-24 2023-03-28 南京芯驰半导体科技有限公司 Watchdog management method, watchdog and computer readable storage medium

Similar Documents

Publication Publication Date Title
CN111796954A (en) Watchdog control method, device, equipment and storage medium based on JVM
US8108733B2 (en) Monitoring distributed software health and membership in a compute cluster
US9342426B2 (en) Distributed system, server computer, distributed management server, and failure prevention method
CN103885847A (en) Dog feeding method and device based on embedded system
CN108363659B (en) Method and device for processing abnormity of electronic equipment
CN111324494B (en) Processor control method, device and storage medium
CN114328102B (en) Equipment state monitoring method, equipment state monitoring device, equipment and computer readable storage medium
CN103370693A (en) Restarting processes
CN103370694A (en) Restarting data processing systems
CN109361542B (en) Client fault processing method, device, system, terminal and server
CN111800304A (en) Process running monitoring method, storage medium and virtual device
CN114116280A (en) Interactive BMC self-recovery method, system, terminal and storage medium
CN115658113A (en) Server self-starting method and device, readable storage medium and electronic equipment
US20050033952A1 (en) Dynamic scheduling of diagnostic tests to be performed during a system boot process
US20090049336A1 (en) Processor controller, processor control method, storage medium, and external controller
CN110895486A (en) Distributed task scheduling system
CN110287159B (en) File processing method and device
US8099637B2 (en) Software fault detection using progress tracker
CN107179911B (en) Method and equipment for restarting management engine
CN105589787A (en) Health check method and heath check system for application program
CN112631872B (en) Exception handling method and device for multi-core system
JP2007172096A (en) Information processor and start control method
CN103518188B (en) Supervisor system resuming control
CN116991637B (en) Operation control method and device of embedded system, electronic equipment and storage medium
JP2785992B2 (en) Server program management processing method

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