1. 2. 1 * Let $A=\{1,2,3, m\}, B=\left\{4,7, n^{4}, n^{2}+3 n\right\}$, the correspondence rule $f: a \rightarrow$ $b=pa+q$ is a one-to-one mapping from $A$ to $B$. It is known that $m, n$ are positive integers, and the image of 1 is 4, the preimage of 7 is 2. Find the values of $p, q, m, n$.
From the conditions, we have 
\[
\left\{\begin{array}{l}
4=p \cdot 1+q, \\
7=p \cdot 2+q,
\end{array}\right.
\]
solving these equations gives \( p=3, q=1 \). Therefore, \( f(x)=3x+1 \). Given that \( f \) is a one-to-one mapping from \( A \) to \( B \), we have
\[
\left\{\begin{array}{l}
n^{4}=3 \cdot 3+1, \\
n^{2}+3 n=3 m+1
\end{array} \text { or } \left\{\begin{array}{l}
n^{4}=3 m+1, \\
n^{2}+3 n=3 \cdot 3+1,
\end{array}\right.\right.
\]

Using \( m, n \in \mathbf{N}_{+} \), we know it can only be the latter case, solving which gives \( n=2, m=5 \). In summary, \((p, q, m, n)=(3,1,5,2)\)