As a new type of porous crystalline composite material, MOF-COF has shown great advantages in metal separation. Herein, a CoMOF-COF was designed for highly selective separation of trace Pb2+ ions. The designed CoMOF-COF has a high density of nitrogen-oxygen functional groups and can selectively separate metal ions. There is a strong affinity between the designed CoMOF-COF material and metal Pb2+ ions, which can be attributed to the ordered heterogeneous porous structure and large amounts of nitrogen-and oxygen-containing functional groups. The composite showed high adsorption selectivity for Pb2+ ions and had adsorption capacity of 33 mg g-1, with high chemical stability. Based on this solid phase extraction material, a high sensitivity detection method for Pb2+ ions was established, which has the detection limit of 37.3 ng L-1, precision of 1.9 %. Linear detection range is 0.2-10 ng mL-1, and the detection of Pb2+ ions in actual water samples was realized. Through this study, it is proved that the strong affinity between the designed CoMOF-COF materials and metal Pb2+ ions can be attributed to the soft and hard acid-base theory, which reveals the structure-activity relationship between the porous heterostructure of such materials and metal separation, providing a highly selective separation material for the separation of other environmental pollutants.