  To understand the formation process of massive stars, we present a
multi-scale and multi-wavelength study of the W31 complex hosting two extended
HII regions (i.e., G10.30-0.15 (hereafter, W31-N) and G10.15-0.34 (hereafter,
W31-S)) powered by a cluster of O-type stars. Several Class I protostars and a
total of 49 ATLASGAL 870 $\mu$m dust clumps (at d = 3.55 kpc) are found toward
the HII regions where some of the clumps are associated with the molecular
outflow activity. These results confirm the existence of a single physical
system hosting the early phases of star formation. The Herschel 250 $\mu$m
continuum map shows the presence of hub-filament system (HFS) toward both W31-N
and W31-S. The central hubs harbour HII regions and they are depicted with
extended structures (with T$_{\text{d}}$ $\sim$ 25-32 K) in the Herschel
temperature map. In the direction of W31-S, an analysis of the NANTEN2
$^{12}$CO(J = 1-0) and SEDIGISM $^{13}$CO(J = 2-1) line data supports the
presence of two cloud components around 8 and 16 km s$^{-1}$, and their
connection in velocity space. A spatial complementary distribution between the
two cloud components is also investigated toward W31-S, where the signposts of
star formation, including massive O-type stars, are concentrated. These
findings favor the applicability of cloud-cloud collision (CCC) around $\sim$2
Myr ago in W31-S. Overall, our observational findings support the theoretical
scenario of CCC in W31, which explains the formation of massive stars and the
existence of HFSs.
