The invention belongs to the technical field of power control and discloses an off-grid and grid-connected integrated power supply control method and system. The off-grid and grid-connected integratedpower supply control system comprises an electric energy acquisition module, a diesel power generation acquisition module, a wind power generation acquisition module, a photovoltaic power generationacquisition module, an electromagnetic switch control module, a central processing module, a wireless communication module, a remote terminal, a power generation module, a signal conversion module, anenergy management module and an electric quantity data analysis module. According to the invention, the integrated operation of the internal power supply and the load can be realized, and the requirements of users on distributed power supply access, electric energy quality, power supply reliability and safety are met. According to the invention, efficient conversion of each input energy source can be carried out on the premise of keeping the stability of the power grid, the intelligent distributed control management system can also ensure that renewable energy sources are used preferentiallyand efficiently, the consumption of fuel is reduced to the greatest extent, and stable, safe and reliable operation and energy supply of the whole system are ensured.