CN100543683C - The method and system that process is monitored - Google Patents

The method and system that process is monitored Download PDF

Info

Publication number
CN100543683C
CN100543683C CNB2006101705664A CN200610170566A CN100543683C CN 100543683 C CN100543683 C CN 100543683C CN B2006101705664 A CNB2006101705664 A CN B2006101705664A CN 200610170566 A CN200610170566 A CN 200610170566A CN 100543683 C CN100543683 C CN 100543683C
Authority
CN
China
Prior art keywords
subprocess
heartbeat
monitor
withdraws
pid
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.)
Active
Application number
CNB2006101705664A
Other languages
Chinese (zh)
Other versions
CN1996257A (en
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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CNB2006101705664A priority Critical patent/CN100543683C/en
Publication of CN1996257A publication Critical patent/CN1996257A/en
Application granted granted Critical
Publication of CN100543683C publication Critical patent/CN100543683C/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention provides a kind of method and system that process is monitored, this method mainly comprises: A, the process in the system is carried out heartbeat monitor, described process regularly reports heartbeat message; The situation of B, the heartbeat message that reports according to described process identifies unusual process.This system mainly comprises; Be used for the process of system is carried out the unit of heartbeat monitor, described process regularly reports heartbeat message to the described unit that is used for the process of system is carried out heartbeat monitor; The situation that is used for the heartbeat message that reports according to described process identifies the unit of unusual process.Utilize the method for the invention and system, thereby can monitor in real time, and can monitor various forms of subprocesss and withdraw from situation and withdraw from reason accordingly unusually withdrawing from unusually of process etc.

Description

The method and system that process is monitored
Technical field
The present invention relates to computer application field, relate in particular to a kind of method and system that process is monitored.
Background technology
In the exploitation and operational process of various computing machines or communication products and system; run into withdrawing from unusually of process through regular meeting; perhaps process is absorbed in the situation of endless loop; as not having corresponding abnormality detection mechanism and method in fruit product or the system; can't judge what process exception withdraws from, what process has been absorbed in endless loop; also just can't take appropriate measures and carry out corresponding unusual and recovery processing, therefore, just can't guarantee the high reliability and the self-reparability of product and system.
In present computer operating system, generally all be that the mode by shared resource between process (for example semaphore public module, shared drive etc.) realizes process is monitored, and the communication between monitored process.For example after certain monitored process exception withdraws from, will write down it to the shared resource district and withdraw from relevant information unusually, this withdraws from relevant information unusually and can not be eliminated in a period of time.When monitoring process visited above-mentioned withdraw from relevant information unusually after, will obtain the information that withdraws from unusually of above-mentioned monitored process even withdraw from reason unusually.
But the above-mentioned method that process is monitored has certain limitation, this limitation mainly to show following two aspects when specifically using:
1, concrete detection method and communication mode binding are used;
If 2 certain process because address visit illegal (illegal address visit), have little time to shared resource district recording exceptional former thereby process and are forced to withdraw from unusually, thereby make the concrete reason that monitoring process can't diagnose it to withdraw from unusually.
A kind of concrete processing procedure of process automatic restoring method is in the prior art:
At first the process that needs are monitored is as parent process, call the fork function by parent process and produce a plurality of subprocesss, this subprocess possesses resource identical with parent process and attribute, and this parent process is as monitoring process, and these a plurality of subprocesss are as working group's process.
Above-mentioned parent process is monitored above-mentioned working group process.Parent process and working group's process communicate by exchanging visit semaphore public module, and by the variation of semaphore, whether each subprocess that parent process can be monitored in working group's process is unusual.
When parent process monitors certain subprocess in working group's process when withdrawing from unusually, then parent process is reported to the police.Then, parent process is obtained the identifier of this subprocess that withdraws from unusually by the fork function, and call function closes this subprocess, closes other subprocess in working group's process simultaneously.
Above-mentioned parent process creates a plurality of subprocesss again and as new working group's process, monitoring process is monitored in real time to new working group's process.
The shortcoming of process automatic restoring method is in the above-mentioned prior art:
1, need realize the exclusive readwrite of semaphore public module by special mutual exclusion mechanism;
2, the parent process part that can only detect subprocess withdraws from reason unusually, can not diagnose all to withdraw from reason (the address visit is illegal etc.) unusually, thereby will cause follow-up analyzing and positioning work to be difficult to carry out.
The concrete processing procedure of another kind of process automatic restoring method is in the prior art:
At first be provided with and start monitoring process, this monitoring process waits for that common process registers to it.
Start each common process and register to above-mentioned monitoring process, after succeeding in registration, monitoring process distributes the shared drive object of a Singleton Pattern respectively for each common process, and each common process is with its shared drive of shared drive object initialization that distributes.
Each common process writes down its operation information in shared drive, whether the mechanism that monitoring process utilizes monitoring process and common process regularly to shake hands is obtained the operation information of each common process, have common process exception to withdraw from according to this operation information real-time judge.
After the monitoring process judgement has a common process exception to withdraw from, read the shared drive object information of this common process correspondence that withdraws from unusually, the shared drive object information of reading is stored in the message file, close the shared drive object of this common process correspondence that withdraws from unusually.
Then, monitoring process is reported the common progress information that withdraws from unusually to the client, and gives the client with above-mentioned canned data files and reports.
The shortcoming of process automatic restoring method is in the above-mentioned prior art:
1, needs to wait the exclusive readwrite that realizes shared drive by special mutual exclusion mechanism (locking);
2, the detection method that withdraws from unusually of process is used with communications platform of specifically shaking hands and shared drive binding, it is dumb to cause this method to use;
3, this method is difficult to the process of monitoring owing to withdrawing from unusually that the visit illegal address occurs; because attempting to revise write-protected address space content when common process occurs when unusual; this common process will have little time to write corresponding abnormal information to the shared drive district and just withdraw from unusually immediately; because the shared drive district does not have the relevant information of this common process that withdraws from unusually, thus monitoring process just can not know common process for sure withdraw from reason unusually.
Summary of the invention
The purpose of this invention is to provide a kind of method and system that process is monitored, thereby can monitor in real time withdrawing from unusually of subprocess etc.
The objective of the invention is to be achieved through the following technical solutions:
A kind of method that process is monitored comprises step:
A, monitor task is set in system, and in described monitor task, starts process heartbeat detection timer;
Subprocess sends to described monitor task and carries process identification (PID) and the maximum heartbeat monitor registration message that allows the heartbeat duration information, and starts the heartbeat report timer; After the timing of described heartbeat report timer arrived, described subprocess sent heartbeat message to described monitor task;
Described monitor task allows the heartbeat duration information that initial monitor duration counting is set according to the maximum of carrying in the heartbeat monitor registration message that receives, according to the process identification (PID) in the described heartbeat monitor registration message, maximum heartbeat duration information and the described initial monitor duration counting of allowing, described subprocess is monitored;
When described subprocess withdrawed from, described monitor task sent specification signal to the parent process of described subprocess, and described specification signal comprises process identification (PID), the corresponding subprocess of process identification (PID);
B, described parent process identify the described subprocess that withdraws from according to the described specification signal that receives.
A kind of system that process is monitored comprises:
Subprocess processing unit: be used for monitor task being set, and in described monitor task, start process heartbeat detection timer in system;
Subprocess in the system sends to described monitor task and carries process identification (PID) and the maximum heartbeat monitor registration message that allows the heartbeat duration information, and starts the heartbeat report timer; After the timing of described heartbeat report timer arrived, described subprocess sent heartbeat message to described monitor task;
Described monitor task allows the heartbeat duration information that initial monitor duration counting is set according to the maximum of carrying in the heartbeat monitor registration message that receives; According to the process identification (PID) in the described heartbeat monitor registration message, maximum heartbeat duration information and the described initial monitor duration counting of allowing, described subprocess is monitored;
When described subprocess withdrawed from, described monitor task sent specification signal to the parent process of described subprocess, and described specification signal comprises process identification (PID), the corresponding subprocess of process identification (PID);
Parent process processing unit: be used for identifying the described subprocess that withdraws from according to the described specification signal that receives.
As seen from the above technical solution provided by the invention, the present invention is by when subprocess withdraws from, system kernel sends specification signal to the parent process of described subprocess, parent process identifies the described subprocess that withdraws from according to the described specification signal that receives, thereby realize that parent process monitors in real time and detect withdrawing from unusually of subprocess etc., and can monitor various forms of subprocesss and withdraw from situation and withdraw from reason accordingly unusually.Compare with prior art, have the following advantages:
1, the method for the invention is based on signaling mechanism, because signal belongs to a kind of soft interrupt mechanism in operating system, response in time, therefore, the present invention can carry out truly real-time monitoring to withdrawing from unusually of process etc., and can in time carry out corresponding abnormality processing, that has farthest avoided causing because of abnormality processing untimely spreads unusually, even the collapse of system.2, the method for the invention is used flexibly, does not need the mutual exclusion control of resource between the process of carrying out.And the mutual exclusion of resource control will lead to disastrous consequence in case operation is uncomfortable between process.
3, the abnormal ranges of the method for the invention monitoring is wider, parent process can monitor various forms of subprocesss and withdraw from situation and withdraw from reason accordingly unusually, no matter be improper the withdrawing from unusually of causing of access resources, or process is absorbed in withdrawing from unusually of endless loop or subprocess and call exit and initiatively withdraw from or finish all functions and normally withdraw from.
4, the method for the invention records abnormal conditions the daily record from user's angle, and intelligibility is strong, conveniently process is positioned analysis.
5, the method for the invention is separated process heartbeat monitor and testing mechanism with the communications platform that needs, and binding is not used, thereby communications platform can be as required neatly based on mechanism such as shared drive, message queue or pipeline even SOCKET.
Description of drawings
Fig. 1 is the processing flow chart of the embodiment 1 of the method for the invention;
Fig. 2 is the processing flow chart of the embodiment 2 of the method for the invention;
Fig. 3 is the structural drawing of the embodiment of the system that process is monitored of the present invention.
Embodiment
The invention provides a kind of method and system that process is monitored.When the embodiment of the invention withdraws from subprocess, system kernel carries the specification signal of information such as process identification (PID) to the parent process transmission of described subprocess, parent process identifies the described subprocess that withdraws from and withdraws from reason according to the described specification signal that receives, thereby realized that parent process monitors in real time and detect withdrawing from unusually of subprocess etc., and carried out corresponding abnormality processing.
The method of the invention needs in product or the system operation system of computer to support following mechanism: when subprocess withdraws from, initiatively send specification signal to parent process, the notice parent process has subprocess to withdraw from present.LINUX operating system is supported this mechanism at present.
The treatment scheme of the embodiment 1 of the method for the invention comprises the steps: as shown in Figure 1
Step 1-1: the signal Processing function of set handling specification signal at first on parent process.This specification signal is a subprocess when withdrawing from, the specification signal that sends to parent process by system kernel.
Step 1-2: parent process is pressed the function logic relation and is created one group of subprocess, and after the establishment subprocess was finished, parent process need write down the system banner of each subprocess.Simultaneously, parent process is stored the system identification information of each subprocess and other relevant information, in actual applications, the system identification information of each subprocess and other relevant information (as the process title etc.) can be stored in the database.
Step 1-3: after each subprocess is successfully created, according to the routine operation of oneself.In case subprocess withdraws from (no matter being normally or unusually to withdraw from) for a certain reason, system kernel sends from the trend parent process and carries the system identification information and the relevant above-mentioned specification signal that withdraws from cause information, described system identification information that withdraws from subprocess.
Step 1-4: after parent process receives this specification signal, call the signal Processing function of above-mentioned setting and handle the specification signal that receives, obtain the system banner that withdraws from subprocess and the relevant reason that withdraws from thereof of carrying in the specification signal that receives by this signal Processing function.Simultaneously, parent process is inquired about above-mentioned database according to the system banner that withdraws from subprocess, identifies this and withdraws from subprocess, obtains other relevant information that this withdraws from subprocess.
Step 1-5: parent process withdraws from reason and other relevant information according to the relevant of subprocess of withdrawing from that obtains, and withdraws from subprocess the importance of total system (or parent process or other subprocess) is carried out corresponding abnormality processing.
In whole above-mentioned processing procedure, parent process need be carried out corresponding log record processing, is convenient to follow-up unusual positioning analysis.
With LINUX operating system is example, and the processing procedure of the described method of the invention described above is as follows:
Signal Processing function based on SIGCHLD is installed in parent process.Because in LINUX operating system, when subprocess withdraws from, no matter subprocess be owing to what reason withdraw from unusually or subprocess calls that the exit built-in function initiatively withdraws from or subprocess finish normally withdraw from after all functions after, all can make kernel send the SIGCHLD signal to parent process.Therefore, parent process must at first be set up the signal Processing function of SIGCHLD signal, constantly to monitor the situation that withdraws from unusually of subprocess.
Parent process is pressed the function logic relation then and is created one group of subprocess.Parent process must pass to kernel to the SIGCHLD signal type information when creating each subprocess, so that subprocess is when withdrawing from, kernel can send the SIGCHLD signal to parent process, and SIGCHLD signalisation parent process is current has subprocess to withdraw from by this.In addition, in LINUX operating system, parent process is when creating subprocess, and the process identification (PID) that need obtain is exactly system pid number of this subprocess.Parent process is organized into subprocess management database table with pid number of these subprocesss and correlator progress information (as the process title) and stores then, uses for follow-up inquiry.
After no matter certain subprocess owing to what reason withdrawed from, kernel all can send the SIGCHLD signal to parent process had subprocess to withdraw from notice.
After parent process receives the SIGCHLD signal of kernel transmission, call the signal Processing function of the SIGCHLD that sets in advance, and in this signal Processing function, obtain system pid number and exit status code of the subprocess that withdraws from by wait or waitpid system call, follow according to exit status code and obtain the concrete reason that subprocess withdraws from, and parent process identifies the subprocess that withdraws from according to pid number that withdraws from subprocess from subprocess management database table.Simultaneously, parent process must be recorded as daily record with the abnormal information of the subprocess that captures, is convenient to follow-up unusual positioning analysis.
Parent process can be divided into two classes with subprocess according to each subprocess to total system or to parent process or to the importance and the stability factor (parent process preestablishes) of other subprocesss: the basic subprocess and the common subprocess that total system or parent process are had bigger influence.
After parent process detects subprocess and withdraws from unusually by said process, if detect have the basic subprocess of bigger influence to withdraw from unusually to total system after, then parent process must determine to restart total system; If detect have the basic subprocess of bigger influence to withdraw from unusually to parent process after, then parent process is created all subprocesss again; If after detecting common subprocess and withdrawing from unusually, then parent process only need be created this subprocess again and gets final product.Simultaneously, parent process needs the above-mentioned subprocess management database of real-time update table after creating subprocess again.
The realization of the described method of the invention described above is very flexible; the exclusive reference protection problem that does not have resource; can realize detecting in real time withdrawing from unusually of subprocess, even and since the address unauthorized access cause process exception to withdraw from, parent process also can detect concrete abnormal cause.Simultaneously after detecting subprocess and withdrawing from unusually, the subprocess abnormal information record be can be carried out, user's understanding and later unusual positioning analysis are convenient to.
Be absorbed in the process exception situation of endless loop for further detecting subprocess, the embodiment of the invention also proposes another kind of process heartbeat monitor based on message mechanism and detection and abnormality eliminating method accordingly.This prerequisite that realizes of improving one's methods is the at first message communicating mechanism between implementation process of user, this message communicating mechanism can be shared drive, message queue, SOCKET, pipeline etc., a monitor task also must be set in system in addition, this monitor task can be process or the thread that can independently dispatch, carries out the heartbeat report of process and detects processing by above-mentioned message communicating mechanism and monitor task then.
The concrete treatment scheme of the embodiment 2 of the method for the invention after the improvement comprises the steps: as shown in Figure 2
Step 21: start monitor task, when the monitor task initialization, create and the process of startup heartbeat detection timer.This process heartbeat detection timer is a cycle timer, regularly triggers according to the duration of setting.This monitor task can be process or the thread that can independently dispatch, such as, can be the subprocess that parent process is created.
Step 22: each process is when initialization, perhaps when needs are monitored, send the heartbeat monitor registration message that carries process identification (PID) and maximum permission heartbeat duration information to monitor task, the notice monitor task carries out heartbeat monitor to this process, create simultaneously and start the heartbeat report timer, this heartbeat report timer is a cycle timer, regularly triggers according to the duration of setting.
Step 23: after monitor task receives the heartbeat monitor registration message of certain process transmission, obtain process identification (PID) and the maximum heartbeat duration information that allows in this heartbeat monitor registration message, and be saved in the monitor state table of monitor task, and at this process setting and preserve an initial monitor duration counting, this initial monitor duration counting generally is made as the maximum heartbeat duration that allows.Monitor task adds a record simultaneously in the monitor state table, this record comprises: process identification (PID), maximum heartbeat duration, the current monitor duration of allowing.
Each process is when wish is monitored in registration, and the maximums different according to the actual treatment ability situation registration of each process allow the heartbeat duration.For example, the time that certain process needs when handling concrete function is long, then can register bigger maximum and allow the heartbeat duration, and vice versa.In addition, the process heartbeat detection length of timer of general monitor task is less than the heartbeat report timer duration of monitored process.
Step 24: after the timing of the heartbeat report timer of certain process arrives, will trigger this heartbeat report timer, and report a heartbeat, promptly to heartbeat reporting message of monitor task transmission to monitor task.
Step 25: after monitor task receives the heartbeat message that above-mentioned process reports, then current monitor duration counting at this process is reverted to its initial value (being generally the maximum duration that allows of heartbeat).
Step 26: when the timing of the process heartbeat detection timer of monitor task arrives, will trigger this process heartbeat detection timer.At this moment, if monitor task is not also received the heartbeat message of certain monitored process, then monitor task subtracts 1 operation to the monitor duration counting of this monitored process of preservation.When the monitor duration of certain monitored process counting is 0 or less than 0 the time, show that then this monitored process is in abnormal conditions (having withdrawed from or be absorbed in endless loop unusually), then carries out corresponding following abnormality processing.
Monitor task can carry out abnormality processing by dual mode: first kind is that abnormal conditions and relevant information with this process reports the unusual process of special processing, and concrete follow-up abnormality processing (such as this process of deletion, again create this process etc.) is responsible for by this process; Another kind of mode then is directly to delete the process that abnormal conditions occur by monitor task, simultaneously this abnormality processing is recorded as daily record, is convenient to follow-up positioning analysis.
Step 27: be subjected to the process of heartbeat monitor to nullify and be subjected to monitor state by send the heartbeat logout message to monitor task, and close its heartbeat simultaneously and report timer, after monitor task received this heartbeat logout message, cancellation was to the heartbeat monitor of this process.
In actual applications, can also and improve one's methods the described method of the invention described above and merge use, become that a kind of monitoring range is wider, abnormality detection monitoring and detection scheme more in real time.Concrete processing procedure at the embodiment 3 of the method for the invention of this scheme is as follows:
1, at first on parent process the set handling subprocess withdraw from the signal Processing function of relevant specification signal, and create one group of subprocess according to the function logic relation.Simultaneously parent process needs to write down the system banner of each subprocess after successfully creating subprocess, and the system identification information of each subprocess and other relevant information (as the process title etc.) are stored in the database.Then, certain subprocess of its establishment of parent process is set to monitor task, parent process also can other process or thread be set to monitor task.
2, start above-mentioned monitor task, when the monitor task initialization, create and the process of startup heartbeat detection timer; Each subprocess is subjected to the wish of heartbeat monitor as required to monitor task registration when initialization, create simultaneously and start the heartbeat report timer.Monitor task carries out above-mentioned heartbeat monitor to each monitored process.
3, after parent process receives the specification signal that subprocess that kernel sends withdraws from unusually, identify the subprocess that withdraws from according to this specification signal, earlier the relevant information of this subprocess (as the system banner of this subprocess, process name etc.) is notified to monitor task by message mode, and then carries out corresponding abnormality processing.After monitor task received this notice, immediate cancel was to the heartbeat monitor of this subprocess.
4, when detecting certain, monitor task is subjected to monitoring process unusual (be absorbed in endless loop or withdraw from unusually) to occur, then relevant information (this is subjected to system banner, the process name of monitoring process) is notified to the parent process that is subjected to monitoring process, carry out corresponding abnormality processing by its parent process, promptly according to handled accordingly to system or to its parent process or to the importance and the stability influence of other subprocesss by monitoring process.
The structure of the embodiment of the system that process is monitored of the present invention comprises as shown in Figure 3 as lower module:
Subprocess processing unit: be used for when subprocess withdraws from, send specification signal to the parent process of described subprocess by system kernel.
Parent process processing unit: be used for identifying the described subprocess that withdraws from according to the described specification signal that receives.
Above-mentioned parent process processing unit specifically comprises:
Subprocess creation module: be used for creating subprocess, and the process identification (PID) of each subprocess of establishment is set by the function logic relation;
The progress information maintenance module: the process identification (PID) and the process name information that are used for each subprocess that the subprocess creation module is created are stored;
Withdraw from the subprocess identification module: be used for call signal processing function the described specification signal that receives is handled, obtain the process identity information of the described subprocess that withdraws from, identify the described subprocess that withdraws from.
The above-mentioned subprocess identification module that withdraws from comprises:
Process withdraws from the information logging modle: be used for by calling described signal Processing function the described specification signal that receives being handled, obtain the process identification (PID) of the described subprocess that withdraws from and withdraw from cause information, with this process identification (PID) with withdraw from cause information and carry out record;
Abnormality processing module: after being used to obtain described subprocess and withdrawing from unusually,, carry out corresponding abnormality processing according to the relation of this subprocess and total system, parent process or other subprocess.
The above; only for the preferable embodiment of the present invention, but protection scope of the present invention is not limited thereto, and anyly is familiar with those skilled in the art in the technical scope that the present invention discloses; the variation that can expect easily or replacement all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection domain of claim.

Claims (12)

1, a kind of method that process is monitored is characterized in that, comprises step:
A, monitor task is set in system, and in described monitor task, starts process heartbeat detection timer;
Subprocess sends to described monitor task and carries process identification (PID) and the maximum heartbeat monitor registration message that allows the heartbeat duration information, and starts the heartbeat report timer; After the timing of described heartbeat report timer arrived, described subprocess sent heartbeat message to described monitor task;
Described monitor task allows the heartbeat duration information that initial monitor duration counting is set according to the maximum of carrying in the heartbeat monitor registration message that receives, according to the process identification (PID) in the described heartbeat monitor registration message, maximum heartbeat duration information and the described initial monitor duration counting of allowing, described subprocess is monitored;
When described subprocess withdrawed from, described monitor task sent specification signal to the parent process of described subprocess, and described specification signal comprises process identification (PID), the corresponding subprocess of process identification (PID);
B, described parent process identify the described subprocess that withdraws from according to the described specification signal that receives.
2, method according to claim 1 is characterized in that, described steps A comprises:
Described parent process is pressed the function logic relation and is created subprocess, and the process identification (PID) of each subprocess of establishment is set; The process identification (PID) and the process name information of each subprocess are stored;
When subprocess withdrawed from, system kernel sent the specification signal of the process identification (PID) of carrying the described subprocess that withdraws to described parent process.
3, method according to claim 2 is characterized in that, described specification signal also carries the cause information that withdraws from of the described subprocess that withdraws from.
4, method according to claim 1 is characterized in that, described steps A comprises:
After the timing of the process heartbeat detection timer in the described monitor task arrives, and described monitor task is not also received the heartbeat message that monitored subprocess sends, and then described monitor task subtracts 1 operation to the corresponding monitor duration counting of described monitored subprocess; When the monitor duration of described monitored subprocess counting is 0 or less than 0 the time, then described monitor task sends to the process identity information of described monitoring subprocess the parent process of described monitoring subprocess.
5, method according to claim 1 is characterized in that, described steps A comprises:
Receive the heartbeat message of described monitored subprocess transmission when described monitor task after, current monitor duration counting at described subprocess is reverted to its initial value.
6, according to claim 1 or 2 or 3 or 4 or 5 described methods, it is characterized in that described step B specifically comprises:
The described specification signal that described parent process basis receives obtains the process identity information of the described subprocess that withdraws from, and identifies the described subprocess that withdraws from according to this process identity information.
7, method according to claim 6 is characterized in that, described described parent process specifically comprises according to the process identity information that the described specification signal that receives obtains the described subprocess that withdraws from:
Described parent process is provided with the signal Processing function of handling described specification signal, and described parent process is called described signal Processing function the described specification signal that receives is handled, and obtains the process identity information of the described subprocess that withdraws from.
8, method according to claim 6 is characterized in that, described step B also comprises:
Described parent process is obtained the process identification (PID) of the described subprocess that withdraws from and is withdrawed from cause information according to the described specification signal that receives, with this process identification (PID) with withdraw from cause information and carry out record.
9, method according to claim 6 is characterized in that, described step B specifically comprises:
Described parent process is called described signal Processing function the described specification signal that receives is handled, obtain the process identity information of the described subprocess that withdraws from, described process identity information is sent to described monitor task, and described monitor task stops the monitoring to the corresponding monitored process of described process identification (PID).
10, a kind of system that process is monitored is characterized in that, comprising:
Subprocess processing unit: be used for monitor task being set, and in described monitor task, start process heartbeat detection timer in system;
Subprocess in the system sends to described monitor task and carries process identification (PID) and the maximum heartbeat monitor registration message that allows the heartbeat duration information, and starts the heartbeat report timer; After the timing of described heartbeat report timer arrived, described subprocess sent heartbeat message to described monitor task;
Described monitor task allows the heartbeat duration information that initial monitor duration counting is set according to the maximum of carrying in the heartbeat monitor registration message that receives; According to the process identification (PID) in the described heartbeat monitor registration message, maximum heartbeat duration information and the described initial monitor duration counting of allowing, described subprocess is monitored;
When described subprocess withdrawed from, described monitor task sent specification signal to the parent process of described subprocess, and described specification signal comprises process identification (PID), the corresponding subprocess of process identification (PID);
Parent process processing unit: be used for identifying the described subprocess that withdraws from according to the described specification signal that receives.
11, system according to claim 10 is characterized in that, described parent process processing unit specifically comprises:
Subprocess creation module: be used for creating subprocess, and the process identification (PID) of each subprocess of establishment is set by the function logic relation;
The progress information maintenance module: the process identification (PID) and the process name information that are used for each subprocess that the subprocess creation module is created are stored;
Withdraw from the subprocess identification module: be used for call signal processing function the described specification signal that receives is handled, obtain the process identity information of the described subprocess that withdraws from unusually, identify the described subprocess that withdraws from unusually.
12, system according to claim 11 is characterized in that, the described subprocess identification module that withdraws from specifically comprises:
Process withdraws from the information logging modle: be used for by calling described signal Processing function the described specification signal that receives being handled, obtain the process identification (PID) of the described subprocess that withdraws from unusually and withdraw from cause information, with this process identification (PID) with withdraw from cause information and carry out record;
Abnormality processing module: after being used to obtain described subprocess and withdrawing from unusually,, carry out corresponding abnormality processing according to the relation of this subprocess and total system, parent process or other subprocess.
CNB2006101705664A 2006-12-26 2006-12-26 The method and system that process is monitored Active CN100543683C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2006101705664A CN100543683C (en) 2006-12-26 2006-12-26 The method and system that process is monitored

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2006101705664A CN100543683C (en) 2006-12-26 2006-12-26 The method and system that process is monitored

Publications (2)

Publication Number Publication Date
CN1996257A CN1996257A (en) 2007-07-11
CN100543683C true CN100543683C (en) 2009-09-23

Family

ID=38251355

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2006101705664A Active CN100543683C (en) 2006-12-26 2006-12-26 The method and system that process is monitored

Country Status (1)

Country Link
CN (1) CN100543683C (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104615497A (en) * 2015-02-13 2015-05-13 广州华多网络科技有限公司 Thread hanging processing method and device
CN105573777A (en) * 2014-11-11 2016-05-11 阿里巴巴集团控股有限公司 Control method and devicefor service in application
CN105793860A (en) * 2013-11-14 2016-07-20 Inka安特沃客有限公司 Method for anti-debugging
CN109032777A (en) * 2018-06-29 2018-12-18 北京奇虎科技有限公司 Process method for restarting, calculates equipment and computer storage medium at device
CN109086179A (en) * 2018-08-20 2018-12-25 郑州云海信息技术有限公司 A kind for the treatment of method and apparatus in the case of program exception

Families Citing this family (31)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102455889B (en) * 2010-10-29 2014-03-26 金蝶软件(中国)有限公司 Method, device and enterprise system for obtaining process output logs
CN102318272B (en) * 2011-06-29 2013-12-18 华为技术有限公司 Method for eliminating abnormal group member in process group
CN103092746B (en) * 2013-02-05 2015-12-02 上海大唐移动通信设备有限公司 The localization method of thread exception and system
CN104714839B (en) * 2013-12-12 2018-12-11 腾讯科技(深圳)有限公司 A kind of method and apparatus of control process lifetime
CN105279433B (en) * 2014-07-10 2020-10-16 腾讯科技(深圳)有限公司 Application program protection method and device
CN104142844B (en) * 2014-08-18 2017-09-26 广东欧珀移动通信有限公司 A kind of method and device for clearing up mobile terminal process
CN104298563B (en) * 2014-10-13 2018-08-21 中国外汇交易中心 A kind of method and system for managing process
CN105589757A (en) * 2014-10-23 2016-05-18 上海天脉聚源文化传媒有限公司 Method for protecting working process in server framework and server
CN106330523A (en) * 2015-07-03 2017-01-11 中国移动通信集团广西有限公司 Cluster server disaster recovery system and method, and server node
US9977696B2 (en) * 2015-07-27 2018-05-22 Mediatek Inc. Methods and apparatus of adaptive memory preparation
CN105224395A (en) * 2015-10-10 2016-01-06 上海斐讯数据通信技术有限公司 A kind of process management method and system
CN105574406A (en) * 2015-12-23 2016-05-11 北京奇虎科技有限公司 Progress monitoring method and device
CN106933658A (en) * 2015-12-29 2017-07-07 北京明朝万达科技股份有限公司 The method and apparatus of the anti-kill of background process in a kind of operating system
CN105824749B (en) * 2016-03-09 2019-06-25 上海博达数据通信有限公司 The analysis method of User space process exception under a kind of Linux system
CN108733465A (en) * 2017-04-18 2018-11-02 北大方正集团有限公司 The control method of service processes, the control device of service processes and terminal
CN107368359A (en) * 2017-05-31 2017-11-21 杭州大搜车汽车服务有限公司 A kind of asynchronous task performs method and its storage medium, device
CN107480005A (en) * 2017-07-31 2017-12-15 惠州华阳通用电子有限公司 A kind of linux system process guard method
CN109388489A (en) * 2017-08-03 2019-02-26 成都蓝盾网信科技有限公司 A kind of technological frame of the fault-tolerant high stable of height of more subprocess and process signals processing based on single guiding systems
CN107807884B (en) * 2017-11-07 2021-11-19 国云科技股份有限公司 Method for modular management of error codes
CN108776633B (en) * 2018-05-22 2021-07-02 深圳壹账通智能科技有限公司 Method for monitoring process operation, terminal equipment and computer readable storage medium
CN110752939B (en) * 2018-07-24 2022-09-16 成都华为技术有限公司 Service process fault processing method, notification method and device
CN109257235B (en) * 2018-11-12 2022-03-22 深信服科技股份有限公司 Network anomaly recovery method, device, equipment and computer readable storage medium
CN109725999A (en) * 2018-12-26 2019-05-07 亚信科技(中国)有限公司 A kind of management method and device of scheduling process
CN111176801B (en) * 2019-07-17 2024-04-12 腾讯科技(深圳)有限公司 Multi-process management method, device, equipment and storage medium
CN110825593B (en) * 2019-11-11 2022-08-23 腾讯科技(深圳)有限公司 Method, device and equipment for detecting abnormal state of process and storage medium
CN111240859A (en) * 2020-01-07 2020-06-05 北京达佳互联信息技术有限公司 Data processing method, device, server and storage medium
CN112540896B (en) * 2020-12-08 2024-04-19 南京天朗防务科技有限公司 Automatic judging and running method for VxWorks program
CN113535446B (en) * 2021-06-29 2023-06-06 中国人民解放军战略支援部队信息工程大学 Bidirectional process daemon method and system for protecting business data during line access
CN114281653B (en) * 2022-03-08 2022-07-12 统信软件技术有限公司 Application program monitoring method and device and computing equipment
CN114817075B (en) * 2022-06-21 2022-09-13 远江盛邦(北京)网络安全科技股份有限公司 Inter-process heartbeat detection method and device
CN117272305B (en) * 2023-11-15 2024-02-23 苏州元脑智能科技有限公司 Process processing method and device, electronic equipment and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW469371B (en) * 1998-12-18 2001-12-21 Inventec Corp Application program process monitoring method

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW469371B (en) * 1998-12-18 2001-12-21 Inventec Corp Application program process monitoring method

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105793860A (en) * 2013-11-14 2016-07-20 Inka安特沃客有限公司 Method for anti-debugging
CN105573777A (en) * 2014-11-11 2016-05-11 阿里巴巴集团控股有限公司 Control method and devicefor service in application
CN105573777B (en) * 2014-11-11 2020-01-14 阿里巴巴集团控股有限公司 Method and device for controlling service in application
CN104615497A (en) * 2015-02-13 2015-05-13 广州华多网络科技有限公司 Thread hanging processing method and device
CN104615497B (en) * 2015-02-13 2018-09-25 广州华多网络科技有限公司 A kind of processing method and processing device of thread suspension
CN109032777A (en) * 2018-06-29 2018-12-18 北京奇虎科技有限公司 Process method for restarting, calculates equipment and computer storage medium at device
CN109032777B (en) * 2018-06-29 2021-02-05 北京鸿享技术服务有限公司 Process restarting method and device, computing equipment and computer storage medium
CN109086179A (en) * 2018-08-20 2018-12-25 郑州云海信息技术有限公司 A kind for the treatment of method and apparatus in the case of program exception
CN109086179B (en) * 2018-08-20 2022-04-22 郑州云海信息技术有限公司 Processing method and device under program exception condition

Also Published As

Publication number Publication date
CN1996257A (en) 2007-07-11

Similar Documents

Publication Publication Date Title
CN100543683C (en) The method and system that process is monitored
CN106776212B (en) Supervision system and method for container cluster deployment of multi-process application
US8612389B2 (en) Method and apparatus for discovering application configuration files in a system
CN106371974A (en) Monitoring method of application program in Docker container and publishing platform
CN111930882B (en) Server anomaly tracing method, system and storage medium
US10177984B2 (en) Isolation of problems in a virtual environment
CN103399812A (en) Magnetic disc file operation monitoring system and monitoring method based on Xen hardware virtualization
CN102761439B (en) Device and method for detecting and recording abnormity on basis of watchdog in PON (Passive Optical Network) access system
US20100223446A1 (en) Contextual tracing
WO2016188100A1 (en) Information system fault scenario information collection method and system
CN102722431B (en) process monitoring method and device
CN110232010A (en) A kind of alarm method, alarm server and monitoring server
CN105760240A (en) Distributed task processing method and device
US20130132778A1 (en) Isolation of problems in a virtual environment
US20060167916A1 (en) Non-intrusive method for logging external events related to an application process, and a system implementing said method
CN109299064B (en) Database monitoring method and terminal equipment
CN101192192B (en) Task abnormity diagnosis method and system for real-time operating system
CN104392297A (en) Method and system for realizing non-business process irregularity detection in large data environment
CN109460307B (en) Micro-service calling tracking method and system based on log embedded point
CN111813497A (en) Container environment anomaly detection method, device, medium and computer equipment
CN112000350B (en) Dynamic rule updating method, device and storage medium
CN111046022A (en) Database auditing method based on big data technology
CN112231180A (en) SQL monitoring method and device based on cloud environment
CN107729213B (en) Background task monitoring method and device
CN105718796B (en) A kind of system call level monitoring method of Android privacy of user data access

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant