Time sequence extreme value prediction method and system based on quantum Transform model
By using a quantum Transformer model to predict time-series extrema, and replacing the traditional model with a quantum input embedding layer and a multi-head attention layer, the problem of low computational efficiency and insufficient accuracy of high-dimensional nonlinear power load data is solved, and accurate prediction of extrema is achieved. This method is suitable for equipment with limited computing resources.
Patent Information
- Application Number
- CN202511748909.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-26
- Publication Date
- 2026-02-27
AI Technical Summary
Existing time-series forecasting models suffer from a large number of parameters and low computational efficiency when processing high-dimensional nonlinear power load data, making it difficult to accurately capture extreme values of load fluctuations.
A time-series extremum prediction method based on the quantum Transformer model is adopted. The data is mapped to quantum states through a quantum input embedding layer. The quantum multi-head attention layer and quantum variational circuit are combined to replace the embedding layer and attention mechanism of the traditional model for feature extraction and fusion. The computational efficiency is improved by utilizing the properties of quantum superposition and entanglement.
It achieves accurate prediction of the maximum and minimum values in power load time series data, reduces the number of model parameters, improves computational efficiency, and is suitable for deployment on devices with limited computing resources.
Smart Images

Figure CN121584550A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of power load prediction, and more particularly to a time series extreme value prediction method and system based on a quantum Transformer model. BACKGROUND
[0002] In traditional time series prediction tasks, especially load prediction problems, commonly used models include autoregressive models (ARIMA), support vector machines (SVM), long short-term memory networks (LSTM), and other deep learning methods (such as the Transformer model), and deep neural networks (such as the Transformer and LSTM) usually contain a large number of parameters and computing requirements, which can lead to low computing efficiency when facing large-scale data, especially when applied on low-resource devices, the performance is difficult to meet expectations. Quantum computing has different computing advantages from classical computing, especially when dealing with large amounts of complex data. Quantum computing can perform parallel computing in multiple states through quantum superposition and entanglement, thereby effectively improving processing efficiency and capturing complex patterns in data. For time series prediction tasks, quantum computing provides superposition and parallel computing, and has an advantage in strong pattern information expression of quantum entanglement. Using a traditional embedding layer to convert input data into a fixed-dimensional vector, for extreme value and minimum value prediction tasks (such as load data fluctuations), it is difficult to effectively capture complex patterns and long-term dependencies. SUMMARY
[0003] In order to overcome the above-mentioned defects of the prior art, the embodiments of the present application provide a time series extreme value prediction method based on a quantum Transformer model to solve the problems of large number of parameters, low computing efficiency and difficulty in accurately capturing load fluctuation extreme values when existing models process high-dimensional nonlinear data.
[0004] To achieve the above-mentioned purpose, the present application provides the following technical solutions: The time series extreme value prediction method based on the quantum Transformer model comprises the following steps: obtaining historical load data and weather data of a power system as original input sequences; performing feature engineering preprocessing on the original input sequences to obtain standard input data containing time features; inputting the standard input data into a pre-constructed hybrid quantum Transformer model to obtain time series extreme value prediction results.
[0005] In a preferred embodiment, obtaining the time-series extreme value prediction result specifically involves: mapping standard input data to quantum states and extracting deep feature vectors through a quantum input embedding layer; inputting the deep feature vectors into a quantum multi-head attention layer, and combining quantum variational circuits with classical neural networks for feature extraction and fusion; and calculating the load maxima and minimum values within a future set time period through a fully connected layer based on the output of the quantum multi-head attention layer.
[0006] In a preferred embodiment, the hybrid quantum Transformer model replaces the embedding layer in the classical Transformer model with a quantum variational circuit and uses the quantum variational circuit to handle the feature transformation in the attention mechanism.
[0007] In a preferred embodiment, the processing of the quantum input embedding layer includes: setting a classical linear preprocessing layer to process a set of input load time-series data. Converted into an angle vector through linear transformation The expression is as follows:
[0008] In the formula, The parameters of the linear layer are the feature embedding dimension. It is a classic embedding vector; The angle vector The input is fed into the parameterized quantum circuit U to complete the unitary representation conversion and prepare the quantum state. ; By measuring multiple expected values to read information from the quantum state, a classical real-number vector is obtained. The measurement expression is as follows:
[0009] In the formula, A real vector The first in One element, For the corresponding measurement operator.
[0010] In a preferred embodiment, the parameterized quantum circuit U is a quantum variational circuit, the structure of which includes a feature encoding layer, a trainable parameter entanglement layer, and a measurement layer; the feature encoding layer is used to encode classical data into the rotation angle of the qubits; the entanglement layer is used to couple the qubits to each other using quantum logic gates and adjust the circuit parameters through classical optimization techniques; the measurement layer is used to output the measurement results of the quantum circuit and convert them into classical data.
[0011] In a preferred embodiment, the processing process of the quantum multi-head attention layer comprises: generating a query matrix Q, a key matrix K and a value matrix V through a quantum variational circuit and a linear transformation on the position encoded input feature tensor X, and the calculation formula is as follows:
[0012] In the formula, indicates the weight parameters combined with the trainable parameters of the quantum circuit and the linear transformation; The attention weight and the output are calculated by using the scaled dot-product attention mechanism, and the formula is as follows:
[0013] In the formula, is a scaling factor; In the quantum multi-head attention layer, the truncated Fourier series is constructed by using the quantum variational circuit to map the smooth sinusoidal part of the data, and the classical multi-layer perception is used to fill the salient part of the data, so as to extract the harmonic features and non-harmonic features in the data respectively.
[0014] In a preferred embodiment, the feature engineering preprocessing specifically comprises: extracting time features, the time features including hours, weeks and months; and performing normalization processing on the meteorological data. The load data of the past time steps, the normalized meteorological data and the time features are spliced to form an input tensor; and label data is constructed, the label data being the minimum load value and the maximum load value in the future time steps.
[0015] The application provides a time series extreme value prediction system based on a quantum Transformer model, comprising: a data acquisition module, configured to acquire historical load data and meteorological data of a power system as original input sequences; a preprocessing module, configured to perform feature engineering preprocessing on the original input sequences to obtain standard input data containing time features; and a hybrid model prediction module, configured to input the standard input data into a pre-constructed hybrid quantum Transformer model to obtain time series extreme value prediction, specifically: mapping the standard input data into a quantum state through a quantum input embedding layer and extracting a deep feature vector; inputting the deep feature vector into a quantum multi-head attention layer to combine a quantum variational circuit and a classical neural network for feature extraction and fusion; and based on the output of the quantum multi-head attention layer, calculating the load maximum value and the load minimum value in a future set time period through a full connection layer; wherein the hybrid quantum Transformer model replaces the embedding layer in the classical Transformer model with a quantum variational circuit, and processes feature transformation in the attention mechanism by using the quantum variational circuit.
[0016] A time series extreme value prediction device based on a quantum Transformer model comprises a memory and a processor: the memory is used for storing a program; the processor is used for executing the program to realize each step of the time series extreme value prediction method based on the quantum Transformer model.
[0017] A readable storage medium has a computer program stored thereon, and the computer program realizes each step of the time series extreme value prediction method based on the quantum Transformer model when executed by a processor.
[0018] The time series extreme value prediction method based on the quantum Transformer model has the following technical effects and advantages: The present application effectively combines the high-dimensional feature mapping capability of quantum computing and the data processing capability of classical neural networks by using a quantum variational circuit to replace the embedding layer in the classical Transformer model and the feature transformation in the attention mechanism, thereby realizing accurate prediction of the maximum and minimum values in the power load time series data. BRIEF DESCRIPTION OF DRAWINGS
[0019] Figure 1 A time series extreme value prediction method based on a quantum Transformer model is provided for the embodiments of the present application; Figure 2 A hybrid quantum Transformer network module is provided for the embodiments of the present application; Figure 3 A quantum multi-head attention layer module is provided for the embodiments of the present application; Figure 4 A quantum variational layer design diagram is provided for the embodiments of the present application; Figure 5 A composition block diagram of a time series extreme value prediction system based on a quantum Transformer model is provided for the embodiments of the present application; Figure 6 A structural block diagram of an exemplary electronic device capable of realizing the embodiments of the present disclosure is provided for the embodiments of the present application; Figure 7 A schematic diagram of an exemplary storage medium capable of realizing the embodiments of the present disclosure is provided for the embodiments of the present application. DETAILED DESCRIPTION
[0020] With reference to the accompanying drawings, the technical solutions in the embodiments of the present application will be described clearly and completely. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present application.
[0021] Embodiment 1, Figure 1 The time series extreme value prediction method based on the quantum Transformer model of the present application is given, including the following steps: S1, obtaining historical load data and meteorological data of a power system as original input sequences.
[0022] In this embodiment, the specific steps of S1 are as follows: The system establishes a communication connection with a power data acquisition terminal or a historical database of a dispatching center, and extracts the power load records of a target area in a past preset time period from the historical database. The load data specifically refers to the actual active power values of a specific node or region in the power system changing with time, which can reflect the power consumption behavior and trend of users in the region. At the same time, the system obtains contemporaneous meteorological monitoring data through a meteorological service interface or a local meteorological monitoring station. The meteorological data mainly includes environmental factors that have a significant impact on power load, such as temperature, humidity, rainfall, wind speed, etc. After obtaining the above two types of data, the system performs time series alignment operation on the load data and meteorological data according to a unified time stamp, to ensure that the data of each sampling point is synchronized in physical time, and to eliminate data segments with unmatched or severely missing time stamps, thereby constructing an original input sequence composed of time series, to provide real and complete physical basic data for subsequent feature engineering and model training.
[0023] S2, performing feature engineering preprocessing on the original input sequence to obtain standard input data containing time features.
[0024] In this embodiment, step S2 includes: The feature engineering preprocessing specifically includes: Extracting time features, the time features including hour, day of week and month. Specifically, the system uses a calendar algorithm to analyze the time stamp corresponding to each data point in the original input sequence, and separates the hour (hour), day of week (dayofweek) and month (month) values from it. These time features can assist the model in identifying the fluctuation rules of power load in daily, weekly and seasonal cycles.
[0025] Performing normalization processing on the meteorological data: After the time feature extraction is completed, in order to eliminate the difference between different dimensional data, avoid large numerical features dominating the gradient update direction in subsequent network training, the system needs to normalize the weather data and load data, usually using the maximum and minimum value normalization method to map the data to the [0, 1] or [-1, 1] interval, the normalization processing calculation formula is as follows: , In the formula, is the normalized data value, is the original data value, and respectively represent the maximum and minimum values of the feature in the training data set.
[0026] The load data of the past several time steps, the normalized weather data and the time features are spliced to form an input tensor, specifically: Set a history observation window with a length of For each time in the sequence, the historical data segment from to is intercepted, and the normalized load data, normalized weather data and extracted time features at each time in the segment are vector spliced to form an input tensor with a dimension of , wherein represents the total number of features contained in each time step.
[0027] The label data is constructed, which is the minimum load value and the maximum load value in the future several time steps, specifically: For each time corresponding to the above input tensor, the future time window with a length of is indexed backward, i.e. from to , all load true values in the future window are traversed, the minimum value and the maximum value are calculated and extracted, and the two scalars are taken as the supervision label (GroundTruth) of the input sample.
[0028] It should be noted that in the data preprocessing process in the embodiment, the data is divided into training set, validation set and test set in proportion. Specifically, the training set accounts for 70% of the total data, the validation set accounts for 15%, and the remaining 15% is used as the test set. Time series order division is used for data division (i.e. without disturbing the data order), to ensure that there is no data leakage in the training process.
[0029] The embodiment converts the heterogeneous physical data into a standard tensor format processable by the neural network, enhances the sensitivity of the model to the periodic extreme value through explicit time feature coding, and directly guides the peak-valley value prediction target that is most concerned by the power grid regulation, thereby significantly improving the pertinence and convergence efficiency of the model training.
[0030] S3, inputting the standard input data into the pre-constructed hybrid quantum Transformer model to obtain a time series extreme value prediction result.
[0031] It should be noted that the traditional time series prediction methods, such as ARIMA, LSTM or classical Transformer model, usually use a fixed classical embedding layer to map discrete data into a high-dimensional vector when processing power load data. This way has a bottleneck for capturing complex nonlinear relationships and long-term dependencies in data, and with the increase of input dimension, the model parameter quantity will increase exponentially, resulting in large consumption of computing resources and easy overfitting. Especially in the prediction task of load extreme value (maximum value and minimum value), since the extreme value is often contained in the high-frequency fluctuation or mutation mode of data, the traditional model is difficult to effectively distinguish between regular fluctuations and extreme events. The present application introduces quantum computing technology, replaces the embedding layer and the core transformation of the attention mechanism in the classical Transformer with a parameterized quantum variational circuit (VQC) to process data in the Hilbert space, and uses quantum parallelism to achieve stronger feature expression capability with fewer parameters, thereby significantly improving the capture accuracy of load extreme value.
[0032] In the embodiment, step S3 includes the following steps: S301, mapping the standard input data into a quantum state through a quantum input embedding layer and extracting a deep feature vector. This process aims to solve the dimension matching problem between classical data and quantum state, and encode the time series data into the physical parameters of the quantum system. Specifically, in order to meet the data dimension matching, the system first sets a classical linear preprocessing layer, and for a set of standard input data vectors containing load and meteorological information , the linear transformation is used to convert it into an angle vector suitable for quantum circuit processing, and the calculation formula of the angle vector is as follows: , In the formula, represents the weight matrix of the classical linear layer, which is used to adjust the feature embedding dimension, is the input classical data vector. Subsequently, the generated angle vector is input into a parameterized quantum circuit In VQC (Virtual Quantum Coherence), data is encoded into the phase or amplitude of a qubit through a quantum rotation gate, completing the unitary representation transformation of the data and preparing a quantum state containing the input information. .like Figure 2 As shown, quantum circuit The structure comprises a feature encoding layer, a parameter update layer, an entanglement layer, and a measurement layer. The feature encoding layer maps classical data to the rotation angles of the qubits. The entanglement layer couples the qubits together using entanglement logic such as CNOT gates or CZ gates to capture correlations between features. Finally, information is read from the quantum state by measuring multiple expected values to obtain a classical real-number vector. This vector is the extracted deep feature vector, and the calculation formula for the measurement is as follows: , In the formula, Represents the output vector The first in One element, For the corresponding measurement operator (such as the Pauli-Z operator). This is the final quantum state after evolution through quantum circuitry.
[0033] S302, the deep feature vector is input into the quantum multi-head attention layer, and feature extraction and fusion are performed by combining quantum variational circuits and classical neural networks. In this step, as... Figure 3 As shown, the model no longer uses purely classical linear transformations to generate the query (Q), key (K), and value (V) matrices, but instead utilizes a combination of quantum variational circuits and linear transformations. Specifically, for the position-encoded input feature tensor... The calculation formula is as follows, using three independent quantum layer Q, K, and V matrices: , In the formula, Instead of a single classical weight matrix, the composite transformation parameter contains both trainable parameters of the quantum circuit and parameters of the classical linear transformation. In this process, the quantum variational circuit (VQC) is designed to create a truncated Fourier series that behaves as a harmonic function, which is good at capturing smooth, periodic sine / cosine components (harmonic features) in the data; while the parallel classical multi-layer perceptron (MLP) network creates a non-harmonic function for the data set, which is good at capturing mutations and spikes (non-harmonic features) in the data. Through this complementary setting, the quantum multi-head attention layer can extract features from both the position space (through the MLP) and the conjugate momentum space (through the VQC) at the same time, achieving comprehensive coverage of the details of the power load fluctuations. Based on the generated Q, K, and V matrices, the attention weight and output are calculated using the scaled dot-product attention mechanism, and the calculation formula of the attention output is as follows: , wherein, is a scaling factor to prevent the gradient from vanishing due to the large dot product result.
[0034] S303, based on the output of the quantum multi-head attention layer, the load maximum value and the load minimum value in the future set time period are calculated through a fully connected layer. The system flattens or performs global average pooling on the output tensor of the attention layer, and inputs it into the end fully connected regression layer, which contains two output nodes corresponding to the maximum load value and the minimum load value in the prediction time window.
[0035] It should be noted that the quantum layer is specifically designed as shown in Figure 4 The design is a common way for quantum neural network models, and the variational quantum circuit (VQC) has been widely used in hybrid quantum-classical computing systems. These algorithms are implemented through parameterized quantum circuits, and the circuit parameters can be adjusted through classical optimization techniques. The core of VQC is the variational quantum circuit (Variational Quantum Circuits, VQC), which is composed of parameterized quantum logic gates for processing quantum data sets and embedding the results into classical machine learning models. The VQC structure includes the part of encoding the classical input data into the circuit quantum state and the variational circuit block with learnable parameters. The VQC structure diagram mainly includes three parts: feature encoding layer, trainable parameters and entanglement layer, and measurement layer; wherein the parameter of RY is the parameter for evolution of the quantum state. VQC measures the output of the quantum circuit and converts the result into classical data, and then calculates the loss value, parameter gradient using the classical model, and updates the model parameters. Compared with classical neural networks, VQC shows better performance under the condition of limited number of parameters, and can be iteratively optimized by classical computers.
[0036] The embodiment fuses the quantum variational circuit into the embedding layer and attention layer of the Transformer architecture, combines the strong fitting ability of the VQC for smooth harmonic features with the capturing ability of the classical network for abrupt features, effectively solves the precision short board of the traditional model in extreme value prediction, and greatly compresses the model parameter quantity through quantum coding, so that the method is more suitable for deployment in the edge side power monitoring equipment with limited computing resources under the premise of ensuring the prediction performance.
[0037] Embodiment 2, Figure 5 A time series extreme value prediction system based on a quantum Transformer model is given, comprising: A data acquisition module is configured to acquire historical load data and weather data of a power system as original input sequences. A preprocessing module is configured to perform feature engineering preprocessing on the original input sequences to obtain standard input data containing time features. A hybrid model prediction module is configured to input the standard input data into a pre-constructed hybrid quantum Transformer model to obtain time series extreme value prediction, specifically: The standard input data is mapped to a quantum state through a quantum input embedding layer and a deep feature vector is extracted. The deep feature vector is input into a quantum multi-head attention layer, and the quantum variational circuit and the classical neural network are combined for feature extraction and fusion. Based on the output of the quantum multi-head attention layer, the load maximum value and the load minimum value in the future set time period are calculated through a fully connected layer. The hybrid quantum Transformer model replaces the embedding layer in the classical Transformer model with a quantum variational circuit, and uses the quantum variational circuit to process feature transformation in the attention mechanism.
[0038] Embodiment 3, A time series extreme value prediction device based on a quantum Transformer model, as shown in Figure 6 The device includes a memory and a processor: the memory is configured to store a program; and the processor is configured to execute the program to implement any of the embodiments of the first embodiment.
[0039] Since the time series extreme value prediction device based on the quantum Transformer model introduced in the embodiment is a device used to implement the method in Embodiment 1 of the application, the specific implementation of the electronic device of the embodiment and various changes thereof can be understood by those skilled in the art based on the method introduced in Embodiment 1 of the application, so the method of the electronic device how to realize the method in the embodiment of the application will not be introduced in detail. As long as the device used to implement the method in the embodiment of the application is implemented by those skilled in the art, it belongs to the scope of the application.
[0040] Embodiment 5, A readable storage medium has a computer program stored thereon, as Figure 7 As shown, the computer program is executed by the processor to implement any of the embodiments of Embodiment 1.
[0041] The above formulas are all dimensionless numerical calculations, and the formulas are obtained by collecting a large amount of data to simulate the recent real situation, and the preset parameters in the formula are set by the person skilled in the art according to the actual situation.
[0042] The above embodiments can be realized all or partially by software, hardware, firmware or other any combination. When realized by software, the above embodiments can be realized in the form of computer program product all or partially.
[0043] Those skilled in the art can realize that the modules and algorithm steps of the examples described in combination with the embodiments disclosed herein can be realized by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. The skilled person can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the application.
[0044] In addition, the functional modules in each embodiment of the application can be integrated in one processing module, or each module can exist physically alone, or two or more modules can be integrated in one module.
[0045] The above is only a specific implementation of the application, but the protection scope of the application is not limited thereto. Any skilled person in the art can easily think of changes or replacements within the technical range disclosed in the application, which should be covered within the protection scope of the application. Therefore, the protection scope of the application should be subject to the protection scope of the claims.
[0046] Finally: the above only for the preferred embodiments of the present application, and not for limiting the present application, any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application, should be included in the scope of protection of the present application.
Claims
1. A method for predicting temporal extrema based on the quantum Transformer model, characterized in that, Includes the following steps: Historical load data and meteorological data of the power system are obtained as the raw input sequence; The original input sequence is preprocessed using feature engineering to obtain standard input data containing time features; The standard input data is input into a pre-built hybrid quantum Transformer model to obtain the time series extremum prediction results, specifically: The standard input data is mapped to quantum states and deep feature vectors are extracted through a quantum input embedding layer. The deep feature vector is input into the quantum multi-head attention layer, and feature extraction and fusion are performed by combining quantum variational circuits and classical neural networks. Based on the output of the quantum multi-head attention layer, the maximum and minimum load values within a future set time period are calculated through a fully connected layer. The hybrid quantum Transformer model replaces the embedding layer in the classical Transformer model with a quantum variational circuit, and uses the quantum variational circuit to handle the feature transformation in the attention mechanism.
2. The time series extremum prediction method based on the quantum Transformer model according to claim 1, characterized in that, The processing steps of the quantum input embedding layer include: Set up a classic linear preprocessing layer to process the input set of load time series data. Converted into an angle vector through linear transformation The expression is as follows: In the formula, The parameters of the linear layer are the feature embedding dimension. It is a classic embedding vector; The angle vector The input is fed into the parameterized quantum circuit U to complete the unitary representation conversion and prepare the quantum state. ; By measuring multiple expected values to read information from the quantum state, a classical real-number vector is obtained. The measurement expression is as follows: In the formula, A real vector The first in One element, For the corresponding measurement operator.
3. The time series extremum prediction method based on the quantum Transformer model according to claim 2, characterized in that, The parameterized quantum circuit U is a quantum variational circuit, whose structure includes a feature encoding layer, a trainable parameter entanglement layer, and a measurement layer. The feature encoding layer is used to encode classical data into the rotation angle of the qubit; The entanglement layer is used to couple qubits to each other using quantum logic gates and to adjust circuit parameters using classical optimization techniques; The measurement layer is used to output the measurement results of the quantum circuit and convert them into classical data.
4. The time series extremum prediction method based on the quantum Transformer model according to claim 1, characterized in that, The processing procedure of the quantum multi-head attention layer includes: For the position-encoded input feature tensor X, the query matrix Q, key matrix K, and value matrix V are generated through quantum variational circuitry and linear transformation, as shown in the following formula: In the formula, This represents the weight parameters that combine the trainable parameters of the quantum circuit with the weights of the linear transformation; The attention weights and output are calculated using the scaled dot product attention mechanism, as shown in the following formula: In the formula, This is the scaling factor; In the quantum multi-head attention layer, a truncated Fourier series is constructed using a quantum variational circuit to map the smooth sinusoidal part of the data, and a classical multilayer perceptron is used to fill the salient part of the data, thereby extracting harmonic and non-harmonic features from the data respectively.
5. The time series extremum prediction method based on the quantum Transformer model according to claim 4, characterized in that, The feature engineering preprocessing specifically includes: Extract time features, including hours, days of the week, and months; Meteorological data are normalized. The load data from several past time steps, the normalized meteorological data, and the time features are concatenated to form the input tensor; Construct tag data, which consists of the minimum and maximum load values over several future time steps.
6. A time-series extremum prediction system based on a quantum Transformer model, used to execute the method according to any one of claims 1 to 5, characterized in that, include: The data acquisition module is used to acquire historical load data and meteorological data of the power system as raw input sequences; The preprocessing module is used to perform feature engineering preprocessing on the original input sequence to obtain standard input data containing time features; The hybrid model prediction module is used to input the standard input data into a pre-built hybrid quantum Transformer model to obtain time series extremum predictions, specifically: The standard input data is mapped to quantum states and deep feature vectors are extracted through a quantum input embedding layer. The deep feature vector is input into the quantum multi-head attention layer, and feature extraction and fusion are performed by combining quantum variational circuits and classical neural networks. Based on the output of the quantum multi-head attention layer, the maximum and minimum load values within a future set time period are calculated through a fully connected layer. The hybrid quantum Transformer model replaces the embedding layer in the classical Transformer model with a quantum variational circuit, and uses the quantum variational circuit to handle the feature transformation in the attention mechanism.
7. A computer device, characterized in that, The device includes a processor and a memory: The memory is used to store computer programs and send the instructions of the computer programs to the processor; The processor executes a time-series extremum prediction method based on a quantum Transformer model as described in any one of claims 1-5 according to the instructions of the computer program.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements a time-series extremum prediction method based on a quantum Transformer model as described in any one of claims 1-5.