Scheduling disposal rule mining and generating method and system based on Apriori
Technical Field
The invention belongs to the technical field of power system automation, and particularly relates to a scheduling disposal rule mining and generating method and system based on Apriori.
Background
With the development of an extra-high voltage alternating current-direct current hybrid power grid and the large-scale new energy grid connection, the operation characteristics of the power grid are changed profoundly. In addition, natural disasters such as typhoons, ice, rainstorms and the like are frequent, the influence of external environment on the power grid is more prominent, the power grid is in a linkage, multiple and other complex fault forms, and the power grid scheduling operation control is increasingly complex. In the face of a large amount of operation data collected by a scheduling control system in a short time when a fault occurs, scheduling operators need to accurately judge the cause of the fault, master weak links and operation boundaries of a power grid, and take reasonable and effective fault handling measures. The dispatching control means based on operation experience and manual analysis is increasingly insufficient in the aspects of analysis and treatment of complex faults of the alternating current and direct current power grid.
The safe and reliable operation of the power system depends on an information-intensive and knowledge-intensive decision control center 'scheduling support system'. The system collects mass high-value data inside and outside the power grid, and scheduling and controlling are carried out by adopting a two-step scheduling decision mechanism of 'offline rule making' and 'online optimization calculation'. However, in the current scheduling support system, equipment monitoring and manual analysis are mainly used, scheduling personnel are still required to participate in decision and execution links, electronic modeling is realized through knowledge in a large number of text forms such as various scheduling operation rules, accident plans and safety control strategies, various heterogeneous data belong to different systems in the aspects of linkage, multiple fault study and judgment and emergency disposal, the scheduling personnel are difficult to capture key information in a short time, and the accuracy, timeliness and normalization of fault processing are difficult to guarantee.
In the patent document, "a power grid accident handling plan online generation and execution method and device" (CN112183834A), a power-losing electronic system is determined according to fault information, a complex circuit path is searched, all searched complex circuit paths are safely retrieved, and if at least one complex circuit path passing verification exists, an optimal path is selected according to a verification result; if the complex circuit path passing the verification does not exist, the complex circuit path is searched again according to the steps after partial load is cut off according to the general strategy, the safe retrieval and the verification are carried out, the optimal path is selected, and the plan is automatically executed. The method aims at recovering power supply for the power grid accident handling plan, and load shedding measures can be taken under necessary conditions, but the aim of power grid accident handling includes not only recovering power supply, but also isolating accidents to prevent accident expansion and propagation, and the measures which can be taken include unit output adjustment, grid structure adjustment and the like besides load shedding.
The power grid dispatching field knowledge of the patent document 'a power grid dispatching field knowledge attribute graph model construction method based on CYPHER' (CN112685608A) comes from publications such as 'electric power subject word list', 'power grid dispatching management regulations and implementation methods', 'national power grid dispatching control management regulations', and the like, but the power grid operation mode is complex and changeable, so that the situation that accident handling plan regulations cannot be covered is inevitable, and the power grid dispatching field knowledge attribute graph is not suitable any more.
Disclosure of Invention
The invention aims to overcome the defects in the prior art and provides a scheduling and handling rule mining and generating method and system based on Apriori, which utilize a big data mining technology to extract rules for supporting scheduling operation to form a scheduling and operating rule knowledge base suitable for different operation modes and fault scenes, and are used for simulating and replacing the brains of scheduling personnel to complete complex work such as fault location and reason analysis in a new scene, power grid operation risk discovery after fault, control measure identification, risk change prediction after measure implementation and the like.
Therefore, the invention adopts the following technical scheme: an Apriori-based scheduling handling rule mining and generating method comprises the following steps:
1) acquiring a dispatching and handling rule and mining a sample set, wherein information contained in each sample includes a power grid operation mode before and after a fault, a safety control and system protection device operation state, a power grid risk link after the fault and a handling measure after the fault;
2) determining a scheduling disposal rule by combining a correlation analysis method to mine key characteristic quantities of a sample set, wherein the key characteristic quantities comprise operation state quantities before a power grid fault, a quasi-steady state operation mode, a power grid safety risk link and fault disposal measures, and the power grid operation state quantities comprise section tide, node power, node voltage and steady state frequency;
3) extracting key characteristic quantities of a scheduling treatment rule mining sample set: all historical operation mode data of the power grid, fault information and corresponding quasi-steady state power grid operation mode data under each fault;
4) selecting any mode as a reference value for each fault, judging whether the key connecting line operation state, the section flow, the node power, the node voltage and the steady-state frequency of the fault are consistent with the existing classified reference modes or not for the subsequent to-be-clustered modes, if so, turning to the step 5), and if not, independently using the mode as a new reference mode;
5) judging whether the power grid risk links of the mode to be clustered are consistent with the control station, and if so, bringing the power grid risk links into the existing classified reference mode; otherwise, the method is independently used as a new reference mode until all the historical modes are clustered;
6) carrying out integer numbering on clustering mode clusters under the same fault, and using the integer numbers as cluster numbers of the clustering mode clusters under the fault;
7) recalculating the reference modes for all the mode clusters, calculating the Euclidean distance between each mode cluster and the center of the mode cluster, and taking the point with the minimum distance as a new reference mode of the mode cluster; if the reference mode of the mode cluster changes or the iteration times are reached, finishing clustering, otherwise, turning to the step 3);
8) acquiring an online operation mode, performing scene matching according to the key characteristic quantity of the power grid, if matching is successful, indicating that similar scenes exist in a historical database, solving the safety risk by using disposal measures, and issuing and executing the disposal measures after manual confirmation;
9) and for the scene with failed matching, mining the association rule of scheduling treatment based on an Apriori algorithm.
The invention relates to a dispatching disposal rule mining and generating method based on Apriori, which is used for mining dispatching accident disposal rules based on-line safety and stability analysis (DSA) and massive historical operation mode data accumulated by long-term periodic operation and analysis decision results. The method comprises the steps of analyzing and processing historical data based on regularity and repeatability of an actual power grid operation mode, clustering massive historical operation modes into a plurality of operation mode clusters according to key characteristic quantities, enabling sample data in the same operation mode cluster to have a relatively close operation mode, and enabling the sample data to have the same safety risk link and treatment measures under the same assessment fault. Through clustering the power grid operation modes, a typical power grid operation mode is extracted, and the completeness of safety and stability analysis and decision making of the power grid is improved. For scenes which do not appear in history, mining a power grid scheduling disposal association rule based on an Apriori algorithm, mining potential association relations between various information changes of a power grid and power grid risk links, between risk links and control measures and between control measures and margin change conditions after the measures are implemented from operation data, and solving the problem of disposal measure generation under the condition that scene matching is unsuccessful.
Further, the power grid quasi-steady-state mode of the power grid risk link after the fault in the step 1) is generated, the operation states of the safety control and system protection devices are taken into consideration, a current value strategy is identified, the quasi-steady-state operation mode after the fault is generated, transient time domain simulation is carried out based on the detailed model of the alternating current and direct current equipment, whether the system reaches the quasi-steady state or not is judged according to the node voltage fluctuation and frequency fluctuation conditions, and the steady-state operation mode is automatically generated according to the node injection quantity.
Further, in the step 9), mining is performed on the scheduling disposal association rule based on an Apriori algorithm, potential association relations between various information changes of the power grid and power grid risk links, between risk links and control measures, and between control measures and margin change conditions after the measures are implemented are mined from the operation data, the problem of disposal measure generation under the condition that scene matching is unsuccessful is solved, a strong association rule is selected by setting a minimum support degree and a minimum confidence degree, and the strength of the association rule is determined by the support degree and the confidence degree.
Further, the specific algorithms for support and confidence are as follows:
9-1) the probability of A and B occurring simultaneously can be defined as the support of A and B, and the expression is as follows:
in the above formula, sp (A) is the support; d is the total number of samples;
counting the support degree of the association rule between A and B;
9-2) the percentage of the sample that contains A and also B can be defined as the confidence, the expression is as follows:
in the above formula, the first and second carbon atoms are,
for confidence, count (A) is the number of A contained in the sample.
Further, in the step 9), mining is performed on the scheduling disposal association rule based on an Apriori algorithm, and by setting a rule mining antecedent and consequent constraint, the categories of frequent items are reduced, so as to generate an effective scheduling operation and disposal rule, with a service scenario as a guide.
The other technical scheme adopted by the invention is as follows: an Apriori based scheduling handling rule mining and generating system, comprising:
a mining sample set acquisition unit: acquiring a dispatching and handling rule and mining a sample set, wherein information contained in each sample includes a power grid operation mode before and after a fault, a safety control and system protection device operation state, a power grid risk link after the fault and a handling measure after the fault;
a key feature quantity mining unit: determining a scheduling disposal rule by combining a correlation analysis method to mine key characteristic quantities of a sample set, wherein the key characteristic quantities comprise operation state quantities before a power grid fault, a quasi-steady state operation mode, a power grid safety risk link and fault disposal measures, and the power grid operation state quantities comprise section tide, node power, node voltage and steady state frequency;
a key characteristic amount extraction unit: extracting key characteristic quantities of a dispatching and disposing rule mining sample set, wherein the key characteristic quantities comprise historical operation mode data and fault information of all power grids and corresponding quasi-steady-state power grid operation mode data under each fault;
a mode state judging and classifying unit: selecting any mode as a reference value for each fault, judging whether the key connecting line operation state, the section flow, the node power, the node voltage and the steady-state frequency of the fault are consistent with the existing classified reference mode or not for the subsequent mode to be clustered, if so, switching to a mode risk judging and classifying unit, otherwise, independently using the mode as a new type of reference mode;
a mode risk judging and classifying unit: judging whether the power grid risk links of the mode to be clustered are consistent with the control station, and if so, bringing the power grid risk links into the existing classified reference mode; otherwise, the method is independently used as a new reference mode until all the historical modes are clustered;
operation mode cluster numbering unit: carrying out integer numbering on clustering mode clusters under the same fault, and using the integer numbers as cluster numbers of the clustering mode clusters under the fault;
reference mode selection unit: recalculating the reference modes for all the mode clusters, calculating the Euclidean distance between each mode cluster and the center of the mode cluster, and taking the point with the minimum distance as a new reference mode of the mode cluster; if the reference mode of the mode cluster changes or the iteration times are reached, finishing clustering, otherwise, switching to a key characteristic quantity extraction unit;
a scene matching unit: acquiring an online operation mode, performing scene matching according to the key characteristic quantity of the power grid, if matching is successful, indicating that similar scenes exist in a historical database, solving the safety risk by using disposal measures, and issuing and executing the disposal measures after manual confirmation;
a scheduling handling association rule mining unit: and for the scene with failed matching, mining the association rule of scheduling treatment based on an Apriori algorithm.
The invention has the following beneficial effects:
compared with the prior art, the method carries out online completion and dynamic update on the knowledge graph based on the sensitivity information and the online decision information given by the online safety and stability analysis module, and solves the problems that the interpretability is not strong and all operation scenes are difficult to cover by only depending on a data driving mode and offline rules.
Drawings
FIG. 1 is a flow chart of the method of the present invention;
fig. 2 is a block diagram of the architecture of the system of the present invention.
Detailed Description
The invention is described in further detail below with reference to the following description and drawings.
Example 1
One embodiment of the present invention includes the steps shown in FIG. 1:
step 1 in fig. 1 describes that a scheduling and handling rule is obtained to mine a sample set, and information contained in each sample includes a power grid operation mode before and after a fault, a safety control and system protection device operation state, a power grid risk link after the fault, and a handling measure.
And generating a power grid quasi-steady state mode of the power grid risk link after the fault, considering the current value strategy identification of the running state of the safety control and system protection device, identifying and generating the quasi-steady state running mode after the fault, performing transient time domain simulation based on the detailed model of the AC/DC equipment, judging whether the system reaches the quasi-steady state according to the node voltage fluctuation and frequency fluctuation conditions, and automatically generating the steady state running mode according to the node injection quantity.
Step 2 in fig. 1 describes that the key feature quantities mined by determining the scheduling and handling rules by combining the correlation analysis method include operation state quantities before the power grid fault, quasi-steady-state operation modes, power grid safety risk links, fault handling measures and the like, and the power grid operation state quantities mainly include section flow, node power, node voltage, steady-state frequency and the like.
Step 3 in fig. 1 describes key feature quantities such as all power grid historical operation mode data and fault information of the scheduling and handling rule mining sample set, and quasi-steady-state power grid operation mode data corresponding to each fault.
Step 4 in fig. 1 describes that, for each fault, any one of the modes is selected as a reference value, and for the subsequent mode to be clustered, whether the operation state of the critical connecting line after the fault, the section flow, the node power, the node voltage, and the steady-state frequency of the fault are consistent with the reference modes of the existing classification is determined, if so, the step 5 is performed, otherwise, the method is independently used as a new reference mode.
Step 5 in fig. 1 describes that whether the power grid risk link of the to-be-clustered mode is consistent with the control station is judged, and if so, the power grid risk link is brought into the existing classified reference mode; otherwise, the method is independently used as a new reference mode until all the historical modes are clustered.
Step 6 in fig. 1 describes that the clustering method clusters under the same fault are numbered in integer as the cluster numbers of the historical clustering clusters under the fault.
Step 7 in fig. 1 describes that the reference method is recalculated for all the method clusters, each method cluster calculates the euclidean distance between the center of the method cluster and the all the methods, and the point with the minimum distance is used as the new reference method for the method cluster. If the reference mode of the mode cluster changes or the iteration times are reached, finishing clustering, otherwise, turning to the step 3.
Step 8 in fig. 1 describes that an online operation mode is obtained, scene matching is performed according to the key characteristic quantity of the power grid, if matching is successful, it is indicated that similar scenes exist in the historical database, the disposal measures can solve the security risk, and the disposal measures can be issued and executed after manual confirmation.
Step 9 in fig. 1 describes that for the matching failure scenario, the mining of the scheduling handling association rule is performed based on Apriori algorithm.
The scheduling disposal association rule mining based on the Apriori algorithm is used for mining potential association relations between various information changes of a power grid and power grid risk links, between risk links and control measures and between control measures and margin change conditions after the measures are implemented, solving the problem of disposal measure generation under the condition of scene matching failure, generally selecting a strong association rule by setting minimum support degree and minimum confidence degree, and determining the strength of the association rule according to the support degree and the confidence degree, wherein the specific algorithm of the support degree and the confidence degree is as follows:
9-1) the probability of A and B occurring simultaneously can be defined as the support of A and B, and the expression is as follows:
in the above formula, sp (A) is the support; d is the total number of samples;
the support of the association rule between a and B is counted.
9-2) the percentage of the sample that contains A and also B can be defined as the confidence, the expression is as follows:
in the above formula, the first and second carbon atoms are,
for confidence, count (A) is the number of A contained in the sample.
The dispatching disposal association rule mining based on the Apriori algorithm is conducted, a business scene is used as a guide, and the frequent item categories are reduced by setting the constraint of a front item and a back item of the rule mining, so that effective dispatching operation and disposal rules are generated.
Example 2
The present embodiment is a scheduling processing rule mining and generating system based on Apriori, and as shown in fig. 2, the system is composed of a mining sample set obtaining unit, a key feature quantity mining unit, a key feature quantity extracting unit, a mode state judging and classifying unit, a mode risk judging and classifying unit, an operation mode cluster numbering unit, a reference mode selecting unit, a scene matching unit, and a scheduling processing association rule mining unit.
A mining sample set acquisition unit: acquiring a dispatching and handling rule and mining a sample set, wherein information contained in each sample includes a power grid operation mode before and after a fault, a safety control and system protection device operation state, a power grid risk link after the fault and a handling measure after the fault;
a key feature quantity mining unit: determining a scheduling disposal rule by combining a correlation analysis method to mine key characteristic quantities of a sample set, wherein the key characteristic quantities comprise operation state quantities before a power grid fault, a quasi-steady state operation mode, a power grid safety risk link and fault disposal measures, and the power grid operation state quantities comprise section tide, node power, node voltage and steady state frequency;
a key characteristic amount extraction unit: extracting key characteristic quantities of a dispatching and disposing rule mining sample set, wherein the key characteristic quantities comprise historical operation mode data and fault information of all power grids and corresponding quasi-steady-state power grid operation mode data under each fault;
a mode state judging and classifying unit: selecting any mode as a reference value for each fault, judging whether the key connecting line operation state, the section flow, the node power, the node voltage and the steady-state frequency of the fault are consistent with the existing classified reference mode or not for the subsequent mode to be clustered, if so, switching to a mode risk judging and classifying unit, otherwise, independently using the mode as a new type of reference mode;
a mode risk judging and classifying unit: judging whether the power grid risk links of the mode to be clustered are consistent with the control station, and if so, bringing the power grid risk links into the existing classified reference mode; otherwise, the method is independently used as a new reference mode until all the historical modes are clustered;
operation mode cluster numbering unit: carrying out integer numbering on clustering mode clusters under the same fault, and using the integer numbers as cluster numbers of the clustering mode clusters under the fault;
reference mode selection unit: recalculating the reference modes for all the mode clusters, calculating the Euclidean distance between each mode cluster and the center of the mode cluster, and taking the point with the minimum distance as a new reference mode of the mode cluster; if the reference mode of the mode cluster changes or the iteration times are reached, finishing clustering, otherwise, switching to a key characteristic quantity extraction unit;
a scene matching unit: acquiring an online operation mode, performing scene matching according to the key characteristic quantity of the power grid, if matching is successful, indicating that similar scenes exist in a historical database, solving the safety risk by using disposal measures, and issuing and executing the disposal measures after manual confirmation;
a scheduling handling association rule mining unit: and for the scene with failed matching, mining the association rule of scheduling treatment based on an Apriori algorithm.
The method comprises the steps of mining a power grid quasi-steady state mode of a power grid risk link after a fault in a sample set acquisition unit, taking operation states of a safety control and system protection device into consideration, identifying a current value strategy, generating a quasi-steady state operation mode after the fault, carrying out transient time domain simulation based on a detailed model of alternating current and direct current equipment, judging whether a system reaches a quasi-steady state or not according to node voltage fluctuation and frequency fluctuation conditions, and automatically generating a steady state operation mode according to node injection quantity.
The scheduling disposal association rule mining unit performs scheduling disposal association rule mining based on an Apriori algorithm, potential association relations between various information changes of the power grid and power grid risk links, between the risk links and control measures and between the control measures and margin change conditions after the measures are implemented are mined from operation data, the problem of disposal measure generation under the condition that scene matching is unsuccessful is solved, a strong association rule is selected by setting minimum support and minimum confidence, and the strength of the association rule is determined by the support and the confidence.
The specific algorithm of the support degree and the confidence degree is as follows:
9-1) the probability of A and B occurring simultaneously can be defined as the support of A and B, and the expression is as follows:
in the above formula, sp (A) is the support; d is the total number of samples;
support count for association rule between A and B;
9-2) the percentage of the sample that contains A and also B can be defined as the confidence, the expression is as follows:
in the above formula, the first and second carbon atoms are,
for confidence, count (A) is the number of A contained in the sample.
The scheduling disposal association rule mining unit performs scheduling disposal association rule mining based on an Apriori algorithm, and reduces the categories of frequent items by setting rule mining antecedent and consequent constraints with the direction of a service scene, thereby generating effective scheduling operation and disposal rules.
Although the present invention has been described in terms of the preferred embodiment, it is not intended that the invention be limited to the embodiment. Any equivalent changes or modifications made without departing from the spirit and scope of the present invention also belong to the protection scope of the present invention. The scope of the invention should therefore be determined with reference to the appended claims.