7. In the Cartesian coordinate system, the ellipse $\Omega: \frac{x^{2}}{4}+y^{2}=1$, $P$ is a moving point on $\Omega$, $A, B$ are two fixed points, where the coordinates of $B$ are $(0,3)$. If the minimum area of $\triangle P A B$ is 1 and the maximum area is 5, then the length of line segment $A B$ is $\qquad$.
Given $A B: y=k x+3, P(2 \cos \theta, \sin \theta)$, construct $P D \perp A B$ at $D$, then $|P D|=\frac{|2 k \cos \theta-\sin \theta+3|}{\sqrt{k^{2}+1}}$ $=\frac{\left|\sqrt{4 k^{2}+1} \sin (\theta+\varphi)+3\right|}{\sqrt{k^{2}+1}}$.
Obviously, the line $A B$ does not intersect the ellipse; otherwise, there would exist points $P, A, B$ that are collinear, making the area of $\triangle P A B$ zero, which is a contradiction.
Thus, $\sqrt{4 k^{2}+1} \sin (\theta+\varphi)+3$ is always positive, leading to $\frac{3+\sqrt{4 k^{2}+1}}{3-\sqrt{4 k^{2}+1}}=5 \Rightarrow \sqrt{4 k^{2}+1}=2$ $\Rightarrow k^{2}=\frac{3}{4}$. When the area of $\triangle P A B$ is minimized, $\frac{1}{2}|A B| \cdot \frac{1}{\sqrt{\frac{3}{4}+1}}=1 \Rightarrow|A B|=\sqrt{7}$.