The invention provides a carbon emission prediction method and
system based on LSTM and self-attention, and a prediction model training method comprises the steps: obtaining a training sample set, inputting training samples into an initial carbon emission prediction model which comprises a long-
short term memory layer, a self-attention layer and a
linear layer. And extracting and outputting effective key information corresponding to each
influence factor by using the long-
short term memory layer, inputting the effective key information corresponding to each
influence factor into the self-attention layer, and outputting association information between each
influence factor and other influence factors except for the influence factor. And integrating the associated information corresponding to each influence factor, inputting the integrated information into a
linear layer, and outputting a carbon emission prediction result. And constructing a
loss function based on the difference between the prediction result and the real
label, minimizing the loss to update the
model parameters until a preset training round number is reached, and obtaining a trained carbon emission prediction model. According to the method,
multiple factors are comprehensively considered, the long-term dependency relationship of the data sequence is captured, and more accurate carbon emission prediction is realized.