The invention discloses a two-stage active instant positioning and mapping algorithm based on graph topology. The algorithm is divided into a global stage and a local stage. The method comprises the following steps: firstly, acquiring a current pose, a pose map and a navigation map of an unmanned platform by an algorithm, and calculating local leading edge points and candidate loopback points; if the points exist, entering a local exploration stage, constructing a local topological graph through a fast random spanning tree algorithm, solving a shortest path to any vertex of the local topological graph by using a Dijkstra algorithm, scoring a path set according to a local exploration and active loopback joint objective function, solving an optimal path, and finally obtaining the optimal path. And updating the global topological graph and the global frontier points according to the local topological graph and the local frontier points. On the contrary, when no local leading edge point exists in the local range and no loopback requirement exists, the algorithm enters a global exploration stage, the unmanned platform goes to the unexplored area to conduct local exploration again according to the global topological graph, and after exploration of the designated area is completed, the unmanned platform returns to the starting point, and the exploration task is completed.