Summary of the invention
The purpose of the present invention is to provide a kind of house dog monitoring method, system and equipment and a kind of computer-readable storage
Medium takes appropriate measures when program hangs dead and reduces the waste of resource, and is conducive to subsequent problem investigation.
To achieve the above object, the present invention provides a kind of house dog monitoring methods, comprising:
With the presence or absence of abnormal collapse program in monitoring objective system;Wherein, the goal systems includes multiple programs, each
Described program includes multiple threads and/or multiple processes;
If it exists, then corresponding configuration information is obtained according to the identifier of the abnormal collapse program;
The data of the abnormal collapse program are saved according to the configuration information, and according to configuration information judgement
Whether abnormal collapse program needs to restart;
If so, restarting the abnormal collapse program.
Wherein, before in the monitoring objective system with the presence or absence of abnormal collapse program, further includes:
The registration information of each program in the goal systems is received, and is the unique identification of each described program distribution
Number.
Wherein, with the presence or absence of abnormal collapse program in the monitoring objective system, comprising:
According to the identifier of program in the goal systems, described program corresponding hello the dog period is obtained;
Judge whether described program presses hello the dog period and remove corresponding time tag position;
If it is not, then collapsing program using described program as abnormal.
Wherein, the identifier according to the abnormal collapse program obtains corresponding configuration information, comprising:
The configuration information is obtained by information input interface according to the identifier of the abnormal collapse program.
Wherein, the identifier according to the abnormal collapse program obtains corresponding configuration information, comprising:
The configuration information is obtained by the mapping table in database according to the identifier of the abnormal collapse program.
Wherein, it is described restart the abnormal collapse program after, further includes:
Open the abnormal collapse program be corresponding and restart countdown, when it is described restart countdown at the end of, described in judgement
Whether abnormal collapse program restarts success;
If it is not, then executing corresponding operation according to the configuration information.
Wherein, corresponding operate includes:
Again the abnormal collapse program is restarted until restarting success, or restart the goal systems, or restart institute again
It states abnormal collapse program and reaches preset value until restarting number.
To achieve the above object, the present invention provides a kind of house dogs to monitor system, comprising:
Monitoring modular, for collapsing program with the presence or absence of abnormal in monitoring objective system;Wherein, the goal systems includes
Multiple programs, each described program include multiple threads and/or multiple processes;
Module being obtained, being used for when there is abnormal collapse program in the goal systems, according to the abnormal collapse program
Identifier obtain corresponding configuration information;
Preserving module for saving the data of the abnormal collapse program according to the configuration information, and is matched according to described
Confidence breath judges whether the abnormal collapse program needs to restart;
Module is restarted, for restarting the abnormal collapse program when the abnormal collapse program needs to restart.
To achieve the above object, the present invention provides a kind of house dog monitoring devices, comprising:
Memory, for storing computer program;
Processor is realized when for executing the computer program such as the step of above-mentioned house dog monitoring method.
To achieve the above object, the present invention provides a kind of computer readable storage medium, the computer-readable storages
It is stored with computer program on medium, such as above-mentioned house dog monitoring method is realized when the computer program is executed by processor.
By above scheme it is found that a kind of house dog monitoring method provided by the invention includes: in monitoring objective system is
It is no to there is abnormal collapse program;Wherein, the goal systems includes multiple programs, each described program include multiple threads and/
Or multiple processes;If it exists, then corresponding configuration information is obtained according to the identifier of the abnormal collapse program;Matched according to described
Set the data for collapsing program described in information preservation extremely, and according to the configuration information judge the abnormal collapse program whether need
Restart;If so, restarting the abnormal collapse program.
A kind of house dog monitoring method provided by the invention, can be managed collectively each program of entire goal systems, make
They do not interact, and can also improve house dog in the prior art by the way that different configuration informations is arranged for each program
This single operation of system can only be restarted, keep system more flexible controllable.It can configure and not restart system, only restart abnormal collapse
Program, it is possible to reduce the influence to other normal procedures, while reducing the consumption of resource.Secondly as individually restarting exception
The speed of collapse program speed, which is far longer than, restarts whole system, and reboot time can generally be ignored not in actual use
Meter, so being influenced on the normal use of system also minimum.It needs to protect when furthermore it is also possible to hang dead by configuration information configurator
The data deposited retain scene as far as possible, are conducive to the investigation positioning of contingency question.The invention also discloses a kind of house dog prisons
Examining system and equipment and a kind of computer readable storage medium, are equally able to achieve above-mentioned technical effect.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall within the protection scope of the present invention.
The embodiment of the invention discloses a kind of house dog monitoring methods, and take appropriate measures reduction money when program hangs dead
The waste in source, and be conducive to subsequent problem investigation.
Referring to Fig. 1, a kind of flow chart of house dog monitoring method disclosed by the embodiments of the present invention, as shown in Figure 1, comprising:
S101: with the presence or absence of abnormal collapse program in monitoring objective system;Wherein, the goal systems includes multiple journeys
Sequence, each described program include multiple threads and/or multiple processes;If it exists, then enter S102;If it does not exist, then continue to supervise
Survey goal systems;
In specific implementation, goal systems can be common embedded system, naturally it is also possible to be other systems, herein
It is not especially limited.It include multiple programs in the goal systems, a process or a thread can be used as a program, house dog
The dog period can be fed by the difference of distinct program, realize the unified management of multiple programs.
It is understood that all programs are registered in house dog after goal systems starting, i.e., sent out to house dog
The registration information of the program is given, house dog can distribute the identifier uniquely determined for each program, this step is established all
On the basis of the relationship mapped one by one that program is all established with its identification number.
It should be noted that it is a kind of timing program that house dog is practical, i.e. this step can specifically include:
According to the identifier of program in the goal systems, described program corresponding hello the dog period is obtained;
Judge whether described program presses hello the dog period and remove corresponding time tag position;
If it is not, then collapsing program using described program as abnormal.
That is, each program has one to feed the dog time in registration, the program is by dog time timing dog-feeding is fed, i.e.,
The corresponding time identifier position of the program in house dog is removed, shows that the program is active, if the program is not providing
Dog is fed in time, then the program is determined as abnormal collapse program by house dog.
S102: corresponding configuration information is obtained according to the identifier of the abnormal collapse program;
It is understood that each program corresponds to a configuration information, it can be according to unique identifier of program
Obtain this configuration information.Specifically, can obtain in several ways, for example, user, which can choose, to be needed when the program hangs dead
Whether data to be saved and the program need to restart, and are manually entered configuration information by information input interface.It for another example, can be with
The configuration information is set for each program in advance, and establishes the mapping table of identifier and configuration information, is hung in a certain program
The configuration information is called directly when dead.For another example, the program in goal systems can be classified by preset rules, same category
Program correspond to same configuration information, can inquire that its generic is corresponding to match by its identifier when a certain program hangs dead
Confidence breath.Above-mentioned is to the simple examples for obtaining configuration information, any other mode is all in the protection scope of the present embodiment.
S103: the data of the abnormal collapse program are saved according to the configuration information, and are sentenced according to the configuration information
Whether the abnormal collapse program of breaking needs to restart;If so, into S104;If it is not, then saving scene, does not execute and restarts behaviour
Make;
In specific implementation, the configuration information of each program store the program hang it is dead when need to store which data and
Whether need to restart.Wherein, which may include that database table associated with the program, system file, system are current
Operating status (such as CPU usage, memory usage, global structure body variable) and equipment critical data (such as voltage, alarm amount
Deng).If the program does not need reboot operation according to configuration information, reboot operation is not executed, continues monitoring objective into S101
Other programs in system are with the presence or absence of the dead phenomenon of extension.
S104: restart the abnormal collapse program.
A kind of house dog monitoring method provided in an embodiment of the present invention, can be managed collectively each journey of entire goal systems
Sequence makes them not interact, and can also improve in the prior art see by the way that different configuration informations is arranged for each program
Door dog can only restart this single operation of system, keep system more flexible controllable.It can configure and not restart system, only restart exception
Collapse program, it is possible to reduce the influence to other normal procedures, while reducing the consumption of resource.Secondly as individually restarting
The speed of abnormal collapse program speed, which is far longer than, restarts whole system, and reboot time can generally neglect in actual use
Slightly disregard, so being influenced on the normal use of system also minimum.Furthermore it is also possible to be needed when hanging dead by configuration information configurator
Data to be saved retains scene as far as possible, is conducive to the investigation positioning of contingency question.
The embodiment of the invention discloses a kind of house dog monitoring methods, and relative to a upper embodiment, the present embodiment is to technology
Scheme has made further instruction and optimization.It is specific:
Referring to fig. 2, the flow chart of another house dog monitoring method provided in an embodiment of the present invention, as shown in Fig. 2, packet
It includes:
S201: with the presence or absence of abnormal collapse program in monitoring objective system;Wherein, the goal systems includes multiple journeys
Sequence, each described program include multiple threads and/or multiple processes;If it exists, then enter S202;If it does not exist, then continue to supervise
Survey goal systems;
S202: corresponding configuration information is obtained according to the identifier of the abnormal collapse program;
S203: the data of the abnormal collapse program are saved according to the configuration information, and are sentenced according to the configuration information
Whether the abnormal collapse program of breaking needs to restart;If so, into S204;If it is not, then saving scene, does not execute and restarts behaviour
Make;
S204: restart the abnormal collapse program;
S205: opening the abnormal collapse program be corresponding and restart countdown, when it is described restart countdown at the end of, judgement
Whether the abnormal collapse program restarts success;If so, into S201;If it is not, then entering S206;
S206: corresponding operation is executed according to the configuration information.
In specific implementation, countdown can also be restarted including each program in configuration information, certainly, this, which is restarted, counts
When also can store in other positions, be not specifically limited herein.After restarting abnormal collapse program, house dog, which is opened, restarts down
Timing, at the end of restarting countdown, abnormal collapse program, which restarts other programs successfully then continued in monitoring objective system, is
It is no to there is the dead phenomenon of extension, restart failure and corresponding operation is then executed according to configuration information.
It is understood that the mode that corresponding operation again may be by above-described embodiment introduction in configuration information carries out
It obtains.Corresponding operation herein may include restart the abnormal collapse program again until restart successfully, restart the target
System restarts the abnormal collapse program again and reaches preset value etc. until restarting number.The above-mentioned only letter to respective operations
Single example, other users optionally operate all in the protection scope of the present embodiment.
A kind of specific house dog monitoring method is described below, referring to Fig. 3, it is provided in an embodiment of the present invention another guard the gate
The flow chart of dog monitoring method, as shown in Figure 3, comprising:
S311: receiving the registration information of each program in goal systems, and is the unique identification of each described program distribution
Number;
S312: according to the identifier of program in the goal systems, described program corresponding hello the dog period is obtained;
S313: judge whether described program presses hello the dog period and remove corresponding time tag position;If it is not, then will be described
Program enters S302 as abnormal collapse program;If so, into S312;
S302: the configuration information is obtained by information input interface according to the identifier of the abnormal collapse program;
S303: the data of the abnormal collapse program are saved according to the configuration information, and are sentenced according to the configuration information
Whether the abnormal collapse program of breaking needs to restart;If so, into S304;If it is not, then saving scene, does not execute and restarts behaviour
Make;
S304: restart the abnormal collapse program;
S305: opening the abnormal collapse program be corresponding and restart countdown, when it is described restart countdown at the end of, judgement
Whether the abnormal collapse program restarts success;If so, into S312;If it is not, then entering S306;
S306: the abnormal collapse program is restarted according to the configuration information again and reaches preset value until restarting number.
A kind of house dog monitoring system provided in an embodiment of the present invention is introduced below, one kind described below is guarded the gate
Dog monitors system can be cross-referenced with a kind of above-described house dog monitoring method.
Referring to fig. 4, the structure chart of a kind of house dog monitoring system provided in an embodiment of the present invention, as shown in Figure 4, comprising:
Monitoring modular 401, for collapsing program with the presence or absence of abnormal in monitoring objective system;Wherein, the goal systems
Including multiple programs, each described program includes multiple threads and/or multiple processes;
Module 402 being obtained, being used for when there is abnormal collapse program in the goal systems, according to the abnormal collapse journey
The identifier of sequence obtains corresponding configuration information;
Preserving module 403, for saving the data of the abnormal collapse program according to the configuration information, and according to described
Configuration information judges whether the abnormal collapse program needs to restart;
Module 404 is restarted, for restarting the abnormal collapse program when the abnormal collapse program needs to restart.
A kind of house dog provided in an embodiment of the present invention monitors system, can be managed collectively each journey of entire goal systems
Sequence makes them not interact, and can also improve in the prior art see by the way that different configuration informations is arranged for each program
Door dog can only restart this single operation of system, keep system more flexible controllable.It can configure and not restart system, only restart exception
Collapse program, it is possible to reduce the influence to other normal procedures, while reducing the consumption of resource.Secondly as individually restarting
The speed of abnormal collapse program speed, which is far longer than, restarts whole system, and reboot time can generally neglect in actual use
Slightly disregard, so being influenced on the normal use of system also minimum.Furthermore it is also possible to be needed when hanging dead by configuration information configurator
Data to be saved retains scene as far as possible, is conducive to the investigation positioning of contingency question.
On the basis of the above embodiments, preferably, further includes:
Distribution module for receiving the registration information of each program in the goal systems, and is each described program point
With unique identifier.
On the basis of the above embodiments, preferably, the monitoring modular 401 includes:
Acquiring unit obtains described program corresponding hello dog week for the identifier according to program in the goal systems
Phase;
Judging unit removes corresponding time tag position for judging whether described program presses hello the dog period;If it is not,
Then start the workflow of determination unit;
The determination unit, for collapsing program using described program as abnormal.
On the basis of the above embodiments, preferably, obtaining module 402 is specially to work as the goal systems
When the middle collapse program in the presence of exception, the configuration is obtained by information input interface according to the identifier of the abnormal collapse program
The module of information.
On the basis of the above embodiments, preferably, obtaining module 402 is specially to work as the goal systems
When the middle collapse program in the presence of exception, the mapping table acquisition in database is passed through according to the identifier of the abnormal collapse program
The module of the configuration information.
On the basis of the above embodiments, preferably, further includes:
Countdown module, program is corresponding for opening the abnormal collapse restarts countdown, restarts countdown when described
At the end of, judge whether the abnormal collapse program restarts success;If it is not, then starting the workflow of execution module;
The execution module, for executing corresponding operation according to the configuration information.
On the basis of the above embodiments, preferably, the execution module is specially restarted described again
Abnormal collapse program is until restart success, or restart the goal systems, or restart the abnormal collapse program again until weight
Open the module that number reaches preset value.
Present invention also provides a kind of house dog monitoring devices, referring to Fig. 5, a kind of house dog provided in an embodiment of the present invention
The structure chart of monitoring device, as shown in Figure 5, comprising:
Memory 501, for storing computer program;
Step provided by above-described embodiment may be implemented in processor 502 when for executing the computer program.Certainly
The house dog monitoring device can also include various network interfaces, the components such as power supply.
A kind of house dog monitoring device provided in an embodiment of the present invention, can be managed collectively each journey of entire goal systems
Sequence makes them not interact, and can also improve in the prior art see by the way that different configuration informations is arranged for each program
Door dog can only restart this single operation of system, keep system more flexible controllable.It can configure and not restart system, only restart exception
Collapse program, it is possible to reduce the influence to other normal procedures, while reducing the consumption of resource.Secondly as individually restarting
The speed of abnormal collapse program speed, which is far longer than, restarts whole system, and reboot time can generally neglect in actual use
Slightly disregard, so being influenced on the normal use of system also minimum.Furthermore it is also possible to be needed when hanging dead by configuration information configurator
Data to be saved retains scene as far as possible, is conducive to the investigation positioning of contingency question.
Present invention also provides a kind of computer readable storage mediums, are stored thereon with computer program, the computer
Step provided by above-described embodiment may be implemented when program is executed by processor.The storage medium may include: USB flash disk, movement
Hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory,
RAM), the various media that can store program code such as magnetic or disk.
Each embodiment in this specification is described in a progressive manner, the highlights of each of the examples are with other
The difference of embodiment, the same or similar parts in each embodiment may refer to each other.
The foregoing description of the disclosed embodiments enables those skilled in the art to implement or use the present invention.
Various modifications to these embodiments will be readily apparent to those skilled in the art, as defined herein
General Principle can be realized in other embodiments without departing from the spirit or scope of the present invention.Therefore, of the invention
It is not intended to be limited to the embodiments shown herein, and is to fit to and the principles and novel features disclosed herein phase one
The widest scope of cause.
Each embodiment is described in a progressive manner in specification, the highlights of each of the examples are with other realities
The difference of example is applied, the same or similar parts in each embodiment may refer to each other.For system disclosed in embodiment
Speech, since it is corresponded to the methods disclosed in the examples, so being described relatively simple, related place is referring to method part illustration
?.It should be pointed out that for those skilled in the art, under the premise of not departing from the application principle, also
Can to the application, some improvement and modification can also be carried out, these improvement and modification also fall into the protection scope of the claim of this application
It is interior.
It should also be noted that, in the present specification, relational terms such as first and second and the like be used merely to by
One entity or operation are distinguished with another entity or operation, without necessarily requiring or implying these entities or operation
Between there are any actual relationship or orders.Moreover, the terms "include", "comprise" or its any other variant meaning
Covering non-exclusive inclusion, so that the process, method, article or equipment for including a series of elements not only includes that
A little elements, but also including other elements that are not explicitly listed, or further include for this process, method, article or
The intrinsic element of equipment.In the absence of more restrictions, the element limited by sentence "including a ...", is not arranged
Except there is also other identical elements in the process, method, article or apparatus that includes the element.