Energy prediction management method and system based on time sequence large model

By constructing overlapping interval subsequences based on a time-series large model and combining them with environmental and operational data, the bias problem in enterprise energy consumption forecasting was solved, and more accurate forecast results were achieved.

CN121745347APending Publication Date: 2026-03-27CHINA IND INTERNET (BEIJING) TECH GRP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-23
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Existing technologies struggle to accurately depict the correlation between different time periods in enterprise energy consumption forecasting, especially when production load fluctuates and external environment changes significantly, resulting in large discrepancies between forecast results and actual energy consumption.

Method used

The method based on time series large model is adopted. By constructing time series sequences and dividing them into subsequences with overlapping intervals, the attention calculation of time series large model is used to obtain the correlation strength between sequences. Combined with environmental data and enterprise operation data, the most similar historical segments are retrieved for prediction.

Benefits of technology

It enables accurate prediction of enterprise energy consumption, effectively solves the prediction deviation caused by production load fluctuations and changes in the external environment, and improves prediction accuracy and adaptability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121745347A_ABST
    Figure CN121745347A_ABST
Patent Text Reader

Abstract

The invention discloses an energy prediction management method and system based on a time sequence large model, and relates to the field of energy prediction, and the method comprises the steps: obtaining enterprise energy consumption historical data, environment data and enterprise operation data, and constructing the enterprise energy consumption historical data into a time sequence with the length T according to a time sequence; dividing the time sequence into a plurality of subsequences according to a preset length L, executing attention calculation on the plurality of subsequences through a time sequence large model to obtain association strength among the sequences, and retrieving a plurality of historical fragments most similar to a current energy consumption mode from enterprise energy consumption historical data according to the time sequence large model based on the association strength; generating an energy consumption prediction value of a preset future time period according to the historical fragment, the environment data and the enterprise operation data based on a time sequence large model; and sending the energy consumption prediction value to the target client. By implementing the method, the accuracy of enterprise energy prediction can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of energy forecasting, and in particular to an energy forecasting management method and system based on a time-series large model. Background Technology

[0002] As enterprises continue to expand their production scale and energy prices fluctuate, they face higher demands for energy management and consumption forecasting. Accurate forecasting of enterprise energy consumption is of great significance for optimizing energy allocation, reducing costs, and formulating energy-saving strategies.

[0003] Existing technologies typically employ time series analysis for energy consumption forecasting. This method first collects historical energy consumption data from enterprises, establishes a mathematical model to capture trends and periodic characteristics within the data, and then predicts future energy consumption based on statistical regularities. In practice, a sliding time window is used to extract segments of historical data, and an autoregressive model is used to analyze the correlation between these segments, thereby inferring future energy usage trends.

[0004] However, because enterprise energy consumption is influenced by multiple factors and exhibits complex nonlinear characteristics, relying solely on statistical models is insufficient to accurately depict the correlation between energy consumption patterns across different time periods. Especially when enterprise production loads fluctuate significantly and the external environment changes dramatically, existing forecasting methods are prone to producing large discrepancies between predicted and actual energy consumption. Summary of the Invention

[0005] This application provides an energy forecasting management method and system based on a time-series large model, which can be used to improve the accuracy of enterprise energy forecasting.

[0006] Firstly, this application provides an energy forecasting and management method based on a time-series large-scale model, applied to an energy forecasting and management system. The method includes: acquiring historical energy consumption data, environmental data, and enterprise operation data; constructing a time-series sequence of length T from the historical energy consumption data in chronological order; dividing the time-series sequence into multiple subseries of a preset length L, where adjacent subseries have overlapping intervals; performing attention calculations on the multiple subseries using the time-series large-scale model to obtain the correlation strength between the sequences, where the correlation strength characterizes the similarity of energy consumption patterns in different time periods; based on the correlation strength, retrieving several historical segments from the historical energy consumption data that are most similar to the current energy consumption pattern according to the time-series large-scale model; generating a predicted energy consumption value for a preset future period based on the historical segments, environmental data, and enterprise operation data according to the time-series large-scale model; and sending the predicted energy consumption value to a target client.

[0007] In the above embodiments, historical energy consumption data of enterprises is constructed into a time series in chronological order and divided into subsequences with overlapping intervals, enabling the large-scale time series model to capture the correlation features between different time periods. Based on the correlation strength between sequences, similar historical segments are retrieved, and combined with environmental data and enterprise operational data, accurate prediction of enterprise energy consumption is achieved, effectively solving the prediction bias problem caused by fluctuations in enterprise production load and changes in the external environment.

[0008] In conjunction with some embodiments of the first aspect, in some embodiments, the step of performing attention calculations on multiple subsequences using a time-series large model to obtain the correlation strength between sequences, whereby the correlation strength characterizes the similarity of energy consumption patterns at different time periods, specifically includes: inputting multiple subsequences into the encoding layer and decoding layer of the time-series large model respectively; in the encoding layer, calculating the self-attention weight within each subsequence, whereby the self-attention weight is used to characterize the degree of mutual correlation of energy consumption data at each time point within the subsequence; in the decoding layer, calculating the cross-attention weight between different subsequences based on the self-attention weight, whereby the cross-attention weight is used to characterize the similarity of energy consumption patterns between different subsequences; and weighted fusing the self-attention weight and the cross-attention weight to obtain the correlation strength between sequences.

[0009] In the above embodiments, the encoding layer of the temporal large model calculates the self-attention weights within subsequences, and the decoding layer calculates the cross-attention weights between different subsequences. The weighted fusion of the two types of attention weights forms the correlation strength between sequences. The self-attention mechanism characterizes the internal correlation pattern of energy consumption data within a single time period, while the cross-attention mechanism establishes the connection between energy consumption patterns across different time periods, thereby comprehensively capturing the temporal characteristics of energy consumption data.

[0010] In conjunction with some embodiments of the first aspect, in some embodiments, the step of retrieving several historical segments from the enterprise's historical energy consumption data that are most similar to the current energy consumption pattern based on the correlation strength and according to a time-series large model specifically includes: calculating the similarity score between all subsequences in the enterprise's historical energy consumption data and the current subsequence based on the correlation strength between the sequences; sorting the similarity scores in descending order and selecting a preset number of subsequences with the highest similarity scores as candidate historical segments; calculating the energy consumption feature vector of the candidate historical segments, which includes energy consumption peak, energy consumption periodicity, and energy consumption trend; and filtering out several historical segments most similar to the current energy consumption pattern from the candidate historical segments based on the energy consumption feature vector.

[0011] In the above embodiments, firstly, similarity scores are calculated based on the strength of correlation between sequences, and candidate historical segments are sorted and filtered. Then, energy consumption feature vectors of the candidate segments are extracted, which include peak, periodic, and trend information of energy consumption. The multi-dimensional feature vector-based filtering mechanism ensures that the selected historical segments have a high similarity to the current energy consumption pattern, providing a reliable reference for subsequent predictions.

[0012] In conjunction with some embodiments of the first aspect, in some embodiments, the step of retrieving several historical segments from the enterprise's historical energy consumption data that are most similar to the current energy consumption pattern based on the correlation strength and according to the time series big data model specifically includes: inputting several historical segments into the time series big data model to generate a basic prediction sequence; extracting temperature, humidity, and weather conditions from environmental data to generate an environmental feature vector; extracting production load, equipment status, and number of personnel from enterprise operation data to generate an operation feature vector; fusing the basic prediction sequence with the environmental feature vector and the operation feature vector; and processing the fused features based on the time series big data model to generate a predicted energy consumption value for a preset future period.

[0013] In the above embodiments, the time-series large model first generates a basic prediction sequence based on historical fragments, and then fuses environmental feature vectors and operational feature vectors with the basic prediction sequence. The environmental feature vectors include external factors such as temperature and humidity, while the operational feature vectors include internal factors such as production load and equipment status. The feature fusion process enables collaborative modeling of multi-source data, allowing the prediction results to simultaneously consider the impact of the external environment and the company's operational status.

[0014] In conjunction with some embodiments of the first aspect, in some embodiments, after the step of sending the predicted energy consumption value to the target client, the method further includes: obtaining the actual energy consumption value of the enterprise, comparing the predicted energy consumption value with the actual energy consumption value of the enterprise, and calculating the prediction accuracy; when the prediction accuracy is lower than a preset threshold, feeding back the actual energy consumption value of the enterprise to the time series large model, and updating the correlation strength calculation parameters between sequences.

[0015] In the above embodiments, the predicted energy consumption values ​​are compared with the actual values ​​to calculate the prediction accuracy. When the accuracy is lower than a preset threshold, the actual values ​​are fed back to the time-series large model to update the correlation strength calculation parameters. The difference between the predicted and actual values ​​reflects the model's misunderstanding of energy consumption patterns. By continuously optimizing the calculation method of the correlation strength between sequences through the parameter update mechanism, a closed-loop model optimization process is formed.

[0016] In conjunction with some embodiments of the first aspect, in some embodiments, after sending the energy consumption forecast to the target client, the method further includes: acquiring external environmental change data, which includes policy adjustment information and market fluctuation information; extracting energy price change indicators and energy use restriction indicators from the policy adjustment information, and extracting energy supply and demand ratio indicators and energy price trend indicators from the market fluctuation information; constructing a feature enhancement matrix, mapping the energy price change indicators, energy use restriction indicators, energy supply and demand ratio indicators, and energy price trend indicators to the same feature space as the environmental data, to obtain environmental enhancement features; aligning the environmental enhancement features with the enterprise operation data in a time series to generate a compensation forecast sequence; calculating the residual vector between the compensation forecast sequence and the actual energy consumption value of the enterprise; and constructing an adaptive weight matrix based on the distribution characteristics of the residual vector, weighting and correcting the correlation strength between the sequences to obtain the optimized energy consumption forecast result.

[0017] In the above embodiments, a feature enhancement matrix is ​​constructed to map policy adjustments and market fluctuation information to the environmental feature space, generating a compensated prediction sequence and calculating the residual vector. Based on the residual distribution characteristics, an adaptive weight matrix is ​​constructed to correct the correlation strength. The introduction of external environmental change data expands the perception range of the prediction model, and the adaptive weight correction mechanism enhances the model's adaptability to sudden environmental changes.

[0018] In conjunction with some embodiments of the first aspect, in some embodiments, before the step of generating a preset future energy consumption forecast value based on historical fragments, environmental data, and enterprise operation data according to a time-series large model, the method further includes: constructing a GPU computing resource pool, assigning a computing power identifier and a storage capacity identifier to each GPU node; dividing the enterprise's historical energy consumption data into multiple data blocks for parallel processing to generate a data tensor that meets GPU computing specifications; allocating the data tensor to the corresponding GPU nodes for sequence feature extraction based on the computing power identifier and storage capacity identifier; setting a load balancing threshold, and migrating computing tasks to idle GPU nodes when the resource utilization of a GPU node exceeds the load balancing threshold.

[0019] In the above embodiments, a GPU computing resource pool is constructed and computing and storage identifiers are assigned to each node. The enterprise's historical energy consumption data is divided into multiple data blocks for parallel processing to generate data tensors, and computing tasks are allocated based on node identifiers. The setting of a load balancing threshold enables dynamic migration of computing tasks, allowing the sequence feature extraction process to fully utilize the parallel computing capabilities of the GPU, thereby improving the processing efficiency of large-scale time-series data while ensuring balanced utilization of computing resources.

[0020] In a second aspect, embodiments of this application provide an energy forecasting and management system, which includes: one or more processors and a memory; the memory is coupled to the one or more processors, and the memory is used to store computer program code, the computer program code including computer instructions, and the one or more processors call the computer instructions to cause the energy forecasting and management system to perform the methods described in the first aspect and any possible implementation thereof.

[0021] Thirdly, embodiments of this application provide a computer program product containing instructions that, when the computer program product is run on an energy forecasting and management system, cause the energy forecasting and management system to perform the method described in the first aspect and any possible implementation thereof.

[0022] Fourthly, embodiments of this application provide a computer-readable storage medium including instructions that, when executed on an energy forecasting and management system, cause the energy forecasting and management system to perform the method described in the first aspect and any possible implementation thereof.

[0023] Understandably, the energy forecasting and management system provided in the second aspect, the computer program product provided in the third aspect, and the computer storage medium provided in the fourth aspect are all used to execute the methods provided in the embodiments of this application. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects in the corresponding methods, and will not be repeated here.

[0024] One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages: 1. This application constructs a time-series sequence from historical enterprise energy consumption data in chronological order and divides it into subsequences with overlapping intervals, enabling the large-scale time-series model to capture the correlation features between different time periods. Based on the correlation strength between sequences, similar historical segments are retrieved, and combined with environmental data and enterprise operation data, accurate prediction of enterprise energy consumption is achieved, effectively solving the prediction bias problem caused by fluctuations in enterprise production load and changes in the external environment.

[0025] 2. This application calculates the self-attention weights within subsequences through the encoding layer of a time-series large model, and calculates the cross-attention weights between different subsequences through the decoding layer. The weighted fusion of the two types of attention weights forms the correlation strength between sequences. The self-attention mechanism characterizes the internal correlation pattern of energy consumption data within a single time period, while the cross-attention mechanism establishes the connection between energy consumption patterns between different time periods, thereby comprehensively capturing the temporal characteristics of energy consumption data.

[0026] 3. This application first calculates and sorts candidate historical segments based on the strength of correlation between sequences to filter them, and then extracts the energy consumption feature vectors of the candidate segments, which include peak, periodic, and trend information of energy consumption. The multi-dimensional feature vector-based filtering mechanism ensures that the selected historical segments have a high similarity to the current energy consumption pattern, providing a reliable reference for subsequent predictions. Attached Figure Description

[0027] Figure 1 This is a flowchart illustrating an energy forecasting and management method based on a large time-series model, as described in this application. Figure 2 This is another flowchart illustrating the energy forecasting and management method based on a large time-series model in the embodiments of this application; Figure 3 This is a schematic diagram of the physical device structure of an energy forecasting and management system in the embodiments of this application. Detailed Implementation

[0028] The terminology used in the following embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. As used in the specification of this application, the singular expressions “a,” “an,” “the,” “the,” and “this” are intended to include the plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this application refers to any or all possible combinations including one or more of the listed items.

[0029] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.

[0030] To facilitate understanding, the application scenarios of the embodiments of this application are described below.

[0031] A large manufacturing industrial park has dozens of production lines, with energy consumption primarily consisting of electricity, natural gas, and steam. Due to its massive production scale, energy use exhibits complex and dynamic characteristics. Energy consumption patterns change significantly, especially during product switching, seasonal changes, and holidays. For example, air conditioning load fluctuates seasonally, different product production lines have significantly different energy consumption characteristics, and the shutdown of some production lines during holidays leads to a sharp drop in energy demand. Simultaneously, energy prices also fluctuate considerably; for instance, electricity is subject to peak-valley time-of-use pricing, and natural gas prices are influenced by international markets. This presents the park with significant challenges in energy cost control and efficiency optimization. Accurately predicting future energy demand is crucial for optimizing energy procurement, adjusting production plans, and implementing energy-saving measures. However, the complexity of influencing factors and the diversity of data characteristics make building accurate predictive models extremely difficult.

[0032] The industrial park employs traditional time-series analysis methods for energy forecasting. The system collects hourly data on electricity, natural gas, and steam consumption from each production line, while also recording meteorological data such as ambient temperature and humidity. The forecasting model uses a 30-day sliding window and builds an autoregressive model based on historical data to analyze the periodic patterns and trends in energy consumption. For example, it extracts features such as 24-hour and 7-day cycles through Fourier transform and combines them with linear regression to predict future energy consumption trends. However, when production plans are temporarily adjusted, weather changes occur, or equipment malfunctions, the forecast results often show significant deviations. Especially in the initial stages of new product launches, the accuracy of forecasts drops significantly due to the lack of similar historical data. Furthermore, the model cannot effectively utilize non-time-series data such as production plans and equipment status, nor can it adapt promptly to changes in energy consumption patterns caused by fluctuations in energy prices.

[0033] By employing the time-series large-scale model-based prediction method proposed in this application, the system can simultaneously process multi-dimensional data and capture complex time-series features. The system divides energy consumption data from the past three years into subsequences of 8 hours each, with adjacent sequences overlapping by 4 hours. An attention mechanism is used to analyze the similarity of energy consumption patterns across different time periods. For example, if the current energy consumption pattern is found to be similar to a peak production period in the same period last year, the system automatically retrieves relevant historical data for prediction. Simultaneously, the model can integrate multi-source information such as weather forecasts, production plans, and equipment maintenance plans. When a prediction deviation is detected, the system automatically adjusts the attention weights to optimize the prediction model. In a case of a sudden increase in production, the system predicted a surge in energy demand based on similar historical cases, issuing a warning 12 hours in advance, allowing the industrial park to adjust its energy consumption plan in time and avoid excessive energy costs. The prediction accuracy of this scheme is 30% higher than traditional methods, and it exhibits stronger adaptability, especially during periods of drastic fluctuations in production load.

[0034] To facilitate understanding, the method provided in this implementation will be described in detail below, using the above scenario as an example. Please refer to [link / reference]. Figure 1 This is a flowchart illustrating an energy forecasting and management method based on a time-series large model in an embodiment of this application.

[0035] S101. Obtain historical energy consumption data, environmental data, and enterprise operation data of the enterprise, and construct a time series with a length of T from the historical energy consumption data of the enterprise in chronological order.

[0036] Among these, historical energy consumption data represents a company's energy usage records over a past period, including numerical data such as electricity consumption, natural gas consumption, and steam consumption. Environmental data refers to data on external environmental factors affecting energy consumption, including temperature, humidity, light intensity, and weather conditions. Enterprise operational data represents data related to a company's production and operations, including production plans, equipment operating status, and output records. Time series refers to a data sequence arranged chronologically, where T represents the number of time points contained in the sequence.

[0037] This step is performed before energy forecasting begins to acquire the necessary foundational data. Specifically, energy consumption data, including measurements from various metering devices, is first collected through the data acquisition module of the enterprise's energy management system; environmental monitoring data is also obtained from the meteorological station; and operational data is acquired from the enterprise's production management system. The collected data undergoes preprocessing, including data format standardization, outlier handling, and missing value imputation. Then, historical energy consumption data is sorted by timestamp and constructed into a fixed-length time series of T, which serves as the input data for subsequent forecasting.

[0038] In some embodiments, data acquisition and time-series sequence construction can be implemented in multiple ways: Optionally, data can be collected through a distributed data acquisition system, transmitted using the MQTT protocol, parsed in JSON format, outliers and missing values ​​can be handled by a data cleaning module, and finally the processed data can be sorted by timestamp to generate a time-series sequence; alternatively, historical data can be obtained through periodic database queries, data within a specified time range can be filtered using SQL statements, the query results can be converted and standardized, missing data points can be supplemented using interpolation algorithms, and finally, a time-series sequence with equally spaced sampling can be generated. It is understood that other methods can also be used to implement the data acquisition and time-series sequence construction process, which are not limited here.

[0039] S102. Divide the time series into multiple subsequences according to a preset length L, wherein adjacent subsequences in the subsequences have overlapping intervals.

[0040] Here, the preset length L represents the number of time points contained in each subsequence, which is usually determined based on data characteristics and prediction requirements. A subsequence refers to a continuous data segment extracted from a complete time series. Overlapping intervals are used to represent the time periods shared by adjacent subsequences, ensuring the continuity and smoothness of the data.

[0041] This step is performed after the complete time series is constructed, and it is used to segment the long sequence into shorter sequences that are easier to process. Specifically, the subsequence length L and the overlap interval length O are first determined, where O is less than L. Starting from the beginning of the time series, data segments of length L are extracted each time to form a subsequence, with the starting positions of adjacent subsequences spaced LO time points apart. The temporal characteristics and integrity of the original data are preserved for each subsequence, ensuring that the subsequence contains feature data of all dimensions.

[0042] In some embodiments, the partitioning of time series sequences can be implemented in several ways: Optionally, a sliding window method can be used, setting the window size to L and the sliding step size to LO, sliding the window along the time axis, with each window position corresponding to a subsequence, and simultaneously recording the start and end timestamps of each subsequence; Optionally, a segmented sampling method can be used, first calculating the number of subsequences N = (TO) / (LO), then determining N sampling start points according to the principle of equal intervals, and extracting a data segment of length L from each start point, ensuring that there are O overlapping data points between adjacent segments. It is understood that other methods can also be used to implement the partitioning process of time series sequences, which are not limited here.

[0043] S103. Attention calculation is performed on multiple subsequences through a time series large model to obtain the correlation strength between the sequences. This correlation strength characterizes the similarity of energy consumption patterns in different time periods.

[0044] The "Time Series Large Model" refers to a deep learning model used to process time series data, featuring a multi-layered Transformer structure. Attention calculation refers to the process of calculating the weights of relationships between elements at different positions in the sequence, achieved through matrix operations on query vectors, key vectors, and value vectors. Subsequences represent data segments partitioned from the original time series. Association strength represents the similarity between different subsequences, expressed as a value between 0 and 1, with higher values ​​indicating greater similarity. Energy consumption patterns refer to the characteristics and patterns of an enterprise's energy use within a specific time period.

[0045] This step, performed after sequence partitioning, is used to analyze the correlations between energy consumption data across different time periods. Specifically, each subsequence is encoded as a high-dimensional vector representation, and an attention weight matrix is ​​calculated between the subsequences. For any two subsequences, the similarity between their query vector and key vector is calculated using a dot product operation, and then normalized using softmax to obtain the attention weights. The attention weights are multiplied by the value vectors to obtain a weighted feature representation. Finally, a multi-head attention mechanism is used to fuse the correlation information from different feature subspaces to generate a matrix representing the strength of the correlation between sequences. In some embodiments, attention calculation and association strength acquisition can be implemented in several ways: Optionally, a self-attention mechanism can be used. First, the subsequence is transformed linearly to generate a query matrix Q, a key matrix K, and a value matrix V. The original attention score is calculated by QK^T, scaled by the square root of the vector dimension, and the attention weight is obtained by applying a softmax function. Finally, it is multiplied by V to obtain a weighted output. Optionally, a relative position encoding attention mechanism can be used. Relative position information is added during sequence encoding to construct a position bias matrix. The position bias is added to the content similarity and then normalized by softmax. The attention scores for different feature subspaces are calculated separately using a multi-head mechanism, and the final association strength is obtained by weighted averaging. It is understood that other methods can also be used to implement the attention calculation and association strength acquisition process, which are not limited here.

[0046] In some embodiments, this step specifically includes: Multiple subsequences are input into the encoding and decoding layers of the time series model, respectively.

[0047] Here, a subsequence represents a fixed-length data segment divided from the complete time-series data. A large-scale time-series model refers to a deep learning model structure specifically designed for processing time-series data. The encoding layer represents the part of the model that processes the input sequence, converting the raw data into hidden state representations. The decoding layer is the part of the model that generates the output based on the encoding results, responsible for feature decoding and prediction generation.

[0048] This step is performed after data preprocessing and serves to initiate the model's computation. Specifically, feature embedding is first performed on each subsequence, converting the raw data into a vector representation of dimension d. Sequence position information is added through positional encoding, using a sine-cosine positional encoding method. The encoded sequence is then input into the encoding layer, processed through a multi-head self-attention layer and a feedforward neural network layer. The output of the encoding layer is passed to the decoding layer, which handles sequence relationships through masked self-attention and cross-attention mechanisms.

[0049] In the coding layer, the self-attention weights within each subsequence are calculated. These self-attention weights are used to characterize the degree of correlation between energy consumption data at different time points within the subsequence.

[0050] Here, self-attention weights represent the degree of correlation between elements within a sequence, expressed in matrix form. Time points represent the specific moments when data was sampled. Energy consumption data refers to a company's energy usage records at a specific point in time. The degree of correlation is used to represent the strength of the dependency between data from different time points.

[0051] This step is performed after the sequence input encoding layer and is used to calculate the dependencies within the sequence. Specifically, the input sequence is transformed linearly to generate a query vector Q, a key vector K, and a value vector V, each with dimension d. The matrix product of Q and K is calculated to obtain the attention score matrix, with dimension equal to the square of the sequence length. The attention scores are normalized by dividing by the square root of d, and the softmax function is applied to obtain the attention weights. The attention weights are multiplied by the value vector V to obtain the weighted feature representation.

[0052] In the decoding layer, based on the self-attention weights, cross-attention weights are calculated between different subsequences. These cross-attention weights are used to characterize the similarity of energy consumption patterns between different subsequences.

[0053] In this context, cross-attention weights represent the correlation between different sequences, expressed in matrix form. Energy consumption patterns refer to the characteristics and patterns of an enterprise's energy use over a period of time. Similarity is used to represent the degree of matching between the energy consumption patterns of different sequences.

[0054] This step is performed after the encoding layer computation is complete and is used to analyze the relationships between different sequences. Specifically, the hidden state representation of the sequence is obtained from the encoding layer. The decoding layer generates a query vector, which is then used to calculate cross-attention with the key and value vectors output by the encoding layer. The original attention scores are calculated through matrix multiplication and scaling operations. The softmax function is applied to convert the scores into a probability distribution, yielding the cross-attention weight matrix.

[0055] The self-attention weights and cross-attention weights are weighted and fused to obtain the correlation strength between sequences.

[0056] Weighted fusion combines multiple attention weight matrices into a final association strength metric. Association strength is a numerical indicator that measures the similarity between sequences. "Sequences" refers to the relationships between different subsequences.

[0057] This step is performed after obtaining the two types of attention weights, which are used to generate the final sequence association metric. Specifically, the fusion coefficients α and β of the self-attention weights and cross-attention weights are designed to satisfy α + β = 1. The self-attention weight matrix is ​​multiplied by α, and the cross-attention weight matrix is ​​multiplied by β. Element-wise addition is performed on the weighted matrix. The resulting matrix is ​​then normalized to obtain the final association strength matrix.

[0058] S104. Based on the correlation strength, retrieve several historical segments from the enterprise's historical energy consumption data that are most similar to the current energy consumption pattern according to the time series big data model.

[0059] The retrieval process refers to the operation of finding data segments in historical data that are similar to the target pattern. Historical segments refer to energy consumption data sequences within past time periods. The current energy consumption pattern represents energy usage characteristics within a recent period. Similarity is used to represent the degree of matching between two energy consumption patterns and is calculated using distance metrics or correlation coefficients.

[0060] This step is performed after obtaining the correlation strength between sequences, and is used to find reference samples in historical data that are similar to the current situation. Specifically, firstly, energy consumption data within the current time window is constructed into a query vector, and the similarity score between this vector and each time window of the historical data is calculated. A weighted similarity is calculated based on the correlation strength matrix, taking into account the proximity of time positions. The similarity scores are sorted, and the K historical segments with the highest scores are selected. These segments represent historical scenarios that are closest to the current situation in terms of energy consumption patterns.

[0061] In some embodiments, similar segment retrieval can be implemented in several ways: Optionally, the KNN retrieval method can be used to convert the current sequence and historical sequences into feature vectors, calculate Euclidean distance or cosine similarity, weight the similarity with time decay weights, select the K most similar historical segments, and record their time positions and similarity scores; Optionally, the Locality Sensitive Hashing (LSH) method can be used to construct a family of hash functions for sequence features, map similar sequences to the same hash bucket, search for similar segments in the hash bucket and neighboring buckets of the current sequence, and perform secondary sorting and filtering by accurately calculating similarity. It is understood that other methods can also be used to implement the similar segment retrieval process, which are not limited here.

[0062] In some embodiments, this step specifically includes: Based on the correlation strength between sequences, a similarity score is calculated between all subsequences in the enterprise's historical energy consumption data and the current subsequence.

[0063] The association strength is a numerical indicator representing the degree of similarity between different sequences, ranging from 0 to 1. A subsequence refers to a fixed-length data segment divided from complete time-series data. The similarity score is used to represent the degree of matching between two sequences in terms of pattern features. The current subsequence represents the energy consumption data sequence within the most recent time period. Historical energy consumption data of an enterprise refers to the energy usage data recorded by the enterprise in the past.

[0064] This step is performed after obtaining the sequence association strength, and is used to calculate the similarity between historical data and the current state. Specifically, the current subsequence is used as a reference sequence, and its similarity is calculated with all subsequences in the historical data. The similarity calculation uses the weighted Euclidean distance method, with association strength as the weight coefficient. For each pair of sequences, the squared difference at the corresponding time points is first calculated, then multiplied by the association strength to obtain the weighted distance, and finally normalized by the inverse of the distance to obtain the similarity score.

[0065] The similarity scores are sorted in descending order, and a preset number of subsequences with the highest similarity scores are selected as candidate historical segments.

[0066] In this context, descending order sorting represents arranging values ​​from largest to smallest. Preset quantity refers to a predetermined number of candidate segments. Candidate historical segments represent similar historical data sequences selected in the initial screening.

[0067] This step is performed after all similarity scores have been calculated, and it is used to select the most similar historical data segments. Specifically, all historical subsequences are quickly sorted according to their similarity scores, and a max-heap data structure is constructed to store the sorting results. A candidate segment number K is set, and the K highest-scoring sequences are sequentially extracted from the max-heap. The time range, similarity score, and sequence data of these K sequences are recorded as a set of candidate historical segments.

[0068] Calculate the energy consumption feature vector of the candidate historical segment, which includes energy consumption peak, energy consumption periodicity and energy consumption trend.

[0069] Among them, the energy consumption feature vector represents a multi-dimensional numerical representation of energy use patterns. Peak energy consumption refers to the maximum energy consumption in the sequence. Energy consumption periodicity represents the recurring pattern of energy use. Energy consumption trend indicates the overall direction of change in the sequence.

[0070] This step is performed after candidate historical segments are obtained, and is used to extract more fine-grained feature information. Specifically, statistical features are calculated for each candidate segment: local peaks are detected using a sliding window, and the peak size and occurrence time are recorded; periodic features are analyzed using Fourier transform to extract the main frequency components; and the trend slope is calculated using linear regression. These features are combined into a feature vector for subsequent similarity comparison.

[0071] Based on energy consumption feature vectors, several historical segments that are most similar to the current energy consumption pattern are selected from the candidate historical segments.

[0072] Here, energy consumption pattern refers to the characteristic regularity of an enterprise's energy use. The screening process represents a secondary selection operation based on feature vectors. Most similar represents the state with the highest feature matching degree.

[0073] This step is performed after the feature vector is calculated, and it is used for the final selection of historical segments. Specifically, the energy consumption feature vector of the current sequence is calculated as a reference vector. The cosine similarity between the feature vector of the candidate segment and the reference vector is calculated to obtain a similarity score in the feature space. Combining the sequence similarity and feature similarity from the previous steps, a comprehensive score is calculated. The N historical segments with the highest comprehensive scores are selected as the final result, where N is the number of historical segments required.

[0074] S105. Based on a time-series large model, generate energy consumption forecasts for future periods according to historical data, environmental data, and enterprise operation data.

[0075] The projected future time period represents the time range for forecasting, typically measured in hours or days. Historical segments refer to sequences of historical data similar to current energy consumption patterns. Environmental data represents external environmental factors influencing energy consumption, including parameters such as temperature, humidity, and light intensity. Enterprise operational data represents information related to enterprise production and operations, including production plans and equipment status. The predicted energy consumption value refers to the enterprise's energy consumption within the predicted future time period. The large-scale time series model represents a deep learning model based on the Transformer architecture, used to process and predict time series data.

[0076] This step is performed after acquiring similar historical data segments to generate energy consumption forecasts for future periods. Specifically, firstly, similar historical data segments are weighted and fused according to similarity to form a baseline prediction sequence. Environmental data and enterprise operational data are encoded into feature vectors and fused with the baseline sequence. The fused features are processed through an encoder-decoder structure of a large-scale time-series model, where the encoder extracts the temporal patterns from the historical data, and the decoder generates a prediction sequence based on the encoded information and the current state. Finally, the model output is post-processed, including numerical range constraints and outlier correction, to obtain the final prediction result.

[0077] In some embodiments, energy consumption prediction can be achieved in several ways: Optionally, an attention-based sequence-to-sequence model is employed, firstly encoding the input sequence by position and embedding features, then extracting temporal features through a multi-layer self-attention network, fusing multi-source information using a cross-attention mechanism, and finally generating predicted values ​​through a feedforward neural network, with residual connections and layer normalization applied to improve model performance; Optionally, a memory-enhanced neural network is used, constructing an external memory matrix to store historical patterns, retrieving relevant information from memory through an attention mechanism, combining it with the current input to generate a predicted sequence through a recurrent neural network, and using a dynamic update mechanism to maintain the memory matrix. It is understood that other methods can also be used to achieve the energy consumption prediction process, which are not limited here.

[0078] In some embodiments, this step specifically includes: Input several historical segments into a large time series model to generate a basic prediction sequence.

[0079] Here, historical segments represent data sequences selected from historical data that are similar to the current state. Large time series models refer to deep learning models used to process time series data. Base prediction sequences represent preliminary predictions generated solely based on historical data.

[0080] This step is performed after obtaining similar historical fragments to generate an initial prediction sequence. Specifically, the historical fragments are standardized to convert them into an input format acceptable to the model. The model's encoder maps the input sequence to a high-dimensional feature space, capturing temporal dependencies. The decoder generates a prediction sequence based on the encoded features, with the output dimension matching the prediction duration. The prediction results of multiple historical fragments are weighted and averaged, with the weights proportional to the similarity of the historical fragments. The weighted result is then destandardized to obtain the base prediction sequence at the actual scale.

[0081] Extract temperature, humidity, and weather conditions from environmental data to generate environmental feature vectors.

[0082] Among them, environmental data represents data on external environmental factors affecting energy consumption. Temperature refers to the ambient temperature value. Humidity represents the percentage of air humidity. Weather conditions are used to indicate weather types such as sunny or rainy. Environmental feature vectors are numerical representations of the encoded environmental data.

[0083] This step is performed after environmental data acquisition and is used to extract environmental factor features. Specifically, temperature data is segmented and encoded, mapping continuous temperature values ​​to discrete intervals. Humidity data is normalized, converting it to a 0-1 range. Weather conditions are converted into unique thermal encoding vectors, with different weather types corresponding to different positions of 1. The processed temperature, humidity, and weather codes are then concatenated to form an environmental feature vector.

[0084] Extract production load, equipment status, and number of personnel from enterprise operation data to generate operation feature vectors.

[0085] Among them, enterprise operation data represents relevant data during the enterprise's production process. Production load refers to the operating load level of production equipment. Equipment status represents the operating status information of the equipment. Personnel quantity is used to represent the personnel scale of the production area. Operation feature vector refers to the feature representation after encoding the operation data.

[0086] This step is performed after acquiring the enterprise's operational data and is used to extract operational status features. Specifically, the production load data is normalized and converted into percentage form. Equipment status is coded, converting states such as start-up, fault, etc., into numerical representations. The number of personnel in each area is counted and normalized. The processed load values, status codes, and personnel data are combined into an operational feature vector.

[0087] The basic prediction sequence is fused with environmental feature vectors and running feature vectors.

[0088] Feature fusion represents the process of combining multiple feature vectors into a unified representation. The fused feature refers to the new feature representation formed by combining multiple feature vectors.

[0089] This step is performed after obtaining various feature vectors and is used to integrate multi-source information. Specifically, an attention mechanism is used to fuse the base prediction sequence, environmental feature vectors, and runtime feature vectors. Attention weights are calculated between features to reflect the importance of different features. Weighted summation is used to fuse the features into a unified representation. Residual connections are used to preserve original feature information and prevent information loss. Finally, layer normalization is applied to obtain the fused features.

[0090] Based on the time series large model, the fused features are processed to generate energy consumption prediction values ​​for a preset future period.

[0091] Here, the preset future time period indicates the time range that needs to be predicted. The energy consumption forecast refers to the future energy consumption predicted by the model.

[0092] This step is performed after feature fusion is complete and is used to generate the final prediction result. Specifically, the fused features are input into the prediction module of the large-scale temporal model. A multi-layer Transformer structure processes the temporal features to capture long-term and short-term dependencies. The decoder generates a prediction sequence based on the current state and historical information. Constraints are applied to the prediction results to ensure that the predicted values ​​are within a reasonable range. Finally, the predicted energy consumption value sequence for the preset time period is output.

[0093] S106. Send the predicted energy consumption value to the target client.

[0094] Here, the energy consumption forecast represents the energy usage data predicted by the model for the future period. The target client refers to the terminal device or system that receives the forecast results, including energy management systems, mobile applications, etc. The transmission process represents the communication operation of transmitting the forecast data to the specified receiving end.

[0095] This step is executed after the prediction calculation is completed and is used to transmit the prediction results to the terminals that need to use this data. Specifically, firstly, the prediction results are converted into a data format to construct a data packet containing information such as timestamps, predicted values, and confidence intervals. A suitable communication protocol is selected according to the target client's interface specifications, and the data packet is encoded and encrypted. A communication connection is established with the target client, and the validity and security of the connection are verified. The data packet is transmitted and confirmation of receipt is awaited; if transmission fails, a retry mechanism is implemented.

[0096] In some embodiments, the prediction results can be sent in several ways: Optionally, a WebService interface can be used to encapsulate the prediction data in JSON format, send a POST request via HTTPS, set the request header to include authentication information, process the data after verifying the validity of the request on the server side, and return a response to confirm the receipt status; Optionally, a message queue mechanism can be used to publish the prediction data to a specified message topic, the message containing data content and metadata information, the message broker ensuring reliable delivery, and the client receiving the data by subscribing to the topic and sending a consumption confirmation. It is understood that other methods can also be used to implement the prediction result sending process, which are not limited here.

[0097] The following provides a more detailed description of the process of the method provided in this implementation. Please refer to [link / reference]. Figure 2 This is another flowchart illustrating the energy forecasting and management method based on a large time-series model in this application.

[0098] S201. Obtain the actual energy consumption value of the enterprise, compare the predicted energy consumption value with the actual energy consumption value of the enterprise, and calculate the prediction accuracy.

[0099] Actual energy consumption of an enterprise refers to the actual amount of energy such as electricity, natural gas, and steam consumed by the enterprise within a specific time period. This data is collected through measuring devices such as smart meters and flow meters, and the unit can be kilowatt-hours (kWh), cubic meters (m³), or tons (t). Forecasted energy consumption refers to the energy consumption value that the enterprise is expected to consume in the future, predicted using a large-scale time-series model. Forecast accuracy measures how close the predicted value is to the actual value, typically using metrics such as mean absolute percentage error (MAPE) or root mean square error (RMSE).

[0100] This step involves using the data acquisition module of the enterprise energy management system to collect energy consumption data from various measuring devices at fixed time intervals (e.g., 15 minutes). The collected data is stored and aggregated according to timestamps to obtain the actual energy consumption value. Then, the pre-obtained predicted value is compared with the actual value for the corresponding time period. Specifically, the MAPE method is used to calculate the prediction accuracy: the difference between the actual and predicted values ​​is divided by the actual value to obtain the relative error. The average of the relative errors over all time points is then multiplied by 100% to obtain the prediction accuracy in percentage form. For example, if the predicted electricity consumption for a certain period is 1000 kWh and the actual value is 1100 kWh, the relative error at that point is 9.09%. The overall prediction accuracy is obtained by averaging the relative errors across all time points.

[0101] S202. When the prediction accuracy is lower than the preset threshold, the actual value of enterprise energy consumption is fed back to the time series large model to update the correlation strength calculation parameters between series.

[0102] The preset threshold is the maximum acceptable prediction error value determined based on actual application needs, typically set to 5%~15%. Parameters for calculating the correlation strength between sequences include weight coefficients in the attention weight matrix, time decay factors, and other parameters used to calculate the correlation between different time series.

[0103] When the calculated prediction accuracy exceeds a preset threshold, it indicates that the prediction model needs optimization and adjustment. The system inputs the latest actual energy consumption values ​​of enterprises as feedback data into the time series model, triggering the model's online learning mechanism. The update process first calculates the error vector between the predicted and actual values, and then adjusts the weight coefficients of the corresponding time points in the attention weight matrix proportionally based on the magnitude of the error. Simultaneously, a time decay factor is introduced, so that historical data further removed from the current time has a smaller weight. The adjusted parameters are used for subsequent calculations of sequence association strength, improving the model's adaptability to the latest energy consumption patterns.

[0104] S203. Obtain data on changes in the external environment, including information on policy adjustments and market fluctuations.

[0105] External environment change data refers to data related to external factors affecting enterprises' energy use. This includes policy adjustment information such as changes in energy price policies, energy use restriction policies, and regulations issued by government departments regarding energy conservation and emission reduction requirements. Market fluctuation information includes indicators reflecting market conditions, such as changes in energy supply and demand, market price trends, and energy trading volumes.

[0106] This step involves connecting to external data interfaces to regularly acquire the latest policy information and market data. For policy adjustment information, the system automatically parses government-issued policy documents, extracting structured data such as price adjustment ranges and specific requirements for restrictive measures. For market fluctuation information, real-time market transaction data and price indices are obtained by subscribing to data interfaces of energy exchanges and industry information platforms. The system stores the acquired external environmental data in a unified data format for subsequent optimization of predictive models.

[0107] S204. Extract energy price change indicators and energy use restriction indicators from policy adjustment information, and extract energy supply and demand ratio indicators and energy price trend indicators from market fluctuation information.

[0108] Energy price change indicators indicate the direction and magnitude of energy price adjustments, including benchmark price change rates and peak-valley electricity price differences. Energy use restriction indicators include constraint parameters such as energy quotas, restricted periods, and excess penalty coefficients. Energy supply-demand ratio indicators reflect the market supply-demand balance and are calculated as the ratio of supply to demand. Energy price trend indicators include characteristic values ​​such as price change rate, fluctuation cycle, and price range.

[0109] This step first structures the policy adjustment information, extracting price-related data through text analysis, such as converting "electricity price increase of 0.1 yuan / kWh" into a price change rate of +10%; and extracting usage restriction data, such as "power rationing on weekdays from 14:00 to 17:00" into a restriction period of [14,17] and a restriction coefficient of 0. Market fluctuation information is then analyzed to calculate the ratio of daily total energy supply to total consumption, yielding a supply-demand ratio indicator. Time series analysis is used to calculate the first difference, acceleration of change, and cyclical characteristic values ​​of prices, forming a price trend indicator. All extracted indicators are standardized to the [0,1] interval for easier subsequent processing.

[0110] S205. Construct a feature enhancement matrix to map energy price change indicators, energy use restriction indicators, energy supply and demand ratio indicators, and energy price trend indicators to the same feature space as the environmental data, thereby obtaining environmental enhancement features.

[0111] A feature enhancement matrix is ​​a multidimensional tensor used to integrate various indicator data. Environmental data includes natural environmental parameters such as temperature, humidity, and light intensity. A feature space refers to a data representation with the same dimensions and scale. Environmental enhancement features are extended feature vectors that incorporate the influence of external factors on top of the original environmental features.

[0112] This step achieves a unified representation of heterogeneous data by constructing a feature enhancement matrix. The number of rows in the matrix equals the length of the time series, and the number of columns equals the sum of the feature dimensions. First, the environmental data is standardized to form a baseline feature space of dimension d. Then, a mapping function f(x) is constructed to convert various indicators into d-dimensional vectors: price change indicators are transformed through linear mapping; usage restriction indicators are transformed through one-hot encoding; supply and demand ratio indicators are transformed through piecewise function mapping; and price trend indicators are transformed through Fourier transform. Finally, all the transformed feature vectors are concatenated to form the enhanced feature matrix.

[0113] S206. Align environmental enhancement features with enterprise operation data over time to generate a compensation prediction sequence.

[0114] Compensated forecast sequences are revised forecast sequences that incorporate the influence of external environments into the original forecasts. Time series alignment ensures that timestamps from different data sources strictly correspond. Enterprise operational data includes information such as production plans, equipment operating status, and personnel scheduling.

[0115] This step first aligns the environmental enhancement features with the enterprise's operational data according to timestamps, and uses linear interpolation to fill in missing values ​​for asynchronously sampled data. Then, it calculates the interaction between the environmental enhancement features and the enterprise's operational status: for each time point t, the environmental enhancement feature vector and the enterprise operational feature vector are subjected to a tensor outer product operation to obtain the interaction feature matrix. Based on the interaction feature matrix, a compensation function g(t) is constructed, and the original prediction sequence p(t) is corrected to p'(t) = p(t) * (1 + g(t)), generating a compensated prediction sequence that considers the influence of the external environment.

[0116] S207. Calculate the residual vector between the compensation prediction sequence and the actual value of enterprise energy consumption.

[0117] The residual vector is the sequence of differences between predicted and actual values, represented as an n-dimensional vector, where n is the length of the time series. The compensated prediction sequence is a sequence of corrected predictions that takes into account the influence of the external environment. The actual energy consumption of an enterprise is a sequence of real consumption data collected from metering equipment.

[0118] This step involves residual calculation: First, the compensated prediction sequence and the actual value sequence are mapped one-to-one according to time points, forming two vectors P and A of equal length. For each time point t, the residual r(t) = P(t) - A(t) is calculated to obtain the residual scalar. The residual scalars of all time points are combined in chronological order to form the residual vector R. The residual vector is normalized, and the min-max method is used to map the residual values ​​to the interval [-1, 1]. The normalized residual vector is stored as input data for subsequent optimization.

[0119] S208. Based on the distribution characteristics of the residual vector, construct an adaptive weight matrix to perform weighted correction on the correlation strength between sequences, and obtain the optimized energy consumption prediction results.

[0120] The distribution characteristics of the residual vector include statistics such as mean, variance, skewness, and kurtosis. The adaptive weight matrix is ​​an n×n square matrix used to adjust the correlation weights between sequences. The correlation strength represents the degree of similarity between different time series. The optimized prediction result is the final predicted sequence after weight correction.

[0121] This step first analyzes the distribution characteristics of the residual vector: calculating the mean μ, standard deviation σ, skewness s, and kurtosis k of the residual sequence. Based on these statistical characteristics, an adaptive weighting function w(x) = exp(-|x-μ| / σ)*(1+sx+kx²) is constructed. This function is used to generate an n×n weight matrix W, where the matrix element W(i,j) represents the weight coefficient between the i-th and j-th time points. The original correlation strength matrix C and the weight matrix W are multiplied by Hadamard to obtain the corrected correlation strength matrix C' = C⊙W. Based on the corrected correlation strength matrix, the prediction sequence is recalculated to generate the final optimized prediction result.

[0122] S209. Construct a GPU computing resource pool and assign computing power identifiers and storage capacity identifiers to each GPU node.

[0123] A GPU computing resource pool is a parallel computing cluster composed of multiple GPU computing nodes. Computing capacity identifiers include performance parameters such as the number of GPU cores, computing frequency, and memory bandwidth. Storage capacity identifiers include storage parameters such as memory size and cache capacity.

[0124] This step establishes the GPU resource management architecture: First, scan the available GPU devices in the system and read the hardware parameters of each GPU. Create a unique identifier ID for each GPU node, recording its computing power parameters vector_C=(number of cores, frequency, bandwidth) and storage capacity parameters vector_S=(video memory, cache). Construct a resource allocation table T, with each row containing GPU_ID, status flags, computing power vector, storage capacity vector, and current load rate. Implement the resource pool management interface, including functions such as node addition / deletion, status query, and task allocation. Establish a heartbeat monitoring mechanism to periodically check the running status and resource usage of each GPU node.

[0125] S210. Divide the enterprise's historical energy consumption data into multiple data blocks for parallel processing to generate data tensors that meet GPU computing specifications.

[0126] A data block is a subset of continuous time-series data divided into fixed-size segments, with each block containing complete feature dimensions. Parallel processing refers to the simultaneous execution of operations on multiple data blocks across different computing units. A data tensor is a multidimensional array structure, with dimensions including batch size, time step size, and number of features. GPU computing specifications include data type requirements, memory alignment requirements, and batch size limits.

[0127] This step first determines the data partitioning strategy: the base block size is set to 1024 time points, ensuring that each data block size is suitable for the GPU memory architecture. The raw data is preprocessed, including missing value imputation, outlier handling, and data type conversion (float32). The data is then partitioned according to the block size, maintaining a 64-time-point overlap between adjacent blocks to preserve data continuity. Each data block is reassembled into a three-dimensional tensor of shape (batch_size, sequence_length, feature_dim), where batch_size=32, sequence_length=1024, and feature_dim is the feature dimension. The tensor data is memory aligned to ensure it meets GPU computing requirements. A data block index table is generated to record the time range and feature information of each data block.

[0128] S211. Based on the computing power identifier and storage capacity identifier, allocate the data tensor to the corresponding GPU node to perform sequence feature extraction.

[0129] Feature extraction is the process of calculating vector representations that reflect the characteristics of time-series data. Computational capability identifiers define the GPU's computational performance metrics. Storage capacity identifiers indicate the GPU's memory capacity limitations. A GPU node is a computing unit with independent computational and storage resources.

[0130] This step implements the data allocation and computation process: First, calculate the processing power score s_compute = α (number of cores) + β (frequency) + γ (bandwidth) for each GPU node based on its computing power identifier. Then, calculate the storage score s_storage = δ (video memory) + ε (cache) based on the storage capacity identifier, where α, β, γ, δ, and ε are weighting coefficients. Construct a task allocation priority queue, sorting the data tensors according to computational complexity. Process the data tensors one by one: calculate the computational and storage resources required to compute the tensor, and select the GPU node with the highest score that meets the resource requirements to allocate the task. Initiate feature extraction computation on the selected GPU node: use a sliding window to calculate time-domain features (mean, variance, peak value), use FFT to calculate frequency-domain features (spectrum, phase), and use wavelet transform to calculate time-frequency features.

[0131] S212. Set a load balancing threshold. When the resource utilization of a GPU node exceeds the load balancing threshold, the computing task will be migrated to an idle GPU node.

[0132] Load balancing thresholds are metrics that measure the upper limit of GPU resource utilization, typically set at 80% to 90%. Resource utilization includes metrics such as compute unit utilization, memory usage, and bandwidth utilization. Task migration is the process of transferring compute tasks from high-load nodes to low-load nodes. Idle GPU nodes refer to compute nodes whose resource utilization is below a specific threshold.

[0133] This step performs load balancing control: setting the load balancing threshold θ=85% and the monitoring interval Δt=5s. It periodically checks the resource usage of each GPU node: collecting compute unit utilization u_compute, memory usage u_memory, and bandwidth usage u_bandwidth, and calculating the overall load rate u = max(u_compute, u_memory, u_bandwidth). When the overall load rate u_i>θ is detected for node i, task migration is triggered: identifying the set of tasks T currently executing on that node and calculating the resource requirement vector for each task. The load status of all nodes is scanned, and the node j with the lowest load rate is selected as the migration target. Task migration is performed: task execution is paused, task status and data are transferred to the target node, and task execution is resumed on the target node. The task allocation table and node status information are updated.

[0134] The energy prediction and management system in the embodiments of this invention is described below from the perspective of hardware processing. Please refer to [link / reference needed]. Figure 3 This is a schematic diagram of the physical device structure of an energy forecasting and management system in an embodiment of this application.

[0135] It should be noted that, Figure 3 The structure of the energy forecasting and management system shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.

[0136] like Figure 3As shown, the energy forecasting and management system includes a Central Processing Unit (CPU) 301, which can perform various appropriate actions and processes based on programs stored in Read-Only Memory (ROM) 302 or programs loaded from storage section 308 into Random Access Memory (RAM) 303, such as performing the methods described in the above embodiments. The RAM 303 also stores various programs and data required for system operation. The CPU 301, ROM 302, and RAM 303 are interconnected via a bus 304. An Input / Output (I / O) interface 305 is also connected to the bus 304.

[0137] The following components are connected to I / O interface 305: input section 306 including audio input devices, push-button switches, etc.; output section 307 including a liquid crystal display (LCD) and audio output devices, indicator lights, etc.; storage section 308 including a hard disk, etc.; and communication section 309 including a network interface card such as a LAN (Local Area Network) card, modem, etc. Communication section 309 performs communication processing via a network such as the Internet. Drive 310 is also connected to I / O interface 305 as needed. Removable media 311, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 310 as needed so that computer programs read from them can be installed into storage section 308 as needed.

[0138] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing computer programs for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 309, and / or installed from removable medium 311. When the computer program is executed by central processing unit (CPU) 301, it performs the various functions defined in the present invention.

[0139] It should be noted that specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0140] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. Each block in a flowchart or block diagram may represent a module, program segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those shown in the drawings.

[0141] Specifically, the energy forecasting management system of this embodiment includes a processor and a memory. The memory stores a computer program. When the computer program is executed by the processor, it implements the energy forecasting management method based on a time-series large model provided in the above embodiment.

[0142] In another aspect, the present invention also provides a computer-readable storage medium, which may be included in the energy forecasting and management system described in the above embodiments; or it may exist independently and not incorporated into the energy forecasting and management system. The storage medium carries one or more computer programs that, when executed by a processor of the energy forecasting and management system, cause the energy forecasting and management system to implement the energy forecasting and management method based on a large time-series model provided in the above embodiments.

[0143] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

[0144] As used in the above embodiments, depending on the context, the term "when..." can be interpreted as meaning "if...", "after...", "in response to determining...", or "in response to detecting...". Similarly, depending on the context, the phrase "when determining..." or "if (the stated condition or event) is interpreted as meaning "if determining...", "in response to determining...", "when (the stated condition or event) is detected", or "in response to detecting (the stated condition or event)".

[0145] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.

Claims

1. An energy forecasting and management method based on a large time-series model, characterized in that, The method, applied to an energy forecasting and management system, includes: Acquire historical energy consumption data, environmental data, and enterprise operation data of the enterprise, and construct a time series of length T from the historical energy consumption data in chronological order; The time series is divided into multiple subsequences according to a preset length L, and adjacent subsequences in the subsequences have overlapping intervals. Attention calculations are performed on the multiple subsequences using a time-series large model to obtain the correlation strength between the sequences. The correlation strength characterizes the similarity of energy consumption patterns in different time periods. Based on the correlation strength, the system retrieves several historical segments from the enterprise's historical energy consumption data that are most similar to the current energy consumption pattern according to the time series model. Based on the aforementioned time-series big data model, energy consumption forecasts for future periods are generated according to the historical data, environmental data, and enterprise operation data. The predicted energy consumption value is sent to the target client.

2. The method according to claim 1, characterized in that, The step of performing attention calculations on the multiple sub-sequences using a large temporal model to obtain the correlation strength between the sequences, whereby the correlation strength characterizes the similarity of energy consumption patterns across different time periods, specifically includes: The multiple subsequences are respectively input into the encoding and decoding layers of the time series model; In the encoding layer, self-attention weights are calculated within each subsequence, and these self-attention weights are used to characterize the degree of correlation between energy consumption data at different time points within the subsequence. In the decoding layer, based on the self-attention weights, cross-attention weights are calculated between different sub-sequences. These cross-attention weights are used to characterize the similarity of energy consumption patterns between different sub-sequences. The self-attention weights and cross-attention weights are weighted and fused to obtain the correlation strength between the sequences.

3. The method according to claim 1, characterized in that, The step of retrieving, based on the correlation strength and according to the time-series large model, several historical segments most similar to the current energy consumption pattern from the enterprise's historical energy consumption data specifically includes: Based on the correlation strength between the sequences, calculate the similarity score between the current subsequence and all subsequences in the enterprise's historical energy consumption data; The similarity scores are sorted in descending order, and a predetermined number of subsequences with the highest similarity scores are selected as candidate historical segments; Calculate the energy consumption feature vector of the candidate historical segment, wherein the energy consumption feature vector includes energy consumption peak, energy consumption periodicity and energy consumption trend; Based on the energy consumption feature vector, select the historical segments that are most similar to the current energy consumption pattern from the candidate historical segments.

4. The method according to claim 1, characterized in that, The step of retrieving, based on the correlation strength and according to the time-series large model, several historical segments most similar to the current energy consumption pattern from the enterprise's historical energy consumption data specifically includes: The aforementioned historical segments are input into the time series model to generate a basic prediction sequence; Temperature, humidity, and weather conditions are extracted from the environmental data to generate an environmental feature vector; Extract production load, equipment status, and number of personnel from the enterprise's operational data to generate operational feature vectors; The basic prediction sequence is fused with the environmental feature vector and the operational feature vector; Based on the aforementioned time-series large model, the fused features are processed to generate the energy consumption prediction values ​​for the preset future time period.

5. The method according to claim 1, characterized in that, After the step of sending the energy consumption forecast to the target client, the method further includes: Obtain the actual energy consumption value of the enterprise, compare the predicted energy consumption value with the actual energy consumption value of the enterprise, and calculate the prediction accuracy; When the prediction accuracy is lower than a preset threshold, the actual value of the enterprise's energy consumption is fed back to the time series model to update the correlation strength calculation parameters between the sequences.

6. The method according to any one of claims 1 to 4, characterized in that, After the step of sending the energy consumption forecast to the target client, the method further includes: Acquire data on changes in the external environment, including policy adjustment information and market fluctuation information; Extract energy price change indicators and energy use restriction indicators from the policy adjustment information, and extract energy supply and demand ratio indicators and energy price trend indicators from the market fluctuation information; A feature enhancement matrix is ​​constructed to map the energy price change index, the energy use restriction index, the energy supply and demand ratio index, and the energy price trend index to the same feature space as the environmental data, thereby obtaining environmental enhancement features; The environmental enhancement features are time-series aligned with the enterprise operation data to generate a compensation prediction sequence; Calculate the residual vector between the compensation prediction sequence and the actual energy consumption of the enterprise; Based on the distribution characteristics of the residual vector, an adaptive weight matrix is ​​constructed to perform weighted correction on the correlation strength between the sequences, thereby obtaining the optimized energy consumption prediction results.

7. The method according to claim 1, characterized in that, Before the step of generating a predicted energy consumption value for a preset future period based on the time-series large model, the historical data, the environmental data, and the enterprise operation data, the method further includes: Build a GPU computing resource pool and assign computing power identifiers and storage capacity identifiers to each GPU node; The enterprise's historical energy consumption data is divided into multiple data blocks and processed in parallel to generate a data tensor that meets GPU computing specifications. Based on the computing power identifier and the storage capacity identifier, the data tensor is allocated to the corresponding GPU node to perform sequence feature extraction; Set a load balancing threshold. When the resource utilization of a GPU node exceeds the load balancing threshold, the computing task will be migrated to an idle GPU node.

8. An energy forecasting and management system, characterized in that, The energy forecasting and management system includes: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code including computer instructions, and the one or more processors call the computer instructions to cause the energy forecasting and management system to perform the method as described in any one of claims 1-7.

9. A computer-readable storage medium comprising instructions, characterized in that, When the instruction is executed on the energy forecasting and management system, it causes the energy forecasting and management system to perform the method as described in any one of claims 1-7.

10. A computer program product, characterized in that, When the computer program product is run on the energy forecasting and management system, it causes the energy forecasting and management system to perform the method as described in any one of claims 1-7.