31. Given the set $A=\left\{x \left\lvert\, \frac{x-2 a}{x-\left(a^{2}+1\right)}<0\right.\right\}, B=\{x \mid x$ $<5 a+7\}$, if $A \cup B=B$, then the range of real number $a$ is $\qquad$ .
31. $[-1,6]$;