Example 4 If $3 x-y-1=0$, find
$$
z=\left|\sqrt{x^{2}+y^{2}-8 x-2 y+17}-\sqrt{x^{2}+y^{2}-8 y+16}\right|
$$

the maximum value.
Solution: The symmetric point of point $B$ with respect to the line $3 x-y-1=0$ is $B_{1}(3,3)$. Then, by the knowledge of plane geometry, we have
$$
z_{\text {max }}\left|A B_{1}\right|=\sqrt{5} .
$$