Based on fast reliability Indices Statistics System and the method for cluster frameworks
Technical field
The present invention relates to a kind of fast reliability Indices Statistics System based on cluster frameworks and method, be mainly used in power information field.
Background technology
Along with the continuous expansion of electrical network scale, the basic data that electric reliability index (as power supply Middle Voltage reliability index, power transformating and supplying facility reliability index and power transmission and transformation system reliability index etc.) calculates also increases rapidly, the efficiency of electric reliability index calculate obviously declines, but the promptness of electric reliability index calculate requires and the efficiency requirements of business department to index calculate is more and more higher.The present situation of electric reliability index calculate efficiency more and more can not meet the demand of quick index calculate.
Because the basic data of reliability index statistics is increasing, the efficiency of single indicator-specific statistics reduces.During peak, the statistics task of big data quantity can cause the queuing of statistics task, and statistics task can not calculate index timely.
Reliability index statistics adopts layering and multiplexing method to be optimized system early stage, and layered approach precalculates out by base values, directly calls base values when overall target calculates.Multiplexing method is new reliability index statistics, if certain electric reliability index was added up, no longer adds up, direct multiplexing history index.But the basic data that the prerequisite of these two kinds of methods is indicator-specific statistics does not change, if basic data changes, base values will be no longer consistent with history index.The method that reliability index also adopts internal memory to calculate is optimized, and internal memory calculates and is cached in internal memory by basic data, by reducing the efficiency improving index calculate with the I/O of database alternately.Although said method statistical efficiency has had raising, but promptness and the reliability of indicator-specific statistics can not be met.
Summary of the invention
For solving deficiency of the prior art, the invention provides a kind of fast reliability Indices Statistics System based on cluster frameworks and method, solving electric reliability indicator-specific statistics computational efficiency low, the problem that concurrent processing task amount is few.
In order to realize above-mentioned target, the present invention adopts following technical scheme: a kind of fast reliability Indices Statistics System based on cluster frameworks, is characterized in that, the some nodes comprising host node and be connected with described master node network; Described host node and node comprise newly-increased statistics node serve module, statistical management service module and statistical fractals module; Statistical management service module on described host node obtains indicator-specific statistics task from indicator-specific statistics database, and described indicator-specific statistics task is distributed to the statistical fractals module of each node; The statistical fractals module of described node carries out indicator-specific statistics, and statistics is sent to indicator-specific statistics database; Described statistical management service module comprises node state management service and request scheduling management service; Described node state management service is for obtaining the state information of each node; Described request dispatching management service distributes described indicator-specific statistics task according to the state of each node to node; When described host node or node occur abnormal, the described request dispatching management service of new host node or host node is redistributed task; Described newly-increased statistics node serve module reactivates abnormal nodes or dynamically increases new node.
Aforesaid a kind of fast reliability Indices Statistics System based on cluster frameworks, is characterized in that: described node is computer, and described meshed network connects and composes cluster frameworks.
Aforesaid a kind of fast reliability Indices Statistics System based on cluster frameworks, is characterized in that: described indicator-specific statistics database comprises basic statistical data, statistics task table and statistics table.
Aforesaid a kind of fast reliability Indices Statistics System based on cluster frameworks, is characterized in that: described host node and node are determined according to service node deployment configuration file; Described service node deployment configuration file comprises as the weighted value of new host node, the IP address of service node and Preserved node IP address and weighted value thereof.
Based on the statistical method of the fast reliability Indices Statistics System based on cluster frameworks described in above-mentioned arbitrary claim, it is characterized in that, comprise step:
1) clustered deploy(ment) service node;
2) state of statistical management service module to each node is monitored in real time, and carries out statistics task distribution according to the state of each node; Statistical fractals module carries out indicator-specific statistics to the indicator-specific statistics task that statistics management module sends, and statistics is inserted in database;
3) when node occurs abnormal, the statistics task that anomaly statistics node does not complete is distributed by statistics management module again;
4) newly-increased statistics node serve module reactivates abnormal nodes or newly enables node.
A kind of aforesaid fast reliability indicator-specific statistics method based on cluster frameworks, it is characterized in that: clustered deploy(ment) service node in described step 1), step comprises:
(1a) number of required node is manually counted according to actual demand; All nodes are connected on network, statistical management service module, statistical fractals module and newly-increased statistics node serve module are disposed on all the nodes;
(1b) editing service node deployment configuration file, arranges the number of node, as the weighted value of new host node and the IP address of service node;
(1c) whether the configuration information of manual verification node is correct, whether can be communicated with indicator-specific statistics database, whether can be communicated with the node corresponding to IP address in configuration file; If correct, then start all services in the corresponding node of IP address, the node automatically selecting weight maximum according to the weight of configuration file interior joint is as host node; If incorrect, then carry out manual amendment; If certain nodal information is inaccurate, then can not start the service of this IP address corresponding node;
A kind of aforesaid fast reliability indicator-specific statistics method based on cluster frameworks, is characterized in that: described step 2), the state of statistical management service module to each node is monitored in real time, and carries out statistics task distribution according to the state of each node; Statistical fractals module carries out indicator-specific statistics to the indicator-specific statistics task that statistics management module sends, and statistics is inserted in database; Concrete steps comprise:
(2a) the statistical fractals module status information of each node is checked in the node state management service circulation in host node, if there is the statistical fractals module status of node normal and idle, request scheduling management service obtains statistics task from indicator-specific statistics database;
If (2b) get the statistics task of initial condition, node state management service checks the running status of each node statistics service module, and request scheduling management service is by the statistical fractals module distributing to each node of statistics task equilibrium; If do not have statistics task in task list, then service cycle obtains task from database;
(2c) the statistical fractals module of each node processes the statistics task distributed, and in change database, the computing mode of statistics task table corresponding record is " carrying out ";
(2d) statistical fractals module judges statistics task whether normal termination, if normal termination, then statistics is write in indicator-specific statistics database by statistical fractals module, and changes the computing mode of this statistics task table corresponding record for " calculating completes "; If the non-normal termination of statistics task, then the computing mode changing statistics task is "abnormal"; Craft is regular carries out analyzing and processing to abnormal task.
A kind of aforesaid fast reliability indicator-specific statistics method based on cluster frameworks, is characterized in that: described step 3), and when node occurs abnormal, the statistics task that anomaly statistics node does not complete is distributed by statistics management module again; Concrete steps comprise:
(3a) the node state management service in host node checks the statistical fractals module status information of each node, whether cycle criterion node there is exception, if node is abnormal, then judge whether abnormal nodes is host node, if host node, other nodes carry out host node by node state management service and again choose, and new host node obtains the statistics task state of former host node by node state management service, and the statistics task of abnormal nodes is re-started task matching as new task;
If not (3b) host node occurs abnormal, then host node obtains the statistics task state of abnormal nodes by node state management service, and the statistics task do not completed is re-started task matching as new task;
(3c) statistical fractals module judges statistics task whether normal termination, if the non-normal termination of statistics task, in indicator-specific statistics database, this statistics task computing mode is set to "abnormal", if statistics task normal termination, then statistics is stored in indicator-specific statistics database;
A kind of aforesaid fast reliability indicator-specific statistics method based on cluster frameworks, is characterized in that: in step 4), and described newly-increased statistics node serve module reactivates abnormal nodes or increases node newly, and step is:
1) newly-increased node: the configuration file of the newly-increased node of editor, the IP of its newly-increased service node is arranged to the IP address of Preserved node, start-up by hand new node service module, new node adds in system by newly-increased statistics node serve module, and new node and original node reselect new host node according to the weighted value of configuration;
2) abnormal nodes reactivates: manually restart self-braking abnormal nodes, and this node reactivates as new node by newly-increased statistics node serve module, and new node and original node reselect new host node according to the weighted value of configuration.
The beneficial effect that the present invention reaches: by clustered deploy(ment) service node; The state of statistical management service module to each node is monitored in real time, and carries out statistics task distribution according to the state of each node; Statistical fractals module carries out indicator-specific statistics to the indicator-specific statistics task that statistics management module sends, and statistics is inserted in database; When node occurs abnormal, the statistics task that anomaly statistics node does not complete is distributed by statistics management module again; Newly-increased statistics node serve module reactivates abnormal nodes or newly enables node.The present invention is based on cluster frameworks technology, add the quantity of concurrent processing statistics task, do not adopt base values data, improve the efficiency of indicator-specific statistics, realize the express statistic of quality of power supply reliability index.
Accompanying drawing explanation
Fig. 1 is the fast reliability Indices Statistics System schematic diagram based on cluster frameworks;
Fig. 2 disposes flow chart based on the fast reliability Indices Statistics System of cluster frameworks;
Fig. 3 is the fast reliability Indices Statistics System statistical method flow chart based on cluster frameworks;
Fig. 4 is the fast reliability Indices Statistics System abnormality processing flow chart based on cluster frameworks.
Embodiment
Below in conjunction with accompanying drawing, the invention will be further described.Following examples only for technical scheme of the present invention is clearly described, and can not limit the scope of the invention with this.
As shown in Figure 1, a kind of fast reliability Indices Statistics System based on cluster frameworks, is characterized in that, the some nodes comprising host node and be connected with described master node network; Described host node and node comprise newly-increased statistics node serve module, statistical management service module and statistical fractals module; Statistical management service module on described host node obtains indicator-specific statistics task from indicator-specific statistics database, and described indicator-specific statistics task is distributed to the statistical fractals module of each node; The statistical fractals module of described node carries out indicator-specific statistics, and statistics is sent to indicator-specific statistics database; Described statistical management service module comprises node state management service and request scheduling management service; Described node state management service is for obtaining the state information of each node; Described request dispatching management service distributes described indicator-specific statistics task according to the state of each node to node; When described host node or node occur abnormal, the described request dispatching management service of new host node or host node is redistributed task; Described newly-increased statistics node serve module reactivates abnormal nodes or dynamically increases new node.
Described node is computer, and described meshed network connects and composes cluster frameworks.
Described indicator-specific statistics database comprises basic statistical data, statistics task and statistics data.
Described host node and node are determined according to service node deployment configuration file; Described service node deployment configuration file comprises as the weighted value of new host node, the IP address of service node and Preserved node IP address and weighted value thereof.Wherein, Preserved node is used for newly-increased statistics node from now on.
According to the statistical method of the above-mentioned fast reliability Indices Statistics System based on cluster frameworks, comprise step:
1) clustered deploy(ment) service node;
2) state of statistical management service module to each node is monitored in real time, and carries out statistics task distribution according to the state of each node; Statistical fractals module carries out indicator-specific statistics to the indicator-specific statistics task that statistics management module sends, and statistics is inserted in database;
3) when node occurs abnormal, the statistics task that anomaly statistics node does not complete is distributed by statistics management module again;
4) newly-increased statistics node serve module reactivates abnormal nodes or newly enables node.Newly-increased statistics node serve module can increase node dynamically, and whole process can not affect the operation of whole service.
As shown in Figure 2, the system cluster deployment services node in the present invention, comprises the steps:
(1) number of required node is manually counted according to actual demand; All nodes are connected on network, statistical management service module, statistical fractals module and newly-increased statistics node serve module are disposed on all the nodes;
(2) editing service node deployment configuration file, arranges the number of node, as the weighted value of new host node and the IP address of service node;
(3) whether the configuration information of manual verification node is correct, whether can get database continuously, whether can be communicated with the node corresponding to IP address in configuration file; If correct, then start all services in the corresponding node of IP address, the node automatically selecting weight maximum according to the weight of configuration file interior joint is as host node; If incorrect, then modify; If certain nodal information is inaccurate, then can not start the service of this IP address corresponding node;
As shown in Figure 3, system statistics flow chart of the present invention, comprises the steps:
(1) the statistical fractals module status information of each node is checked in the node state management service circulation in host node, if there is the statistical fractals module status of node normal and idle, request scheduling management service obtains statistics task from indicator-specific statistics database;
(2) if get the statistics task of initial condition, node state management service checks the running status of each node statistics service module, and request scheduling management service is by the statistical fractals module distributing to each node of statistics task equilibrium; If do not have statistics task in task list, then service cycle obtains task from database;
(3) the statistical fractals module of each node processes the statistics task distributed, and in change database, the computing mode of statistics task table corresponding record is " carrying out ",
(4) statistical fractals judges statistics task whether normal termination, if normal termination, then statistics is write in indicator-specific statistics database by statistical fractals module, and changes the computing mode of statistics task table corresponding record in database for " calculating completes "; If the non-normal termination of statistics task, then the computing mode changing statistics task is "abnormal", and periodic manual carries out analyzing and processing to abnormal task.
As shown in Figure 4, be system exception process chart of the present invention, comprise the steps:
(1) the node state management service in host node checks the statistical fractals module status information of each node, whether cycle criterion node there is exception, if node is abnormal, then judge whether abnormal nodes is host node, if host node, other nodes carry out host node by node state management service and again choose, and new host node obtains the statistics task state of former host node by node state management service, and the statistics task of abnormal nodes is re-started task matching as new task;
(2) if not host node occurs abnormal, then host node obtains the statistics task state of abnormal nodes by node state management service, and the statistics task do not completed is re-started task matching as new task;
(3) statistical fractals judges statistics task whether normal termination, if the non-normal termination of statistics task, this statistics task computing mode is set to "abnormal", if statistics task normal termination, then statistics is stored in indicator-specific statistics database;
Described newly-increased statistics node serve module reactivates abnormal nodes or increases node newly, and step is:
1) configuration file of the newly-increased node of editor, the IP of its newly-increased service node is arranged to the IP address of Preserved node, start-up by hand new node service module, newly-increased statistics node serve module adds new node in system, and new node and original node reselect new host node according to the weighted value of configuration;
2) manually restart self-braking abnormal nodes, this node reactivates as new node by newly-increased statistics node serve module, and new node and original node reselect new host node according to the weighted value of configuration.
The present invention does not adopt base values data, calculates and has higher efficiency and stability, improve the efficiency of electric reliability indicator-specific statistics and the stability of statistics for jumbo indicator-specific statistics.
The above is only the preferred embodiment of the present invention; it should be pointed out that for those skilled in the art, under the prerequisite not departing from the technology of the present invention principle; can also make some improvement and distortion, these improve and distortion also should be considered as protection scope of the present invention.