With a large number of distributed photovoltaic resources and multiple types of loads entering the distribution network, the increase in network losses and voltage fluctuations are two important issues. In response to this issue, this paper proposes an active and reactive power collaborative optimization strategy for active distribution networks that considers loss reduction and voltage regulation. Firstly, an improved K-means clustering algorithm based on the maximum minimum distance criterion is used to effectively cluster the output scenarios of photovoltaic power generation, reducing the number of scenarios. Secondly, the impact of different data attributes of power generation equipment on the operation of the power system is analyzed to optimize the assessment of active power loss in the distribution network. Finally, considering the collaborative control of various controllable distributed resources, establish an active and reactive power collaborative optimization model, and cooperate with on load tap changer to reduce network losses while maintaining voltage levels. The effectiveness of the proposed strategy is verified by an example on an improved IEEE-33 distribution network.