The integration of distribution generators (DG) can bring the influences to the distribution network’s voltage, power flow and loss. In order to enhance the system’s profit, the optimal allocation for DGs is studied. Bi-level optimal allocation model that is for DGs and combined planning and working was established. Basing on aiming at maximizing the integrated social income or power company income in lower level, upper level optimize the integration position and capacity of DGs in order to minimize the annual total cost. As for the randomness of DG output, a method of scenario generation of DG output was raised, which was based on the kernel density estimation and K-means cluster. Taking photovoltaic and gas turbine as an example, calculation and analysis based on typical 10kV distribution network was provided, which verified the validity of the model.