Example 10 Let $2 n$ real numbers $a_{1}, a_{2}, \cdots, a_{2 n}$ satisfy $\sum_{i=1}^{2 n-1}\left(a_{i+1}-a_{i}\right)^{2}=1$, find
$$\left(a_{n+1}+a_{n+2}+\cdots+a_{2 n}\right)-\left(a_{1}+a_{2}+\cdots+a_{n}\right)$$

the maximum value.
When $n=1$, $\left(a_{2}-a_{1}\right)^{2}=1$, then $a_{2}-a_{1}= \pm 1$, the maximum value is 1.
When $n \geqslant 2$, let $x_{1}=a_{1}, x_{i+1}=a_{i+1}-a_{i}, i=1,2, \cdots, 2 n-1$. Then $\sum_{i=2}^{2 n} x_{i}^{2}=$ 1, and $a_{k}=x_{1}+x_{2}+\cdots+x_{k}, k=1,2, \cdots, 2 n$.

By the Cauchy-Schwarz inequality, we get
$$\begin{aligned}
& a_{n+1}+a_{n+2}+\cdots+a_{2 n}-\left(a_{1}+a_{2}+\cdots+a_{n}\right) \\
= & x_{2}+2 x_{3}+\cdots+(n-1) x_{n}+n x_{n+1}+(n-1) x_{n+2}+\cdots+x_{2 n} \\
\leqslant & {\left[1+2^{2}+\cdots+(n-1)^{2}+n^{2}+(n-1)^{2}+\cdots+1\right]^{\frac{1}{2}} } \\
& \cdot\left(x_{2}^{2}+x_{3}^{2}+\cdots+x_{2 n}^{2}\right)^{\frac{1}{2}} \\
= & {\left[n^{2}+2 \cdot \frac{1}{6}(n-1) n(2(n-1)+1)\right]^{\frac{1}{2}}=\sqrt{\frac{n\left(2 n^{2}+1\right)}{3}} . }
\end{aligned}$$

When $a_{k}=\frac{\sqrt{3} k(k-1)}{2 \sqrt{n\left(2 n^{2}+1\right)}}, k=1,2, \cdots, n+1$,
$$a_{n+k}=\frac{\sqrt{3}\left[2 n^{2}-(n-k)(n-k+1)\right]}{2 \sqrt{n\left(2 n^{2}+1\right)}}, k=1,2, \cdots, n-1$$

the equality holds, and the maximum value is $\sqrt{\frac{n\left(2 n^{2}+1\right)}{3}}$.