Example 2 If the inequality about $x$
$$
\frac{x^{2}+\left(2 a^{2}+2\right) x-a^{2}+4 a-7}{x^{2}+\left(a^{2}+4 a-5\right) x-a^{2}+4 a-7}<0
$$

has a solution set that is the union of some intervals, and the sum of the lengths of these intervals is no less than 4, find the range of real numbers $a$.
(2001, Shanghai High School Mathematics Competition)
Notice the relationship between the coefficients of the quadratic terms in $x$ in the numerator and denominator on the left side of the inequality:
$$
\left(a^{2}+4 a-5\right)-\left(2 a^{2}+2\right)=-a^{2}+4 a-7 \text {. }
$$

Consider the equations in $x$:
$$
\begin{array}{l}
x^{2}+\left(2 a^{2}+2\right) x-a^{2}+4 a-7=0, \\
x^{2}+\left(a^{2}+4 a-5\right) x-a^{2}+4 a-7=0
\end{array}
$$

with roots $x_{1}$ and $x_{2}\left(x_{1}<x_{2}\right)$, and $x_{3}$ and $x_{4}\left(x_{3}<x_{4}\right)$, respectively. Notice that:
$$
\begin{array}{l}
x_{1} x_{2}=x_{3} x_{4}=-a^{2}+4 a-7 \\
=-(a-2)^{2}-3<0, \\
\left(x_{1}+x_{2}\right)-\left(x_{3}+x_{4}\right) \\
=\left(a^{2}+4 a-5\right)-\left(2 a^{2}+2\right) \\
=-a^{2}+4 a-7<0,
\end{array}
$$

Therefore, the order of $x_{1}, x_{2}, x_{3}, x_{4}$ is:
$$
x_{1}<x_{3}<x_{2}<x_{4} \text {. }
$$

Thus, the solution set of the original inequality is:
$$
\left(x_{1}, x_{3}\right) \cup\left(x_{2}, x_{4}\right) \text {. }
$$

Given that $\left(x_{3}-x_{1}\right)+\left(x_{4}-x_{2}\right) \geqslant 4$, we have:
$$
a^{2}-4 a+7 \geqslant 4 \text {. }
$$

Solving this, we get $a \leqslant 1$ and $a \geqslant 3$.
Therefore, $a \in(-\infty, 1] \cup[3,+\infty)$.