A method for obtaining optical distribution network, ODN, logical topology information, wherein the method comprises: obtaining identification information of each first optical network unit, ONU, that is connected to a first passive optical network, PON, port and whose optical path changes and feature data of the first ONU in a first time window, wherein the feature data comprises at least one of a receive optical power and an alarm event, and the alarm event comprises an alarm generation time and an alarm type; obtaining, based on the feature data of each first ONU, a feature vector corresponding to the first ONU, wherein the feature vector corresponding to the first ONU comprises a feature of the first ONU that is used to indicate a change of the receive optical power in the first time window, and/or the alarm generation time and the alarm type that are of the first ONU; and performing cluster analysis on the feature vector corresponding to each first ONU, to obtain topology information corresponding to the first PON port, wherein the topology information comprises identification information of at least one group of first ONUs, and identification information of each group of first ONUs includes a cluster comprising numbers of the first ONUs in the group to indicate that the first ONUs in the group are connected to a same non-level-1 optical splitter; characterized in that the performing cluster analysis on the feature vector corresponding to each first ONU, to obtain topology information corresponding to the first PON port comprises: obtaining, based on the feature vector corresponding to each first ONU, a similarity matrix between feature vectors corresponding to any two first ONUs; and using all similarity matrices as input of an affinity propagation clustering algorithm, to obtain the topology information corresponding to the first PON port. obtaining identification information of each first optical network unit, ONU, that is connected to a first passive optical network, PON, port and whose optical path changes and feature data of the first ONU in a first time window, wherein the feature data comprises at least one of a receive optical power and an alarm event, and the alarm event comprises an alarm generation time and an alarm type; obtaining, based on the feature data of each first ONU, a feature vector corresponding to the first ONU, wherein the feature vector corresponding to the first ONU comprises a feature of the first ONU that is used to indicate a change of the receive optical power in the first time window, and/or the alarm generation time and the alarm type that are of the first ONU; and performing cluster analysis on the feature vector corresponding to each first ONU, to obtain topology information corresponding to the first PON port, wherein the topology information comprises identification information of at least one group of first ONUs, and identification information of each group of first ONUs includes a cluster comprising numbers of the first ONUs in the group to indicate that the first ONUs in the group are connected to a same non-level-1 optical splitter; characterized in that the performing cluster analysis on the feature vector corresponding to each first ONU, to obtain topology information corresponding to the first PON port comprises: obtaining, based on the feature vector corresponding to each first ONU, a similarity matrix between feature vectors corresponding to any two first ONUs; and using all similarity matrices as input of an affinity propagation clustering algorithm, to obtain the topology information corresponding to the first PON port. obtaining, based on the feature vector corresponding to each first ONU, a similarity matrix between feature vectors corresponding to any two first ONUs; and using all similarity matrices as input of an affinity propagation clustering algorithm, to obtain the topology information corresponding to the first PON port.