A self-moving device moves and works in a defined working region. The self-moving device includes an energy module supplying energy to the self-moving device and a battery mounting portion used to accommodate the energy module. The battery mounting portion includes a housing, an accommodating cavity defined by the housing, a support accommodated in the accommodating cavity, and a battery accommodating portion located in the accommodating cavity and used to accommodate a battery pack. A connection relationship between the housing and the support at least includes two different connection states. The battery accommodating portion has different volumes or sizes in the two different connection states.