Summary of the invention
This application provides a kind of function dissemination method and equipment, to realize the automation of entire reboot operation, so that
Whole process is not necessarily to the intervention of background maintenance personnel, while can be in time by the corresponding functional characteristic in system modification part or function
It is supplied to platform user, improves platform availability.
This application discloses a kind of function dissemination methods, comprising:
Restarting equipment judges whether platform needs to restart;
When the judging result, which is, is, the restarting equipment restarts the platform by non-application level process, with hair
Distribution system modifies the corresponding function in part;Wherein, the process that the non-application level process is run independently of the platform.
Preferably, the restarting equipment judges whether platform needs to restart, comprising:
The state of restarting equipment identification reboot flag position;
When recognition result is when rebooting status, it is determined that the platform is restarted;When recognition result be without
When rebooting status, it is determined that the platform does not need to be restarted.
Preferably, the restarting equipment identifies the state of the reboot flag position, comprising:
The restarting equipment is periodically detected the state of the reboot flag position by the non-application level process to know
The state of the not described reboot flag position;Or the restarting equipment according to receive the status information comprising the reboot flag position come
Identify the state of the reboot flag position.
Disclosed herein as well is a kind of restarting equipments, comprising:
Judgment module, for judging whether platform needs to restart;
Module is restarted, for restarting the platform by non-application level process when the judging result, which is, is, with hair
Distribution system modifies the corresponding function in part;Wherein, the process that the non-application level process is run independently of the platform.
Preferably, the judgment module, comprising:
Identification module, for identification state of reboot flag position;
Determining module is used to when recognition result be to determine that the platform is restarted when rebooting status;Work as identification
When as a result for without rebooting status, determine that the platform does not need to be restarted.
Preferably, the identification module described is restarted specifically for being periodically detected by the non-application level process
The state of flag bit identifies the state of the reboot flag position;Or believe according to the state comprising the reboot flag position is received
Cease the state to identify the reboot flag position.
Disclosed herein as well is a kind of function dissemination methods, comprising:
Platform initial setting up reboot flag position is without rebooting status;
When the platform needs to restart, changing the reboot flag position is to rebooting status, so that restarting equipment passes through
Non- application level process, which restarts the platform, carrys out the corresponding function in delivery system modification part;
Wherein, the process that the non-application level process is run independently of the platform.
Preferably, after changing the reboot flag position as to rebooting status, further includes:
The information of state comprising the reboot flag position is sent to the restarting equipment by the platform.
It preferably, is to exist to restart script based on determining designated position when the change reboot flag position is to rebooting status
When, include: after changing the reboot flag position as to rebooting status
The platform is sent to the restarting equipment for there is the information for restarting script comprising designated position.
Preferably, after the platform is restarted in completion, further includes:
It is described without rebooting status that the platform, which resets the reboot flag position,.
It preferably, is to exist to restart script based on determining designated position when the change reboot flag position is to rebooting status
When, the resetting reboot flag position is described without rebooting status, comprising:
The platform restarts script described in deleting.
Disclosed herein as well is a kind of platforms, comprising:
Initial setup module is without rebooting status for initial setting up reboot flag position;
Change module, for when the platform needs to restart, change the reboot flag position be to rebooting status, with
Restart restarting equipment to the platform by non-application level process and modifies the corresponding function in part come delivery system;Its
In, process that the non-application level process is run independently of the platform.
Preferably, the platform further include:
Sending module, for will include that the information of state of the reboot flag position is sent to the restarting equipment.
Preferably, the sending module, is specifically used for
It is when rebooting status is based on designated position is determined in the presence of script is restarted, more when changing the reboot flag position
It is described heavy to be sent to comprising designated position in the presence of the information for restarting script after rebooting status for changing the reboot flag position
Open equipment.
Preferably, the platform further include:
Module is reset, is described without restarting for after completing to restart the platform, resetting the reboot flag position
State.
Preferably, the resetting module, is specifically used for
It is to be deleted when rebooting status is based on designated position is determined in the presence of script is restarted when changing the reboot flag position
It is described to restart script.
Compared with prior art, the application first determines whether platform needs to restart by restarting equipment;When the judgement
As a result for when being, restarting equipment restarts the platform by the non-application level process run independently of the platform to issue
The corresponding function in system modification part, realizes the automation of entire reboot operation, so that whole process is not necessarily to background maintenance personnel
Intervention, while the corresponding characteristic in system modification part or function can be supplied to platform user in time, improving platform can
With rate.
Specific embodiment
The purpose of the application is to provide a kind of function dissemination method and equipment, to realize the automatic of entire reboot operation
Change so that whole process is not necessarily to the intervention of background maintenance personnel, while can in time by the corresponding characteristic in system modification part or
Function is supplied to platform user, improves platform availability.
To reach the above technical purpose, as shown in Figure 1, the embodiment of the present application one provides a kind of function dissemination method, answer
It is right with delivery system modification part for needing to restart when system has altered (demand change, bug-fix, configuration change etc.)
Under the function/characteristic scene answered, specifically includes the following steps:
Step 101, restarting equipment judges whether platform needs to restart;
Specifically, platform involved in the application is that single or multiple applications erect and are provide specific function
System, when facing maintenance personnel, platform can be software program;If being directed to user, platform, which can be, to be equipped with this and is
The hardware of system;When system is modified, such as platform increases relevant configuration on foreground, just must be into the configuration take-effective
Row is restarted, and when platform is restarted, setting is restarted independently of the restarting equipment of platform for triggering the platform
Operation specifically can be by the state of reboot flag position come so that restarting equipment is known is finally to realize restarting for system
It is no restarted namely restarting equipment can by reboot flag position to determine whether restarted, certainly its
His mode is also possible, such as notifies restarting equipment by message or signaling etc., so that restarting equipment can determine that platform is
No needs are restarted, and specific means can have very much, however it is not limited to reboot flag position.
Wherein, restarting equipment judges whether platform needs to restart, and can specifically include following two step:
Firstly, the state of restarting equipment identification reboot flag position;Wherein, the state for restarting marker bit includes: to weight
State is opened, rebooting status is not necessarily to;
Specifically, the reboot flag position is used to mark the state of platform, that is, what is marked is whether platform has occurred system and repair
Change (namely whether the platform is restarted);Such as in specific scene, which can be specially 0 and 1
Two values, in the initial state, can be set reboot flag position be 0 when, i.e., expression platform be in be not necessarily to rebooting status;And work as
System changes, and needs to restart, then it is 1 that reboot flag position, which can be set, indicates that platform is in rebooting status, in this situation
The state of lower reboot flag position becomes from without rebooting status to rebooting status, so that it may by the way that reboot flag position is become 1 from 0
Realize, certainly there are also much also can be achieved on otherwise (such as when original state can be set, reboot flag position is
1), however it is not limited to which a kind of this mode is ok as long as the state that can distinguish two kinds of reboot flag positions.
Specifically, the state of restarting equipment identification reboot flag position, can there is following two mode:
Mode one, the restarting equipment can be periodically detected the reboot flag position by the non-application level process
State identify the state of the reboot flag position.
It specifically, the application carried on platform, is realized by the process of application level, and it is involved in the application
And non-application level process be then to be and application level with the different process of application level process, i.e., non-application level process
Process is mutually indepedent, namely independent with platform, not will receive the influence of platform, thus is examined by the non-application level process
The process of survey is unrelated with platform, and not restarted process by platform is influenced, and will not restart because of platform causes detection to be interrupted.
Mode two, the restarting equipment can be according to receiving the status information comprising the reboot flag position to identify
State the state of reboot flag position.
Certainly specific identification process can also have much otherwise, currently restart as long as can determine that restarting equipment
The state of flag bit, however it is not limited to above two mode.
Secondly, after identification is completed, when recognition result is when rebooting status, it is determined that the platform needs to carry out
Restart;When recognition result is without rebooting status, it is determined that the platform does not need to be restarted.
Step 102, when the judging result is that the platform is restarted, the restarting equipment passes through non-application
Rank process restarts the platform with the corresponding function in delivery system modification part;Wherein, the non-application level process is independent
It is run in the platform.
Specifically, non-application level process involved in the application be then with the different process of application level process,
I.e. non-application level process be it is mutually indepedent with application level process, not will receive the influence for restarting process of platform, restart and set
It will not be by the influence that platform is restarted, due to the non-application for restarting for platform is executed by the non-application level process triggers
Rank process is run independently of the platform, and will not be restarted by platform application influences, so restarting equipment passes through non-application layer
The process that script is restarted in other process execution will not interrupt, thus can smoothly complete the process restarted;Wherein, the non-application level into
Journey can be the process of system level, can also be other processes it is not limited to the process of system level, as long as can not be by
The influence of restarting of platform application is just ok.
Judge whether platform needs to restart by restarting equipment in the embodiment of the present application one;When the judging result is yes
When, restarting equipment is by restarting the platform independently of the non-application level process that the platform is run with delivery system modification portion
Divide corresponding function, realize the automation of entire reboot operation, so that whole process is not necessarily to the intervention of background maintenance personnel, simultaneously
The corresponding characteristic in system modification part or function can be supplied to platform user in time, improve platform availability.
It is the explanation done based on restarting equipment side to the application above, now the application is done further based on platform side
It is bright, as shown in Fig. 2, also proposed a kind of function dissemination method in the embodiment of the present application two, comprising the following steps:
Step 201, platform initial setting up reboot flag position is without rebooting status;
Step 202, when the platform needs to restart, changing the reboot flag position is to rebooting status, so as to restart
Equipment, which restarts the platform by non-application level process, modifies the corresponding function in part come delivery system;Wherein, institute
State the process that non-application level process is run independently of the platform.
Specifically, in step 202, (namely when the platform needs to restart, changing the reboot flag position is wait restart
State) after, can also include:
The information of state comprising the reboot flag position is sent to the restarting equipment by the platform.
In this way, since the information of the state comprising the reboot flag position is sent to the restarting equipment by platform, it is described
Restarting equipment is recognized that the status information of current reboot flag position, to carry out subsequent judgement, it is determined whether needs weight
Open platform.
It wherein, is based on determining specific bit when the change reboot flag position is to rebooting status under specific scene
Set in the presence of when restarting script, change the reboot flag position be to rebooting status after, can also include: that the platform will wrap
The restarting equipment is sent in the presence of the information for restarting script containing designated position.
In addition, specifically, can also include: to restart mark described in the platform resetting after completing to restart the platform
Will position is without rebooting status.
In this way, due to whether restarting based on the state of the reboot flag position and judged, when platform is restarted after,
If the state of the reboot flag position will lead to there is no variation and fall into the state for restarting endless loop, in such a case, it is possible to
The reboot flag position is set as can be and being performed by platform without rebooting status, naturally it is also possible to whether other third
Method, apparatus or program etc. execute, as long as can make after restarting, the state of the reboot flag position is arranged to without restarting
State.
It wherein, is based on determining specific bit when the change reboot flag position is to rebooting status under specific scene
It sets in the presence of when restarting script, it can also include: the platform that the resetting reboot flag position, which is described without rebooting status,
Script is restarted described in deletion.
In this case, because when designated position exist restart script when, the state of reboot flag position can be arranged to
Rebooting status, if being deleted, it is naturally also that can fall into avoid system that reboot flag position, which will be arranged to without rebooting status,
Enter to restart endless loop, restarts script likewise, can be platform to delete this, be also possible to by other third party device, or
Person's program etc. is deleted, as long as can delete this restarts script.
In the embodiment of the present application two, it is without rebooting status, when platform needs are restarted that reboot flag position, which is arranged, in platform first choice
When, the state that can change reboot flag position is to rebooting status, so that restarting equipment was run independently of the platform
Non- application level process restarts the platform with the corresponding function in delivery system modification part, realizes the automatic of entire reboot operation
Change so that whole process is not necessarily to the intervention of background maintenance personnel, while can in time by the corresponding characteristic in system modification part or
Function is supplied to platform user, improves platform availability.
The embodiment of the present invention is described in detail below in conjunction with specific application scenarios, as shown in figure 3, the present invention is implemented
The function dissemination method under concrete application scene is proposed in example three.
Wherein, with mockservice platform (i.e. one unified mock service platform, when user has new interface mock to need
When asking, operation addition configuration can be carried out on foreground, be provided using needing to issue out by new mock interface after restarting
Mock service) for.
When user is after foreground changes platform mock configuration file, triggering general module is restarted in meeting automatic trigger execution,
Specific: this restarts the movement that triggering general module executes setting reboot flag position, can specifically replicate for restarting platform
The catalogue that shell script is specified to cron job;In this way, when the asynchronous timed task process detection of cron tab to specified directory
Restarting after script exists will directly execute to achieve the purpose that restart platform/system
When determine restart script there are this under specified directory when, Linux system can by the process of system level execute should
Restart script (the system level process will not be restarted by platform application to be influenced, so will not interrupt).If there is no the foot
This, then directly skip, and next timed task is waited to judge again;So circulation, the frequency of specific timed task can be according to demand
Arbitrarily setting, wherein what the timed task utilized is that (crontab order is common in for the crontab order of linux server
Among the operating system of Unix and class Unix, for the instruction being periodically performed to be arranged;The order is read from standard input device
Instruction fetch, and deposited in crontab file, for reading and executing later).In general, the instruction quilt of crontab storage
Finger daemon activation, usually in running background, each minute checks whether there is scheduled operation and needs to be implemented, this kind of operation
Commonly referred to as cron jobs.
After restart platform, it is also necessary to initReboot module (be platform/system a starting it is initial
Change functional module), which can reset in the reboot process restarts script, prevents next cron timed task again
It is secondary by system reboot, cause to fall into and restart endless loop.There are many kinds of the implementations of the initReboot module, with
It for mockservice platform, is achieved in that, using the initial method in system starting process, increases function code
That deletes designated position restarts script;Certainly others implementation also may be implemented, for example after execution is restarted, be further added by one
Section deletes the logic for restarting script.
It, can automatic trigger general module duplication use after changing platform mock configuration file in the embodiment of the present application three
In the catalogue that the shell script for restarting platform is specified to cron job, can be detected according to the frequency of setting with this timed task
Whether shell script for restart platform there is under Zhi Ding catalogue, and the process if having through system level executes the use
In the shell script for restarting platform;After having executed and restarting, initReboot module is had by this and is used to restart platform
Shell script is deleted, and is fallen into avoid system and is restarted endless loop.Through the above steps with this, the automatic of reboot operation is realized
Change, whole process is not necessarily to the intervention of background maintenance personnel, in this way can be in time by the corresponding characteristic in system modification part or function
It is supplied to platform user, improves platform availability.
As shown in figure 4, the embodiment of the present invention four also proposed a kind of restarting equipment, comprising:
Judgment module 401, for judging whether platform needs to restart;
Restart module 402, for restarting the platform by non-application level process when the judging result, which is, is,
With the corresponding function in delivery system modification part;Wherein, the process that the non-application level process is run independently of the platform.
Wherein, as shown in figure 5, judgment module 402, can also include:
Identification module 4021, for identification state of reboot flag position;
Determining module 4022 is used to when recognition result be to determine that the platform is restarted when rebooting status;When
When recognition result is without rebooting status, determine that the platform does not need to be restarted.
Specifically, the identification module 4021, described specifically for being periodically detected by the non-application level process
The state of reboot flag position identifies the state of the reboot flag position;Or according to receiving the shape comprising the reboot flag position
State information identifies the state of the reboot flag position.
Judge whether platform needs to restart by restarting equipment in the embodiment of the present application two;When the judging result is yes
When, restarting equipment is by restarting the platform independently of the non-application level process that the platform is run with delivery system modification portion
Divide corresponding function, realize the automation of entire reboot operation, so that whole process is not necessarily to the intervention of background maintenance personnel, simultaneously
The corresponding characteristic in system modification part or function can be supplied to platform user in time, improve platform availability.
As shown in fig. 6, the embodiment of the present application five also proposed a kind of platform, including
Initial setup module 601 is without rebooting status for initial setting up reboot flag position;
Change module 602, for when the platform needs to restart, change the reboot flag position be to rebooting status,
So that restarting equipment, which restarts the platform by non-application level process, modifies the corresponding function in part come delivery system;
Wherein, the process that the non-application level process is run independently of the platform.
As shown in fig. 7, the platform can also include:
Sending module 603, for will include that the information of state of the reboot flag position is sent to the restarting equipment.
Wherein, the sending module 603, is specifically used for
It is when rebooting status is based on designated position is determined in the presence of script is restarted, more when changing the reboot flag position
It is described heavy to be sent to comprising designated position in the presence of the information for restarting script after rebooting status for changing the reboot flag position
Open equipment.
As shown in figure 8, the platform can also include:
Module 604 is reset, is described without weight for after completing to restart the platform, resetting the reboot flag position
Open state.
Wherein, the resetting module 604, specifically for being to be based on really to rebooting status when changing the reboot flag position to be
Designated position is determined in the presence of when restarting script, restarts script described in deletion.
In the embodiment of the present application five, it is without rebooting status, when platform needs are restarted that reboot flag position, which is arranged, in platform first
When, the state that can change reboot flag position is to rebooting status, so that restarting equipment was run independently of the platform
Non- application level process restarts the platform with the corresponding function in delivery system modification part, realizes the automatic of entire reboot operation
Change so that whole process is not necessarily to the intervention of background maintenance personnel, while can in time by the corresponding characteristic in system modification part or
Function is supplied to platform user, improves platform availability.
In order to further describe the present application, as shown in figure 9, the embodiment of the present application six additionally provides a kind of function hair
Distribution system, comprising: restarting equipment and platform, wherein
When system has a modification, such as configuration changes, and needs platform to be restarted, realizes that restarting for system could make
The corresponding function in system modification part or characteristic are published, for this purpose, reboot flag position is arranged in platform in the application, to identify
The state (whether needing to restart) of platform itself, the state of the reboot flag position can change because of the state change of platform itself,
Platform can will include that the information of the reboot flag position is sent to restarting equipment or restarting equipment or by non-application
Rank process (independently of the process of platform operation) is periodically detected the state of the reboot flag position, can also also have certainly very
Mostly come otherwise so that restarting equipment determines the state of the reboot flag position, it is determined whether the platform needs to carry out weight
It opens, when restarting equipment determines that the platform is restarted, it is flat that restarting equipment triggers execution by non-application level process
Platform is restarted, and the corresponding function in system modification part of making is published, and after restarting completion, platform can reset reboot flag
The state of position is to restart endless loop to avoid falling into without rebooting status.
Compared with prior art, in the embodiment of the present application six, it is without restarting shape that reboot flag position, which is arranged, in platform first
State, when platform needs to restart, the state that can change reboot flag position is to rebooting status, so that restarting equipment is independent
The platform is restarted with the corresponding function in delivery system modification part in the non-application level process of platform operation, is realized whole
The automation of a reboot operation, so that whole process is not necessarily to the intervention of background maintenance personnel, while can be in time by system modification portion
Divide corresponding characteristic or function to be supplied to platform user, improves platform availability.
It will be appreciated by those skilled in the art that the accompanying drawings are only schematic diagrams of a preferred implementation scenario, module in attached drawing or
Process is not necessarily implemented necessary to the application.
It will be appreciated by those skilled in the art that the module in device in implement scene can be described according to implement scene into
Row is distributed in the device of implement scene, can also be carried out corresponding change and is located at the one or more dresses for being different from this implement scene
In setting.The module of above-mentioned implement scene can be merged into a module, can also be further split into multiple submodule.
Above-mentioned the application serial number is for illustration only, does not represent the superiority and inferiority of implement scene.
Disclosed above is only several specific implementation scenes of the application, and still, the application is not limited to this, Ren Heben
What the technical staff in field can think variation should all fall into protection scope of the present invention.