Bi-directional cross-modal alignment-based regional building group load prediction method and system

The regional building cluster load forecasting method based on bidirectional cross-modal alignment solves the problem of discrepancies between building load time series and text prompts. Through bidirectional cross-modal cross-attention calibration and large language model modeling, high-precision load forecasting is achieved, which is applicable to energy management and scheduling of regional building clusters.

CN123180797APending Publication Date: 2026-11-27TONGJI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611709555.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-11-02
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Existing building load forecasting methods struggle to achieve effective cross-modal interaction and information calibration when dealing with the differences between building load time series and text prompts, leading to inaccurate forecasting results. This is particularly true in load forecasting of regional building clusters, where existing methods lack mechanisms to differentiate and utilize different semantic information, resulting in redundant semantic interference and low forecasting accuracy.

Method used

A regional building cluster load forecasting method with bidirectional cross-modal alignment is adopted. By acquiring the historical electrical load, meteorological variables and time variables of multiple buildings, a unified timestamp input window is constructed and divided into time series segments and text representations. Cross-attention calibration is performed using a bidirectional cross-modal alignment module to form a joint representation. Finally, the data is input into a large language model for contextual modeling to perform load forecasting.

Benefits of technology

It significantly improved the accuracy of single-step and multi-step load forecasting for regional building clusters. While maintaining the core parameters of the large language model frozen, it achieved bidirectional, controlled calibration between load time series representation and text prompt representation, thereby improving forecasting performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123180797A_ABST
    Figure CN123180797A_ABST
Patent Text Reader

Abstract

The application provides a bidirectional cross-modal alignment regional building group load prediction method and system, comprising: obtaining input variables, aligning according to a unified timestamp and constructing a historical input window; dividing the historical input window into time sequence segments along the time dimension, obtaining time sequence representation through a shared time sequence embedding layer and a time sequence projection layer; constructing a text prompt to obtain a text representation; inputting the time sequence representation and the text representation into a bidirectional cross-modal alignment module, respectively executing first cross attention and second cross attention, and performing gated residual update to obtain calibrated time sequence representation and calibrated text representation; splicing to form joint representation, inputting the joint representation into a model for context modeling; extracting hidden states to obtain context representation, and obtaining load prediction results of one or more time steps of multiple buildings in the future through a linear prediction head; the application can significantly improve the single-step and multi-step load prediction accuracy of the regional building group, and can maintain good performance under different prediction time intervals.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of building load forecasting technology, and specifically to a method and system for forecasting regional building cluster loads through bidirectional cross-modal alignment. Background Technology

[0002] Against the backdrop of green and low-carbon energy transformation and continuous urbanization, the building sector has become a crucial area for energy consumption and carbon emission control. As urban buildings become increasingly concentrated, the focus of building energy management is gradually expanding from individual buildings to building clusters in campuses, industrial parks, and urban areas. Accurately understanding the future electricity demand of building clusters is a vital foundation for conducting energy supply and demand balancing, demand response, equipment operation optimization, and regional integrated energy dispatch. Building loads are influenced by various factors such as historical operating conditions, meteorological conditions, time cycles, building functions, and human activities, exhibiting periodicity, volatility, and nonlinearity. Therefore, it is necessary to utilize historical monitoring data to reliably predict the future loads of multiple buildings within a region.

[0003] Existing building load forecasting methods mainly include physical models and data-driven models. Physical models simulate building loads by describing mechanisms such as building heat transfer processes, equipment operation, and human activities, offering a degree of interpretability. However, they typically rely on relatively complete building physical parameters and operational settings, resulting in high modeling and calibration costs and making it difficult to quickly extend to scenarios with a large number of buildings. Data-driven models are usually trained around specific numerical data and forecasting tasks. Their predictive capabilities mainly derive from time-series patterns in historical samples, and textual information such as forecasting task descriptions, data backgrounds, and building operational patterns is difficult to directly incorporate into model calculations.

[0004] In recent years, pre-trained large language models have provided new approaches to time series prediction due to their contextual representation capabilities. To reduce training costs, some methods keep the core parameters of the large language model frozen, training only the temporal mapping and prediction-related modules. These methods still rely primarily on numerical temporal features for prediction, while attempting to utilize textual prompts to provide task constraints and auxiliary semantic information for time series prediction, thereby transferring the pre-trained contextual representation capabilities of large language models to the load prediction task.

[0005] However, building load time series and textual prompts differ in data format and representation distribution: the former describes continuous numerical changes, local fluctuations, and periodic patterns, while the latter uses discrete terms to describe the prediction task, sample state, and scene background. Existing methods, such as direct concatenation, independent encoding, or unidirectional cross-modal interaction, struggle to adequately address these differences. Direct concatenation relies primarily on freezing the large language model internally to passively establish connections between the two types of information. Independent encoding followed by fusion lacks deep interaction during the input phase. Unidirectional cross-attention can only update the time series representation using textual information, or update the textual representation using time series information; it cannot simultaneously guide the time series features with textual information and reverse-calibrate the textual representation with the current time series state. Furthermore, if the information generated by cross-attention is directly superimposed onto the original representation, weakly correlated semantic content or local numerical fluctuations may be over-introduced. For large language models with frozen backbone parameters, their internal parameters cannot be further corrected for mismatches between input representations through domain fine-tuning; therefore, the interaction method and injection intensity of cross-modal information directly affect subsequent prediction results. Furthermore, existing temporal prediction methods based on large language models typically employ fixed text templates or directly combine task descriptions, statistical information, and domain background into text prefixes, lacking mechanisms for distinguishing and utilizing different semantic information. When some semantic information in structured prompts is weakly related to the current temporal state or prediction task, introducing all prompt information into the model indiscriminately may cause redundant semantic interference. How to differentiate and weight different prompt lexical units according to the current temporal state and reasonably control the injection intensity of prompt information into the temporal representation remains a problem that existing technologies need to solve. Summary of the Invention

[0006] This invention is made to solve the above-mentioned problems, and aims to provide a method and system for predicting the load of regional building complexes with bidirectional cross-modal alignment.

[0007] This invention provides a bidirectional cross-modal alignment method for regional building cluster load forecasting, characterized by the following steps: Step S1, acquiring historical electrical load, meteorological variables, and time variables of multiple buildings within a region, using them as input variables, aligning them according to a unified timestamp, and constructing a historical input window; Step S2, for the input variables, dividing the historical input window into time-series segments along the time dimension, and obtaining a time-series representation through a shared time-series embedding layer and a time-series projection layer; Step S3, constructing text prompts corresponding to the input variables, and obtaining a text representation through a large language model input embedding layer after word segmentation and core parameter freezing; Step S4, inputting the time-series representation and text representation into a bidirectional cross-modal alignment module, and executing queries based on the time-series representation and the text representation respectively. The first cross-attention is represented as key and value, and the second cross-attention is represented as text query and time sequence as key and value. The outputs of the first cross-attention and the second cross-attention are updated by gating residuals using two independent learnable gating parameters to obtain the calibrated time sequence representation and the calibrated text representation. In step S5, the calibrated time sequence representation and text representation are concatenated along the word dimension to form a joint representation, which is input into the large language model with frozen backbone parameters for context modeling. In step S6, the hidden states are extracted from the output of the large language model with frozen backbone parameters to obtain the context representation corresponding to the time sequence segment. The load prediction results of multiple buildings in the region for one or more time steps in the future are obtained through the linear prediction head.

[0008] The bidirectional cross-modal aligned regional building cluster load forecasting method provided by this invention may also have the following features: Step S1 includes the following sub-steps: Step S10, dividing the multivariate time series into a training set, a validation set, and a test set; Step S11, calculating the mean and standard deviation of the input variables using only the training set, and performing Z-score standardization on the training set, validation set, and test set to obtain standardized data; Step S12, constructing historical input windows and future load labels based on the standardized data; Step S13, performing window-level reversible normalization on the historical input windows and saving the corresponding window mean and standard deviation.

[0009] The bidirectional cross-modal aligned regional building load forecasting method provided by this invention may also have the following features: before constructing the historical input window, it further includes: using only the training set to screen candidate auxiliary variables; calculating the Spearman rank correlation coefficient between the candidate auxiliary variables and each building load variable, and including candidate auxiliary variables whose absolute values ​​are greater than the first correlation threshold into the preliminary candidate set; calculating the correlation between candidate auxiliary variables in the preliminary candidate set, and removing variables whose absolute values ​​of the correlation coefficients are greater than the second correlation threshold or whose physical meanings are highly similar; retaining building electrical load variables, regional total load variables, meteorological variables, and time variables as input variables.

[0010] The bidirectional cross-modal aligned regional building cluster load prediction method provided by this invention may also have the following features: wherein, in step S2, dividing the historical input window into temporal segments along the time dimension includes: adjusting the input tensor into a variable sequence, copying the last observation at the end of the variable sequence, dividing it into overlapping temporal segments along the time dimension according to the segment length and sliding step size; after merging the batch dimension and the variable dimension, obtaining the initial temporal representation through a shared one-dimensional convolutional temporal embedding layer and random deactivation processing, and then mapping it to the same embedding dimension as the large language model input with frozen backbone parameters to obtain the temporal representation.

[0011] The bidirectional cross-modal aligned regional building cluster load prediction method provided by the present invention may also have the following feature: wherein, in step S3, the text prompt includes one or more semantic fragments from the task description, input statistics, time prior, building energy consumption domain prior and data background, and the semantic fragments are combined in a preset order.

[0012] The bidirectional cross-modal aligned regional building cluster load prediction method provided by the present invention may also have the following feature: before step S4, it further includes: using mutually independent linear projection layers to map the temporal representation and text representation into temporal projection representation and text projection representation, respectively.

[0013] The bidirectional cross-modal aligned regional building cluster load prediction method provided by this invention may also have the following features: wherein, the gated residual update specifically includes: multiplying the output of the first cross-attention with the value obtained by the first learnable gate parameter through the Sigmoid function element by element, then adding it to the time-series representation before the update and performing layer normalization; multiplying the output of the second cross-attention with the value obtained by the second learnable gate parameter through the Sigmoid function element by element, then adding it to the text representation before the update and performing layer normalization; both the first cross-attention and the second cross-attention are multi-head cross-attention.

[0014] The bidirectional cross-modal aligned regional building cluster load prediction method provided by this invention may also have the following features: step S5 includes the following sub-steps: step S50, placing the calibrated text representation at the beginning and the calibrated temporal representation at the end; step S51, concatenating the calibrated text representation and the calibrated temporal representation in lexical order to obtain a joint representation; step S52, inputting the joint representation into the large language model with frozen backbone parameters in an embedded form for context modeling.

[0015] The bidirectional cross-modal aligned regional building load prediction method provided by the present invention may also have the following features, including: step S7, generating local prediction results from the time-series representation through a local prediction head, and fusing it with the load prediction results according to the learnable fusion weights corresponding to the prediction positions to obtain the fusion result, and using the window mean and standard deviation saved in step S13 and the mean and standard deviation of the training set in step S11 to perform an inverse transformation on the fusion result to restore it to the actual building load scale.

[0016] This invention also provides a bidirectional cross-modal aligned regional building cluster load forecasting system, characterized by the following features: a data acquisition module for acquiring historical electrical loads, meteorological variables, and time variables of multiple buildings within a region, using these as input variables, aligning them according to a unified timestamp, and constructing a historical input window; a time-series representation generation module for dividing the historical input window into time-series segments along the time dimension for the input variables, obtaining a time-series representation through a shared time-series embedding layer and a time-series projection layer; a text representation generation module for constructing text prompts corresponding to the input variables, obtaining a text representation through a word segmenter and a large language model input embedding layer with frozen backbone parameters; and a bidirectional cross-modal alignment module for receiving the time-series representation and the text representation, and executing queries based on the time-series representation, respectively. The system employs a first cross-attention module, which uses text representation as keys and values, and a second cross-attention module, which uses text representation as queries and temporal representation as keys and values. Two independent, learnable gating parameters are used to update the outputs of the first and second cross-attention modules, respectively, to obtain calibrated temporal and text representations. A context modeling module concatenates the calibrated temporal and text representations along the lexical dimension to form a joint representation, which is then input into a large language model with frozen backbone parameters for context modeling. A prediction and decoding module extracts hidden states from the output of the large language model with frozen backbone parameters to obtain the context representation corresponding to the temporal segment. This is then processed by a linear prediction head to obtain the load prediction results for multiple buildings within the region for one or more future time steps.

[0017] The role and effect of invention

[0018] The method and system for predicting regional building cluster loads according to the present invention includes the following steps: Step S1, acquiring historical electrical loads, meteorological variables, and time variables of multiple buildings in the region, using them as input variables, aligning them according to a unified timestamp, and constructing a historical input window; Step S2, for the input variables, dividing the historical input window into time-series segments along the time dimension, and obtaining a time-series representation through a shared time-series embedding layer and a time-series projection layer; Step S3, constructing text prompts corresponding to the input variables, and obtaining a text representation through a word segmenter and a large language model with frozen backbone parameters input to the embedding layer; Step S4, inputting the time-series representation and text representation into a bidirectional cross-modal alignment module, performing a first cross-attention with the time-series representation as the query and the text representation as the key and value, and a second cross-attention with the text representation as the query and the time-series representation as the key and value, respectively, and using two independent learnable gating parameters to respectively perform the second cross-attention with the time-series representation as the query and the text representation as the key and value. The outputs of the first and second cross-attention methods are used for gated residual updates to obtain calibrated temporal representations and calibrated text representations. In step S5, the calibrated temporal representations and text representations are concatenated along the lexical dimension to form a joint representation, which is then input into a large language model with frozen backbone parameters for context modeling. In step S6, the hidden states are extracted from the output of the large language model with frozen backbone parameters to obtain the context representation corresponding to the temporal segment. The load prediction results for one or more time steps of multiple buildings in the region are obtained through a linear prediction head. Therefore, the bidirectional cross-modal aligned regional building cluster load prediction method and system of the present invention, while keeping the backbone parameters of the large language model frozen, achieves bidirectional, controlled calibration between the load temporal representation and the text prompt representation through the bidirectional cross-modal alignment module, thereby significantly improving the accuracy of single-step and multi-step load prediction for regional building clusters and maintaining good performance under different prediction time intervals. Attached Figure Description

[0019] Figure 1 This is a flowchart illustrating the bidirectional cross-modal aligned regional building cluster load prediction method in an embodiment of the present invention.

[0020] Figure 2 This is a schematic diagram of the structure of the bidirectional cross-modal alignment module in an embodiment of the present invention.

[0021] Figure 3 This is a schematic diagram of the prediction performance of each model under different prediction step sizes in the embodiments of the present invention. Subplots (a), (b), and (c) represent the building-level average MAE, MAPE, and R², respectively, and subplots (d), (e), and (f) represent the regional aggregated MAE, MAPE, and R², respectively.

[0022] Figure 4This is a schematic diagram of ablation experiment results for different cross-modal alignment methods in embodiments of the present invention. Subplots (a), (b), and (c) represent building-level average MAE, MAPE, and R², respectively, while subplots (d), (e), and (f) represent region-aggregated MAE, MAPE, and R², respectively.

[0023] Figure 5 This is a schematic diagram of the single-step prediction performance of each model under different seasons in an embodiment of the present invention. Subplots (a), (b), and (c) represent the building-level average MAE, MAPE, and R², respectively, and subplots (d), (e), and (f) represent the regional aggregated MAE, MAPE, and R², respectively.

[0024] Figure 6 This is a schematic diagram of the hourly relative error distribution of aggregated load in each model region under different seasons in an embodiment of the present invention.

[0025] Figure 7 This is a schematic diagram illustrating the prediction performance under different structured cue configurations and prediction step sizes in embodiments of the present invention. Subplot (a) shows the building-level average index, and subplot (b) shows the regional aggregate index.

[0026] Figure 8 This is a schematic diagram illustrating the semantic segment attention percentage under different structured cue configurations and prediction step sizes in embodiments of the present invention. Subgraphs (a), (b), and (c) represent the normalized attention percentages when the prediction step sizes are 1 h, 24 h, and 168 h, respectively.

[0027] Figure 9 This is a schematic diagram of the modules of the bidirectional cross-modal aligned regional building cluster load prediction system in an embodiment of the present invention. Detailed Implementation

[0028] To make the technical means, creative features, objectives and effects of the present invention easy to understand, the following embodiments, in conjunction with the accompanying drawings, specifically illustrate the method and system for predicting regional building cluster loads of the present invention with bidirectional cross-modal alignment.

[0029] Example

[0030] Figure 1 This is a flowchart illustrating the bidirectional cross-modal aligned regional building cluster load prediction method in an embodiment of the present invention.

[0031] like Figure 1 As shown, this embodiment provides a two-way cross-modal aligned regional building cluster load forecasting method, including:

[0032] Step S1: Obtain the historical electrical load, meteorological variables, and time variables of multiple buildings in the area, use them as input variables, align them with a unified timestamp, and construct a historical input window.

[0033] Step S1 includes the following sub-steps:

[0034] Step S10: Divide the multivariate time series into a training set, a validation set, and a test set.

[0035] Before constructing the history input window, the following is also included:

[0036] Candidate auxiliary variables are screened using only the training set: Spearman rank correlation coefficients between candidate auxiliary variables and each building load variable are calculated, and candidate auxiliary variables with absolute values ​​greater than the first correlation threshold are included in the preliminary candidate set; the correlation between candidate auxiliary variables in the preliminary candidate set is calculated, and variables with absolute values ​​of correlation coefficients greater than the second correlation threshold or with highly similar physical meanings are removed; building electrical load variable, regional total load variable, meteorological variable, and time variable are retained as input variables.

[0037] In this embodiment, the first correlation threshold is 0.25 and the second correlation threshold is 0.5.

[0038] Step S11: Calculate the mean and standard deviation of the input variables using only the training set, and perform Z-score standardization on the training, validation, and test sets to obtain standardized data. This avoids using validation and test set information in model training.

[0039] Step S12: Construct historical input windows and future load labels based on standardized data.

[0040] Let the standardized observation vector at time t be... This includes M building load variables and K auxiliary variables. For the prediction starting point t, the observation vectors of its previous L consecutive time steps are used. Stacked along the time dimension, they form a historical input matrix:

[0041]

[0042] Stack the load variables of M buildings at consecutive H time points after the prediction start point along the time dimension to form future load labels (prediction labels): ,in, This represents the load vector of Building M at the first time point after the prediction starting point t. This represents the load vector of M buildings at the H-th time after the prediction starting point t, where H represents the prediction step size and M represents the number of buildings to be predicted; the building load vectors at the next H time moments are stacked sequentially along the time dimension to form a vector with dimension t. The future load label.

[0043] The prediction starting point is moved according to a preset sliding interval, and multiple prediction samples are generated sequentially. The validation and test set samples can read historical data that has been observed before the prediction starting point, but the prediction label must be completely located within the corresponding data subset.

[0044] Step S13: Perform window-level reversible normalization on the historical input window and save the corresponding window mean and standard deviation.

[0045] Step S2: For the input variables, the historical input window is divided into time-series segments along the time dimension, and a time-series representation is obtained through a shared time-series embedding layer and a time-series projection layer.

[0046] After constructing the historical input window and normalizing the data, a batch input tensor is obtained. Let the batch size be... The length of the historical input is The number of input variables is The input tensor is then represented as: .

[0047] In step S2, dividing the historical input window into temporal segments along the time dimension includes: first adjusting the input tensor The dimensions of building load, meteorological variables, and time variables are arranged into independent historical sequences, and the input tensor is... Adjust to a variable sequence In the variable sequence End copy of the last observation Next, among them This is the sliding step size for time-series partitioning. It involves the variable sequence... According to the time dimension by segment length and sliding step size The time series is divided into overlapping time segments. The number of time segments corresponding to each variable. for:

[0048]

[0049] in, This represents the number of time segments obtained after each input variable is divided into blocks. This indicates the number of time steps contained in the history input window. This indicates the length of each time segment, i.e., the number of consecutive time steps contained in each segment. This represents the sliding step size between the start positions of adjacent time segments. Since this embodiment copies the last observation and fills in the end of the original sequence... There are 1 time steps, therefore the length of the padded sequence is 1. .

[0050] After segmentation, the temporal segment tensor is obtained: Batch maintenance (Batch size) and variable dimensions After merging (number of input variables), we get: All input variables share the same set of temporal embedding parameters. Each temporal segment is input into a learnable temporal embedding layer, and an initial temporal representation is obtained through a shared one-dimensional convolutional temporal embedding layer and random deactivation.

[0051]

[0052] in, This represents the shared temporal segment embedding layer. Its dimensions are: , This represents the initial temporal embedding dimension. Sharing embedding parameters enables different building loads and auxiliary variables to use a consistent segment encoding method, while preserving the variation characteristics of each variable in different local time intervals.

[0053] The temporal representation is obtained by linearly projecting the data onto the same embedding dimension as the large language model input with the trunk parameters frozen.

[0054] In this embodiment, due to the initial temporal embedding dimension Input dimensions of a large language model with frozen backbone parameters Unlike other methods, it employs a learnable temporal projection layer for dimension mapping to obtain the mapped temporal representation. :

[0055] in, and These represent the learnable weights and biases of the temporal projection layer, respectively. The dimensions of the mapped temporal representation are: .

[0056] Step S3: Construct text prompts corresponding to the input variables, and obtain text representations by inputting the large language model into the embedding layer after passing through a word segmenter and freezing the backbone parameters.

[0057] To provide auxiliary information such as load forecasting tasks and current input status to the large language model with frozen backbone parameters, this embodiment generates a text prompt for each input variable within a batch. Let the batch size be... The number of input variables is Each batch will then form a total of A text prompt, and the result obtained in step S2 The timing representation of the groups corresponds one-to-one.

[0058] The basic text prompt organizes three types of information using a preset natural language template: the first type is prediction task information, including historical input length, prediction step size, and prediction object. The second type is a statistical summary of the current historical window. The third type is data background information, including regional building clusters, data time resolution, and basic descriptions of load, meteorological, and time variables. The specific word order and number of fields in the text prompt can be adjusted according to the prediction task.

[0059] For the -th input variable in the -th sample, extract the minimum value, maximum value, median, overall trend, and main autocorrelation lag positions from its normalized historical window to form a statistical summary :

[0060]

[0061] wherein, the minimum value , the maximum value and the median describe the amplitude range and center position of the current window; the overall trend is determined according to the cumulative direction of differences between adjacent time instants; the main autocorrelation lag positions are obtained by calculating an autocorrelation sequence via fast Fourier transform and then selecting positions, and in one embodiment, 5 lag positions with the highest correlation are selected.

[0062] After filling the above information into the basic text template, a tokenizer supporting the large language model with frozen backbone parameters is used to convert the text into a token number sequence. Truncation or padding is performed on prompts of different lengths, and a prompt attention mask is generated. Subsequently, the input embedding layer of the large language model with frozen backbone parameters is invoked to map the basic text prompt to a text representation:

[0063]

[0064] wherein, represents a corresponding text representation; represents an input embedding mapping of the frozen large language model; represents a basic text representation corresponding to the n-th input variable in the b-th sample; ; and are the batch size and the number of input variables, respectively; represents a unified text token length, and d represents a text embedding dimension. In this embodiment, the maximum token length may be set to 192, with excess portions truncated and insufficient portions padded with padding tokens. The prompt attention mask takes a value of 1 at valid token positions and 0 at padding positions. After the above processing, the text representation and the time-series representation Having the same batch size and embedding dimension, they can form cross-modal input pairs corresponding to each variable.

[0065] In another implementation, the text prompts are divided into several types, including one or more semantic fragments from Task description, Statistics, Temporal prior, Domain prior for building energy consumption, and Dataset. The Temporal prior describes daily, weekly, and hourly effects, as well as recent load continuity; the Domain prior describes weather-load coupling, energy consumption differences between buildings, and load characteristics related to building functions. The semantic fragments are combined in a preset order and paired with the temporal fragments of the corresponding input variables to form a bidirectional cross-modal alignment module (BiCAL module). T0 to T3 represent different implementations of the structured prompts, as detailed in Table 1.

[0066] Table 1. Structured hint configuration and its semantic components

[0067]

[0068] Independent linear projection layers are used to map temporal representation and text representation to temporal projection representation and text projection representation, respectively.

[0069] Although time sequence representation and text representation They already have the same embedding dimension However, they originate from different encoding processes. The bidirectional cross-modal alignment module first utilizes independent linear projection layers to form a temporal projection representation Tproj and a text projection representation Pproj for cross-attention computation:

[0070]

[0071]

[0072] in, , , and These are trainable parameters. Two projection layers adjust the distribution of the temporal representation and the text representation, respectively, while keeping the word length of both constant.

[0073] For the The first sample Let there be input variables, and their time-series representation and text representation after linear projection be respectively:

[0074]

[0075] in, Indicates the number of time segments. Indicates the number of words in the text. This indicates a unified embedding dimension.

[0076] Figure 2 This is a schematic diagram of the structure of the bidirectional cross-modal alignment module in an embodiment of the present invention.

[0077] like Figure 2 As shown, Figure 2 The text embedding and temporal embedding in the figure correspond to the text representation P obtained in step S3 and the temporal representation T obtained in step S2, respectively. Here, Q, K, and V represent the query matrix, key matrix, and value matrix in the cross-attention calculation, respectively. In the first cross-attention where the temporal representation queries the text representation, Q is generated from the temporal projection representation, and K and V are generated from the text projection representation; in the second cross-attention where the text representation queries the temporal representation, Q is generated from the text projection representation, and K and V are generated from the temporal projection representation. Softmax in the figure represents the normalization of the correlation calculation results between the query matrix and the key matrix. The normalized attention weights are multiplied by the value matrix to obtain the cross-modal information in the corresponding direction.

[0078] Step S4: Input the temporal representation and text representation into the bidirectional cross-modal alignment module. Perform a first cross-attention operation with the temporal representation as the query and the text representation as the key and value, and a second cross-attention operation with the text representation as the query and the temporal representation as the key and value. Update the gated residuals of the outputs of the first and second cross-attention operations using two independent learnable gating parameters, respectively, to obtain the calibrated temporal representation and the calibrated text representation. The structure of the bidirectional cross-modal alignment module is as follows: Figure 2 As shown.

[0079] The first cross-attention calculation enables each time segment to extract semantic information related to the prediction task and the current input state from the text prompts, while the second cross-attention enables the text representation to be reverse-calibrated based on the numerical change pattern in the current history window.

[0080] Specifically, the gated residual update includes: multiplying the output of the first cross-attention by the value obtained by the first learnable gate parameter through the Sigmoid function element by element, adding it to the temporal representation before the update, and then performing layer normalization.

[0081] The output of the second cross-attention is multiplied element-wise with the value of the second learnable gating parameter obtained by the Sigmoid function, then added to the text representation before the update and layer normalization is performed.

[0082] The first cross-attention, the second cross-attention, and the gated residual update are respectively represented as:

[0083]

[0084]

[0085] in, This indicates a multi-headed cross-attention operation. and Let represent the learnable gating parameter vectors for the first cross-attention and the second cross-attention, respectively. This represents the Sigmoid function. This represents element-wise multiplication. Representation layer normalization.

[0086] The two gate parameters are independent and are used to control the injection intensity of text information into the temporal representation and the injection intensity of temporal information into the text representation, respectively. The residual connection is used to preserve the original representation before the cross-attention update, so as to avoid the over-injection of information from one modality and interference with the original features of another modality.

[0087] When the text prompt contains filler words, a text attention mask is used in the cross-attention calculation where text representations are used as keys and values, so that the filler positions do not participate in the attention weight calculation. All temporal segments are valid positions and do not require filler position masking. Both the first and second cross-attention are multi-head cross-attention. In this embodiment, 8-head cross-attention calculation is used in both directions.

[0088] Step S5: The calibrated temporal representation and text representation are concatenated along the lexical dimension to form a joint representation, which is then input into the large language model with frozen backbone parameters for context modeling.

[0089] Step S5 includes the following sub-steps:

[0090] Step S50: Place the calibrated text representation at the beginning and the calibrated timing representation at the end.

[0091] Step S51: Concatenate the calibrated text representation and the calibrated temporal representation in lexical order to obtain the joint representation. :

[0092]

[0093] This concatenation order enables the accurate retrieval of the large language model output corresponding to the time sequence segment through a fixed position index.

[0094] Step S52: Input the joint representation into the large language model with frozen backbone parameters in an embedded form for context modeling.

[0095] Step S6: Extract the hidden states from the output of the large language model with frozen backbone parameters to obtain the context representation corresponding to the time series segment, and obtain the load prediction results of multiple buildings in the region for one or more time steps in the future through the linear prediction head.

[0096] The specific steps for extracting hidden states from the output of a large language model with frozen backbone parameters are as follows:

[0097] After BiCAL bidirectional cross-modal alignment, the first In the nth sample The text and temporal representations of the input variables have been concatenated in text-first, temporal-second order to form a joint representation:

[0098]

[0099] in, Indicates the number of words in the text. Indicates the number of time segments. This represents the embedding dimension of a large language model.

[0100] In this embodiment, the joint representation is directly input into the backbone of the large language model as an embedding, without converting it into natural language lexical numbers. To avoid text padding positions participating in context calculations, the text attention mask and the temporally valid mask are concatenated in lexical order to obtain the joint attention mask:

[0101]

[0102] in, This represents a text attention mask used to distinguish between valid text terms and filler locations; Indicates length is A vector of all 1s indicates that all time segments are valid inputs.

[0103] By inputting the joint representation and its attention mask into a large language model with frozen backbone parameters, we obtain the context modeling results:

[0104]

[0105] in:

[0106]

[0107] This represents the hidden state sequence output by the large language model with its backbone parameters frozen, and its positional arrangement is consistent with the joint input. This represents a large language model with frozen backbone parameters. The large language model with frozen backbone parameters utilizes the context modeling capabilities obtained through pre-training to jointly process textual information and temporal information calibrated by BiCAL, providing contextual features for subsequent load prediction decoding.

[0108] During training, the core parameters of the large language model remain frozen, including its attention layer, feedforward network, layer normalization layer, and core embedding parameters. Only the trainable parameters in the temporal embedding module, BiCAL module, and subsequent prediction / decoding modules at the input front end of the large language model are updated. This allows for leveraging the contextual modeling capabilities of the pre-trained large language model while reducing the computational and storage resources required for fine-tuning the core parameters.

[0109] This embodiment only illustrates how the joint representation obtains the hidden state sequence after freezing the large language model. The process involves extracting the hidden states of time-series locations and generating future multi-building load values, all of which are completed in the subsequent prediction and decoding module.

[0110] The hidden state sequence output by the frozen big language model contains both text position and temporal position. Since the joint representation is input into the frozen big language model in text-first, temporal-last order, the hidden state sequence extracted from the output sequence... The hidden states at each position are used to obtain the context representation corresponding to the time segment:

[0111]

[0112] in, , This is the output hidden state vector corresponding to the first time segment. For the output hidden state vector corresponding to the last time segment, the temporal context representations corresponding to each input variable are flattened and mapped to the future using a trainable linear prediction head. The prediction results are obtained at each time step. After predicting all input variables, the results are extracted based on the preset target channel index. The load forecast results were obtained from each building load channel. :

[0113]

[0114] in, This represents a prediction head composed of feature flattening and linear mapping. This indicates the extraction of the target building's access route. The context representation tensor corresponding to all temporal segments in the output of the frozen large language model is represented as follows:

[0115]

[0116] Regional total load, meteorological variables, and time variables are involved in contextual modeling, but are not used as the final forecast target output.

[0117] Step S7: The time series representation is used to generate local prediction results through the local prediction head, and then fused with the load prediction results according to the learnable fusion weights corresponding to the prediction positions to obtain the fusion result. The fusion result is then inversely transformed using the window mean and standard deviation saved in step S13 and the mean and standard deviation of the training set in step S11 to restore it to the actual building load scale.

[0118] The specific process of step S7 is as follows:

[0119] To simultaneously preserve both the temporal information before entering the large language model and the global information after contextual modeling by the large language model, the temporal representation before input to the large language model is used to generate local prediction results through a local prediction head. and with load forecast results To integrate.

[0120] In response to the future Learnable parameters can be set for each predicted location. The fusion process is represented as:

[0121] in, Learnable fusion weights corresponding to the predicted location, and shared across different samples and building channels. This represents the Sigmoid function; the subscripts b, h, and m indicate the predicted location of the m-th building in the b-th sample at the h-th future position. and These represent the local and global predicted loads at the corresponding predicted locations, respectively. ;right and By using learnable fusion weights for weighted summation, the fused predicted load at the corresponding predicted location is obtained. .

[0122] Finally, the prediction results are inversely transformed sequentially using the historical window normalization parameters and the training set normalization parameters to restore them to the actual building load scale, resulting in a dimension of [missing value]. The multi-building load forecast results. The regional aggregated load forecast can be obtained by summing the forecasts of each building at the same future time.

[0123] In this embodiment, the core parameters of the large language model are frozen during the model training phase, and the parameters of its input embedding layer, attention layer, feedforward network, and layer normalization layer are not updated. During training, only the parameters of the temporal segment embedding layer, temporal projection layer, bidirectional cross-attention parameters in the BiCAL module, gating parameters, and prediction decoding module parameters are updated. When local-global prediction fusion is used, the local prediction head, global prediction head, and fusion parameters corresponding to each prediction position are updated simultaneously.

[0124] The mean squared error between the model's predicted results and the actual building load is used as the training objective. For [the following]... Training batches of samples, length is Prediction interval and The target building, the loss function is expressed as:

[0125]

[0126] in, Indicates the first In the nth sample Building in the future Forecast load at each time step, This represents the corresponding actual load. The training loss is calculated on the scale of the normalized data and updated through backpropagation of the trainable modules mentioned above.

[0127] During training, a mini-batch optimization approach is employed. Gradient optimization algorithms such as Adam are used to update model parameters, and the learning rate is adjusted, model selection is performed, and early stopping is implemented based on the validation set error. The test set is not involved in parameter updates, feature selection, or hyperparameter selection. After training, the model parameters corresponding to the minimum validation set error are saved for subsequent regional building load prediction.

[0128] To verify the feasibility and technical effectiveness of the method of this invention, 10 buildings in a campus were selected as the prediction targets, and multi-source input data were constructed using hourly building load, regional total load, meteorological variables, and time variables. The experiment selected DLinear, Autoformer, PatchTST, iTransformer, and Time-LLM as comparative models, ensuring that each model used the same data partitioning, input variables, and evaluation range.

[0129] The mean absolute error (MAE), mean absolute percentage error (MAPE), and coefficient of determination (R²) are used to evaluate forecast performance. The building-level average index is calculated by averaging the forecasts for 10 buildings individually, while the regional aggregate index is calculated by summing the forecast loads for the 10 buildings. Lower MAE and MAPE, and higher R², indicate better forecast performance. The calculation formulas are as follows:

[0130]

[0131]

[0132]

[0133] Where n represents the total number of load observation points participating in the evaluation. ; This represents the actual load value at the i-th observation point. This represents the predicted load value at the i-th observation point. This represents the average of all actual load values. When calculating the regional aggregation index, and These two terms represent the actual regional load and the predicted regional load obtained by summing the loads of multiple buildings at the same time, respectively.

[0134] The following predictive performance experiments are used to verify the overall feasibility of BiCAL-LLM (a large language model containing the BiCAL module) of this invention. The independent technical role of BiCAL is further verified through ablation experiments with other conditions kept constant.

[0135] Figure 3 This is a schematic diagram of the prediction performance of each model under different prediction step sizes in the embodiments of the present invention. Subplots (a), (b), and (c) represent the building-level average MAE, MAPE, and R², respectively, and subplots (d), (e), and (f) represent the regional aggregated MAE, MAPE, and R², respectively.

[0136] Among them, the building-level average index is obtained by averaging the corresponding evaluation indexes calculated for each building; the regional aggregate index is obtained by first summing the actual load and predicted load of each building at the same time, and then calculating the corresponding evaluation index based on the formed regional aggregate load sequence.

[0137] The multi-prediction step-size experiment selected data from six consecutive months, from May to October 2018, and divided them into training, validation, and test sets according to a time ratio of 7:1:2. The historical input window length was set to 168 hours to cover a complete cycle. The prediction step-sizes were set to 24 hours, 48 ​​hours, 72 hours, and 168 hours to examine the applicability of the invention in daily to weekly load forecasting tasks. The experimental results are as follows: Figure 3 As shown in Table 2.

[0138] Table 2 Prediction performance of each model under different prediction step sizes

[0139]

[0140] As the prediction step size increases, the overall prediction error of each model rises, but the implementation model including the BiCAL mechanism achieves the best overall results under all four prediction step sizes. In the 168-hour prediction task, the building-level average MAE is 11.3806 kW, and the regional aggregated MAE is 81.5835 kW, which are 9.49% and 12.27% lower than the corresponding best baselines, respectively; the building-level average R² and the regional aggregated R² reach 0.6008 and 0.8236, respectively.

[0141] The above results show that when the prediction time interval is extended from the daily scale to the weekly scale, the present invention can still maintain an effective characterization of the load changes of each building and the overall load trend of the region, and maintain good performance under different prediction time intervals.

[0142] Figure 4 This is a schematic diagram of ablation experiment results for different cross-modal alignment methods in embodiments of the present invention. Subplots (a), (b), and (c) represent building-level average MAE, MAPE, and R², respectively, while subplots (d), (e), and (f) represent region-aggregated MAE, MAPE, and R², respectively.

[0143] The BiCAL ablation experiment used the same data from May to October 2018, a 7:1:2 time partitioning scheme, and a 168-hour historical input window as the multi-prediction-step experiment, with the prediction step size set to 24 hours. Under the condition that the data, training parameters, and other model structures remained unchanged, model variants were set up with the complete model, the BiCAL module removed, only text-to-time direction retained, and only time-to-text direction retained. The experimental results are as follows: Figure 4 As shown in Table 3.

[0144] Table 3. Ablation and comparison results of key modules and cross-modal alignment methods in the 24-hour prediction task.

[0145]

[0146] The building-level average MAE of the complete two-way aligned model is 7.6109 kW, and the regional aggregated MAE is 45.8043 kW. After removing BiCAL, the two indicators increased to 8.2244 kW and 51.1908 kW, respectively, representing increases of 8.06% and 11.76%.

[0147] Compared to the better-performing text-to-temporal one-way alignment model, the full two-way model reduces the building-level average MAE and MAPE by 3.76% and 5.29%, respectively, and the region-aggregated MAE and MAPE by 3.19% and 2.58%, respectively. This indicates that the guidance of text information on temporal representation can improve prediction results, and further performance gains can be obtained by using the current temporal state to back-calibrate the text representation.

[0148] Therefore, the technical effect of this invention does not come solely from the splicing of text and temporal representations or unidirectional information injection, but rather from the synergistic effect formed by cross-attention in two directions and gated residual updates.

[0149] Figure 5 This is a schematic diagram of the single-step prediction performance of each model under different seasons in an embodiment of the present invention. Subplots (a), (b), and (c) represent the building-level average MAE, MAPE, and R², respectively, and subplots (d), (e), and (f) represent the regional aggregated MAE, MAPE, and R², respectively.

[0150] Figure 6 This is a schematic diagram of the hourly relative error distribution of aggregated load in each model region under different seasons in an embodiment of the present invention.

[0151] The seasonal experiments selected three consecutive time periods: winter (January to March 2018), transition season (March to May 2018), and summer (June to August 2018). Data for each season was divided into training, validation, and test sets in a 7:1:2 time ratio. The historical input window length was set to 168 hours, and the prediction step size was set to 1 hour. The experimental results are as follows: Figure 5 As shown in Table 4, Figure 6 The distribution of hourly relative errors of regional aggregated loads for different models in the summer, winter, and transitional season test sets is further presented. For any time t in the test set, the relative error of regional aggregated loads is expressed as:

[0152]

[0153] in, and These represent the sum of the predicted load and the sum of the actual load for each building within the time zone t, respectively. When... When, it indicates that the predicted value is higher than the actual value; when When the predicted value is lower than the actual value, it indicates that the predicted value is lower than the actual value. The smaller the absolute value, the closer the predicted result is to the actual load. Each scatter point in the graph represents the regional aggregate load relative error of the corresponding model at a certain time in the test set; the middle line of the box represents the median, the upper and lower boundaries of the box represent the first and third quartiles, respectively, and the dashed line represents the error distribution range within 1.5 times the interquartile range; the horizontal dashed line represents a relative error of 0. Different colors correspond to different prediction models. The more concentrated the boxes are near 0 and the narrower the distribution range, the smaller the prediction bias and the better the stability of the model.

[0154] Table 4. Single-step prediction performance of each model under different seasonal windows.

[0155]

[0156] The implementation model incorporating the BiCAL mechanism achieved optimal results in both the building-level average index and the regional aggregate index across all three seasons. Compared to the optimal baselines for each season, its MAE decreased by 19.28% to 32.86%, and its MAPE decreased by 19.36% to 30.46%.

[0157] In the summer scenario, where load fluctuations and weather-driven factors are more pronounced, the building-level average MAE is 6.4010 kW and the regional aggregated MAE is 29.5617 kW, which are 32.86% and 30.61% lower than the corresponding optimal baseline, respectively; the building-level average R² and the regional aggregated R² reach 0.9541 and 0.9884, respectively.

[0158] The above results demonstrate that the present invention can maintain relatively stable predictive performance under different building operation conditions in winter, transitional season and summer, and can adapt to relatively complex load changes under the combined effects of summer cooling load and external meteorological factors.

[0159] Figure 7 This is a schematic diagram illustrating the prediction performance under different structured cue configurations and prediction step sizes in embodiments of the present invention. Subplot (a) shows the building-level average index, and subplot (b) shows the regional aggregate index.

[0160] The building-level average indicators in subfigure (a) are calculated for each building separately using the mean absolute error (MAE), mean absolute percentage error (MAPE), and coefficient of determination (R). 2 The average is then taken; in subgraph (b), the regional aggregation index is obtained by first summing the actual load and predicted load of each building at the same time, and then calculating MAE, MAPE and R based on the formed regional aggregated load sequence. 2 . Figure 7 The rows correspond to 1-hour, 24-hour, and 168-hour prediction step sizes, respectively, and the columns correspond to MAE, MAPE, and R. 2 Evaluation metrics. T0 to T3 in each cell represent the structured cue configurations that achieve the optimal results under the corresponding prediction step size and evaluation metrics. The values ​​in the cells represent the corresponding evaluation metric values ​​for that cue configuration. Different fill colors are used to distinguish the four cue configurations from T0 to T3. For MAE and MAPE, the cue configuration with the lowest value is the optimal configuration; for R... 2 The configuration with the highest value is the optimal configuration.

[0161] Table 5. Prediction performance under different structured cue configurations and prediction step sizes.

[0162]

[0163] To examine the impact of the structured cue composition on prediction results, data from May to October 2018 were used to compare four cue configurations (T0 to T3) under 1-hour, 24-hour, and 168-hour prediction tasks. The results are as follows: Figure 7 Table 5 shows that adding semantic fragments does not necessarily improve prediction performance. In the 1-hour prediction, T0 achieved the best numerical results on most indicators, but the differences between different configurations were small. In the 24-hour prediction, T1 performed better on building-level indicators, while T2 performed better on regional aggregation indicators. In the 168-hour prediction, the optimal configurations for different evaluation indicators further diverged, and no single, consistently dominant suggestion scheme emerged. These results indicate that the effectiveness of suggestion information is related to the prediction scale and evaluation objectives. The key lies not in increasing the quantity of suggestion content, but in whether the suggestion information can effectively interact with the current task.

[0164] Figure 8 This is a schematic diagram illustrating the semantic segment attention percentage under different structured cue configurations and prediction step sizes in embodiments of the present invention. Subgraphs (a), (b), and (c) represent the normalized attention percentages when the prediction step sizes are 1 h, 24 h, and 168 h, respectively.

[0165] Figure 8 Subgraphs (a) to (c) correspond to prediction tasks of 1 h, 24 h, and 168 h, respectively. The vertical axis represents four cue configurations from T0 to T3, and the horizontal axis represents five semantic segments: task, statistics, time, domain, and dataset. T0 to T3 follow the settings in Table 1: T0 includes task, statistics, and dataset; T1 adds time segment; T2 adds domain segment; and T3 includes all five segments.

[0166] For the cross-attention weights represented as queries in time sequence and as keys and values ​​in text, the average is taken sequentially along the attention head and time sequence segments, then summed by semantic segments, and finally normalized within each prompt configuration before averaging over the test samples. The cell value and color intensity represent the normalized attention percentage of the corresponding semantic segment; a short horizontal line indicates that the prompt configuration does not include the corresponding segment. Due to rounding, the sum of the displayed values ​​may slightly differ from 1.

[0167] To further determine whether the model can distinguish and utilize different semantic information within the prompts, this invention statistically analyzes the relative attention allocated by BiCAL to different prompt segments when constructing the temporal-text fusion representation. The results are as follows: Figure 8 As shown, the attention percentages received by different semantic segments vary and change depending on the cue composition and the prediction task. Input statistics receive high attention in most configurations, while temporal and domain priors serve as supplementary differentiators. Attention percentages only describe the model's internal information retrieval tendency and are not equivalent to the independent causal contribution of each semantic segment to the prediction result.

[0168] Figure 9 This is a schematic diagram of the modules of the bidirectional cross-modal aligned regional building cluster load prediction system in an embodiment of the present invention.

[0169] like Figure 9 As shown, this embodiment also provides a two-way cross-modal aligned regional building cluster load prediction system 100, including: a data acquisition module 1, a time series representation generation module 2, a text representation generation module 3, a two-way cross-modal alignment module 4, a context modeling module 5, and a prediction decoding module 6.

[0170] The data acquisition module 1 uses the above step S1 to acquire the historical electrical load, meteorological variables and time variables of multiple buildings in the area, and uses them as input variables, aligns them with a unified timestamp and constructs a historical input window.

[0171] The timing representation generation module 2 uses the above step S2 to divide the historical input window into timing segments along the time dimension for the input variables, and obtains the timing representation through the shared timing embedding layer and the timing projection layer.

[0172] The text representation generation module 3 uses the above step S3 to construct text prompts corresponding to the input variables, and obtains the text representation by inputting the large language model embedding layer through the word segmenter and freezing the backbone parameters.

[0173] The bidirectional cross-modal alignment module 4 adopts the above step S4 to receive the temporal representation and the text representation, and performs a first cross-attention with the temporal representation as the query and the text representation as the key and value, and a second cross-attention with the text representation as the query and the temporal representation as the key and value, respectively. It then uses two independent learnable gating parameters to update the gating residuals of the outputs of the first cross-attention and the second cross-attention, respectively, to obtain the calibrated temporal representation and the calibrated text representation.

[0174] The context modeling module 5 uses the above step S5 to concatenate the calibrated temporal representation and text representation along the lexical dimension to form a joint representation, which is then input into the large language model with frozen backbone parameters for context modeling.

[0175] The prediction decoding module 6 uses the above step S6 to extract the hidden state from the output of the large language model with frozen backbone parameters, obtain the context representation corresponding to the time series segment, and obtain the load prediction results of multiple buildings in the region for one or more time steps in the future through the linear prediction head.

[0176] The role and effect of the embodiments

[0177] The method and system for predicting regional building cluster loads according to the present invention includes the following steps: Step S1, acquiring historical electrical loads, meteorological variables, and time variables of multiple buildings in the region, using them as input variables, aligning them according to a unified timestamp, and constructing a historical input window; Step S2, for the input variables, dividing the historical input window into time-series segments along the time dimension, and obtaining a time-series representation through a shared time-series embedding layer and a time-series projection layer; Step S3, constructing text prompts corresponding to the input variables, and obtaining a text representation through a word segmenter and a large language model with frozen backbone parameters input to the embedding layer; Step S4, inputting the time-series representation and text representation into a bidirectional cross-modal alignment module, performing a first cross-attention with the time-series representation as the query and the text representation as the key and value, and a second cross-attention with the text representation as the query and the time-series representation as the key and value, respectively, and using two independent learnable gating parameters to respectively perform the second cross-attention with the time-series representation as the query and the text representation as the key and value. The outputs of the first and second cross-attention methods are used for gated residual updates to obtain calibrated temporal representations and calibrated text representations. In step S5, the calibrated temporal representations and text representations are concatenated along the lexical dimension to form a joint representation, which is then input into a large language model with frozen backbone parameters for context modeling. In step S6, the hidden states are extracted from the output of the large language model with frozen backbone parameters to obtain the context representation corresponding to the temporal segment. The load prediction results for one or more time steps of multiple buildings in the region are obtained through a linear prediction head. Therefore, the bidirectional cross-modal aligned regional building cluster load prediction method and system of the present invention, while keeping the backbone parameters of the large language model frozen, achieves bidirectional, controlled calibration between the load temporal representation and the text prompt representation through the bidirectional cross-modal alignment module, thereby significantly improving the accuracy of single-step and multi-step load prediction for regional building clusters and maintaining good performance under different prediction time intervals.

[0178] In this embodiment, time-series text query enables prediction tasks, statistical states, and scene backgrounds to participate in time-series feature calibration. Text query time-series allows text representations to be updated in reverse based on the current numerical state, compensating for the lack of information utilization in direct splicing or one-way interaction.

[0179] This embodiment also introduces two independent learnable gating parameter vectors combined with residual connections to control the information injection intensity in two directions respectively, which helps to reduce irrelevant cross-modal information interference while preserving the original representation.

[0180] Those skilled in the art should understand that this invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to this invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the invention as claimed. The scope of protection of this invention is defined by the appended claims and their equivalents.

Claims

1. A two-way cross-modal aligned method for predicting regional building cluster loads, characterized in that, include: Step S1: Obtain the historical electrical load, meteorological variables, and time variables of multiple buildings in the area, use them as input variables, align them with a unified timestamp, and construct a historical input window; Step S2: For the input variable, the historical input window is divided into time-series segments along the time dimension, and a time-series representation is obtained through a shared time-series embedding layer and a time-series projection layer; Step S3: Construct a text prompt corresponding to the input variable, and obtain the text representation by inputting it into the large language model embedding layer after passing through a word segmenter and freezing the backbone parameters; Step S4: Input the temporal representation and the text representation into the bidirectional cross-modal alignment module, and perform a first cross-attention with the temporal representation as the query and the text representation as the key and value, and a second cross-attention with the text representation as the query and the temporal representation as the key and value, respectively. Then, use two independent learnable gating parameters to update the gating residuals of the outputs of the first cross-attention and the second cross-attention, respectively, to obtain the calibrated temporal representation and the calibrated text representation. Step S5: The calibrated temporal representation and text representation are concatenated along the lexical dimension to form a joint representation, which is then input into the large language model with the frozen backbone parameters for context modeling. Step S6: Extract the hidden state from the output of the large language model with the frozen backbone parameters to obtain the context representation corresponding to the time series segment, and obtain the load prediction results of multiple buildings in the region for one or more future time steps through the linear prediction head.

2. The method for predicting regional building cluster loads according to claim 1, characterized in that: in, Step S1 includes the following sub-steps: Step S10: Divide the multivariate time series into a training set, a validation set, and a test set; Step S11: Calculate the mean and standard deviation of the input variables using only the training set, and perform Z-score standardization on the training set, the validation set, and the test set to obtain standardized data; Step S12: Construct the historical input window and future load labels based on the standardized data; Step S13: Perform window-level reversible normalization on the historical input window and save the corresponding window mean and standard deviation.

3. The method for predicting regional building cluster loads according to claim 2 (two-way cross-modal alignment) Its features are: in, Before constructing the history input window, the following is also included: The candidate auxiliary variables are screened using only the training set: the Spearman rank correlation coefficient between the candidate auxiliary variables and each building load variable is calculated, and the candidate auxiliary variables with an absolute value greater than the first correlation threshold are included in the preliminary candidate set; the correlation between the candidate auxiliary variables in the preliminary candidate set is calculated, and variables with an absolute value of correlation coefficient greater than the second correlation threshold or with highly similar physical meanings are removed. The building electrical load variable, regional total load variable, meteorological variable, and time variable are retained as the input variables.

4. The method for predicting regional building cluster loads according to claim 1, characterized in that: in, In step S2, dividing the historical input window into temporal segments along the time dimension includes: adjusting the input tensor into a variable sequence, copying the last observation at the end of the variable sequence, dividing it into overlapping temporal segments along the time dimension according to the segment length and sliding step size; merging the batch dimension and variable dimension, obtaining an initial temporal representation through a shared one-dimensional convolutional temporal embedding layer and random deactivation processing, and then mapping it linearly to the same embedding dimension as the large language model input with the frozen backbone parameters to obtain the temporal representation.

5. The method for predicting regional building cluster loads according to claim 1, characterized in that: in, In step S3, the text prompt includes one or more semantic fragments from task description, input statistics, time priors, building energy consumption domain priors, and data background, and the semantic fragments are combined in a preset order.

6. The method for predicting regional building cluster loads according to claim 1, characterized in that: in, Before step S4, the method further includes: using mutually independent linear projection layers to map the temporal representation and the text representation into temporal projection representation and text projection representation, respectively.

7. The method for predicting regional building cluster loads according to claim 1, characterized in that: in, The gated residual update specifically includes: multiplying the output of the first cross attention by the value obtained by the first learnable gate parameter through the Sigmoid function element by element, then adding it to the temporal representation before the update and performing layer normalization; The output of the second cross attention is multiplied element-wise with the value of the second learnable gating parameter obtained by the Sigmoid function, then added to the text representation before the update and layer normalization is performed. Both the first cross attention and the second cross attention are multi-head cross attention.

8. The method for predicting regional building cluster loads according to claim 1 (two-way cross-modal alignment) Its features are: Step S5 includes the following sub-steps: Step S50: Place the calibrated text representation at the beginning and the calibrated timing representation at the end; Step S51: Concatenate the calibrated text representation and the calibrated temporal representation in lexical order to obtain the joint representation; Step S52: Input the joint representation into the large language model with frozen backbone parameters in an embedded form to perform context modeling.

9. The method for predicting regional building cluster loads according to claim 2, characterized in that, Also includes: Step S7: The time series representation is used to generate a local prediction result through a local prediction head, and then fused with the load prediction result according to the learnable fusion weights corresponding to the prediction position to obtain a fusion result. The fusion result is then inversely transformed using the window mean and standard deviation saved in step S13 and the mean and standard deviation of the training set in step S11 to restore it to the actual building load scale.

10. A two-way cross-modal aligned regional building cluster load forecasting system, characterized in that, include: The data acquisition module is used to acquire historical electrical load, meteorological variables and time variables of multiple buildings in the area, use them as input variables, align them with a unified timestamp and construct a historical input window; The timing representation generation module is used to divide the historical input window into timing segments along the time dimension for the input variables, and obtain the timing representation through a shared timing embedding layer and a timing projection layer; The text representation generation module is used to construct text prompts corresponding to the input variables, and obtain text representations by inputting the large language model embedding layer through a word segmenter and freezing the backbone parameters. A bidirectional cross-modal alignment module is used to receive the temporal representation and the text representation, perform a first cross-attention with the temporal representation as the query and the text representation as the key and value, and a second cross-attention with the text representation as the query and the temporal representation as the key and value, respectively, and update the gated residuals of the outputs of the first cross-attention and the second cross-attention using two independent learnable gating parameters, respectively, to obtain the calibrated temporal representation and the calibrated text representation; The context modeling module is used to concatenate the calibrated temporal representation and text representation along the lexical dimension to form a joint representation, and input it into the large language model with the frozen backbone parameters for context modeling. The prediction decoding module is used to extract hidden states from the output of the large language model with frozen backbone parameters, obtain the context representation corresponding to the time segment, and obtain the load prediction results of multiple buildings in the region for one or more time steps in the future through the linear prediction head.