Example 6 Given positive integers $a, b$ satisfy that $a-b$ is a prime number, and $ab$ is a perfect square. When $a \geqslant 2012$, find the minimum value of $a$.

保留源文本的换行和格式，直接输出翻译结果。
Given the problem, let's set
$a-b=p(p$ is a prime number $), ab=k^{2}\left(k \in \mathbf{N}_{+}\right)$.
Then $a(a-p)=k^{2} \Rightarrow a^{2}-k^{2}=ap$
$$
\Rightarrow(a+k)(a-k)=ap \text {. }
$$

Since $a+k, a, p$ are all positive integers, we have
$$
a-k>0 \text {. }
$$

Given that $p$ is a prime number, from equation (1) we know $p \mid(a+k)$ or $p \mid(a-k)$.
Clearly, $a-k \Rightarrow p \nmid(a-k) \Rightarrow p \mid(a+k)$. Let $a+k=np\left(n \in \mathbf{N}_{+}\right)$.
From $a-kp \Rightarrow n \geqslant 2 \Rightarrow k=np-a \text {. }$
$$

Substituting into equation (1) we get
$$
\begin{array}{l}
n(2a-np)=a \\
\Rightarrow a(2n-1)=n^{2}p .
\end{array}
$$

It is easy to prove that $n^{2}$ and $2n-1$ are coprime.
Thus, $n^{2} \mid a$. Let $a=mn^{2}\left(m \in \mathbf{N}_{+}\right)$.
From equation (2) we get $m(2n-1)=p$.
Since $p$ is a prime number, either $m$ or $2n-1$ must be 1.
Also, $2n-1 \geqslant 2 \times 2-1>1$, so $m=1$.
Therefore, $a=n^{2}, p=2n-1$.
Hence, $a$ meets the condition $\Leftrightarrow a=n^{2}$ and $2n-1$ is a prime number.
Given $a \geqslant 2012$, then $a \geqslant 45^{2}$.
Also, $2 \times 45-1=89$ is a prime number, thus,
$$
a_{\min }=2025
$$