7. Given $a_{1}, a_{2}, \cdots, a_{10}$ and $b_{1}, b_{2}, \cdots, b_{10}$ are 20 distinct real numbers. If the equation
$$
\begin{array}{l}
\left|x-a_{1}\right|+\left|x-a_{2}\right|+\cdots+\left|x-a_{10}\right| \\
=\left|x-b_{1}\right|+\left|x-b_{2}\right|+\cdots+\left|x-b_{10}\right|
\end{array}
$$

has a finite number of solutions, then this equation has at most $\qquad$ solutions.
7.9.
$$
\text { Let } \begin{aligned}
f(x)= & \left|x-a_{1}\right|+\left|x-a_{2}\right|+\cdots+\left|x-a_{10}\right|- \\
& \left|x-b_{1}\right|-\left|x-b_{2}\right|-\cdots-\left|x-b_{10}\right| .
\end{aligned}
$$

Thus, by the problem statement, $f(x)=0$.
Let $c_{1}<c_{2}<\cdots<c_{20}$ be the elements of the set
$$
\left\{a_{1}, a_{2}, \cdots, a_{10}, b_{1}, b_{2}, \cdots, b_{10}\right\}
$$

arranged in increasing order, and in
$$
\left(-\infty, c_{1}\right],\left[c_{1}, c_{2}\right], \cdots,\left[c_{19}, c_{20}\right],\left[c_{20},+\infty\right)
$$

these 21 intervals, the function $f(x)$ is linear in each.
Notice that, in the interval $\left(-\infty, c_{1}\right]$,
$$
f(x)=a_{1}+a_{2}+\cdots+a_{10}-b_{1}-b_{2}-\cdots-b_{10}=m,
$$

and in the interval $\left[c_{20},+\infty\right)$, $f(x)=-m$.
Since the number of roots of the equation is finite, we have $m \neq 0$.
Moving along the number line from left to right. Initially, the coefficient of $x$ in $f(x)$ is 0. Each time we pass a $c_{i}\left(1 \leqslant i \leqslant 20, i \in \mathbf{Z}_{+}\right)$, the way one of the absolute values is removed changes, causing the coefficient of $x$ to change by $\pm 2$ (increase by 2 or decrease by 2). This indicates that the coefficient of $x$ is always even and does not change sign before it becomes 0. Therefore, the coefficient of $x$ in any two adjacent intervals is either both non-negative or both non-positive. Thus, $f(x)$ is either non-increasing or non-decreasing in such an interval union. As a result, if $f(x)=0$ has only a finite number of roots, then it has at most one root in each of the intervals $\left[c_{1}, c_{3}\right], \cdots,\left[c_{17}, c_{19}\right],\left[c_{19}, c_{20}\right]$. Furthermore, since $f\left(c_{1}\right)$ and $f\left(c_{20}\right)$ have different signs, and $f(x)$ changes sign at each root, the equation $f(x)=0$ has an odd number of roots. Therefore, it has at most nine roots.
On the other hand, it is not difficult to verify that if
$$
\begin{array}{l}
a_{1}=1, a_{2}=4, a_{3}=5, a_{4}=8, a_{5}=9, \\
a_{6}=12, a_{7}=13, a_{8}=16, a_{9}=17, a_{10}=19.5, \\
b_{1}=2, b_{2}=3, b_{3}=6, b_{4}=7, b_{5}=10, \\
b_{6}=11, b_{7}=14, b_{8}=15, b_{9}=18, b_{10}=19,
\end{array}
$$

then the equation $f(x)=0$ has exactly nine roots.