Transform-based model prediction control

By introducing Transformer-based methods and meta-learning algorithms in model prediction control, the problem of insufficient adaptability of traditional MPC in nonlinear systems and dynamic environments is solved, and higher robustness and real-time control effects are achieved.

CN120103706APending Publication Date: 2025-06-06ANHUI SHANGGAO DATA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510252310.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-05
Publication Date
2025-06-06

AI Technical Summary

Technical Problem

Traditional model predictive control (MPC) is not adaptable and robust when dealing with application scenarios of highly nonlinear systems, dynamically changing environments, and real-time data flows, especially when facing new situations or changes in operating conditions.

Method used

The model prediction control method based on Transformer is adopted, combined with meta-learning and deep learning technology, and the dynamic changes in state information in the state space model are captured through the Transformer encoder, and the model is quickly adjusted to adapt to environmental changes using the meta-learning algorithm.

Benefits of technology

It improves the adaptability, robustness and real-timeness of the control system in nonlinear systems, dynamically changing environments and real-time data flows, and improves prediction accuracy and computing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120103706A_ABST
    Figure CN120103706A_ABST
Patent Text Reader

Abstract

The invention is suitable for the technical field of model predictive control, provides model predictive control based on Transform, and improves the ability of a control system to process time series data with complex dependency and dynamic change based on complex dependency of Transform learning data. The dynamic change of state information in the state space model is captured by using a Transform encoder, so that the prediction precision is improved; and the meta-learning rapid adjustment model is utilized to timely cope with the dynamic change of the environment. An MAML training algorithm is used, a new task can be quickly adapted through a small amount of gradient updating, the operation requirements are remarkably reduced, and the calculation efficiency is improved; future output is predicted based on a Transfor mer meta-learning model, MPC is optimized, and the robustness of the control system is improved. And an online learning mechanism is introduced, so that the system can continuously learn and quickly adapt to new operation conditions, and the flexibility of the system is further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of model predictive control, and in particular relates to a Transformer-based model predictive control. Background Art

[0002] Model Predictive Control (MPC) is an advanced control strategy that predicts the future state of a system by optimizing the control input sequence and ensures that the system reaches the predetermined goal within a limited time. The core of MPC is its ability to handle multi-input and multi-output systems while taking into account system dynamics and constraints. Specifically, the MPC controller uses a prediction model to calculate the system state in the future based on the current state of the system and the future control quantity, and then substitutes the obtained prediction results into the iterative optimization link, calculates through a pre-constructed cost function, and finally selects the control quantity that makes the cost function take the optimal result as the output, and performs feedback correction based on the error between the actual output of the system and the predicted output. The core problem of the MPC algorithm is to establish an accurate dynamic model, predict the future system behavior, and solve an optimal control sequence to achieve optimal control of the system.

[0003] The prior art still has the following deficiencies:

[0004] Although traditional MPC has proven its effectiveness in many fields, it still faces many challenges when dealing with highly nonlinear systems, dynamically changing environments, and real-time data streams. In particular, when the system encounters new situations that have never been seen or changes in operating conditions, the adaptability and robustness of traditional MPC are often insufficient. In order to overcome these shortcomings, the present invention proposes a Transformer-based model predictive control method, which improves the adaptability, robustness, and real-time performance of MPC in nonlinear systems, dynamically changing environments, and real-time data streams by combining meta-learning and deep learning techniques. Summary of the invention

[0005] The present invention provides a Transformer-based model predictive control, which aims to solve the problem that although traditional MPC has proven its effectiveness in many fields, it still faces many challenges when dealing with highly nonlinear systems, dynamically changing environments, and application scenarios of real-time data streams. In particular, when the system encounters new situations that have never been seen or changes in operating conditions, the adaptability and robustness of traditional MPC are often insufficient.

[0006] The present invention is implemented in this way: a Transformer-based model predictive control comprises the following steps:

[0007] Step 1: Train the meta-learning model to obtain the updated model parameters θ after meta-training, and use an independent test data set for evaluation. The meta-learning model is constructed based on Transformer, which includes Transformer model construction and meta-learning algorithm integration.

[0008] Step 2: Based on the state space model of Transformer, the encoder of Transformer is used to capture the dynamic changes of the state, dynamically update the state vector, and the decoder network of Transformer is used to generate observation values. The state space model of the system is formed based on the combination of state equation and observation equation, including state equation and observation equation.

[0009] Step 3: Integrate the model predictive control of the Transformer meta-learning model, use MPC to solve the optimization problem, find the optimal control sequence, and bring the optimized control input into the system for iterative calculation, which includes stateful prediction, prediction output, and MPC optimized control input.

[0010] Preferably, the state space model based on Transformer in step 2 includes the following components: an input embedding layer, a multi-head self-attention layer, a position encoding, a feedforward neural network layer and an output layer, as follows:

[0011] Input embedding: Each input sequence x t The input sequence is converted to a high-dimensional feature representation through an embedding layer, where the input sequence contains the control variables (CV) of the past Nc steps, represented as X = [X t-Nc+1 , X t-Nc+2 , ..., X t ].

[0012] Preferably, the position coding: position coding is added to capture the timing information in the time series, and a common method is to use a combination of sine and cosine functions:

[0013]

[0014] Where pos is the position in the sequence, i is the dimension index, and d model is the dimension of the model. The input data is added to the positional encoding to form the input of the encoder:

[0015] X encoded =X+PE

[0016] Encoder layer: Linearly transform the encoder input data to obtain the Q, K, V matrices:

[0017]

[0018] Calculate the attention score: Calculate the dot product of the query and the key, and get the attention weight through the softmax function:

[0019]

[0020] Where Q, K, V are query, key, and value, which are linear transformations of the input.

[0021] are learnable parameters.

[0022] Preferably, the method of calculating the attention output of multiple heads is to concatenate them and obtain the final output through linear transformation:

[0023] MultiHead(Q,K,V)=Concat(head 1 , ..., head h )W O

[0024] Add the multi-head attention output to the input and normalize it:

[0025] z i =LayerNorm(X encoded +MultiHead(Q,K,V)

[0026] The normalized output is subjected to feedforward neural network calculation to further extract features:

[0027] FFN(z i )=ReLU(z i W 1 +b 1 )W 2 +b 2

[0028] Add the feedforward neural network output to the input and normalize it:

[0029] y i =LayerNorm(z i +FFn(z i )).

[0030] Preferably, the meta-learning algorithm ensemble includes using model-agnostic meta-learning (MAML) as a training algorithm, wherein the MAML training:

[0031] Among them, θ is the initial parameter, α and β are learning rates, and is the loss function on different tasks.

[0032] Preferably, the specific process of step one is:

[0033] (1) Initialize model parameters θ: mainly including all weights and biases in the Transformer network;

[0034] (2) Setting the learning rate: α is used for intra-task gradient updates, and β is used for global updates across tasks;

[0035] (3) Loading and preprocessing data: The data is grouped into different tasks, each task corresponding to a specific operating condition or control objective;

[0036] (4) Meta-learning cycle training: In each meta-training cycle, the model parameters are updated using the training data;

[0037] (5) Perform performance evaluation on the final model.

[0038] Preferably, the state space model of the Transformer in step 2 includes using a Transformer encoder to capture dynamic changes in state;

[0039] Let x t is the state vector at time t, then the state equation can be expressed as:

[0040] x t+1 =f(x t ,u t )

[0041] Where: x t is the state vector at time t, u t is the input vector at time t, and f is the state transfer function, which is implemented by the Transformer encoder:

[0042] x t+1 = TransformerEncoder(x t ,u t ).

[0043] Preferably, the observation equation can be expressed as:

[0044] y t =g(x t )

[0045] Where: y t is the observed value at time t, and g is the mapping function from state to observed value, which is usually a linear or nonlinear function. In the Transformer-based model, the mapping function g can be implemented using a simple feedforward neural network, namely:

[0046] y t= TransformerDecoder(x t ).

[0047] Preferably, the specific process in step 2 is:

[0048] (1) First, initialize the state vector x 0 and Transformer model parameters;

[0049] (2) Then update the state using the Transformer encoder:

[0050] x t+1 = TransformerEncoder(x t ,u t );

[0051] (3) Finally, observation generation, using the decoder network to generate observation values:

[0052] y t = TransformerDecoder(x t ).

[0053] Preferably, the state prediction in step 3 is expressed as:

[0054] Let x t is the system state at the current moment, and the output of the model is the predicted state at the next moment, which can be expressed as:

[0055]

[0056] where u t is the current control input.

[0057] The prediction output is expressed as:

[0058]

[0059] The MPC optimization control input is expressed as solving and optimizing the integrated MPC problem. The specific optimization can be expressed as:

[0060] Objective function:

[0061]

[0062] Where N is the prediction step size, Q and R are weight matrices used to balance the state error and control cost.

[0063] optimization:

[0064]

[0065] Find the partial derivative of u for the control input:

[0066]

[0067] Combine the two gradients above:

[0068]

[0069] because:

[0070] x t+1 =f(x t ,u t )

[0071]

[0072] so:

[0073]

[0074] Let it be equal to 0:

[0075]

[0076] To solve the above equation, we can transform it into a matrix form: for each k, we have:

[0077]

[0078] so:

[0079]

[0080] This means:

[0081]

[0082] Right now:

[0083]

[0084] R is a diagonal matrix, let R = rI, then:

[0085]

[0086] so:

[0087]

[0088] Specifically, for each k:

[0089]

[0090] Therefore, what needs to be solved is to find the optimal control sequence under constraints, such as state constraints and control input constraints: t:t+N-1 .

[0091] Compared with the prior art, the embodiments of the present application have the following beneficial effects:

[0092] 1. Based on the complex dependencies of Transformer learning data, the control system's ability to process time series data with complex dependencies and dynamic changes is improved. The Transformer encoder is used to capture the dynamic changes of state information in the state space model, which improves the prediction accuracy.

[0093] 2. Use meta-learning to quickly adjust the model to respond to changes in environmental dynamics in a timely manner. The MAML training algorithm is used to quickly adapt to new tasks through a small amount of gradient updates, significantly reducing computing requirements and improving computing efficiency.

[0094] 3. The Transformer-based meta-learning model predicts future outputs, optimizes MPC, and improves the robustness of the control system. The introduction of an online learning mechanism enables the system to continuously learn and quickly adapt to new operating conditions, further improving system flexibility. BRIEF DESCRIPTION OF THE DRAWINGS

[0095] Figure 1 It is a schematic diagram of the structure of the present invention;

[0096] Figure 2 It is a schematic diagram of the structure of a model prediction control process based on Transformer of the present invention; DETAILED DESCRIPTION

[0097] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of this application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of this application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.

[0098] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0099] The embodiment of the present invention provides a Transformer-based model predictive control, as shown in the figure, including the following steps:

[0100] Step 1: Train the meta-learning model to obtain the updated model parameters θ after meta-training, and use an independent test data set for evaluation. The meta-learning model is constructed based on Transformer, which includes Transformer model construction and meta-learning algorithm integration.

[0101] Step 2: Based on the state space model of Transformer, the encoder of Transformer is used to capture the dynamic changes of the state, dynamically update the state vector, and the decoder network of Transformer is used to generate observation values. The state space model of the system is formed based on the combination of state equation and observation equation, including state equation and observation equation.

[0102] Step 3: Integrate the model predictive control of the Transformer meta-learning model, use MPC to solve the optimization problem, find the optimal control sequence, and bring the optimized control input into the system for iterative calculation, which includes stateful prediction, prediction output, and MPC optimized control input.

[0103] The Transformer-based state space model in step 2 consists of the following components: input embedding layer, multi-head self-attention layer, position encoding, feedforward neural network layer and output layer, as follows:

[0104] Input embedding: Each input sequence x t The input sequence is converted to a high-dimensional feature representation through an embedding layer, where the input sequence contains the control variables (CV) of the past Nc steps, represented as X = [X t-Nc+1 , X t-Nc+2 , ..., X t ].

[0105] Position encoding: Position encoding is added to capture the timing information in the time series. A common method is to use a combination of sine and cosine functions:

[0106]

[0107] Where pos is the position in the sequence, i is the dimension index, and d model is the dimension of the model. The input data is added to the positional encoding to form the input of the encoder:

[0108] X encoded =X+PE

[0109] Encoder layer: Linearly transform the encoder input data to obtain the Q, K, V matrices:

[0110]

[0111] Calculate the attention score: Calculate the dot product of the query and the key, and get the attention weight through the softmax function:

[0112]

[0113] Where Q, K, V are query, key, and value, which are linear transformations of the input.

[0114] are learnable parameters.

[0115] The way to calculate the attention output of multiple heads is to concatenate them and get the final output through linear transformation:

[0116] multiHead(Q,K,V)=Concat(head 1 , ..., head h )W O

[0117] Add the multi-head attention output to the input and normalize it:

[0118] z i =LayerNorm(X encoded +MultiHead(Q,K,V)

[0119] The normalized output is subjected to feedforward neural network calculation to further extract features:

[0120] FFN(z i )=ReLU(z i W 1 +b 1 )W 2 +b 2 Add the feedforward neural network output to the input and normalize it:

[0121] y i =LayerNorm(z i +FFn(z i )).

[0122] The meta-learning algorithm ensemble includes the use of Model-Agnostic Meta-Learning (MAML) as a training algorithm. MAML training:

[0123] Among them, θ is the initial parameter, α and β are learning rates, and is the loss function on different tasks.

[0124] The specific process of step one is:

[0125] (1) Initialize model parameters θ: mainly including all weights and biases in the Transformer network;

[0126] (2) Setting the learning rate: α is used for intra-task gradient updates, and β is used for global updates across tasks;

[0127] (3) Loading and preprocessing data: The data is grouped into different tasks, each task corresponding to a specific operating condition or control objective;

[0128] (4) Meta-learning cycle training: In each meta-training cycle, the model parameters are updated using the training data;

[0129] (5) Perform performance evaluation on the final model.

[0130] The state space model of the Transformer in step 2 includes using the Transformer encoder to capture the dynamic changes of the state;

[0131] Let x t is the state vector at time t, then the state equation can be expressed as:

[0132] x t+1 =f(x t ,u t )

[0133] Where: x t is the state vector at time t, u t is the input vector at time t, and f is the state transfer function, which is implemented by the Transformer encoder:

[0134] x t+1 = TransformerEncoder(x t ,u t ).

[0135] The observation equation can be expressed as:

[0136] y t =g(x t )

[0137] Where: y t is the observed value at time t, and g is the mapping function from state to observed value, which is usually a linear or nonlinear function. In the Transformer-based model, the mapping function g can be implemented using a simple feedforward neural network, namely:

[0138] yt = TransformerDecoder(x t ).

[0139] The specific process in step 2 is:

[0140] (1) First, initialize the state vector x 0 and Transformer model parameters;

[0141] (2) Then update the state using the Transformer encoder:

[0142] x t+1 = TransformerEncoder(x t ,u t );

[0143] (3) Finally, observation generation, using the decoder network to generate observation values:

[0144] y t = TransformerDecoder(x t ).

[0145] The state prediction in step 3 is expressed as:

[0146] Set as the current system state, the output of the model is the predicted state at the next moment, which can be expressed as:

[0147]

[0148] where u t is the current control input.

[0149] The predicted output is expressed as:

[0150]

[0151] The MPC optimization control input is expressed as solving and optimizing the integrated MPC problem. The specific optimization can be expressed as:

[0152] Objective function:

[0153]

[0154] Where N is the prediction step size, Q and R are weight matrices used to balance the state error and control cost.

[0155] optimization:

[0156]

[0157] Find u for the control inputt Partial derivative:

[0158]

[0159] Combine the two gradients above:

[0160]

[0161] because:

[0162] x t+1 =f(x t ,u t )

[0163]

[0164] so:

[0165]

[0166] Let it be equal to 0:

[0167]

[0168] To solve the above equation, we can convert it into matrix form:

[0169] For each k, we have:

[0170]

[0171] so:

[0172]

[0173] This means:

[0174]

[0175] Right now:

[0176]

[0177] R is a diagonal matrix, let R = rI, then:

[0178]

[0179] so:

[0180]

[0181] Specifically, for each k:

[0182]

[0183] Therefore, what needs to be solved is to find the optimal control sequence under constraints, such as state constraints and control input constraints: t:t+N-1 .

[0184] Although traditional MPC has proven its effectiveness in many fields, it still faces many challenges when dealing with highly nonlinear systems, dynamically changing environments, and real-time data streams. In particular, when the system encounters new situations that have never been seen or changes in operating conditions, the adaptability and robustness of traditional MPC are often insufficient. In order to overcome these shortcomings, the present invention proposes a Transformer-based model predictive control method, which improves the adaptability, robustness, and real-time performance of MPC in nonlinear systems, dynamically changing environments, and real-time data streams by combining meta-learning and deep learning techniques.

[0185] The present invention is based on the complex dependencies of Transformer learning data, and improves the ability of the control system to process time series data with complex dependencies and dynamic changes. The Transformer encoder is used to capture the dynamic changes of state information in the state space model, which improves the prediction accuracy; meta-learning is used to quickly adjust the model to respond to changes in environmental dynamics in a timely manner. The MAML training algorithm is used, which can quickly adapt to new tasks through a small amount of gradient updates, significantly reducing the computing requirements and improving computing efficiency; the meta-learning model based on Transformer predicts future outputs, optimizes MPC, and improves the robustness of the control system. The introduction of an online learning mechanism enables the system to continuously learn and quickly adapt to new operating conditions, further improving the flexibility of the system.

[0186] The electrical components appearing in the text are all electrically connected to the controller and the power supply. The control method of the present invention is controlled by the controller. The control circuit of the controller can be implemented by simple programming by technicians in this field. The provision of power supply is also common knowledge in this field. The present invention is mainly used to protect mechanical devices, so the present invention will no longer explain the control method and circuit connection in detail.

[0187] It should be noted that, for the above-mentioned embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described order of actions, because according to the present invention, some steps may be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.

[0188] In the several embodiments provided in the present application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are merely schematic, such as the division of the above-mentioned units. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or units can be in the form of telecommunication or other forms.

[0189] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0190] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the scope of protection of the invention. Obviously, the described embodiments are only some embodiments of the present invention, rather than all embodiments. Based on these embodiments, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in this field can still combine, add, delete or make other adjustments to the features in the various embodiments of the present invention according to the circumstances without conflict, without making creative work, so as to obtain different other technical solutions that do not deviate from the concept of the present invention in essence, and these technical solutions also belong to the scope of protection of the present invention.

Claims

1. A Transformer-based model predictive control, characterized in that: The following steps are involved: Step 1: Train the meta-learning model to obtain the updated model parameters θ after meta-training, and use an independent test data set for evaluation. The meta-learning model is constructed based on Transformer, which includes Transformer model construction and meta-learning algorithm integration. Step 2: Based on the state space model of Transformer, the encoder of Transformer is used to capture the dynamic changes of the state, dynamically update the state vector, and the decoder network of Transformer is used to generate observation values. The state space model of the system is formed based on the combination of state equation and observation equation, including state equation and observation equation; Step 3: Integrate the model predictive control of the Transformer meta-learning model, use MPC to solve the optimization problem, find the optimal control sequence, and bring the optimized control input into the system for iterative calculation, which includes stateful prediction, prediction output, and MPC optimized control input.

2. The Transformer-based model predictive control according to claim 1, characterized in that: The state space model based on Transformer in step 2 includes the following components: input embedding layer, multi-head self-attention layer, position encoding, feedforward neural network layer and output layer, as follows: Input embedding: Each input sequence x t The input sequence is converted to a high-dimensional feature representation through an embedding layer, where the input sequence contains the control variables (CV) of the past Nc steps, represented as X = [X t-Nc+1 , X t-Nc+2 , ..., X t ].

3. The Transformer-based model predictive control according to claim 2, characterized in that: The position encoding: position encoding is added to capture the timing information in the time series. A common method is to use a combination of sine and cosine functions: Where pos is the position in the sequence, i is the dimension index, and d model is the dimension of the model. The input data is added to the positional encoding to form the input of the encoder: X encoded =X+PE Encoder layer: Linearly transform the encoder input data to obtain the Q, K, V matrices: Calculate the attention score: Calculate the dot product of the query and the key, and get the attention weight through the softmax function: Where Q, K, V are query, key, and value, which are linear transformations of the input. are learnable parameters.

4. A Transmer-based model predictive control as claimed in claim 3, characterized in that: The method of calculating the attention output of multiple heads is to concatenate them and obtain the final output through linear transformation: MultiHead(Q,K,V)=Concat(head1,...,head h )W O Add the multi-head attention output to the input and normalize it: z i =LayerNorm(X encoded +MultiHead(Q,K,V)) The normalized output is subjected to feedforward neural network calculation to further extract features: <h2 style=";text-align:left;direction:ltr">FFN(z<h2 style=";text-align:left;direction:ltr"> i <h2 style=";text-align:left;direction:ltr"> )=ReLU(z<h2 style=";text-align:left;direction:ltr"> i <h2 style=";text-align:left;direction:ltr"> W1+b1)W2+b2 Add the feedforward neural network output to the input and normalize it: <h2 style=";text-align:left;direction:ltr">y<h2 style=";text-align:left;direction:ltr"> i <h2 style=";text-align:left;direction:ltr"> =LayerNorm(z<h2 style=";text-align:left;direction:ltr"> i <h2 style=";text-align:left;direction:ltr"> +FFN(z<h2 style=";text-align:left;direction:ltr"> i <h2 style=";text-align:left;direction:ltr"> ))。 5. The Transmer-based model predictive control according to claim 1, characterized in that: The meta-learning algorithm ensemble includes using model-agnostic meta-learning (MAML) as a training algorithm, wherein the MAML training: Among them, θ is the initial parameter, α and β are learning rates, and is the loss function on different tasks.

6. The Transmer-based model predictive control according to claim 2, characterized in that: The specific process of step one is as follows: (1) Initialize model parameters θ: mainly including all weights and biases in the Transformer network; (2) Setting the learning rate: α is used for intra-task gradient updates, and β is used for global updates across tasks; (3) Loading and preprocessing data: The data is grouped into different tasks, each task corresponding to a specific operating condition or control objective; (4) Meta-learning cycle training: In each meta-training cycle, the model parameters are updated using the training data; (5) Perform performance evaluation on the final model.

7. The Transmer-based model predictive control according to claim 1, characterized in that: The state space model of the Transformer in step 2 includes using a Transformer encoder to capture dynamic changes in state; Let x t is the state vector at time t, then the state equation can be expressed as: x t+1 =f(x t ,u t ) Where: x t is the state vector at time t, u t is the input vector at time t, f is the state transfer function, which is implemented by the Transformer encoder: x t+1 =TransformerEncoder(x t ,u t )。 8. The Transmer-based model predictive control according to claim 7, characterized in that: The observation equation can be expressed as: y t =g(x t ) Where: yt is the observed value at time t, g is the mapping function from state to observed value, usually a linear or nonlinear function. In the Transformer-based model, the mapping function g can be implemented using a simple feedforward neural network, namely: y t =TransformerDecoder(x t )。 9. The Transmer-based model predictive control according to claim 8, characterized in that: The specific process in step 2 is as follows: (1) First, initialize the state vector x0 and Transformer model parameters; (2) Then update the state using the Transformer encoder: x t+1 =TransformerEncoder(x t ,u t ); (3) Finally, observation generation, using the decoder network to generate observation values: y t =TransformerDecoder(x t )。 10. The Transmer-based model predictive control according to claim 1, characterized in that: The state prediction in step 3 is expressed as: Let x t is the system state at the current moment, and the output of the model is the predicted state at the next moment, which can be expressed as: where u t is the current control input. The prediction output is expressed as: The MPC optimization control input is expressed as solving and optimizing the integrated MPC problem. The specific optimization can be expressed as: Objective function: Where N is the prediction step size, Q and R are weight matrices used to balance the state error and control cost. optimization: Find u for the control input t Partial derivative: Combine the two gradients above: because: x t+1 =f(x t ,u t ) so: Let it be equal to 0: To solve the above equation, we can convert it into matrix form: For each k, we have: so: This means: Right now: R is a diagonal matrix, let R = rI, then: so: Specifically, for each k: Therefore, what needs to be solved is to find the optimal control sequence under constraints, such as state constraints and control input constraints: t:t+N-1 .