Dissolved oxygen is an essential water quality parameter in aquaculture as it affects both the yield and quality of the aquatic organisms. However, traditional prediction models face a challenge in predicting the long-term trend of dissolved oxygen and are easily affected by outliers, leading to lower prediction accuracy. To address this problem, this paper proposes an improved aquaculture dissolved oxygen prediction model based on Autoformer model, which dynamically correlates the moving average step required to separate the feature term with the dissolved oxygen sensor collection frequency to accommodate the effect of timing intervals on feature term extraction arising from data acquisition by sensors with different frequencies, so as to separate more adequate and accurate long-term trend part. Furthermore, we propose a causal autocorrelation mechanism that is more concerned with local up-and-down information to calculate autocorrelation coefficient and reduce the interference of outliers on prediction accuracy. Experimental results show that our proposed model performs better than the Transformer-based dissolved oxygen prediction model in real dissolved oxygen data sets, particularly in terms of long-term prediction accuracy. This reflects the feasibility and effectiveness of our model.