Let $\mathcal {N}=N_n(R)$ be the algebra of all $n\times n$ strictly upper triangular matrices over a unital commutative ring $R$. A map $\varphi $ on $\mathcal {N}$ is called preserving commutativity in both directions if $xy=yx\Leftrightarrow \varphi (x)\varphi (y)=\varphi (y)\varphi (x)$. In this paper, we prove that each invertible linear map on $\mathcal {N}$ preserving commutativity in both directions is exactly a quasi-automorphism of $\mathcal {N}$, and a quasi-automorphism of $\mathcal {N}$ can be decomposed into the product of several standard maps, which extains the main result of Y. Cao, Z. Chen and C. Huang (2002) from fields to rings.