11. A device, applied to query of graph data in a graph data whole set, wherein the graph data whole set comprises multiple vertices and an edge between every two vertices that have a connection relationship; partitioning and layering are performed on the multiple vertices in the graph data whole set; a number of a partition in which a vertex is located is used as a partition number of the vertex; a shortest distance between a vertex and a partition border of a partition in which the vertex is located is used as a layer number of the vertex; the device comprising: a memory configured to store instructions; and a processor coupled to the memory and configured to execute the instructions to: acquire a query condition, and a partition number and a layer number of a query vertex indicated by the query condition; determine, based on the partition number and the layer number of the query vertex, a partition number and a layer number of a candidate vertex indicated by the query condition, and use the partition number and the layer number of the candidate vertex respectively as a candidate partition number and a candidate layer number, wherein the candidate vertex is a vertex that needs to be queried according to the query condition; form a candidate set using a vertex whose partition number and layer number satisfy any group of a candidate partition number and a candidate layer number; and perform graph data query in the candidate set according to the query condition.
11. A device, applied to query of graph data in a graph data whole set, wherein the graph data whole set comprises multiple vertices and an edge between every two vertices that have a connection relationship; partitioning and layering are performed on the multiple vertices in the graph data whole set; a number of a partition in which a vertex is located is used as a partition number of the vertex; a shortest distance between a vertex and a partition border of a partition in which the vertex is located is used as a layer number of the vertex; the device comprising: a memory configured to store instructions; and a processor coupled to the memory and configured to execute the instructions to: acquire a query condition, and a partition number and a layer number of a query vertex indicated by the query condition; determine, based on the partition number and the layer number of the query vertex, a partition number and a layer number of a candidate vertex indicated by the query condition, and use the partition number and the layer number of the candidate vertex respectively as a candidate partition number and a candidate layer number, wherein the candidate vertex is a vertex that needs to be queried according to the query condition; form a candidate set using a vertex whose partition number and layer number satisfy any group of a candidate partition number and a candidate layer number; and perform graph data query in the candidate set according to the query condition. 20. The device according to claim 11 , wherein when the graph data in the graph data whole set is stored in a file system, partition numbers and layer numbers of the multiple vertices are stored in one file, graph data of vertices that have a same partition number and layer number are stored in one file, and graph data of vertices that have different partition numbers and layer numbers are stored in different files.