Summary of the invention
The objective of the invention is to be directed against the problem that to unify high-efficiency management of the real time information that different hardware equipment provides in the photovoltaic plant, propose a kind of photovoltaic plant method for supervising of rule-based engine.
Technical scheme of the present invention is:
A kind of photovoltaic plant method for supervising of rule-based engine is characterized in that it may further comprise the steps:
(a), to make up initial monitor network be the Rete network, creates root node, Alpha node and Beta node, Alpha node and Beta node are initially the sky node;
Root node is empty node, is the inlet that each data enter into monitor network;
The Alpha node is used for writing down the promptly true tuple of forming of relevant parameter of each equipment of monitor network;
The Beta node is used for record rule, and rule is the tuple that is made up of a series of decision logic setup parameter promptly relevant with the relevant criterion of photovoltaic industry;
(b), inspection monitoring rule is whether the content of Beta node exists, if do not exist, then sets up the Beta node of a correspondence; If exist, then continue step c;
(c), the relevant parameter of each equipment in the monitor network that relates in the rule of inspection, if do not exist, the Alpha node of then setting up a plurality of correspondences is respectively applied for the relevant parameter of depositing each equipment; If exist, then continue step c;
(d), satisfied the demand of respective rule when the combination of Alpha node, in the time of can be with the Beta node matching, have mated successfully, repeating step c, all tuples in this rule all have the combination of corresponding Alpha node to mate with it;
(e), repeating step b-d, be the Beta node up to creating good all rules, create the Action node, be connected with all Beta nodes, as the output node of monitor network.
The relevant parameter of each equipment that Alpha node of the present invention is write down comprises the state relevant parameter of each inverter, the power supply status relevant parameter of each radiator group, the state relevant parameter of blower fan, state, circuit breaker air pressure, the position of circuit breaker change over switch and the state relevant parameter of oil pump of tap changer motor.
Each Alpha node of the present invention includes a plurality of facts, i.e. the voltage of monitored device, electric current or frequency, phase place, device temperature, pressure and gas density.
Among the step c of the present invention; If the Alpha node exists, the position of then writing down this Alpha node is not if exist; Then in network, create new Alpha node; Set up corresponding Alpha memory simultaneously, and in the Alpha memory, counter is set, in order to the true quantity that deposits in the record Alpha memory.
In the steps d of the present invention, after the Alpha node is set up and finished, to ascending rearrangement of true quantity of each Alpha node according to counter records in each Alpha memory; If in this time filtered, the fact that does not satisfy condition in certain Alpha memory then temporarily extracted this Alpha node; Residue Alpha node is labeled as after sorting: Alpha (1 '); Alpha (2 ') ..., Alpha (n ').
For example: rule is to judge the state of radiator, and Beta node the inside is that the tuple that [solar radiation angle, certain electric current, certain voltage, certain resistance] constitutes is formed.And these parameters suppose to have 3 from different hardware devices, so just have three different Alpha nodes and Beta node corresponding.Wherein there is and has only a node (being assumed to be the Alpha1 node) that two parameters are arranged, be assumed to be [solar radiation angle, certain electric current].In coupling,, just to mate the fact in the Alpha1 node earlier, because the true quantity that the Alpha1 node is comprised under this rule is maximum through ordering to the Alpha node.In case, just need not mate two other Alpha node again with the coupling failure of Alpha1 node.
Create the Beta node in the steps d of the present invention; Couple together relevant Alpha node and Beta node then; As input; If Beta node needs >=fact of 2 Alpha nodes, just create the fact that a Beta1 node comprises preceding two Alpha nodes earlier, Alpha1 node and Alpha2 node are respectively as the left and right input of Beta1 node; With of the left side input of Beta1 node, with of the right side input of Alpha3 node as Beta2 as the Beta2 node; With the left side input of Beta2 node as the Beta3 node, the Alpha4 node is as the right side input of Beta3 node, by that analogy then.
Beneficial effect of the present invention:
In the real-time monitoring of photovoltaic plant, because watch-dog quantity is many, it is huge to detect data, need obtain useful conclusion through Treatment Analysis from various data.The application rule engine can address this problem well in supervisory control system.The key of regulation engine is matching technique.What use among the present invention is a kind of Rete matching technique of having improved; Set up a network configuration that is formed by rule condition, become the network of an effective filtering data, the true parameter that the fact enters into the root node of tree passes to rule; And along the tree structure transmit downwards; Just continue down to transmit if matched corresponding condition, filter layer by layer through this up to the incoming terminal leafy node, far away more from root node; Data matching is just few more, so just can filter out the fact that meets rule condition.
In conjunction with the actual conditions of photovoltaic plant information classification treatment system, the present invention improves aspect following two the matching way of Rete algorithm:
1. because in the matching process of Rete network; If any one in Alpha memory and the Beta memory is empty; The null link operation will be occurred,, then more null link can be caused downwards if the matching result of sky is continued to propagate along the Rete network; Along with the increase of null link number, the efficient of matching algorithm will be affected.Need be like a rule about the information of electric current, but the information of electric current has but been formed the Alpha node of a sky, and in the Rete network, participated in the process of coupling, and will produce a large amount of skies and connect, cause space waste.In the middle of the photovoltaic plant specification processing system, the data volume of various information is bigger, and the flow process that carry out statistical disposition is also more; Comprising various photovoltaic data are generated hour, day, month, season, year data produce; In enquiry of historical data or other operations, because the time span of data product is bigger, the judgement to the year node in the condition of rule often is false; Will make corresponding Alpha memory for empty so; Null link will appear in this moment, if follow-up have the operations such as historical data fusion of the data product in pair year will cause a series of null link operation, thus the efficient of influence coupling.
To this situation, when judgement year node, if time span is not enough; The Alpha memory is empty; We just break off the binding of corresponding AlphaNode and Beta memory, and when the Beta memory was non-NULL, relevant binding operation just null link can not occur like this; Span had satisfied at that time, and for example annual January 1, the Alpha memory was a non-NULL by idle running then to December 31, and at this moment we just link this AlphaNode and Beta memory again, accomplish corresponding data processing.
2. in the process of coupling; Putting in order of pattern in fact also has the influence of any to the efficient of coupling; Unreasonable if put in order; Just might make that the true quantity that contains in corresponding Alpha memory and the Beta memory is very big, at this moment will consume the binding that great amount of time and internal memory carry out the contained fact in two memories and operate, thereby reduce the efficient of mating.In the process that the photovoltaic plant information data is handled; The data volume of information is bigger; The Rule of judgment of rule is the comparison of logarithm value mostly; So satisfying the true quantity of certain rule condition maybe be bigger, if will contain the advanced joining line operation of these true Alpha memories, then above-mentioned problem can appear.
So here, we consider when depositing the fact in the Alpha memory; Adding is to the statistics of true quantity; If the rule constrain condition of pattern is many more, the true quantity that then satisfies this pattern is just few more, and the true quantity that deposits in the Alpha memory is also just few more; In follow-up binding operation, the Alpha memory that just will contain true negligible amounts preferentially links operation so.In the monitoring of actual light overhead utility; For example a rule is made up of certain electric current, certain voltage, certain solar radiation angle; In case but electric current surpasses 100A, other parameters are the operations what state all will be correlated with, then in matching process; Should mate with current value earlier, to reach maximum matching efficiency.
Following rule is for example arranged:
(P?rule?1
(context?phase?1)…(a)
(large <x>)…(b)
(middle <x>)…(c)
(small <x>)…(d)
(make...))
After containing true how much adjusting, rule is changed into:
(P?rule?1
(context?phase?1)…(a)
(small <x>)…(d)
(middle <x>)…(c)
(large <x>)…(b)
(make...))
This conversion can be carried out visual representation with Fig. 3.
The present invention is quoting the engine rule aspect the monitoring of photovoltaic plant; Aspect pattern matching, used improved Rete matching technique; Solve the null link operational issue in the former Rete network well, reduced the waste in space, when handling mass data, can save the space; Simultaneously, owing to added statistics, the fact has been carried out sequence arrangement made the efficient of coupling be improved true quantity.When the processing photovoltaic plant detects data in a large number, improved real-time, portability and the treatment effeciency of supervisory control system.
Embodiment
Below in conjunction with accompanying drawing and embodiment the present invention is further described.
In the real-time monitoring of photovoltaic plant, because watch-dog quantity is many, it is huge to detect data, need obtain useful conclusion through Treatment Analysis from various data.The application rule engine can address this problem well in supervisory control system.The key of regulation engine is matching technique.What use among the present invention is a kind of Rete matching technique of having improved.
In the present invention, set up a network configuration that forms by rule condition, become the network of an effective filtering data; The true parameter that the fact enters into the root node of tree passes to rule, and transmits downwards along the structure of tree, just continues down to transmit up to the incoming terminal leafy node if matched corresponding condition; Filter layer by layer through this; Far away more from root node, data matching is just few more, so just can filter out the fact that meets rule condition.
In the Rete photovoltaic plant monitor network structure of our structure, 4 kinds of base node: RootNode are arranged, 1-input (AlphaNode), 2-input (BetaNode) and Action node.Wherein RootNode is a virtual node, and it is the inlet that all data objects get into the Rete network; AlphaNode is in order to assess the constraints of the single fact; BetaNode is in order to assess one group of true constraints; BetaNode has two inputs and a plurality of output; Its two inputs be otherwise known as LeftInput (left side input) and RightInput (the right input); LeftInput is the combination of a data object normally, and RightInput is the individual data object.The Action node representes that all conditions of rule has all mated success.
In the photovoltaic plant monitoring of reality, root node is an empty node, is the inlet that each data enter into network; The fact promptly is the tuple that the detected data of each inverter are formed, and comprises the data that voltage, electric current, frequency etc. monitor in the tuple; Rule is the tuple that the relevant criterion by a series of decision logic and some photovoltaic industries constitutes.For example, if the radiator group that needs to judge photovoltaic plant operate as normal whether, possible demand is to judge whether the radiator group needs emergency maintenance, and whether time that at present can continuous firing is above 8 hours etc.Each bar demand corresponding a rule, in the Rete network, be a Betanode.Radiator group 1 has been formed N Alpha node to equipment facts such as power supply status, fan condition and oil pump state separately such as radiator group N, is comprising plurality of data (like electric current and voltage etc.) in each node.When corresponding demand has been satisfied in the combination of these alpha nodes, in the time of can be with the Beta node matching, mate successfully, withdraw from the Rete network.When demand changes, (add the radiator group in addition or judge that true standard changes) like needs; Service logic also needs to change; This time, we were as long as add or the corresponding rule of modification; And need not revise the code of monitoring program in large area, successfully separated service logic and business datum.
During practical implementation:
A kind of photovoltaic plant method for supervising of rule-based engine has used improved Rete technology in matching module, Rete network matching structure and object lesson see also Fig. 1 and Fig. 2.When handling a large amount of photovoltaic plant monitor datas, the rule base good according to prior formulation (being user's request), mate according to following steps:
1. create RootNode;
2. inspection article one is regular:
(1) first pattern of extracting rule condition is checked the parameter type in the pattern, if the type node exists, then continues next type of inspection; If do not exist, then add new type node;
(2) judge whether the AlphaNode corresponding with pattern sets up; If set up, then write down the position of this AlphaNode, if do not set up; Then in network, create new AlphaNode; Set up corresponding Alpha memory simultaneously, and in the Alpha memory, counter is set, in order to the true quantity that deposits in the record Alpha memory;
(3) repeat (2), all patterns in rule condition all have corresponding AlphaNode;
(4) after AlphaNode sets up and finishes, to ascending rearrangement of true quantity of AlphaNode, if in this time filtered according to counter records in each Alpha memory; The fact that does not satisfy condition in certain Alpha memory; Then this AlphaNode is temporarily extracted, residue AlphaNode is labeled as after sorting: Alpha (1 '), Alpha (2 ');, Alpha (n ');
(5) create BetaNode, BetaNode is begun by Beta (2):
The LeftInput of Beta (2) is Alpha (1 '), and RightInput is Alpha (2 ');
The LeftInput of Beta (i) is Beta (i-1), and RightInput is Alpha (i '), wherein i>2;
(6) repeat (5), up to creating good all BetaNode;
(7) be that the action part of rule is created the Action node, and as the output node of Beta (n);
3. repeat 2, up to handling strictly all rules.
The present invention does not relate to all identical with the prior art prior art that maybe can adopt of part and realizes.