A kind of Policy Table's searching algorithm that is adapted to safety and stability control device
Technical field
The invention belongs to the Power System and its Automation technical field, relate to a kind of Policy Table's searching algorithm that is adapted to safety and stability control device more precisely.
Background technology
Safety and stability control device is the visual plant that guarantees second and three lines of defence of power system safety and stability operation, adopts control strategy table mode to realize that the function of safety and stability control device is the most frequently used control model, and the control strategy tableau format is referring to Fig. 1.Total Policy Table is made up of several minutes Policy Table; Corresponding each method of operation (Yi) has a branch Policy Table (Ti); The branch Policy Table is divided into some by the fault element (L) of electrical network and the fault type (K) of this element; Each is divided into some shelves by the corresponding trend mode (∑ P) of this fault element again, in each grade, fills out the measure measure (Z) that should take through analytical calculation, i.e. Z=F (Y, L, K, ∑ P).
After safety and stability control device detects electrical network and breaks down, confirm the control measure that need take through the search strategy table, therefore, the efficient of searching algorithm has directly determined the control rate of safety and stability control device.
Traditional Policy Table's searching algorithm is to each tactful first cyclic search, and its algorithm can be stated as:
This shows, traditional Policy Table's searching algorithm, its time complexity is O (n
5), so had a strong impact on the control rate of safety and stability control device.
The document " a kind of new statement of power system stability control strategy table and storage mode " that is published on " relay " 2003 the 12nd phases discloses a kind of Policy Table's searching algorithm that is adapted to safety and stability control device that adopts tree construction storage control strategy table.This algorithm is decomposed into the Policy Table five kinds of elementary tactics elements such as the mode of connection, trend mode, failure message, protection action message and control strategy; Adopt logical expression to represent the relation between the policy elements, the control strategy table memory capacity that this method generated is little, highly versatile, be easy to revise.But this method adopts right preface traversal Policy Table to generate tree when the search strategy table; Its time complexity is O (n), and when Policy Table's data volume is quite big, strategy of each match query needs search again to generate to set; Especially when control strategy is terminal near right preface traverse tree, waste the plenty of time.
Summary of the invention
The objective of the invention is defective, a kind of Policy Table's searching algorithm that is adapted to safety and stability control device fast and effectively is provided, thereby improve the control rate of safety and stability control device to above-mentioned Policy Table's searching algorithm.
To achieve these goals, the present invention takes following technical scheme to realize, comprises the following steps:
1) Policy Table with safety and stability control device is divided into the method for operation, fault element, fault type, trend mode and five elementary tactics units of control measure; Adopt the tree construction mode to store and describe five elementary tactics units of Policy Table; This tree construction is made up of root node layer and five elementary tactics unit layers; Wherein five elementary tactics unit layers down are expressed as method of operation layer, fault element layer, fault type layer, trend mode layer, control measure layer respectively successively by the root node layer, strategy unit of every layer of correspondence.
2) the node weights of calculating in the tree construction of step 1 structure; Earlier each layer leaf node in the tree construction started from scratch to increase progressively successively by order from left to right and give initial weight; Give this father node by the maximum leaf node weights assignment of weights of the end in pushing up the leaf node set that will have common father node again, obtain cum rights value tree.
3) according to cum rights value tree structure hash function; Construct the four-tuple variable function earlier; Wherein the four-tuple variable is respectively the corresponding respectively leaf node weights of the method for operation, fault element, fault type, trend mode; The codomain of four-tuple variable function is the corresponding leaf node weights of control measure, respectively each paths in the cum rights value tree is expressed as a Function Mapping of this four-tuple variable function and generates mapping table then, at last according to mapping table structure hash function.
4) utilize the hash function Search Control strategy of constructing in the step 3,, from hash function, obtain corresponding control measures for the given method of operation, fault element, fault type, trend mode value.
The invention has the beneficial effects as follows: the present invention adopts the searching algorithm of structure hash function, and time complexity is O (1), can improve the efficient of search greatly, improves Policy Table's search speed, can improve the response speed of device, improves the control effect.Device memory can satisfy the requirement of this algorithm space complexity fully now, thereby makes the present invention have good practicability.
Description of drawings
Fig. 1 is the conventional form synoptic diagram of control strategy table.
Fig. 2 is a tree construction synoptic diagram of the present invention.
Fig. 3 is a cum rights value tree construction synoptic diagram of the present invention.
Fig. 4 is a particular flow sheet of the present invention.
Embodiment
With reference to the accompanying drawings and combine instance that the present invention is described in further detail.
Fig. 4 has provided particular flow sheet of the present invention; Wherein at first the Policy Table of safety and stability control device is divided into the method for operation, fault element, fault type, trend mode and five elementary tactics units of control measure; Adopt the tree construction mode to store and describe five elementary tactics units of Policy Table; This tree construction is made up of root node layer and five elementary tactics unit layers; Wherein five elementary tactics unit layers down are expressed as method of operation layer, fault element layer, fault type layer, trend mode layer, control measure layer respectively successively by the root node layer, strategy unit of every layer of correspondence.Then this Policy Table's tree construction five-layer structure can be expressed as L respectively
n(n ∈ [1,5]), as shown in Figure 2.
Then; Calculate the node weights in the tree construction of constructing; Earlier each layer leaf node in the tree construction started from scratch to increase progressively successively by order from left to right and give initial weight; Give this father node by the maximum leaf node weights assignment of weights of the end in pushing up the leaf node set that will have common father node again, obtain cum rights value tree.Then each node of this cum rights value tree can be expressed as L
nM (n ∈ [1,5], m=1,2,3 ..m representes the weights of node).
For example, the Policy Table of a stabilizing control system, specifically as shown in table 1, wherein m is that the method for operation, e are that fault element, f are that fault type, p are that trend mode, c are control measure:
Table 1
Then this Policy Table's cum rights value tree is as shown in Figure 3.
Then; According to cum rights value tree structure hash function, construct four-tuple variable function f earlier, wherein the four-tuple variable is respectively the corresponding respectively leaf node weights of method of operation x, fault element y, fault type z, trend mode k; The codomain of four-tuple variable function f is the corresponding leaf node weights of control measure c; Respectively each paths in the cum rights value tree is expressed as a Function Mapping of this four-tuple variable function and generates mapping table then, at last according to mapping table structure hash function f (x, y; Z, k)={ L
1X, L
2Y, L
3Z, L
4K, L
5C}, wherein x, y, z, k represent the weights variable, c representes codomain.When each variate-value is zero, represent that the corresponding strategy unit in this control strategy does not exist.
As, according to cum rights value shown in Figure 3 tree, can construct hash function f as shown in table 2 (x, y, z, mapping table k):
f(4,2,1,1) |
L
14
|
L
22
|
L
31
|
L
41
|
L
51
|
L
14L
22L
31L
41L
51
|
f(4,2,2,2) |
L
14
|
L
22
|
L
32
|
L
42
|
L
52
|
L
14L
22L
32L
42L
52
|
f(4,4,3,3) |
L
14
|
L
24
|
L
33
|
L
43
|
L
53
|
L
14L
24L
33L
43L
53
|
f(4,4,4,4) |
L
14
|
L
24
|
L
34
|
L
44
|
L
54
|
L
14L
24L
34L
44L
54
|
f(6,5,5,5) |
L
16
|
L
25
|
L
35
|
L
45
|
L
55
|
L
16L
25L
35L
45L
55
|
f(6,6,6,6) |
L
16
|
L
26
|
L
36
|
L
46
|
L
56
|
L
16L
26L
36L
46L
56
|
f(10,7,7,7) |
L
110
|
L
27
|
L
37
|
L
47
|
L
57
|
L
110L
27L
37L
47L
57
|
f(10,8,8,8) |
L
110
|
L
28
|
L
38
|
L
48
|
L
58
|
L
110L
28L
38L
48L
58
|
f(10,9,9,9) |
L
110
|
L
29
|
L
39
|
L
49
|
L
59
|
L
110L
29L
39L
49L
59
|
f(10,10,10,10) |
L
110
|
L
210
|
L
310
|
L
410
|
L
510
|
L
110L
210L
310L
410L
510
|
Table 2
At last, according to the hash function f (x, y, z, k) the Search Control strategy (L that construct
1X, L
2Y, L
3Z, L
4K, L
5C).When hash function f (x, y, z, k) in given x, y, z, the value of k draws corresponding control measures L immediately
5C, its time complexity is O (1).
For example, when providing (6,6,6,6), (z k), just can obtain corresponding control measure L at once for x, y according to the hash function f shown in the table 2
56, thus the control measure c6 in the corresponding table 1 obtained.
Though the present invention is with preferred embodiment openly as above, embodiment be not be used for limiting of the present invention.In spirit that does not break away from the present invention and scope, any equivalence of being done changes or retouching, belongs to the present invention's protection domain equally.Therefore protection scope of the present invention should be standard with the application's the content that claim was defined.