The invention provides a distributed storage method based on
source code semantic partitioning, and particularly relates to the technical field of
cloud data distributed storage. The method comprises the steps of performing semantic partitioning on a
source code, and segmenting the
source code into a plurality of semantic blocks according to dimensions such as
functional semantics, an
abstract syntax tree structure, author information and version information; generating
metadata containing information such as grammar type tags, file paths, line number ranges, author identifiers, version identifiers and access popularity for each semantic block; constructing a weighted
directed acyclic graph (DAG) based on the semantic chunks and the dependency relationship thereof; superposing a
metadata layer in the DAG structure, and recording information such as function call dependency, inter-block reference relationship and version evolution chain; blocks with relatively high
access frequency and close
semantics are aggregated into super blocks, the traversal depth is reduced, and meanwhile, hot data and cold data are differentiated for hierarchical storage by adopting a cold and hot
data management strategy; and evaluating a parent block aggregation degree through a BDS
algorithm, determining a
block sorting priority, and optimizing super block boundary division. Compared with the prior art, the method has the advantages that the semantic retrieval efficiency, the incremental updating capability and the distributed query performance of the source code storage
system are improved.