Interpretation method and system for power system state prediction model

The power system state prediction model is explained through SHAP tools and random forest algorithms, which solves the problem of insufficient interpretability of the model, reveals the contribution of features to the results and generates control strategies, ensuring the safety and stability of the power grid and improving the credibility of the model. degree and transparency.

CN118607645APending Publication Date: 2024-09-06GUIZHOU POWER GRID CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410520678.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-28
Publication Date
2024-09-06

AI Technical Summary

Technical Problem

When applying artificial intelligence solutions to existing power system state prediction models, there is a problem of insufficient model interpretability, making it difficult to understand the model's decision-making process and prediction results.

Method used

The SHAP tool is combined with the random forest algorithm to construct a power system state prediction model, obtain characteristic data of historical operating data, train the model and interpret it, calculate SHAP values, conduct global and local interpretations, and generate control strategies to improve the interpretability of the model.

Benefits of technology

Through the use of the SHAP tool, the contribution of each feature to the prediction results is revealed, diversified control strategies are generated, ensuring the safety and stability of the power grid operation, and improving the credibility and transparency of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118607645A
    Figure CN118607645A
Patent Text Reader

Abstract

The invention discloses an interpretation method and system for a power system state prediction model, and relates to the technical field of power grids, and the method comprises the steps: obtaining a test sample, and constructing the power system state prediction model; inputting the test sample into the power system state prediction model, and outputting a prediction value of the power system state prediction model; and explaining the power system state prediction model by using an SHAP tool in combination with the test samples and the prediction values corresponding to the test samples. According to the method, the power system state prediction model is constructed by using historical data, and various states of the power system are accurately predicted; and explanation is carried out through an SHAP tool, so that the problem of poor explanation is solved, contribution of each feature to a result is disclosed, diversified control strategies are generated, and safe and stable operation of a power grid is guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of power grids, and in particular to an interpretation method and system for a power system state prediction model. Background Art

[0002] Traditional grid state prediction schemes rely on simulation methods based on physical mechanism modeling. However, with the continuous development of new power systems, the randomness and complexity of power systems are also increasing, and traditional methods can no longer meet the needs.

[0003] In this context, data-driven artificial intelligence solutions have attracted much attention. These solutions can achieve intelligent prediction of power system status through offline training and online end-to-end application. However, when applying artificial intelligence solutions (such as neural network models) to power system status prediction, there is currently a challenge, that is, the model's interpretability is insufficient. This problem urgently needs to be solved. Summary of the invention

[0004] In view of the problem that the existing power system state prediction scheme has a weak model interpretability, the present invention is proposed.

[0005] Therefore, the problem to be solved by the present invention is how to improve the interpretability of the artificial intelligence model in power system state prediction so as to better understand the decision-making process and prediction results of the model.

[0006] In order to solve the above technical problems, the present invention provides the following technical solutions:

[0007] In the first aspect, an embodiment of the present invention provides an interpretation method for a power system state prediction model, which includes obtaining a test sample and constructing a power system state prediction model; inputting the test sample into the power system state prediction model and outputting a prediction value of the power system state prediction model; using the SHAP tool to interpret the power system state prediction model in combination with the test sample and the prediction value corresponding to the test sample.

[0008] As a preferred solution of the interpretation method for the power system state prediction model described in the present invention, the construction of the power system state prediction model includes the following steps: collecting historical operation data from the power system for preprocessing; wherein the historical operation data includes voltage, current, power and frequency data; extracting feature data of the preprocessed historical operation data by the wrapping method, and constructing the power system state prediction model; wherein the feature data includes the voltage amplitude and voltage phase angle of the bus; using the feature data as training samples, and training the power system state prediction model by the random forest algorithm; wherein the training samples include the feature data; interpreting the trained power system state prediction model and calculating the SHAP value; the power system state prediction model is used to predict the state of the power system; wherein the state includes a safe state, a warning state, a stable state and an unstable state.

[0009] As a preferred solution of the interpretation method for the power system state prediction model described in the present invention, the interpretation includes the following steps: creating a tree interpreter TreeExplainer in SHAP, and interpreting the power system state prediction model through the SHAP tool; wherein the interpretation includes a global interpretation and a local interpretation; for the global interpretation, the absolute value of the average SHAP value of each feature is calculated as the feature importance, and a scatter plot of the overall feature density is drawn according to the SHAP value and the feature value of each feature; the SHAP value of each feature under different feature values ​​is calculated, a global feature SHAP scatter plot and a multi-sample feature influence diagram are drawn, and the feature The impact of the value on the SHAP value, and sort the samples according to specific standards; the global explanation is to sort the importance of the associated features of all test samples, analyze the correlation between the feature input and the predicted value, and analyze the key features that are most important for state prediction among all features; for local explanation, by calculating the SHAP value of each feature data in each test sample, and drawing a single sample feature influence diagram in combination with the base value, the influence of each feature data on the prediction result is displayed; wherein, the base value is the mean of the predicted values ​​output by the power system state prediction model for the test samples; according to the interpretation results, the influence of each feature data on the power system state prediction model is obtained, and a control strategy is generated.

[0010] As a preferred solution of the interpretation method for the power system state prediction model described in the present invention, wherein: the degree of influence includes positive influence and negative influence; the degree of influence includes the following steps: counting the number of positive and negative SHAP values ​​of each feature, and calculating the average of the positive and negative values ​​in the SHAP value as the positive influence score and the negative influence score of this feature; for features with higher influence scores, comparing the positive and negative influence scores; if the positive influence score is greater than the negative influence score, the high value of this feature has a positive promoting effect on the prediction result of the power system state prediction model; if the negative influence score is greater than the positive influence score, the high value of this feature has a negative impact on the prediction result of the power system state prediction model, and by adjusting the parameter value range of the power system state prediction model, the impact on the prediction result is reduced; according to the influence degree of the feature, balance the influence of each feature and generate a control strategy.

[0011] As a preferred solution of the interpretation method for the power system state prediction model described in the present invention, wherein: the global interpretation includes a first global feature and a second global feature; the drawing of the global feature SHAP scatter plot includes the following steps: calculating the SHAP values ​​corresponding to Angle_C at different Angle_C values ​​for all test samples according to the first global feature, and drawing the global feature SHAP scatter plot of Angle_C; drawing the global feature SHAP scatter plot of Angle_C according to the first global feature, and drawing the global feature SHAP value scatter plot under the influence of the second global feature.

[0012] As a preferred solution of the interpretation method for the power system state prediction model described in the present invention, the generation of the control strategy includes the following steps: obtaining the absolute values ​​of the SHAP values ​​of the Angle_C, Voltage_C and Angle_B features, and judging whether the absolute value of the SHAP value of Angle_C is greater than zero; when the absolute value of the SHAP value of Angle_C is greater than zero, this feature has a positive effect on the predicted stable state; if the absolute value of the SHAP value of Voltage_C is greater than zero at the same time, it indicates that this feature has a positive effect on the predicted stable state; if the absolute value of the SHAP value of Angle_B tends to zero, a first control strategy is generated; the first control strategy includes : Maintain Angle_C and Voltage_C in the current predicted stable state, and increase the Angle_B value to enhance system stability; if the absolute value of the SHAP value of Angle_B is greater than zero, generate the second control strategy: the second control strategy includes: maintaining Angle_C, Voltage_C and Angle_B in the current predicted stable state; if the absolute value of the SHAP value of Angle_B is less than zero, generate the third control strategy: the third control strategy includes: immediately cutting off the relevant lines of bus B to prevent system instability, and arrange maintenance; if the absolute value of the SHAP value of Voltage_C is less than zero at the same time, ignore the impact of Voltage_C.

[0013] As a preferred solution of the interpretation method for the power system state prediction model described in the present invention, it also includes: when the absolute value of the SHAP value of Angle_C is less than zero, it indicates that Angle_C has a negative impact on the predicted stable state; if the absolute value of the SHAP value of Voltage_A is greater than zero at the same time, a fourth control strategy is generated; the fourth control strategy includes: lowering the Angle_C value to maintain the current predicted stable state of Voltage_A to reduce the risk of system instability; if the absolute value of the SHAP value of Voltage_A is less than zero at the same time, then Ignore the influence of Voltage_A; if the absolute value of the SHAP value of other features is less than zero, generate the fifth control strategy; the fifth control strategy includes: immediately cutting off the relevant lines and equipment, isolating the fault area, preventing the spread of system instability, arranging maintenance, confirming the root cause of the fault, and optimizing the parameters of the power system state prediction model; wherein Angle_B is the voltage phase angle characteristic of bus B, Angle_C is the voltage phase angle characteristic of bus C, Voltage_B is the voltage amplitude characteristic of bus B, and Voltage_C is the voltage amplitude characteristic of bus C.

[0014] In the second aspect, an embodiment of the present invention provides an interpretation system for a power system state prediction model, which includes: a test sample acquisition module, used to obtain test samples and construct a power system state prediction model; a prediction value acquisition module, used to input the test sample into the power system state prediction model, and output the prediction value of the power system state prediction model; a power system state prediction model interpretation module, used to use the SHAP tool, combined with the test sample and the prediction value corresponding to the test sample, to interpret the power system state prediction model.

[0015] In a third aspect, an embodiment of the present invention provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: when the computer program instructions are executed by the processor, the steps of the interpretation method for the power system state prediction model as described in the first aspect of the present invention are implemented.

[0016] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program instructions are executed by a processor, the steps of the method for interpreting the power system state prediction model as described in the first aspect of the present invention are implemented.

[0017] The beneficial effects of the present invention are as follows: the present invention constructs a power system state prediction model by utilizing historical data to accurately predict various states of the power system; interprets it through the SHAP tool, thereby solving the problem of poor interpretability, revealing the contribution of each feature to the result, and generating diversified control strategies to ensure the safe and stable operation of the power grid. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Among them:

[0019] Figure 1 This is a flow chart of the method for interpreting the power system state prediction model in Example 1.

[0020] Figure 2 This is a schematic diagram of the overall feature importance SHAP value diagram of the interpretation method for the power system state prediction model in Example 1.

[0021] Figure 3 This is a schematic diagram of an overall feature density scatter plot of the interpretation method for the power system state prediction model in Example 1.

[0022] Figure 4This is a schematic diagram of a scatter plot of global feature SHAP values ​​of the interpretation method for the power system state prediction model in Example 1.

[0023] Figure 5 Example 1 is a schematic diagram of a multi-sample feature influence diagram of an interpretation method for a power system state prediction model.

[0024] Figure 6 Embodiment 2 is a schematic diagram of a first single sample feature influence diagram of an interpretation method for a power system state prediction model.

[0025] Figure 7 Embodiment 2 is a schematic diagram of a second single sample feature influence diagram of an interpretation method for a power system state prediction model. DETAILED DESCRIPTION

[0026] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the accompanying drawings.

[0027] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.

[0028] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive with other embodiments.

[0029] Example 1

[0030] Reference Figure 1 to Figure 5 , which is the first embodiment of the present invention, and provides an interpretation method for a power system state prediction model, comprising:

[0031] S1: Obtain test samples and build a power system state prediction model.

[0032] Specifically, constructing a power system state prediction model includes the following steps: collecting historical operation data from the power system for preprocessing; wherein the historical operation data includes voltage, current, power and frequency data; extracting feature data of the preprocessed historical operation data by a wrapping method, and constructing a power system state prediction model; wherein the feature data includes the voltage amplitude and voltage phase angle of the bus; using the feature data as training samples, and training the power system state prediction model by a random forest algorithm; wherein the training samples include the feature data; interpreting the trained power system state prediction model and calculating the SHAP value; the power system state prediction model is used to predict the state of the power system; wherein the state includes a safe state, a warning state, a stable state and an unstable state.

[0033] Furthermore, in the prediction of power system status, the safe state means that the power system operates within a normal and stable range, all components and parameters are at a safe level, there are no abnormal conditions or potential risks, and the power supply continuity and stability are maintained. The alert state means that there are some potential problems or abnormal conditions in the power system, which need to alert the operators.

[0034] Furthermore, a stable state means that the power system maintains balance under various external and internal influences, all components and parameters are in a stable state, the system operates within the normal working range, there is no serious fluctuation or instability, and the user needs are continuously met. An unstable state means that the power system is seriously unstable, and various parts of the system may be out of control or disorder, resulting in unstable operation or even collapse of the system. In this state, the system cannot provide normal power supply, there are serious safety hazards, and emergency measures need to be taken immediately to restore the stability and normal operation of the system.

[0035] S2: Input the test sample into the power system state prediction model and output the prediction value of the power system state prediction model.

[0036] S3: Use the SHAP tool to interpret the power system state prediction model by combining the test samples and the predicted values ​​corresponding to the test samples respectively.

[0037] Specifically, the explanation includes the following steps: creating a tree interpreter TreeExplainer in SHAP, and using the SHAP tool to explain the power system state prediction model; wherein, the explanation includes global explanation and local explanation; for the global explanation, the absolute value of the average SHAP value of each feature is calculated as the feature importance, and the overall feature density scatter plot is drawn according to the SHAP value and feature value of each feature; the SHAP value of each feature under different feature values ​​is calculated, a global feature SHAP scatter plot and a multi-sample feature influence diagram are drawn, the influence of the feature value on the SHAP value is analyzed, and the samples are sorted according to specific standards; the global explanation is to sort the importance of the associated features of all test samples, analyze the correlation between the feature input and the predicted value, and analyze the most important key features for state prediction among all features; for the local explanation, the SHAP value of each feature data in each test sample is calculated, and a single sample feature influence diagram is drawn in combination with the base value to show the influence of each feature data on the prediction result; wherein, the base value is the mean of the predicted values ​​output by the power system state prediction model for the test samples; according to the explanation result, the influence of each feature data on the power system state prediction model is obtained, and a control strategy is generated.

[0038] Further, such as Figure 2 As shown in the SHAP value diagram of overall feature importance, the SHAP feature importance is measured by the average SHAP value absolute value. It can be clearly seen which features are the most important in the entire test set. Features Angle_C and Angle_B have the greatest impact on the model.

[0039] Furthermore, if Figure 3 As shown in the figure, in the overall feature density scatter plot, each row represents a feature, the horizontal axis is the SHAP value, a point in the figure represents a sample, and the color level indicates the level of the feature value (dark color is high, light color is low). For example, the feature Voltage_C-3 has a large feature value (dark color), a positive SHAP value, and a positive impact on the prediction of a stable state. Angel_C and Angle_B have small feature values ​​(light color), and a positive SHAP value, which has a positive impact on the prediction of stability.

[0040] It should be noted that the global interpretation includes the first global feature and the second global feature; drawing the global feature SHAP scatter plot includes the following steps: calculating the SHAP values ​​corresponding to Angle_C at different Angle_C values ​​for all test samples according to the first global feature, and drawing the global feature SHAP scatter plot of Angle_C; drawing the global feature SHAP scatter plot of Angle_C according to the first global feature, and drawing the global feature SHAP value scatter plot under the influence of the second global feature, so as to achieve the global interpretation of the power system state prediction model.

[0041] Specifically, the global feature SHAP value scatter plot is the SHAP value of the feature under the feature value corresponding to this feature, which is used to reflect the influence of the feature value on the feature SHAP value. Figure 4 As shown, Figure 4 The left side is the scatter plot of the global feature SHAP value of Angle_C. It can be seen that when the feature value is greater than 2, the SHAP value is less than 0, which has a negative impact on the prediction stability. When the feature value is less than 2, the SHAP value is greater than 0, which has a positive impact on the prediction stability. Figure 4 On the right is a scatter plot of the global feature SHAP value of Angle_C under the influence of the feature Voltage_C. It can be seen that when the Angle_C feature value is greater than 2, Voltage_C is larger (darker), and the SHAP value of Angle_C is less than 0, which has a negative impact on the stability of the predicted value.

[0042] It should be noted that the global feature SHAP value scatter plot shows the result of sorting at least part of the test samples according to the first selected indicator on the horizontal axis, and shows the indicator values ​​of at least part of the test samples under the second selected indicator on the vertical axis, so as to obtain a multi-sample feature influence diagram to achieve a global interpretation of the power system state prediction model.

[0043] Furthermore, the degree of influence includes positive influence and negative influence; the degree of influence includes the following steps: counting the number of positive and negative SHAP values ​​of each feature, and calculating the average of the positive and negative values ​​in the SHAP value as the positive influence score and the negative influence score of this feature; for features with higher influence scores, comparing the positive and negative influence scores; if the positive influence score is greater than the negative influence score, the high value of this feature has a positive promoting effect on the prediction results of the power system state prediction model; if the negative influence score is greater than the positive influence score, the high value of this feature has a negative impact on the prediction results of the power system state prediction model, and by adjusting the value range of the power system state prediction model parameters, the impact on the prediction results is reduced; according to the degree of influence of the feature, the influence of each feature is balanced to generate a control strategy.

[0044] Furthermore, generating a control strategy includes the following steps: obtaining the absolute values ​​of the SHAP values ​​of the Angle_C, Voltage_C, and Angle_B features, and determining whether the absolute value of the SHAP value of Angle_C is greater than zero; when the absolute value of the SHAP value of Angle_C is greater than zero, this feature has a positive effect on the predicted stable state; if the absolute value of the SHAP value of Voltage_C is greater than zero at the same time, it indicates that this feature has a positive effect on the predicted stable state; if the absolute value of the SHAP value of Angle_B tends to zero, then generating a first control strategy; the first control strategy includes: maintaining Angle_C and Voltage When age_C is in the current predicted stable state, the Angle_B value is increased to enhance the system stability; if the absolute value of the SHAP value of Angle_B is greater than zero, the second control strategy is generated: the second control strategy includes: maintaining Angle_C, Voltage_C and Angle_B in the current predicted stable state; if the absolute value of the SHAP value of Angle_B is less than zero, the third control strategy is generated: the third control strategy includes: immediately cutting off the relevant lines of bus B to prevent system instability and arranging maintenance; if the absolute value of the SHAP value of Voltage_C is less than zero at the same time, the influence of Voltage_C is ignored.

[0045] Specifically, when the absolute value of the SHAP value of Angle_C is less than zero, it indicates that Angle_C has a negative impact on the predicted stable state; if the absolute value of the SHAP value of Voltage_A is greater than zero at the same time, the fourth control strategy is generated; the fourth control strategy includes: lowering the Angle_C value to maintain the current predicted stable state of Voltage_A to reduce the risk of system instability; if the absolute value of the SHAP value of Voltage_A is less than zero at the same time, the influence of Voltage_A is ignored; if the absolute value of the SHAP value of other characteristics is less than zero, the fifth control strategy is generated; the fifth control strategy includes: immediately cutting off related lines and equipment, isolating the fault area, preventing the spread of system instability, arranging maintenance, confirming the root cause of the fault, and optimizing the parameters of the power system state prediction model; wherein, Angle_B is the voltage phase angle characteristic of bus B, Angle_C is the voltage phase angle characteristic of bus C, Voltage_B is the voltage amplitude characteristic of bus B, and Voltage_C is the voltage amplitude characteristic of bus C.

[0046] Furthermore, the present embodiment also provides an interpretation system for the power system state prediction model, including: a test sample acquisition module, used to obtain test samples and construct a power system state prediction model; a prediction value acquisition module, used to input the test sample into the power system state prediction model and output the prediction value of the power system state prediction model; a power system state prediction model interpretation module, used to use the SHAP tool, combined with the test sample and the prediction value corresponding to the test sample, to interpret the power system state prediction model.

[0047] This embodiment also provides a computer device, which is suitable for the case of an interpretation method for a power system state prediction model, including a memory and a processor; the memory is used to store computer executable instructions, and the processor is used to execute computer executable instructions to implement the interpretation method for a power system state prediction model as proposed in the above embodiment.

[0048] The computer device may be a terminal, and the computer device includes a processor, a memory, a communication interface, a display screen and an input device connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device may be a touch layer covering the display screen, or a key, trackball or touchpad provided on the housing of the computer device, or an external keyboard, touchpad or mouse, etc.

[0049] This embodiment also provides a storage medium having a computer program stored thereon, which implements the following steps when executed by a processor: obtaining a test sample and constructing a power system state prediction model; inputting the test sample into the power system state prediction model and outputting a predicted value of the power system state prediction model; and using the SHAP tool to interpret the power system state prediction model in combination with the test sample and the predicted value corresponding to the test sample.

[0050] In summary, the present invention constructs a power system state prediction model by utilizing historical data to accurately predict various states of the power system; interprets it through the SHAP tool to solve the problem of poor model interpretability, reveals the contribution of each feature to the result, and generates diversified control strategies to ensure the safe and stable operation of the power grid, so that users can understand the decision-making process of the model, thereby improving the credibility and transparency of the model.

[0051] Example 2

[0052] Reference Figure 6-7 , which is the second embodiment of the present invention, provides an interpretation method for a power system state prediction model. In order to verify the beneficial effects of the present invention, scientific demonstration is carried out through economic benefit calculation and simulation experiments.

[0053] Specifically, a test set of 6000 samples is prepared, each sample contains 24 features, representing the voltage amplitude and voltage phase angle features of 12 buses. Specifically, every two features form a group, representing the voltage amplitude and voltage phase angle of bus C, bus A, bus 1, bus 3, bus B, bus 2, bus A-bus 2, bus 2-bus C, bus 1-bus B, bus C-bus 3, bus B-bus 3, bus 1-bus A. The label is 0 or 1, 0 represents instability and 1 represents stability.

[0054] Furthermore, the historical operation data of the 6,000 samples collected were first preprocessed, and then the feature data, mainly including the voltage amplitude and voltage phase angle of the busbar, were extracted using the wrapping method. These feature data were used as training samples and trained by the random forest algorithm. At the same time, the model parameters and optimization algorithm were adjusted to ensure good prediction performance on the training set. After the training was completed, the SHAP tool was used for interpretation to calculate the SHAP value of each feature, aiming to understand the degree of influence of each feature on the prediction results. The global interpretation part includes calculating the average SHAP absolute value of the feature, drawing the overall feature density scatter plot and the global feature SHAP scatter plot, and analyzing the influence of the feature value on the SHAP value and sorting the samples, so as to find the most important key features for model prediction. The local interpretation calculates the SHAP value of the feature data for each test sample, and draws the single sample feature influence diagram in combination with the base value to show the degree of influence of each feature data on the prediction result. Through this process, the specific degree of influence of each feature on the model prediction can be accurately evaluated.

[0055] Furthermore, the single sample feature influence diagram can be understood as a graph representing the contribution of the features in the sample to be tested to the predicted value of the sample to be tested. Figure 6 As shown in the figure, it represents how each feature pushes the predicted value from the base value to f(x) (the final output value), indicating the contribution of each feature. The right side indicates a positive push to the predicted value; the left side indicates a negative push to the predicted value. The size of each feature block indicates the size of the SHAP value. Among them, basevalue refers to the mean of the predicted values ​​of the model for all samples in the training set.

[0056] Furthermore, Figure 7As shown in the figure, the Y axis represents different feature values, the X axis represents the SHAP value, E[f(x)] represents the expectation of all samples f(x), and the average value of the predicted value of model.predict(X). The value of f(x) is the predicted value of the 199th sample. Through the single sample feature influence diagram, we can intuitively see the degree of influence of each feature on the predicted value.

[0057] Specifically, as shown in Table 1, the test data table analyzes the interpretation results of the power system state prediction model. From the perspective of feature importance, the three features Angle_C, Voltage_C and Angle_B have the most significant impact on the model prediction results, and their average SHAP absolute values ​​are 0.267, 0.231 and 0.185, respectively, which are much higher than other features. This means that the voltage phase angle of bus C, the voltage amplitude of bus C and the voltage phase angle of bus B are the three most critical factors affecting the power system state prediction.

[0058] Table 1 Test data table

[0059] feature Angle_C Voltage_C Angle_B, Voltage_B Angle_A Feature importance ranking (average |SHAP| value) 0.267 0.231 0.185 0.112 0.089 Robustness score (positive impact score) 0.514 0.397 0.023 0.211 0.178 Vulnerability score (negative impact score) 0.020 -0.065 -0.047 -0.013 -0.010 Actual value 0 1 0 1 0 Predicted value 0.032 0.982 0.017 0.971 0.018

[0060] Further, by analyzing the robustness score and vulnerability score, it can be seen that the positive impact scores of the two features Angle_C and Voltage_C are as high as 0.514 and 0.397, respectively, while the negative impact scores are very low, only 0.020 and -0.065. This shows that when the values ​​of Angle_C and Voltage_C are high, it will significantly promote the improvement of power system stability. The situation of Angle_B is the opposite. Its negative impact score of 0.047 is higher than the positive impact score of 0.023, indicating that the high value of Angle_B may cause system instability.

[0061] Furthermore, the comparison between the actual value and the predicted value shows that in most cases, the predicted value of the power system state prediction model is basically consistent with the actual value, such as the second and fourth rows. This fully proves the prediction ability of the model. In some cases, such as the first and third rows, there is a certain difference between the predicted value of the model and the actual value, but the prediction error is within a controllable range.

[0062] In summary, the interpretation of the power system state prediction model through the SHAP tool not only reveals the inherent operating mechanism of the model and discovers the most critical features that affect the prediction, but also can specifically evaluate the specific impact of each feature on the prediction results, thus laying the foundation for formulating control strategies.

[0063] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.

Claims

1. An interpretation method for power system state prediction model, Features: include, Obtain test samples and build a power system state prediction model; Inputting the test sample into the power system state prediction model, and outputting the prediction value of the power system state prediction model; The SHAP tool is used to interpret the power system state prediction model by combining the test samples and the predicted values ​​corresponding to the test samples respectively.

2. The method for interpreting a power system state prediction model according to claim 1, Features: The construction of the power system state prediction model comprises the following steps: Collecting historical operation data from the power system for preprocessing; wherein the historical operation data includes data on voltage, current, power and frequency; Extracting characteristic data of pre-processed historical operation data by the wrapping method, and constructing a power system state prediction model; wherein the characteristic data includes the voltage amplitude and voltage phase angle of the bus; The characteristic data is used as a training sample, and a power system state prediction model is trained by a random forest algorithm; wherein the training sample includes the characteristic data; Explain the trained power system state prediction model and calculate the SHAP value; The power system state prediction model is used to predict the state of the power system; wherein the state includes a safe state, a warning state, a stable state and an unstable state.

3. The method for interpreting the power system state prediction model according to claim 2, Features: The explanation comprises the following steps: A tree interpreter TreeExplainer is created in SHAP, and the power system state prediction model is interpreted by the SHAP tool; wherein the interpretation includes a global interpretation and a local interpretation; For global explanation, the absolute value of the average SHAP value of each feature is calculated as the feature importance, and a scatter plot of the overall feature density is drawn based on the SHAP value and feature value of each feature; Calculate the SHAP value of each feature at different feature values, draw the global feature SHAP scatter plot and multi-sample feature influence diagram, analyze the impact of feature values ​​on SHAP value, and sort samples according to specific standards; The global explanation is to sort the importance of all test sample related features, analyze the correlation between feature input and predicted value, and analyze the most important key features for state prediction among all features; For local explanation, the SHAP value of each feature data in each test sample is calculated, and a single sample feature influence diagram is drawn in combination with the base value to show the influence of each feature data on the prediction result; wherein the base value is the mean of the prediction values ​​output by the power system state prediction model for the test samples respectively; According to the interpretation results, the influence degree of each characteristic data on the power system state prediction model is obtained, and the control strategy is generated.

4. The method for interpreting a power system state prediction model according to claim 3, Features: The impact degree includes positive impact and negative impact; the impact degree includes the following steps: The number of positive and negative SHAP values ​​of each feature is counted, and the average of the positive and negative SHAP values ​​is calculated as the positive influence score and negative influence score of this feature. For features with high impact scores, compare the positive and negative impact scores; If the positive impact score is greater than the negative impact score, the high value of this feature will have a positive effect on the prediction results of the power system state prediction model; If the negative impact score is greater than the positive impact score, the high value of this feature has a negative impact on the prediction results of the power system state prediction model, and the impact on the prediction results can be reduced by adjusting the value range of the power system state prediction model parameters; According to the degree of influence of the features, the influence of each feature is balanced and a control strategy is generated.

5. The method for interpreting the power system state prediction model according to claim 3, Features: The global interpretation includes a first global feature and a second global feature; and drawing a global feature SHAP scatter plot includes the following steps: According to the first global feature, the SHAP values ​​corresponding to Angle_C at different Angle_C values ​​are calculated for all test samples, and a global feature SHAP scatter plot of Angle_C is drawn; A global feature SHAP scatter plot of Angle_C is drawn based on the first global feature, and a global feature SHAP value scatter plot under the influence of the second global feature is drawn.

6. The method for interpreting a power system state prediction model according to claim 4, Features: The generation control strategy comprises the following steps: Get the absolute values ​​of the SHAP values ​​of the Angle_C, Voltage_C, and Angle_B features, and determine whether the absolute value of the SHAP value of Angle_C is greater than zero; When the absolute value of the SHAP value of Angle_C is greater than zero, this feature has a positive impact on predicting the stable state; If at the same time the absolute value of the SHAP value of Voltage_C is greater than zero, it indicates that this feature has a positive impact on the prediction of the steady state; If the absolute value of the SHAP value of Angle_B approaches zero, the first control strategy is generated; The first control strategy includes: maintaining Angle_C and Voltage_C at the current predicted stable state, and increasing the Angle_B value to enhance system stability; If the absolute value of the SHAP value of Angle_B is greater than zero, the second control strategy is generated: The second control strategy includes: maintaining Angle_C, Voltage_C and Angle_B at the current predicted stable state; If the absolute value of the SHAP value of Angle_B is less than zero, the third control strategy is generated: The third control strategy includes: immediately cutting off the relevant lines of busbar B to prevent system instability and arranging maintenance; If the absolute value of the SHAP value of Voltage_C is less than zero at the same time, the influence of Voltage_C is ignored.

7. The method for interpreting a power system state prediction model according to claim 6, Features: Also includes, When the absolute value of the SHAP value of Angle_C is less than zero, it indicates that Angle_C has a negative impact on the predicted stable state; If at the same time the absolute value of the SHAP value of Voltage_A is greater than zero, the fourth control strategy is generated; The fourth control strategy includes: lowering the Angle_C value to maintain the current predicted stable state of Voltage_A to reduce the risk of system instability; If the absolute value of the SHAP value of Voltage_A is less than zero at the same time, the influence of Voltage_A is ignored; If there are other features whose SHAP values ​​are less than zero in absolute value, a fifth control strategy is generated; The fifth control strategy includes: immediately cutting off the relevant lines and equipment, isolating the fault area, preventing the spread of system instability, arranging maintenance, confirming the root cause of the fault, and optimizing the parameters of the power system state prediction model; Among them, Angle_B is the voltage phase angle characteristic of bus B, Angle_C is the voltage phase angle characteristic of bus C, Voltage_B is the voltage amplitude characteristic of bus B, and Voltage_C is the voltage amplitude characteristic of bus C.

8. An interpretation system for a power system state prediction model, based on the interpretation method for a power system state prediction model according to any one of claims 1 to 7, Features: include, A test sample acquisition module is used to acquire test samples and build a power system state prediction model; A prediction value obtaining module is used to input the test sample into the power system state prediction model and output the prediction value of the power system state prediction model; The power system state prediction model interpretation module is used to interpret the power system state prediction model by using the SHAP tool, combining the test samples and the prediction values ​​corresponding to the test samples.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program. Features: When the processor executes the computer program, the steps of the method for interpreting the power system state prediction model described in any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, Features: When the computer program is executed by a processor, the steps of the method for interpreting a power system state prediction model according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Multi-layer scheduling method based on power system active correction intelligent model

    CN117013547A

  • Computer system

    US20240046124A1