The invention provides an SLAM system based on data association and error detection and a method for constructing data association, wherein the system comprises a frontend module and a key frame database. The process for constructing data association by the frontend module comprises the steps of S100, receiving a common frame and a predicated pose Tpredict of the common frame; S200, searching n candidate frames which are similar with the common frame from a key frame database, and classifying the n candidate frames to a global candidate frame set and a local candidate frame set; S300, calculating a pose transform relation Tpc between each candidate frame and the common frame, and using Tpc as an association result; S400, performing error testing on the association result according to classification of the candidate frame for filtering error association results; S500, determining whether a correct association result is generated after S400, and if yes, returning for executing the S100,and otherwise, executing S600; and S600, creating a new key frame according to the historical common frame in a temporary region, the predicated pose, the common frame and the predicated pose thereof.