Natural gas long-term demand prediction method and system, processing equipment and storage medium

By constructing a large-scale natural gas demand prediction model based on large language models, the problem of insufficient prediction performance of existing models in the case of scarce historical data is solved, and accurate prediction of natural gas demand and flexible adaptation to market changes are achieved.

CN119647837APending Publication Date: 2025-03-18CHINA UNIV OF PETROLEUM (BEIJING)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411661650.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-20
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

The existing natural gas demand forecasting model is limited in predicting performance when historical data is scarce, and it is difficult to accurately predict future market trends.

Method used

A large language model is used to build a large-scale gas demand prediction model. By encoding and training a large amount of time series data, the large-scale model can learn and understand the historical data patterns and trends of natural gas demand and generate accurate prediction results.

Benefits of technology

It realizes accurate prediction of natural gas demand in the case of scarce historical data, improves the learning and generalization capabilities of the model, and can flexibly adapt to changes in the natural gas demand market.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119647837A_ABST
    Figure CN119647837A_ABST
Patent Text Reader

Abstract

The invention relates to a natural gas long-term demand quantity prediction method and system, processing equipment and a storage medium, and the method is characterized in that the method comprises the steps: obtaining the time series data of a part of historical natural gas demand quantity of a to-be-measured region; encoding the obtained time sequence data, inputting the encoded time sequence data into a pre-trained natural gas demand prediction large model, and generating a natural gas demand prediction result of the to-be-detected region; wherein the natural gas demand quantity prediction large model is obtained by training a large language model based on a plurality of time series data including natural gas demand quantity, the method combines the context learning ability of the large language model, can flexibly adapt to sudden changes and fluctuations of a natural gas demand market, provides a dynamically adjusted and optimized prediction result, and improves the prediction efficiency. The method can be widely applied to the natural gas field.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of natural gas, and in particular to a method, system, processing equipment and storage medium for predicting long-term demand for natural gas. Background Art

[0002] In the context of clean and low-carbon energy, natural gas is a transitional energy source to ensure the stable operation of the national economy. China's demand for natural gas will continue to grow, and changes in the environmental situation have also brought uncertainty to future natural gas demand. Therefore, the development of the energy situation and stable supply need to rely on accurate predictions of long-term natural gas demand. Today, commonly used natural gas prediction models include time series models, gray models, regression models, etc., but these models all face some common problems, that is, they all require a large amount of historical data for training. In the case of scarce historical data, the prediction performance of the model will be severely limited. In addition, the natural gas demand market also has strong fluctuations. Traditional models have poor learning ability and insufficient generalization ability, making it difficult to accurately predict future market trends.

[0003] Recently, large language models represented by ChatGPT have achieved remarkable results in natural language processing tasks. Large language models have the ability to understand and generate human text, and can achieve contextual learning and zero-sample inference. Natural gas demand data belongs to time series prediction data. Similar to natural language, time series have seriality and contextual relevance. They are all data generated in a certain order, and each unit (word or time point data) depends on the previous unit. In addition, natural gas demand data and natural language have inherent rules and patterns, such as syntactic and semantic rules in language, and trends and periodicity in time series. Therefore, large language models also have the possibility of processing time series data, and through their contextual learning and zero-sample inference capabilities, they solve the problems of existing time series prediction models being limited by data volume and having weak learning and generalization capabilities.

[0004] However, there is currently no long-term natural gas demand forecasting method based on a large language model that can accurately predict natural gas demand when historical data is scarce. Summary of the invention

[0005] In view of the above problems, the purpose of the present invention is to provide a method, system, processing equipment and storage medium for predicting long-term natural gas demand, which can achieve accurate prediction of natural gas demand when historical data is scarce.

[0006] To achieve the above objectives, the present invention adopts the following technical solutions: In a first aspect, a method for predicting long-term demand for natural gas is provided, comprising: Obtain some time series data of historical natural gas demand in the area to be measured; The acquired time series data is encoded and input into a pre-trained natural gas demand forecasting model to generate a natural gas demand forecasting result for the area to be tested; The large model for predicting natural gas demand is obtained by training a large language model based on a number of time series data including natural gas demand.

[0007] Furthermore, the training process of the natural gas demand prediction model is as follows: Encoding a large amount of time series data including natural gas demand, converting the time series data into discrete symbols to obtain encoded data, wherein the large amount of time series data including natural gas demand is millions to hundreds of millions of data points; A large language model is trained based on the encoded data to obtain a trained large model for natural gas demand prediction.

[0008] Furthermore, the encoding of a large amount of time series data including natural gas demand, converting the time series data into discrete symbols, and obtaining encoded data includes: Set up a time series dataset of natural gas demand , is a single time series data point; Divide the time series data point value range according to a certain interval length to obtain a time series interval data set , is the time series interval boundary, where ; Based on the defined conversion function, the time series data of natural gas demand is encoded, and the original time series data set is converted into a symbol set to obtain the encoded data. .

[0009] Furthermore, the large language model is trained based on the encoded data to obtain a trained large model for natural gas demand prediction, including: Build a large language model, including input layer, multi-head attention mechanism layer, residual connection and layer normalization layer, feedforward neural network layer and output layer; The constructed large language model is trained based on the encoded data to obtain a trained large model for natural gas demand prediction.

[0010] Furthermore, the specific working process of the large language model is as follows: The input layer converts the input encoded time series symbols into vectors of fixed dimensions and maps them into the vector space to obtain an initial time series vector set. It also adds position encoding to the initial time series vector set, encodes the position information of the word in the sentence into the word vector, and obtains a time series vector set after position encoding. The multi-head attention mechanism layer performs a linear transformation on the time series vector set after position encoding to obtain the query vector, key vector and value vector of the time series vector set, and uses the attention calculation formula to calculate the new time series vector set; The residual connection and layer normalization layer normalizes each vector in the time series vector set obtained through the multi-head attention mechanism layer or the feedforward neural network layer according to the characteristics of the layer, and introduces the residual connection method to directly add the output to the input to obtain the time series vector set after residual connection; The feedforward neural network layer performs nonlinear transformation on the residual connected time series vector set based on the obtained time series vector set to obtain a nonlinearly transformed time series vector set; The output layer remaps each time series vector in the set of time series vectors after nonlinear transformation back to a single scalar, and processes the mapped scalar through the softmax activation function to obtain the probability distribution of the prediction result belonging to a certain symbol.

[0011] Furthermore, cross entropy is used as the loss function in the training of the large natural gas demand forecasting model. :

[0012] in, represents the number of samples; Indicates the number of symbols; One-hot encoding representing the actual label; Represents the model for category The predicted probability of .

[0013] Furthermore, the obtained time series data is encoded and input into a pre-trained natural gas demand prediction model to generate a natural gas demand prediction result for the area to be tested, including: Encode the acquired time series data to obtain encoded data; Input the encoded data into a large natural gas demand forecasting model to obtain a model forecasting result; The last symbol in the model prediction result is added to the initial input data and re-input into the natural gas demand prediction model until the length of the model prediction result reaches the preset length or reaches the maximum length of the model. The model prediction result is the final natural gas demand prediction result, completing the natural gas demand prediction for the area to be tested.

[0014] In a second aspect, a natural gas long-term demand forecasting system is provided, comprising: A data acquisition module, used to obtain time series data of some historical natural gas demand in the area to be tested; The prediction module is used to encode the acquired time series data and input it into the pre-trained natural gas demand prediction model to generate the natural gas demand prediction results of the area to be tested; The large model for predicting natural gas demand is obtained by training a large language model based on a number of time series data including natural gas demand.

[0015] In a third aspect, a processing device is provided, comprising computer program instructions, wherein the computer program instructions, when executed by the processing device, are used to implement the steps corresponding to the above-mentioned method for predicting long-term natural gas demand.

[0016] In a fourth aspect, a computer-readable storage medium is provided, on which computer program instructions are stored, wherein the computer program instructions, when executed by a processor, are used to implement the steps corresponding to the above-mentioned method for predicting long-term natural gas demand.

[0017] The present invention adopts the above technical solution, which has the following advantages: 1. The present invention combines the powerful learning ability of the large language model to construct a large natural gas demand forecasting model with strong learning and generalization capabilities, which can achieve accurate forecasting of natural gas demand when historical data is scarce, and provide decision support for the stable supply of energy.

[0018] 2. The present invention introduces a multi-head attention mechanism, which enables the model to learn different features of input data in multiple representation subspaces in parallel, thereby improving the model's adaptability and ability to handle complex market environments, especially in scenarios with drastic demand fluctuations, while still being able to maintain stable prediction performance.

[0019] 3. The present invention applies residual connection and layer normalization in the model, which can effectively solve the problem of gradient disappearance during the training of the large language model for natural gas demand prediction, ensure that information is not lost during the model transmission process, greatly accelerate the convergence speed of the model, and improve the prediction accuracy of the model.

[0020] 4. The present invention adopts an autoregressive prediction method, combined with contextual information, to ensure that the model can gradually derive and generate reasonable demand forecast results when a small amount of data is input, especially when historical data is limited, it can still provide stable forecast output.

[0021] 5. The present invention combines the contextual learning capabilities of the large language model, can flexibly adapt to sudden changes and fluctuations in the natural gas demand market, provide dynamically adjusted and optimized forecast results, and provide technical support for the stability and resilience of the energy supply chain.

[0022] In summary, the present invention can be widely used in the field of natural gas. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Throughout the accompanying drawings, the same reference numerals are used to represent the same components. In the accompanying drawings: Figure 1 It is a schematic diagram of a large model for predicting natural gas demand provided by an embodiment of the present invention; Figure 2 is a schematic diagram of a multi-head attention mechanism layer provided by an embodiment of the present invention; Figure 3 It is a schematic diagram of the result of natural gas demand forecasting using the method of the present invention provided in one embodiment of the present invention. DETAILED DESCRIPTION

[0024] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present invention and to fully convey the scope of the present invention to those skilled in the art.

[0025] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.

[0026] Although the terms first, second, third, etc. can be used in the text to describe multiple elements, components, regions, layers and / or sections, these elements, components, regions, layers and / or sections should not be limited by these terms. These terms can only be used to distinguish an element, component, region, layer or section from another region, layer or section. Unless the context clearly indicates, terms such as "first", "second" and other numerical terms do not imply order or sequence when used in the text. Therefore, the first element, component, region, layer or section discussed below can be referred to as the second element, component, region, layer or section without departing from the teaching of the example embodiments.

[0027] The traditional natural gas demand forecasting model has limited forecasting performance when historical data is scarce. Moreover, it lacks learning and generalization capabilities when dealing with the rapidly changing natural gas demand market forecast, and cannot accurately predict future market trends. The present invention relies on the powerful ability of large language models to understand and generate text, contextual learning and zero-sample inference capabilities, and draws on and utilizes the potential of these models to process time series, so as to achieve accurate natural gas demand forecasting even when historical data is scarce.

[0028] Example 1 This embodiment provides a method for predicting long-term natural gas demand, comprising the following steps: 1) Based on a large amount of time series data (millions to hundreds of millions of data points) including natural gas demand (for example, electricity demand data, energy price data, etc.), the large language model is trained to obtain a trained natural gas demand prediction model.

[0029] 2) Obtain a small amount (30 to 100 data points) of time series data on historical natural gas demand in the area to be measured.

[0030] 3) The acquired time series data is encoded and input into the trained natural gas demand forecasting model to generate the natural gas demand forecast results for the area to be tested.

[0031] In a preferred embodiment, in the above step 1), a large language model is trained based on a large amount of time series data including natural gas demand to obtain a trained natural gas demand prediction large model, specifically: 1.1) Encode a large amount of time series data including natural gas demand, convert the time series data into discrete symbols, and obtain encoded data for processing by the large language model.

[0032] 1.2) Train a large language model based on the encoded data so that the model can learn and understand the historical data patterns and trends of natural gas demand, and obtain a trained large model for natural gas demand prediction.

[0033] In a preferred embodiment, the large language model is good at processing natural language data. Unlike natural language data, which can be viewed as discrete symbols, time series data is a set of continuous data, which needs to be encoded into discrete symbols to form a time series "language" similar to natural language, so as to facilitate in-depth processing or analysis by the large language model. Therefore, the specific process of encoding a large amount of time series data including natural gas demand in the above step 1.1) is: 1.1.1) Set up a time series dataset of natural gas demand , is a single time series data point. The time series data point value range is divided according to a certain interval length to obtain a time series interval data set , is the time series interval boundary, where .

[0034] 1.1.2) Define the conversion function as: (1) in, Indicates symbol.

[0035] 1.1.3) Based on the defined conversion function, encode the time series data of natural gas demand, convert the original time series data set into a symbol set, and obtain the encoded data .

[0036] In a preferred embodiment, the specific process of training the large language model in the above step 1.2) is: 1.2.1) Build a large language model.

[0037] 1.2.2) The constructed large language model is trained based on the encoded data to obtain a trained large model for natural gas demand prediction.

[0038] In a preferred embodiment, in the above step 1.2.1), the large language model in this embodiment adopts the GPT model. The bottom layer of the GPT model is the Transformer architecture, that is, the GPT model is composed of a stack of decoders of several Transformer models, and its structure is as follows: Figure 1 As shown in the figure, the core components of the GPT model mainly include the input layer, the (causal) multi-head attention mechanism layer, the residual connection and layer normalization layer, the feedforward neural network layer and the output layer.

[0039] Specifically, the input layer includes an input encoding part and a position encoding part. The specific working process of the input layer is: ① The input encoding part converts the input encoded data, i.e., the time series symbols, into a vector of fixed dimension and maps it into the vector space. This dimension is called the dimension of the vector, i.e., the time series symbol set. Transform to get the initial time series vector set : (2) in, Represents a trainable weight matrix. Through the above transformation, the original time series symbol set is converted into a time series vector set, which makes it easier for the model to learn the characteristics of the time series.

[0040] ② The order of words in the time series is very important for learning the characteristics of the time series. Therefore, the position encoding part is added to the initial time series vector set Add position encoding to encode the position information of the word in the sentence into the word vector. The position encoding can be obtained by the following transformation method : (3) (4) in, Indicates that it is located The position encoding vector of the position time series symbol The value of the dimension; Indicates the position of the time series symbol in the time series; Represents the frequency parameter, which is used to introduce different frequencies for time series symbols during position encoding so that the model can recognize the position information in the sequence; Represents a sequence index identifier, which is used to identify the time series symbols of odd and even index positions to ensure that the time series symbols of even positions and odd positions are positionally encoded by sine and cosine functions respectively; Represents the dimension of the model. A collection of time series vectors after position encoding for: (5) in, Represents a collection of positional encoding vectors.

[0041] Specifically, the specific working process of the multi-head attention mechanism layer is: ① The time series vector set after position encoding Perform linear transformation to obtain the query vector of the time series vector set , key vector Sum value vector : (6) (7) (8) in, , , Indicates that it is used to obtain , and A trainable linearly varying weight matrix.

[0042] ②Using the attention calculation formula, the query vector based on the obtained time series vector set , key vector Sum value vector , calculate the new time series vector set : (9) in, express The dimension of the vector; express Activation function.

[0043] Specifically, the multi-head attention mechanism divides each vector of the original input time series into multiple parts according to a certain length, and applies the multi-head attention mechanism to each part, namely: (10) in, Represents the length of the new time series vector after division, Represents the embedding dimension of the model, that is, the length of a time series vector; Indicates the number of heads of multi-head attention. Through the multi-head attention mechanism, the model can learn different features of input data in multiple representation subspaces in parallel, thereby improving the model's ability to process information.

[0044] The large natural gas demand forecasting model constructed by the present invention belongs to an autoregressive model, which first generates a single forecast output, then feeds the output back to the original input to form a new input, and then generates the next single forecast output, and repeats this process until the specified output length is reached. In the training phase, in order to prevent the model from "cheating", it is necessary to ensure that the output of each sequence element depends only on the previous sequence element. However, the output sequence is a one-time input. Therefore, the present invention adopts the causal attention method to perform a mask operation on the time series input vector set. When calculating the attention through formula (9), the time series vectors in the input that the model has not seen are not considered, such as Figure 2 shown.

[0045] Specifically, the specific working process of the residual connection and layer normalization layer is: ① In the natural gas demand forecasting model of the present invention, each vector in the time series vector set obtained by the multi-head attention mechanism layer or the feedforward neural network layer is normalized according to the characteristics of the layer: (11) in, The normalized samples of the representation layer; The feature vector representing the input; represents the mean of the eigenvector; represents the standard deviation of the eigenvector; and represents the learned scaling and translation coefficients; Represents a very small number for stable calculation. Through layer normalization operation, the convergence speed of the model can be accelerated and the training process of the model can be stabilized.

[0046] ② Gradient vanishing is a common problem in the training process of deep learning models. In this invention, in order to prevent the problem of gradient vanishing, the residual connection method is introduced to directly add the output to the input to obtain a time series vector set after residual connection: (12) in, Represents the set of time series vectors after residual connection; Represents the original time series symbol set The vector set obtained after the multi-head attention mechanism layer or feedforward neural network layer operation. Through the above method, it is ensured that information is not lost during the transmission process in the model, and the performance and accuracy of the model are improved.

[0047] Specifically, in the large natural gas demand prediction model constructed by the present invention, other parts of the model only perform linear transformation on the input vector, such as the self-attention mechanism and residual connection. The lack of nonlinearity may limit the representation ability of the model. Therefore, this embodiment introduces a feedforward neural network layer. The specific process is as follows: Based on the time series vector set obtained by formula (11), the time series vector set after residual connection is processed through the feedforward neural network layer. Perform nonlinear transformation to obtain a set of time series vectors after nonlinear transformation : (13) in, , Represents trainable weights and biases; Represents the ReLu activation function. Feedforward neural networks use nonlinear activation functions such as ReLU to enhance the representation and learning capabilities of the model.

[0048] Specifically, the output layer consists of two parts: the linear layer and the softmax layer. The specific working process of the output layer is: ① Through the linear layer, the time series vector set after nonlinear transformation Each time series vector in is remapped back to a single scalar .

[0049] ②Through the softmax activation function, the scalar of the mapping Processing is performed to obtain the probability distribution of the predicted result belonging to a certain symbol : (14) in, , Represents trainable weights and biases.

[0050] In a preferred embodiment, unlike the traditional time series prediction model, the natural gas demand prediction model constructed by the present invention predicts the discretized time series, so the cross entropy is used as the loss function during training. : (15) in, represents the number of samples; Indicates the number of symbols; One-hot encoding representing the actual label; Represents the model for category One-hot encoding is the process of converting a time series symbol into a vector containing only 0 and 1, where the dimension of the vector is equal to the total number of symbols, the position corresponding to the category in the vector is 1, and the other positions are 0.

[0051] In a preferred embodiment, in the above step 1.2.2), the constructed large language model is trained based on the encoded data, and the specific process is: ①Use the above formula (1) to input the sequence and target sequence are all converted into discrete symbolic representations, namely and .

[0052] ②Represent the symbol of the input sequence By using the above formulas (2) to (14) in sequence, we can get the prediction results: : (16) in, represents the probability distribution of the symbol predicted by the model.

[0053] ③Symbolize the target sequence Convert to one-hot encoding : (17) in, Indicates the target sequence One-hot encoding of the symbols.

[0054] ④ Input the prediction results of the sequence and the target sequence in the form of one-hot encoding The model loss is calculated by the above formula (15), and the model is trained by the gradient descent algorithm to obtain a trained natural gas demand prediction model.

[0055] In a preferred embodiment, in the above step 3), the natural gas demand forecasting model constructed by the present invention adopts an autoregressive training method during forecasting, that is, the model predicts the next symbol in the sequence through context information. The specific process is as follows: 3.1) Encode the acquired time series data in step 1.1) above to obtain the encoded data .

[0056] 3.2) The encoded data Input it into the large natural gas demand forecasting model to obtain a model forecasting result.

[0057] 3.3) The last symbol in the model prediction result Add to the initial input data, that is, the initial input data becomes , and proceed to step 3.2), until the length of the model prediction result reaches the preset length or reaches the maximum length of the model, the model prediction result is the final natural gas demand prediction result, and the natural gas demand prediction of the area to be tested is completed.

[0058] The method for predicting the long-term demand for natural gas of the present invention is described in detail below through specific embodiments: Taking the Internet public data set as an example, the method of the present invention is used to train a large natural gas demand prediction model and perform natural gas demand prediction. The prediction results are as follows: Figure 3 As shown, it can be seen that the large natural gas demand prediction model constructed by the present invention can make predictions on unseen data sets and has high prediction accuracy.

[0059] Example 2 This embodiment provides a natural gas long-term demand forecasting system, including: The data acquisition module is used to obtain the time series data of some historical natural gas demand in the area to be tested.

[0060] The prediction module is used to encode the acquired time series data and input it into a pre-trained natural gas demand prediction model to generate a natural gas demand prediction result for the area to be tested.

[0061] The large model for predicting natural gas demand is obtained by training a large language model based on a number of time series data including natural gas demand.

[0062] The system provided in this embodiment is used to execute the above-mentioned method embodiments. Please refer to the above-mentioned embodiments for specific processes and detailed contents, which will not be repeated here.

[0063] Example 3 This embodiment provides a processing device corresponding to the natural gas long-term demand prediction method provided in Embodiment 1. The processing device can be applicable to a client processing device, such as a mobile phone, a laptop computer, a tablet computer, a desktop computer, etc., to execute the method of Embodiment 1.

[0064] The processing device includes a processor, a memory, a communication interface and a bus, and the processor, the memory and the communication interface are connected through the bus to complete mutual communication. The memory stores a computer program that can be run on the processing device, and the processing device executes the long-term natural gas demand prediction method provided in this embodiment 1 when running the computer program.

[0065] In some implementations, the memory may be a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage.

[0066] In some other implementations, the processor may be a central processing unit (CPU), a digital signal processor (DSP), or other general-purpose processors of various types, which are not limited herein.

[0067] In addition, the logic instructions in the above-mentioned memory can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on such an understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0068] Those skilled in the art will understand that the structure of the above-mentioned computing device is only a partial structure related to the solution of the present invention, and does not constitute a limitation on the computing device to which the solution of the present invention is applied. The specific computing device may include more or fewer components, or combine certain components, or have a different arrangement of components.

[0069] Example 4 This embodiment provides a computer program product corresponding to the natural gas long-term demand forecasting method provided in Embodiment 1. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for executing the natural gas long-term demand forecasting method described in Embodiment 1.

[0070] Computer readable storage media can be tangible devices that hold and store instructions used by instruction execution devices. Computer readable storage media can be, for example, but not limited to, electronic storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any combination thereof.

[0071] The above embodiment provides a computer-readable storage medium, whose implementation principle and technical effect are similar to those of the above method embodiment, and will not be repeated here.

[0072] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0073] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0074] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0075] The above embodiments are only used to illustrate the present invention, wherein the structure, connection mode and manufacturing process of each component may be changed. Any equivalent transformations and improvements based on the technical solution of the present invention should not be excluded from the protection scope of the present invention.

Claims

1. A method for predicting long-term demand for natural gas, characterized in that: include: Obtain some time series data of historical natural gas demand in the area to be measured; The acquired time series data is encoded and input into a pre-trained natural gas demand forecasting model to generate a natural gas demand forecasting result for the area to be tested; The large model for predicting natural gas demand is obtained by training a large language model based on a number of time series data including natural gas demand.

2. A method for predicting long-term demand for natural gas according to claim 1, characterized in that: The training process of the natural gas demand prediction model is as follows: Encoding a large amount of time series data including natural gas demand, converting the time series data into discrete symbols to obtain encoded data, wherein the large amount of time series data including natural gas demand is millions to hundreds of millions of data points; A large language model is trained based on the encoded data to obtain a trained large model for natural gas demand prediction.

3. A method for predicting long-term natural gas demand according to claim 2, characterized in that: The method of encoding a large amount of time series data including natural gas demand, converting the time series data into discrete symbols, and obtaining encoded data includes: Set up a time series dataset of natural gas demand , is a single time series data point; Divide the time series data point value range according to a certain interval length to obtain a time series interval data set , is the time series interval boundary, where ; Based on the defined conversion function, the time series data of natural gas demand is encoded, and the original time series data set is converted into a symbol set to obtain the encoded data. .

4. A method for predicting long-term demand for natural gas according to claim 2, characterized in that: The method of training a large language model based on the encoded data to obtain a trained large model for predicting natural gas demand includes: Build a large language model, including input layer, multi-head attention mechanism layer, residual connection and layer normalization layer, feedforward neural network layer and output layer; The constructed large language model is trained based on the encoded data to obtain a trained large model for natural gas demand prediction.

5. A method for predicting long-term demand for natural gas according to claim 4, characterized in that: The specific working process of the large language model is as follows: The input layer converts the encoded time series symbols into fixed-dimensional vectors and maps them into the vector space to obtain the initial time series vector set. It also adds position encoding to the initial time series vector set, encodes the position information of the words in the sentence into the word vector, and obtains the time series vector set after position encoding. The multi-head attention mechanism layer performs a linear transformation on the time series vector set after position encoding to obtain the query vector, key vector and value vector of the time series vector set, and uses the attention calculation formula to calculate the new time series vector set; The residual connection and layer normalization layer normalizes each vector in the time series vector set obtained through the multi-head attention mechanism layer or the feedforward neural network layer according to the characteristics of the layer, and introduces the residual connection method to directly add the output and the input to obtain the time series vector set after residual connection; The feedforward neural network layer performs nonlinear transformation on the residual connected time series vector set based on the obtained time series vector set to obtain a nonlinearly transformed time series vector set; The output layer remaps each time series vector in the set of time series vectors after nonlinear transformation back to a single scalar, and processes the mapped scalar through the softmax activation function to obtain the probability distribution of the prediction result belonging to a certain symbol.

6. A method for predicting long-term demand for natural gas according to claim 4, characterized in that: Using cross entropy as the loss function in training the large natural gas demand forecasting model : in, represents the number of samples; Indicates the number of symbols; One-hot encoding representing the actual label; Represents the model for category The predicted probability of .

7. A method for predicting long-term demand for natural gas according to claim 1, characterized in that: The obtained time series data is encoded and input into a pre-trained natural gas demand prediction model to generate a natural gas demand prediction result for the area to be tested, including: Encode the acquired time series data to obtain encoded data; Input the encoded data into a large natural gas demand forecasting model to obtain a model forecasting result; The last symbol in the model prediction result is added to the initial input data and re-input into the natural gas demand prediction model until the length of the model prediction result reaches the preset length or reaches the maximum length of the model. The model prediction result is the final natural gas demand prediction result, completing the natural gas demand prediction for the area to be tested.

8. A natural gas long-term demand forecasting system, characterized in that: include: A data acquisition module, used to obtain time series data of some historical natural gas demand in the area to be tested; The prediction module is used to encode the acquired time series data and input it into the pre-trained natural gas demand prediction model to generate the natural gas demand prediction results of the area to be tested; The large model for predicting natural gas demand is obtained by training a large language model based on a number of time series data including natural gas demand.

9. A processing device, characterized in that: The method comprises computer program instructions, wherein the computer program instructions are used to implement the steps corresponding to the method for predicting long-term natural gas demand according to any one of claims 1 to 7 when executed by a processing device.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, wherein the computer program instructions, when executed by a processor, are used to implement the steps corresponding to the method for predicting long-term natural gas demand according to any one of claims 1-7.