The invention discloses a network flow measurement
algorithm based on sampling. The method comprises the following steps: (1) reasonably configuring parameters of a Counting
Bloom Filter structure; (2) judging whether the network flow of an arrival data packet is new flow by using the Counting
Bloom Filter structure; (3) if the arrival data packet is judged as the new flow, inserting the new flow into the Counting
Bloom Filter, adding 1 to a flow counter, calculating an error probability P of the number of the inserted flow, adjusting the sampling frequency (the formula is as shown in the specification) at the same time, wherein f is the sampling frequency of the entire
algorithm, perform random sampling on the new flow according to the adjusted frequency, continuing to process the next packet, repeating the step (2) to continue the circulation; and (4) if it is judged that no new flow arrives, continuing to process the next packet, and repeating the step (2) to continue the circulation. By adoption of the network flow measurement
algorithm based on sampling,
equal probability sampling of the network flow is realized, the network flow data can be reduced, the feature information of the network flow data can be maintained, and the storage resources of the
system are saved.