The invention discloses a large-scale knowledge graph storage scheme based on a distributed key value library. A "KG over SQL" unified storage scheme or a "KG over KV" unified storage scheme is adopted; the unified storage scheme of "KG over SQL" comprises the following steps: reading knowledge graph data; extracting metadata in the mapping knowledge domain, and generating a corresponding SQL statement; extracting data in the knowledge graph, storing the data in a data structure, and generating a corresponding SQL statement; executing an SQL statement through an external SQL interface of the Cockroach DB database, and establishing a relation table; mapping the data in the relation table into a key value pair form by using an original data coding mapping scheme in a Cockroach DB database, and storing the data in a Cockroach DB bottom layer; By means of the "KG over KV" unified storage scheme, knowledge graph data are read, a knowledge graph is converted into a graph containing index nodes, index node graph data are stored in a data structure, and the data are mapped into a key value pair form through an optimized data coding mapping scheme and stored in a Cockroach DB bottom layer. According to the method, efficient data storage compatible with the RDF graph model and the attribute graph model can be realized.