  The recently experimentally synthesized monolayer $\mathrm{MoSi_2N_4}$ and
$\mathrm{WSi_2N_4}$ (\textcolor[rgb]{0.00,0.00,1.00}{Science 369, 670-674
(2020})) lack inversion symmetry, which allows them to become piezoelectric. In
this work, based on ab initio calculations, we report structure effect on
intrinsic piezoelectricity in septuple-atomic-layer $\mathrm{MSi_2N_4}$ (M=Mo
and W), and six structures ($\alpha_i$ ($i$=1 to 6)) are considered with the
same space group.It is found that $\mathrm{MSi_2N_4}$ (M=Mo and W) with
$\alpha_i$ ($i$=1 to 6) all are indirect band gap semiconductors. Calculated
results show that $\mathrm{MoSi_2N_4}$ and $\mathrm{WSi_2N_4}$ monolayers have
the same structural dependence on piezoelectric strain and stress coefficients
($d_{11}$ and $e_{11}$), together with the ionic and electronic contributions
to $e_{11}$.Finally, we investigate the intrinsic piezoelectricity of monolayer
$\mathrm{MA_2Z_4}$ (M=Cr, Mo and W; A=Si and Ge; Z=N and P) with $\alpha_1$ and
$\alpha_2$ phases expect $\mathrm{CrGe_2N_4}$, because they all are
semiconductors and their enthalpies of formation between $\alpha_1$ and
$\alpha_2$ phases are very close. The most important result is that monolayer
$\mathrm{MA_2Z_4}$ containing P atom have more stronger piezoelectric
polarization than one including N atom. The largest $d_{11}$ among
$\mathrm{MA_2N_4}$ materials is 1.85 pm/V, which is close to the smallest
$d_{11}$ of 1.65 pm/V in $\mathrm{MA_2P_4}$ monolayers. For $\mathrm{MA_2P_4}$,
the largest $d_{11}$ is up to 6.12 pm/V. Among the 22 monolayers,
$\alpha_1$-$\mathrm{CrSi_2P_4}$, $\alpha_1$-$\mathrm{MoSi_2P_4}$,
$\alpha_1$-$\mathrm{CrGe_2P_4}$, $\alpha_1$-$\mathrm{MoGe_2P_4}$ and
$\alpha_2$-$\mathrm{CrGe_2P_4}$ have large $d_{11}$, which are greater than or
close to 5 pm/V, a typical value for bulk piezoelectric materials.
