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. 18. The device according to claim 11 , when acquiring the query condition, and the partition number and the layer number of the query vertex indicated by the query condition, the processor is configured to execute the instructions to: acquire the query condition; and when the query condition indicates that a shortest path between a first query vertex and a second query vertex needs to be queried, acquire a partition number and a layer number of the first query vertex and a partition number and a layer number of the second query vertex; and if the first query vertex and the second query vertex are located in a same partition, when determining the partition number and the layer number of the candidate vertex indicated by the query condition, the processor is configured to execute the instructions to: determine that the partition number of the candidate vertex is the partition number of the first query vertex and the second query vertex; and determine a layer number within a closed interval from the layer number of the first query vertex to the layer number of the second query vertex as the layer number of the candidate vertex; if the first query vertex and the second query vertex are located in different partitions, when determining the partition number and a layer number of a candidate vertex indicated by the query condition, the processor is configured to execute the instructions to: determine that the partition number of the candidate vertex is the partition number of the first query vertex and the partition number of the second query vertex; for a partition in which the first query vertex is located, determine a layer number within a closed interval from zero to the layer number of the first query vertex as the layer number that is of the candidate vertex and that belongs to a same group as the partition number of the first query vertex; and for a partition in which the second query vertex is located, determine a layer number within a closed interval from zero to the layer number of the second query vertex as the layer number that is of the candidate vertex and that belongs to a same group as the partition number of the second query vertex.