NO
x emission of Diesel engine is the main harmful emission substance of motor vehicles; accurate measurement of NO
x emission is conducive to the control of urea injection to reduce emissions. However, the existing NO
x sensors and emission MAP obtained by calibration are both difficult to achieve real-time measurement of NO
x under transient conditions. Principal component analysis (PCA) was used to reduce the dimension of diesel engine operating parameters for world harmonized transient cycle (WHTC). A real-time diesel NO
x prediction model was built based on long and short-term memory (LSTM) neural network, and the parameters of LSTM were optimized by grey wolf optimization (GWO) algorithm. The results show that the mean absolute percentage error (MAPE) of GMOLSTM prediction model on the untrained data set is 3.23%, which proves that the model can accurately achieve real-time prediction of NO
x emissions of diesel engines. In addition, the model has good generalization ability and reliability, which provides a reference for the realization of diesel emission control with software instead of hardware.