Summary of the invention
To overcome the problems in correlation technique, present description provides Keep Alive supervision method, apparatus and electronic equipments.
According to this specification embodiment in a first aspect, providing a kind of Keep Alive supervision method, comprising:
Determine one or more processes to be monitored;
Monitor the running state of a process to be monitored;
If needing monitoring process misoperation according to monitored results determination, the process of misoperation is restarted.
Optionally, it is executed by the Keep Alive supervision process of destination application, the destination application is installed on electronics and sets
In standby, the process to be monitored be the application program other processes or the electronic equipment in install other answer
With the process of program.
Optionally, the Keep Alive supervision process at least there are two.
Optionally, at least two Keep Alive supervisions process belongs to same destination application, or belongs to different mesh
Mark application program.
Optionally, each Keep Alive supervision process is at least monitored by another Keep Alive supervision process.
Optionally, the process for restarting misoperation, comprising:
The operating system of electronic device is restarted the process of misoperation by the operating system.
Optionally, one or more of processes to be monitored are by reading the process mark to be monitored recorded in pre-configured list
Know and determines.
Optionally, the process mark to be monitored that one or more of processes to be monitored are sent by obtaining the application program
Know and determines.
Optionally, further includes:
Self-operating parameter is written to the watchdog module of electronic equipment.
A kind of Keep Alive supervision device, comprising:
Process determining module, is used for: determining one or more processes to be monitored;
Monitoring module is used for: the monitoring running state of a process to be monitored;
Restart module, be used for: if according to monitored results determination need monitoring process misoperation, restart misoperation into
Journey.
Optionally, described device runs on the Keep Alive supervision process of destination application, the destination application installation
In electronic equipment, the process to be monitored be the application program other processes or the electronic equipment in install
Other applications process.
Optionally, the Keep Alive supervision process at least there are two.
Optionally, at least two Keep Alive supervisions process belongs to same destination application, or belongs to different mesh
Mark application program.
Optionally, each Keep Alive supervision process is at least monitored by another Keep Alive supervision process.
Optionally, described to restart module and be also used to:
The operating system of electronic device is restarted the process of misoperation by the operating system.
Optionally, one or more of processes to be monitored are by reading the process mark to be monitored recorded in pre-configured list
Know and determines.
Optionally, the process mark to be monitored that one or more of processes to be monitored are sent by obtaining the application program
Know and determines.
A kind of electronic equipment, including memory, processor and storage on a memory and can run on a processor to
A few application program;
The application program is run after being executed by processor one or more processes;
At least one described application program includes having destination application, and the destination application includes Keep Alive supervision
Process;
Wherein, following method is realized when the processor executes the Keep Alive supervision process:
Determine one or more processes to be monitored;
Monitor the running state of a process to be monitored;
If needing monitoring process misoperation according to monitored results determination, the process of misoperation is restarted.
Optionally, the Keep Alive supervision process at least there are two.
Optionally, at least two Keep Alive supervisions process belongs to same destination application, or belongs to different mesh
Mark application program.
Optionally, each Keep Alive supervision process is at least monitored by another Keep Alive supervision process.
Optionally, the process for restarting misoperation, comprising:
The operating system of electronic device is restarted the process of misoperation by the operating system.
Optionally, one or more of processes to be monitored are by reading the process mark to be monitored recorded in pre-configured list
Know and determines.
Optionally, the process mark to be monitored that one or more of processes to be monitored are sent by obtaining the application program
Know and determines.
The technical solution that the embodiment of this specification provides can include the following benefits:
In this specification embodiment, Keep Alive supervision scheme is the Keep Alive supervision based on application, can be to application program
Running state of a process be monitored, and find process exception operation when restarted, therefore can application layer exception
Fast quick-recovery when generation improves the stability of business service without solving by restarting whole operation system.
It should be understood that above general description and following detailed description be only it is exemplary and explanatory, not
This specification can be limited.
Specific embodiment
Example embodiments are described in detail here, and the example is illustrated in the accompanying drawings.Following description is related to
When attached drawing, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements.Following exemplary embodiment
Described in embodiment do not represent all embodiments consistent with this specification.On the contrary, they are only and such as institute
The example of the consistent device and method of some aspects be described in detail in attached claims, this specification.
It is only to be not intended to be limiting this explanation merely for for the purpose of describing particular embodiments in the term that this specification uses
Book.The "an" of used singular, " described " and "the" are also intended to packet in this specification and in the appended claims
Most forms are included, unless the context clearly indicates other meaning.It is also understood that term "and/or" used herein is
Refer to and includes that one or more associated any or all of project listed may combine.
It will be appreciated that though various information may be described using term first, second, third, etc. in this specification, but
These information should not necessarily be limited by these terms.These terms are only used to for same type of information being distinguished from each other out.For example, not taking off
In the case where this specification range, the first information can also be referred to as the second information, and similarly, the second information can also be claimed
For the first information.Depending on context, word as used in this " if " can be construed to " ... when " or
" when ... " or " in response to determination ".
Currently, the electronic equipment in the indoor and outdoors such as market, subway station, office building, elevator place mounting arrangements is more and more,
Such as picture pick-up device, entrance detection device, scanning device or the payment device of unmanned supermarket, swiping the card for subway station entrance are set
It is standby etc..The deployment amount of this class of electronic devices is growing at top speed, the feelings for having some electronic equipment requirements that can keep an eye at unmanned scene
Constantly provide service under condition, therefore this class of electronic devices is needed with keepalive feature, keep-alive refers to that the object of concern is in just
Normal operating status, it is normal operating condition that the keep-alive of electronic equipment, which keeps electronic equipment to be in booting, when electronic equipment encounters
Software systems can be restarted automatically when collapsing and restore to operate normally.
Electronic equipment can realize keepalive feature by house dog (watchdog), and current mainstream operation system is such as single
Operating systems such as piece machine, Windows, Linux and Android etc. all support the house dog of software or hardware, by house dog to being
System service etc. is monitored.Hardware vendor and operating system have opened interface also to inquire house dog and write operation.
Specifically, if exception occurs in operating system write operation cannot be timed to house dog program, house dog can be voluntarily
Reboot operation system is restored.It is appreciated that the recovery operation of house dog is system level, however, operating system is restarted
Certain time may be needed to expend, also, electronic equipment can not provide service during operating system is restarted.
Based on this, a kind of this specification Keep Alive supervision scheme shown according to an exemplary embodiment, the program is to be based on
The Keep Alive supervision of application can be monitored the running state of a process of application program, and in discovery process exception fortune
Restarted when row, thus can application layer extremely occur when fast quick-recovery, without by restarting whole operation system
System improves the stability of business service to solve.Next the Keep Alive supervision scheme is described in detail.
As shown in Figure 1, being a kind of this specification Keep Alive supervision method shown according to an exemplary embodiment, including as follows
Step:
In a step 102, one or more processes to be monitored are determined.
At step 104, the running state of a process to be monitored is monitored.
In step 106, if according to monitored results determination need monitoring process misoperation, restart misoperation into
Journey.
The Keep Alive supervision method of the present embodiment can be applied to the electronic equipment with keep-alive demand, by way of example, can be
A system-level process is configured in the electronic device, and the above method is executed by the system-level process.
In other examples, it can be and the above method executed by the process of application program.Application program (Application)
Referring to the software write for certain special applications purpose for user, application program is the ordered set of one group of instruction, and
Process is that have the program (program) of certain standalone feature about the primary operation activity on some data acquisition system, is operation
System carries out an individual of Resource Distribution and Schedule, it can apply for and possess system resource, is one dynamic general
It reads, is a movable entity.It is more than the code of program, further includes current activity, popular understanding: process is exactly journey
The implementation procedure of sequence.That is, process reflects whole dynamic mistakes that an application program is run on certain data set
Journey.Application program can be corresponding with multiple processes.For example after opening a browser application, open multiple webpages, so that it may
To there is multiple processes, operating system is assigned with memory independent of each other to them, mutually executes and is not constrained one another, and distribution is same
CPU.For a user, they are an entirety, belong to the same application program (application).
One or more application program can be installed, each application program can correspond to one or more in electronic equipment
The method of process, the present embodiment can be executed by wherein one or more processes, the process can according to need monitoring other one
A or multiple runnings state of a process.When having process exception operation according to monitored results discovery, process can be carried out in time
Restart, thus can application layer extremely occur when fast quick-recovery, without being solved by restarting whole operation system,
Improve the stability of business service.
For the ease of distinguishing, the process for executing Keep Alive supervision method is known as Keep Alive supervision process by the present embodiment, is configured with
The application program of Keep Alive supervision process is known as destination application.The Keep Alive supervision process can determine one or more to be monitored
Process, by way of example, process to be monitored can be all processes for all application programs installed in electronic equipment, be also possible to
The Partial Process of specified certain applications program as needed, can also be other processes in destination application.
It as shown in Figure 2 A, is the hardware structure diagram of this specification electronic equipment shown according to an exemplary embodiment, electricity
Sub- equipment may include except processor 210, memory 230, network interface 220 and nonvolatile memory 240, wherein place
Reason device can run one or more application program, and application program includes having one or more processes, and which includes targets
Application program, at least one Keep Alive supervision process of the destination application, the Keep Alive supervision process can monitor other processes
Operating status.In practical application, electronic equipment in embodiment can be with generally according to the actual functional capability of the electronic equipment
Including other hardware, this is repeated no more.
Optionally, the determination process of process to be monitored can be realized there are many mode in practical application, for example, can provide
One pre-configured list can recorde in the pre-configured list and need monitoring process mark, recorded by reading in pre-configured list
Process identification (PID) to be monitored can determine process to be monitored.In some instances, the process identification (PID) to be monitored in pre-configured list
Can be and be pre-configured with by the provider of destination application, for example, destination application developer can finish writing in advance it is pre-
Configured list;In other examples, destination application can also provide user interface, with the user of electronic device
It specifies the process of which application program to need to be monitored by the user interface, passes through the user interface and receive electronics
After the input of the user of equipment, the process identification (PID) and write-in for obtaining the application program that the needs that user specifies are monitored extremely are pre-configured
In list.In other examples, it can also be that Keep Alive supervision process is communicated with other applications after operation, by needing to be supervised
Process identification (PID) to be monitored is sent to Keep Alive supervision process by the application program of control process.
As seen from the above-described embodiment, Keep Alive supervision process can monitor the process to be monitored run in electronic equipment, if to
Monitoring process misoperation can also be restarted in time.And Keep Alive supervision process itself is as supervisor, it is also possible to occur different
Often the case where operation;In order to guarantee comprehensive stability, the Keep Alive supervision process of the present embodiment at least there are two, one wherein
In the case where misoperation, there can be another Keep Alive supervision process to can continue to monitor.Optionally, between Keep Alive supervision process
It can also mutually monitor, for example, each Keep Alive supervision process is at least in the case where there is at least two Keep Alive supervision processes
It is monitored by another Keep Alive supervision process, therefore, if having the operation of some Keep Alive supervision process exception, the Keep Alive supervision of the exception
Process can be monitored and be restarted.Optionally, above-mentioned at least two Keep Alive supervisions process may belong to same target and answer
With program, it is also possible to belong to different target application program.
In other examples, self-operating ginseng can also be written in Keep Alive supervision process to the watchdog module of electronic equipment
Number, thus can be by house dog in the case where misoperation by watchdog module monitoring Keep Alive supervision running state of a process
Module executes system reboot.
It as shown in Figure 2 B, is this specification Keep Alive supervision schematic diagram shown according to an exemplary embodiment, by way of example,
It include watchdog module in hardware/system level;It may include: a Keep Alive supervision process in application software level, with
And one or more business process.
Keep Alive supervision process the following functions may be performed:
By timed writing watchdog module, it is guaranteed under the monitoring of house dog and operates normally.
The operation conditions for monitoring each business process, if there is business process is inactive or has collapsed, then restarting should
Business process.Optionally, other business process also may include in addition to providing common business service with the present embodiment
Keep Alive supervision function, that is to say, that the business process in Fig. 2 B can also be used as Keep Alive supervision process.The keep-alive of business process is supervised
Control function it is similar with the Keep Alive supervision function in Keep Alive supervision process, can be monitored by configuring other associated business into
Journey.
As seen from the above-described embodiment, acceptable mutual keep-alive, this redundancy improve the reliable of keep-alive between business process
Property.Due to carrying out keep-alive by independent Keep Alive supervision process, the mutual keep-alive between other processes, the present embodiment can be combined with
High reliability and quick traffic restoration capability can be provided.
In the present embodiment, determine that needing monitoring process misoperation can be accomplished in several ways according to monitored results,
For example, can run by checking whether process to be monitored has, if not running, it is believed that process to be monitored do not restart or
Collapse, process to be monitored are in abnormal operating condition.Wherein, it checks whether process to be monitored has running, operation can be passed through
The interface that system provides, which is got, currently process identification (PID) in operation, by the mark of process to be monitored with currently have in operation
Process identification (PID) compares, that is, can determine whether process to be monitored has and running.In other examples, operation can also be passed through
System provide interface get each running state of a process parameter to be monitored, according to running state parameter determine it is to be monitored into
Journey is can to determine the process for the process of non-responsive state in normal operating condition, or in non-responsive state
Misoperation.
Optionally, the present embodiment can be for monitoring process, can be with flexible configuration Keep Alive supervision detection time interval;Having
In the case where there are multiple Keep Alive supervision processes, different Keep Alive supervision detection time intervals can also be set, which can
With flexible configuration according to actual needs, for example, can based on balance monitor and detection expense and business service can allow interruption when
The factors such as long and determine.
In the present embodiment, after finding process exception, the process of misoperation can be restarted, in some instances, if protecting
Monitoring process living has permission (for example, system-level process, or belong to same destination application with process to be monitored),
The process of misoperation can directly be restarted;In other examples, it is also possible to the operating system of electronic device, by institute
State the process that operating system restarts misoperation;Or it still can be answered by application program belonging to process to be monitored by this
Restarted with program;Alternatively, the prompting message for the abnormal process can also be exported, it is specific to export to notify user to restart
Mode can be the various ways such as output sound, text or picture and be reminded, and the present embodiment is not construed as limiting this.
Corresponding with the embodiment of aforementioned Keep Alive supervision method, this specification additionally provides Keep Alive supervision device and its is answered
The embodiment of electronic equipment.
The embodiment of this specification Keep Alive supervision device can be using on an electronic device.Installation practice can be by soft
Part is realized, can also be realized by way of hardware or software and hardware combining.Taking software implementation as an example, as a logical meaning
On device, be to be read computer program instructions corresponding in nonvolatile memory by the processor of Keep Alive supervision where it
Get what operation in memory was formed.For hardware view, as shown in figure 3, for this specification embodiment Keep Alive supervision device institute
In a kind of hardware structure diagram of electronic equipment, in addition to processor 310 shown in Fig. 3, memory 330, network interface 320, Yi Jifei
Except volatile memory 340, the electronic equipment at 331 place of device in embodiment, generally according to the reality of the computer equipment
Function can also include other hardware, repeat no more to this.
As shown in figure 4, Fig. 4 is a kind of this specification frame of Keep Alive supervision device shown according to an exemplary embodiment
Figure, comprising:
Process determining module 41, is used for: determining one or more processes to be monitored;
Monitoring module 42, is used for: the monitoring running state of a process to be monitored;
Restart module 43, be used for: if needing monitoring process misoperation according to monitored results determination, restarting misoperation
Process.
Optionally, described device runs on the Keep Alive supervision process of destination application, the destination application installation
In electronic equipment, the process to be monitored be the application program other processes or the electronic equipment in install
Other applications process.
Optionally, the Keep Alive supervision process at least there are two.
Optionally, at least two Keep Alive supervisions process belongs to same destination application, or belongs to different mesh
Mark application program.
Optionally, each Keep Alive supervision process is at least monitored by another Keep Alive supervision process.
Optionally, described to restart module and be also used to:
The operating system of electronic device is restarted the process of misoperation by the operating system.
Optionally, one or more of processes to be monitored are by reading the process mark to be monitored recorded in pre-configured list
Know and determines.
Optionally, the process mark to be monitored that one or more of processes to be monitored are sent by obtaining the application program
Know and determines.
Correspondingly, this specification also provides a kind of electronic equipment, including memory, processor and storage are on a memory simultaneously
At least one application program that can be run on a processor;
The application program is run after being executed by processor one or more processes;
At least one described application program includes having destination application, and the destination application includes Keep Alive supervision
Process;
Wherein, following method is realized when the processor executes the Keep Alive supervision process:
Determine one or more processes to be monitored;
Monitor the running state of a process to be monitored;
If needing monitoring process misoperation according to monitored results determination, the process of misoperation is restarted.
Optionally, the Keep Alive supervision process at least there are two.
Optionally, at least two Keep Alive supervisions process belongs to same destination application, or belongs to different mesh
Mark application program.
Optionally, each Keep Alive supervision process is at least monitored by another Keep Alive supervision process.
Optionally, the process for restarting misoperation, comprising:
The operating system of electronic device is restarted the process of misoperation by the operating system.
Optionally, one or more of processes to be monitored are by reading the process mark to be monitored recorded in pre-configured list
Know and determines.
Optionally, the process mark to be monitored that one or more of processes to be monitored are sent by obtaining the application program
Know and determines.
The function of modules and the realization process of effect are specifically detailed in above-mentioned Keep Alive supervision in above-mentioned Keep Alive supervision device
The realization process of step is corresponded in method, details are not described herein.
For device embodiment, since it corresponds essentially to embodiment of the method, so related place is referring to method reality
Apply the part explanation of example.The apparatus embodiments described above are merely exemplary, wherein described be used as separation unit
The module of explanation may or may not be physically separated, and the component shown as module can be or can also be with
It is not physical module, it can it is in one place, or may be distributed on multiple network modules.It can be according to actual
The purpose for needing to select some or all of the modules therein to realize this specification scheme.Those of ordinary skill in the art are not
In the case where making the creative labor, it can understand and implement.
It is above-mentioned that this specification specific embodiment is described.Other embodiments are in the scope of the appended claims
It is interior.In some cases, the movement recorded in detail in the claims or step can be come according to the sequence being different from embodiment
It executes and desired result still may be implemented.In addition, process depicted in the drawing not necessarily require show it is specific suitable
Sequence or consecutive order are just able to achieve desired result.In some embodiments, multitasking and parallel processing be also can
With or may be advantageous.
Those skilled in the art will readily occur to this specification after considering specification and practicing the invention applied here
Other embodiments.This specification is intended to cover any variations, uses, or adaptations of this specification, these modifications,
Purposes or adaptive change follow the general principle of this specification and do not apply in the art including this specification
Common knowledge or conventional techniques.The description and examples are only to be considered as illustrative, the true scope of this specification and
Spirit is indicated by the following claims.
It should be understood that this specification is not limited to the precise structure that has been described above and shown in the drawings,
And various modifications and changes may be made without departing from the scope thereof.The range of this specification is only limited by the attached claims
System.
The foregoing is merely the preferred embodiments of this specification, all in this explanation not to limit this specification
Within the spirit and principle of book, any modification, equivalent substitution, improvement and etc. done should be included in the model of this specification protection
Within enclosing.