IoT sensors in oilfields gather real-time data sequences from oil wells. Accurate trend predictions of these data are crucial for production optimization and failure forecasting. However, oil well time series data exhibit strong nonlinearity, requiring not only precise trend prediction but also the estimation of uncertainty intervals. This paper first proposed a data denoising method based on Variational Mode Decomposition (VMD) and Long Short-Term Memory (LSTM) to reduce the noise present in oil well time series data. Subsequently, an SDMI loss function was introduced, combining the respective advantages of Soft Dynamic Time Warping and Mean Squared Error (MSE). The loss function additionally accepts the upper and lower bounds of the uncertainty prediction interval as input and is optimized with the prediction sequence. By predicting the data of the next 48 data points, the prediction results using the SDMI loss function and the existing three common loss functions are compared on multiple data sets. The prediction results before and after data denoising are compared and the results of predicting the uncertainty interval are shown. The experimental results demonstrate that the average coverage rate of the predicted uncertainty intervals across data from seven wells is 81.4%, and the prediction results accurately reflect the trends in real data.