The invention discloses a flow sampling method and device and
electronic equipment, and relates to the technical field of communication, and the method comprises the steps: when an
assembly line entrance of an ASIC switching
chip receives a service message, determining the
message type of the service message based on an
access control list (ACL), and storing the
message type in a
system header; and then, in response to the fact that the service message arrives at an
assembly line outlet of the ASIC switching
chip, identifying a
system header based on the ACL, determining a
message type of the service message, and performing
traffic sampling on the service message in the message header according to a sampling rule set based on the message type. According to the method, the message type of the service message is extracted and stored in the
system header in advance at an
assembly line inlet, the system header is packaged on the outermost layer of the service message, the storage space of an ASIC switching
chip is prevented from being occupied, the system header is directly matched through an ACL, so that the message type of the service message is determined, and flow sampling is carried out through a corresponding sampling rule.