To improve the machining accuracy of machine tools, a correlation analysis-based thermal error control is realized on the basis of the improved tunicate swarm algorithm-gated recurrent unit-attention (ITSA-GRU-A) model and cloud-edge-physical collaboration framework. The memorizing, non-stationary, and nonlinear behaviors of thermal errors are mathematically and numerically revealed by using the power series solution of the one-dimensional heat transfer equation and the finite element method of the three-dimensional spindle system. To adequately reduce the collinearities among temperatures, the variance inflation factor (VIF) is applied to conduct the grouping and clustering of input temperature variables for the first time. Then the final input is determined by the kernel-based R-vector (KBRV) coefficient and complex correlation coefficient (CCC). Finally, the ITSA-GRU-A model is proposed, and the attention mechanism is introduced to improve the predictive ability. The input variables are selected by the VIF, KBRV, and CCC. The ITSA is proposed to optimize the hyper-parameters of the GRU-A model, and the adaptive weights are introduced into the ITSA to reduce the computation time. The proposed ITSA-GRU-A model has a more powerful predictive performance, generalization ability, and convergence than the GRU, GRU-A, and tunicate swarm algorithm (TSA)-GRU models. Finally, a cloud-edge-physical collaboration framework is proposed. The above algorithms are embedded into the cloud-edge-physical collaboration framework, and then the error control is realized by the collaboration framework and ITSA-GRU-A model. With the implementation of the error control system, the execution time and machining error is reduced significantly.