It may be due to the following reasons:
1. The charger or data cable is faulty or damaged;
2. The phone battery is aging or damaged;
3. There is a problem with the mobile phone system or an application occupies a lot of resources. The solution is to replace the charger or data cable, replace the battery, clean the memory of the phone or restart the phone. If the above methods are ineffective, it is recommended to go to a professional repair shop to test the cause.