The invention discloses a three-dimensional imaging sonar point cloud underwater terrain matching and positioning method and system, and the method comprises the steps: S1, carrying out the sampling of online collected sonar point cloud frames, enabling the number of points to reach N, and cutting a pre-stored large-range sonar point cloud map into a point cloud X with N points; s2, enabling L randomly generated transformation matrixes {T1,..., TL} and TL < SE (3) to act on the point cloud X = [X0,..., XN] < R3 * N, and obtaining L pairs of data to train a key point extraction network; s3, a plurality of neighborhood points of each key point are selected, feature extraction is carried out on the neighborhood points, and features are extracted from a pre-stored sonar point cloud topographic map and a sonar point cloud topographic map collected online according to the neighborhood range of each key point; s4, calculating the matching cost between the real-time point cloud frame and the map according to the key points; s5, calculating the position offset of the sonar point cloud frame and the map under prediction in real time according to the matching cost; and S6, defining the loss according to the square of the distance between the predicted position offset and the ground real value. The matching effect can be improved, errors are reduced, and positioning is accurate.