Microgrid energy decision interpretation method and device based on artificial intelligence and medium
By generating decision snapshots and quantifying contribution explanations, the problem of decision-making uninterpretability in microgrid scheduling schemes is solved, improving the credibility and interpretability of scheduling decisions and reducing operation and maintenance costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-12
- Publication Date
- 2026-04-10
AI Technical Summary
Existing microgrid scheduling schemes based on deep reinforcement learning suffer from a lack of interpretability in the decision-making process. Schedulers cannot clearly understand the quantitative impact of each input feature on the scheduling results, leading to insufficient trust and difficulty in tracing the root cause of the problem.
By acquiring the data required for microgrid scheduling decisions, generating decision snapshots, determining the quantitative contribution of input feature data to the target scheduling instructions, and interpreting based on the quantitative contribution, the decision snapshot mechanism is used to capture key states within the model, and asynchronous interpretation calculations are performed to improve interpretability.
It solves the black box problem of deep learning models, improves the credibility and acceptability of AI scheduling decisions, provides accurate basis for tracing the source of scheduling result deviations and optimizing model parameters, and reduces operation and maintenance costs.
Smart Images

Figure CN121840567A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence, and particularly provides a micro-grid energy decision explanation method based on artificial intelligence, a device and a medium. BACKGROUND
[0002] With the large-scale access of distributed energy and energy storage systems, the complexity of the operation and dispatch of microgrids as the core unit of energy autonomy and efficient utilization has been significantly improved. As the core of dispatching decisions, the microgrid energy management system needs to accurately coordinate the dynamic matching of power output, energy storage charging and discharging, and load demand. At present, artificial intelligence technology, especially deep reinforcement learning (DRL) models, has become a key direction for the intelligent upgrading of microgrid energy management systems. Deep reinforcement learning models can autonomously learn dispatching strategies through massive operation data, effectively dealing with complex scenarios such as distributed power output fluctuations and load random changes. However, the existing microgrid dispatching scheme based on deep reinforcement learning has the following technical defects: the deep reinforcement learning model is essentially a black box structure, and its dispatching instruction generation relies on complex internal parameter operations and state transitions, and the decision-making process lacks explainability. Dispatch personnel cannot clearly quantify the influence of each input feature on the dispatching result, leading to insufficient trust in artificial intelligence decisions and difficulty in directly adopting them in critical conditions; at the same time, when the dispatching result deviates, it is difficult to quickly locate the root cause of the problem. SUMMARY
[0003] In order to overcome the above-mentioned defects, the present application is proposed to solve or at least partially solve the technical problem of the lack of explainability of the decision-making of the deep learning model in the existing microgrid energy management system. The present application provides a micro-grid energy decision explanation method based on artificial intelligence, a device and a medium.
[0004] In a first aspect, the present application provides a micro-grid energy decision explanation method based on artificial intelligence, which comprises:
[0005] obtaining data required for microgrid dispatching decisions;
[0006] generating target dispatching instructions and decision snapshots based on the data required for microgrid dispatching decisions and decision models, wherein the decision snapshots include input feature data for generating the target dispatching instructions and internal key states of the decision models;
[0007] determining the quantitative contribution of the input feature data to the target dispatching instructions based on the decision snapshots;
[0008] interpreting the target dispatching instructions based on the quantitative contribution.
[0009] In an embodiment of the microgrid energy decision explanation method based on artificial intelligence, the data required for the microgrid scheduling decision includes real-time operation data of the microgrid and prediction data of a future preset time period; the data required for the microgrid scheduling decision is obtained, including:
[0010] The collected real-time operation data of the microgrid is obtained.
[0011] The prediction data of the future preset time period is predicted based on the real-time operation data of the microgrid.
[0012] In an embodiment of the microgrid energy decision explanation method based on artificial intelligence, the generation of a decision snapshot based on the data required for the microgrid scheduling decision and a decision model includes:
[0013] When the decision model outputs the target scheduling instruction based on the data required for the microgrid scheduling decision, the input feature data on which the target scheduling instruction is generated is extracted, wherein the input feature data is high-dimensional data processed by the decision model on the data required for the microgrid scheduling decision;
[0014] The internal key state of the decision model is extracted.
[0015] The input feature data and the internal key state of the decision model are packaged and assigned with an identifier corresponding to the target scheduling instruction to form the decision snapshot.
[0016] In an embodiment of the microgrid energy decision explanation method based on artificial intelligence, the determination of the quantitative contribution degree of the input feature data to the target scheduling instruction based on the decision snapshot includes:
[0017] The decision snapshot is analyzed to extract the input feature data and the internal key state of the decision model from the decision snapshot;
[0018] An optimization background data set is obtained, which is a cluster center set generated based on clustering of historical operation data of the microgrid;
[0019] The quantitative contribution degree of the input feature data to the target scheduling instruction is determined based on the input feature data, the internal key state, and the optimization background data set.
[0020] In an embodiment of the microgrid energy decision explanation method based on artificial intelligence, the determination of the quantitative contribution degree of the input feature data to the target scheduling instruction based on the input feature data, the internal key state, and the optimization background data set includes:
[0021] The internal key state is taken as an initialization parameter of an explanation model, and state resetting is performed on the explanation model;
[0022] A feature subset is determined based on features of corresponding dimensions in the input feature data;
[0023] Mask values are determined based on clustering center data of corresponding dimensions in the optimization background data set;
[0024] Based on the initialized explanation model, the feature subset, and the mask values, an explanation model output value corresponding to the feature subset is calculated;
[0025] Based on the explanation model output value, the quantitative contribution of each dimension feature in the input feature data to the target scheduling instruction is determined.
[0026] In an embodiment of the microgrid energy decision explanation method based on artificial intelligence, the target scheduling instruction is explained based on the quantitative contribution, including:
[0027] A set of quantitative contributions of each dimension feature is obtained;
[0028] A preset semantic conversion rule library is called to convert the quantitative contribution of each feature into natural language text;
[0029] The target scheduling instruction is explained based on the natural language text.
[0030] In an embodiment of the microgrid energy decision explanation method based on artificial intelligence, the step of determining the quantitative contribution of the input feature data to the target scheduling instruction based on the decision snapshot is executed asynchronously through an independent thread.
[0031] In a specific embodiment of the microgrid energy decision explanation method based on artificial intelligence, the prediction data for the future preset time period is predicted based on the real-time operation data of the microgrid, including:
[0032] Feature data is obtained based on the real-time operation data of the microgrid;
[0033] Time sequence features are extracted from the feature data;
[0034] The time sequence features are fused with external features at future time points to obtain fused feature data;
[0035] The prediction data for the future preset time period is generated based on the fused feature data, wherein the prediction data for the future preset time period includes at least one of load prediction information and photovoltaic power prediction information of the microgrid in the future preset time period.
[0036] In a second aspect, a computer device is provided, comprising:
[0037] at least one processor;
[0038] and a memory connected in communication with the at least one processor;
[0039] wherein the memory has stored therein a computer program, which, when executed by the at least one processor, implements the aforementioned AI-based microgrid energy decision interpretation method.
[0040] In a third aspect, a computer-readable storage medium is provided, which has stored therein a plurality of program codes adapted to be loaded and run by a processor to implement the aforementioned AI-based microgrid energy decision interpretation method.
[0041] The one or more technical solutions of the present application have at least one or more of the following beneficial effects:
[0042] The AI-based microgrid energy decision interpretation method in the present application comprises: obtaining data required for microgrid dispatching decision; generating target dispatching instruction and decision snapshot based on the data required for microgrid dispatching decision and decision model, wherein the decision snapshot comprises input feature data for generating the target dispatching instruction and internal key state of the decision model; determining quantitative contribution degree of the input feature data to the target dispatching instruction based on the decision snapshot; and interpreting the target dispatching instruction based on the quantitative contribution degree. Not only does it solve the black box problem of deep learning model, but also makes the dispatching personnel clearly know the specific influence of each feature on the dispatching decision, greatly improving the credibility and acceptability of artificial intelligence dispatching decision; at the same time, the quantitative contribution degree provides accurate basis for dispatching result deviation tracing and model parameter optimization, and reduces the model operation and maintenance cost. BRIEF DESCRIPTION OF DRAWINGS
[0043] The disclosure of the present application will become more apparent with reference to the drawings. It is easily understood by those skilled in the art that the drawings are only for illustrative purposes, and are not intended to limit the scope of protection of the present application. In addition, similar numbers in the figures are used to represent similar components, wherein:
[0044] Figure 1 is the main flowchart of the AI-based microgrid energy decision interpretation method in one embodiment of the present application;
[0045] Figure 2 is the main structure diagram of the microgrid energy management system in one embodiment of the present application;
[0046] Figure 3 is the main structure diagram of the user interface in one embodiment of the present application;
[0047] Figure 4 is a complete flowchart of the instruction interpretation of the micro-grid energy management system in an embodiment of the present application;
[0048] Figure 5 is a main structure diagram of a computer device in an embodiment of the present application. DETAILED DESCRIPTION
[0049] Some embodiments of the present application will be described below with reference to the accompanying drawings. Those skilled in the art will understand that these embodiments are only used to explain the technical principles of the present application, and are not intended to limit the protection scope of the present application.
[0050] In the description of the present application, "module" and "processor" can include hardware, software or a combination of both. A module can include hardware circuitry, various suitable sensors, communication ports, memories, and can also include a software part such as program code, and can be a combination of software and hardware. The processor can be a central processor, a microprocessor, a graphic processor, a digital signal processor or any other suitable processor. The processor has data and / or signal processing functions. The processor can be implemented in software, hardware or a combination of both. The non-transitory computer readable storage medium includes any suitable medium that can store program code, such as a magnetic disk, a hard disk, an optical disk, a flash memory, a read-only memory, a random access memory, etc. The term "A and / or B" means all possible combinations of A and B, such as only A, only B or both A and B. The term "at least one of A or B" or "at least one of A and B" has a similar meaning as "A and / or B", and can include only A, only B or both A and B. The singular form of the term "one", "this" can also include the plural form.
[0051] In the current traditional micro-grid scheduling scheme based on deep reinforcement learning, the deep reinforcement learning model is essentially a black box structure, and the generation of scheduling instructions depends on complex parameter operations and state transitions inside, and the decision-making process lacks interpretability.
[0052] Therefore, the present application proposes a micro-grid energy decision interpretation method, device and medium based on artificial intelligence.
[0053] Referring to the accompanying drawings Figure 1 , Figure 1 is a main step flowchart of a micro-grid energy decision interpretation method based on artificial intelligence according to an embodiment of the present application.
[0054] As shown in Figure 1 , the micro-grid energy decision interpretation method based on artificial intelligence in the embodiment of the present application mainly includes the following steps S10-S40.
[0055] Step S10: Obtain data required for microgrid scheduling decision.
[0056] The data required for microgrid scheduling decision refers to the full amount of data required for microgrid scheduling decision, which can include real-time operation data of the microgrid and prediction data for a future preset time period.
[0057] Step S20: Generate target scheduling instruction and decision snapshot based on the data required for microgrid scheduling decision and decision model, wherein the decision snapshot includes input feature data for generating the target scheduling instruction and internal key state of the decision model.
[0058] The decision model is an intelligent model for microgrid scheduling decision, usually a deep reinforcement learning model, which can autonomously learn the target scheduling strategy based on input data and output the target scheduling instruction adapted to the current working condition.
[0059] The target scheduling instruction is generated by the decision model based on the real-time operation state of the microgrid and the future prediction data, and can realize the scheduling instruction of dynamic matching of energy storage charging and discharging and load demand.
[0060] The decision snapshot is a data package corresponding to the target scheduling instruction only, which contains the input feature data and the internal key state of the decision model for generating the instruction, and is used to reproduce the decision process.
[0061] The input feature data is high-dimensional data formed after preprocessing and feature engineering of the data required for microgrid scheduling decision, which covers various key factors affecting scheduling decision, such as photovoltaic power, load, electricity price, state of charge of energy storage, etc.
[0062] The internal key state of the decision model is the core running state of the decision model at the moment of generating the scheduling instruction, which encapsulates the compressed memory of the decision model on the historical time series data of the microgrid, and is the key to reproduce the decision context.
[0063] Step S30: Determine the quantitative contribution degree of the input feature data to the target scheduling instruction based on the decision snapshot.
[0064] The quantitative contribution degree is the quantitative value of the influence degree of each dimension feature in the input feature data on the target scheduling instruction, which indicates the influence direction and the influence size.
[0065] Step S40: Interpret the target scheduling instruction based on the quantitative contribution degree.
[0066] Based on the above steps S10-S40, first, the data required for microgrid scheduling decision is obtained; based on the data required for microgrid scheduling decision and the decision model, the target scheduling instruction and the decision snapshot are generated, wherein the decision snapshot includes the input feature data of the generated target scheduling instruction and the internal key state of the decision model; based on the decision snapshot, the quantitative contribution of the input feature data to the target scheduling instruction is determined; and based on the quantitative contribution, the target scheduling instruction is explained. Not only does it solve the black box problem of traditional microgrid deep learning models, but also makes the scheduling personnel clearly understand the specific influence of each feature on the decision, greatly improving the credibility and acceptability of artificial intelligence scheduling decision; at the same time, the quantitative contribution provides accurate basis for scheduling result deviation tracing and model parameter optimization, reducing the model operation and maintenance cost.
[0067] By introducing the "decision snapshot" mechanism to capture the internal key state of the model, the problem of difficult to reproduce the historical state of the time series decision model (such as LSTM) is solved; through the asynchronous execution architecture, the high-computing-explanation work is completed without blocking the real-time control main process; finally, through the semantic transformation and synchronous display of the quantitative contribution, the black box barrier of artificial intelligence is eliminated, and the human-machine trust is rebuilt.
[0068] The above steps S10-S40 will be further described below.
[0069] In step S10, the data required for microgrid scheduling decision includes microgrid real-time operation data and prediction data in a future preset time period, wherein the microgrid real-time operation data is multi-dimensional data such as photovoltaic power, load, weather, electricity price, and state of charge of energy storage, which is collected in real time from multiple data sources such as SCADA system of microgrid, weather service, and power market.
[0070] The prediction data in the future preset time period includes at least one of load prediction information and photovoltaic power prediction information of the microgrid in the future preset time period (such as the next three days, one week, one month, one year, etc.), such as load prediction curve and photovoltaic power prediction curve.
[0071] Specifically, the above step S10 can be implemented through the following steps S101-S102.
[0072] Step S101: Obtain the collected microgrid real-time operation data.
[0073] Step S102: Predict the prediction data in the future preset time period based on the microgrid real-time operation data.
[0074] Specifically, the prediction model is used to predict the prediction data in the future preset time period. It can be implemented through the following steps S1021-S1024.
[0075] Step S1021: obtaining feature data based on the micro-grid real-time operation data.
[0076] Specifically, based on the micro-grid real-time operation data, such as current photovoltaic power, load data, electricity price information, and energy storage state of charge data, through preprocessing operations such as data cleaning, missing value filling, and standardization processing, combined with feature engineering (such as feature selection, dimensionality lifting, and data conversion), the dispersed original real-time data is integrated into structured and high-dimensional feature data.
[0077] Step S1022: extracting time sequence features from the feature data.
[0078] Specifically, an encoder based on a Transformer architecture and a self-attention mechanism can be used to capture long-distance dependencies, trend changes, periodic features, and other key time sequence information of the data in the time dimension from the standardized feature data, and obtain time sequence features.
[0079] Step S1023: fusing the time sequence features with external features at a future time to obtain fused feature data.
[0080] The external features at the future time can be weather forecasts, preset electricity prices, and the like at a future preset time (e.g., three days, a week, etc.).
[0081] Specifically, an attention fusion layer can be used to dynamically integrate the extracted time sequence features and future external features. Specifically, the correlation between each external feature and the time sequence feature can be analyzed and a differentiated weight can be assigned, and then the weighted external features and time sequence features can be fused to generate fused feature data containing both current time sequence feature rules and future external influences, thereby overcoming the limitations of a single feature dimension.
[0082] Step S1024: generating prediction data for the future preset time period based on the fused feature data, wherein the prediction data for the future preset time period includes at least one of load prediction information and photovoltaic power prediction information of the micro-grid in the future preset time period.
[0083] Specifically, the fused feature data is input into a preset prediction model (such as a fully connected network), and through a model decoder, the core operation data prediction results of the micro-grid in the future preset time period are output, including load prediction information (such as a load prediction curve) and photovoltaic power prediction information (such as a photovoltaic curve).
[0084] The above is a further description of step S10, and the following continues to further describe step S20.
[0085] Specifically, the decision model is a pre-trained deep learning model, and the data required for micro-grid scheduling decision is input into the decision model, so that the target scheduling instruction is output.
[0086] The decision snapshot can be generated through the following steps S201 to S203.
[0087] Step S201: When the decision model outputs the target scheduling instruction based on the data required for micro-grid scheduling decision, the input feature data on which the target scheduling instruction is generated is extracted, wherein the input feature data is high-dimensional feature data processed by the decision model from the data required for micro-grid scheduling decision.
[0088] Specifically, when the decision model outputs the target scheduling instruction based on the data required for micro-grid scheduling decision, the input feature data is extracted synchronously, and the input feature data can be structured feature data obtained by the feature extraction layer of the decision model from the data required for micro-grid scheduling decision.
[0089] Step S202: Extract the internal key state of the decision model.
[0090] Specifically, the internal core state in the running process of the decision model is captured at the same moment when the target scheduling instruction is output. For example, when the decision model adopts the LSTM loop architecture, the internal key state of the decision model is the hidden state ht and / or the cell state ct.
[0091] Step S203: Pack the input feature data and the internal key state of the decision model, and assign an identification corresponding to the target scheduling instruction to form the decision snapshot.
[0092] Specifically, the input feature data and the internal key state of the model are integrated and packed, and the data packet is assigned an identification (such as ID) that is uniquely matched with the corresponding target scheduling instruction, so as to finally form the decision snapshot. The identification realizes the accurate binding of the scheduling instruction and the decision basis, and ensures that the complete data of the target decision can be quickly located through the identification in the subsequent interpretation process.
[0093] The above is a further description of step S20, and the following will further describe step S30.
[0094] Specifically, the above step S30 can be implemented through the following steps S301 to S303.
[0095] Step S301: Analyze the decision snapshot to extract the input feature data and the internal key state of the decision model from the decision snapshot.
[0096] Step S302: Obtain an optimized background data set, which is a cluster center set generated based on micro-grid historical operation data clustering.
[0097] Specifically, the optimized background data set is a simplified data set formed by clustering all historical data by a clustering algorithm such as K-Means, and extracting the center data of each cluster. For example, thousands of historical photovoltaic power and load combination data are clustered into 10 typical working condition centers, which not only retains the core distribution characteristics of historical data, but also greatly reduces the data size.
[0098] Step S303: Determine the quantitative contribution of the input feature data to the target scheduling instruction based on the input feature data, the internal key state, and the optimized background data set.
[0099] Specifically, a post-explanation algorithm can be used to determine the quantitative contribution, for example, SHAP (Shapley Additive exPlanations) algorithm, LIME (Local Interpretable Model-agnostic Explanations) algorithm, etc. can be used as examples of the post-explanation algorithm.
[0100] Step S3031: Reset the state of the explanation model by taking the internal key state as the initialization parameter of the explanation model.
[0101] The internal key state is the core running state at the moment when the decision model generates the target scheduling instruction. For example, when the decision model is a deep learning model of LSTM architecture, the internal key state is the hidden state ht and cell state ct of the LSTM architecture deep learning model.
[0102] The explanation model is a tool model for calculating the quantitative contribution of the feature, which is essentially a state-frozen original decision model (such as an intelligent scheduling model integrating DRL). By reusing the architecture and parameters of the original decision model, it ensures that the contribution calculation is consistent with the original decision logic.
[0103] The initialization parameter is the reference data used to reset the running state of the explanation model, which specifically refers to the internal key state extracted in the decision snapshot. Its role is to restore the running environment of the explanation model to the state when the target scheduling instruction is generated.
[0104] Specifically, the explanation model is essentially the original decision model after state freezing. Taking the LSTM model of the deep learning model as an example, the internal key state is the hidden state ht and the cell state ct of the LSTM, which encapsulates the historical time memory and running context when the model generates the target scheduling instruction. By resetting the state of the explanation model as the initialization parameter, the running state of the explanation model can be ensured to be completely consistent with the original decision process, avoiding the calculation deviation of the contribution degree caused by the difference in model state, and laying a foundation for subsequent accurate quantification of feature influence.
[0105] Step S3032: determining a feature subset based on the features in the corresponding dimensions of the input feature data.
[0106] The feature subset is a set of partial dimension features selected from the input feature data (such as {photovoltaic power, load}), which is used to enumerate different scenarios of presence / absence of features.
[0107] Specifically, the feature subset is a feature combination set constructed for calculating the contribution degree of a single feature, and its determination is based on all dimension features of the input feature data, such as photovoltaic power, load, electricity price, and energy storage state of charge.
[0108] For example, to calculate the contribution degree of photovoltaic power, all feature subsets without photovoltaic power need to be enumerated, such as the empty set, {load}, {electricity price}, {load+electricity price}, etc. Each subset corresponds to a scenario of presence of partial features and absence of partial features. Through the combination of different subsets, the independent influence of a single feature on the scheduling instruction can be separated, ensuring the pertinence of the contribution degree calculation.
[0109] Step S3033: determining a mask value based on the clustering center data of the corresponding dimensions in the optimization background data set.
[0110] The mask value is a substitute input value for the absent features in the feature subset, which is determined by the clustering center data of the corresponding dimensions in the optimization background data set, and is used to ensure the integrity of the input of the explanation model and avoid operation exceptions caused by feature absence.
[0111] Specifically, when a dimension feature is not included in the feature subset, the clustering center data of the corresponding dimension in the optimization background data set is used as the mask value. For example, when the feature subset does not contain the electricity price, the clustering center value of the electricity price dimension in the background data is used as the substitute.
[0112] Step S3034: calculating the output value of the explanation model corresponding to the feature subset based on the initialized explanation model, the feature subset, and the mask value.
[0113] The explanation model output value is an initialized explanation model, and the result output after the input feature subset and the mask value combination data are combined. The result reflects the influence degree of the current feature combination on the scheduling result.
[0114] The actual feature value of the feature subset is combined with the mask value to form a complete input, which is input into the explanation model after state reset. Based on the reproduced original state, the model calculates the decision output value (such as the decision score of the scheduling instruction, the energy storage charging and discharging power reference value, etc.) corresponding to the feature combination. The output value reflects the influence degree of the current feature combination on the scheduling result.
[0115] Step S3035: determining the quantitative contribution of each dimension feature in the input feature data to the target scheduling instruction based on the explanation model output value.
[0116] By comparing the output value differences of different feature subsets, the independent contribution of a single feature is quantified. For example, when calculating the contribution of photovoltaic power, the difference between the output value of the subset containing photovoltaic power and the output value of the subset not containing photovoltaic power is compared, and then combined with the algorithm rule (such as the fairness weight of SHAP and the local fitting coefficient of LIME) to calculate the quantitative contribution of each dimension feature (such as SHAP value or LIME weight). The positive or negative of the contribution degree represents the positive (promoting) or negative (inhibiting) influence of the feature on the scheduling instruction, and the absolute value represents the degree of influence (such as the SHAP value of photovoltaic power is +0.7, which represents that it significantly promotes the generation of energy storage charging instruction).
[0117] In order to explain this step in detail, the calculation method of quantitative contribution will be explained in detail below taking SHAP algorithm as an example, but it should be clear that SHAP algorithm should not be limited as the post-explanation algorithm.
[0118] Suppose the current scenario is a microgrid with photovoltaic power and current load as input features, and the SHAP value of feature 1 (photovoltaic power) needs to be calculated.
[0119] The information in the decision snapshot is the input feature data Xt: photovoltaic power = 120kW, load = 90kW; internal key state ht / ct: hidden state of the frozen LSTM model; optimization background dataset Bcluster: typical working conditions obtained by clustering, such as photovoltaic power = 70kW, load = 60kW.
[0120] First, reset the internal state of the explanation model to ht / ct in the decision snapshot to ensure that it is completely consistent with the model state when generating energy storage charging of 60kW.
[0121] Then, all subsets S not containing feature 1 need to be enumerated. There is only one non-empty set not containing feature 1, so S = {feature 2}.
[0122] Feature 2 takes the actual value 80kW, Feature 1 takes the background value 70kW, and the input is input into the explanation model to obtain the output = Energy storage charging 20kW.
[0123] After inputting the photovoltaic power 120kW and the load 80kW into the explanation model, the explanation model outputs = Energy storage charging 60kW.
[0124] The = Energy storage charging 20kW and = Energy storage charging 60kW are brought into the calculation formula of the SHAP value, and the specific formula is as follows, so that the SHAP value of Feature 1 (photovoltaic power) can be obtained.
[0125] Wherein, is the SHAP value of the feature ; is the SHAP value of the model output ; is the dimension feature to be calculated, such as photovoltaic power; is the output result of the explanation model; is a feature subset not containing the target feature ; is the set of all feature subsets not containing the target feature ; is the total number of dimension features in the input feature data; is the output value of the explanation model when only inputting the feature subset S; is the output value of the explanation model when inputting the feature subset S and the target feature .
[0126] The above is a further description of step S30, and the following continues to further describe step S40.
[0127] Specifically, the above step S40 can be implemented by the following steps S401 to S403.
[0128] Step S401: Obtain a set of quantified contribution degrees corresponding to each dimension feature, which is presented in the form of key-value pairs of feature names and quantified contribution degrees.
[0129] Specifically, the calculated quantified contribution degree (such as SHAP value) corresponding to each feature is arranged into a set of key-value pairs of feature names-quantified contribution degrees, for example {photovoltaic over-release power: +0.75, future peak-time electricity price expectation: +0.15, current SOC: +0.10}. This key-value pair form can clearly associate features with contribution degrees.
[0130] Step S402: Call the preset semantic conversion rule library to convert the quantified contribution degree of each feature into natural language text.
[0131] The semantic conversion rule library is a pre-defined contribution degree-natural language mapping rule, for example, a positive quantified contribution degree indicates promotion, and a large absolute value indicates significant influence. By calling the library, abstract numerical values are converted into understandable textual descriptions, for example, converting photovoltaic power: +0.75 into photovoltaic power surplus significantly promoting the generation of the current energy storage charging instruction.
[0132] Step S403: Interpret the target scheduling instruction based on the natural language text.
[0133] Specifically, the converted natural language text is integrated into complete interpretation content, which corresponds to a specific target scheduling instruction. For example, in the target scheduling instruction of charging the energy storage system at 80kW power, the photovoltaic power surplus (quantified contribution degree +0.7) significantly promotes the charging decision, while the current low load (quantified contribution degree -0.3) has a slight inhibitory effect on the charging decision, allowing the scheduling personnel to intuitively understand the generation logic of the instruction.
[0134] In one embodiment of the microgrid energy decision interpretation method based on artificial intelligence of the present application, the step of determining the quantified contribution degree of the input feature data to the target scheduling instruction based on the decision snapshot is executed asynchronously by an independent thread.
[0135] Specifically, in the microgrid scheduling process, the step of calculating the quantified contribution degree is not executed synchronously with the main scheduling process, but is executed in a separate calculation thread, specifically in a calculation thread independent of the main control thread for generating the target scheduling instruction, and the calculated quantified contribution degree is matched with the target scheduling instruction through the unique identifier in the decision snapshot. When the decision model outputs the target scheduling instruction and generates the decision snapshot, the system triggers the independent thread to call the interpretation model, process the data and calculate the feature contribution degree in the background. The entire process does not occupy the resources of the main scheduling process and does not hinder the real-time scheduling operation of the main process. It not only guarantees the real-time performance of the main scheduling process of the microgrid, but also completes the accurate calculation of the quantified contribution degree, realizes the parallel processing of real-time scheduling and decision interpretation, and improves the stability of the system operation.
[0136] It should be noted that although the steps in the above embodiments are described in a specific order, those skilled in the art can understand that, in order to achieve the effects of the present application, the different steps do not necessarily have to be executed in such an order, they can be executed simultaneously (in parallel) or in other orders, and these changes are within the protection scope of the present application.
[0137] Those skilled in the art can understand that all or part of the processes in the method of the above-mentioned embodiment can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer readable storage medium, and the computer program can implement the steps of each method embodiment when executed by a processor. The computer program includes computer program code, which can be in the form of source code, object code, executable files or some intermediate forms, etc. The computer readable storage medium can include any entity or device, medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory, random access memory, electrical carrier signal, telecommunication signal and software distribution medium, etc. that can carry the computer program code.
[0138] In addition, Figure 2 The structure of the micro-grid energy management system based on explainable artificial intelligence can be as shown in the structural schematic diagram of the micro-grid energy management system based on explainable artificial intelligence.
[0139] Specifically as Figure 2 shown, the micro-grid energy management system based on explainable artificial intelligence includes a data acquisition module 101, an AI scheduling engine module 102, an explainable analysis module 103, a human-computer interaction module 104 and a prediction engine module 105.
[0140] The data acquisition module 101 is used to acquire multi-dimensional data such as photovoltaic power, load, weather, electricity price and energy storage state of charge collected in real time from multiple data sources such as the SCADA system of the micro-grid, the weather service and the electricity market.
[0141] The prediction engine module 105 is used to predict prediction data in a future preset time period according to the data collected by the data acquisition module 101, which can include at least one of load prediction information and photovoltaic power prediction information of the micro-grid in the future preset time period, such as a load prediction curve and a photovoltaic power prediction curve.
[0142] The AI scheduling engine module 102 is used to predict a target scheduling instruction according to the data collected by the data acquisition module 101 and the prediction data predicted by the prediction engine module 105. The AI scheduling engine module 102 includes a decision snapshot sub-module 102a, which is used to generate a decision snapshot.
[0143] The explainable analysis module 103 is used to determine the quantitative contribution of input feature data to the target scheduling instruction according to the decision snapshot sent by the AI scheduling engine module 102. The explainable analysis module 103 includes a semantic conversion engine 103a, which is used to convert the quantitative contribution into a natural language description under a preset rule.
[0144] The human-computer interaction module 104 is configured to receive the natural language description of the quantified contribution degree sent by the explainability analysis module 103, and explain the target scheduling instruction according to the quantified contribution degree. Specifically, the module 103 associates the converted natural language explanation text with the instruction ID, and pushes it to the human-computer interaction module 104. As shown in Figure 3 illustrated, the user interface 400 is divided into an instruction area 401 and an explanation area 402, the instruction area 401 is configured to present the target scheduling instruction, and the explanation area 402 is configured to present the relevant explanation corresponding to the target scheduling instruction, so as to realize the synchronous and parallel display of the instruction and the decision basis.
[0145] As shown in the example, Figure 4 The complete flowchart of the instruction explanation of the micro-grid energy management system is shown in the example, which can be realized by the following steps S201 to S205.
[0146] In step S201, the data acquisition module 101 acquires the multi-dimensional data such as photovoltaic power, load, weather, electricity price, and state of charge of energy storage from the SCADA system of the micro-grid, weather service, and power market, and the prediction engine module 105 predicts the future prediction data of a preset time period according to the data acquired by the data acquisition module 101.
[0147] In step S202, the scheduling instruction and the decision snapshot are generated according to the collected data and the predicted data.
[0148] In step S203, the decision basis is analyzed according to the decision snapshot, so as to obtain the SHAP value corresponding to each dimension feature.
[0149] In step S204, the SHAP value is converted into a natural language description text, and the target scheduling instruction is explained according to the converted text.
[0150] In step S205, the target scheduling instruction and the explanation are synchronously displayed.
[0151] Further, the present application also provides a computer device, which can include at least one processor; and a memory connected with the at least one processor in communication; wherein the memory stores a computer program, and the computer program is executed by the at least one processor to realize the micro-grid energy decision explanation method based on artificial intelligence according to any one of the above embodiments. As shown in Figure 5 illustrated, Figure 5 The structure of the computer device is shown in the example, which includes a processor 100 and a memory 200.
[0152] Further, the present application also provides a computer readable storage medium. In an embodiment of the computer readable storage medium according to the present application, the computer readable storage medium can be configured to store a program of the artificial intelligence-based microgrid energy decision explanation method of the above-mentioned method embodiments, which can be loaded and run by a processor to implement the above-mentioned artificial intelligence-based microgrid energy decision explanation method. For the convenience of illustration, only the parts related to the embodiments of the present application are shown, and the specific technical details not disclosed are referred to the method part of the embodiments of the present application. The computer readable storage medium can be a memory device formed by various electronic devices, and optionally, the computer readable storage medium in the embodiments of the present application is a non-transitory computer readable storage medium.
[0153] So far, the technical solutions of the present application have been described in combination with the specific embodiments shown in the drawings, but those skilled in the art can easily understand that the protection scope of the present application is obviously not limited to these specific embodiments. Those skilled in the art can make equivalent changes or replacements to the related technical features without departing from the principles of the present application, and the technical solutions after these changes or replacements will all fall within the protection scope of the present application.
Claims
1. An artificial intelligence-based microgrid energy decision interpretation method, characterized in that, The method comprises: acquiring data required for micro-grid scheduling decision; generating target scheduling instruction and decision snapshot based on the data required for micro-grid scheduling decision and decision model, wherein the decision snapshot comprises input feature data for generating the target scheduling instruction and internal key state of the decision model; determining quantitative contribution degree of the input feature data to the target scheduling instruction based on the decision snapshot; interpreting the target scheduling instruction based on the quantitative contribution degree. 2.The AI-based microgrid energy decision interpretation method of claim 1, wherein, The data required for micro-grid scheduling decision comprises real-time operation data of micro-grid and prediction data of future preset time period; The acquiring data required for micro-grid scheduling decision comprises: acquiring the real-time operation data of micro-grid collected; predicting the prediction data of future preset time period based on the real-time operation data of micro-grid. 3.The AI-based microgrid energy decision interpretation method of claim 1, wherein, The generating decision snapshot based on the data required for micro-grid scheduling decision and decision model comprises: extracting input feature data for generating the target scheduling instruction when the decision model outputs the target scheduling instruction based on the data required for micro-grid scheduling decision, wherein the input feature data is high-dimensional data processed by the decision model on the data required for micro-grid scheduling decision; extracting internal key state of the decision model, wherein the internal key state is used to represent memory feature of the decision model on historical time series information; packing the input feature data and the internal key state of the decision model and assigning unique identification corresponding to the target scheduling instruction to form the decision snapshot. 4.The AI-based microgrid energy decision interpretation method of claim 1, wherein, The determining quantitative contribution degree of the input feature data to the target scheduling instruction based on the decision snapshot comprises: analyzing the decision snapshot to extract input feature data and internal key state of the decision model from the decision snapshot; acquiring optimization background data set, wherein the optimization background data set is a cluster center set generated based on clustering of historical operation data of micro-grid; determining quantitative contribution degree of input feature data to target scheduling instruction based on the input feature data, the internal key state and the optimization background data set.
5. The artificial intelligence-based microgrid energy decision interpretation method according to claim 4, characterized in that, The determining quantitative contribution degree of input feature data to target scheduling instruction based on the input feature data, the internal key state and the optimization background data set comprises: resetting state of an explanation model by taking the internal key state as initialization parameter of the explanation model to reproduce decision context when the target scheduling instruction is generated; determining feature subset based on corresponding dimension feature in the input feature data; determining mask value based on cluster center data of corresponding dimension in the optimization background data set; calculating explanation model output value corresponding to the feature subset based on the initialized explanation model, the feature subset and the mask value; determining quantitative contribution degree of each dimension feature in the input feature data to the target scheduling instruction based on the explanation model output value. 6.The microgrid energy decision interpretation method based on artificial intelligence according to claim 5, wherein, The interpreting the target scheduling instruction based on the quantitative contribution degree comprises: acquiring quantitative contribution degree set corresponding to each dimension feature; calling preset semantic conversion rule library to convert quantitative contribution degree of each feature into natural language text; Interpret the target scheduling instruction based on the natural language text. 7.The microgrid energy decision interpretation method based on artificial intelligence according to claim 1, wherein, The step of determining the quantitative contribution degree of the input feature data to the target scheduling instruction based on the decision snapshot is executed asynchronously through an independent thread. 8.The microgrid energy decision interpretation method based on artificial intelligence according to claim 2, wherein, The prediction data of the future preset time period is predicted based on the real-time operation data of the micro-grid, comprising: Obtaining feature data based on the real-time operation data of the micro-grid; Extracting time sequence features from the feature data; Fusing the time sequence features with external features at future time to obtain fused feature data; Generating prediction data of the future preset time period based on the fused feature data, wherein the prediction data of the future preset time period comprises at least one of load prediction information and photovoltaic power prediction information of the micro-grid in the future preset time period.
9. A computer device, comprising: Comprise: At least one processor; And a memory connected in communication with the at least one processor; Wherein the memory stores a computer program, and the computer program is executed by the at least one processor to realize the artificial intelligence-based micro-grid energy decision interpretation method in any one of claims 1 to 8.
10. A computer readable storage medium having stored therein a plurality of program codes, characterized in that, The program code is adapted to be loaded and run by the processor to execute the artificial intelligence-based micro-grid energy decision interpretation method in any one of claims 1 to 8.