II. (Full marks 25 points) As shown in the figure, in quadrilateral $ABCD$, $AB \parallel CD$, $AD=DC=DB=p$, $BC=q$. Find the length of diagonal $AC$.

---

The translation maintains the original text's format and line breaks.
$$
\text { Given, } \because A D=D C=D B=p \text {, }
$$
$\therefore$ With $D$ as the center and $P$ as the radius, draw a circle, C, $R, A$ all lie on the circle ( p). Extend $C J$ to intersect at $E$, and connect $A E$. It is easy to know that $C D E$ is the diameter of $\odot(D, p)$, $C E=$ $2 p$.
Also, $B A / / C D$, which means $B A / / C E$,
$$
\therefore \overparen{C B}=\overparen{A E} \Rightarrow A E=B C=q \text {. }
$$

Since $\angle C A E$ is the inscribed angle subtended by the diameter,
$$
\therefore \angle C A E=90^{\circ} \text {. }
$$

In the right triangle $\triangle C A E$, by the Pythagorean theorem,
$$
A C^{2}=C E^{2}-A E^{2}=(2 p)^{2}-q^{2} \text {. }
$$

Therefore, $A C=\sqrt{4 p^{2}-q^{2}}$.