A network flow information collection method, comprising: receiving, by a switching device, a data packet; generating, by the switching device, a network flow identifier of the data packet according to all flow entries that match the data packet when the data packet passes from an ingress port to an egress port in the switching device; and updating, by the switching device, network flow information corresponding to the network flow identifier; wherein the generating, by the switching device, a network flow identifier of the data packet according to all flow entries that match the data packet when the data packet passes from an ingress port to an egress port in the switching device comprises: obtaining, by the switching device, identifiers of all the flow entries that match the data packet when the data packet passes from the ingress port to the egress port in the switching device; and generating, by the switching device, the network flow identifier of the data packet according to the identifiers of all the flow entries that match the data packet when the data packet passes from the ingress port to the egress port in the switching device; wherein the generating, by the switching device, the network flow identifier of the data packet according to the identifiers of all the flow entries that match the data packet when the data packet passes from the ingress port to the egress port in the switching device comprises: sequentially arranging, by the switching device, the identifiers of all the flow entries that match the data packet when the data packet passes from the ingress port to the egress port in the switching device, to generate the network flow identifier of the data packet. receiving, by a switching device, a data packet; generating, by the switching device, a network flow identifier of the data packet according to all flow entries that match the data packet when the data packet passes from an ingress port to an egress port in the switching device; and updating, by the switching device, network flow information corresponding to the network flow identifier; wherein the generating, by the switching device, a network flow identifier of the data packet according to all flow entries that match the data packet when the data packet passes from an ingress port to an egress port in the switching device comprises: obtaining, by the switching device, identifiers of all the flow entries that match the data packet when the data packet passes from the ingress port to the egress port in the switching device; and generating, by the switching device, the network flow identifier of the data packet according to the identifiers of all the flow entries that match the data packet when the data packet passes from the ingress port to the egress port in the switching device; wherein the generating, by the switching device, the network flow identifier of the data packet according to the identifiers of all the flow entries that match the data packet when the data packet passes from the ingress port to the egress port in the switching device comprises: sequentially arranging, by the switching device, the identifiers of all the flow entries that match the data packet when the data packet passes from the ingress port to the egress port in the switching device, to generate the network flow identifier of the data packet. obtaining, by the switching device, identifiers of all the flow entries that match the data packet when the data packet passes from the ingress port to the egress port in the switching device; and generating, by the switching device, the network flow identifier of the data packet according to the identifiers of all the flow entries that match the data packet when the data packet passes from the ingress port to the egress port in the switching device; wherein the generating, by the switching device, the network flow identifier of the data packet according to the identifiers of all the flow entries that match the data packet when the data packet passes from the ingress port to the egress port in the switching device comprises: sequentially arranging, by the switching device, the identifiers of all the flow entries that match the data packet when the data packet passes from the ingress port to the egress port in the switching device, to generate the network flow identifier of the data packet.