Power load scheduling method and device based on large language model
By adopting a power load scheduling method based on a large language model, the problems of insufficient multi-source data fusion and ambiguous causal relationship identification are solved. This method maximizes the consumption of distributed energy and optimizes scheduling strategies under the constraints of power grid security, thereby improving the accuracy and efficiency of power load scheduling.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- STATE GRID TIANJIN ELECTRIC POWER COMPANY
- Filing Date
- 2025-09-23
- Publication Date
- 2026-06-23
AI Technical Summary
The existing power load dispatching system suffers from problems such as insufficient fusion of multi-source data, lack of accuracy in spatiotemporal modeling, and fuzzy identification of causal relationships. This leads to a mismatch between dispatching strategies and real-time dynamics, incorrect adjustment of the output of traditional generating units, and increased energy waste.
A power load scheduling method based on a large language model is adopted. By acquiring scheduling text data, feature extraction and encoding are performed. A spatiotemporal joint location embedding layer, a structural causal constraint attention mechanism, and a grid security constraint scheduling strategy are constructed. Combined with dynamic weight fusion of gating network, the distributed energy consumption is maximized and the scheduling strategy is optimized under grid security constraints.
It improves the accuracy and efficiency of power load dispatch, minimizes energy waste, and maximizes the absorption of distributed energy under the constraints of grid security.
Smart Images

Figure CN121503946B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of power dispatching, in particular to a power load dispatching method and device based on a large language model. BACKGROUND
[0002] With the large-scale application of renewable energy such as solar energy and wind energy, the inherent fluctuation characteristics of renewable energy make local energy dispatch among multiple subjects a key path to reduce waste. In this context, the existing energy dispatch mode is evolving from centralized control to distributed collaboration to improve management efficiency and response flexibility. However, there are still the following supplements in distributed energy dispatch: first, the multi-source data fusion is insufficient, leading to mismatch between dispatch strategy and real-time dynamics; second, the spatial modeling accuracy is lacking, and the spatial analysis is limited to physical distance, ignoring the effect of electrical distance on power flow; finally, the causal relationship identification is fuzzy, based on statistical correlation modeling, without distinguishing direct causality and common cause correlation, which is easy to misjudge the cause of load growth in non-steady-state scenarios, and to exacerbate energy waste by incorrectly adjusting traditional unit output. Therefore, there is an urgent need for a power load dispatching method based on a large language model to solve the above problems. SUMMARY
[0003] Therefore, the present application provides a power load dispatching method and device based on a large language model, mainly to solve the problem of poor accuracy of existing power load dispatching.
[0004] According to one aspect of the present application, a power load dispatching method based on a large language model is provided, comprising:
[0005] Obtaining dispatch text data of power load, wherein the dispatch text data includes load time series data, meteorological text data, device log data, and power grid index data;
[0006] Performing feature extraction on the dispatch text data to obtain multi-modal features, and encoding the multi-modal features into a semantic space to obtain multi-modal feature encodings;
[0007] Performing dispatch prediction processing on the multi-modal feature encodings after consistency processing based on a large language model that has completed model training to obtain a power load dispatching result;
[0008] Wherein, the large language model includes a spatio-temporal joint position embedding layer obtained based on time position encoding and geographical space encoding, an attention mechanism based on structural causal constraints, a contribution degree explanation based on dynamic weight fusion of a gating network, and a dispatch strategy output layer containing a power grid safety constraint dispatch strategy.
[0009] Further, the method further comprises:
[0010] The time series convolution network is used for multi-scale feature extraction on the load time series data, to obtain first features;
[0011] The pre-trained language model is used for semantic analysis on the meteorological text data, to obtain second features;
[0012] The heterogeneous graph neural network is used for entity relationship analysis on the device log data, to obtain third features;
[0013] The first features, the second features and the third features are encoded in a semantic space, to obtain multi-modal feature encodings.
[0014] Further, before the large language model trained based on the model training is used for consistency-processed multi-modal feature encoding scheduling prediction processing to obtain a power load scheduling result, the method further comprises:
[0015] A space-time joint location embedding layer is constructed based on time location encoding and geographical space encoding;
[0016] An attention layer is constrained based on structural causality;
[0017] A contribution degree explanation is obtained by fusing weights of a time series mode expert function, a power grid topology expert function and an external factor expert function based on a gating network;
[0018] A scheduling strategy output layer containing a power grid safety constraint scheduling strategy is constructed;
[0019] A large language network is constructed based on the space-time joint location embedding layer, the attention layer, the contribution degree explanation and the scheduling strategy output layer, to obtain the large language model, and the large language model is trained based on a training sample set.
[0020] Further, the method further comprises:
[0021] A stability reward, an environmental protection reward and an economic reward of a power grid are obtained, and the stability reward, the environmental protection reward and the economic reward are fused by weighting, to obtain a multi-objective reward function, so as to constrain the large language model based on the multi-objective reward function.
[0022] Further, the space-time joint location embedding layer is constructed based on time location encoding and geographical space encoding, which comprises:
[0023] The location embedding vector of the load time series data is generated by encoding with periodic basis functions, and the time location code is generated based on the location embedding vector and the nonlinear time evolution law.
[0024] Obtain the coordinates of the power grid nodes and perform hierarchical encoding on the coordinates to obtain multi-level strings;
[0025] The multi-level strings after the embedded vector is extracted are weighted and fused, and spatial encoding is performed based on the power grid topology impedance parameters and the weighted and fused strings to obtain the geospatial code;
[0026] The spatiotemporal joint location embedding layer is constructed based on the time location encoding and the geospatial encoding.
[0027] Furthermore, the constraint on the attention layer based on structural causality includes:
[0028] The causal effects among the estimated variables of the power dispatching procedure text are determined by a dual machine learning algorithm, and a causal mask matrix is constructed based on the causal effects among the estimated variables.
[0029] The attention mechanism layer of the large language model is constrained by the causal mask matrix.
[0030] Furthermore, the contribution explanation obtained by weighting and fusing the time-series pattern expert function, the power grid topology expert function, and the external factor expert function based on the gated network includes:
[0031] Constructing temporal pattern expert functions based on deep learning networks with Fourier basis functions;
[0032] Constructing power grid topology expert functions based on graph diffusion networks with node admittance matrices;
[0033] An expert function for external factors is constructed by integrating meteorological text data and economic indicator data.
[0034] After determining the system state based on the time-series pattern expert function, the power grid topology expert function, and the external factor expert function, expert weights are generated. Then, based on the expert weights, the time-series pattern expert function, the power grid topology expert function, and the external factor expert function, a weighted fusion is performed to obtain the contribution explanation.
[0035] According to another aspect of this application, a power load dispatching device based on a large language model is provided, comprising:
[0036] The acquisition module is used to acquire power load dispatch text data, which includes load time series data, meteorological text data, equipment log data, and power grid index data.
[0037] The extraction module is used to extract features from the scheduling text data to obtain multimodal features, and encode the multimodal features into the semantic space to obtain multimodal feature encoding;
[0038] The processing module is used to perform scheduling prediction processing on the multimodal feature encoding after consistency processing based on the large language model that has completed model training, so as to obtain the power load scheduling result;
[0039] The large language model includes a spatiotemporal joint location embedding layer based on time-location encoding and geospatial encoding, an attention mechanism based on structural causal constraints, a contribution interpretation based on dynamic weight fusion of gating networks, and a scheduling strategy output layer containing power grid security constraint scheduling strategies.
[0040] Furthermore, the extraction module is specifically used to perform multi-scale feature extraction on the load time-series data through a temporal convolutional network to obtain a first feature; to perform semantic parsing on the meteorological text data through a pre-trained language model to obtain a second feature; to parse the entity relationships in the equipment log data through a heterogeneous graph neural network to obtain a third feature; and to encode the first feature, the second feature, and the third feature in the semantic space to obtain a multimodal feature encoding.
[0041] Furthermore, the device also includes:
[0042] The first construction module is used to build a spatiotemporal joint location embedding layer based on time location coding and geospatial coding.
[0043] The constraint module is used to constrain the attention layer based on structural causality;
[0044] The fusion module is used to perform weighted fusion of time-series pattern expert functions, power grid topology expert functions, and external factor expert functions based on a gated network to obtain the contribution interpretation.
[0045] The second building module is used to build a scheduling strategy output layer that includes power grid security constraint scheduling strategies;
[0046] The training module is used to construct the large language network based on the spatiotemporal joint location embedding layer, the attention layer, the contribution interpretation, and the scheduling policy output layer to obtain the large language model, and to train the large language model based on the training sample set.
[0047] Furthermore, the acquisition module is also used to acquire the stability reward, environmental protection reward, and economic reward of the power grid, and to perform weighted fusion based on the stability reward, the environmental protection reward, and the economic reward to obtain a multi-objective reward function, so as to constrain the large language model based on the multi-objective reward function.
[0048] Furthermore,
[0049] The first construction module is specifically used to generate a location embedding vector of the load time series data through periodic basis function encoding, and generate the time location code based on the location embedding vector and the nonlinear time evolution law representation; obtain the grid node coordinates, and perform hierarchical encoding on the grid node coordinates to obtain multi-level strings; perform weighted fusion on the multi-level strings after extracting the embedding vector, and perform spatial encoding based on the grid topology impedance parameters and the weighted fused strings to obtain the geospatial code; and construct the spatiotemporal joint location embedding layer based on the time location code and the geospatial code.
[0050] Furthermore,
[0051] The constraint module is specifically used to determine the causal effects between estimated variables of the power dispatching procedure text through a dual machine learning algorithm, and to construct a causal mask matrix based on the causal effects between the estimated variables; and to constrain the attention mechanism layer of the large language model through the causal mask matrix.
[0052] Furthermore,
[0053] The fusion module is specifically used to construct a time-series model expert function based on a deep learning network with Fourier basis functions; construct a power grid topology expert function based on a graph diffusion network with node admittance matrices; construct an external factor expert function by fusing meteorological text data and economic indicator data; after determining the system state based on the time-series model expert function, the power grid topology expert function, and the external factor expert function, generate expert weights, and perform weighted fusion based on the expert weights, the time-series model expert function, the power grid topology expert function, and the external factor expert function to obtain the contribution explanation.
[0054] According to another aspect of this application, a storage medium is provided, wherein at least one executable instruction is stored therein, the executable instruction causing a processor to perform operations corresponding to the power load scheduling method based on the large language model described above.
[0055] According to another aspect of this application, a terminal is provided, comprising: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other through the communication bus;
[0056] The memory is used to store at least one executable instruction, which causes the processor to perform the operation corresponding to the power load scheduling method based on the large language model described above.
[0057] By employing the above technical solutions, the technical solutions provided in the embodiments of this application have at least the following advantages:
[0058] This application provides a power load dispatching method and apparatus based on a large language model. Compared with the prior art, the embodiments of this application acquire dispatching text data of power load, which includes load time series data, meteorological text data, equipment log data, and power grid index data; extract features from the dispatching text data to obtain multimodal features, and encode the multimodal features into a semantic space to obtain multimodal feature encoding; perform dispatching prediction processing on the consistency-processed multimodal feature encoding based on a large language model that has completed model training to obtain power load dispatching results; wherein, the large language model includes a spatiotemporal joint location embedding layer obtained based on time location encoding and geospatial encoding, an attention mechanism based on structural causal constraints, a contribution explanation based on dynamic weight fusion of gating networks, and a dispatching strategy output layer containing power grid security constraint dispatching strategies, thereby maximizing the consumption of distributed energy and optimizing dispatching strategies under power grid security constraints, minimizing energy waste, and improving the accuracy and efficiency of power load dispatching.
[0059] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description
[0060] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the scope of this application. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:
[0061] Figure 1 The diagram illustrates a power load scheduling method based on a large language model, as provided in an embodiment of this application.
[0062] Figure 2 This illustration shows a schematic diagram of a time encoding and spatial encoding process provided in an embodiment of this application;
[0063] Figure 3 This illustration shows a schematic diagram of an attention constraint process provided in an embodiment of this application;
[0064] Figure 4 This illustration shows a schematic diagram of a contribution interpretation process provided in an embodiment of this application;
[0065] Figure 5This illustration shows a block diagram of a power load dispatching device based on a large language model, as provided in an embodiment of this application.
[0066] Figure 6 A schematic diagram of the structure of a terminal provided in an embodiment of this application is shown. Detailed Implementation
[0067] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
[0068] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0069] This application provides a power load dispatching method based on a large language model, such as... Figure 1 As shown, the method includes:
[0070] 101. Obtain the dispatch text data of power load.
[0071] In this embodiment, the current execution terminal, as the main body for power load scheduling, can be a terminal server or a cloud server to obtain power load scheduling text data. For example, it can receive scheduling text data directly entered by the user or automatically generated scheduling text data; this embodiment does not impose specific limitations. The scheduling text data includes load time-series data, meteorological text data, equipment log data, and power grid indicator data. The load time-series data is the power grid load scheduled and called according to time sequence; the meteorological text data is the weather condition text obtained during the scheduling period; the equipment log data is the text recorded by various energy storage or transmission equipment in the power grid during the scheduling process; and the power grid indicator data includes economic indicators affecting power load; this embodiment does not impose specific limitations.
[0072] 102. Extract features from the scheduling text data to obtain multimodal features, and encode the multimodal features into the semantic space to obtain multimodal feature encoding.
[0073] In this embodiment, since the scheduled text data includes multimodal data, such as numerical content and textual content, the current execution end first performs feature extraction on the scheduled text data to obtain multimodal features, which are then transcoded into a unified semantic space to obtain multimodal feature encoding. Feature extraction involves extracting and fusing key information from multiple data types (such as text, images, audio, and video). This can be achieved using pre-trained language models (such as BERT) to extract semantic features, convolutional neural networks (CNNs), or a combination of recurrent neural networks (RNNs) or 3D CNNs to process time-series data. This embodiment does not impose specific limitations on these methods.
[0074] 103. Based on the large language model that has completed model training, the multimodal feature encoding after consistency processing is subjected to scheduling prediction processing to obtain the power load scheduling result.
[0075] In this embodiment, after the current execution end obtains the multimodal feature encoding, it performs consistency processing on the multimodal feature encoding, which may include feature alignment, unified computational logic, feature fusion verification, etc., and this embodiment does not specifically limit the specific processing. Furthermore, based on the large language model, scheduling prediction processing is performed on the consistent multimodal feature encoding to obtain the power load scheduling result. The large language model (LMM) can be constructed based on Transformer combined with a self-attention mechanism. Through pre-training, such as masked language modeling, the large language model is trained to perform power load scheduling prediction. The large language model includes a spatiotemporal joint location embedding layer based on temporal and geospatial encoding, an attention mechanism based on structural causal constraints, a contribution interpretation based on dynamic weight fusion of gating networks, and a scheduling strategy output layer containing power grid security constraint scheduling strategies.
[0076] In another embodiment of this application, for further definition and explanation, the step of extracting features from the scheduling text data to obtain multimodal features, and encoding the multimodal features into a semantic space, includes:
[0077] The first feature is obtained by performing multi-scale feature extraction on the load time-series data through a temporal convolutional network.
[0078] The meteorological text data is semantically parsed using a pre-trained language model to obtain the second feature;
[0079] The entity relationships in the device log data are analyzed using a heterogeneous graph neural network to obtain the third feature;
[0080] The first feature, the second feature, and the third feature are encoded in the semantic space to obtain multimodal feature encoding.
[0081] To effectively forecast power load using scheduling text data containing multimodal data, thereby improving forecasting accuracy, the current execution end first extracts multi-scale features from the load time-series data using a temporal convolutional network (TCN) to obtain the first feature. The TCN is a deep learning architecture specifically designed for time-series data to extract features from the load time-series data. Simultaneously, since the meteorological text data is in text form, a pre-trained language model is used to perform semantic parsing on the meteorological text data to obtain the second feature. Pre-trained language models (PLMs) are a core technology in Natural Language Processing (NLP), capable of learning general language representations through pre-training on large-scale unlabeled data, and then being trained on weather samples for feature extraction tasks. Furthermore, the current execution end can also parse the entity relationships in the device log data using a heterogeneous graph neural network to obtain a third feature. The heterogeneous graph neural network (HGNN) is a deep learning model designed to process heterogeneous graph data. By fusing semantic information from multiple types of nodes and edges, it overcomes the limitations of traditional graph neural networks on homogeneous data, enabling the parsing of entity relationships in device log data as a third feature, such as the grid load scheduling status at various grid node devices. Finally, the first feature, the second feature, and the third feature are encoded in a unified semantic space to obtain multimodal feature encoding. The encoding method is not specifically limited in this embodiment.
[0082] In another embodiment of this application, for further definition and explanation, before the step of performing scheduling prediction processing on the multimodal feature encoding after consistency processing based on the large language model that has completed model training to obtain the power load scheduling result, the method further includes:
[0083] A spatiotemporal joint location embedding layer is constructed based on time location coding and geospatial coding;
[0084] Constraining the attention layer based on structural causality;
[0085] Based on the gating network, the contribution interpretation is obtained by weighting and fusing the time-series pattern expert function, the power grid topology expert function and the external factor expert function.
[0086] Construct a scheduling policy output layer that includes power grid security constraint scheduling strategies;
[0087] The large language network is constructed based on the spatiotemporal joint location embedding layer, the attention layer, the contribution interpretation, and the scheduling policy output layer to obtain the large language model, and the large language model is trained based on the training sample set.
[0088] To improve the accuracy of grid load scheduling by predicting grid load based on a large language model, the current execution end is pre-trained using an improved large language model. The current execution end constructs a spatiotemporal joint location embedding layer and improves the attention mechanism. It also constructs a scheduling strategy output layer and calculates contribution interpretation to improve the initial large language network. Specifically, the spatiotemporal joint location embedding layer can be constructed based on temporal location encoding and geospatial encoding. For the attention mechanism, structural causality can be used to constrain the attention layer. For contribution interpretation, a weighted fusion of temporal pattern expert functions, grid topology expert functions, and external factor expert functions can be performed using a gating network to obtain the contribution interpretation. Finally, an output layer containing grid security constraint scheduling strategies is constructed to build the large language network based on the spatiotemporal joint location embedding layer, the attention layer, the contribution interpretation, and the scheduling strategy output layer.
[0089] In another embodiment of this application, for further definition and explanation, the steps also include:
[0090] The system obtains the stability reward, environmental reward, and economic reward of the power grid, and performs a weighted fusion of the stability reward, environmental reward, and economic reward to obtain a multi-objective reward function, which is then used to constrain the large language model.
[0091] To improve the quality of the quantized model output for large language models and enhance reinforcement learning capabilities, the current execution end obtains the grid stability reward, environmental reward, and economic reward. At this point, the economic reward can be calculated based on power generation costs, unit start-up and shutdown costs, and energy storage losses. Specifically, it is expressed as:
[0092] ;
[0093] in, The power generation cost of the k-th generating unit is... For unit start-up costs, For the actual output of the kth unit, This represents the charging and discharging loss coefficient of the energy storage system s. The charging and discharging power of the energy storage system s. (In calculating environmental rewards) In this case, the carbon emission impact can be calculated based on the quantification of the scheduling strategy, specifically expressed as follows:
[0094] ;
[0095] in, For coal-fired power units Let k be the carbon emission intensity of the k-th unit. This represents the reactive power loss at the m-th transmission section. The equivalent carbon emission factor for reactive power loss can be calibrated based on the grid carbon intensity; however, this application's embodiments do not impose specific limitations. Stability Bonus It can be calculated based on the grid voltage stability and line load rate, specifically expressed as follows:
[0096] ;
[0097] in, Let pu be the per-unit voltage value of the nth node. The over-limit penalty term ensures that the voltage is between 0.95 and 1.05 pu. As an indicator function, when any line power Exceeding the limit The value is 1 if the condition is met, otherwise it is 0. The line overload penalty weight; f is the system frequency, and a penalty is applied when it deviates from 50Hz. The frequency deviation penalty weight.
[0098] It should be noted that after the current execution end receives the various rewards, it performs a weighted fusion based on the stability reward, the environmental protection reward, and the economic reward to obtain a multi-objective reward function. This multi-objective reward function is then used to constrain the large language model, specifically expressed as follows:
[0099] Where R is the weighted fusion multi-objective reward function, Norm( The function uses Min-Max normalization to scale each reward to the [0,1] interval; These are the weighting coefficients.
[0100] In another embodiment of this application, for further definition and explanation, the step of constructing a spatiotemporal joint location embedding layer based on time location encoding and geospatial encoding includes:
[0101] The location embedding vector of the load time series data is generated by encoding with periodic basis functions, and the time location code is generated based on the location embedding vector and the nonlinear time evolution law.
[0102] Obtain the coordinates of the power grid nodes and perform hierarchical encoding on the coordinates to obtain multi-level strings;
[0103] The multi-level strings after the embedded vector is extracted are weighted and fused, and spatial encoding is performed based on the power grid topology impedance parameters and the weighted and fused strings to obtain the geospatial code;
[0104] The spatiotemporal joint location embedding layer is constructed based on the time location encoding and the geospatial encoding.
[0105] To improve the performance of the large language model, the current execution layer, when constructing the spatiotemporal joint location embedding layer, first generates the location embedding vector of the load time series data through periodic basis function encoding, and then generates the temporal location code based on the location embedding vector and the nonlinear time evolution law representation. Specifically, as shown... Figure 2 As shown, the position embedding vector is represented as:
[0106] ;
[0107] in, These correspond to daily, weekly, monthly, and yearly cycles, respectively, with the unit being hours. For learnable phase offset parameters; through learnable phase offset parameters The periodic phase is adaptively adjusted to address the bias issue of fixed-phase encoding in cross-regional applications. Furthermore, a multilayer perceptron is used to capture the nonlinear time evolution representation. Specifically, it is expressed as:
[0108] ;
[0109] in, For normalized timestamps, , The weight matrix, which integrates the periodic and trend terms into the final time code, is represented as follows:
[0110] ;
[0111] At this point, the final time codes of different time granularities are concatenated to obtain the time location code, represented as:
[0112] ;
[0113] in, This represents a feature dimension concatenation operation, using learnable phase shift parameters. The adaptive adjustment of the periodic phase overcomes the bias problem of fixed phase coding when applied across regions. By separating the trend term and the periodic term, it avoids the problem of trend interference with periodic components in traditional Fourier transform. Furthermore, by independently calculating the coding at different time scales, it significantly improves the model's ability to predict sudden load fluctuations and long-term evolution trends in a coordinated manner.
[0114] When the current execution end performs geospatial encoding, such as Figure 2 As shown, firstly, the coordinates of the power grid nodes are obtained, and then hierarchical encoding is performed on these coordinates to obtain multi-level strings. These multi-level strings, after the embedding vector is extracted, are then weighted and fused. Finally, spatial encoding is performed based on the power grid topology impedance parameters and the weighted and fused strings to obtain the geospatial code. Specifically, hierarchical GeoHash encoding is used to encode the power grid node coordinates. Convert to a GeoHash string of length LL, where the l-th substring... The hierarchical division of geographic space is represented by the following code:
[0115] ;
[0116] in, For the geographic precision of level l, This involves alternating concatenation of longitude and latitude codes. Simultaneously, the embedding vectors of each GeoHash substring are extracted and weighted, resulting in:
[0117] ;
[0118] in, Let l be the trainable embedding matrix of level l. This represents the attenuation factor. In the spatial encoding of impedance parameters based on power grid topology, it is specifically expressed as:
[0119] ;
[0120] in, Let be the complex impedance at time nodes i and j. This represents the real-valued concatenation; correspondingly, it generates a spatial attention adjacency matrix, represented as:
[0121] ;
[0122] in, Let σ be the adjacency matrix of nodes i and j at the same voltage level, and let σ be the impedance scaling factor, which is adaptively calculated through the maximum short-circuit capacity of the power grid.
[0123] In another embodiment of this application, for further definition and explanation, the step of constraining the attention layer based on structural causality includes:
[0124] The causal effects among the estimated variables of the power dispatching procedure text are determined by a dual machine learning algorithm, and a causal mask matrix is constructed based on the causal effects among the estimated variables.
[0125] The attention mechanism layer of the large language model is constrained by the causal mask matrix.
[0126] To improve the predictive performance of the attention mechanism on large language models, the current execution end improves the attention mechanism by specifically determining the causal effects between estimated variables in the power dispatching procedure text through a dual machine learning algorithm, and constructing a causal mask matrix based on these causal effects. For example... Figure 3 As shown, at this point, the power system cause-effect graph is defined. Where V represents the variable set and E represents the edge set; the variable set V = {temperature (T), policy intensity (P), industrial electricity consumption (I), residential load (R), total load (L), power generation plan (G)}, and the construction rules for the edge set E are as follows:
[0127] .
[0128] Furthermore, by combining the power dispatching procedure text with the Peter-Clark (PC) algorithm for causal discovery, specifically, Double Machine Learning (DML) can be used to estimate the causal effects between variables:
[0129] ;
[0130] in, for Unit change Average causal effect wei except All confounding variables outside of, This is a causal effect prediction model trained through cross-fitting. Additionally, a causal mask matrix is constructed. When, it is represented as:
[0131] ;
[0132] Among them, significance threshold .
[0133] It should be noted that when constraining the attention mechanism layer of the large language model through the causal mask matrix, that is, applying causal constraints to the multi-head attention layer of the large language model LLM, it is expressed as:
[0134] ;
[0135] Where Q, K, and V represent the query matrix, key matrix, and value matrix, respectively. Scaling factor The Hadama product is used to constrain the propagation of information along non-causal paths.
[0136] In another embodiment of this application, for further definition and explanation, the step of weighted fusion of the time-series pattern expert function, the power grid topology expert function, and the external factor expert function based on a gating network to obtain the contribution interpretation includes:
[0137] Constructing temporal pattern expert functions based on deep learning networks with Fourier basis functions;
[0138] Constructing power grid topology expert functions based on graph diffusion networks with node admittance matrices;
[0139] An expert function for external factors is constructed by integrating meteorological text data and economic indicator data.
[0140] After determining the system state based on the time-series pattern expert function, the power grid topology expert function, and the external factor expert function, expert weights are generated. Then, based on the expert weights, the time-series pattern expert function, the power grid topology expert function, and the external factor expert function, a weighted fusion is performed to obtain the contribution explanation.
[0141] In a specific embodiment, such as Figure 4 As shown, the temporal pattern expert function is constructed using an LSTM network with Fourier basis functions, and its hidden state update formula is:
[0142] ;
[0143] in, For daily / weekly / monthly / yearly periodic basis functions, Hour.
[0144] In a specific embodiment, such as Figure 4 As shown, when constructing the power grid topology expert function, the node update formula for the graph diffusion network based on the node admittance matrix is:
[0145] ;
[0146] in, For elements of the admittance matrix, For electrical connection to neighbors.
[0147] In a specific embodiment, such as Figure 4 As shown, when constructing expert functions for external factors, it is possible to construct fused meteorological text data. With economic indicators The multilayer perceptron outputs:
[0148] .
[0149] Furthermore, such as Figure 4 As shown, after determining the system state based on the time-series model expert function, the power grid topology expert function, and the external factor expert function, expert weights are generated. Then, a weighted fusion is performed based on these expert weights, the time-series model expert function, the power grid topology expert function, and the external factor expert function to obtain the contribution explanation. Specifically, a method for dynamically allocating the expert weights of the hybrid expert system MoE using a gated network is employed. At this point, the current system state is input as... The expert weights g are generated and represented as:
[0150] ;
[0151] in, The weight matrix is obtained by applying load balancing loss regularization. Finally, the outputs of the time-series model expert function, the power grid topology expert function, and the external factor expert function are weighted and fused, as shown below:
[0152] ;
[0153] Where y represents the fused output vector, and K represents the number of experts. This represents the weight of the k-th expert. This represents the output of the k-th expert. It also includes an explanation of each expert's contribution.
[0154] ;
[0155] in, Providing experts with a norm, while addressing issues with fixed weights that fail to respond to extreme events, gating networks can automatically identify dominant factors. For example, in extreme weather conditions, the weight of external factors increases for experts, thus affecting the explanation of contribution. Used to generate a decision contribution report, facilitating the understanding and analysis of the reasons for power grid changes.
[0156] This application provides a power load scheduling method based on a large language model. Compared with the prior art, this application obtains power load scheduling text data, which includes load time series data, meteorological text data, equipment log data, and power grid index data. Features are extracted from the scheduling text data to obtain multimodal features, which are then encoded into a semantic space to obtain multimodal feature encoding. Scheduling prediction processing is performed on the consistency-processed multimodal feature encoding based on a large language model that has completed model training, resulting in power load scheduling results. The large language model includes a spatiotemporal joint location embedding layer based on time-location encoding and geospatial encoding, an attention mechanism based on structural causal constraints, a contribution explanation based on dynamic weight fusion of gating networks, and a scheduling strategy output layer containing power grid security constraint scheduling strategies. This maximizes the absorption of distributed energy and optimizes scheduling strategies under power grid security constraints, minimizing energy waste and improving the accuracy and efficiency of power load scheduling.
[0157] Furthermore, as a response to the above Figure 1 The implementation of the method shown in this application provides a power load dispatching device based on a large language model, such as... Figure 5 As shown, the device includes:
[0158] The acquisition module 21 is used to acquire the dispatch text data of the power load, which includes load time series data, meteorological text data, equipment log data and power grid index data.
[0159] The extraction module 22 is used to extract features from the scheduling text data to obtain multimodal features, and encode the multimodal features into the semantic space to obtain multimodal feature encoding;
[0160] Processing module 23 is used to perform scheduling prediction processing on the multimodal feature encoding after consistency processing based on the large language model that has completed model training, so as to obtain the power load scheduling result;
[0161] The large language model includes a spatiotemporal joint location embedding layer based on time-location encoding and geospatial encoding, an attention mechanism based on structural causal constraints, a contribution interpretation based on dynamic weight fusion of gating networks, and a scheduling strategy output layer containing power grid security constraint scheduling strategies.
[0162] Furthermore, the extraction module is specifically used to perform multi-scale feature extraction on the load time-series data through a temporal convolutional network to obtain a first feature; to perform semantic parsing on the meteorological text data through a pre-trained language model to obtain a second feature; to parse the entity relationships in the equipment log data through a heterogeneous graph neural network to obtain a third feature; and to encode the first feature, the second feature, and the third feature in the semantic space to obtain a multimodal feature encoding.
[0163] Furthermore, the device also includes:
[0164] The first construction module is used to build a spatiotemporal joint location embedding layer based on time location coding and geospatial coding.
[0165] The constraint module is used to constrain the attention layer based on structural causality;
[0166] The fusion module is used to perform weighted fusion of time-series pattern expert functions, power grid topology expert functions, and external factor expert functions based on a gated network to obtain the contribution interpretation.
[0167] The second building module is used to build a scheduling strategy output layer that includes power grid security constraint scheduling strategies;
[0168] The training module is used to construct the large language network based on the spatiotemporal joint location embedding layer, the attention layer, the contribution interpretation, and the scheduling policy output layer to obtain the large language model, and to train the large language model based on the training sample set.
[0169] Furthermore, the acquisition module is also used to acquire the stability reward, environmental protection reward, and economic reward of the power grid, and to perform weighted fusion based on the stability reward, the environmental protection reward, and the economic reward to obtain a multi-objective reward function, so as to constrain the large language model based on the multi-objective reward function.
[0170] Furthermore,
[0171] The first construction module is specifically used to generate a location embedding vector of the load time series data through periodic basis function encoding, and generate the time location code based on the location embedding vector and the nonlinear time evolution law representation; obtain the grid node coordinates, and perform hierarchical encoding on the grid node coordinates to obtain multi-level strings; perform weighted fusion on the multi-level strings after extracting the embedding vector, and perform spatial encoding based on the grid topology impedance parameters and the weighted fused strings to obtain the geospatial code; and construct the spatiotemporal joint location embedding layer based on the time location code and the geospatial code.
[0172] Furthermore,
[0173] The constraint module is specifically used to determine the causal effects between estimated variables of the power dispatching procedure text through a dual machine learning algorithm, and to construct a causal mask matrix based on the causal effects between the estimated variables; and to constrain the attention mechanism layer of the large language model through the causal mask matrix.
[0174] Furthermore,
[0175] The fusion module is specifically used to construct a time-series model expert function based on a deep learning network with Fourier basis functions; construct a power grid topology expert function based on a graph diffusion network with node admittance matrices; construct an external factor expert function by fusing meteorological text data and economic indicator data; after determining the system state based on the time-series model expert function, the power grid topology expert function, and the external factor expert function, generate expert weights, and perform weighted fusion based on the expert weights, the time-series model expert function, the power grid topology expert function, and the external factor expert function to obtain the contribution explanation.
[0176] This application provides a power load dispatching device based on a large language model. Compared with the prior art, this application obtains dispatching text data of power load, which includes load time series data, meteorological text data, equipment log data, and power grid index data. Features are extracted from the dispatching text data to obtain multimodal features, which are then encoded into a semantic space to obtain multimodal feature encoding. Based on a large language model that has completed model training, the multimodal feature encoding after consistency processing is used for dispatching prediction processing to obtain power load dispatching results. The large language model includes a spatiotemporal joint location embedding layer based on time-location encoding and geospatial encoding, an attention mechanism based on structural causal constraints, a contribution explanation based on dynamic weight fusion of gating networks, and a dispatching strategy output layer containing power grid security constraint dispatching strategies. This maximizes the absorption of distributed energy and optimizes dispatching strategies under power grid security constraints, minimizing energy waste and improving the accuracy and efficiency of power load dispatching.
[0177] According to one embodiment of this application, a storage medium is provided, the storage medium storing at least one executable instruction, which can execute the power load dispatching method based on a large language model in any of the above method embodiments.
[0178] Figure 6 The diagram shows a structural schematic of a terminal according to one embodiment of the present application. The specific embodiments of the present application do not limit the specific implementation of the terminal.
[0179] like Figure 6As shown, the terminal may include: a processor 302, a communications interface 304, a memory 306, and a communications bus 308.
[0180] The processor 302, communication interface 304, and memory 306 communicate with each other via communication bus 308.
[0181] Communication interface 304 is used to communicate with other network elements such as clients or other servers.
[0182] The processor 302 is used to execute program 310, specifically to execute the relevant steps in the above embodiment of the power load dispatching method based on a large language model.
[0183] Specifically, program 310 may include program code that includes computer operation instructions.
[0184] Processor 302 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application. The terminal includes one or more processors, which may be processors of the same type, such as one or more CPUs; or they may be processors of different types, such as one or more CPUs and one or more ASICs.
[0185] Memory 306 is used to store program 310. Memory 306 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.
[0186] Specifically, program 310 can be used to cause processor 302 to perform the following operations:
[0187] Acquire power load dispatch text data, which includes load time sequence data, meteorological text data, equipment log data, and power grid index data;
[0188] Feature extraction is performed on the scheduling text data to obtain multimodal features, and the multimodal features are encoded into the semantic space to obtain multimodal feature encoding;
[0189] Based on the large language model that has completed model training, the multimodal feature encoding after consistency processing is used for scheduling prediction processing to obtain the power load scheduling result;
[0190] The large language model includes a spatiotemporal joint location embedding layer based on time-location encoding and geospatial encoding, an attention mechanism based on structural causal constraints, a contribution interpretation based on dynamic weight fusion of gating networks, and a scheduling strategy output layer containing power grid security constraint scheduling strategies.
[0191] Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.
[0192] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A power load dispatching method based on a large language model, characterized in that, include: Acquire power load dispatch text data, which includes load time sequence data, meteorological text data, equipment log data, and power grid index data; Feature extraction is performed on the scheduling text data to obtain multimodal features, and the multimodal features are encoded into the semantic space to obtain multimodal feature encoding; Based on the large language model that has completed model training, the multimodal feature encoding after consistency processing is used for scheduling prediction processing to obtain the power load scheduling result; The large language model includes a spatiotemporal joint location embedding layer based on temporal location encoding and geospatial encoding, an attention mechanism based on structural causal constraints, a contribution interpretation based on dynamic weight fusion of gating networks, and a scheduling strategy output layer containing power grid security constraint scheduling strategies. Before performing scheduling prediction processing on the multimodal feature encoding after consistency processing based on the large language model that has completed model training to obtain the power load scheduling result, the method further includes: A spatiotemporal joint location embedding layer is constructed based on temporal location coding and geospatial coding; Constraining the attention layer based on structural causality; Based on the gating network, the contribution interpretation is obtained by weighting and fusing the time-series pattern expert function, the power grid topology expert function and the external factor expert function. Construct a scheduling policy output layer that includes power grid security constraint scheduling strategies; The large language network is constructed based on the spatiotemporal joint location embedding layer, the attention layer, the contribution interpretation, and the scheduling policy output layer to obtain the large language model, and the large language model is trained based on the training sample set. The spatiotemporal joint location embedding layer constructed based on time location coding and geospatial coding includes: The location embedding vector of the load time series data is generated by encoding with periodic basis functions, and the time location code is generated based on the location embedding vector and the nonlinear time evolution law. Obtain the coordinates of the power grid nodes and perform hierarchical encoding on the coordinates to obtain multi-level strings; The multi-level strings after the embedded vector is extracted are weighted and fused, and spatial encoding is performed based on the power grid topology impedance parameters and the weighted and fused strings to obtain the geospatial code; The spatiotemporal joint location embedding layer is constructed based on the time location encoding and the geospatial encoding.
2. The method according to claim 1, characterized in that, The step of extracting features from the scheduling text data to obtain multimodal features, and encoding the multimodal features into the semantic space, includes: The first feature is obtained by performing multi-scale feature extraction on the load time-series data using a temporal convolutional network. The meteorological text data is semantically parsed using a pre-trained language model to obtain the second feature; The entity relationships in the device log data are analyzed using a heterogeneous graph neural network to obtain the third feature; The first feature, the second feature, and the third feature are encoded in the semantic space to obtain multimodal feature encoding.
3. The method according to claim 1, characterized in that, The method further includes: The system obtains the stability reward, environmental reward, and economic reward of the power grid, and performs a weighted fusion of the stability reward, environmental reward, and economic reward to obtain a multi-objective reward function, which is then used to constrain the large language model.
4. The method according to claim 1, characterized in that, The constraint on the attention layer based on structural causality includes: The causal effects among the estimated variables of the power dispatching procedure text are determined by a dual machine learning algorithm, and a causal mask matrix is constructed based on the causal effects among the estimated variables. The attention mechanism layer of the large language model is constrained by the causal mask matrix.
5. The method according to claim 1, characterized in that, The contribution explanation obtained by weighting and fusing the time-series pattern expert function, the power grid topology expert function, and the external factor expert function based on the gated network includes: Constructing temporal pattern expert functions based on deep learning networks with Fourier basis functions; Constructing power grid topology expert functions based on graph diffusion networks with node admittance matrices; An expert function for external factors is constructed by integrating meteorological text data and economic indicator data. After determining the system state based on the time-series pattern expert function, the power grid topology expert function, and the external factor expert function, expert weights are generated. Then, based on the expert weights, the time-series pattern expert function, the power grid topology expert function, and the external factor expert function, a weighted fusion is performed to obtain the contribution explanation.
6. A power load dispatching device based on a large language model, characterized in that, include: The acquisition module is used to acquire power load dispatch text data, which includes load time series data, meteorological text data, equipment log data, and power grid index data. The extraction module is used to extract features from the scheduling text data to obtain multimodal features, and encode the multimodal features into the semantic space to obtain multimodal feature encoding; The processing module is used to perform scheduling prediction processing on the multimodal feature encoding after consistency processing based on the large language model that has completed model training, so as to obtain the power load scheduling result; The large language model includes a spatiotemporal joint location embedding layer based on temporal location encoding and geospatial encoding, an attention mechanism based on structural causal constraints, a contribution interpretation based on dynamic weight fusion of gating networks, and a scheduling strategy output layer containing power grid security constraint scheduling strategies. The device further includes: The first construction module is used to build a spatiotemporal joint location embedding layer based on time location coding and geospatial coding. The constraint module is used to constrain the attention layer based on structural causality; The fusion module is used to perform weighted fusion of time-series pattern expert functions, power grid topology expert functions, and external factor expert functions based on a gated network to obtain the contribution interpretation. The second building module is used to build a scheduling strategy output layer that includes power grid security constraint scheduling strategies; The training module is used to construct the large language network based on the spatiotemporal joint location embedding layer, the attention layer, the contribution interpretation, and the scheduling policy output layer to obtain the large language model, and to train the large language model based on the training sample set. The first construction module is specifically used to generate a location embedding vector of the load time series data through periodic basis function encoding, and generate the time location code based on the location embedding vector and the nonlinear time evolution law representation; obtain the grid node coordinates, and perform hierarchical encoding on the grid node coordinates to obtain multi-level strings; perform weighted fusion on the multi-level strings after extracting the embedding vector, and perform spatial encoding based on the grid topology impedance parameters and the weighted fused strings to obtain the geospatial code; and construct the spatiotemporal joint location embedding layer based on the time location code and the geospatial code.
7. A computer-readable storage medium having a computer program / instructions stored thereon, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method of claim 1.
8. A computer device, comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the steps of the method of claim 1.