Optimal power flow is a nonlinear optimization problem, which is featured with complexity and cumbersome, high dimensionality, many constraints and many variables. Applying it to active distribution networks is also a hot research topic. This paper firstly establishes the optimal power flow model of the active distribution network to minimize the active loss; secondly, considering the controllable unit and switch state of the distribution network, the improved radial constraints and power flow constraints are adopted to transform, and it becomes a second-order cone constraint after reasonable relaxation, and the mixed integer second-order cone programming model is established. The Yalmip toolkit was used for modeling, and the Gurobi commercial algorithm package was used to solve and calculate it. Finally, the calculation results of the particle swarm optimization algorithm and the mixed integer second-order cone programming method are compared and analyzed through an example. It is proved that the mixed integer second-order cone method is more suitable for active distribution networks, and the efficiency and stability of the proposed method are verified.