Real-time prediction method for transient particulate matter emissions from diesel engines based on attention mechanism

By introducing an attention mechanism into the diesel engine particulate matter emission prediction model, the diesel engine speed and torque data is processed, the problem of insufficient prediction accuracy under transient operating conditions is solved, real-time and accurate particulate matter emission prediction is achieved, and the development of the model prediction controller is supported.

CN118888031BActive Publication Date: 2025-04-25SHANGHAI JIAOTONG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410868131.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-01
Publication Date
2025-04-25
Estimated Expiration
2044-07-01

AI Technical Summary

Technical Problem

The existing diesel engine particulate matter emission prediction model is difficult to achieve real-time accurate prediction under transient operating conditions, and cannot meet the needs of model prediction controllers.

Method used

Using a prediction method based on attention mechanism, a multi-layer attention value calculation model is established by normalizing and positionally encoding the speed and torque data of the diesel engine for 5 consecutive seconds, a multi-layer attention value calculation model is established to predict the transient particulate emission value at the next moment, and the prediction accuracy is improved through training and adjustment of matrix and fully connected layer parameters.

Benefits of technology

Real-time accurate prediction of particulate matter emissions under transient conditions of diesel engines is achieved, and the requirements of model prediction controllers are met, providing a foundation for the development of performance and emission optimization controllers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118888031B_ABST
    Figure CN118888031B_ABST
Patent Text Reader

Abstract

A method for real-time prediction of transient particulate emissions of diesel engines based on an attention mechanism in the field of internal combustion engine technology, comprising the following steps: processing the speed and torque operating data of a diesel engine running continuously for 5 seconds according to a normalization formula and using them as input to a prediction model; position encoding the prediction model input according to a position encoding formula to obtain a speed and torque position input vector with time series characteristics; establishing a weight matrix under each attention head for the position input vector, and obtaining an attention value according to an attention calculation formula; calculating and obtaining multi-layer attention values; processing the multi-layer attention values ​​according to a full connection layer calculation formula and an anti-normalization formula to predict the transient particulate emission value at the next moment; and training and adjusting the matrix and full connection layer parameters. The present invention solves the problems of poor prediction accuracy and long calculation time of particulate emission under transient conditions of diesel engines, and can provide support for model-based optimization control and the development of virtual sensors.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to an emission prediction method in the technical field of internal combustion engines, and in particular to a real-time prediction method for transient particulate matter emissions of diesel engines based on an attention mechanism, which can achieve rapid and accurate prediction of transient particulate matter emissions. Background Art

[0002] Based on human exploration and knowledge so far, fossil fuels or bio-derived fuels are the only reliable energy sources. Diesel engines are widely used in various industrial fields, but the emissions of nitrogen oxides and particulate matter produced by combustion have a great impact on climate and public health. In order to reduce diesel engine emissions and achieve precise emission control, model predictive control has shown strong advantages in constraint processing to optimize engine emissions and fuel economy, and can achieve coordinated optimization of emissions and fuel consumption, and is considered to be an effective diesel engine control method.

[0003] The key to model predictive control is to establish a fast and accurate prediction model. However, the formation mechanism of diesel engine particulate matter emissions is complex, involving complex chemical and physical processes. At the same time, the transient cycle process is accompanied by complex changes in oil-gas mixing and boundary conditions. Existing empirical models, semi-empirical models, theoretical mechanism models, and neural network prediction models are difficult to simultaneously achieve real-time and accurate prediction of particulate matter emissions under transient conditions of internal combustion engines, and cannot provide a basis for the development of particulate matter model predictive controllers. Summary of the invention

[0004] In view of the shortcomings of the above-mentioned technologies, the present invention proposes a real-time prediction method for transient particulate matter emissions of diesel engines based on an attention mechanism, which captures the relationship between speed and torque at different times under the transient operating conditions of the diesel engine, and realizes rapid and accurate prediction of transient particulate matter emissions of the diesel engine.

[0005] To solve the above technical problems, the present invention includes the following steps: Step 1, processing the speed and torque operating data of the diesel engine for 5 consecutive seconds according to the normalization formula, and using it as the input of the prediction model; Step 2, position encoding the prediction model input according to the position encoding formula, and obtaining the speed and torque position input vector with time series characteristics; Step 3, for the position input vector, respectively establishing the weight matrix of each attention head, and obtaining the attention value according to the attention calculation formula; Step 4, calculating and obtaining the multi-layer attention value; Step 5, processing the multi-layer attention value according to the full connection layer calculation formula and the denormalization formula, and predicting the transient particulate matter emission value at the next moment; Step 6, training and adjusting the matrix and full connection layer parameters.

[0006] Furthermore, in the present invention, the normalized calculation formula is:

[0007]

[0008] Where: nor 转速 is the normalized speed; x 转速 is the diesel engine speed signal, the unit is r / (min); x 转速,min is the minimum speed of the diesel engine, in r / (min); x 转速,max is the maximum speed of the diesel engine, in r / (min); nor 扭矩 is the normalized torque; x 扭矩 is the diesel engine torque signal, in N·m; x 扭矩,min is the minimum torque of the diesel engine, in N·m; x 扭矩,max It is the maximum torque of diesel engine, in N·m.

[0009] Furthermore, in the present invention, the calculation formula of the position code is:

[0010] PE K,转速 = sin(K)+nor K,转速

[0011]

[0012] Where: K = 1, 2, ..., 5, is the time when the model inputs data, the unit is t; PE K,转速 is the speed vector after position encoding at time K; PE K,扭矩 is the torque vector after position encoding at time K; nor K,转速 is the normalized speed at time K; nor K,扭矩 is the normalized torque at time K.

[0013] Furthermore, in the present invention, the attention calculation formula is:

[0014]

[0015] Where: Q is the query matrix, the matrix dimension is (5, 64); PE is the speed and torque matrix after position encoding, the matrix dimension is (5, 2); W Q is the weight matrix of the query matrix, with a dimension of (2, 64); K is the key value matrix, with a matrix dimension of (5, 64); W K is the weight matrix of the key-value matrix, with a dimension of (2, 64); V is the value matrix, with a matrix dimension of (5, 64); W V is the weight matrix of the value matrix, with a dimension of (2, 64); Z is the attention matrix, with a matrix dimension of (5, 64); softmax normalizes each row of the matrix, that is, the sum of the elements in each row of the matrix is ​​1.

[0016] Furthermore, in the present invention, the calculation formula of the multi-layer attention value is:

[0017] Z mul =[Z 1 Z 2 ]×Z W

[0018] Where: Z mul is the multi-layer attention value, with a dimension of (5, 2); [] represents the horizontal concatenation operation; Z 1 is the first layer attention value, dimension is (5, 64); Z 2 is the second layer attention value, with a dimension of (5, 64); Z W is the weight matrix with dimension (128, 2).

[0019] Furthermore, in the present invention, the calculation formula of the fully connected layer is:

[0020]

[0021] Where: Y nor is the normalized predicted value of particulate matter emission; W 1 is the weight matrix, dimension is (1, 5); W 2 is the weight matrix, dimension is (2, 1); Z mul is the multi-layer attention value, with dimension (5, 2); B 1 is the bias value; B 2 is the bias value;

[0022] Furthermore, in the present invention, the denormalization calculation formula is:

[0023] Y=Y nor (y max -y min )+y min

[0024] Where: Y is the predicted value of particulate matter emission, in g / h; Y nor is the normalized predicted value of particulate matter emission, y max is the maximum value of particulate matter emission, in g / h; y min It is the minimum value of particulate matter emission, in g / h.

[0025] Furthermore, in the present invention, the training and adjustment of the matrix and fully connected layer parameters include the following steps: first, obtaining the data of speed, torque, and particulate matter emission under different transient cycles; then, sequentially inputting the speed and torque signals at 5 consecutive moments, the prediction model predicts the particulate matter emission value at the next moment and compares it with the actual value of particulate matter emission; finally, reversely adjusting W according to the error between the two Q , WK , W V , W 1 , W 2 , B 1 , B 2 and Z matrix to improve the model prediction accuracy until convergence.

[0026] Compared with the prior art, the beneficial effects of the present invention are as follows: the present invention captures the internal correlation between diesel engine speed, torque and transient particulate matter emissions at different times based on the attention mechanism, establishes a prediction model for particulate matter emissions under transient conditions, and realizes real-time and accurate prediction of transient particulate matter emissions. This method can meet the requirements of the model predictive controller for real-time and accurate prediction of the model, and can provide a basis for the development of performance and emission optimization controllers. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 is a flow chart of the prediction method of the present invention;

[0028] Figure 2 This is a diagram showing the prediction effect of transient particulate matter emissions in a specific implementation case of the present invention. DETAILED DESCRIPTION

[0029] In order to make the content of the present invention easier to understand, the technical scheme of the present invention is further explained below in conjunction with specific embodiments. The examples are only used to illustrate the present invention, but the present invention is not limited to this content. The operating methods without specifying specific conditions in the following examples are usually carried out under conventional conditions or according to the product instructions.

[0030] Example

[0031] Specific implementation examples include Figure 1 First, the speed and torque operation data of the diesel engine running continuously for 5 seconds are processed according to the normalized formula and used as the input of the prediction model;

[0032] The normalized calculation formula is:

[0033]

[0034] Where: nor 转速 is the normalized speed; x 转速 is the diesel engine speed signal, the unit is r / (min); x 转速,min is the minimum speed of the diesel engine, in r / (min); x 转速,max is the maximum speed of the diesel engine, in r / (min); nor 扭矩 is the normalized torque; x 扭矩 is the diesel engine torque signal, in N·m; x 扭矩,minis the minimum torque of the diesel engine, in N·m; x 扭矩,max It is the maximum torque of diesel engine, in N·m.

[0035] Then, the prediction model input is position-encoded according to the position encoding formula to obtain the speed and torque position input vector with time series characteristics;

[0036] The calculation formula of position coding is:

[0037] PE K,转速 = sin(K)+nor K,转速

[0038]

[0039] Where: K = 1, 2, ..., 5, is the time when the model inputs data, the unit is t; PE K,转速 is the speed vector after position encoding at time K; PE K,扭矩 is the torque vector after position encoding at time K; nor K,转速 is the normalized speed at time K; nor K,扭矩 is the normalized torque at time K.

[0040] Then, for the position input vector, the weight matrix under each attention head is established, and the attention value is obtained according to the attention calculation formula;

[0041] Among them, the attention calculation formula is:

[0042]

[0043] Where: Q is the query matrix, the matrix dimension is (5, 64); PE is the speed and torque matrix after position encoding, the matrix dimension is (5, 2); W Q is the weight matrix of the query matrix, with a dimension of (2, 64); K is the key value matrix, with a matrix dimension of (5, 64); W K is the weight matrix of the key-value matrix, with a dimension of (2, 64); V is the value matrix, with a matrix dimension of (5, 64); W V is the weight matrix of the value matrix, with a dimension of (2, 64); Z is the attention matrix, with a matrix dimension of (5, 64); softmax normalizes each row of the matrix, that is, the sum of the elements in each row of the matrix is ​​1.

[0044] Then, the multi-layer attention value is calculated by the following formula.

[0045] Z mul =[Z 1 Z 2 ]×Z W

[0046] Where: Z mul is the multi-layer attention value, with a dimension of (5, 2); [] represents the horizontal concatenation operation; Z 1 is the first layer attention value, dimension is (5, 64); Z 2 is the second layer attention value, with a dimension of (5, 64); Z W is the weight matrix with dimension (128, 2).

[0047] Then, the multi-layer attention values ​​are processed according to the fully connected layer calculation formula and the denormalization formula to predict the transient particulate matter emission value at the next moment;

[0048] Among them, the calculation formula of the fully connected layer is:

[0049]

[0050] Where: Y nor is the normalized predicted value of particulate matter emission; W 1 is the weight matrix, dimension is (1, 5); W 2 is the weight matrix, dimension is (2, 1); Z mul is the multi-layer attention value, with dimension (5, 2); B 1 is the bias value; B 2 is the bias value;

[0051] The anti-normalization calculation formula is:

[0052] Y=Y nor (y max -y min )+y min

[0053] Where: Y is the predicted value of particulate matter emission, in g / h; Y nor is the normalized predicted value of particulate matter emission, y max is the maximum value of particulate matter emission, in g / h; y min It is the minimum value of particulate matter emission, in g / h.

[0054] Finally, the matrix and fully connected layer parameters are trained and adjusted. First, the speed, torque, and particulate matter emission data under different transient cycles are obtained; then, the speed and torque signals at 5 consecutive moments are input in sequence, and the prediction model predicts the particulate matter emission value at the next moment and compares it with the actual value of the particulate matter emission; finally, W is adjusted inversely according to the error between the two. Q , W K , W V , W 1 , W 2 , B 1 , B2 The Z matrix is ​​used to improve the prediction accuracy of the model until convergence. At this time, by inputting the diesel engine speed and torque signals at five consecutive moments, the particle emission value at the next moment can be accurately predicted in real time.

[0055] Taking the specific test results of a diesel engine as an example, after testing according to the EU transient cycle standard, the world unified transient driving cycle standard, and the load response cycle, a total of 5779 sets of test data were obtained, of which 4000 sets of data of the EU transient cycle standard and the load response cycle were used to train the diesel engine particulate matter transient emission prediction model based on the attention mechanism, and 1779 sets of data of the world unified transient driving cycle standard were used to verify the model prediction effect. After applying the prediction method of the present invention, Figure 2 It can be seen that under the world unified transient driving cycle standard, the real-time prediction method of diesel engine particulate matter transient emissions based on the attention mechanism can achieve accurate prediction of particulate matter emissions under transient conditions. In addition, when the operating system is Windows 10 and the CPU is Intel Core i7-7700HQ@2.8GHz, the time counter in python is used to calculate the running time of different types of models. The results show that the average calculation time of the diesel engine particulate matter transient emission prediction model based on the attention mechanism is 2ms, which is much less than the actual cycle working time of the engine, and the calculation accuracy is 91%, achieving real-time and accurate prediction of transient particulate matter emissions.

[0056] The above describes the specific embodiments of the present invention. It should be understood that the present invention is not limited to the above specific embodiments, and those skilled in the art can make various changes or modifications within the scope of the claims, which does not affect the essence of the present invention. In the absence of conflict, the embodiments of the present application and the features in the embodiments can be combined with each other arbitrarily.

Claims

1. A real-time prediction method for transient particulate matter emissions from diesel engines based on attention mechanism, characterized in that: The following steps are involved: Step 1: Process the speed and torque operation data of the diesel engine running continuously for 5 seconds according to the normalization formula and use it as the input of the prediction model; Step 2: Position-encode the prediction model input according to the position encoding formula to obtain the speed and torque position input vector with time series characteristics; Step 3: For the position input vector, establish the weight matrix under each attention head respectively, and obtain the attention value according to the attention calculation formula; Step 4: Calculate and obtain multi-layer attention values; Step 5: Process the multi-layer attention values ​​according to the fully connected layer calculation formula and the denormalization formula to predict the transient particulate matter emission value at the next moment; Step 6: Train and adjust the matrix and fully connected layer parameters; Wherein, in step 1, the normalized calculation formula is: Where: nor 转速 is the normalized speed; x 转速 is the diesel engine speed signal, the unit is r / (min); x 转速,min is the minimum speed of the diesel engine, in r / (min); x 转速,max is the maximum speed of the diesel engine, in r / (min); nor 扭矩 is the normalized torque; x 扭矩 is the diesel engine torque signal, in N·m; x 扭矩,min is the minimum torque of the diesel engine, in N·m; x 扭矩,max is the maximum torque of the diesel engine, in N·m; In step 2, the calculation formula of the position code is: ON K,转速 =sin(K)+cloud K,转速 Where: K = 1, 2, ..., 5, is the time when the model inputs data, the unit is t; PE K,转速 is the speed vector after position encoding at time K; PE K,扭矩 is the torque vector after position encoding at time K; nor K,转速 is the normalized speed at time K; nor K,扭矩 is the normalized torque at time K; In step three, the attention calculation formula is: Where: Q is the query matrix, the matrix dimension is (5, 64); PE is the speed and torque matrix after position encoding, the matrix dimension is (5, 2); W Q is the weight matrix of the query matrix, with a dimension of (2, 64); K is the key value matrix, with a matrix dimension of (5, 64); W K is the weight matrix of the key-value matrix, with a dimension of (2, 64); V is the value matrix, with a matrix dimension of (5, 64); W V is the weight matrix of the value matrix, with a dimension of (2, 64); Z is the attention matrix, with a matrix dimension of (5, 64); softmax normalizes each row of the matrix, that is, the sum of the elements in each row of the matrix is ​​1; In step 5, the calculation formula of the fully connected layer is: Where: Y nor is the normalized prediction value of particulate matter emission; W1 is the weight matrix with dimension (1, 5); W2 is the weight matrix with dimension (2, 1); Z mul is the multi-layer attention value, with a dimension of (5, 2); B1 is the bias value; B2 is the bias value; In step 5, the denormalization calculation formula is: Y=Y nor (and max -and min )+y min Where: Y is the predicted value of particulate matter emission, in g / h; Y nor is the normalized predicted value of particulate matter emission, y max is the maximum value of particulate matter emission, in g / h; y min It is the minimum value of particulate matter emission, in g / h.

2. The real-time prediction method for transient emission of diesel engine particulate matter based on attention mechanism according to claim 1 is characterized in that In step 4, the calculation formula of the multi-layer attention value is: WITH mul =[Z1 Z2]×Z W Where: Z mul is the multi-layer attention value, with a dimension of (5, 2); [] represents the horizontal concatenation operation; Z1 is the first layer attention value, with a dimension of (5, 64); Z2 is the second layer attention value, with a dimension of (5, 64); Z W is the weight matrix with dimension (128, 2).

3. The real-time prediction method for transient emission of diesel engine particulate matter based on attention mechanism according to claim 1 is characterized in that In step six, the training and adjustment of the matrix and fully connected layer parameters include the following steps: first, obtaining the data of speed, torque, and particulate matter emission under different transient cycles; then, inputting the speed and torque signals at 5 consecutive moments in sequence, and the prediction model predicts the particulate matter emission value at the next moment and compares it with the actual value of particulate matter emission; finally, adjusting W inversely according to the error between the two Q , W K , W V , W1, W2, B1, B2 and Z matrices to improve the prediction accuracy of the model until convergence.

Citation Information

Patent Citations

  • Road motor vehicle exhaust emission prediction method based on improved attention bidirectional long-short-term memory network

    CN111612254A

  • Method for predicting exhaust emission condition based on multi-path parallel model when ASM working condition method is used

    CN116739171A